peaks-loop 4.1.3 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +56 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/commands/asset-command-shared.d.ts +12 -0
- package/dist/cli/commands/asset-command-shared.js +45 -0
- package/dist/cli/commands/asset-commands.d.ts +6 -1
- package/dist/cli/commands/asset-commands.js +11 -372
- package/dist/cli/commands/asset-crystallize-command.d.ts +3 -0
- package/dist/cli/commands/asset-crystallize-command.js +60 -0
- package/dist/cli/commands/asset-crystallize-payload.d.ts +47 -0
- package/dist/cli/commands/asset-crystallize-payload.js +85 -0
- package/dist/cli/commands/asset-crystallize-runner.d.ts +3 -0
- package/dist/cli/commands/asset-crystallize-runner.js +133 -0
- package/dist/cli/commands/asset-dispose-command.d.ts +3 -0
- package/dist/cli/commands/asset-dispose-command.js +99 -0
- package/dist/cli/commands/asset-status-command.d.ts +3 -0
- package/dist/cli/commands/asset-status-command.js +100 -0
- package/dist/cli/commands/baseline-audit-command.d.ts +3 -0
- package/dist/cli/commands/baseline-audit-command.js +64 -0
- package/dist/cli/commands/baseline-command-shared.d.ts +23 -0
- package/dist/cli/commands/baseline-command-shared.js +39 -0
- package/dist/cli/commands/baseline-commands.js +33 -313
- package/dist/cli/commands/baseline-freeze-commands.d.ts +4 -0
- package/dist/cli/commands/baseline-freeze-commands.js +81 -0
- package/dist/cli/commands/baseline-guard-command.d.ts +3 -0
- package/dist/cli/commands/baseline-guard-command.js +52 -0
- package/dist/cli/commands/baseline-read-commands.d.ts +5 -0
- package/dist/cli/commands/baseline-read-commands.js +72 -0
- package/dist/cli/commands/baseline-rollback-commands.d.ts +4 -0
- package/dist/cli/commands/baseline-rollback-commands.js +88 -0
- package/dist/cli/commands/classify-downgrade-command.d.ts +9 -0
- package/dist/cli/commands/classify-downgrade-command.js +21 -0
- package/dist/cli/commands/classify-run-command.d.ts +9 -0
- package/dist/cli/commands/classify-run-command.js +73 -0
- package/dist/cli/commands/classify-signals.d.ts +5 -0
- package/dist/cli/commands/classify-signals.js +104 -0
- package/dist/cli/commands/code-emit-handoff-command.js +40 -3
- package/dist/cli/commands/code-gate-step-08-command.js +25 -9
- package/dist/cli/commands/codegraph-command-options.d.ts +22 -0
- package/dist/cli/commands/codegraph-command-options.js +22 -0
- package/dist/cli/commands/codegraph-commands.d.ts +2 -2
- package/dist/cli/commands/codegraph-commands.js +14 -397
- package/dist/cli/commands/codegraph-config-restore-command.d.ts +3 -0
- package/dist/cli/commands/codegraph-config-restore-command.js +200 -0
- package/dist/cli/commands/codegraph-proxy-commands.d.ts +10 -0
- package/dist/cli/commands/codegraph-proxy-commands.js +159 -0
- package/dist/cli/commands/codegraph-repair-commands.d.ts +3 -0
- package/dist/cli/commands/codegraph-repair-commands.js +94 -0
- package/dist/cli/commands/codegraph-status-command.d.ts +1 -1
- package/dist/cli/commands/codegraph-status-command.js +27 -214
- package/dist/cli/commands/codegraph-status-integrity.d.ts +44 -0
- package/dist/cli/commands/codegraph-status-integrity.js +121 -0
- package/dist/cli/commands/codegraph-status-json.d.ts +5 -0
- package/dist/cli/commands/codegraph-status-json.js +127 -0
- package/dist/cli/commands/container-command-shared.d.ts +60 -0
- package/dist/cli/commands/container-command-shared.js +52 -0
- package/dist/cli/commands/container-commands.d.ts +1 -1
- package/dist/cli/commands/container-commands.js +4 -216
- package/dist/cli/commands/container-release-command.d.ts +3 -0
- package/dist/cli/commands/container-release-command.js +105 -0
- package/dist/cli/commands/container-spawn-command.d.ts +3 -0
- package/dist/cli/commands/container-spawn-command.js +148 -0
- package/dist/cli/commands/context-check-command.d.ts +3 -0
- package/dist/cli/commands/context-check-command.js +81 -0
- package/dist/cli/commands/context-commands.d.ts +2 -7
- package/dist/cli/commands/context-commands.js +6 -276
- package/dist/cli/commands/context-layer-command.d.ts +3 -0
- package/dist/cli/commands/context-layer-command.js +34 -0
- package/dist/cli/commands/context-layer-fetchers.d.ts +15 -0
- package/dist/cli/commands/context-layer-fetchers.js +162 -0
- package/dist/cli/commands/context-status-command.d.ts +17 -0
- package/dist/cli/commands/context-status-command.js +41 -0
- package/dist/cli/commands/contract-write-command.d.ts +3 -0
- package/dist/cli/commands/contract-write-command.js +144 -0
- package/dist/cli/commands/core/doctor-bindings.d.ts +17 -0
- package/dist/cli/commands/core/doctor-bindings.js +30 -0
- package/dist/cli/commands/core/doctor-command.d.ts +4 -18
- package/dist/cli/commands/core/doctor-command.js +2 -323
- package/dist/cli/commands/core/doctor-logs.d.ts +8 -0
- package/dist/cli/commands/core/doctor-logs.js +32 -0
- package/dist/cli/commands/core/doctor-probes.d.ts +3 -0
- package/dist/cli/commands/core/doctor-probes.js +55 -0
- package/dist/cli/commands/core/doctor-run-command.d.ts +12 -0
- package/dist/cli/commands/core/doctor-run-command.js +172 -0
- package/dist/cli/commands/core/doctor-summary.d.ts +7 -0
- package/dist/cli/commands/core/doctor-summary.js +39 -0
- package/dist/cli/commands/core/memory-command-shared.d.ts +25 -0
- package/dist/cli/commands/core/memory-command-shared.js +20 -0
- package/dist/cli/commands/core/memory-command.d.ts +1 -1
- package/dist/cli/commands/core/memory-command.js +6 -227
- package/dist/cli/commands/core/memory-delegated-verbs.d.ts +4 -0
- package/dist/cli/commands/core/memory-delegated-verbs.js +178 -0
- package/dist/cli/commands/core/memory-extract-command.d.ts +3 -0
- package/dist/cli/commands/core/memory-extract-command.js +90 -0
- package/dist/cli/commands/core/memory-sync-command.d.ts +3 -0
- package/dist/cli/commands/core/memory-sync-command.js +38 -0
- package/dist/cli/commands/core/session-command.d.ts +1 -1
- package/dist/cli/commands/core/session-command.js +12 -206
- package/dist/cli/commands/core/session-info-command.d.ts +3 -0
- package/dist/cli/commands/core/session-info-command.js +142 -0
- package/dist/cli/commands/core/session-verb-commands.d.ts +5 -0
- package/dist/cli/commands/core/session-verb-commands.js +58 -0
- package/dist/cli/commands/core/standards-command.d.ts +1 -24
- package/dist/cli/commands/core/standards-command.js +33 -201
- package/dist/cli/commands/core/standards-init-command.d.ts +3 -0
- package/dist/cli/commands/core/standards-init-command.js +87 -0
- package/dist/cli/commands/core/standards-lint.d.ts +24 -0
- package/dist/cli/commands/core/standards-lint.js +57 -0
- package/dist/cli/commands/core/standards-migrate-command.d.ts +3 -0
- package/dist/cli/commands/core/standards-migrate-command.js +57 -0
- package/dist/cli/commands/cron-scheduler-commands.d.ts +5 -1
- package/dist/cli/commands/cron-scheduler-commands.js +36 -206
- package/dist/cli/commands/cron-scheduler-run-once-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-run-once-command.js +35 -0
- package/dist/cli/commands/cron-scheduler-shared.d.ts +6 -0
- package/dist/cli/commands/cron-scheduler-shared.js +48 -0
- package/dist/cli/commands/cron-scheduler-start-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-start-command.js +65 -0
- package/dist/cli/commands/cron-scheduler-status-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-status-command.js +46 -0
- package/dist/cli/commands/cron-scheduler-stop-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-stop-command.js +61 -0
- package/dist/cli/commands/dispatch-dag-envelope.d.ts +41 -0
- package/dist/cli/commands/dispatch-dag-envelope.js +49 -0
- package/dist/cli/commands/dispatch-dag-failure.d.ts +18 -0
- package/dist/cli/commands/dispatch-dag-failure.js +16 -0
- package/dist/cli/commands/dispatch-dag-preflight.d.ts +51 -0
- package/dist/cli/commands/dispatch-dag-preflight.js +105 -0
- package/dist/cli/commands/dispatch-dag-runners.d.ts +48 -0
- package/dist/cli/commands/dispatch-dag-runners.js +73 -0
- package/dist/cli/commands/dispatch-from-dag.d.ts +27 -0
- package/dist/cli/commands/dispatch-from-dag.js +87 -257
- package/dist/cli/commands/final-review-command-envelopes.d.ts +44 -0
- package/dist/cli/commands/final-review-command-envelopes.js +100 -0
- package/dist/cli/commands/final-review-command-shared.d.ts +52 -0
- package/dist/cli/commands/final-review-command-shared.js +35 -0
- package/dist/cli/commands/final-review-commands.d.ts +7 -27
- package/dist/cli/commands/final-review-commands.js +13 -240
- package/dist/cli/commands/final-review-prepare-command.d.ts +3 -0
- package/dist/cli/commands/final-review-prepare-command.js +200 -0
- package/dist/cli/commands/governance-classify-contract-commands.d.ts +23 -9
- package/dist/cli/commands/governance-classify-contract-commands.js +26 -269
- package/dist/cli/commands/hooks-command-shared.d.ts +42 -0
- package/dist/cli/commands/hooks-command-shared.js +32 -0
- package/dist/cli/commands/hooks-commands.d.ts +20 -0
- package/dist/cli/commands/hooks-commands.js +75 -309
- package/dist/cli/commands/hooks-install-envelopes.d.ts +6 -0
- package/dist/cli/commands/hooks-install-envelopes.js +144 -0
- package/dist/cli/commands/hooks-status-command.d.ts +3 -0
- package/dist/cli/commands/hooks-status-command.js +93 -0
- package/dist/cli/commands/hooks-uninstall-command.d.ts +3 -0
- package/dist/cli/commands/hooks-uninstall-command.js +43 -0
- package/dist/cli/commands/loop-command-shared.d.ts +31 -0
- package/dist/cli/commands/loop-command-shared.js +15 -0
- package/dist/cli/commands/loop-commands.d.ts +12 -17
- package/dist/cli/commands/loop-commands.js +56 -238
- package/dist/cli/commands/loop-export-command.d.ts +3 -0
- package/dist/cli/commands/loop-export-command.js +73 -0
- package/dist/cli/commands/loop-goal-compose-command.d.ts +3 -0
- package/dist/cli/commands/loop-goal-compose-command.js +36 -0
- package/dist/cli/commands/loop-import-command.d.ts +3 -0
- package/dist/cli/commands/loop-import-command.js +86 -0
- package/dist/cli/commands/loop-placeholder-commands.d.ts +3 -0
- package/dist/cli/commands/loop-placeholder-commands.js +52 -0
- package/dist/cli/commands/memory-command-shared.d.ts +59 -0
- package/dist/cli/commands/memory-command-shared.js +39 -0
- package/dist/cli/commands/memory-commands.d.ts +6 -79
- package/dist/cli/commands/memory-commands.js +19 -309
- package/dist/cli/commands/memory-ingest-command.d.ts +3 -0
- package/dist/cli/commands/memory-ingest-command.js +50 -0
- package/dist/cli/commands/memory-list-command.d.ts +16 -0
- package/dist/cli/commands/memory-list-command.js +129 -0
- package/dist/cli/commands/memory-reindex-command.d.ts +9 -0
- package/dist/cli/commands/memory-reindex-command.js +78 -0
- package/dist/cli/commands/memory-rotate-command.d.ts +3 -0
- package/dist/cli/commands/memory-rotate-command.js +55 -0
- package/dist/cli/commands/memory-search-command.d.ts +7 -0
- package/dist/cli/commands/memory-search-command.js +46 -0
- package/dist/cli/commands/openspec-archive-command.d.ts +3 -0
- package/dist/cli/commands/openspec-archive-command.js +55 -0
- package/dist/cli/commands/openspec-command-shared.d.ts +62 -0
- package/dist/cli/commands/openspec-command-shared.js +135 -0
- package/dist/cli/commands/openspec-commands.d.ts +1 -1
- package/dist/cli/commands/openspec-commands.js +33 -306
- package/dist/cli/commands/openspec-from-doctor-command.d.ts +3 -0
- package/dist/cli/commands/openspec-from-doctor-command.js +66 -0
- package/dist/cli/commands/openspec-init-command.d.ts +3 -0
- package/dist/cli/commands/openspec-init-command.js +49 -0
- package/dist/cli/commands/openspec-list-command.d.ts +3 -0
- package/dist/cli/commands/openspec-list-command.js +27 -0
- package/dist/cli/commands/openspec-render-command.d.ts +3 -0
- package/dist/cli/commands/openspec-render-command.js +33 -0
- package/dist/cli/commands/openspec-show-command.d.ts +3 -0
- package/dist/cli/commands/openspec-show-command.js +33 -0
- package/dist/cli/commands/openspec-to-rd-command.d.ts +3 -0
- package/dist/cli/commands/openspec-to-rd-command.js +33 -0
- package/dist/cli/commands/openspec-validate-command.d.ts +3 -0
- package/dist/cli/commands/openspec-validate-command.js +45 -0
- package/dist/cli/commands/playwright-browser-command.d.ts +8 -0
- package/dist/cli/commands/playwright-browser-command.js +61 -0
- package/dist/cli/commands/playwright-commands.d.ts +10 -62
- package/dist/cli/commands/playwright-commands.js +77 -400
- package/dist/cli/commands/playwright-envelope.d.ts +8 -0
- package/dist/cli/commands/playwright-envelope.js +29 -0
- package/dist/cli/commands/playwright-ls-stop-commands.d.ts +4 -0
- package/dist/cli/commands/playwright-ls-stop-commands.js +74 -0
- package/dist/cli/commands/playwright-session-store.d.ts +65 -0
- package/dist/cli/commands/playwright-session-store.js +189 -0
- package/dist/cli/commands/project-commands.d.ts +19 -0
- package/dist/cli/commands/project-commands.js +98 -259
- package/dist/cli/commands/project-context-command.d.ts +3 -0
- package/dist/cli/commands/project-context-command.js +44 -0
- package/dist/cli/commands/project-dashboard-command.d.ts +3 -0
- package/dist/cli/commands/project-dashboard-command.js +74 -0
- package/dist/cli/commands/project-knowledge-command.d.ts +3 -0
- package/dist/cli/commands/project-knowledge-command.js +48 -0
- package/dist/cli/commands/project-memories-show-command.d.ts +3 -0
- package/dist/cli/commands/project-memories-show-command.js +87 -0
- package/dist/cli/commands/project-memory-index-command.d.ts +3 -0
- package/dist/cli/commands/project-memory-index-command.js +31 -0
- package/dist/cli/commands/qa-archive-screenshots-command.d.ts +3 -0
- package/dist/cli/commands/qa-archive-screenshots-command.js +53 -0
- package/dist/cli/commands/qa-commands.d.ts +14 -87
- package/dist/cli/commands/qa-commands.js +17 -315
- package/dist/cli/commands/qa-context-prestep.d.ts +1 -0
- package/dist/cli/commands/qa-context-prestep.js +34 -0
- package/dist/cli/commands/qa-run-command.d.ts +3 -0
- package/dist/cli/commands/qa-run-command.js +105 -0
- package/dist/cli/commands/qa-run-options.d.ts +23 -0
- package/dist/cli/commands/qa-run-options.js +31 -0
- package/dist/cli/commands/qa-run-slice.d.ts +41 -0
- package/dist/cli/commands/qa-run-slice.js +145 -0
- package/dist/cli/commands/release-canary-command.d.ts +28 -0
- package/dist/cli/commands/release-canary-command.js +129 -0
- package/dist/cli/commands/release-command-shared.d.ts +13 -0
- package/dist/cli/commands/release-command-shared.js +18 -0
- package/dist/cli/commands/release-commands.d.ts +10 -18
- package/dist/cli/commands/release-commands.js +25 -298
- package/dist/cli/commands/release-done-command.d.ts +3 -0
- package/dist/cli/commands/release-done-command.js +64 -0
- package/dist/cli/commands/release-hotfix-command.d.ts +3 -0
- package/dist/cli/commands/release-hotfix-command.js +50 -0
- package/dist/cli/commands/release-plan-command.d.ts +3 -0
- package/dist/cli/commands/release-plan-command.js +33 -0
- package/dist/cli/commands/release-precheck-command.d.ts +3 -0
- package/dist/cli/commands/release-precheck-command.js +28 -0
- package/dist/cli/commands/release-promote-command.d.ts +3 -0
- package/dist/cli/commands/release-promote-command.js +34 -0
- package/dist/cli/commands/release-rollback-command.d.ts +3 -0
- package/dist/cli/commands/release-rollback-command.js +33 -0
- package/dist/cli/commands/release-watch-command.d.ts +3 -0
- package/dist/cli/commands/release-watch-command.js +44 -0
- package/dist/cli/commands/sediment-argv-flags.d.ts +54 -0
- package/dist/cli/commands/sediment-argv-flags.js +116 -0
- package/dist/cli/commands/sediment-command-shared.d.ts +15 -0
- package/dist/cli/commands/sediment-command-shared.js +5 -0
- package/dist/cli/commands/sediment-commands.d.ts +35 -59
- package/dist/cli/commands/sediment-commands.js +36 -590
- package/dist/cli/commands/sediment-pool-commands.d.ts +9 -0
- package/dist/cli/commands/sediment-pool-commands.js +185 -0
- package/dist/cli/commands/sediment-query-commands.d.ts +4 -0
- package/dist/cli/commands/sediment-query-commands.js +94 -0
- package/dist/cli/commands/sediment-release-commands.d.ts +8 -0
- package/dist/cli/commands/sediment-release-commands.js +232 -0
- package/dist/cli/commands/sop-advance-command.d.ts +3 -0
- package/dist/cli/commands/sop-advance-command.js +160 -0
- package/dist/cli/commands/sop-check-command.d.ts +3 -0
- package/dist/cli/commands/sop-check-command.js +44 -0
- package/dist/cli/commands/sop-command-shared.d.ts +23 -0
- package/dist/cli/commands/sop-command-shared.js +18 -0
- package/dist/cli/commands/sop-commands.d.ts +15 -1
- package/dist/cli/commands/sop-commands.js +26 -240
- package/dist/cli/commands/sop-init-command.d.ts +3 -0
- package/dist/cli/commands/sop-init-command.js +51 -0
- package/dist/cli/commands/sop-lint-command.d.ts +3 -0
- package/dist/cli/commands/sop-lint-command.js +64 -0
- package/dist/cli/commands/sop-register-command.d.ts +3 -0
- package/dist/cli/commands/sop-register-command.js +48 -0
- package/dist/cli/commands/sop-registry-command.d.ts +3 -0
- package/dist/cli/commands/sop-registry-command.js +30 -0
- package/dist/cli/commands/statusline-command-shared.d.ts +73 -0
- package/dist/cli/commands/statusline-command-shared.js +90 -0
- package/dist/cli/commands/statusline-commands.d.ts +1 -19
- package/dist/cli/commands/statusline-commands.js +48 -287
- package/dist/cli/commands/statusline-compact-command.d.ts +4 -0
- package/dist/cli/commands/statusline-compact-command.js +54 -0
- package/dist/cli/commands/statusline-install-command.d.ts +3 -0
- package/dist/cli/commands/statusline-install-command.js +48 -0
- package/dist/cli/commands/statusline-render-command.d.ts +9 -0
- package/dist/cli/commands/statusline-render-command.js +55 -0
- package/dist/cli/commands/statusline-status-command.d.ts +3 -0
- package/dist/cli/commands/statusline-status-command.js +23 -0
- package/dist/cli/commands/statusline-uninstall-command.d.ts +3 -0
- package/dist/cli/commands/statusline-uninstall-command.js +23 -0
- package/dist/cli/commands/test-command-run-helpers.d.ts +27 -0
- package/dist/cli/commands/test-command-run-helpers.js +73 -0
- package/dist/cli/commands/test-command-runner-resolution.d.ts +57 -0
- package/dist/cli/commands/test-command-runner-resolution.js +183 -0
- package/dist/cli/commands/test-commands.d.ts +8 -56
- package/dist/cli/commands/test-commands.js +26 -249
- package/dist/cli/commands/vm-command-shared.d.ts +23 -0
- package/dist/cli/commands/vm-command-shared.js +23 -0
- package/dist/cli/commands/vm-commands.d.ts +1 -28
- package/dist/cli/commands/vm-commands.js +36 -270
- package/dist/cli/commands/vm-hypervisor-runtime.d.ts +15 -0
- package/dist/cli/commands/vm-hypervisor-runtime.js +64 -0
- package/dist/cli/commands/vm-release-command.d.ts +5 -0
- package/dist/cli/commands/vm-release-command.js +101 -0
- package/dist/cli/commands/vm-spawn-command.d.ts +5 -0
- package/dist/cli/commands/vm-spawn-command.js +177 -0
- package/dist/cli/commands/web-command-shared.d.ts +12 -0
- package/dist/cli/commands/web-command-shared.js +30 -0
- package/dist/cli/commands/web-commands.d.ts +7 -14
- package/dist/cli/commands/web-commands.js +6 -314
- package/dist/cli/commands/web-install-command.d.ts +10 -0
- package/dist/cli/commands/web-install-command.js +116 -0
- package/dist/cli/commands/web-lifecycle-commands.d.ts +9 -30
- package/dist/cli/commands/web-lifecycle-commands.js +14 -322
- package/dist/cli/commands/web-login-command.d.ts +14 -0
- package/dist/cli/commands/web-login-command.js +189 -0
- package/dist/cli/commands/web-op-payload.d.ts +22 -0
- package/dist/cli/commands/web-op-payload.js +89 -0
- package/dist/cli/commands/web-op-refusals.d.ts +37 -0
- package/dist/cli/commands/web-op-refusals.js +73 -0
- package/dist/cli/commands/web-op-runner.d.ts +14 -0
- package/dist/cli/commands/web-op-runner.js +166 -0
- package/dist/cli/commands/web-status-command.d.ts +4 -0
- package/dist/cli/commands/web-status-command.js +32 -0
- package/dist/cli/commands/web-stop-command.d.ts +10 -0
- package/dist/cli/commands/web-stop-command.js +59 -0
- package/dist/cli/commands/web-verb-specs.d.ts +18 -0
- package/dist/cli/commands/web-verb-specs.js +66 -0
- package/dist/cli/commands/workflow-command-shared.d.ts +102 -0
- package/dist/cli/commands/workflow-command-shared.js +74 -0
- package/dist/cli/commands/workflow-graph-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-graph-commands.js +73 -0
- package/dist/cli/commands/workflow-init-command.d.ts +3 -0
- package/dist/cli/commands/workflow-init-command.js +68 -0
- package/dist/cli/commands/workflow-lifecycle-commands.d.ts +9 -59
- package/dist/cli/commands/workflow-lifecycle-commands.js +14 -348
- package/dist/cli/commands/workflow-node-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-node-commands.js +154 -0
- package/dist/cli/commands/workflow-terminalize-command.d.ts +3 -0
- package/dist/cli/commands/workflow-terminalize-command.js +56 -0
- package/dist/services/code/auto-compact-artifacts.d.ts +54 -0
- package/dist/services/code/auto-compact-artifacts.js +135 -0
- package/dist/services/code/auto-compact-attempt.d.ts +46 -0
- package/dist/services/code/auto-compact-attempt.js +88 -0
- package/dist/services/code/auto-compact-decision.d.ts +74 -0
- package/dist/services/code/auto-compact-decision.js +149 -0
- package/dist/services/code/auto-compact-dispatch-gate.d.ts +36 -0
- package/dist/services/code/auto-compact-dispatch-gate.js +86 -0
- package/dist/services/code/auto-compact-envelopes.d.ts +33 -0
- package/dist/services/code/auto-compact-envelopes.js +134 -0
- package/dist/services/code/auto-compact-history.d.ts +46 -0
- package/dist/services/code/auto-compact-history.js +17 -0
- package/dist/services/code/auto-compact-orchestrator.d.ts +11 -240
- package/dist/services/code/auto-compact-orchestrator.js +165 -686
- package/dist/services/code/auto-compact-run-types.d.ts +123 -0
- package/dist/services/code/auto-compact-run-types.js +1 -0
- package/dist/services/code/emit-handoff.d.ts +35 -1
- package/dist/services/code/emit-handoff.js +128 -7
- package/dist/services/code/step-08-gate.d.ts +28 -19
- package/dist/services/code/step-08-gate.js +92 -35
- package/dist/services/config/config-coercion.d.ts +7 -0
- package/dist/services/config/config-coercion.js +156 -0
- package/dist/services/config/config-file-io.d.ts +11 -0
- package/dist/services/config/config-file-io.js +61 -0
- package/dist/services/config/config-get.d.ts +2 -0
- package/dist/services/config/config-get.js +36 -0
- package/dist/services/config/config-global-loader.d.ts +15 -0
- package/dist/services/config/config-global-loader.js +111 -0
- package/dist/services/config/config-nested-path.d.ts +3 -0
- package/dist/services/config/config-nested-path.js +53 -0
- package/dist/services/config/config-primitives.d.ts +16 -0
- package/dist/services/config/config-primitives.js +24 -0
- package/dist/services/config/config-service.d.ts +9 -33
- package/dist/services/config/config-service.js +16 -665
- package/dist/services/config/config-validation.d.ts +19 -0
- package/dist/services/config/config-validation.js +152 -0
- package/dist/services/config/config-workspace.d.ts +10 -0
- package/dist/services/config/config-workspace.js +158 -0
- package/dist/services/skills/hooks-settings-deny-list.d.ts +61 -0
- package/dist/services/skills/hooks-settings-deny-list.js +173 -0
- package/dist/services/skills/hooks-settings-envelopes.d.ts +20 -0
- package/dist/services/skills/hooks-settings-envelopes.js +79 -0
- package/dist/services/skills/hooks-settings-file-shape.d.ts +43 -0
- package/dist/services/skills/hooks-settings-file-shape.js +207 -0
- package/dist/services/skills/hooks-settings-paths.d.ts +34 -0
- package/dist/services/skills/hooks-settings-paths.js +75 -0
- package/dist/services/skills/hooks-settings-read-installed.d.ts +39 -0
- package/dist/services/skills/hooks-settings-read-installed.js +60 -0
- package/dist/services/skills/hooks-settings-service.d.ts +12 -212
- package/dist/services/skills/hooks-settings-service.js +71 -657
- package/dist/services/skills/hooks-settings-types.d.ts +139 -0
- package/dist/services/skills/hooks-settings-types.js +1 -0
- package/dist/services/workspace/claude-settings-template-merge.d.ts +89 -0
- package/dist/services/workspace/claude-settings-template-merge.js +243 -0
- package/dist/services/workspace/claude-settings-template.d.ts +29 -87
- package/dist/services/workspace/claude-settings-template.js +81 -236
- package/package.json +5 -5
|
@@ -18,308 +18,35 @@
|
|
|
18
18
|
*
|
|
19
19
|
* Real deployment (k8s rollout, LB config, monitoring integration) is
|
|
20
20
|
* OUT OF SCOPE for this slice.
|
|
21
|
+
*
|
|
22
|
+
* The verb implementations live beside this file, one module per verb:
|
|
23
|
+
* `release-plan-command.ts`, `release-canary-command.ts`,
|
|
24
|
+
* `release-promote-command.ts`, `release-watch-command.ts`,
|
|
25
|
+
* `release-done-command.ts`, `release-rollback-command.ts`,
|
|
26
|
+
* `release-hotfix-command.ts`, `release-precheck-command.ts`, with their shared
|
|
27
|
+
* project-root / canary-percent vocabulary in `release-command-shared.ts`.
|
|
21
28
|
*/
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
50: 'canary-50'
|
|
31
|
-
};
|
|
32
|
-
// precheck-guard via direct function call (not via program.parseAsync with a
|
|
33
|
-
// mocked service). Returns the result envelope for the caller to print.
|
|
34
|
-
export function executeCanaryAction(opts, io, projectRoot) {
|
|
35
|
-
// this function is called (step 0 short-circuits with CHANGESET_BLOCKED).
|
|
36
|
-
// Layers C/D default warning → do not block canary; --strict upgrade would
|
|
37
|
-
// Layers C/D default warning → do not block canary; --strict upgrade would
|
|
38
|
-
const precheck = runAllLayers({ projectRoot, strict: false });
|
|
39
|
-
const blockerEntry = Object.entries(precheck.layers).find(([, l]) => l.status === 'blocker');
|
|
40
|
-
if (blockerEntry !== undefined) {
|
|
41
|
-
const [name, result] = blockerEntry;
|
|
42
|
-
return {
|
|
43
|
-
ok: false,
|
|
44
|
-
status: 'PRECHECK_BLOCKER',
|
|
45
|
-
blockerLayer: { name, result },
|
|
46
|
-
payload: {
|
|
47
|
-
projectRoot,
|
|
48
|
-
precheckSnapshotAt: precheck.snapshotAt,
|
|
49
|
-
layer: name,
|
|
50
|
-
message: result.message,
|
|
51
|
-
remediation: result.remediation
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const percent = Number.parseInt(opts.percent, 10);
|
|
56
|
-
if (percent !== 10 && percent !== 50) {
|
|
57
|
-
return {
|
|
58
|
-
ok: false,
|
|
59
|
-
status: 'INVALID_PERCENT',
|
|
60
|
-
payload: { projectRoot, got: opts.percent }
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const state = readReleaseState(projectRoot);
|
|
64
|
-
const targetStage = CANARY_PERCENTS[percent];
|
|
65
|
-
const result = transitionRelease(state, targetStage, opts.note);
|
|
66
|
-
if ('error' in result) {
|
|
67
|
-
return {
|
|
68
|
-
ok: false,
|
|
69
|
-
status: 'INVALID_TRANSITION',
|
|
70
|
-
payload: { projectRoot, error: result.error }
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
writeReleaseState(projectRoot, result.state);
|
|
74
|
-
return {
|
|
75
|
-
ok: true,
|
|
76
|
-
status: 'OK',
|
|
77
|
-
payload: {
|
|
78
|
-
projectRoot,
|
|
79
|
-
percent,
|
|
80
|
-
currentStage: targetStage,
|
|
81
|
-
nextAction: percent === 10 ? 'peaks release canary --percent 50' : 'peaks release promote'
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
29
|
+
import { registerReleaseCanaryCommand } from './release-canary-command.js';
|
|
30
|
+
import { registerReleasePrecheckCommand } from './release-precheck-command.js';
|
|
31
|
+
import { registerReleaseDoneCommand } from './release-done-command.js';
|
|
32
|
+
import { registerReleaseHotfixCommand } from './release-hotfix-command.js';
|
|
33
|
+
import { registerReleasePlanCommand } from './release-plan-command.js';
|
|
34
|
+
import { registerReleasePromoteCommand } from './release-promote-command.js';
|
|
35
|
+
import { registerReleaseRollbackCommand } from './release-rollback-command.js';
|
|
36
|
+
import { registerReleaseWatchCommand } from './release-watch-command.js';
|
|
85
37
|
export function registerReleaseCommands(program, io) {
|
|
86
38
|
const release = program
|
|
87
39
|
.command('release')
|
|
88
40
|
.description('v2.15.0 follow-up G15: canary → promote → watch → done / hotfix state machine.');
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const result = planRelease(state, version);
|
|
98
|
-
if ('error' in result) {
|
|
99
|
-
printResult(io, fail('release.plan', 'CONFLICT', result.error, { projectRoot }, [
|
|
100
|
-
'Run `peaks release rollback` or `peaks release hotfix` to clear the active release.'
|
|
101
|
-
]), opts.json ?? false);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
writeReleaseState(projectRoot, result.state);
|
|
105
|
-
printResult(io, ok('release.plan', {
|
|
106
|
-
projectRoot,
|
|
107
|
-
version: result.record.version,
|
|
108
|
-
currentStage: result.record.currentStage
|
|
109
|
-
}, [], ['Run `peaks release canary --percent 10` to begin the canary phase.']), opts.json ?? false);
|
|
110
|
-
});
|
|
111
|
-
addJsonOption(release
|
|
112
|
-
.command('canary')
|
|
113
|
-
.description('Advance the active release to a canary stage. Two percent values supported: ' +
|
|
114
|
-
'10 (first canary, requires stage=planned) and 50 (second canary, requires ' +
|
|
115
|
-
'stage=canary-10). Runs `peaks release precheck` first and refuses with ' +
|
|
116
|
-
'PRECHECK_BLOCKER if any blocker layer (rootVsShared or tagCollision) fails.')
|
|
117
|
-
.requiredOption('--percent <10|50>', 'canary percent (10 or 50)')
|
|
118
|
-
.option('--note <text>', 'optional note for the stage transition')
|
|
119
|
-
.option('--project <path>', 'project root (default: cwd)')).action((opts) => {
|
|
120
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
121
|
-
const gate = runChangesetHardGate(projectRoot);
|
|
122
|
-
if (gate.state === 'staged-present') {
|
|
123
|
-
process.exitCode = 1;
|
|
124
|
-
printResult(io, fail('release.canary', 'CHANGESET_BLOCKED', `${gate.stagedFiles.length} staged .changeset/*.md file(s) — refusing canary`, {
|
|
125
|
-
projectRoot,
|
|
126
|
-
state: gate.state,
|
|
127
|
-
stagedFiles: [...gate.stagedFiles],
|
|
128
|
-
snapshotAt: gate.snapshotAt
|
|
129
|
-
}, [
|
|
130
|
-
`Drain pending changesets (coordinating LLM: drain via the standard changeset consumption path), then re-run \`peaks changeset check --project ${projectRoot}\` to confirm clean state.`
|
|
131
|
-
]), opts.json ?? false);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const result = executeCanaryAction(opts, io, projectRoot);
|
|
135
|
-
if (result.status === 'PRECHECK_BLOCKER') {
|
|
136
|
-
const layer = result.blockerLayer;
|
|
137
|
-
printResult(io, fail('release.canary', 'PRECHECK_BLOCKER', `precheck blocker on layer '${layer?.name ?? 'unknown'}': ${layer?.result.message ?? ''}`, result.payload, [
|
|
138
|
-
`Run 'peaks release precheck --project ${projectRoot}' for the full 4-layer envelope.`,
|
|
139
|
-
`Run 'peaks release precheck --strict' to also surface warning-layer issues.`,
|
|
140
|
-
`Remediation: ${layer?.result.remediation ?? ''}`
|
|
141
|
-
]), opts.json ?? false);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (result.status === 'INVALID_PERCENT') {
|
|
145
|
-
printResult(io, fail('release.canary', 'INVALID_PERCENT', `--percent must be 10 or 50 (got "${opts.percent}")`, result.payload, []), opts.json ?? false);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (result.status === 'INVALID_TRANSITION') {
|
|
149
|
-
printResult(io, fail('release.canary', 'INVALID_TRANSITION', String(result.payload['error'] ?? ''), result.payload, []), opts.json ?? false);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
printResult(io, ok('release.canary', result.payload, [], []), opts.json ?? false);
|
|
153
|
-
});
|
|
154
|
-
// 3. promote
|
|
155
|
-
addJsonOption(release
|
|
156
|
-
.command('promote')
|
|
157
|
-
.description('Promote the canary to 100% (full release). Requires stage=canary-50. ' +
|
|
158
|
-
'Records the promoted-at timestamp and starts the 24h watch window.')
|
|
159
|
-
.option('--note <text>', 'optional note')
|
|
160
|
-
.option('--project <path>', 'project root (default: cwd)')).action((opts) => {
|
|
161
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
162
|
-
const state = readReleaseState(projectRoot);
|
|
163
|
-
const result = transitionRelease(state, 'promoted', opts.note);
|
|
164
|
-
if ('error' in result) {
|
|
165
|
-
printResult(io, fail('release.promote', 'INVALID_TRANSITION', result.error, { projectRoot }, []), opts.json ?? false);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
writeReleaseState(projectRoot, result.state);
|
|
169
|
-
printResult(io, ok('release.promote', {
|
|
170
|
-
projectRoot,
|
|
171
|
-
currentStage: 'promoted',
|
|
172
|
-
promotedAt: result.state.active?.promotedAt
|
|
173
|
-
}, [], [
|
|
174
|
-
'Watch window started. Run `peaks release watch` to check progress; `peaks release rollback` for emergency.'
|
|
175
|
-
]), opts.json ?? false);
|
|
176
|
-
});
|
|
177
|
-
// 4. watch
|
|
178
|
-
addJsonOption(release
|
|
179
|
-
.command('watch')
|
|
180
|
-
.description('Show the watch window status for the current promoted release. ' +
|
|
181
|
-
'24h window from promoted-at. After the window, run `peaks release done` ' +
|
|
182
|
-
'to mark the release complete.')
|
|
183
|
-
.option('--project <path>', 'project root (default: cwd)')).action((opts) => {
|
|
184
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
185
|
-
const state = readReleaseState(projectRoot);
|
|
186
|
-
if (state.active === null) {
|
|
187
|
-
printResult(io, fail('release.watch', 'NO_ACTIVE', 'no active release to watch', { projectRoot }, [
|
|
188
|
-
'Run `peaks release plan <version>` to start one.'
|
|
189
|
-
]), opts.json ?? false);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
const win = watchWindow(state.active);
|
|
193
|
-
const readyForDone = win.percentComplete >= 1.0;
|
|
194
|
-
printResult(io, ok('release.watch', {
|
|
195
|
-
projectRoot,
|
|
196
|
-
version: state.active.version,
|
|
197
|
-
currentStage: state.active.currentStage,
|
|
198
|
-
window: {
|
|
199
|
-
elapsedMs: win.elapsedMs,
|
|
200
|
-
remainingMs: win.remainingMs,
|
|
201
|
-
windowMs: win.windowMs,
|
|
202
|
-
percentComplete: Math.round(win.percentComplete * 100) / 100
|
|
203
|
-
},
|
|
204
|
-
readyForDone
|
|
205
|
-
}, readyForDone
|
|
206
|
-
? ['Watch window complete. Run `peaks release done` to mark the release done.']
|
|
207
|
-
: []), opts.json ?? false);
|
|
208
|
-
});
|
|
209
|
-
// 5. done (implicit helper; not in original spec but useful)
|
|
210
|
-
addJsonOption(release
|
|
211
|
-
.command('done')
|
|
212
|
-
.description('Mark the active release as done. Requires the watch window to be ' +
|
|
213
|
-
'complete (24h after promoted-at).')
|
|
214
|
-
.option('--project <path>', 'project root (default: cwd)')).action((opts) => {
|
|
215
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
216
|
-
const state = readReleaseState(projectRoot);
|
|
217
|
-
if (state.active === null) {
|
|
218
|
-
printResult(io, fail('release.done', 'NO_ACTIVE', 'no active release', { projectRoot }, []), opts.json ?? false);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
// No stage guard here: `watching` is unreachable (nothing ever calls
|
|
222
|
-
// transitionRelease(state, 'watching')), so the real precondition is the
|
|
223
|
-
// watch window itself — the same thing this command's description
|
|
224
|
-
// documents ("Requires the watch window to be complete"). The stage
|
|
225
|
-
// table (`promoted → watching → done`) stays as the declared design, but
|
|
226
|
-
// `promoted` may now reach `done` directly.
|
|
227
|
-
const win = watchWindow(state.active);
|
|
228
|
-
if (win.percentComplete < 1.0) {
|
|
229
|
-
printResult(io, fail('release.done', 'WATCH_INCOMPLETE', `watch window not yet complete (${Math.round(win.percentComplete * 100)}% elapsed)`, { projectRoot }, []), opts.json ?? false);
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
const result = transitionRelease(state, 'done');
|
|
233
|
-
if ('error' in result) {
|
|
234
|
-
printResult(io, fail('release.done', 'INVALID_TRANSITION', result.error, { projectRoot }, []), opts.json ?? false);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
// Move to history.
|
|
238
|
-
const finalRecord = result.state.active;
|
|
239
|
-
const newState = {
|
|
240
|
-
version: 1,
|
|
241
|
-
active: null,
|
|
242
|
-
history: [...result.state.history, finalRecord]
|
|
243
|
-
};
|
|
244
|
-
writeReleaseState(projectRoot, newState);
|
|
245
|
-
printResult(io, ok('release.done', {
|
|
246
|
-
projectRoot,
|
|
247
|
-
version: finalRecord.version,
|
|
248
|
-
doneAt: finalRecord.doneAt
|
|
249
|
-
}, [], []), opts.json ?? false);
|
|
250
|
-
});
|
|
251
|
-
// 6. rollback
|
|
252
|
-
addJsonOption(release
|
|
253
|
-
.command('rollback')
|
|
254
|
-
.description('Emergency rollback of the active release. Moves the active release to ' +
|
|
255
|
-
'the history with currentStage=rolled-back. Available from any ' +
|
|
256
|
-
'pre-done stage.')
|
|
257
|
-
.option('--note <text>', 'optional rollback reason')
|
|
258
|
-
.option('--project <path>', 'project root (default: cwd)')).action((opts) => {
|
|
259
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
260
|
-
const state = readReleaseState(projectRoot);
|
|
261
|
-
const result = rollbackRelease(state, opts.note);
|
|
262
|
-
if ('error' in result) {
|
|
263
|
-
printResult(io, fail('release.rollback', 'INVALID_TRANSITION', result.error, { projectRoot }, []), opts.json ?? false);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
writeReleaseState(projectRoot, result.state);
|
|
267
|
-
printResult(io, ok('release.rollback', {
|
|
268
|
-
projectRoot,
|
|
269
|
-
rolledBack: result.record.version,
|
|
270
|
-
finalStage: result.record.currentStage
|
|
271
|
-
}, [], ['Run `peaks release hotfix <version>` to start a hotfix on the previous release.']), opts.json ?? false);
|
|
272
|
-
});
|
|
273
|
-
// 7. hotfix
|
|
274
|
-
addJsonOption(release
|
|
275
|
-
.command('hotfix <version>')
|
|
276
|
-
.description('Start a hotfix release. Forces a rollback of any active release, ' +
|
|
277
|
-
'skips the `planned` stage, and starts the new release at canary-10. ' +
|
|
278
|
-
'Use this for紧急修复 — minimal ceremony, no full prd ceremony.')
|
|
279
|
-
.option('--note <text>', 'optional hotfix note')
|
|
280
|
-
.option('--project <path>', 'project root (default: cwd)')).action((version, opts) => {
|
|
281
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
282
|
-
const changesetGate = runChangesetHardGate(projectRoot);
|
|
283
|
-
if (changesetGate.state === 'staged-present') {
|
|
284
|
-
process.exitCode = 1;
|
|
285
|
-
printResult(io, fail('release.hotfix', 'CHANGESET_BLOCKED', `${changesetGate.stagedFiles.length} staged .changeset/*.md file(s) — refusing to start hotfix`, {
|
|
286
|
-
projectRoot,
|
|
287
|
-
stagedFiles: [...changesetGate.stagedFiles],
|
|
288
|
-
snapshotAt: changesetGate.snapshotAt
|
|
289
|
-
}, [
|
|
290
|
-
`Drain pending changesets (coordinating LLM: drain via the standard changeset consumption path), then re-run \`peaks changeset check --project ${projectRoot}\` to confirm clean state.`
|
|
291
|
-
]), opts.json ?? false);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
const state = readReleaseState(projectRoot);
|
|
295
|
-
const result = hotfixRelease(state, version, opts.note);
|
|
296
|
-
if ('error' in result) {
|
|
297
|
-
printResult(io, fail('release.hotfix', 'HOTFIX_FAILED', result.error, { projectRoot }, []), opts.json ?? false);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
writeReleaseState(projectRoot, result.state);
|
|
301
|
-
printResult(io, ok('release.hotfix', {
|
|
302
|
-
projectRoot,
|
|
303
|
-
version: result.record.version,
|
|
304
|
-
currentStage: result.record.currentStage
|
|
305
|
-
}, [], ['Hotfix started at canary-10. Run `peaks release canary --percent 50` to advance.']), opts.json ?? false);
|
|
306
|
-
});
|
|
307
|
-
addJsonOption(release
|
|
308
|
-
.command('precheck')
|
|
309
|
-
.description('Run the 4-layer version precheck (rootVsShared / tagCollision / ' +
|
|
310
|
-
'changesetStaged / workspaceLockstep). Layer A+B are blockers by default; ' +
|
|
311
|
-
'Layer C+D are warnings unless --strict is passed (CI parity mode). ' +
|
|
312
|
-
'Shared with publish.yml gate-cli-version step §(A).')
|
|
313
|
-
.option('--strict', 'treat warnings as blockers (CI parity mode)')
|
|
314
|
-
.option('--project <path>', 'project root (default: cwd)')).action((opts) => {
|
|
315
|
-
const projectRoot = opts.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
316
|
-
const envelope = runAllLayers({ projectRoot, strict: opts.strict === true });
|
|
317
|
-
process.exitCode = envelope.ok ? 0 : 1;
|
|
318
|
-
const warningLines = envelope.overall === 'warning'
|
|
319
|
-
? ['Warning layers reported but did not block. Re-run with --strict to upgrade.']
|
|
320
|
-
: [];
|
|
321
|
-
printResult(io, ok('release.precheck', envelope, [], warningLines), opts.json ?? false);
|
|
322
|
-
});
|
|
41
|
+
registerReleasePlanCommand(release, io);
|
|
42
|
+
registerReleaseCanaryCommand(release, io);
|
|
43
|
+
registerReleasePromoteCommand(release, io);
|
|
44
|
+
registerReleaseWatchCommand(release, io);
|
|
45
|
+
registerReleaseDoneCommand(release, io);
|
|
46
|
+
registerReleaseRollbackCommand(release, io);
|
|
47
|
+
registerReleaseHotfixCommand(release, io);
|
|
48
|
+
registerReleasePrecheckCommand(release, io);
|
|
323
49
|
}
|
|
324
50
|
// Re-export for tests / external consumers.
|
|
325
|
-
export {
|
|
51
|
+
export { executeCanaryAction } from './release-canary-command.js';
|
|
52
|
+
export { isReleaseStage } from '../../services/release/release-state.js';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// src/cli/commands/release-done-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks release done` — close the active release once the watch window is
|
|
4
|
+
// complete. Split out of `release-commands.ts`; the verb name, its options, the
|
|
5
|
+
// "no stage guard, the window is the precondition" ruling and the envelope
|
|
6
|
+
// shape are unchanged.
|
|
7
|
+
import { readReleaseState, transitionRelease, watchWindow, writeReleaseState } from '../../services/release/release-state.js';
|
|
8
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
9
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
10
|
+
import { resolveReleaseProjectRoot } from './release-command-shared.js';
|
|
11
|
+
function noActiveRelease(projectRoot) {
|
|
12
|
+
return fail('release.done', 'NO_ACTIVE', 'no active release', { projectRoot }, []);
|
|
13
|
+
}
|
|
14
|
+
function watchIncomplete(projectRoot, percentComplete) {
|
|
15
|
+
return fail('release.done', 'WATCH_INCOMPLETE', `watch window not yet complete (${Math.round(percentComplete * 100)}% elapsed)`, { projectRoot }, []);
|
|
16
|
+
}
|
|
17
|
+
function doneTransitionFailed(projectRoot, error) {
|
|
18
|
+
return fail('release.done', 'INVALID_TRANSITION', error, { projectRoot }, []);
|
|
19
|
+
}
|
|
20
|
+
function runReleaseDone(io, opts) {
|
|
21
|
+
const projectRoot = resolveReleaseProjectRoot(opts.project);
|
|
22
|
+
const state = readReleaseState(projectRoot);
|
|
23
|
+
if (state.active === null) {
|
|
24
|
+
printResult(io, noActiveRelease(projectRoot), opts.json ?? false);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// No stage guard here: `watching` is unreachable (nothing ever calls
|
|
28
|
+
// transitionRelease(state, 'watching')), so the real precondition is the
|
|
29
|
+
// watch window itself — the same thing this command's description
|
|
30
|
+
// documents ("Requires the watch window to be complete"). The stage
|
|
31
|
+
// table (`promoted → watching → done`) stays as the declared design, but
|
|
32
|
+
// `promoted` may now reach `done` directly.
|
|
33
|
+
const win = watchWindow(state.active);
|
|
34
|
+
if (win.percentComplete < 1.0) {
|
|
35
|
+
printResult(io, watchIncomplete(projectRoot, win.percentComplete), opts.json ?? false);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const result = transitionRelease(state, 'done');
|
|
39
|
+
if ('error' in result) {
|
|
40
|
+
printResult(io, doneTransitionFailed(projectRoot, result.error), opts.json ?? false);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Move to history. `transitionRelease` never clears `active`; the fallback
|
|
44
|
+
// is what keeps this read type-safe without asserting non-nullness.
|
|
45
|
+
const finalRecord = result.state.active ?? state.active;
|
|
46
|
+
const newState = {
|
|
47
|
+
version: 1,
|
|
48
|
+
active: null,
|
|
49
|
+
history: [...result.state.history, finalRecord]
|
|
50
|
+
};
|
|
51
|
+
writeReleaseState(projectRoot, newState);
|
|
52
|
+
printResult(io, ok('release.done', {
|
|
53
|
+
projectRoot,
|
|
54
|
+
version: finalRecord.version,
|
|
55
|
+
doneAt: finalRecord.doneAt
|
|
56
|
+
}, [], []), opts.json ?? false);
|
|
57
|
+
}
|
|
58
|
+
export function registerReleaseDoneCommand(release, io) {
|
|
59
|
+
addJsonOption(release
|
|
60
|
+
.command('done')
|
|
61
|
+
.description('Mark the active release as done. Requires the watch window to be ' +
|
|
62
|
+
'complete (24h after promoted-at).')
|
|
63
|
+
.option('--project <path>', 'project root (default: cwd)')).action((opts) => runReleaseDone(io, opts));
|
|
64
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/cli/commands/release-hotfix-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks release hotfix <version>` — start a hotfix, forcing any active release
|
|
4
|
+
// back. Split out of `release-commands.ts`; the verb name, its options, the
|
|
5
|
+
// changeset gate and the envelope shape are unchanged.
|
|
6
|
+
import { hotfixRelease, readReleaseState, writeReleaseState } from '../../services/release/release-state.js';
|
|
7
|
+
import { runChangesetHardGate } from '../../services/changeset/changeset-check-service.js';
|
|
8
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
9
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
10
|
+
import { resolveReleaseProjectRoot } from './release-command-shared.js';
|
|
11
|
+
/** The refusal a staged changeset triggers before a hotfix may start. */
|
|
12
|
+
function changesetBlockedOutcome(gate, projectRoot) {
|
|
13
|
+
return fail('release.hotfix', 'CHANGESET_BLOCKED', `${gate.stagedFiles.length} staged .changeset/*.md file(s) — refusing to start hotfix`, {
|
|
14
|
+
projectRoot,
|
|
15
|
+
stagedFiles: [...gate.stagedFiles],
|
|
16
|
+
snapshotAt: gate.snapshotAt
|
|
17
|
+
}, [
|
|
18
|
+
`Drain pending changesets (coordinating LLM: drain via the standard changeset consumption path), then re-run \`peaks changeset check --project ${projectRoot}\` to confirm clean state.`
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
function runReleaseHotfix(io, version, opts) {
|
|
22
|
+
const projectRoot = resolveReleaseProjectRoot(opts.project);
|
|
23
|
+
const gate = runChangesetHardGate(projectRoot);
|
|
24
|
+
if (gate.state === 'staged-present') {
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
printResult(io, changesetBlockedOutcome(gate, projectRoot), opts.json ?? false);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const state = readReleaseState(projectRoot);
|
|
30
|
+
const result = hotfixRelease(state, version, opts.note);
|
|
31
|
+
if ('error' in result) {
|
|
32
|
+
printResult(io, fail('release.hotfix', 'HOTFIX_FAILED', result.error, { projectRoot }, []), opts.json ?? false);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
writeReleaseState(projectRoot, result.state);
|
|
36
|
+
printResult(io, ok('release.hotfix', {
|
|
37
|
+
projectRoot,
|
|
38
|
+
version: result.record.version,
|
|
39
|
+
currentStage: result.record.currentStage
|
|
40
|
+
}, [], ['Hotfix started at canary-10. Run `peaks release canary --percent 50` to advance.']), opts.json ?? false);
|
|
41
|
+
}
|
|
42
|
+
export function registerReleaseHotfixCommand(release, io) {
|
|
43
|
+
addJsonOption(release
|
|
44
|
+
.command('hotfix <version>')
|
|
45
|
+
.description('Start a hotfix release. Forces a rollback of any active release, ' +
|
|
46
|
+
'skips the `planned` stage, and starts the new release at canary-10. ' +
|
|
47
|
+
'Use this for紧急修复 — minimal ceremony, no full prd ceremony.')
|
|
48
|
+
.option('--note <text>', 'optional hotfix note')
|
|
49
|
+
.option('--project <path>', 'project root (default: cwd)')).action((version, opts) => runReleaseHotfix(io, version, opts));
|
|
50
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/cli/commands/release-plan-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks release plan <version>` — start a new release. Split out of
|
|
4
|
+
// `release-commands.ts`; the verb name, its options and the envelope shape are
|
|
5
|
+
// unchanged.
|
|
6
|
+
import { planRelease, readReleaseState, writeReleaseState } from '../../services/release/release-state.js';
|
|
7
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
8
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
9
|
+
import { resolveReleaseProjectRoot } from './release-command-shared.js';
|
|
10
|
+
function runReleasePlan(io, version, opts) {
|
|
11
|
+
const projectRoot = resolveReleaseProjectRoot(opts.project);
|
|
12
|
+
const state = readReleaseState(projectRoot);
|
|
13
|
+
const result = planRelease(state, version);
|
|
14
|
+
if ('error' in result) {
|
|
15
|
+
printResult(io, fail('release.plan', 'CONFLICT', result.error, { projectRoot }, [
|
|
16
|
+
'Run `peaks release rollback` or `peaks release hotfix` to clear the active release.'
|
|
17
|
+
]), opts.json ?? false);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
writeReleaseState(projectRoot, result.state);
|
|
21
|
+
printResult(io, ok('release.plan', {
|
|
22
|
+
projectRoot,
|
|
23
|
+
version: result.record.version,
|
|
24
|
+
currentStage: result.record.currentStage
|
|
25
|
+
}, [], ['Run `peaks release canary --percent 10` to begin the canary phase.']), opts.json ?? false);
|
|
26
|
+
}
|
|
27
|
+
export function registerReleasePlanCommand(release, io) {
|
|
28
|
+
addJsonOption(release
|
|
29
|
+
.command('plan <version>')
|
|
30
|
+
.description('Start a new release. Stores the version in the canary pipeline state. ' +
|
|
31
|
+
'Fails when there is already an active release in any non-terminal stage.')
|
|
32
|
+
.option('--project <path>', 'project root (default: cwd)')).action((version, opts) => runReleasePlan(io, version, opts));
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/cli/commands/release-precheck-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks release precheck` — the 4-layer version precheck. Split out of
|
|
4
|
+
// `release-commands.ts`; the verb name, its options, the `--strict` CI-parity
|
|
5
|
+
// meaning and both the envelope and the exit code are unchanged.
|
|
6
|
+
import { runAllLayers } from '../../services/release/version-precheck-service.js';
|
|
7
|
+
import { ok } from 'peaks-loop-shared/result';
|
|
8
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
9
|
+
import { resolveReleaseProjectRoot } from './release-command-shared.js';
|
|
10
|
+
function runReleasePrecheck(io, opts) {
|
|
11
|
+
const projectRoot = resolveReleaseProjectRoot(opts.project);
|
|
12
|
+
const envelope = runAllLayers({ projectRoot, strict: opts.strict === true });
|
|
13
|
+
process.exitCode = envelope.ok ? 0 : 1;
|
|
14
|
+
const warningLines = envelope.overall === 'warning'
|
|
15
|
+
? ['Warning layers reported but did not block. Re-run with --strict to upgrade.']
|
|
16
|
+
: [];
|
|
17
|
+
printResult(io, ok('release.precheck', envelope, [], warningLines), opts.json ?? false);
|
|
18
|
+
}
|
|
19
|
+
export function registerReleasePrecheckCommand(release, io) {
|
|
20
|
+
addJsonOption(release
|
|
21
|
+
.command('precheck')
|
|
22
|
+
.description('Run the 4-layer version precheck (rootVsShared / tagCollision / ' +
|
|
23
|
+
'changesetStaged / workspaceLockstep). Layer A+B are blockers by default; ' +
|
|
24
|
+
'Layer C+D are warnings unless --strict is passed (CI parity mode). ' +
|
|
25
|
+
'Shared with publish.yml gate-cli-version step §(A).')
|
|
26
|
+
.option('--strict', 'treat warnings as blockers (CI parity mode)')
|
|
27
|
+
.option('--project <path>', 'project root (default: cwd)')).action((opts) => runReleasePrecheck(io, opts));
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/cli/commands/release-promote-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks release promote` — promote the canary to 100% and start the watch
|
|
4
|
+
// window. Split out of `release-commands.ts`; the verb name, its options, the
|
|
5
|
+
// `canary-50` precondition and the envelope shape are unchanged.
|
|
6
|
+
import { readReleaseState, transitionRelease, writeReleaseState } from '../../services/release/release-state.js';
|
|
7
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
8
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
9
|
+
import { resolveReleaseProjectRoot } from './release-command-shared.js';
|
|
10
|
+
function runReleasePromote(io, opts) {
|
|
11
|
+
const projectRoot = resolveReleaseProjectRoot(opts.project);
|
|
12
|
+
const state = readReleaseState(projectRoot);
|
|
13
|
+
const result = transitionRelease(state, 'promoted', opts.note);
|
|
14
|
+
if ('error' in result) {
|
|
15
|
+
printResult(io, fail('release.promote', 'INVALID_TRANSITION', result.error, { projectRoot }, []), opts.json ?? false);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
writeReleaseState(projectRoot, result.state);
|
|
19
|
+
printResult(io, ok('release.promote', {
|
|
20
|
+
projectRoot,
|
|
21
|
+
currentStage: 'promoted',
|
|
22
|
+
promotedAt: result.state.active?.promotedAt
|
|
23
|
+
}, [], [
|
|
24
|
+
'Watch window started. Run `peaks release watch` to check progress; `peaks release rollback` for emergency.'
|
|
25
|
+
]), opts.json ?? false);
|
|
26
|
+
}
|
|
27
|
+
export function registerReleasePromoteCommand(release, io) {
|
|
28
|
+
addJsonOption(release
|
|
29
|
+
.command('promote')
|
|
30
|
+
.description('Promote the canary to 100% (full release). Requires stage=canary-50. ' +
|
|
31
|
+
'Records the promoted-at timestamp and starts the 24h watch window.')
|
|
32
|
+
.option('--note <text>', 'optional note')
|
|
33
|
+
.option('--project <path>', 'project root (default: cwd)')).action((opts) => runReleasePromote(io, opts));
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/cli/commands/release-rollback-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks release rollback` — emergency rollback of the active release. Split
|
|
4
|
+
// out of `release-commands.ts`; the verb name, its options and the envelope
|
|
5
|
+
// shape are unchanged.
|
|
6
|
+
import { readReleaseState, rollbackRelease, writeReleaseState } from '../../services/release/release-state.js';
|
|
7
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
8
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
9
|
+
import { resolveReleaseProjectRoot } from './release-command-shared.js';
|
|
10
|
+
function runReleaseRollback(io, opts) {
|
|
11
|
+
const projectRoot = resolveReleaseProjectRoot(opts.project);
|
|
12
|
+
const state = readReleaseState(projectRoot);
|
|
13
|
+
const result = rollbackRelease(state, opts.note);
|
|
14
|
+
if ('error' in result) {
|
|
15
|
+
printResult(io, fail('release.rollback', 'INVALID_TRANSITION', result.error, { projectRoot }, []), opts.json ?? false);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
writeReleaseState(projectRoot, result.state);
|
|
19
|
+
printResult(io, ok('release.rollback', {
|
|
20
|
+
projectRoot,
|
|
21
|
+
rolledBack: result.record.version,
|
|
22
|
+
finalStage: result.record.currentStage
|
|
23
|
+
}, [], ['Run `peaks release hotfix <version>` to start a hotfix on the previous release.']), opts.json ?? false);
|
|
24
|
+
}
|
|
25
|
+
export function registerReleaseRollbackCommand(release, io) {
|
|
26
|
+
addJsonOption(release
|
|
27
|
+
.command('rollback')
|
|
28
|
+
.description('Emergency rollback of the active release. Moves the active release to ' +
|
|
29
|
+
'the history with currentStage=rolled-back. Available from any ' +
|
|
30
|
+
'pre-done stage.')
|
|
31
|
+
.option('--note <text>', 'optional rollback reason')
|
|
32
|
+
.option('--project <path>', 'project root (default: cwd)')).action((opts) => runReleaseRollback(io, opts));
|
|
33
|
+
}
|