Skip to content

IT2: pure capability-derived catalog projection (TaskGrant -> CatalogView) - #242

Merged
George-RD merged 1 commit into
mainfrom
George-RD/dev-211
Aug 21, 2026
Merged

George-RD merged 1 commit into
mainfrom
George-RD/dev-211

Conversation

@George-RD

@George-RD George-RD commented Aug 21, 2026

Copy link
Copy Markdown
Owner

What

Adds project_catalog(&TaskGrant, &ActionCatalog) -> CatalogView, a pure, deterministic pre-inference projection in openspine-authority, beside compose. This is IT2 of the Immune-system "capability-derived tool catalogs" lane (spec #209). It builds directly on #210 (merged): ToolDescriptor + the tool_descriptors map / tool_descriptor_for lookup on ActionCatalog.

New public surface:

  • project_catalog(grant, catalog) -> CatalogView
  • CatalogView (ordered, grant-derived), CatalogEntry { action_id, descriptor, status }, CatalogEntryStatus { Callable, RequiresOwnerApproval }

Why

Per spec #209 the worker must receive, before inference, exactly the tools the composed grant carried — and nothing for any action it did not. The three-list rule (D4):

  • allowed_actions -> Callable
  • approval_required_actions -> RequiresOwnerApproval (proposable; the existing approval/gate flow handles the pause)
  • denied_actions and any ungranted action -> structurally absent (no name, no description, no schema)

Structural absence is attenuation; gate() is the sole enforcement. The projection is policy-free (D5): it reads only its two arguments, makes no second authority decision, performs no I/O, and holds no state. A granted id lacking a catalog descriptor is omitted (D3 — a capability gap the kernel's completeness gate test catches, not a security hole). The crate trust boundary is preserved: openspine-authority depends only on openspine-schemas, never on the kernel.

Tests

Six integration tests in tests/project_catalog.rs: three-list rule, grant-order, missing-descriptor omission, the I2 structural-absence invariant (asserted positively), policy-free purity, and the empty-grant (no error channel) case. Full scripts/check.sh passes (45/45 spec items, fmt, clippy -D warnings, workspace tests, file-size + claims gates).

Notes (implementation-notes.md summary)

  • Added project_catalog(&TaskGrant, &ActionCatalog) -> CatalogView in openspine-authority, beside compose.
  • Implements the spec Spec: capability-derived tool catalogs #209 three-list rule; a granted id with no descriptor is omitted.
  • Policy-free and I/O-free: reads only its two arguments, makes no second authority decision; absence is attenuation, gate() stays sole enforcement.
  • Six integration tests cover the three-list rule, grant-order, omission, I2 structural-absence, purity, and empty-grant; full gate passes (45/45).
  • Respects the trust boundary (authority -> schemas only) and the 500-line file cap (fixtures split into tests/common/projection.rs).

Deviations worth a look

  • CatalogEntry carries action_id (beyond the drafted plan) so IT3's wire seam / a worker can invoke the tool without a second lookup; the descriptor itself deliberately has no id. Easy to drop.
  • Projection types have no serde derives (authority has no serde dep; ticket said add no new crate dependency). IT3 (kernel side) owns wire serialization. serde_json added as a dev-dependency only for test fixtures.

Closes #211


Summary by cubic

Adds a pure pre-inference projection project_catalog(&TaskGrant, &ActionCatalog) -> CatalogView in openspine-authority so workers see exactly the tools granted by a composed TaskGrant. Denied and ungranted actions are now structurally absent; allowed actions are callable and approval-required actions are flagged.

  • Public API: project_catalog, CatalogView, CatalogEntry { action_id, descriptor, status }, CatalogEntryStatus { Callable, RequiresOwnerApproval }.
  • Behavior: allowed -> Callable; approval-required -> RequiresOwnerApproval; denied/ungranted -> absent; granted ids without a descriptor are omitted.
  • Deterministic and policy-free: reads only its arguments, no I/O or state; preserves the trust boundary (openspine-authority depends only on openspine-schemas).
  • Ordering: all allowed_actions in grant order, then all approval_required_actions in grant order.
  • Deviation to review: CatalogEntry includes action_id so workers can invoke without a second lookup; can be removed later if not needed.
  • No serialization on projection types; serde_json added as a dev-dependency for tests only. Integration tests cover the three-list rule, ordering, omission, purity, and empty-grant cases.

Written for commit 7ae65e5. Summary will update on new commits.

Review in cubic

Add project_catalog(&TaskGrant, &ActionCatalog) -> CatalogView in
openspine-authority, beside compose. Implements the spec #209 three-list
rule (allowed -> Callable, approval-required -> RequiresOwnerApproval,
denied/ungranted -> structurally absent; missing descriptor -> omitted).

Policy-free and I/O-free: reads only its two arguments and makes no second
authority decision. Structural absence is attenuation; gate() stays sole
enforcement. Trust boundary held (authority depends only on schemas).

Closes #211
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@George-RD, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eef670f6-71af-4cd6-9888-f4992cea9196

📥 Commits

Reviewing files that changed from the base of the PR and between eab8584 and 7ae65e5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • crates/openspine-authority/Cargo.toml
  • crates/openspine-authority/src/lib.rs
  • crates/openspine-authority/src/project_catalog.rs
  • crates/openspine-authority/tests/common/mod.rs
  • crates/openspine-authority/tests/common/projection.rs
  • crates/openspine-authority/tests/compose.rs
  • crates/openspine-authority/tests/project_catalog.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@George-RD
George-RD merged commit 2d22c15 into main Aug 21, 2026
3 checks passed
@George-RD
George-RD deleted the George-RD/dev-211 branch August 21, 2026 03:18
George-RD added a commit that referenced this pull request Aug 21, 2026
…) (#246)

ProvenanceLabelAllowlist caveat (AD-060 discipline, dormant on owner grant) + fixes the #245/#242 cross-merge build breaker in authority test fixture. Closes #226.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IT2: pure catalog projection in openspine-authority (TaskGrant -> CatalogView)

1 participant