Crate split: layer the engine crate (helpers down, adapters up, seams 1-3)
AF
2d ago+22794+22794+01234567890123456789012345678901234567890123456789-19904-19904-01234567890123456789012345678901234567890123456789
Crate split, steps 2 and 4 (seams 1-3): the single agent-file-tools crate is reorganized into layers so it can later be cut into separate crates. No behaviour changes.
- Shared helpers and types move down to the lowest layer that uses them (path identity, progress reporting, storage paths, task types, gh-shim constants, inspect categories); tool adapters move up out of the index layer.
- The shell command parser is its own shell-layer module (
bash_parse), so permission and policy code no longer depends on the rewrite layer. - Seam 1: the index layer reads the runtime through a narrow
IndexHostandReadPolicyinstead ofAppContext; parent-folder search adapters that own a context move toparent_search. - Seam 2: a narrow
ToolLauncherinterface replaces the formatter's dependency on the sandbox spawner. - Seam 3: dead-code fact helpers and TODO marker parsing move into the parser layer. Stored index records stay byte-identical (golden test), so no repository re-indexes.
Upward imports inside the crate: 151 edges / 629 references before, 95 / 272 now. The branch is rebased on main after #1426; conflicts with the loading-repository search and the first-search wait kept main's behaviour at the moved paths.
Summary by cubic
Reorganizes the agent-file-tools crate into layers so it can later be split into separate crates (seams 1-9), with no behavior changes. Shared helpers and types move down to the lowest layer that uses them, tool adapters move up, and narrow host interfaces plus runtime hook tables replace direct AppContext reads and upward calls.
- The shell command parser is its own
bash_parsemodule; permission and policy code no longer depends on the rewrite layer. - Search request, candidate, memo and reranker state move to
search_statewith compatibility re-exports; parent-folder search adapters that own a context move toparent_search. - Shell rewrite targets, configure-maintenance continuations, shell frame bodies, and daemon services register through runtime hook tables instead of calling commands directly; database retries refuse unregistered hook claims.
- Shell snapshots are cached structurally and rendered at reply consumers through shared stateless format primitives; watch eviction state sits beside cursor state below route delivery.
- Remote policy rows, speech authority, effect and plumbing classification, and task environment recognition move beside their database rows or tool names.
- Stored index records stay byte-identical (golden test), so no repository re-indexes.
- Upward imports inside the crate drop from 151 edges / 629 references to 95 / 272.