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
|
@@ -1,319 +1,39 @@
|
|
|
1
1
|
// src/cli/commands/baseline-commands.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
io.stdout(JSON.stringify({ ok: true, command, data, warnings: [], nextActions }));
|
|
24
|
-
}
|
|
25
|
-
const CURRENT_DIR = (root) => join(root, 'openspec', 'baselines', 'current');
|
|
26
|
-
const HISTORY_DIR = (root, version) => join(root, 'openspec', 'baselines', 'history', version);
|
|
27
|
-
/** Whitelist of supported `--scorer` values for `peaks baseline audit`. */
|
|
28
|
-
const SCORER_MODES = ['live', 'stub'];
|
|
29
|
-
/**
|
|
30
|
-
* `live` is the default because it is the credential-free one. Defaulting to
|
|
31
|
-
* `stub` would leave the publish gate permanently inconclusive; defaulting to a
|
|
32
|
-
* scorer that needs a key would leave it unrunnable in CI.
|
|
33
|
-
*/
|
|
34
|
-
const DEFAULT_SCORER_MODE = 'live';
|
|
35
|
-
function isScorerMode(v) {
|
|
36
|
-
return v !== undefined && SCORER_MODES.includes(v);
|
|
37
|
-
}
|
|
38
|
-
/** The guard `run-guard` / `audit` execute against. */
|
|
39
|
-
function guardContext(projectRoot) {
|
|
40
|
-
return { projectRoot, sessionId: 'cli', contract: {}, baselineInvariant: 'auto' };
|
|
41
|
-
}
|
|
2
|
+
//
|
|
3
|
+
// `peaks baseline` — manage the capability baseline (frozen product semantics
|
|
4
|
+
// for the 15 P0 journeys). Registration order is the user's reading order and
|
|
5
|
+
// is what the whole-registry render pins; each verb's body lives beside this
|
|
6
|
+
// file, over the shared envelope / path / scorer vocabulary in
|
|
7
|
+
// `baseline-command-shared.ts`.
|
|
8
|
+
//
|
|
9
|
+
// - `baseline freeze` — install a baseline JSON file
|
|
10
|
+
// - `baseline list` — list the 15 P0 journey rows
|
|
11
|
+
// - `baseline show <id>` — show one journey row
|
|
12
|
+
// - `baseline run-guard` — run the guard contracts over the baseline
|
|
13
|
+
// - `baseline diff` — current implementation vs. frozen baseline
|
|
14
|
+
// - `baseline audit` — the independent-context scorer
|
|
15
|
+
// - `baseline freeze-update` — update rows, with the user's approval
|
|
16
|
+
// - `baseline rollback` — roll back to a historical version
|
|
17
|
+
// - `baseline reset` — wipe the current baseline
|
|
18
|
+
import { registerBaselineFreezeCommand, registerBaselineFreezeUpdateCommand } from './baseline-freeze-commands.js';
|
|
19
|
+
import { registerBaselineDiffCommand, registerBaselineListCommand, registerBaselineShowCommand } from './baseline-read-commands.js';
|
|
20
|
+
import { registerBaselineRunGuardCommand } from './baseline-guard-command.js';
|
|
21
|
+
import { registerBaselineAuditCommand } from './baseline-audit-command.js';
|
|
22
|
+
import { registerBaselineResetCommand, registerBaselineRollbackCommand } from './baseline-rollback-commands.js';
|
|
42
23
|
export function registerBaselineCommands(program, io) {
|
|
43
24
|
const baseline = program
|
|
44
25
|
.command('baseline')
|
|
45
26
|
.description('Manage the capability baseline (frozen product semantics for 15 P0 journeys).');
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const file = JSON.parse(readFileSync(opts.from, 'utf8'));
|
|
59
|
-
const v = validateBaselineFile(file);
|
|
60
|
-
if (!v.ok) {
|
|
61
|
-
fail(io, v.error.code, v.error.message);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const out = writeBaselineFile({ projectRoot, file });
|
|
65
|
-
historySnapshot({ projectRoot, version: file.version });
|
|
66
|
-
ok(io, 'baseline.freeze', { path: out.path, lockPath: out.lockPath, version: file.version });
|
|
67
|
-
});
|
|
68
|
-
baseline
|
|
69
|
-
.command('list')
|
|
70
|
-
.description('List the 15 P0 journey rows in the frozen baseline.')
|
|
71
|
-
.option('--project <path>', 'Project root', '.')
|
|
72
|
-
.option('--json', 'Emit JSON envelope')
|
|
73
|
-
.action((opts) => {
|
|
74
|
-
const projectRoot = opts.project ?? '.';
|
|
75
|
-
const r = readBaselineFile(projectRoot);
|
|
76
|
-
if (!r.ok) {
|
|
77
|
-
fail(io, r.error.code, r.error.message);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const rows = r.file.rows.map((row) => ({
|
|
81
|
-
journeyId: row.journeyId,
|
|
82
|
-
intent: row.intent,
|
|
83
|
-
invariantCount: row.invariants.length
|
|
84
|
-
}));
|
|
85
|
-
ok(io, 'baseline.list', { version: r.file.version, signedAt: r.file.signedAt, rows });
|
|
86
|
-
});
|
|
87
|
-
baseline
|
|
88
|
-
.command('show <journeyId>')
|
|
89
|
-
.description('Show one journey row.')
|
|
90
|
-
.option('--project <path>', 'Project root', '.')
|
|
91
|
-
.option('--json', 'Emit JSON envelope')
|
|
92
|
-
.action((journeyId, opts) => {
|
|
93
|
-
const projectRoot = opts.project ?? '.';
|
|
94
|
-
const r = readBaselineFile(projectRoot);
|
|
95
|
-
if (!r.ok) {
|
|
96
|
-
fail(io, r.error.code, r.error.message);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const row = r.file.rows.find((x) => x.journeyId === journeyId);
|
|
100
|
-
if (!row) {
|
|
101
|
-
fail(io, 'BASELINE_ROW_SHAPE_INVALID', `row ${journeyId} not found`);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
ok(io, 'baseline.show', row);
|
|
105
|
-
});
|
|
106
|
-
baseline
|
|
107
|
-
.command('run-guard')
|
|
108
|
-
.description('Run the guard contracts over the frozen baseline. Runs all 15 journeys unless --journey is given.')
|
|
109
|
-
.option('--journey <id>', `Run only one journey (${P0_JOURNEY_IDS.join('|')}); default is all 15.`)
|
|
110
|
-
.option('--project <path>', 'Project root', '.')
|
|
111
|
-
.option('--json', 'Emit JSON envelope')
|
|
112
|
-
.action(async (opts) => {
|
|
113
|
-
const projectRoot = opts.project ?? '.';
|
|
114
|
-
let contracts;
|
|
115
|
-
if (opts.journey === undefined) {
|
|
116
|
-
contracts = GUARD_CONTRACTS;
|
|
117
|
-
}
|
|
118
|
-
else if (!isJourneyId(opts.journey)) {
|
|
119
|
-
fail(io, 'UNKNOWN_JOURNEY', `unknown journey "${opts.journey}"; expected one of ${P0_JOURNEY_IDS.join(', ')}`);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
const contract = getGuardContract(opts.journey);
|
|
124
|
-
if (contract === undefined) {
|
|
125
|
-
fail(io, 'UNKNOWN_JOURNEY', `no guard contract is registered for ${opts.journey}`);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
contracts = [contract];
|
|
129
|
-
}
|
|
130
|
-
const summary = await runAllGuards(contracts, guardContext(projectRoot));
|
|
131
|
-
const data = summary;
|
|
132
|
-
const exitCode = exitCodeForGuardSummary(summary);
|
|
133
|
-
if (exitCode === 0) {
|
|
134
|
-
ok(io, 'baseline.run-guard', data);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
fail(io, exitCode === 1 ? 'GUARD_FAILED' : 'GUARD_SKIPPED', `${String(summary.fail)} failed, ${String(summary.skipped)} skipped of ${String(summary.total)} guard contracts`, data);
|
|
138
|
-
// `fail` sets 1; a skipped run is a distinct outcome from a failed one.
|
|
139
|
-
process.exitCode = exitCode;
|
|
140
|
-
});
|
|
141
|
-
baseline
|
|
142
|
-
.command('diff')
|
|
143
|
-
.description('Show current implementation vs. frozen baseline.')
|
|
144
|
-
.option('--project <path>', 'Project root', '.')
|
|
145
|
-
.option('--json', 'Emit JSON envelope')
|
|
146
|
-
.action((opts) => {
|
|
147
|
-
const projectRoot = opts.project ?? '.';
|
|
148
|
-
const r = readBaselineFile(projectRoot);
|
|
149
|
-
if (!r.ok) {
|
|
150
|
-
fail(io, r.error.code, r.error.message);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
ok(io, 'baseline.diff', {
|
|
154
|
-
version: r.file.version,
|
|
155
|
-
signedAt: r.file.signedAt,
|
|
156
|
-
rowsCount: r.file.rows.length
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
baseline
|
|
160
|
-
.command('audit')
|
|
161
|
-
.description('Run the capability audit (independent-context scorer). Exits non-zero unless the verdict is consistent.')
|
|
162
|
-
.option('--scorer <mode>', `Scorer to run: ${SCORER_MODES.join('|')}. 'live' (default) runs the deterministic independent checker, which needs no credentials; 'stub' performs no evaluation and can never be consistent.`, DEFAULT_SCORER_MODE)
|
|
163
|
-
.option('--project <path>', 'Project root', '.')
|
|
164
|
-
.option('--json', 'Emit JSON envelope')
|
|
165
|
-
.action(async (opts) => {
|
|
166
|
-
const projectRoot = opts.project ?? '.';
|
|
167
|
-
if (!isScorerMode(opts.scorer)) {
|
|
168
|
-
fail(io, 'UNKNOWN_SCORER', `unknown scorer "${String(opts.scorer)}"; expected one of ${SCORER_MODES.join(', ')}`);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const r = readBaselineFile(projectRoot);
|
|
172
|
-
if (!r.ok) {
|
|
173
|
-
fail(io, r.error.code, r.error.message);
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
// The guard summary is the REAL aggregate of the 15 contracts. It used to
|
|
177
|
-
// be a literal `{pass:15,fail:0,skipped:0,total:15}` that no run produced.
|
|
178
|
-
const guardSummary = await runAllGuards(GUARD_CONTRACTS, guardContext(projectRoot));
|
|
179
|
-
// `live` is the deterministic independent checker: a real
|
|
180
|
-
// separate-context evaluation that needs no credentials, which is why it
|
|
181
|
-
// is the only kind that can run inside the secretless OIDC publish gate.
|
|
182
|
-
// It is handed the frozen rows and the registry, not just the guard
|
|
183
|
-
// summary — a scorer that only sees the guard result is a restatement.
|
|
184
|
-
const { runAudit } = await import('../../services/capability-audit-service/runner.js');
|
|
185
|
-
// `sessionId` is the on-disk scope for the audit artifacts. This command
|
|
186
|
-
// has NO session — it is the credential-free scorer that runs inside the
|
|
187
|
-
// secretless OIDC publish gate — and it used to pass the literal `'cli'`,
|
|
188
|
-
// so every run wrote `.peaks/_runtime/cli/capability-audit/*.json` into
|
|
189
|
-
// the operator's real workspace. That directory is indistinguishable from
|
|
190
|
-
// a session dir whose id failed validation, so `peaks doctor`'s
|
|
191
|
-
// orphan-session check failed on it permanently (`4 orphan session(s)
|
|
192
|
-
// …: callers, cli, unknown-sid, x`, exit 1). The reserved
|
|
193
|
-
// underscore-prefixed scope says "machinery, not a session" in the name.
|
|
194
|
-
const audit = await runAudit({
|
|
195
|
-
projectRoot,
|
|
196
|
-
sessionId: RUNTIME_SESSIONLESS_SCOPE,
|
|
197
|
-
journeyId: 'J01',
|
|
198
|
-
scorerMode: opts.scorer,
|
|
199
|
-
baselineRows: r.file.rows,
|
|
200
|
-
contracts: GUARD_CONTRACTS,
|
|
201
|
-
guardSummary
|
|
202
|
-
});
|
|
203
|
-
const data = audit;
|
|
204
|
-
if (audit.verdict === 'consistent' && !audit.degraded) {
|
|
205
|
-
ok(io, 'baseline.audit', data);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
fail(io, 'AUDIT_NOT_CONSISTENT', `capability audit verdict is "${audit.verdict}"${audit.degraded ? ' (degraded: stub scorer)' : ''}`, data);
|
|
209
|
-
});
|
|
210
|
-
baseline
|
|
211
|
-
.command('freeze-update')
|
|
212
|
-
.description("Update one or more baseline rows. The LLM authors the JSON; --confirm records the user's approval.")
|
|
213
|
-
.option('--from <path>', 'Path to the new baseline JSON input')
|
|
214
|
-
.option('--confirm', "Record the user's approval (collected via AskUserQuestion) for this ratchet change")
|
|
215
|
-
.option('--project <path>', 'Project root', '.')
|
|
216
|
-
.option('--json', 'Emit JSON envelope')
|
|
217
|
-
.action((opts) => {
|
|
218
|
-
const projectRoot = opts.project ?? '.';
|
|
219
|
-
if (opts.confirm !== true) {
|
|
220
|
-
fail(io, 'HUMAN_NL_DECISION_REQUIRED', 'freeze-update requires the user to approve the ratchet change via AskUserQuestion. The LLM must surface a multi-choice prompt, then re-run with --confirm.');
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
if (!opts.from) {
|
|
224
|
-
fail(io, 'MISSING_ARG', '--from is required');
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
const r = readBaselineFile(projectRoot);
|
|
228
|
-
if (!r.ok) {
|
|
229
|
-
fail(io, r.error.code, r.error.message);
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
const file = JSON.parse(readFileSync(opts.from, 'utf8'));
|
|
233
|
-
const v = validateBaselineFile(file);
|
|
234
|
-
if (!v.ok) {
|
|
235
|
-
fail(io, v.error.code, v.error.message);
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
const out = writeBaselineFile({ projectRoot, file });
|
|
239
|
-
historySnapshot({ projectRoot, version: file.version });
|
|
240
|
-
ok(io, 'baseline.freeze-update', {
|
|
241
|
-
path: out.path,
|
|
242
|
-
lockPath: out.lockPath,
|
|
243
|
-
fromVersion: r.file.version,
|
|
244
|
-
version: file.version
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
baseline
|
|
248
|
-
.command('rollback')
|
|
249
|
-
.description("Roll the baseline back to a historical version. --confirm records the user's approval.")
|
|
250
|
-
.option('--to <version>', 'Historical version to roll back to')
|
|
251
|
-
.option('--confirm', "Record the user's approval (collected via AskUserQuestion) for this rollback")
|
|
252
|
-
.option('--project <path>', 'Project root', '.')
|
|
253
|
-
.option('--json', 'Emit JSON envelope')
|
|
254
|
-
.action((opts) => {
|
|
255
|
-
const projectRoot = opts.project ?? '.';
|
|
256
|
-
if (opts.confirm !== true) {
|
|
257
|
-
fail(io, 'HUMAN_NL_DECISION_REQUIRED', 'rollback requires the user to approve via AskUserQuestion. The LLM must surface a multi-choice prompt, then re-run with --confirm.');
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
if (!opts.to) {
|
|
261
|
-
fail(io, 'MISSING_ARG', '--to is required');
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
const source = HISTORY_DIR(projectRoot, opts.to);
|
|
265
|
-
const from = join(source, 'capability-baseline.json');
|
|
266
|
-
const fromLock = join(source, 'capability-baseline.lock');
|
|
267
|
-
if (!existsSync(from) || !existsSync(fromLock)) {
|
|
268
|
-
fail(io, 'BASELINE_HISTORY_GAP', `no frozen baseline recorded for version ${opts.to}`);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
const r = readBaselineFile(projectRoot);
|
|
272
|
-
if (!r.ok) {
|
|
273
|
-
fail(io, r.error.code, r.error.message);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
mkdirSync(CURRENT_DIR(projectRoot), { recursive: true });
|
|
277
|
-
copyFileSync(from, join(CURRENT_DIR(projectRoot), 'capability-baseline.json'));
|
|
278
|
-
copyFileSync(fromLock, join(CURRENT_DIR(projectRoot), 'capability-baseline.lock'));
|
|
279
|
-
// Re-read through the locked store so a tampered history entry cannot be
|
|
280
|
-
// installed: the copy is only reported successful if it verifies.
|
|
281
|
-
const after = readBaselineFile(projectRoot);
|
|
282
|
-
if (!after.ok) {
|
|
283
|
-
fail(io, after.error.code, after.error.message);
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
ok(io, 'baseline.rollback', {
|
|
287
|
-
fromVersion: r.file.version,
|
|
288
|
-
toVersion: after.file.version,
|
|
289
|
-
historyPath: source
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
baseline
|
|
293
|
-
.command('reset')
|
|
294
|
-
.description("Wipe the current baseline and require a re-freeze. --confirm records the user's approval.")
|
|
295
|
-
.option('--confirm', "Record the user's approval (collected via AskUserQuestion) for the wipe")
|
|
296
|
-
.option('--project <path>', 'Project root', '.')
|
|
297
|
-
.option('--json', 'Emit JSON envelope')
|
|
298
|
-
.action((opts) => {
|
|
299
|
-
const projectRoot = opts.project ?? '.';
|
|
300
|
-
if (opts.confirm !== true) {
|
|
301
|
-
fail(io, 'HUMAN_NL_DECISION_REQUIRED', 'reset requires the user to approve via AskUserQuestion. The LLM must surface a multi-choice prompt, then re-run with --confirm.');
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
const r = readBaselineFile(projectRoot);
|
|
305
|
-
// A missing baseline is already "wiped" — but an unreadable one (hash
|
|
306
|
-
// mismatch / unsigned lock) must not be silently discarded.
|
|
307
|
-
if (!r.ok && r.error.code !== 'BASELINE_NOT_FOUND') {
|
|
308
|
-
fail(io, r.error.code, r.error.message);
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
const wipedVersion = r.ok ? r.file.version : null;
|
|
312
|
-
rmSync(join(CURRENT_DIR(projectRoot), 'capability-baseline.json'), { force: true });
|
|
313
|
-
rmSync(join(CURRENT_DIR(projectRoot), 'capability-baseline.lock'), { force: true });
|
|
314
|
-
ok(io, 'baseline.reset', {
|
|
315
|
-
wipedVersion,
|
|
316
|
-
nextAction: 're-freeze with `baseline freeze --from <path>`'
|
|
317
|
-
});
|
|
318
|
-
});
|
|
27
|
+
// The call order below IS the registration order the whole-registry render
|
|
28
|
+
// pins, so it stays the order the verbs shipped in — a file may hold two
|
|
29
|
+
// verbs' bodies without moving either.
|
|
30
|
+
registerBaselineFreezeCommand(baseline, io);
|
|
31
|
+
registerBaselineListCommand(baseline, io);
|
|
32
|
+
registerBaselineShowCommand(baseline, io);
|
|
33
|
+
registerBaselineRunGuardCommand(baseline, io);
|
|
34
|
+
registerBaselineDiffCommand(baseline, io);
|
|
35
|
+
registerBaselineAuditCommand(baseline, io);
|
|
36
|
+
registerBaselineFreezeUpdateCommand(baseline, io);
|
|
37
|
+
registerBaselineRollbackCommand(baseline, io);
|
|
38
|
+
registerBaselineResetCommand(baseline, io);
|
|
319
39
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { ProgramIO } from '../cli-helpers.js';
|
|
3
|
+
export declare function registerBaselineFreezeCommand(baseline: Command, io: ProgramIO): void;
|
|
4
|
+
export declare function registerBaselineFreezeUpdateCommand(baseline: Command, io: ProgramIO): void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/cli/commands/baseline-freeze-commands.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks baseline freeze` and `peaks baseline freeze-update` — install a
|
|
4
|
+
// baseline JSON file and snapshot the previous version into history. Split out
|
|
5
|
+
// of `baseline-commands.ts`; every envelope code, message, data field and
|
|
6
|
+
// next-action string is unchanged.
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { historySnapshot, readBaselineFile, writeBaselineFile } from '../../services/capability-baseline/store.js';
|
|
9
|
+
import { validateBaselineFile } from '../../services/capability-baseline/validator.js';
|
|
10
|
+
import { fail, ok } from './baseline-command-shared.js';
|
|
11
|
+
/**
|
|
12
|
+
* Parse, validate, install and snapshot one baseline file. Returns where it
|
|
13
|
+
* landed and its version on success; prints the matching refusal and returns
|
|
14
|
+
* null otherwise.
|
|
15
|
+
*/
|
|
16
|
+
function installBaseline(io, projectRoot, from) {
|
|
17
|
+
const file = JSON.parse(readFileSync(from, 'utf8'));
|
|
18
|
+
const v = validateBaselineFile(file);
|
|
19
|
+
if (!v.ok) {
|
|
20
|
+
fail(io, v.error.code, v.error.message);
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const out = writeBaselineFile({ projectRoot, file });
|
|
24
|
+
historySnapshot({ projectRoot, version: file.version });
|
|
25
|
+
return { path: out.path, lockPath: out.lockPath, version: file.version };
|
|
26
|
+
}
|
|
27
|
+
function runFreeze(io, opts) {
|
|
28
|
+
const projectRoot = opts.project ?? '.';
|
|
29
|
+
if (!opts.from) {
|
|
30
|
+
fail(io, 'MISSING_ARG', '--from is required');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const out = installBaseline(io, projectRoot, opts.from);
|
|
34
|
+
if (out === null)
|
|
35
|
+
return;
|
|
36
|
+
ok(io, 'baseline.freeze', { path: out.path, lockPath: out.lockPath, version: out.version });
|
|
37
|
+
}
|
|
38
|
+
function runFreezeUpdate(io, opts) {
|
|
39
|
+
const projectRoot = opts.project ?? '.';
|
|
40
|
+
if (opts.confirm !== true) {
|
|
41
|
+
fail(io, 'HUMAN_NL_DECISION_REQUIRED', 'freeze-update requires the user to approve the ratchet change via AskUserQuestion. The LLM must surface a multi-choice prompt, then re-run with --confirm.');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!opts.from) {
|
|
45
|
+
fail(io, 'MISSING_ARG', '--from is required');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const r = readBaselineFile(projectRoot);
|
|
49
|
+
if (!r.ok) {
|
|
50
|
+
fail(io, r.error.code, r.error.message);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const out = installBaseline(io, projectRoot, opts.from);
|
|
54
|
+
if (out === null)
|
|
55
|
+
return;
|
|
56
|
+
ok(io, 'baseline.freeze-update', {
|
|
57
|
+
path: out.path,
|
|
58
|
+
lockPath: out.lockPath,
|
|
59
|
+
fromVersion: r.file.version,
|
|
60
|
+
version: out.version
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export function registerBaselineFreezeCommand(baseline, io) {
|
|
64
|
+
baseline
|
|
65
|
+
.command('freeze')
|
|
66
|
+
.description('Freeze the capability baseline from a JSON file (SquabbyZ-signed).')
|
|
67
|
+
.option('--from <path>', 'Path to the baseline JSON input.')
|
|
68
|
+
.option('--project <path>', 'Project root', '.')
|
|
69
|
+
.option('--json', 'Emit JSON envelope')
|
|
70
|
+
.action((opts) => runFreeze(io, opts));
|
|
71
|
+
}
|
|
72
|
+
export function registerBaselineFreezeUpdateCommand(baseline, io) {
|
|
73
|
+
baseline
|
|
74
|
+
.command('freeze-update')
|
|
75
|
+
.description("Update one or more baseline rows. The LLM authors the JSON; --confirm records the user's approval.")
|
|
76
|
+
.option('--from <path>', 'Path to the new baseline JSON input')
|
|
77
|
+
.option('--confirm', "Record the user's approval (collected via AskUserQuestion) for this ratchet change")
|
|
78
|
+
.option('--project <path>', 'Project root', '.')
|
|
79
|
+
.option('--json', 'Emit JSON envelope')
|
|
80
|
+
.action((opts) => runFreezeUpdate(io, opts));
|
|
81
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/cli/commands/baseline-guard-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks baseline run-guard` — run the guard contracts over the frozen
|
|
4
|
+
// baseline. Split out of `baseline-commands.ts`; the journey selector, the
|
|
5
|
+
// refusal codes, the summary data and the exit-code rule are unchanged.
|
|
6
|
+
import { GUARD_CONTRACTS, getGuardContract, isJourneyId } from '../../services/capability-guard-runner/registry.js';
|
|
7
|
+
import { exitCodeForGuardSummary, runAllGuards } from '../../services/capability-guard-runner/runner.js';
|
|
8
|
+
import { P0_JOURNEY_IDS } from '../../services/capability-baseline/types.js';
|
|
9
|
+
import { fail, guardContext, ok } from './baseline-command-shared.js';
|
|
10
|
+
/**
|
|
11
|
+
* The contracts `--journey` selects: all 15 when the flag is absent, the one
|
|
12
|
+
* named contract when it is, or null after the matching refusal was printed.
|
|
13
|
+
*/
|
|
14
|
+
function selectContracts(io, journey) {
|
|
15
|
+
if (journey === undefined)
|
|
16
|
+
return GUARD_CONTRACTS;
|
|
17
|
+
if (!isJourneyId(journey)) {
|
|
18
|
+
fail(io, 'UNKNOWN_JOURNEY', `unknown journey "${journey}"; expected one of ${P0_JOURNEY_IDS.join(', ')}`);
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const contract = getGuardContract(journey);
|
|
22
|
+
if (contract === undefined) {
|
|
23
|
+
fail(io, 'UNKNOWN_JOURNEY', `no guard contract is registered for ${journey}`);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return [contract];
|
|
27
|
+
}
|
|
28
|
+
async function runGuard(io, opts) {
|
|
29
|
+
const projectRoot = opts.project ?? '.';
|
|
30
|
+
const contracts = selectContracts(io, opts.journey);
|
|
31
|
+
if (contracts === null)
|
|
32
|
+
return;
|
|
33
|
+
const summary = await runAllGuards(contracts, guardContext(projectRoot));
|
|
34
|
+
const data = summary;
|
|
35
|
+
const exitCode = exitCodeForGuardSummary(summary);
|
|
36
|
+
if (exitCode === 0) {
|
|
37
|
+
ok(io, 'baseline.run-guard', data);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
fail(io, exitCode === 1 ? 'GUARD_FAILED' : 'GUARD_SKIPPED', `${String(summary.fail)} failed, ${String(summary.skipped)} skipped of ${String(summary.total)} guard contracts`, data);
|
|
41
|
+
// `fail` sets 1; a skipped run is a distinct outcome from a failed one.
|
|
42
|
+
process.exitCode = exitCode;
|
|
43
|
+
}
|
|
44
|
+
export function registerBaselineRunGuardCommand(baseline, io) {
|
|
45
|
+
baseline
|
|
46
|
+
.command('run-guard')
|
|
47
|
+
.description('Run the guard contracts over the frozen baseline. Runs all 15 journeys unless --journey is given.')
|
|
48
|
+
.option('--journey <id>', `Run only one journey (${P0_JOURNEY_IDS.join('|')}); default is all 15.`)
|
|
49
|
+
.option('--project <path>', 'Project root', '.')
|
|
50
|
+
.option('--json', 'Emit JSON envelope')
|
|
51
|
+
.action((opts) => runGuard(io, opts));
|
|
52
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { ProgramIO } from '../cli-helpers.js';
|
|
3
|
+
export declare function registerBaselineListCommand(baseline: Command, io: ProgramIO): void;
|
|
4
|
+
export declare function registerBaselineShowCommand(baseline: Command, io: ProgramIO): void;
|
|
5
|
+
export declare function registerBaselineDiffCommand(baseline: Command, io: ProgramIO): void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/cli/commands/baseline-read-commands.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks baseline list` / `show` / `diff` — the three read-only projections of
|
|
4
|
+
// the frozen baseline. Split out of `baseline-commands.ts`; every envelope
|
|
5
|
+
// command name, code and data field is unchanged.
|
|
6
|
+
import { readBaselineFile } from '../../services/capability-baseline/store.js';
|
|
7
|
+
import { fail, ok } from './baseline-command-shared.js';
|
|
8
|
+
function runList(io, opts) {
|
|
9
|
+
const projectRoot = opts.project ?? '.';
|
|
10
|
+
const r = readBaselineFile(projectRoot);
|
|
11
|
+
if (!r.ok) {
|
|
12
|
+
fail(io, r.error.code, r.error.message);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const rows = r.file.rows.map((row) => ({
|
|
16
|
+
journeyId: row.journeyId,
|
|
17
|
+
intent: row.intent,
|
|
18
|
+
invariantCount: row.invariants.length
|
|
19
|
+
}));
|
|
20
|
+
ok(io, 'baseline.list', { version: r.file.version, signedAt: r.file.signedAt, rows });
|
|
21
|
+
}
|
|
22
|
+
function runShow(io, journeyId, opts) {
|
|
23
|
+
const projectRoot = opts.project ?? '.';
|
|
24
|
+
const r = readBaselineFile(projectRoot);
|
|
25
|
+
if (!r.ok) {
|
|
26
|
+
fail(io, r.error.code, r.error.message);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const row = r.file.rows.find((x) => x.journeyId === journeyId);
|
|
30
|
+
if (!row) {
|
|
31
|
+
fail(io, 'BASELINE_ROW_SHAPE_INVALID', `row ${journeyId} not found`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
ok(io, 'baseline.show', row);
|
|
35
|
+
}
|
|
36
|
+
function runDiff(io, opts) {
|
|
37
|
+
const projectRoot = opts.project ?? '.';
|
|
38
|
+
const r = readBaselineFile(projectRoot);
|
|
39
|
+
if (!r.ok) {
|
|
40
|
+
fail(io, r.error.code, r.error.message);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
ok(io, 'baseline.diff', {
|
|
44
|
+
version: r.file.version,
|
|
45
|
+
signedAt: r.file.signedAt,
|
|
46
|
+
rowsCount: r.file.rows.length
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function registerBaselineListCommand(baseline, io) {
|
|
50
|
+
baseline
|
|
51
|
+
.command('list')
|
|
52
|
+
.description('List the 15 P0 journey rows in the frozen baseline.')
|
|
53
|
+
.option('--project <path>', 'Project root', '.')
|
|
54
|
+
.option('--json', 'Emit JSON envelope')
|
|
55
|
+
.action((opts) => runList(io, opts));
|
|
56
|
+
}
|
|
57
|
+
export function registerBaselineShowCommand(baseline, io) {
|
|
58
|
+
baseline
|
|
59
|
+
.command('show <journeyId>')
|
|
60
|
+
.description('Show one journey row.')
|
|
61
|
+
.option('--project <path>', 'Project root', '.')
|
|
62
|
+
.option('--json', 'Emit JSON envelope')
|
|
63
|
+
.action((journeyId, opts) => runShow(io, journeyId, opts));
|
|
64
|
+
}
|
|
65
|
+
export function registerBaselineDiffCommand(baseline, io) {
|
|
66
|
+
baseline
|
|
67
|
+
.command('diff')
|
|
68
|
+
.description('Show current implementation vs. frozen baseline.')
|
|
69
|
+
.option('--project <path>', 'Project root', '.')
|
|
70
|
+
.option('--json', 'Emit JSON envelope')
|
|
71
|
+
.action((opts) => runDiff(io, opts));
|
|
72
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { ProgramIO } from '../cli-helpers.js';
|
|
3
|
+
export declare function registerBaselineRollbackCommand(baseline: Command, io: ProgramIO): void;
|
|
4
|
+
export declare function registerBaselineResetCommand(baseline: Command, io: ProgramIO): void;
|