refactor/cmd: split runUp and the harness policy command, share one JSONC stripper #94
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/complexity-cmd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #71, the cmd slice. runUp was at Sonar cognitive complexity 32 and newHarnessPolicySetCmd at 34. runUp now delegates to upWorkspaceRoot, loadUpConfig, validateUpContainerOptions, ensureUpServer and upReadyHook with the step order unchanged, record check before runtime selection, validation, sbx preflight, token provisioning, server ensure, bring-up with the ready hook writing the worktree record right before the attach. The policy set command builds a policySetRequest with validate and apply methods, flags and help text unchanged. The two byte-identical JSONC strippers in cmd and doctor, both at 27, are replaced by one internal/jsonc package whose Strip is split into small helpers, with the old tests moved there plus new edge-case assertions. Reviewer pass ran a differential test of the new stripper against the old one over the repo's real devcontainer files, hand-written edge cases and two million random inputs, all byte-identical, and confirmed the ensureServer seam and XDG isolation of the runUp tests. 🤖 Generated with Claude Code