Tracking issue for the internal code-quality review of internal/cli and the core model (internal/source, internal/adapter, internal/state, internal/render boundaries).
Overall verdict from the review: the interface hardening (secret fencing, Resolved/Canonical type split, guard tests, fail-closed defaults) is in excellent shape. The implementation behind it has one systemic weakness: domain logic accreting in internal/cli as hand-rolled, duplicated walks over under-modeled data — stringly state keys, sniffed FileOps, parallel structs for single artifacts — held together by comments and pinning tests where types and shared functions should be.
Each fix is a sub-issue below. The first six are in the review's priority order (highest leverage first); the remaining ones cover a verified latent bug and consolidation work the review also surfaced.
- Typed state keys in
internal/state
- Unify
[secrets] validation (live check/doctor disagreement)
- Shared plan→drift-classification walk for status/diff/reconcile/explain
FileOp modeling: typed Action + explicit cleanup-op kind
- Route plugin upgrade re-apply through the real apply pipeline
- Restructure
reconcileRun into a session type
- Bug:
addMarketplaceSource swallows cache-rename failure
- Unify
pluginTOMLSpec with source.PluginSpec
- CLI duplication & boundary cleanup batch
Tracking issue for the internal code-quality review of
internal/cliand the core model (internal/source,internal/adapter,internal/state,internal/renderboundaries).Overall verdict from the review: the interface hardening (secret fencing,
Resolved/Canonicaltype split, guard tests, fail-closed defaults) is in excellent shape. The implementation behind it has one systemic weakness: domain logic accreting ininternal/clias hand-rolled, duplicated walks over under-modeled data — stringly state keys, sniffedFileOps, parallel structs for single artifacts — held together by comments and pinning tests where types and shared functions should be.Each fix is a sub-issue below. The first six are in the review's priority order (highest leverage first); the remaining ones cover a verified latent bug and consolidation work the review also surfaced.
internal/state[secrets]validation (livecheck/doctordisagreement)FileOpmodeling: typedAction+ explicit cleanup-op kindreconcileRuninto a session typeaddMarketplaceSourceswallows cache-rename failurepluginTOMLSpecwithsource.PluginSpec