Define stock tools in one descriptor catalog

Merged
VA
3d ago
+455-246

Problem

Builtin registration, command definitions, file-tool definitions and hook aliases had separate lists. Help and policy consumers could drift from the schemas actually bound to a task.

Design

Export tools::catalog() as borrowed ToolSpec data: identifier, revision, description, required binding, hook aliases and typed schema/implementation factories. Generate model definitions and help from that data; derive call grants and bind each selected implementation once. Registration and grants still share one availability decision. The standalone file constructors use these same entries, including reference projections.

Move task-bound workspace delegation into workspace_executor.rs, leaving defaults.rs responsible only for registration. Hook routing tests now use the real builtin catalog.

Deletions

Remove string-based builtin dispatch, separate read/write/edit descriptors and the hook tests' copied builtin aliases. Net +209 lines (+455/-246), including pinned-contract and shrinking registration properties plus approval-routing coverage.

Decisions

The catalog is immutable compiled data with typed function references; the active ToolRegistry remains the sole installation. No task store or wire message is added. Existing ToolPolicy and hook handling retain approval ownership: defaults ask for no approval, configured policy/approval hooks still receive the catalog's exact identifiers and aliases, and filesystem access stays with acyclic-fs.

Preserve the default set, revisions, file schemas and digests. Custom tools remain additive; without_default_tools() still opts out. Instantiate only descriptors whose required task binding and scope permit registration.

Tests

One bb1 build, then direct test-binary execution, all passed:

SuitePassedWall
default_tools (including golden definitions/digests and 64-case shrinking catalog property)170.065 s
Hook identifier/alias and approval routing20.010 s
File authorization20.012 s
File projections and contracts30.016 s
Stock LocalHarness bash/fs scenario, scripted provider11.648 s

Windows: lb.ps1 cargo check -p acyclic-harness --lib --tests --features filesystem-local,native-execution,objects passed in 2m18s. git diff --cached --check passed.

No parser or synchronization algorithm changes; existing parser and concurrency verification paths are unchanged.


Summary by cubic

Defines all stock tools (bash, fs, read, write, edit) in one immutable catalog so registration, model contracts, help text, call grants, and approval hooks always share the same definitions, revisions, and identifiers.

Refactors

  • Replaces string-based builtin dispatch and separate read/write/edit descriptors with typed ToolSpec entries that bind implementations only when selected.
  • Moves task-bound workspace delegation into workspace_executor.rs; defaults.rs now only handles registration.
  • Hook routing tests now exercise the real builtin catalog instead of copied aliases.
  • Preserves the default tool set, revisions, file schemas, and digests; custom tools remain additive and without_default_tools() still opts out.