feat: build daemon command registry from descriptors, delete the hand table — Phase 1 step 2#907
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
Current blocker: Layering Guard is failing, and the failure is real rather than flaky. The job reports two forbidden daemon-to-commands imports in
This is the same architecture issue from #906: if the descriptor registry is meant to become a root consumed by daemon, it cannot live in the current |
|
Good catch — addressing the layering decision before going further, taking option 1. I'm relocating the shared descriptor registry + projections out of
Relocating across the stack (#906 → #907 → #908), re-running the Layering Guard ( |
97b88ff to
0acefbf
Compare
95ce046 to
271b173
Compare
|
Both blockers addressed. Layering fix: relocated the descriptor registry to iOS smoke (booted iPhone 17 Pro, source build of the #908 tip — the genuinely behavior-relevant checkpoint since the daemon registry + capability matrix now derive at runtime):
No regression — the derived |
… table — Phase 1 step 2
271b173 to
b0368aa
Compare
|
What
Phase 1 step 2 of the command-descriptor migration (ADR-0008), stacked on #906 (
feat/command-descriptor-registry).The daemon command registry now builds from the derived descriptors instead of a hand-authored literal:
src/daemon/daemon-command-registry.ts— replaced theDAEMON_COMMAND_DESCRIPTORSarray literal (plus its privatedescriptor/descriptorsbuilders and theisRecordingStartRequest/isShardedTestRequestclosures, now living indescriptor/registry.ts) with:DaemonCommandDescriptortype, the predicate accessors, andbuildDaemonCommandRegistryare unchanged and consumeDAEMON_COMMAND_DESCRIPTORSas before.src/commands/descriptor/__tests__/parity.test.ts— the slice-1 DAEMON parity assertion would now be a tautology (derived-vs-derived), so it was replaced with an invariant assertion: no duplicate command names, every descriptor has a route, and the derived command set still covers every public command (minus the two intentionally unroutedapp-switcher/install-from-source). The capability-matrix and batch-name parity tests are kept as-is (those hand tables still exist for later slices).Behaviorless
The daemon registry's routes + request-policy traits are identical — #906's parity test proved
deriveDaemonCommandDescriptors(commandDescriptors)is byte-equal to the deleted literal. No predicate accessor or consumer changed.Cycle check
No runtime import cycle:
daemon-command-registry.ts(value) →descriptor/derive.ts+descriptor/registry.ts(values); the back-edges fromderive.tsanddescriptor/types.tsto this module'sDaemonCommandDescriptorare type-only imports, erased at runtime.tsc --noEmitis clean (exit 0) and a runtimeimport()of the module loads cleanly (57 descriptors).Verification
tsc -p tsconfig.json --noEmit: exit 0oxfmt --write+oxlint --deny-warningson changed files: exit 0vitest run daemon: 94 files, 902 tests passedvitest run commands/descriptor: 1 file, 5 tests passedStacked on #906 — merge that first.