IT1 (#210): tool-descriptor axis on the kernel ActionCatalog + failing completeness gate test - #237
Conversation
…ss gate test IT1 for spec #209 (capability-derived tool catalogs). Adds a kernel-owned, per-action ToolDescriptor (name, description, parameter JSON Schema, and approval_required/selection_token_required presentation flags) and a tool_descriptors map on ActionCatalog, mirroring the egress_declarations axis (builder with_tool_descriptors + accessor tool_descriptor_for + count). Catalog-metadata value types split into action/catalog_metadata.rs to keep action.rs under the 500-line cap; public paths preserved via pub use. Populates one curated descriptor per currently-dispatchable action id (15) in a new kernel sibling action_catalog_tool_descriptors.rs, wired into canonical_catalog(). Adds a fail-closed completeness gate test that panics when a dispatchable action lacks a descriptor, pins the descriptor count, and asserts selection_token_required mirrors the catalog. No change to compose(), gate(), TaskViewBody, or the shell. Closes #210
|
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: 21 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 selected for processing (6)
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 & why
IT1 for spec #209 (capability-derived tool catalogs; Immune-system lane; promises Immune system + Permissions; users Bell, Lyra). This lands the kernel-owned tool-descriptor axis the later projection (IT2) and wire seam (IT3) will consume — nothing shell-spoofable, nothing carried on the
TaskGrant.ToolDescriptor(crates/openspine-schemas/src/action): LLM-facingname, one-linedescription, parameter JSON Schema (serde_json::Value), and presentation flagsapproval_required/selection_token_required. DerivesPartialEq/Serialize/Deserializewith#[serde(deny_unknown_fields)]and a manualimpl EqsoActionCatalogkeeps its derivedEq.ActionCatalogaxis:tool_descriptorsmap +with_tool_descriptorsbuilder +tool_descriptor_foraccessor (+tool_descriptor_count), mirroringegress_declarationsexactly.ActionHandlerRegistry::default_registrations()ids) in a new kernel siblingaction_catalog_tool_descriptors.rs, wired intocanonical_catalog(). The intentionally-unwired PRD ids get none.selection_token_requiredmirrorsrequires_selection_token(id).is_some(). Demonstrated: removing a descriptor makes the test fail withdispatchable action <id> lacks a tool descriptor.approval_requiredis a curated presentation flag by reviewed judgment (spec #209 design choice 3):trueonly forworker.commission(mints a delegated grant) andopenspine.overlay.restore(mutates the live governed set); all othersfalse.No change to
compose(),gate()decision logic,TaskViewBody, or the shell.Deviation
ActionEgressDeclarationwas moved into a new siblingaction/catalog_metadata.rsalongsideToolDescriptor:action.rswas at 499/500 lines and the cap left no room. Preferred a split over theallow-large-modulehatch (per AGENTS.md); both are per-action catalog-metadata value types, so they group naturally. All public paths (openspine_schemas::action::ActionEgressDeclaration) preserved viapub use— no caller changes.Verification
cargo test -p openspine-schemas -p openspine-kernelgreen.scripts/check.shgreen (fmt, clippy -D warnings, workspace tests + shell E2E, file-size cap, claims, omp ceremony, openspec validate --all --strict: 45/45).Implementation-notes summary
ToolDescriptortype +tool_descriptorsaxis onActionCatalog(builder + accessor + count), mirroringegress_declarations.action/catalog_metadata.rsto stay under the 500-line cap; all public paths preserved viapub use.action_catalog_tool_descriptors.rs, wired intocanonical_catalog().cargo test -p openspine-schemas -p openspine-kernelandscripts/check.shboth green; no change tocompose(),gate(),TaskViewBody, or the shell.Closes #210
Summary by cubic
Adds a kernel-owned
ToolDescriptoraxis to theActionCatalogand wires curated descriptors for all 15 dispatchable actions. This enables the capability‑derived tool catalog from spec #209 and fail‑closes missing or inconsistent descriptors without changing runtime behavior.ToolDescriptorinopenspine-schemas::action::catalog_metadata(name, description,parameters_schema,approval_required,selection_token_required,#[serde(deny_unknown_fields)]), plusActionCatalogsupport (tool_descriptorsmap,with_tool_descriptors,tool_descriptor_for,tool_descriptor_count).openspine-kernel/src/action_catalog_tool_descriptors.rsfor the 15 currently dispatchable IDs, integrated viacanonical_catalog();approval_required = trueonly forworker.commissionandopenspine.overlay.restore.selection_token_requireddrifts fromrequires_selection_token, or if the descriptor count differs from 15.ActionEgressDeclarationintoopenspine-schemas::action::catalog_metadata; re‑export preservesopenspine_schemas::action::ActionEgressDeclarationfor callers.action_catalog_tool_descriptors.rsand update the pinned count in the test. No changes tocompose(), gate decisions,TaskViewBody, or the shell.Written for commit 0233a70. Summary will update on new commits.