peaks-loop 4.1.3 → 4.1.5
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 +7 -2
- package/CHANGELOG.md +168 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/cli-helpers.d.ts +20 -0
- package/dist/cli/cli-helpers.js +34 -0
- package/dist/cli/commands/_register.js +2 -0
- 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-commands.d.ts +6 -4
- package/dist/cli/commands/code-commands.js +6 -4
- package/dist/cli/commands/code-emit-handoff-command.js +40 -3
- package/dist/cli/commands/code-gate-command.d.ts +5 -5
- package/dist/cli/commands/code-gate-command.js +49 -9
- package/dist/cli/commands/code-gate-step-08-command.js +25 -9
- package/dist/cli/commands/code-mode-gate-plan-command.d.ts +1 -1
- package/dist/cli/commands/code-mode-gate-plan-command.js +2 -2
- 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 +95 -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-cli-invocation-check.d.ts +108 -0
- package/dist/cli/commands/dispatch-cli-invocation-check.js +87 -0
- package/dist/cli/commands/dispatch-cli-invocation-scan.d.ts +66 -0
- package/dist/cli/commands/dispatch-cli-invocation-scan.js +162 -0
- package/dist/cli/commands/dispatch-commands.js +12 -5
- 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/dispatch-preflight.js +46 -0
- package/dist/cli/commands/dispatch-prompt-composition.d.ts +6 -0
- package/dist/cli/commands/dispatch-prompt-composition.js +29 -7
- package/dist/cli/commands/doc-commands.js +1 -1
- package/dist/cli/commands/feedback-commands-helpers.js +1 -1
- 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 +221 -0
- package/dist/cli/commands/gate-commands-enforce.js +3 -3
- 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/hook-handle.js +41 -20
- 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/lint-commands.js +3 -1
- 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-eval-capture-index.js +2 -4
- 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/perf-audit-commands.js +15 -5
- 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 +101 -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/race-commands.d.ts +15 -0
- package/dist/cli/commands/race-commands.js +65 -0
- package/dist/cli/commands/race-pilot-gate-record-command.d.ts +3 -0
- package/dist/cli/commands/race-pilot-gate-record-command.js +81 -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/request-command-options.d.ts +8 -0
- package/dist/cli/commands/request-commands.js +2 -0
- package/dist/cli/commands/request-init-command.js +67 -12
- package/dist/cli/commands/request-retag-command.d.ts +3 -0
- package/dist/cli/commands/request-retag-command.js +50 -0
- package/dist/cli/commands/request-show-command.d.ts +8 -0
- package/dist/cli/commands/request-show-command.js +14 -1
- package/dist/cli/commands/request-transition-command.js +12 -4
- package/dist/cli/commands/request-transition-failures.d.ts +14 -0
- package/dist/cli/commands/request-transition-failures.js +45 -3
- package/dist/cli/commands/scan-scope-commands.js +2 -2
- package/dist/cli/commands/security-audit-commands.js +26 -6
- 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/cli/commands/worktree-lease-gc-command.js +1 -1
- package/dist/services/artifacts/artifact-contract-block.d.ts +53 -0
- package/dist/services/artifacts/artifact-contract-block.js +212 -0
- package/dist/services/artifacts/artifact-prerequisites.d.ts +27 -19
- package/dist/services/artifacts/artifact-prerequisites.js +63 -133
- package/dist/services/artifacts/artifact-templates.d.ts +1 -1
- package/dist/services/artifacts/artifact-templates.js +17 -10
- package/dist/services/artifacts/prerequisite-checks.d.ts +87 -0
- package/dist/services/artifacts/prerequisite-checks.js +198 -0
- package/dist/services/artifacts/prerequisite-transition-event.d.ts +20 -0
- package/dist/services/artifacts/prerequisite-transition-event.js +27 -0
- package/dist/services/artifacts/request-artifact-metadata.d.ts +31 -0
- package/dist/services/artifacts/request-artifact-metadata.js +44 -0
- package/dist/services/artifacts/request-artifact-service.d.ts +5 -0
- package/dist/services/artifacts/request-artifact-service.js +23 -51
- package/dist/services/artifacts/request-artifact-state-helpers.d.ts +12 -0
- package/dist/services/artifacts/request-artifact-state-helpers.js +28 -4
- package/dist/services/artifacts/request-retag-service.d.ts +68 -0
- package/dist/services/artifacts/request-retag-service.js +125 -0
- package/dist/services/artifacts/request-state-order.d.ts +38 -0
- package/dist/services/artifacts/request-state-order.js +99 -0
- package/dist/services/artifacts/request-type-demand.d.ts +44 -0
- package/dist/services/artifacts/request-type-demand.js +71 -0
- package/dist/services/audit/audit-goal-service.d.ts +7 -0
- package/dist/services/audit/enforcers/active-skill-resolver.d.ts +18 -0
- package/dist/services/audit/enforcers/active-skill-resolver.js +48 -1
- package/dist/services/audit/enforcers/code-ban.d.ts +11 -2
- package/dist/services/audit/enforcers/code-ban.js +21 -1
- package/dist/services/audit/red-line-catalog-p2-a-bee-runtime.d.ts +17 -0
- package/dist/services/audit/red-line-catalog-p2-a-bee-runtime.js +24 -7
- package/dist/services/audit-independent/handoff-missing-refusal.d.ts +26 -0
- package/dist/services/audit-independent/handoff-missing-refusal.js +109 -0
- package/dist/services/audit-independent/handoff-readers.d.ts +37 -0
- package/dist/services/audit-independent/handoff-readers.js +81 -0
- package/dist/services/audit-independent/index.d.ts +6 -1
- package/dist/services/audit-independent/index.js +6 -1
- package/dist/services/audit-independent/judged-declaration-build.d.ts +48 -0
- package/dist/services/audit-independent/judged-declaration-build.js +73 -0
- package/dist/services/audit-independent/judged-declaration-check.d.ts +79 -0
- package/dist/services/audit-independent/judged-declaration-check.js +155 -0
- package/dist/services/audit-independent/judged-declaration.d.ts +94 -0
- package/dist/services/audit-independent/judged-declaration.js +218 -0
- package/dist/services/audit-independent/perf-audit-service.js +12 -14
- package/dist/services/audit-independent/security-audit-artifact.d.ts +28 -0
- package/dist/services/audit-independent/security-audit-artifact.js +90 -0
- package/dist/services/audit-independent/security-audit-service.d.ts +6 -53
- package/dist/services/audit-independent/security-audit-service.js +34 -178
- package/dist/services/capability-guard-runner/contracts/J05.js +60 -14
- 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/codegraph/codegraph-index-integrity.js +2 -0
- 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/context/build-dispatch-system-prompt.d.ts +3 -3
- package/dist/services/context/build-dispatch-system-prompt.js +7 -7
- package/dist/services/context/collector.js +5 -1
- package/dist/services/dispatch/active-dispatch-index.d.ts +36 -0
- package/dist/services/dispatch/active-dispatch-index.js +118 -0
- package/dist/services/dispatch/batch-counter.js +1 -2
- package/dist/services/dispatch/dispatch-record-writer.d.ts +29 -16
- package/dist/services/dispatch/dispatch-record-writer.js +58 -100
- package/dist/services/dispatch/dispatch-sub-agent.js +1 -1
- package/dist/services/dispatch/karpathy-block.d.ts +55 -0
- package/dist/services/dispatch/karpathy-block.js +101 -0
- package/dist/services/dispatch/ledger-reaper.d.ts +80 -0
- package/dist/services/dispatch/ledger-reaper.js +131 -0
- package/dist/services/evidence/evidence-generator.js +15 -8
- package/dist/services/feedback/feedback-promotion-service.d.ts +8 -11
- package/dist/services/feedback/feedback-promotion-service.js +30 -35
- package/dist/services/feedback/promotion-artifact-json-evidence.d.ts +18 -0
- package/dist/services/feedback/promotion-artifact-missing.d.ts +22 -0
- package/dist/services/feedback/promotion-artifact-missing.js +63 -0
- package/dist/services/final-review/final-review-contract.d.ts +95 -4
- package/dist/services/final-review/final-review-contract.js +64 -0
- package/dist/services/final-review/final-review-delivery.d.ts +13 -0
- package/dist/services/final-review/final-review-delivery.js +26 -12
- package/dist/services/final-review/final-review-evidence-collect.js +8 -53
- package/dist/services/final-review/final-review-evidence-records.d.ts +21 -0
- package/dist/services/final-review/final-review-evidence-records.js +67 -0
- package/dist/services/final-review/final-review-evidence-sources.d.ts +22 -0
- package/dist/services/final-review/final-review-evidence-sources.js +28 -4
- package/dist/services/final-review/final-review-prompt.js +19 -6
- package/dist/services/final-review/final-review-runner.js +5 -0
- package/dist/services/final-review/final-review-service.d.ts +2 -2
- package/dist/services/final-review/index.d.ts +1 -1
- package/dist/services/final-review/pre-post-diff.d.ts +2 -75
- package/dist/services/final-review/pre-post-diff.js +60 -59
- package/dist/services/hooks/pre-tool-code-gate.d.ts +7 -1
- package/dist/services/hooks/pre-tool-code-gate.js +21 -2
- package/dist/services/hooks/worktree-authorization-gate.js +6 -31
- package/dist/services/hooks/worktree-refusal-messages.d.ts +74 -0
- package/dist/services/hooks/worktree-refusal-messages.js +102 -0
- package/dist/services/lint/eslint-runner-support.d.ts +1 -1
- package/dist/services/lint/eslint-runner-support.js +2 -1
- package/dist/services/lint/eslint-runner-types.d.ts +8 -0
- package/dist/services/lint/eslint-runner.js +17 -4
- package/dist/services/llm/anthropic-runner.js +24 -7
- package/dist/services/loop/loop-observability.d.ts +39 -0
- package/dist/services/loop/loop-observability.js +55 -0
- package/dist/services/loop/monotonic-guard.js +6 -9
- package/dist/services/loop/monotonic-runner.js +8 -7
- package/dist/services/loop/run-driver.js +18 -22
- package/dist/services/memory/project-memory-service/index/kind-dispatch.js +14 -1
- package/dist/services/memory/project-memory-service/index/project-memory-plan-exec.js +13 -2
- package/dist/services/memory/project-memory-service/index.d.ts +2 -2
- package/dist/services/memory/project-memory-service/index.js +1 -1
- package/dist/services/memory/project-memory-service/parsers/frontmatter-parse.d.ts +36 -0
- package/dist/services/memory/project-memory-service/parsers/frontmatter-parse.js +48 -2
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.d.ts +23 -1
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.js +37 -0
- package/dist/services/memory/project-memory-service/types.d.ts +32 -0
- package/dist/services/observability/observability-service.d.ts +7 -0
- package/dist/services/observability/observability-service.js +2 -1
- package/dist/services/prd/gate-evidence-derivation.d.ts +4 -3
- package/dist/services/prd/gate-evidence-derivation.js +4 -3
- package/dist/services/qa/bdd-test-style-verifier.js +22 -8
- package/dist/services/race/gate2-evaluator.d.ts +58 -0
- package/dist/services/race/gate2-evaluator.js +111 -0
- package/dist/services/race/gate2-policy.d.ts +17 -0
- package/dist/services/race/gate2-policy.js +31 -0
- package/dist/services/race/lane-phase.d.ts +19 -0
- package/dist/services/race/lane-phase.js +113 -0
- package/dist/services/race/pilot-gate-store.d.ts +67 -0
- package/dist/services/race/pilot-gate-store.js +227 -0
- package/dist/services/scan/file-size-baseline.d.ts +26 -0
- package/dist/services/scan/file-size-baseline.js +150 -0
- package/dist/services/scan/file-size-scan.d.ts +42 -3
- package/dist/services/scan/file-size-scan.js +58 -42
- package/dist/services/scan/type-sanity-service.js +13 -3
- package/dist/services/skill/resume-detector.js +3 -3
- package/dist/services/skills/hooks-codegate-superpowers.d.ts +5 -6
- package/dist/services/skills/hooks-codegate-superpowers.js +7 -8
- 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 +13 -213
- package/dist/services/skills/hooks-settings-service.js +72 -658
- package/dist/services/skills/hooks-settings-types.d.ts +139 -0
- package/dist/services/skills/hooks-settings-types.js +1 -0
- package/dist/services/skills/presence-lease-order.d.ts +13 -0
- package/dist/services/skills/presence-lease-order.js +24 -0
- package/dist/services/skills/skill-conformance-service.js +1 -0
- package/dist/services/skills/skill-statusline-service.js +4 -7
- package/dist/services/slice/slice-check-service.js +8 -8
- package/dist/services/workflow/pipeline-verify-gate-support.js +2 -1
- package/dist/services/workflow/pipeline-verify-service.js +1 -1
- package/dist/services/workflow/workflow-skip-service.d.ts +0 -20
- package/dist/services/workflow/workflow-skip-service.js +3 -4
- package/dist/services/workspace/claude-settings-retirements.d.ts +54 -0
- package/dist/services/workspace/claude-settings-retirements.js +112 -0
- package/dist/services/workspace/claude-settings-template-merge.d.ts +109 -0
- package/dist/services/workspace/claude-settings-template-merge.js +223 -0
- package/dist/services/workspace/claude-settings-template.d.ts +79 -87
- package/dist/services/workspace/claude-settings-template.js +80 -235
- package/dist/services/workspace/migrate-1-4-1-service.js +3 -0
- package/dist/services/workspace/reconcile-service.js +0 -1
- package/dist/shared/incrementing-number.d.ts +10 -0
- package/dist/shared/incrementing-number.js +27 -0
- package/package.json +5 -5
- package/skills/bee/peaks-perf-audit/SKILL.md +1 -1
- package/skills/bee/peaks-prd/SKILL.md +1 -1
- package/skills/bee/peaks-qa/SKILL.md +1 -1
- package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +2 -2
- package/skills/bee/peaks-qa/references/qa-transition-gates.md +1 -1
- package/skills/bee/peaks-rd/SKILL.md +2 -2
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +1 -1
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +8 -4
- package/skills/bee/peaks-rd/references/rd-transition-gates.md +3 -3
- package/skills/bee/peaks-rd/references/v2-12-fanout-collapse.md +2 -2
- package/skills/bee/peaks-rd/references/writing-handoff-frontmatter.md +1 -1
- package/skills/bee/peaks-reviewer/SKILL.md +1 -1
- package/skills/bee/peaks-sc/SKILL.md +1 -1
- package/skills/bee/peaks-security-audit/SKILL.md +10 -2
- package/skills/bee/peaks-txt/SKILL.md +4 -3
- package/skills/bee/peaks-ui/SKILL.md +3 -3
- package/skills/peaks-audit/SKILL.md +29 -1
- package/skills/peaks-code/SKILL.md +5 -2
- package/skills/peaks-code/references/fast-lane-norm.md +42 -0
- package/skills/peaks-code/references/fast-mode.md +3 -2
- package/skills/peaks-code/references/local-artifact-workspace.md +3 -3
- package/skills/peaks-code/references/micro-cycle.md +3 -3
- package/skills/peaks-code/references/resume-detection.md +1 -1
- package/skills/peaks-code/references/runbook.md +12 -6
- package/skills/peaks-code/references/step-11-memory-sediment.md +4 -0
- package/skills/peaks-code/references/sub-agent-dispatch.md +1 -1
- package/skills/peaks-code/references/swarm-dispatch-contract.md +40 -16
- package/skills/peaks-code/references/workflow-gates-and-types.md +6 -6
- package/skills/peaks-code/references/worktree-governance.md +4 -4
- package/skills/peaks-content/SKILL.md +1 -1
- package/skills/peaks-doctor/SKILL.md +1 -1
- package/skills/peaks-final-review/SKILL.md +31 -11
- package/skills/peaks-ide/SKILL.md +1 -1
- package/skills/peaks-issue-fix-orchestrator/SKILL.md +1 -1
- package/skills/peaks-race-code/SKILL.md +185 -0
- package/skills/peaks-resume/SKILL.md +1 -1
- package/skills/peaks-slice-decompose/SKILL.md +1 -1
- package/skills/peaks-solo/SKILL.md +1 -1
- package/skills/peaks-sop/SKILL.md +1 -1
- package/skills/peaks-status/SKILL.md +1 -1
- package/skills/peaks-test/SKILL.md +7 -4
- package/dist/services/audit/enforcers/lint-peaks-skill-runtime.d.ts +0 -23
- package/dist/services/audit/enforcers/lint-peaks-skill-runtime.js +0 -64
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// The artifact contract block a dispatched sub-agent receives: for its own role
|
|
2
|
+
// and the request's type, every artifact the prerequisite gate will demand and
|
|
3
|
+
// the literal body markers each one must carry.
|
|
4
|
+
//
|
|
5
|
+
// Generated from the table the gate reads (`getPrerequisitesFor`), never from a
|
|
6
|
+
// second hand-written list: the markers are matched as case-insensitive
|
|
7
|
+
// substrings of the artifact body, so a list kept in prose drifts the moment a
|
|
8
|
+
// marker changes and the gate then refuses a producer it never told.
|
|
9
|
+
import { DEFAULT_REQUEST_TYPE, getPrerequisitesFor } from './artifact-prerequisites.js';
|
|
10
|
+
import { ALLOWED_STATES_PER_ROLE } from './request-artifact-state-helpers.js';
|
|
11
|
+
import { extractMetadata } from './request-artifact-metadata.js';
|
|
12
|
+
import { REQUEST_ID_PATTERN, showRequestArtifact } from './request-artifact-service.js';
|
|
13
|
+
import { isUnsafePathInput } from '../../shared/path-safety.js';
|
|
14
|
+
/** Roles whose request artifact may carry a `- type:` line, in search order. */
|
|
15
|
+
const TYPE_SOURCE_ROLES = ['rd', 'prd', 'qa', 'ui', 'sc'];
|
|
16
|
+
/** True for the five roles the state table is keyed on. */
|
|
17
|
+
function isRequestArtifactRole(role) {
|
|
18
|
+
return Object.prototype.hasOwnProperty.call(ALLOWED_STATES_PER_ROLE, role);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The prerequisite's path with the request id substituted for its `<rid>`.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately NOT exported. A test that called this would no longer be
|
|
24
|
+
* independent of the renderer it checks, and that independence is the whole
|
|
25
|
+
* value of the pinning case.
|
|
26
|
+
*/
|
|
27
|
+
function resolveContractPath(prerequisite, requestId) {
|
|
28
|
+
return prerequisite.relativePath.replace('<rid>', requestId);
|
|
29
|
+
}
|
|
30
|
+
function quoteAll(markers) {
|
|
31
|
+
return markers.map((marker) => `\`${marker}\``).join(', ');
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The marker fields, in the order the block renders them. A table rather than a
|
|
35
|
+
* chain of `if`s: the three fields are independent and uniform, so listing them
|
|
36
|
+
* keeps the renderer's complexity flat as the vocabulary grows.
|
|
37
|
+
*/
|
|
38
|
+
const MARKER_CLAUSES = [
|
|
39
|
+
{ markers: (candidate) => candidate.mustContain, label: 'must contain' },
|
|
40
|
+
{ markers: (candidate) => candidate.mustContainAny, label: 'must contain at least one of' },
|
|
41
|
+
{
|
|
42
|
+
markers: (candidate) => candidate.headingMustContain,
|
|
43
|
+
label: 'must appear as markdown headings'
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* One line's worth of "what this file must carry", or the explicit statement
|
|
48
|
+
* that there is nothing to carry. `mustContainAny` is rendered as an
|
|
49
|
+
* alternative set rather than as three requirements — the gate passes on one.
|
|
50
|
+
*/
|
|
51
|
+
function describePrerequisite(prerequisite) {
|
|
52
|
+
const clauses = MARKER_CLAUSES.flatMap(({ markers, label }) => {
|
|
53
|
+
const list = markers(prerequisite) ?? [];
|
|
54
|
+
return list.length === 0 ? [] : [`${label}: ${quoteAll(list)}`];
|
|
55
|
+
});
|
|
56
|
+
if (prerequisite.backCompat === true) {
|
|
57
|
+
const until = prerequisite.backCompatUntil ?? 'the window closes';
|
|
58
|
+
clauses.push(`a missing file only warns until ${until}`);
|
|
59
|
+
}
|
|
60
|
+
return clauses.length === 0 ? 'the file must exist; it has no body markers' : clauses.join('; ');
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The command that reaches a state, spelled with every option
|
|
64
|
+
* `src/cli/commands/request-transition-command.ts` registers as MANDATORY.
|
|
65
|
+
* `--project` is one of them, and an earlier revision of this line omitted it —
|
|
66
|
+
* the prompt therefore handed the producer a command the CLI refuses for a
|
|
67
|
+
* missing option, which is this block's own defect class turned on itself. The
|
|
68
|
+
* pinning test now compares the emitted options against the command's own
|
|
69
|
+
* `mandatory` set, so a newly required flag fails the suite rather than reaching
|
|
70
|
+
* a prompt. `.` because a dispatched sub-agent's working directory is the
|
|
71
|
+
* project root.
|
|
72
|
+
*/
|
|
73
|
+
function transitionCommand(role, state, requestId) {
|
|
74
|
+
return `peaks request transition ${requestId} --role ${role} --state ${state} --project .`;
|
|
75
|
+
}
|
|
76
|
+
function renderStateRow(role, state, prerequisites, requestId) {
|
|
77
|
+
const lines = prerequisites.map((entry) => `- \`${resolveContractPath(entry, requestId)}\` — ${describePrerequisite(entry)}`);
|
|
78
|
+
const reached = transitionCommand(role, state, requestId);
|
|
79
|
+
return {
|
|
80
|
+
state,
|
|
81
|
+
text: `\nAt \`${role}:${state}\` (reached with \`${reached}\`):\n${lines.join('\n')}\n`
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* One row per state of `role` that demands at least one artifact under
|
|
86
|
+
* `requestType`. A state with an empty row (`rd:implemented` for a feature, for
|
|
87
|
+
* instance) is left out rather than rendered as "nothing required" — the block
|
|
88
|
+
* is a list of obligations, and a state with none is not an obligation.
|
|
89
|
+
*/
|
|
90
|
+
function stateRows(role, requestType, requestId) {
|
|
91
|
+
if (!isRequestArtifactRole(role))
|
|
92
|
+
return [];
|
|
93
|
+
const rows = [];
|
|
94
|
+
for (const state of ALLOWED_STATES_PER_ROLE[role]) {
|
|
95
|
+
const prerequisites = getPrerequisitesFor(role, state, requestType);
|
|
96
|
+
if (prerequisites.length === 0)
|
|
97
|
+
continue;
|
|
98
|
+
rows.push(renderStateRow(role, state, prerequisites, requestId));
|
|
99
|
+
}
|
|
100
|
+
return rows;
|
|
101
|
+
}
|
|
102
|
+
const BODY_RULE = 'The gate matches each marker below as a case-insensitive substring of the artifact body, and a ' +
|
|
103
|
+
'heading marker must be a real markdown heading. Content under a different spelling is refused, ' +
|
|
104
|
+
'so write the marker literally. Paths are relative to `.peaks/_runtime/<session-id>/`.';
|
|
105
|
+
/**
|
|
106
|
+
* The scope bound, always true of the block regardless of what the gate does:
|
|
107
|
+
* it says what the rows ARE (necessary) and not what they are not (sufficient).
|
|
108
|
+
*/
|
|
109
|
+
const SCOPE_BASE = 'This block is generated from the prerequisite table alone, so the rows below are necessary and are ' +
|
|
110
|
+
'not a complete contract.';
|
|
111
|
+
/**
|
|
112
|
+
* The addendum for a state the gate really does guard with more than the table.
|
|
113
|
+
* Measured on a probe project and again on this slice's own rid: an artifact set
|
|
114
|
+
* satisfying every `rd:qa-handoff` row was still refused once, on a declaration
|
|
115
|
+
* outside the table. The earlier wording said a gate "may also check something
|
|
116
|
+
* the table does not carry", which under-claims a systematic gap at exactly the
|
|
117
|
+
* state this block guides a producer to.
|
|
118
|
+
*/
|
|
119
|
+
const SCOPE_HANDOFF = ' At `rd:qa-handoff` the gate also runs checks that are not rows of this table, so satisfying every ' +
|
|
120
|
+
'row below does not by itself open that transition.';
|
|
121
|
+
const ARTIFACT_CONTRACT_HEADING = '## Artifact contract (generated from the prerequisite table)';
|
|
122
|
+
/**
|
|
123
|
+
* The block, or `''` when this role has nothing gated to say under this type.
|
|
124
|
+
* The empty string is the whole byte-identity contract: callers concatenate it,
|
|
125
|
+
* and a role with no gated artifacts must add zero bytes to the prompt.
|
|
126
|
+
*/
|
|
127
|
+
export function buildArtifactContractBlock(input) {
|
|
128
|
+
const rows = stateRows(input.role, input.requestType, input.requestId);
|
|
129
|
+
if (rows.length === 0)
|
|
130
|
+
return '';
|
|
131
|
+
const typeLine = input.requestTypeSource === 'declared'
|
|
132
|
+
? `request type \`${input.requestType}\` (recorded by a \`- type:\` line)`
|
|
133
|
+
: `request type \`${input.requestType}\` — the DEFAULT, not a recorded choice: this request ` +
|
|
134
|
+
'records no `- type:` line, so the gate applies the default table. If the work is really a ' +
|
|
135
|
+
'different type, the demand set below is the wrong one';
|
|
136
|
+
// Conditional on the ROWS, not on a hand-written type list: whichever types
|
|
137
|
+
// render an `rd:qa-handoff` row are exactly the ones the extra checks run for.
|
|
138
|
+
const guardedHandoff = input.role === 'rd' && rows.some((row) => row.state === 'qa-handoff');
|
|
139
|
+
return (`\n${ARTIFACT_CONTRACT_HEADING}\n` +
|
|
140
|
+
`Role \`${input.role}\`, ${typeLine}.\n` +
|
|
141
|
+
`${BODY_RULE}\n` +
|
|
142
|
+
`${SCOPE_BASE}${guardedHandoff ? SCOPE_HANDOFF : ''}\n` +
|
|
143
|
+
rows.map((row) => row.text).join('') +
|
|
144
|
+
'\n');
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Append the block unless the text already carries one.
|
|
148
|
+
*
|
|
149
|
+
* Idempotent for the same reason `ensureKarpathyBlock` is: a caller prompt can
|
|
150
|
+
* already hold a copy — a re-dispatch, or a resume from a stored prompt — and
|
|
151
|
+
* two sections can DISAGREE (the type may have been declared between the two
|
|
152
|
+
* runs), so a reader cannot tell which contract is authoritative. The presence
|
|
153
|
+
* test is the block's own heading, which nothing else emits.
|
|
154
|
+
*
|
|
155
|
+
* An empty block adds zero bytes even when the text already carries one, so an
|
|
156
|
+
* unaffected dispatch stays byte-identical.
|
|
157
|
+
*/
|
|
158
|
+
export function ensureArtifactContractBlock(text, block) {
|
|
159
|
+
if (block.length === 0 || text.includes(ARTIFACT_CONTRACT_HEADING))
|
|
160
|
+
return text;
|
|
161
|
+
return `${text}${block}`;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The type recorded for `requestId`, read through the same reader the rest of
|
|
165
|
+
* the CLI uses. Every request artifact of the id is a candidate because the
|
|
166
|
+
* dispatched role's own file frequently does not exist yet at dispatch time —
|
|
167
|
+
* a dated snapshot over the dispatch records of the 2026-10-12 session (77 of
|
|
168
|
+
* them at the time of writing, a count the session is still growing): 18 had any
|
|
169
|
+
* request artifact for the id on disk before the dispatch and 10 had one that
|
|
170
|
+
* declared a type — while a sibling role may have recorded the type already. A
|
|
171
|
+
* `default` result is a real answer — nothing declared it.
|
|
172
|
+
*/
|
|
173
|
+
export async function readArtifactType(input) {
|
|
174
|
+
const fallback = {
|
|
175
|
+
requestType: DEFAULT_REQUEST_TYPE,
|
|
176
|
+
requestTypeSource: 'default'
|
|
177
|
+
};
|
|
178
|
+
if (isUnsafePathInput(input.sessionId) || !REQUEST_ID_PATTERN.test(input.requestId)) {
|
|
179
|
+
return fallback;
|
|
180
|
+
}
|
|
181
|
+
const candidates = [];
|
|
182
|
+
for (const candidate of [input.role, ...TYPE_SOURCE_ROLES]) {
|
|
183
|
+
if (isRequestArtifactRole(candidate) && !candidates.includes(candidate)) {
|
|
184
|
+
candidates.push(candidate);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
for (const role of candidates) {
|
|
188
|
+
const found = await showRequestArtifact({
|
|
189
|
+
projectRoot: input.projectRoot,
|
|
190
|
+
sessionId: input.sessionId,
|
|
191
|
+
role,
|
|
192
|
+
requestId: input.requestId
|
|
193
|
+
});
|
|
194
|
+
if (found === null)
|
|
195
|
+
continue;
|
|
196
|
+
const metadata = extractMetadata(found.content);
|
|
197
|
+
if (metadata.requestTypeSource === 'declared') {
|
|
198
|
+
return { requestType: metadata.requestType, requestTypeSource: 'declared' };
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return fallback;
|
|
202
|
+
}
|
|
203
|
+
/** The composed block for a dispatch, reading the type from disk first. */
|
|
204
|
+
export async function readArtifactContractBlock(input) {
|
|
205
|
+
const reading = await readArtifactType(input);
|
|
206
|
+
return buildArtifactContractBlock({
|
|
207
|
+
role: input.role,
|
|
208
|
+
requestId: input.requestId,
|
|
209
|
+
requestType: reading.requestType,
|
|
210
|
+
requestTypeSource: reading.requestTypeSource
|
|
211
|
+
});
|
|
212
|
+
}
|
|
@@ -55,6 +55,10 @@ export type ArtifactPrerequisite = {
|
|
|
55
55
|
* the last of those, so the oldest tier still has to resolve.
|
|
56
56
|
*/
|
|
57
57
|
legacyRelativePaths?: ReadonlyArray<string>;
|
|
58
|
+
/** Back-compat window — a missing file warns instead of failing; see `prerequisite-checks.ts`. */
|
|
59
|
+
backCompat?: boolean;
|
|
60
|
+
/** The release that CLOSES that window (e.g. `v2.14.0`); the warning code's suffix. */
|
|
61
|
+
backCompatUntil?: string;
|
|
58
62
|
};
|
|
59
63
|
export type PrerequisiteCheckResult = {
|
|
60
64
|
ok: boolean;
|
|
@@ -63,15 +67,19 @@ export type PrerequisiteCheckResult = {
|
|
|
63
67
|
description: string;
|
|
64
68
|
}>;
|
|
65
69
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
+
* Missing files inside a back-compat window (see
|
|
71
|
+
* `ArtifactPrerequisite.backCompat`). NOT a failure — the gate does not throw
|
|
72
|
+
* on these, so legacy callers keep working. They ARE reported:
|
|
73
|
+
* `transitionRequestArtifact` copies the list onto its success result and
|
|
74
|
+
* `peaks request transition` prints each one as an envelope warning, so a
|
|
75
|
+
* soft-passed prerequisite is not read as a passed one. `code` is derived per
|
|
76
|
+
* prerequisite (`prerequisite-checks.ts`), so it names which artifact.
|
|
70
77
|
*/
|
|
71
78
|
warnings: Array<{
|
|
72
79
|
path: string;
|
|
73
80
|
code: string;
|
|
74
81
|
message: string;
|
|
82
|
+
expiredWindow?: string;
|
|
75
83
|
}>;
|
|
76
84
|
};
|
|
77
85
|
export type CheckPrerequisitesOptions = {
|
|
@@ -85,20 +93,20 @@ export type CheckPrerequisitesOptions = {
|
|
|
85
93
|
role: RequestArtifactRole;
|
|
86
94
|
newState: RequestArtifactState;
|
|
87
95
|
requestId: string;
|
|
88
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Required, with no default. The `?? DEFAULT_REQUEST_TYPE` that used to sit in
|
|
98
|
+
* `getPrerequisitesFor`'s signature let a caller silently select the `feature`
|
|
99
|
+
* table by omitting an argument; a caller that wants the default now has to
|
|
100
|
+
* write it, and the one place that legitimately substitutes it is the artifact
|
|
101
|
+
* reader (`request-artifact-metadata.ts`), which labels the substitution.
|
|
102
|
+
*/
|
|
103
|
+
requestType: RequestType;
|
|
104
|
+
/**
|
|
105
|
+
* False for a caller that is not a state move — the retag command's impact
|
|
106
|
+
* probe reads the table without transitioning anything, and the event stream
|
|
107
|
+
* is read as a record of transitions.
|
|
108
|
+
*/
|
|
109
|
+
emitEvents?: boolean;
|
|
89
110
|
};
|
|
90
|
-
export declare function getPrerequisitesFor(role: RequestArtifactRole, newState: RequestArtifactState, requestType
|
|
91
|
-
/**
|
|
92
|
-
* The contract's BODY checks for one prerequisite, applied to `body`. Returns
|
|
93
|
-
* one human-readable message per failed check, empty when the body satisfies
|
|
94
|
-
* the contract.
|
|
95
|
-
*
|
|
96
|
-
* Exported because this contract has a SECOND enforcer: `peaks workflow
|
|
97
|
-
* verify-pipeline` probes the same table for the paths it checks
|
|
98
|
-
* (`pipeline-verify-gate-support.ts`), and a resolver that probed only
|
|
99
|
-
* `existsSync` passed files this function rejects — a guard laxer than the
|
|
100
|
-
* contract it claims to read. Both callers now share this one implementation,
|
|
101
|
-
* so the checker cannot drift from the table again.
|
|
102
|
-
*/
|
|
103
|
-
export declare function prerequisiteBodyViolations(prerequisite: ArtifactPrerequisite, body: string): string[];
|
|
111
|
+
export declare function getPrerequisitesFor(role: RequestArtifactRole, newState: RequestArtifactState, requestType: RequestType): ReadonlyArray<ArtifactPrerequisite>;
|
|
104
112
|
export declare function checkPrerequisites(options: CheckPrerequisitesOptions): Promise<PrerequisiteCheckResult>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { join, dirname, basename } from 'node:path';
|
|
2
2
|
import { readFile, readdir } from 'node:fs/promises';
|
|
3
3
|
import { pathExists } from 'peaks-loop-shared/fs';
|
|
4
|
-
import {
|
|
4
|
+
import { emitPrereqTransitionEvent } from './prerequisite-transition-event.js';
|
|
5
5
|
import { isUnsafePathInput } from '../../shared/path-safety.js';
|
|
6
|
+
import { bodyViolationsIfDeclared, missingPrerequisiteWarning } from './prerequisite-checks.js';
|
|
6
7
|
export const VALID_REQUEST_TYPES = [
|
|
7
8
|
'feature',
|
|
8
9
|
'bugfix',
|
|
@@ -15,41 +16,28 @@ export const DEFAULT_REQUEST_TYPE = 'feature';
|
|
|
15
16
|
export function isRequestType(value) {
|
|
16
17
|
return VALID_REQUEST_TYPES.includes(value);
|
|
17
18
|
}
|
|
18
|
-
// Shared prerequisite fragments
|
|
19
|
-
// (Removed in v2.11.0 Group A: TECH_DOC prerequisite. The per-session
|
|
20
|
-
// rd/tech-doc.md is replaced by the immutable peaks-prd handoff at
|
|
21
|
-
// prd/handoff.md. Group B will introduce a PRD_HANDOFF prerequisite
|
|
22
|
-
// once the handoff service lands. For Group A scope, `rd:implemented`
|
|
23
|
-
// and `rd:qa-handoff` rely on the evidence files (code-review,
|
|
24
|
-
// security-review, perf-baseline, karpathy-review, unit tests) only.)
|
|
19
|
+
// Shared prerequisite fragments.
|
|
25
20
|
const BUG_ANALYSIS = {
|
|
26
|
-
relativePath: 'rd/bug-analysis
|
|
27
|
-
|
|
21
|
+
relativePath: 'rd/bug-analysis-<rid>.md',
|
|
22
|
+
// The bare path below is still accepted, so an older session keeps passing.
|
|
23
|
+
legacyRelativePath: 'rd/bug-analysis.md',
|
|
24
|
+
description: 'Bug root-cause analysis (reproduction, affected paths, fix approach, regression test plan). The rid is part of the filename so two bugfix slices in one session do not collide; the bare location is accepted during the back-compat window via legacyRelativePath.',
|
|
28
25
|
mustContain: ['## Root cause', '## Fix approach']
|
|
29
26
|
};
|
|
30
|
-
// filename (`code-review-<rid>.md`). A fixed per-session path cannot hold
|
|
31
|
-
// two slices' evidence at once — the second slice's write silently
|
|
32
|
-
// destroyed the first slice's on 2026-09-13, and the gate stayed green
|
|
33
|
-
// because it only checks that *some* file is there, not whose it is.
|
|
34
|
-
// The bare path stays accepted (see `legacyRelativePath`) so sessions
|
|
35
|
-
// written before this change — and any writer still emitting it — keep
|
|
36
|
-
// passing.
|
|
37
27
|
const CODE_REVIEW = {
|
|
28
|
+
// The bare path below is still accepted, so an older session keeps passing.
|
|
38
29
|
relativePath: 'rd/code-review-<rid>.md',
|
|
39
30
|
legacyRelativePath: 'rd/code-review.md',
|
|
40
31
|
description: 'Code review evidence (CRITICAL/HIGH must be fixed before handoff)',
|
|
41
32
|
mustContain: ['## Findings', 'CRITICAL']
|
|
42
33
|
};
|
|
43
34
|
const SECURITY_REVIEW = {
|
|
44
|
-
relativePath: 'rd/security-review
|
|
45
|
-
|
|
35
|
+
relativePath: 'rd/security-review-<rid>.md',
|
|
36
|
+
// The bare path is the legacy tier, so a session already on disk keeps passing.
|
|
37
|
+
legacyRelativePath: 'rd/security-review.md',
|
|
38
|
+
description: 'Security review evidence for the changed surface. The rid is part of the filename so two config slices in one session do not collide; the bare location is the legacy tier. The body is never read, so a collision here was silent.'
|
|
46
39
|
};
|
|
47
|
-
// Gate B9 — RD-side perf baseline
|
|
48
|
-
// The file must exist; the body must either carry a Results table marker
|
|
49
|
-
// (per peaks-rd SKILL "Mandatory perf-baseline output") or the explicit
|
|
50
|
-
// "N/A — no perf surface" escape hatch. A slice without a perf surface
|
|
51
|
-
// still has to write the stub; an RD that omits perf-baseline entirely is
|
|
52
|
-
// blocked here, matching peaks-rd's BLOCKING Gate B9 claim.
|
|
40
|
+
// Gate B9 — RD-side perf baseline: the body carries a Results table or "N/A — no perf surface".
|
|
53
41
|
const PERF_BASELINE = {
|
|
54
42
|
relativePath: 'rd/perf-baseline.md',
|
|
55
43
|
description: 'RD-side perf baseline (peaks-rd Gate B9) — must include a Results table with measurements OR the literal "N/A — no perf surface" escape hatch in the Notes section. QA Gate A4 diffs against this file.',
|
|
@@ -105,28 +93,31 @@ const AUDIT_PERF = {
|
|
|
105
93
|
// rd-side CLI hard gate (blocks `rd → qa-handoff`), while qa-side
|
|
106
94
|
// consumption remains soft.
|
|
107
95
|
//
|
|
108
|
-
// `backCompat: true` is set, a MISSING file downgrades to a warning
|
|
109
|
-
//
|
|
110
|
-
// failure. The hard-fail behavior for `passed: false` is preserved
|
|
96
|
+
// `backCompat: true` is set, a MISSING file downgrades to a warning instead
|
|
97
|
+
// of a hard failure. The hard-fail behavior for `passed: false` is preserved
|
|
111
98
|
// (the body still has to carry `"passed": true` when present).
|
|
112
99
|
// v2.14.0 will remove `backCompat` and re-elevate missing → throw.
|
|
100
|
+
// The warning's code is derived from this prerequisite
|
|
101
|
+
// (`backCompatWarningCode` → `mut-report-missing-deprecated-in-v2.14.0`)
|
|
102
|
+
// rather than hardcoded in the shared branch, so a consumer filtering on the
|
|
103
|
+
// code cannot match a different artifact's warning.
|
|
113
104
|
//
|
|
114
|
-
// repo's
|
|
115
|
-
// `packages/peaks-loop-mut/src/services/mut/report-loader.ts`,
|
|
116
|
-
// `mut/mut-report.json
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
// `backCompat: true` so it gates nothing at all. If mut ever gains a
|
|
105
|
+
// The repo's producer/reader constant is `mutReportPath()` in
|
|
106
|
+
// `packages/peaks-loop-mut/src/services/mut/report-loader.ts`, naming
|
|
107
|
+
// `mut/mut-report.json`; `peaks mut run`'s `--out` is caller-supplied. A
|
|
108
|
+
// `<rid>`-templated requirement here would name no file a producer can write —
|
|
109
|
+
// a gate living only in prose, behind `backCompat: true`, gating nothing.
|
|
120
110
|
const MUT_REPORT = {
|
|
121
111
|
relativePath: 'mut/mut-report.json',
|
|
122
|
-
description: 'peaks-mut mutation + weak-assertion report (Plan 2, v2.12.0+). v2.13.1:
|
|
112
|
+
description: 'peaks-mut mutation + weak-assertion report (Plan 2, v2.12.0+). v2.13.1: the artifact contract requires this at rd:qa-handoff for feature / bugfix / refactor slices — `peaks workflow verify-pipeline` is what checks that, and it reads this table rather than the transition. v2.13.2: back-compat window — missing file downgrades to a warning (1-minor-release); passed:false still throws. The body must carry `"passed": true` when present; failed runs are blocked at this gate. CONFIG / DOCS / CHORE slices retain the legacy "no acceptance surface" exemption.',
|
|
123
113
|
// Substring check on the JSON property name only — strictness (kill
|
|
124
114
|
// rate ≥ 0.8 etc.) is enforced downstream by verdict-aggregator +
|
|
125
115
|
// peaks-mut's evaluateThresholds. We require both the property name
|
|
126
116
|
// and a literal `true` value to keep the gate as tight as possible
|
|
127
117
|
// without depending on JSON parsing in the prereq resolver.
|
|
128
118
|
mustContainAny: ['"passed": true', '"passed":true'],
|
|
129
|
-
backCompat: true
|
|
119
|
+
backCompat: true,
|
|
120
|
+
backCompatUntil: 'v2.14.0'
|
|
130
121
|
};
|
|
131
122
|
// v2.12.0 Group B Tier 5 — gate that the peaks-prd handoff (the
|
|
132
123
|
// immutable, per-slice handoff capsule at `prd/handoff-<rid>.md`
|
|
@@ -151,7 +142,7 @@ const AUDIT_REQUIRES_HANDOFF = {
|
|
|
151
142
|
// sessions on disk that hold only `prd/handoff.md` keep passing. That tier
|
|
152
143
|
// on, and every producer (`handoff-service.initHandoff`,
|
|
153
144
|
legacyRelativePath: 'prd/handoff.md',
|
|
154
|
-
description: 'PRD handoff capsule (v2.12.0+) — peaks-security-audit / peaks-perf-audit both read frontmatter from this file.
|
|
145
|
+
description: 'PRD handoff capsule (v2.12.0+) — peaks-security-audit / peaks-perf-audit both read frontmatter from this file. There is no dependency on the transition: the ARTIFACT CONTRACT is what binds every reader of this table, and `peaks workflow verify-pipeline` is what checks the contract on disk (`contractEvidencePaths()` reads this table; a state name does not). The `rd:qa-handoff` transition enforces this same table through `checkPrerequisites`, so a missing prerequisite blocks the state move and is reported without one — the table is checked the same way with or without a transition. The rid is part of the filename so two slices in one session do not collide; the bare pre-rid-scoping location is accepted as the legacy tier.',
|
|
155
146
|
// Empty `mustContain` is fine — file existence is the contract.
|
|
156
147
|
// The peaks-prd handoff service writes frontmatter with
|
|
157
148
|
// `schemaVersion: 2` and a sha256 fingerprint; we pin a
|
|
@@ -197,7 +188,8 @@ const THIRD_PARTY_REVIEW = {
|
|
|
197
188
|
relativePath: 'rd/third-party-review.md',
|
|
198
189
|
description: 'v2.14.0 G4 third-party reviewer (peaks-reviewer skill) — must declare a `modelFamily` distinct from the karpathy-reviewer modelFamily (AC-4.4). Skipped when `~/.peaks/config.json` lacks `reviewer.providers` (>=2 entries); the prereq then resolves to a soft warning (`no-reviewer-config`) rather than a hard failure. The JSON sibling at `rd/third-party-review.json` carries the schema-validated ReviewerEnvelope (no free-form LLM JSON). v2.14.0 ships as a soft-warning prereq (1-minor-release back-compat window); v2.15.0 will hard-fail when the file is absent AND `reviewer.providers` is configured.',
|
|
199
190
|
mustContain: ['third-party-review', 'modelFamily'],
|
|
200
|
-
backCompat: true
|
|
191
|
+
backCompat: true,
|
|
192
|
+
backCompatUntil: 'v2.15.0'
|
|
201
193
|
};
|
|
202
194
|
const TEST_CASES = {
|
|
203
195
|
relativePath: 'qa/test-cases/<rid>.md',
|
|
@@ -257,13 +249,10 @@ const QA_INITIATED = {
|
|
|
257
249
|
relativePath: 'qa/.initiated',
|
|
258
250
|
description: 'QA skill must be invoked before RD handoff (run peaks request init --role qa)'
|
|
259
251
|
};
|
|
260
|
-
// v2.11.0 D1/D4 trim (Group C Tier 6):
|
|
261
|
-
// qa/security-findings.md or qa/performance-findings.md
|
|
262
|
-
//
|
|
263
|
-
//
|
|
264
|
-
// (see qa-transition-gates.md Gates A3/A4). SECURITY_FINDINGS /
|
|
265
|
-
// PERFORMANCE_FINDINGS constants are kept for back-compat and a 1-minor-
|
|
266
|
-
// release deprecation window but are NOT in any qa:verdict-issued table.
|
|
252
|
+
// v2.11.0 D1/D4 trim (Group C Tier 6): no qa:verdict-issued table holds
|
|
253
|
+
// qa/security-findings.md or qa/performance-findings.md — peaks-rd's audit
|
|
254
|
+
// fan-out owns that evidence. Both constants below are kept for back-compat
|
|
255
|
+
// only: `evidence-generator.ts` writes the scoped names, not these.
|
|
267
256
|
//
|
|
268
257
|
// v2.12.0 Group B Tier 5: at rd:qa-handoff, the v2.11.x security-review +
|
|
269
258
|
// perf-baseline slots are replaced by `AUDIT_SECURITY` + `AUDIT_PERF` (the
|
|
@@ -303,8 +292,7 @@ const FEATURE_TABLE = {
|
|
|
303
292
|
// v2.11.0 D1/D4: SECURITY_FINDINGS dropped from qa:verdict-issued (peaks-rd owns it).
|
|
304
293
|
// v2.12.0 Group B Tier 5: security-review + perf-baseline → AUDIT_SECURITY +
|
|
305
294
|
// AUDIT_PERF (with legacy shims for 1-minor-release back-compat).
|
|
306
|
-
// v2.13.1 Group A: add MUT_REPORT (same rd-side hard block rationale as
|
|
307
|
-
// FEATURE_TABLE).
|
|
295
|
+
// v2.13.1 Group A: add MUT_REPORT (same rd-side hard block rationale as FEATURE_TABLE).
|
|
308
296
|
const BUGFIX_TABLE = {
|
|
309
297
|
'prd:handed-off': [PRD_CONTENT],
|
|
310
298
|
'rd:implemented': [BUG_ANALYSIS],
|
|
@@ -345,7 +333,7 @@ const PREREQUISITES_BY_TYPE = {
|
|
|
345
333
|
config: CONFIG_TABLE,
|
|
346
334
|
chore: MINIMAL_TABLE
|
|
347
335
|
};
|
|
348
|
-
export function getPrerequisitesFor(role, newState, requestType
|
|
336
|
+
export function getPrerequisitesFor(role, newState, requestType) {
|
|
349
337
|
const table = PREREQUISITES_BY_TYPE[requestType];
|
|
350
338
|
return table[`${role}:${newState}`] ?? [];
|
|
351
339
|
}
|
|
@@ -383,57 +371,6 @@ async function resolvePrerequisiteAbsolutePath(sessionRoot, prerequisite, reques
|
|
|
383
371
|
const match = entries.find((name) => /^\d+-/.test(name) && name.endsWith(targetSuffix));
|
|
384
372
|
return match ? join(dir, match) : null;
|
|
385
373
|
}
|
|
386
|
-
/**
|
|
387
|
-
* The contract's BODY checks for one prerequisite, applied to `body`. Returns
|
|
388
|
-
* one human-readable message per failed check, empty when the body satisfies
|
|
389
|
-
* the contract.
|
|
390
|
-
*
|
|
391
|
-
* Exported because this contract has a SECOND enforcer: `peaks workflow
|
|
392
|
-
* verify-pipeline` probes the same table for the paths it checks
|
|
393
|
-
* (`pipeline-verify-gate-support.ts`), and a resolver that probed only
|
|
394
|
-
* `existsSync` passed files this function rejects — a guard laxer than the
|
|
395
|
-
* contract it claims to read. Both callers now share this one implementation,
|
|
396
|
-
* so the checker cannot drift from the table again.
|
|
397
|
-
*/
|
|
398
|
-
export function prerequisiteBodyViolations(prerequisite, body) {
|
|
399
|
-
const violations = [];
|
|
400
|
-
const lowered = body.toLowerCase();
|
|
401
|
-
if (prerequisite.mustContain && prerequisite.mustContain.length > 0) {
|
|
402
|
-
const missingMarkers = prerequisite.mustContain.filter((marker) => !lowered.includes(marker.toLowerCase()));
|
|
403
|
-
if (missingMarkers.length > 0) {
|
|
404
|
-
violations.push(`${prerequisite.description} — missing section(s): ${missingMarkers.join(', ')}`);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
if (prerequisite.headingMustContain && prerequisite.headingMustContain.length > 0) {
|
|
408
|
-
// Slice 2.6.1.F: a line beginning with `#`, `##`, or `###` followed by
|
|
409
|
-
// the marker (case-insensitive). Fenced code blocks are NOT excluded
|
|
410
|
-
// here — a "heading" inside a code fence is rare and, when present,
|
|
411
|
-
// should still be reported as missing to keep the contract strict.
|
|
412
|
-
const headingLines = body
|
|
413
|
-
.split('\n')
|
|
414
|
-
.map((line) => line.trim())
|
|
415
|
-
.filter((line) => /^#{1,3}\s+/.test(line));
|
|
416
|
-
const loweredHeadings = headingLines.map((h) => h.toLowerCase());
|
|
417
|
-
const missingHeadings = prerequisite.headingMustContain.filter((marker) => !loweredHeadings.some((h) => h.includes(marker.toLowerCase())));
|
|
418
|
-
if (missingHeadings.length > 0) {
|
|
419
|
-
violations.push(`${prerequisite.description} — missing heading(s): ${missingHeadings.join(', ')}`);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
if (prerequisite.mustContainAny && prerequisite.mustContainAny.length > 0) {
|
|
423
|
-
const hitAny = prerequisite.mustContainAny.some((marker) => lowered.includes(marker.toLowerCase()));
|
|
424
|
-
if (!hitAny) {
|
|
425
|
-
violations.push(`${prerequisite.description} — none of the escape-hatch markers present: ${prerequisite.mustContainAny.join(', ')}`);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return violations;
|
|
429
|
-
}
|
|
430
|
-
/** True when `prerequisite` declares any body check at all. Guards the read so
|
|
431
|
-
* a prereq with no body contract is never opened (unchanged behaviour). */
|
|
432
|
-
function hasBodyChecks(prerequisite) {
|
|
433
|
-
return ((prerequisite.mustContain?.length ?? 0) > 0 ||
|
|
434
|
-
(prerequisite.headingMustContain?.length ?? 0) > 0 ||
|
|
435
|
-
(prerequisite.mustContainAny?.length ?? 0) > 0);
|
|
436
|
-
}
|
|
437
374
|
export async function checkPrerequisites(options) {
|
|
438
375
|
const requirements = getPrerequisitesFor(options.role, options.newState, options.requestType);
|
|
439
376
|
if (requirements.length === 0) {
|
|
@@ -466,25 +403,21 @@ export async function checkPrerequisites(options) {
|
|
|
466
403
|
const relative = resolvePrerequisitePath(prerequisite, options.requestId);
|
|
467
404
|
const absolute = await resolvePrerequisiteAbsolutePathWithFallback(canonicalSessionRoot, legacySessionRoot, prerequisite, options.requestId);
|
|
468
405
|
if (absolute === null) {
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
code: 'mut-report-missing-deprecated-in-v2.14.0',
|
|
476
|
-
message: `${prerequisite.description} — file missing; soft-blocked under v2.13.2 1-minor back-compat window. v2.14.0 hard-fail.`
|
|
477
|
-
});
|
|
406
|
+
// A `backCompat` prerequisite downgrades a missing file to a warning, NOT
|
|
407
|
+
// a hard failure; v2.14.0/v2.15.0 re-elevate it. The decision and the
|
|
408
|
+
// code that names the artifact live in `prerequisite-checks.ts`.
|
|
409
|
+
const softWarning = missingPrerequisiteWarning(prerequisite, relative);
|
|
410
|
+
if (softWarning !== null) {
|
|
411
|
+
warnings.push(softWarning);
|
|
478
412
|
continue;
|
|
479
413
|
}
|
|
480
414
|
missing.push({ path: relative, description: prerequisite.description });
|
|
481
415
|
continue;
|
|
482
416
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
417
|
+
// Read handed over as a thunk: the no-body-contract guard lives with the check.
|
|
418
|
+
const bodyViolations = await bodyViolationsIfDeclared(prerequisite, () => readFile(absolute, 'utf8'));
|
|
419
|
+
for (const description of bodyViolations) {
|
|
420
|
+
missing.push({ path: relative, description });
|
|
488
421
|
}
|
|
489
422
|
}
|
|
490
423
|
// own `gateEvidence` DECLARATION must be true — every path it names must
|
|
@@ -519,8 +452,25 @@ export async function checkPrerequisites(options) {
|
|
|
519
452
|
});
|
|
520
453
|
missing.push(...declaredEvidence.missing);
|
|
521
454
|
warnings.push(...declaredEvidence.warnings);
|
|
455
|
+
// The security audit artifact declares the paths it judged; the check
|
|
456
|
+
// re-hashes them, so a repair after the audit is refused by name. An
|
|
457
|
+
// artifact with no declaration is refused here, not waved through — a
|
|
458
|
+
// deleted section is the shed this arm exists to close.
|
|
459
|
+
const { verifyJudgedDeclaration } = await import('../audit-independent/judged-declaration-check.js');
|
|
460
|
+
for (const refusal of verifyJudgedDeclaration({
|
|
461
|
+
projectRoot: options.projectRoot,
|
|
462
|
+
sessionId: options.sessionId,
|
|
463
|
+
requestId: options.requestId
|
|
464
|
+
}).refusals) {
|
|
465
|
+
missing.push({
|
|
466
|
+
path: refusal.artifact,
|
|
467
|
+
description: `Judged declaration ${refusal.code} at ${refusal.path}`
|
|
468
|
+
});
|
|
469
|
+
}
|
|
522
470
|
}
|
|
523
471
|
const result = { ok: missing.length === 0, missing, warnings };
|
|
472
|
+
if (options.emitEvents === false)
|
|
473
|
+
return result;
|
|
524
474
|
emitPrereqTransitionEvent({
|
|
525
475
|
projectRoot: options.projectRoot,
|
|
526
476
|
sessionId: options.sessionId ?? '',
|
|
@@ -531,26 +481,6 @@ export async function checkPrerequisites(options) {
|
|
|
531
481
|
});
|
|
532
482
|
return result;
|
|
533
483
|
}
|
|
534
|
-
// Slice C of v2.11.1 — observability hook #7/7. Fire-and-forget per
|
|
535
|
-
// PRD Q4. The synchronous emit never throws and never blocks the
|
|
536
|
-
// prereq check return value.
|
|
537
|
-
function emitPrereqTransitionEvent(opts) {
|
|
538
|
-
if (opts.sessionId === undefined)
|
|
539
|
-
return;
|
|
540
|
-
emitObservabilityEvent({
|
|
541
|
-
schemaVersion: 1,
|
|
542
|
-
ts: new Date().toISOString(),
|
|
543
|
-
sessionId: opts.sessionId,
|
|
544
|
-
category: 'slice-transition',
|
|
545
|
-
sliceRid: opts.requestId,
|
|
546
|
-
detail: {
|
|
547
|
-
artifactRole: opts.role,
|
|
548
|
-
to: opts.newState,
|
|
549
|
-
prereqOk: opts.result.ok,
|
|
550
|
-
missingCount: opts.result.missing.length
|
|
551
|
-
}
|
|
552
|
-
}, { projectRoot: opts.projectRoot });
|
|
553
|
-
}
|
|
554
484
|
/**
|
|
555
485
|
* Resolve a prerequisite to an on-disk path, with a 2-tier fallback
|
|
556
486
|
* dirs are no longer created):
|
|
@@ -26,4 +26,4 @@ export declare function formatHandoffPath(sessionId: string, role: string, reque
|
|
|
26
26
|
export declare function formatCommitBoundaryPath(sessionId: string, requestId: string): string;
|
|
27
27
|
/** Canonical path for the txt skill-usage lessons log under a session scope. */
|
|
28
28
|
export declare function formatSkillUsageLessonsPath(sessionId: string): string;
|
|
29
|
-
export declare function renderTemplate(role: RequestArtifactRole, requestId: string, sessionId: string, changeSlug: string, timestamp: string, requestType: RequestType): string;
|
|
29
|
+
export declare function renderTemplate(role: RequestArtifactRole, requestId: string, sessionId: string, changeSlug: string, timestamp: string, requestType: RequestType | null): string;
|