refactor: migrate command families to facets#854
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
Reviewer pass is clean: no actionable findings. Merge-ready from my side. The isolated review checked the PR metadata, all green checks, CONTEXT.md, ADR 0003, and the management command route through family facets -> CLI schema/reader -> daemon projection -> existing daemon routing/output formatting. The split preserves the public management command order, keeps install-from-source projected to internal install_source, leaves daemon routing unchanged, and retains the prior output formatter behavior. Residual risk is low: this is a structural command-surface refactor with no daemon/runtime files changed, so CI parser/metadata/integration coverage is appropriate and I did not require a fresh manual device run. |
c3474ea to
233cb09
Compare
|
The earlier merge-ready note applied to the previous management-only head. This new head broadens the PR to all command families, so I’m treating it as needing a fresh review once CI finishes. Current status: mergeable but UNSTABLE, with most checks still pending. |
|
Fresh reviewer pass on the expanded head is clean: no actionable findings. Merge-ready from my side for bc4d9c7. CI is green, including Unit Tests, Integration Tests, Smoke Tests, Typecheck, Lint & Format, Fallow, Coverage, CodeQL, Layering Guard, and Bundle Size. The isolated review traced the command-family facet migration through registry aggregation, CLI schema/readers, daemon projection, CLI output formatting, and existing daemon routing. It also compared base vs head registry outputs: metadata order, CLI schema keys/readers, daemon writer keys, output formatter keys, schema JSON, representative daemon projections, and representative CLI readers all matched. Gesture alias writers were preserved. Residual risk is low: this is a structural command-surface/test-isolation refactor with no daemon router/runtime behavior changes, so I did not require live device verification. |
Summary
Migrates every command family to command-level facets, with no remaining exported raw family constructor path. The command surface now composes metadata, executable definition, CLI schema/reader, daemon projection, and output formatting from per-command facets across all families.
Before/after: management/index.ts drops from 463 LOC to a 21 LOC composer; every exported command family now uses defineCommandFamilyFromFacets; the old defineCommandFamily helper was removed. Gesture typed-client projection aliases are preserved through explicit extraDaemonWriters, with duplicate writer-key protection covered by a regression test.
Second-order cleanup included removing the stale family constructor/cast path and making Android .aab bundletool tests hermetic so local unit checks do not depend on a developer machine bundletool in PATH.
Touched files: 21. Scope expanded from management to all command families plus one Android test isolation fix.
Note: requested external
claude -preview was blocked by execution policy because it would send private repository context to an external service. I performed a local critical pass instead and addressed the actionable duplicate-writer overwrite risk it found.Validation
Verified with
pnpm format,pnpm check:quick, focused command-surface/CLI/gesture tests,pnpm test:integration:progress:check,pnpm check:fallow --base origin/main, focused Android bundletool tests, and escalatedpnpm check:unit. The full unit/smoke run passed after the final cleanup: 270 unit files / 2611 tests and smoke tests passed, with the live web smoke intentionally skipped by env guard.