IT2: pure capability-derived catalog projection (TaskGrant -> CatalogView) - #242
Conversation
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
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
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. Comment |
What
Adds
project_catalog(&TaskGrant, &ActionCatalog) -> CatalogView, a pure, deterministic pre-inference projection inopenspine-authority, besidecompose. This is IT2 of the Immune-system "capability-derived tool catalogs" lane (spec #209). It builds directly on #210 (merged):ToolDescriptor+ thetool_descriptorsmap /tool_descriptor_forlookup onActionCatalog.New public surface:
project_catalog(grant, catalog) -> CatalogViewCatalogView(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->Callableapproval_required_actions->RequiresOwnerApproval(proposable; the existing approval/gate flow handles the pause)denied_actionsand 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-authoritydepends only onopenspine-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. Fullscripts/check.shpasses (45/45 spec items, fmt, clippy-D warnings, workspace tests, file-size + claims gates).Notes (implementation-notes.md summary)
project_catalog(&TaskGrant, &ActionCatalog) -> CatalogViewinopenspine-authority, besidecompose.gate()stays sole enforcement.tests/common/projection.rs).Deviations worth a look
CatalogEntrycarriesaction_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.serde_jsonadded as a dev-dependency only for test fixtures.Closes #211
Summary by cubic
Adds a pure pre-inference projection
project_catalog(&TaskGrant, &ActionCatalog) -> CatalogViewinopenspine-authorityso workers see exactly the tools granted by a composedTaskGrant. Denied and ungranted actions are now structurally absent; allowed actions are callable and approval-required actions are flagged.project_catalog,CatalogView,CatalogEntry { action_id, descriptor, status },CatalogEntryStatus { Callable, RequiresOwnerApproval }.openspine-authoritydepends only onopenspine-schemas).allowed_actionsin grant order, then allapproval_required_actionsin grant order.CatalogEntryincludesaction_idso workers can invoke without a second lookup; can be removed later if not needed.serde_jsonadded 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.