peaks-loop 3.0.0
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 +51 -0
- package/CHANGELOG.md +3136 -0
- package/LICENSE +21 -0
- package/README-en.md +281 -0
- package/README.md +365 -0
- package/agents/karpathy-reviewer.md +229 -0
- package/bin/peaks.js +2 -0
- package/dist/src/cli/cli-helpers.d.ts +25 -0
- package/dist/src/cli/cli-helpers.js +78 -0
- package/dist/src/cli/commands/agent-commands.d.ts +20 -0
- package/dist/src/cli/commands/agent-commands.js +48 -0
- package/dist/src/cli/commands/audit-commands.d.ts +28 -0
- package/dist/src/cli/commands/audit-commands.js +437 -0
- package/dist/src/cli/commands/capability-commands.d.ts +16 -0
- package/dist/src/cli/commands/capability-commands.js +45 -0
- package/dist/src/cli/commands/capability-worker-config-sc-commands.d.ts +3 -0
- package/dist/src/cli/commands/capability-worker-config-sc-commands.js +10 -0
- package/dist/src/cli/commands/classify-classify-commands.d.ts +19 -0
- package/dist/src/cli/commands/classify-classify-commands.js +151 -0
- package/dist/src/cli/commands/code-review-commands.d.ts +34 -0
- package/dist/src/cli/commands/code-review-commands.js +83 -0
- package/dist/src/cli/commands/codegraph-commands.d.ts +3 -0
- package/dist/src/cli/commands/codegraph-commands.js +99 -0
- package/dist/src/cli/commands/complexity-commands.d.ts +9 -0
- package/dist/src/cli/commands/complexity-commands.js +34 -0
- package/dist/src/cli/commands/config-commands.d.ts +3 -0
- package/dist/src/cli/commands/config-commands.js +220 -0
- package/dist/src/cli/commands/context-builder-commands.d.ts +11 -0
- package/dist/src/cli/commands/context-builder-commands.js +85 -0
- package/dist/src/cli/commands/context-commands.d.ts +21 -0
- package/dist/src/cli/commands/context-commands.js +254 -0
- package/dist/src/cli/commands/contract-commands.d.ts +26 -0
- package/dist/src/cli/commands/contract-commands.js +114 -0
- package/dist/src/cli/commands/core/artifacts-command.d.ts +3 -0
- package/dist/src/cli/commands/core/artifacts-command.js +62 -0
- package/dist/src/cli/commands/core/binding-commands.d.ts +3 -0
- package/dist/src/cli/commands/core/binding-commands.js +58 -0
- package/dist/src/cli/commands/core/doctor-command.d.ts +11 -0
- package/dist/src/cli/commands/core/doctor-command.js +204 -0
- package/dist/src/cli/commands/core/memory-command.d.ts +3 -0
- package/dist/src/cli/commands/core/memory-command.js +98 -0
- package/dist/src/cli/commands/core/profile-command.d.ts +3 -0
- package/dist/src/cli/commands/core/profile-command.js +9 -0
- package/dist/src/cli/commands/core/proxy-command.d.ts +3 -0
- package/dist/src/cli/commands/core/proxy-command.js +26 -0
- package/dist/src/cli/commands/core/session-command.d.ts +3 -0
- package/dist/src/cli/commands/core/session-command.js +213 -0
- package/dist/src/cli/commands/core/skill-command.d.ts +3 -0
- package/dist/src/cli/commands/core/skill-command.js +275 -0
- package/dist/src/cli/commands/core/standards-command.d.ts +3 -0
- package/dist/src/cli/commands/core/standards-command.js +95 -0
- package/dist/src/cli/commands/core-artifact-commands.d.ts +15 -0
- package/dist/src/cli/commands/core-artifact-commands.js +31 -0
- package/dist/src/cli/commands/dispatch-commands.d.ts +10 -0
- package/dist/src/cli/commands/dispatch-commands.js +351 -0
- package/dist/src/cli/commands/dispatch-from-dag.d.ts +3 -0
- package/dist/src/cli/commands/dispatch-from-dag.js +251 -0
- package/dist/src/cli/commands/doc-commands.d.ts +11 -0
- package/dist/src/cli/commands/doc-commands.js +65 -0
- package/dist/src/cli/commands/feedback-commands.d.ts +18 -0
- package/dist/src/cli/commands/feedback-commands.js +145 -0
- package/dist/src/cli/commands/final-review-commands.d.ts +31 -0
- package/dist/src/cli/commands/final-review-commands.js +161 -0
- package/dist/src/cli/commands/fixture-commands.d.ts +32 -0
- package/dist/src/cli/commands/fixture-commands.js +91 -0
- package/dist/src/cli/commands/fork-commands.d.ts +16 -0
- package/dist/src/cli/commands/fork-commands.js +163 -0
- package/dist/src/cli/commands/gate-commands.d.ts +3 -0
- package/dist/src/cli/commands/gate-commands.js +117 -0
- package/dist/src/cli/commands/heartbeat-commands.d.ts +3 -0
- package/dist/src/cli/commands/heartbeat-commands.js +135 -0
- package/dist/src/cli/commands/hook-handle.d.ts +17 -0
- package/dist/src/cli/commands/hook-handle.js +157 -0
- package/dist/src/cli/commands/hooks-commands.d.ts +3 -0
- package/dist/src/cli/commands/hooks-commands.js +156 -0
- package/dist/src/cli/commands/impact-commands.d.ts +15 -0
- package/dist/src/cli/commands/impact-commands.js +62 -0
- package/dist/src/cli/commands/legacy-commands.d.ts +11 -0
- package/dist/src/cli/commands/legacy-commands.js +32 -0
- package/dist/src/cli/commands/log-commands.d.ts +17 -0
- package/dist/src/cli/commands/log-commands.js +64 -0
- package/dist/src/cli/commands/loop-commands.d.ts +21 -0
- package/dist/src/cli/commands/loop-commands.js +128 -0
- package/dist/src/cli/commands/loop-eval-commands.d.ts +20 -0
- package/dist/src/cli/commands/loop-eval-commands.js +526 -0
- package/dist/src/cli/commands/memory-commands.d.ts +23 -0
- package/dist/src/cli/commands/memory-commands.js +129 -0
- package/dist/src/cli/commands/migrate-1-4-1-command.d.ts +11 -0
- package/dist/src/cli/commands/migrate-1-4-1-command.js +34 -0
- package/dist/src/cli/commands/migrate-v2-10-to-v2-11-command.d.ts +20 -0
- package/dist/src/cli/commands/migrate-v2-10-to-v2-11-command.js +52 -0
- package/dist/src/cli/commands/mut-commands.d.ts +20 -0
- package/dist/src/cli/commands/mut-commands.js +239 -0
- package/dist/src/cli/commands/observability-commands.d.ts +22 -0
- package/dist/src/cli/commands/observability-commands.js +201 -0
- package/dist/src/cli/commands/openspec-commands.d.ts +3 -0
- package/dist/src/cli/commands/openspec-commands.js +237 -0
- package/dist/src/cli/commands/perf-audit-commands.d.ts +22 -0
- package/dist/src/cli/commands/perf-audit-commands.js +132 -0
- package/dist/src/cli/commands/perf-commands.d.ts +3 -0
- package/dist/src/cli/commands/perf-commands.js +41 -0
- package/dist/src/cli/commands/playwright-commands.d.ts +95 -0
- package/dist/src/cli/commands/playwright-commands.js +432 -0
- package/dist/src/cli/commands/prd-blocks-commands.d.ts +18 -0
- package/dist/src/cli/commands/prd-blocks-commands.js +50 -0
- package/dist/src/cli/commands/prd-commands.d.ts +18 -0
- package/dist/src/cli/commands/prd-commands.js +141 -0
- package/dist/src/cli/commands/preferences-commands.d.ts +2 -0
- package/dist/src/cli/commands/preferences-commands.js +197 -0
- package/dist/src/cli/commands/project-commands.d.ts +3 -0
- package/dist/src/cli/commands/project-commands.js +248 -0
- package/dist/src/cli/commands/qa-business-review-commands.d.ts +17 -0
- package/dist/src/cli/commands/qa-business-review-commands.js +148 -0
- package/dist/src/cli/commands/qa-commands.d.ts +94 -0
- package/dist/src/cli/commands/qa-commands.js +271 -0
- package/dist/src/cli/commands/release-commands.d.ts +24 -0
- package/dist/src/cli/commands/release-commands.js +231 -0
- package/dist/src/cli/commands/request-commands.d.ts +3 -0
- package/dist/src/cli/commands/request-commands.js +509 -0
- package/dist/src/cli/commands/retrospective-commands.d.ts +12 -0
- package/dist/src/cli/commands/retrospective-commands.js +175 -0
- package/dist/src/cli/commands/reviewer-commands.d.ts +14 -0
- package/dist/src/cli/commands/reviewer-commands.js +64 -0
- package/dist/src/cli/commands/role-commands.d.ts +13 -0
- package/dist/src/cli/commands/role-commands.js +85 -0
- package/dist/src/cli/commands/sc-commands.d.ts +3 -0
- package/dist/src/cli/commands/sc-commands.js +45 -0
- package/dist/src/cli/commands/scan-commands.d.ts +3 -0
- package/dist/src/cli/commands/scan-commands.js +445 -0
- package/dist/src/cli/commands/security-audit-commands.d.ts +23 -0
- package/dist/src/cli/commands/security-audit-commands.js +132 -0
- package/dist/src/cli/commands/session-checkpoint-command.d.ts +10 -0
- package/dist/src/cli/commands/session-checkpoint-command.js +100 -0
- package/dist/src/cli/commands/session-resume-command.d.ts +11 -0
- package/dist/src/cli/commands/session-resume-command.js +83 -0
- package/dist/src/cli/commands/share-commands.d.ts +17 -0
- package/dist/src/cli/commands/share-commands.js +296 -0
- package/dist/src/cli/commands/skill-conformance-commands.d.ts +9 -0
- package/dist/src/cli/commands/skill-conformance-commands.js +39 -0
- package/dist/src/cli/commands/slice-commands.d.ts +24 -0
- package/dist/src/cli/commands/slice-commands.js +492 -0
- package/dist/src/cli/commands/slice-integrate-commands.d.ts +11 -0
- package/dist/src/cli/commands/slice-integrate-commands.js +74 -0
- package/dist/src/cli/commands/slice-review-commands.d.ts +23 -0
- package/dist/src/cli/commands/slice-review-commands.js +162 -0
- package/dist/src/cli/commands/smoke-commands.d.ts +21 -0
- package/dist/src/cli/commands/smoke-commands.js +203 -0
- package/dist/src/cli/commands/solo-commands.d.ts +80 -0
- package/dist/src/cli/commands/solo-commands.js +435 -0
- package/dist/src/cli/commands/sop-commands.d.ts +3 -0
- package/dist/src/cli/commands/sop-commands.js +215 -0
- package/dist/src/cli/commands/statusline-commands.d.ts +3 -0
- package/dist/src/cli/commands/statusline-commands.js +169 -0
- package/dist/src/cli/commands/sub-agent-commands.d.ts +22 -0
- package/dist/src/cli/commands/sub-agent-commands.js +19 -0
- package/dist/src/cli/commands/sub-agent-dispatch-guard.d.ts +55 -0
- package/dist/src/cli/commands/sub-agent-dispatch-guard.js +57 -0
- package/dist/src/cli/commands/sub-agent-shared.d.ts +99 -0
- package/dist/src/cli/commands/sub-agent-shared.js +67 -0
- package/dist/src/cli/commands/test-commands.d.ts +47 -0
- package/dist/src/cli/commands/test-commands.js +204 -0
- package/dist/src/cli/commands/understand-commands.d.ts +3 -0
- package/dist/src/cli/commands/understand-commands.js +112 -0
- package/dist/src/cli/commands/upgrade-commands.d.ts +23 -0
- package/dist/src/cli/commands/upgrade-commands.js +119 -0
- package/dist/src/cli/commands/user-touchpoint-commands.d.ts +18 -0
- package/dist/src/cli/commands/user-touchpoint-commands.js +78 -0
- package/dist/src/cli/commands/verdict-aggregate-command.d.ts +14 -0
- package/dist/src/cli/commands/verdict-aggregate-command.js +106 -0
- package/dist/src/cli/commands/worker-commands.d.ts +3 -0
- package/dist/src/cli/commands/worker-commands.js +52 -0
- package/dist/src/cli/commands/workflow-commands.d.ts +3 -0
- package/dist/src/cli/commands/workflow-commands.js +535 -0
- package/dist/src/cli/commands/workflow-plan-commands.d.ts +39 -0
- package/dist/src/cli/commands/workflow-plan-commands.js +163 -0
- package/dist/src/cli/commands/workspace/clean-command.d.ts +14 -0
- package/dist/src/cli/commands/workspace/clean-command.js +49 -0
- package/dist/src/cli/commands/workspace/helpers.d.ts +28 -0
- package/dist/src/cli/commands/workspace/helpers.js +87 -0
- package/dist/src/cli/commands/workspace/init-command.d.ts +121 -0
- package/dist/src/cli/commands/workspace/init-command.js +436 -0
- package/dist/src/cli/commands/workspace/migrate-command.d.ts +11 -0
- package/dist/src/cli/commands/workspace/migrate-command.js +91 -0
- package/dist/src/cli/commands/workspace/reconcile-command.d.ts +14 -0
- package/dist/src/cli/commands/workspace/reconcile-command.js +103 -0
- package/dist/src/cli/commands/workspace-commands.d.ts +18 -0
- package/dist/src/cli/commands/workspace-commands.js +50 -0
- package/dist/src/cli/index.d.ts +1 -0
- package/dist/src/cli/index.js +30 -0
- package/dist/src/cli/program.d.ts +5 -0
- package/dist/src/cli/program.js +336 -0
- package/dist/src/hooks/pre-tool-use-sub-agent.d.ts +28 -0
- package/dist/src/hooks/pre-tool-use-sub-agent.js +105 -0
- package/dist/src/lib/render/message-renderer.d.ts +20 -0
- package/dist/src/lib/render/message-renderer.js +80 -0
- package/dist/src/services/agent/ecc-agent-service.d.ts +47 -0
- package/dist/src/services/agent/ecc-agent-service.js +143 -0
- package/dist/src/services/artifacts/artifact-lint-service.d.ts +23 -0
- package/dist/src/services/artifacts/artifact-lint-service.js +99 -0
- package/dist/src/services/artifacts/artifact-prerequisites.d.ts +78 -0
- package/dist/src/services/artifacts/artifact-prerequisites.js +491 -0
- package/dist/src/services/artifacts/artifact-service.d.ts +43 -0
- package/dist/src/services/artifacts/artifact-service.js +98 -0
- package/dist/src/services/artifacts/artifact-templates.d.ts +30 -0
- package/dist/src/services/artifacts/artifact-templates.js +302 -0
- package/dist/src/services/artifacts/repair-cycle-service.d.ts +23 -0
- package/dist/src/services/artifacts/repair-cycle-service.js +52 -0
- package/dist/src/services/artifacts/request-artifact-service.d.ts +116 -0
- package/dist/src/services/artifacts/request-artifact-service.js +451 -0
- package/dist/src/services/artifacts/request-artifact-state-helpers.d.ts +51 -0
- package/dist/src/services/artifacts/request-artifact-state-helpers.js +114 -0
- package/dist/src/services/artifacts/workspace-service.d.ts +34 -0
- package/dist/src/services/artifacts/workspace-service.js +272 -0
- package/dist/src/services/audit/artifact-writer.d.ts +93 -0
- package/dist/src/services/audit/artifact-writer.js +303 -0
- package/dist/src/services/audit/audit-goal-service.d.ts +35 -0
- package/dist/src/services/audit/audit-goal-service.js +75 -0
- package/dist/src/services/audit/audit-goal-types.d.ts +40 -0
- package/dist/src/services/audit/audit-goal-types.js +15 -0
- package/dist/src/services/audit/backing-detector.d.ts +24 -0
- package/dist/src/services/audit/backing-detector.js +59 -0
- package/dist/src/services/audit/classifier.d.ts +38 -0
- package/dist/src/services/audit/classifier.js +134 -0
- package/dist/src/services/audit/decision-writer.d.ts +76 -0
- package/dist/src/services/audit/decision-writer.js +217 -0
- package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +29 -0
- package/dist/src/services/audit/enforcers/active-skill-resolver.js +71 -0
- package/dist/src/services/audit/enforcers/design-draft-confirm.d.ts +24 -0
- package/dist/src/services/audit/enforcers/design-draft-confirm.js +58 -0
- package/dist/src/services/audit/enforcers/lint-audit-regression.d.ts +21 -0
- package/dist/src/services/audit/enforcers/lint-audit-regression.js +86 -0
- package/dist/src/services/audit/enforcers/lint-catalog-governance.d.ts +32 -0
- package/dist/src/services/audit/enforcers/lint-catalog-governance.js +48 -0
- package/dist/src/services/audit/enforcers/lint-cli-back.d.ts +16 -0
- package/dist/src/services/audit/enforcers/lint-cli-back.js +35 -0
- package/dist/src/services/audit/enforcers/lint-output-style.d.ts +11 -0
- package/dist/src/services/audit/enforcers/lint-output-style.js +94 -0
- package/dist/src/services/audit/enforcers/lint-reference-integrity.d.ts +6 -0
- package/dist/src/services/audit/enforcers/lint-reference-integrity.js +83 -0
- package/dist/src/services/audit/enforcers/lint-reference-shape.d.ts +30 -0
- package/dist/src/services/audit/enforcers/lint-reference-shape.js +272 -0
- package/dist/src/services/audit/enforcers/lint-style.d.ts +49 -0
- package/dist/src/services/audit/enforcers/lint-style.js +173 -0
- package/dist/src/services/audit/enforcers/lint-workflow-shape.d.ts +4 -0
- package/dist/src/services/audit/enforcers/lint-workflow-shape.js +100 -0
- package/dist/src/services/audit/enforcers/login-gate.d.ts +23 -0
- package/dist/src/services/audit/enforcers/login-gate.js +40 -0
- package/dist/src/services/audit/enforcers/mock-placement.d.ts +25 -0
- package/dist/src/services/audit/enforcers/mock-placement.js +48 -0
- package/dist/src/services/audit/enforcers/no-root-pollution.d.ts +21 -0
- package/dist/src/services/audit/enforcers/no-root-pollution.js +56 -0
- package/dist/src/services/audit/enforcers/pre-rd-scan.d.ts +22 -0
- package/dist/src/services/audit/enforcers/pre-rd-scan.js +23 -0
- package/dist/src/services/audit/enforcers/prototype-fidelity.d.ts +25 -0
- package/dist/src/services/audit/enforcers/prototype-fidelity.js +75 -0
- package/dist/src/services/audit/enforcers/resume-detection.d.ts +21 -0
- package/dist/src/services/audit/enforcers/resume-detection.js +52 -0
- package/dist/src/services/audit/enforcers/solo-code-ban.d.ts +23 -0
- package/dist/src/services/audit/enforcers/solo-code-ban.js +27 -0
- package/dist/src/services/audit/enforcers/sub-agent-sid.d.ts +25 -0
- package/dist/src/services/audit/enforcers/sub-agent-sid.js +63 -0
- package/dist/src/services/audit/prose-ratio-calculator.d.ts +45 -0
- package/dist/src/services/audit/prose-ratio-calculator.js +52 -0
- package/dist/src/services/audit/red-line-catalog-p2-a.d.ts +21 -0
- package/dist/src/services/audit/red-line-catalog-p2-a.js +229 -0
- package/dist/src/services/audit/red-line-catalog-p2-b.d.ts +19 -0
- package/dist/src/services/audit/red-line-catalog-p2-b.js +225 -0
- package/dist/src/services/audit/red-line-catalog.d.ts +51 -0
- package/dist/src/services/audit/red-line-catalog.js +195 -0
- package/dist/src/services/audit/red-lines-service.d.ts +23 -0
- package/dist/src/services/audit/red-lines-service.js +464 -0
- package/dist/src/services/audit/scanners/openspec-scanner.d.ts +15 -0
- package/dist/src/services/audit/scanners/openspec-scanner.js +55 -0
- package/dist/src/services/audit/scanners/rules-tree-scanner.d.ts +16 -0
- package/dist/src/services/audit/scanners/rules-tree-scanner.js +56 -0
- package/dist/src/services/audit/scanners/skills-tree-scanner.d.ts +17 -0
- package/dist/src/services/audit/scanners/skills-tree-scanner.js +46 -0
- package/dist/src/services/audit/static-service.d.ts +60 -0
- package/dist/src/services/audit/static-service.js +130 -0
- package/dist/src/services/audit/types.d.ts +86 -0
- package/dist/src/services/audit/types.js +13 -0
- package/dist/src/services/audit-independent/perf-audit-service.d.ts +151 -0
- package/dist/src/services/audit-independent/perf-audit-service.js +316 -0
- package/dist/src/services/audit-independent/security-audit-service.d.ts +155 -0
- package/dist/src/services/audit-independent/security-audit-service.js +316 -0
- package/dist/src/services/classify/classify-service.d.ts +42 -0
- package/dist/src/services/classify/classify-service.js +122 -0
- package/dist/src/services/classify/classify-types.d.ts +79 -0
- package/dist/src/services/classify/classify-types.js +90 -0
- package/dist/src/services/code-review/ecc-bridge.d.ts +148 -0
- package/dist/src/services/code-review/ecc-bridge.js +242 -0
- package/dist/src/services/code-review/ocr-service.d.ts +129 -0
- package/dist/src/services/code-review/ocr-service.js +369 -0
- package/dist/src/services/codegraph/codegraph-process-runner.d.ts +2 -0
- package/dist/src/services/codegraph/codegraph-process-runner.js +93 -0
- package/dist/src/services/codegraph/codegraph-service.d.ts +43 -0
- package/dist/src/services/codegraph/codegraph-service.js +160 -0
- package/dist/src/services/complexity/complexity-estimator.d.ts +34 -0
- package/dist/src/services/complexity/complexity-estimator.js +64 -0
- package/dist/src/services/config/config-migration.d.ts +45 -0
- package/dist/src/services/config/config-migration.js +154 -0
- package/dist/src/services/config/config-restore.d.ts +10 -0
- package/dist/src/services/config/config-restore.js +47 -0
- package/dist/src/services/config/config-rollback.d.ts +13 -0
- package/dist/src/services/config/config-rollback.js +26 -0
- package/dist/src/services/config/config-safety.d.ts +40 -0
- package/dist/src/services/config/config-safety.js +359 -0
- package/dist/src/services/config/config-service.d.ts +69 -0
- package/dist/src/services/config/config-service.js +814 -0
- package/dist/src/services/config/config-types.d.ts +119 -0
- package/dist/src/services/config/config-types.js +18 -0
- package/dist/src/services/config/model-routing.d.ts +4 -0
- package/dist/src/services/config/model-routing.js +17 -0
- package/dist/src/services/config/provider-service.d.ts +48 -0
- package/dist/src/services/config/provider-service.js +143 -0
- package/dist/src/services/config/proxy-service.d.ts +21 -0
- package/dist/src/services/config/proxy-service.js +44 -0
- package/dist/src/services/config/sidecar-store.d.ts +25 -0
- package/dist/src/services/config/sidecar-store.js +61 -0
- package/dist/src/services/config/workspace-state-service.d.ts +30 -0
- package/dist/src/services/config/workspace-state-service.js +142 -0
- package/dist/src/services/context/artifact-meta.d.ts +72 -0
- package/dist/src/services/context/artifact-meta.js +105 -0
- package/dist/src/services/context/auto-compact-dispatcher.d.ts +37 -0
- package/dist/src/services/context/auto-compact-dispatcher.js +190 -0
- package/dist/src/services/context/auto-compact-reader.d.ts +51 -0
- package/dist/src/services/context/auto-compact-reader.js +164 -0
- package/dist/src/services/context/auto-compact-types.d.ts +143 -0
- package/dist/src/services/context/auto-compact-types.js +36 -0
- package/dist/src/services/context/collector.d.ts +24 -0
- package/dist/src/services/context/collector.js +133 -0
- package/dist/src/services/context/context-builder.d.ts +30 -0
- package/dist/src/services/context/context-builder.js +78 -0
- package/dist/src/services/context/context-guard.d.ts +49 -0
- package/dist/src/services/context/context-guard.js +91 -0
- package/dist/src/services/context/context-schema.d.ts +415 -0
- package/dist/src/services/context/context-schema.js +73 -0
- package/dist/src/services/context/dispatch-context-guard.d.ts +27 -0
- package/dist/src/services/context/dispatch-context-guard.js +192 -0
- package/dist/src/services/context/doc-retriever.d.ts +26 -0
- package/dist/src/services/context/doc-retriever.js +51 -0
- package/dist/src/services/context/headroom-client.d.ts +34 -0
- package/dist/src/services/context/headroom-client.js +117 -0
- package/dist/src/services/context/headroom-fetcher.d.ts +6 -0
- package/dist/src/services/context/headroom-fetcher.js +28 -0
- package/dist/src/services/context/headroom-prefs.d.ts +46 -0
- package/dist/src/services/context/headroom-prefs.js +34 -0
- package/dist/src/services/context/index.d.ts +7 -0
- package/dist/src/services/context/index.js +6 -0
- package/dist/src/services/context/main-session-monitor.d.ts +77 -0
- package/dist/src/services/context/main-session-monitor.js +130 -0
- package/dist/src/services/context/renderer.d.ts +20 -0
- package/dist/src/services/context/renderer.js +30 -0
- package/dist/src/services/context/shared-channel.d.ts +93 -0
- package/dist/src/services/context/shared-channel.js +308 -0
- package/dist/src/services/context/threshold.d.ts +35 -0
- package/dist/src/services/context/threshold.js +76 -0
- package/dist/src/services/context/tokenizer.d.ts +12 -0
- package/dist/src/services/context/tokenizer.js +43 -0
- package/dist/src/services/context/types.d.ts +93 -0
- package/dist/src/services/context/types.js +9 -0
- package/dist/src/services/dashboard/project-dashboard-service.d.ts +91 -0
- package/dist/src/services/dashboard/project-dashboard-service.js +147 -0
- package/dist/src/services/dispatch/batch-counter.d.ts +27 -0
- package/dist/src/services/dispatch/batch-counter.js +102 -0
- package/dist/src/services/dispatch/contract-store.d.ts +63 -0
- package/dist/src/services/dispatch/contract-store.js +157 -0
- package/dist/src/services/dispatch/dispatch-record-writer.d.ts +138 -0
- package/dist/src/services/dispatch/dispatch-record-writer.js +460 -0
- package/dist/src/services/dispatch/heartbeat-truncator.d.ts +26 -0
- package/dist/src/services/dispatch/heartbeat-truncator.js +13 -0
- package/dist/src/services/dispatch/leak-detector.d.ts +11 -0
- package/dist/src/services/dispatch/leak-detector.js +72 -0
- package/dist/src/services/dispatch/slice-dag.d.ts +81 -0
- package/dist/src/services/dispatch/slice-dag.js +238 -0
- package/dist/src/services/dispatch/sub-agent-dispatcher.d.ts +239 -0
- package/dist/src/services/dispatch/sub-agent-dispatcher.js +382 -0
- package/dist/src/services/dispatch/test-tool-detection.d.ts +36 -0
- package/dist/src/services/dispatch/test-tool-detection.js +46 -0
- package/dist/src/services/doc/doc-generator.d.ts +38 -0
- package/dist/src/services/doc/doc-generator.js +122 -0
- package/dist/src/services/doctor/doctor-service.d.ts +149 -0
- package/dist/src/services/doctor/doctor-service.js +929 -0
- package/dist/src/services/feedback/feedback-promotion-service.d.ts +123 -0
- package/dist/src/services/feedback/feedback-promotion-service.js +300 -0
- package/dist/src/services/filesystem/file-lock.d.ts +11 -0
- package/dist/src/services/filesystem/file-lock.js +129 -0
- package/dist/src/services/final-review/final-review-service.d.ts +12 -0
- package/dist/src/services/final-review/final-review-service.js +52 -0
- package/dist/src/services/final-review/final-review-types.d.ts +42 -0
- package/dist/src/services/final-review/final-review-types.js +18 -0
- package/dist/src/services/fixture/fixture-capture-service.d.ts +87 -0
- package/dist/src/services/fixture/fixture-capture-service.js +317 -0
- package/dist/src/services/fixture/fixture-sanitize-service.d.ts +117 -0
- package/dist/src/services/fixture/fixture-sanitize-service.js +161 -0
- package/dist/src/services/fixture/index.d.ts +8 -0
- package/dist/src/services/fixture/index.js +8 -0
- package/dist/src/services/fork/fork-sync-state.d.ts +85 -0
- package/dist/src/services/fork/fork-sync-state.js +130 -0
- package/dist/src/services/fuzzy-matching/fuzzy-match-service.d.ts +15 -0
- package/dist/src/services/fuzzy-matching/fuzzy-match-service.js +56 -0
- package/dist/src/services/fuzzy-matching/fzf-pick-service.d.ts +68 -0
- package/dist/src/services/fuzzy-matching/fzf-pick-service.js +158 -0
- package/dist/src/services/fuzzy-matching/types.d.ts +20 -0
- package/dist/src/services/fuzzy-matching/types.js +1 -0
- package/dist/src/services/handoff/handoff-parser.d.ts +28 -0
- package/dist/src/services/handoff/handoff-parser.js +69 -0
- package/dist/src/services/handoff/handoff-types.d.ts +39 -0
- package/dist/src/services/handoff/handoff-types.js +19 -0
- package/dist/src/services/handoff/handoff-writer.d.ts +23 -0
- package/dist/src/services/handoff/handoff-writer.js +30 -0
- package/dist/src/services/hooks/output.d.ts +92 -0
- package/dist/src/services/hooks/output.js +111 -0
- package/dist/src/services/hooks/presence-marker-detector.d.ts +16 -0
- package/dist/src/services/hooks/presence-marker-detector.js +105 -0
- package/dist/src/services/ide/adapters/claude-code-adapter.d.ts +18 -0
- package/dist/src/services/ide/adapters/claude-code-adapter.js +91 -0
- package/dist/src/services/ide/adapters/codex-adapter.d.ts +46 -0
- package/dist/src/services/ide/adapters/codex-adapter.js +97 -0
- package/dist/src/services/ide/adapters/cursor-adapter.d.ts +36 -0
- package/dist/src/services/ide/adapters/cursor-adapter.js +84 -0
- package/dist/src/services/ide/adapters/hermes-adapter.d.ts +21 -0
- package/dist/src/services/ide/adapters/hermes-adapter.js +51 -0
- package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +14 -0
- package/dist/src/services/ide/adapters/openclaw-adapter.js +42 -0
- package/dist/src/services/ide/adapters/trae-adapter.d.ts +42 -0
- package/dist/src/services/ide/adapters/trae-adapter.js +83 -0
- package/dist/src/services/ide/hook-protocol.d.ts +47 -0
- package/dist/src/services/ide/hook-protocol.js +74 -0
- package/dist/src/services/ide/hook-translator.d.ts +72 -0
- package/dist/src/services/ide/hook-translator.js +128 -0
- package/dist/src/services/ide/ide-detector.d.ts +10 -0
- package/dist/src/services/ide/ide-detector.js +19 -0
- package/dist/src/services/ide/ide-registry.d.ts +14 -0
- package/dist/src/services/ide/ide-registry.js +60 -0
- package/dist/src/services/ide/ide-types.d.ts +230 -0
- package/dist/src/services/ide/ide-types.js +2 -0
- package/dist/src/services/ide/resource-profile.d.ts +52 -0
- package/dist/src/services/ide/resource-profile.js +33 -0
- package/dist/src/services/ide/shared/atomic-json.d.ts +15 -0
- package/dist/src/services/ide/shared/atomic-json.js +58 -0
- package/dist/src/services/ide/shared/safe-path.d.ts +11 -0
- package/dist/src/services/ide/shared/safe-path.js +29 -0
- package/dist/src/services/impact/impact-scan-service.d.ts +66 -0
- package/dist/src/services/impact/impact-scan-service.js +197 -0
- package/dist/src/services/legacy/legacy-detector.d.ts +34 -0
- package/dist/src/services/legacy/legacy-detector.js +111 -0
- package/dist/src/services/log/log-commands-service.d.ts +54 -0
- package/dist/src/services/log/log-commands-service.js +83 -0
- package/dist/src/services/log/logger.d.ts +103 -0
- package/dist/src/services/log/logger.js +224 -0
- package/dist/src/services/log/redact.d.ts +32 -0
- package/dist/src/services/log/redact.js +89 -0
- package/dist/src/services/log/retention.d.ts +34 -0
- package/dist/src/services/log/retention.js +78 -0
- package/dist/src/services/loop/evaluator-dispatcher.d.ts +50 -0
- package/dist/src/services/loop/evaluator-dispatcher.js +551 -0
- package/dist/src/services/loop/monotonic-guard.d.ts +80 -0
- package/dist/src/services/loop/monotonic-guard.js +215 -0
- package/dist/src/services/loop/monotonic-runner.d.ts +55 -0
- package/dist/src/services/loop/monotonic-runner.js +197 -0
- package/dist/src/services/loop/run-driver.d.ts +70 -0
- package/dist/src/services/loop/run-driver.js +379 -0
- package/dist/src/services/loop/spec-service.d.ts +90 -0
- package/dist/src/services/loop/spec-service.js +497 -0
- package/dist/src/services/memory/llm-reranker.d.ts +174 -0
- package/dist/src/services/memory/llm-reranker.js +284 -0
- package/dist/src/services/memory/memory-search-service.d.ts +93 -0
- package/dist/src/services/memory/memory-search-service.js +117 -0
- package/dist/src/services/memory/project-context-service.d.ts +11 -0
- package/dist/src/services/memory/project-context-service.js +148 -0
- package/dist/src/services/memory/project-memory-service.d.ts +167 -0
- package/dist/src/services/memory/project-memory-service.js +817 -0
- package/dist/src/services/migration/v2-10-to-v2-11-service.d.ts +44 -0
- package/dist/src/services/migration/v2-10-to-v2-11-service.js +190 -0
- package/dist/src/services/migration/v2-10-to-v2-11-types.d.ts +41 -0
- package/dist/src/services/migration/v2-10-to-v2-11-types.js +23 -0
- package/dist/src/services/mode/bypass-tracker.d.ts +4 -0
- package/dist/src/services/mode/bypass-tracker.js +31 -0
- package/dist/src/services/mode/mode-enforcement.d.ts +14 -0
- package/dist/src/services/mode/mode-enforcement.js +84 -0
- package/dist/src/services/mut/assert-scanner.d.ts +6 -0
- package/dist/src/services/mut/assert-scanner.js +116 -0
- package/dist/src/services/mut/index.d.ts +8 -0
- package/dist/src/services/mut/index.js +7 -0
- package/dist/src/services/mut/mut-runner.d.ts +39 -0
- package/dist/src/services/mut/mut-runner.js +29 -0
- package/dist/src/services/mut/production-stryker.d.ts +7 -0
- package/dist/src/services/mut/production-stryker.js +66 -0
- package/dist/src/services/mut/report-builder.d.ts +11 -0
- package/dist/src/services/mut/report-builder.js +110 -0
- package/dist/src/services/mut/report-loader.d.ts +31 -0
- package/dist/src/services/mut/report-loader.js +78 -0
- package/dist/src/services/mut/thresholds.d.ts +21 -0
- package/dist/src/services/mut/thresholds.js +22 -0
- package/dist/src/services/mut/types.d.ts +336 -0
- package/dist/src/services/mut/types.js +59 -0
- package/dist/src/services/observability/aggregation.d.ts +64 -0
- package/dist/src/services/observability/aggregation.js +217 -0
- package/dist/src/services/observability/jsonl-store.d.ts +59 -0
- package/dist/src/services/observability/jsonl-store.js +120 -0
- package/dist/src/services/observability/observability-service.d.ts +95 -0
- package/dist/src/services/observability/observability-service.js +119 -0
- package/dist/src/services/observability/report-formatter.d.ts +42 -0
- package/dist/src/services/observability/report-formatter.js +156 -0
- package/dist/src/services/openspec/openspec-archive-service.d.ts +12 -0
- package/dist/src/services/openspec/openspec-archive-service.js +28 -0
- package/dist/src/services/openspec/openspec-bridge-service.d.ts +16 -0
- package/dist/src/services/openspec/openspec-bridge-service.js +76 -0
- package/dist/src/services/openspec/openspec-init-service.d.ts +23 -0
- package/dist/src/services/openspec/openspec-init-service.js +122 -0
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +31 -0
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +95 -0
- package/dist/src/services/openspec/openspec-render-service.d.ts +38 -0
- package/dist/src/services/openspec/openspec-render-service.js +130 -0
- package/dist/src/services/openspec/openspec-scan-service.d.ts +6 -0
- package/dist/src/services/openspec/openspec-scan-service.js +123 -0
- package/dist/src/services/openspec/openspec-types.d.ts +39 -0
- package/dist/src/services/openspec/openspec-types.js +1 -0
- package/dist/src/services/openspec/openspec-validate-service.d.ts +27 -0
- package/dist/src/services/openspec/openspec-validate-service.js +77 -0
- package/dist/src/services/perf/perf-baseline-service.d.ts +70 -0
- package/dist/src/services/perf/perf-baseline-service.js +214 -0
- package/dist/src/services/prd/handoff-auto-regen.d.ts +22 -0
- package/dist/src/services/prd/handoff-auto-regen.js +73 -0
- package/dist/src/services/prd/handoff-service.d.ts +54 -0
- package/dist/src/services/prd/handoff-service.js +142 -0
- package/dist/src/services/prd/handoff-types.d.ts +64 -0
- package/dist/src/services/prd/handoff-types.js +22 -0
- package/dist/src/services/prd/prd-blocks-checker.d.ts +51 -0
- package/dist/src/services/prd/prd-blocks-checker.js +130 -0
- package/dist/src/services/prd/project-scan-reader.d.ts +24 -0
- package/dist/src/services/prd/project-scan-reader.js +150 -0
- package/dist/src/services/prd/project-scan-sediment.d.ts +97 -0
- package/dist/src/services/prd/project-scan-sediment.js +445 -0
- package/dist/src/services/prd/project-scan-types.d.ts +66 -0
- package/dist/src/services/prd/project-scan-types.js +20 -0
- package/dist/src/services/preferences/preferences-service.d.ts +38 -0
- package/dist/src/services/preferences/preferences-service.js +198 -0
- package/dist/src/services/preferences/preferences-types.d.ts +148 -0
- package/dist/src/services/preferences/preferences-types.js +53 -0
- package/dist/src/services/profiles/profile-service.d.ts +6 -0
- package/dist/src/services/profiles/profile-service.js +19 -0
- package/dist/src/services/progress/progress-service.d.ts +125 -0
- package/dist/src/services/progress/progress-service.js +192 -0
- package/dist/src/services/providers/minimax-provider-service.d.ts +24 -0
- package/dist/src/services/providers/minimax-provider-service.js +143 -0
- package/dist/src/services/providers/minimax-worker-service.d.ts +21 -0
- package/dist/src/services/providers/minimax-worker-service.js +83 -0
- package/dist/src/services/proxy/proxy-service.d.ts +7 -0
- package/dist/src/services/proxy/proxy-service.js +31 -0
- package/dist/src/services/qa/browser-event-logger.d.ts +40 -0
- package/dist/src/services/qa/browser-event-logger.js +54 -0
- package/dist/src/services/qa/browser-restart-detector.d.ts +74 -0
- package/dist/src/services/qa/browser-restart-detector.js +138 -0
- package/dist/src/services/qa/browser-reuse-hint.d.ts +18 -0
- package/dist/src/services/qa/browser-reuse-hint.js +18 -0
- package/dist/src/services/qa/browser-wrapper-service.d.ts +37 -0
- package/dist/src/services/qa/browser-wrapper-service.js +88 -0
- package/dist/src/services/qa/qa-business-review-state.d.ts +47 -0
- package/dist/src/services/qa/qa-business-review-state.js +96 -0
- package/dist/src/services/rd/ast-gate.d.ts +19 -0
- package/dist/src/services/rd/ast-gate.js +71 -0
- package/dist/src/services/rd/impl.d.ts +9 -0
- package/dist/src/services/rd/impl.js +57 -0
- package/dist/src/services/rd/rd-service.d.ts +129 -0
- package/dist/src/services/rd/rd-service.js +438 -0
- package/dist/src/services/rd/reviewer-dispatch-policy.d.ts +122 -0
- package/dist/src/services/rd/reviewer-dispatch-policy.js +148 -0
- package/dist/src/services/rd/standards-diagnostic.d.ts +76 -0
- package/dist/src/services/rd/standards-diagnostic.js +166 -0
- package/dist/src/services/rd/strategic-stage.d.ts +4 -0
- package/dist/src/services/rd/strategic-stage.js +15 -0
- package/dist/src/services/rd/strategy.d.ts +13 -0
- package/dist/src/services/rd/strategy.js +60 -0
- package/dist/src/services/rd/tactical-stage.d.ts +33 -0
- package/dist/src/services/rd/tactical-stage.js +62 -0
- package/dist/src/services/rd/types.d.ts +252 -0
- package/dist/src/services/rd/types.js +47 -0
- package/dist/src/services/recommendations/capability-availability.d.ts +5 -0
- package/dist/src/services/recommendations/capability-availability.js +40 -0
- package/dist/src/services/recommendations/capability-map-service.d.ts +7 -0
- package/dist/src/services/recommendations/capability-map-service.js +131 -0
- package/dist/src/services/recommendations/capability-seed-items.d.ts +2 -0
- package/dist/src/services/recommendations/capability-seed-items.js +140 -0
- package/dist/src/services/recommendations/capability-seed-mappings.d.ts +2 -0
- package/dist/src/services/recommendations/capability-seed-mappings.js +54 -0
- package/dist/src/services/recommendations/capability-seed-sources.d.ts +2 -0
- package/dist/src/services/recommendations/capability-seed-sources.js +35 -0
- package/dist/src/services/recommendations/recommendation-service.d.ts +8 -0
- package/dist/src/services/recommendations/recommendation-service.js +106 -0
- package/dist/src/services/recommendations/recommendation-types.d.ts +129 -0
- package/dist/src/services/recommendations/recommendation-types.js +1 -0
- package/dist/src/services/recommendations/seed-capability-catalog.d.ts +3 -0
- package/dist/src/services/recommendations/seed-capability-catalog.js +3 -0
- package/dist/src/services/refactor/refactor-service.d.ts +9 -0
- package/dist/src/services/refactor/refactor-service.js +36 -0
- package/dist/src/services/release/release-state.d.ts +70 -0
- package/dist/src/services/release/release-state.js +140 -0
- package/dist/src/services/retrospective/retrospective-index.d.ts +37 -0
- package/dist/src/services/retrospective/retrospective-index.js +110 -0
- package/dist/src/services/retrospective/retrospective-search-service.d.ts +55 -0
- package/dist/src/services/retrospective/retrospective-search-service.js +107 -0
- package/dist/src/services/retrospective/retrospective-show.d.ts +40 -0
- package/dist/src/services/retrospective/retrospective-show.js +109 -0
- package/dist/src/services/reviewer/model-family.d.ts +18 -0
- package/dist/src/services/reviewer/model-family.js +70 -0
- package/dist/src/services/reviewer/providers/anthropic.d.ts +2 -0
- package/dist/src/services/reviewer/providers/anthropic.js +61 -0
- package/dist/src/services/reviewer/providers/ollama.d.ts +26 -0
- package/dist/src/services/reviewer/providers/ollama.js +38 -0
- package/dist/src/services/reviewer/providers/openai.d.ts +2 -0
- package/dist/src/services/reviewer/providers/openai.js +63 -0
- package/dist/src/services/reviewer/reviewer-config.d.ts +34 -0
- package/dist/src/services/reviewer/reviewer-config.js +100 -0
- package/dist/src/services/reviewer/reviewer-service.d.ts +56 -0
- package/dist/src/services/reviewer/reviewer-service.js +263 -0
- package/dist/src/services/reviewer/selection-strategies.d.ts +27 -0
- package/dist/src/services/reviewer/selection-strategies.js +53 -0
- package/dist/src/services/role/role-registry.d.ts +38 -0
- package/dist/src/services/role/role-registry.js +83 -0
- package/dist/src/services/sc/index.d.ts +1 -0
- package/dist/src/services/sc/index.js +1 -0
- package/dist/src/services/sc/sc-service.d.ts +131 -0
- package/dist/src/services/sc/sc-service.js +552 -0
- package/dist/src/services/scan/acceptance-coverage-service.d.ts +42 -0
- package/dist/src/services/scan/acceptance-coverage-service.js +140 -0
- package/dist/src/services/scan/api-surface-service.d.ts +69 -0
- package/dist/src/services/scan/api-surface-service.js +239 -0
- package/dist/src/services/scan/archetype-service.d.ts +5 -0
- package/dist/src/services/scan/archetype-service.js +242 -0
- package/dist/src/services/scan/diff-scope-service.d.ts +40 -0
- package/dist/src/services/scan/diff-scope-service.js +198 -0
- package/dist/src/services/scan/existing-system-service.d.ts +7 -0
- package/dist/src/services/scan/existing-system-service.js +300 -0
- package/dist/src/services/scan/file-size-scan.d.ts +23 -0
- package/dist/src/services/scan/file-size-scan.js +68 -0
- package/dist/src/services/scan/karpathy-service.d.ts +60 -0
- package/dist/src/services/scan/karpathy-service.js +228 -0
- package/dist/src/services/scan/libraries-service.d.ts +24 -0
- package/dist/src/services/scan/libraries-service.js +419 -0
- package/dist/src/services/scan/libraries-types.d.ts +59 -0
- package/dist/src/services/scan/libraries-types.js +9 -0
- package/dist/src/services/scan/orphan-service.d.ts +76 -0
- package/dist/src/services/scan/orphan-service.js +538 -0
- package/dist/src/services/scan/scan-types.d.ts +59 -0
- package/dist/src/services/scan/scan-types.js +1 -0
- package/dist/src/services/scan/type-sanity-service.d.ts +23 -0
- package/dist/src/services/scan/type-sanity-service.js +116 -0
- package/dist/src/services/security/safe-settings-path.d.ts +12 -0
- package/dist/src/services/security/safe-settings-path.js +104 -0
- package/dist/src/services/session/binding-status-service.d.ts +56 -0
- package/dist/src/services/session/binding-status-service.js +106 -0
- package/dist/src/services/session/binding-store.d.ts +161 -0
- package/dist/src/services/session/binding-store.js +509 -0
- package/dist/src/services/session/caller-binding-service.d.ts +70 -0
- package/dist/src/services/session/caller-binding-service.js +148 -0
- package/dist/src/services/session/caller-id-types.d.ts +77 -0
- package/dist/src/services/session/caller-id-types.js +46 -0
- package/dist/src/services/session/getSessionDir.d.ts +1 -0
- package/dist/src/services/session/getSessionDir.js +27 -0
- package/dist/src/services/session/index.d.ts +6 -0
- package/dist/src/services/session/index.js +7 -0
- package/dist/src/services/session/platform-fallbacks.d.ts +31 -0
- package/dist/src/services/session/platform-fallbacks.js +35 -0
- package/dist/src/services/session/resolve-caller-id.d.ts +57 -0
- package/dist/src/services/session/resolve-caller-id.js +88 -0
- package/dist/src/services/session/session-binding-bridge.d.ts +76 -0
- package/dist/src/services/session/session-binding-bridge.js +247 -0
- package/dist/src/services/session/session-checkpoint-service.d.ts +57 -0
- package/dist/src/services/session/session-checkpoint-service.js +143 -0
- package/dist/src/services/session/session-manager.d.ts +168 -0
- package/dist/src/services/session/session-manager.js +502 -0
- package/dist/src/services/session/session-resume-service.d.ts +25 -0
- package/dist/src/services/session/session-resume-service.js +101 -0
- package/dist/src/services/signal/cancel-handler.d.ts +14 -0
- package/dist/src/services/signal/cancel-handler.js +76 -0
- package/dist/src/services/skill/resume-detector.d.ts +54 -0
- package/dist/src/services/skill/resume-detector.js +334 -0
- package/dist/src/services/skill/skill-scheduler.d.ts +40 -0
- package/dist/src/services/skill/skill-scheduler.js +53 -0
- package/dist/src/services/skills/hooks-settings-service.d.ts +137 -0
- package/dist/src/services/skills/hooks-settings-service.js +396 -0
- package/dist/src/services/skills/skill-conformance-service.d.ts +40 -0
- package/dist/src/services/skills/skill-conformance-service.js +136 -0
- package/dist/src/services/skills/skill-presence-service.d.ts +158 -0
- package/dist/src/services/skills/skill-presence-service.js +474 -0
- package/dist/src/services/skills/skill-registry.d.ts +17 -0
- package/dist/src/services/skills/skill-registry.js +40 -0
- package/dist/src/services/skills/skill-runbook-service.d.ts +11 -0
- package/dist/src/services/skills/skill-runbook-service.js +128 -0
- package/dist/src/services/skills/skill-statusline-renderer.d.ts +6 -0
- package/dist/src/services/skills/skill-statusline-renderer.js +55 -0
- package/dist/src/services/skills/skill-statusline-service.d.ts +24 -0
- package/dist/src/services/skills/skill-statusline-service.js +110 -0
- package/dist/src/services/skills/statusline-settings-service.d.ts +59 -0
- package/dist/src/services/skills/statusline-settings-service.js +141 -0
- package/dist/src/services/skills/sync-service.d.ts +86 -0
- package/dist/src/services/skills/sync-service.js +271 -0
- package/dist/src/services/slice/calibration-store.d.ts +39 -0
- package/dist/src/services/slice/calibration-store.js +68 -0
- package/dist/src/services/slice/cross-pass-edge-merger.d.ts +53 -0
- package/dist/src/services/slice/cross-pass-edge-merger.js +246 -0
- package/dist/src/services/slice/granularity-decider.d.ts +37 -0
- package/dist/src/services/slice/granularity-decider.js +40 -0
- package/dist/src/services/slice/llm-arbitrator.d.ts +35 -0
- package/dist/src/services/slice/llm-arbitrator.js +63 -0
- package/dist/src/services/slice/multi-pass-orchestrator.d.ts +67 -0
- package/dist/src/services/slice/multi-pass-orchestrator.js +225 -0
- package/dist/src/services/slice/schema-router.d.ts +44 -0
- package/dist/src/services/slice/schema-router.js +61 -0
- package/dist/src/services/slice/slice-archive-service.d.ts +20 -0
- package/dist/src/services/slice/slice-archive-service.js +111 -0
- package/dist/src/services/slice/slice-benchmark-service.d.ts +19 -0
- package/dist/src/services/slice/slice-benchmark-service.js +60 -0
- package/dist/src/services/slice/slice-check-service.d.ts +2 -0
- package/dist/src/services/slice/slice-check-service.js +459 -0
- package/dist/src/services/slice/slice-check-types.d.ts +104 -0
- package/dist/src/services/slice/slice-check-types.js +28 -0
- package/dist/src/services/slice/slice-decompose-runners.d.ts +23 -0
- package/dist/src/services/slice/slice-decompose-runners.js +174 -0
- package/dist/src/services/slice/slice-decompose-service.d.ts +24 -0
- package/dist/src/services/slice/slice-decompose-service.js +532 -0
- package/dist/src/services/slice/slice-decompose-types.d.ts +263 -0
- package/dist/src/services/slice/slice-decompose-types.js +30 -0
- package/dist/src/services/slice/slice-integration.d.ts +43 -0
- package/dist/src/services/slice/slice-integration.js +106 -0
- package/dist/src/services/slice/slice-pick-service.d.ts +32 -0
- package/dist/src/services/slice/slice-pick-service.js +75 -0
- package/dist/src/services/slice/slice-review-state.d.ts +70 -0
- package/dist/src/services/slice/slice-review-state.js +109 -0
- package/dist/src/services/slice/slice-topology-types.d.ts +115 -0
- package/dist/src/services/slice/slice-topology-types.js +20 -0
- package/dist/src/services/smoke/smoke-paths-state.d.ts +73 -0
- package/dist/src/services/smoke/smoke-paths-state.js +117 -0
- package/dist/src/services/solo/auto-compact-orchestrator.d.ts +98 -0
- package/dist/src/services/solo/auto-compact-orchestrator.js +343 -0
- package/dist/src/services/solo/batch-heartbeat-poller.d.ts +51 -0
- package/dist/src/services/solo/batch-heartbeat-poller.js +88 -0
- package/dist/src/services/solo/dag-orchestrator.d.ts +128 -0
- package/dist/src/services/solo/dag-orchestrator.js +304 -0
- package/dist/src/services/solo/mode-gate.d.ts +163 -0
- package/dist/src/services/solo/mode-gate.js +212 -0
- package/dist/src/services/solo/post-compact-detector.d.ts +61 -0
- package/dist/src/services/solo/post-compact-detector.js +240 -0
- package/dist/src/services/solo/status-line-renderer.d.ts +34 -0
- package/dist/src/services/solo/status-line-renderer.js +55 -0
- package/dist/src/services/solo/user-touchpoint-classifier.d.ts +44 -0
- package/dist/src/services/solo/user-touchpoint-classifier.js +145 -0
- package/dist/src/services/sop/gate-enforce-service.d.ts +33 -0
- package/dist/src/services/sop/gate-enforce-service.js +168 -0
- package/dist/src/services/sop/sop-advance-service.d.ts +74 -0
- package/dist/src/services/sop/sop-advance-service.js +115 -0
- package/dist/src/services/sop/sop-check-service.d.ts +45 -0
- package/dist/src/services/sop/sop-check-service.js +181 -0
- package/dist/src/services/sop/sop-paths.d.ts +62 -0
- package/dist/src/services/sop/sop-paths.js +92 -0
- package/dist/src/services/sop/sop-registry-service.d.ts +46 -0
- package/dist/src/services/sop/sop-registry-service.js +89 -0
- package/dist/src/services/sop/sop-service.d.ts +55 -0
- package/dist/src/services/sop/sop-service.js +222 -0
- package/dist/src/services/sop/sop-types.d.ts +95 -0
- package/dist/src/services/sop/sop-types.js +11 -0
- package/dist/src/services/standards/ide-aware-standards-service.d.ts +94 -0
- package/dist/src/services/standards/ide-aware-standards-service.js +89 -0
- package/dist/src/services/standards/migrate-claude-rules-service.d.ts +19 -0
- package/dist/src/services/standards/migrate-claude-rules-service.js +193 -0
- package/dist/src/services/standards/migrate-service.d.ts +63 -0
- package/dist/src/services/standards/migrate-service.js +193 -0
- package/dist/src/services/standards/missing-standards-detector.d.ts +79 -0
- package/dist/src/services/standards/missing-standards-detector.js +132 -0
- package/dist/src/services/standards/project-context.d.ts +24 -0
- package/dist/src/services/standards/project-context.js +314 -0
- package/dist/src/services/standards/project-standards-service.d.ts +114 -0
- package/dist/src/services/standards/project-standards-service.js +574 -0
- package/dist/src/services/tech/tech-service.d.ts +69 -0
- package/dist/src/services/tech/tech-service.js +299 -0
- package/dist/src/services/test-cache/test-cache-service.d.ts +70 -0
- package/dist/src/services/test-cache/test-cache-service.js +175 -0
- package/dist/src/services/understand/understand-scan-service.d.ts +28 -0
- package/dist/src/services/understand/understand-scan-service.js +170 -0
- package/dist/src/services/understand/understand-types.d.ts +50 -0
- package/dist/src/services/understand/understand-types.js +1 -0
- package/dist/src/services/upgrade/1x-detector-service.d.ts +7 -0
- package/dist/src/services/upgrade/1x-detector-service.js +94 -0
- package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +56 -0
- package/dist/src/services/upgrade/gitignore-migrate-service.js +170 -0
- package/dist/src/services/upgrade/upgrade-service.d.ts +47 -0
- package/dist/src/services/upgrade/upgrade-service.js +381 -0
- package/dist/src/services/verdict/envelopes.d.ts +93 -0
- package/dist/src/services/verdict/envelopes.js +349 -0
- package/dist/src/services/verdict/verdict-aggregator.d.ts +94 -0
- package/dist/src/services/verdict/verdict-aggregator.js +112 -0
- package/dist/src/services/workflow/artifact-paths.d.ts +59 -0
- package/dist/src/services/workflow/artifact-paths.js +166 -0
- package/dist/src/services/workflow/autonomous-resume-writer.d.ts +16 -0
- package/dist/src/services/workflow/autonomous-resume-writer.js +170 -0
- package/dist/src/services/workflow/pipeline-verify-service.d.ts +90 -0
- package/dist/src/services/workflow/pipeline-verify-service.js +449 -0
- package/dist/src/services/workflow/plan-reader.d.ts +29 -0
- package/dist/src/services/workflow/plan-reader.js +174 -0
- package/dist/src/services/workflow/plan-refresher.d.ts +32 -0
- package/dist/src/services/workflow/plan-refresher.js +353 -0
- package/dist/src/services/workflow/plan-trigger-detector.d.ts +55 -0
- package/dist/src/services/workflow/plan-trigger-detector.js +142 -0
- package/dist/src/services/workflow/workflow-autonomous-resume-helpers.d.ts +19 -0
- package/dist/src/services/workflow/workflow-autonomous-resume-helpers.js +300 -0
- package/dist/src/services/workflow/workflow-autonomous-service.d.ts +100 -0
- package/dist/src/services/workflow/workflow-autonomous-service.js +306 -0
- package/dist/src/services/workflow/workflow-loader.d.ts +63 -0
- package/dist/src/services/workflow/workflow-loader.js +168 -0
- package/dist/src/services/workflow/workflow-router-service.d.ts +85 -0
- package/dist/src/services/workflow/workflow-router-service.js +227 -0
- package/dist/src/services/workflow/workflow-skip-service.d.ts +106 -0
- package/dist/src/services/workflow/workflow-skip-service.js +209 -0
- package/dist/src/services/workflow/workflow-spec.d.ts +116 -0
- package/dist/src/services/workflow/workflow-spec.js +431 -0
- package/dist/src/services/workflow/workflow-state-store.d.ts +27 -0
- package/dist/src/services/workflow/workflow-state-store.js +95 -0
- package/dist/src/services/workspace/claude-settings-template.d.ts +96 -0
- package/dist/src/services/workspace/claude-settings-template.js +215 -0
- package/dist/src/services/workspace/migrate-1-4-1-service.d.ts +44 -0
- package/dist/src/services/workspace/migrate-1-4-1-service.js +195 -0
- package/dist/src/services/workspace/migrate-service.d.ts +2 -0
- package/dist/src/services/workspace/migrate-service.js +613 -0
- package/dist/src/services/workspace/migrate-types.d.ts +127 -0
- package/dist/src/services/workspace/migrate-types.js +21 -0
- package/dist/src/services/workspace/reconcile-service.d.ts +188 -0
- package/dist/src/services/workspace/reconcile-service.js +683 -0
- package/dist/src/services/workspace/reconcile-types.d.ts +130 -0
- package/dist/src/services/workspace/reconcile-types.js +13 -0
- package/dist/src/services/workspace/sid-naming-guard.d.ts +17 -0
- package/dist/src/services/workspace/sid-naming-guard.js +34 -0
- package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +45 -0
- package/dist/src/services/workspace/workspace-claude-settings-materializer.js +194 -0
- package/dist/src/services/workspace/workspace-clean-service.d.ts +28 -0
- package/dist/src/services/workspace/workspace-clean-service.js +46 -0
- package/dist/src/services/workspace/workspace-service.d.ts +177 -0
- package/dist/src/services/workspace/workspace-service.js +432 -0
- package/dist/src/services/workspace/workspace-state-service.d.ts +7 -0
- package/dist/src/services/workspace/workspace-state-service.js +43 -0
- package/dist/src/shared/format-md-compact.d.ts +32 -0
- package/dist/src/shared/format-md-compact.js +297 -0
- package/dist/src/shared/frontmatter.d.ts +6 -0
- package/dist/src/shared/frontmatter.js +165 -0
- package/dist/src/shared/fs-utils.d.ts +4 -0
- package/dist/src/shared/fs-utils.js +16 -0
- package/dist/src/shared/fs.d.ts +4 -0
- package/dist/src/shared/fs.js +26 -0
- package/dist/src/shared/incrementing-number.d.ts +23 -0
- package/dist/src/shared/incrementing-number.js +68 -0
- package/dist/src/shared/json-schema-mini.d.ts +10 -0
- package/dist/src/shared/json-schema-mini.js +113 -0
- package/dist/src/shared/path-safety.d.ts +21 -0
- package/dist/src/shared/path-safety.js +54 -0
- package/dist/src/shared/path-utils.d.ts +13 -0
- package/dist/src/shared/path-utils.js +56 -0
- package/dist/src/shared/paths.d.ts +6 -0
- package/dist/src/shared/paths.js +50 -0
- package/dist/src/shared/planner-response.d.ts +21 -0
- package/dist/src/shared/planner-response.js +26 -0
- package/dist/src/shared/platform.d.ts +6 -0
- package/dist/src/shared/platform.js +11 -0
- package/dist/src/shared/process.d.ts +5 -0
- package/dist/src/shared/process.js +12 -0
- package/dist/src/shared/result.d.ts +22 -0
- package/dist/src/shared/result.js +46 -0
- package/dist/src/shared/stale-policy.d.ts +67 -0
- package/dist/src/shared/stale-policy.js +85 -0
- package/dist/src/shared/version.d.ts +1 -0
- package/dist/src/shared/version.js +1 -0
- package/output-styles/peaks-skill-swarm.md +132 -0
- package/package.json +101 -0
- package/schemas/approval-record.schema.json +14 -0
- package/schemas/artifact-manifest.schema.json +16 -0
- package/schemas/artifact-retention-report.schema.json +38 -0
- package/schemas/artifact-workspace.schema.json +22 -0
- package/schemas/capability-availability.schema.json +36 -0
- package/schemas/capability-item.schema.json +37 -0
- package/schemas/capability-source.schema.json +30 -0
- package/schemas/change-impact.schema.json +15 -0
- package/schemas/context-capsule.schema.json +16 -0
- package/schemas/context.schema.json +360 -0
- package/schemas/decomposition-v1.json +194 -0
- package/schemas/decomposition-v2.json +193 -0
- package/schemas/doctor-report.schema.json +34 -0
- package/schemas/library-breaking-changes.data.json +141 -0
- package/schemas/library-breaking-changes.meta.json +6 -0
- package/schemas/library-breaking-changes.schema.json +50 -0
- package/schemas/mcp-apply-result.schema.json +46 -0
- package/schemas/mcp-install-plan.schema.json +71 -0
- package/schemas/mcp-install-spec.schema.json +29 -0
- package/schemas/mcp-server.schema.json +29 -0
- package/schemas/openspec-change-summary.schema.json +68 -0
- package/schemas/openspec-render-request.schema.json +61 -0
- package/schemas/openspec-validation-result.schema.json +36 -0
- package/schemas/recommendation-plan.schema.json +37 -0
- package/schemas/refactor-slice-spec.schema.json +19 -0
- package/schemas/replay-fixture.schema.json +158 -0
- package/schemas/reviewer-envelope.schema.json +79 -0
- package/schemas/sop-manifest.schema.json +52 -0
- package/scripts/clean-dist.mjs +8 -0
- package/scripts/install-skills.mjs +1202 -0
- package/scripts/sync-version.mjs +12 -0
- package/scripts/watch.mjs +389 -0
- package/skills/peaks-audit/SKILL.md +151 -0
- package/skills/peaks-audit/references/6-dimensions.md +141 -0
- package/skills/peaks-doctor/SKILL.md +59 -0
- package/skills/peaks-doctor/references/doctor-check-catalog.md +31 -0
- package/skills/peaks-doctor/references/from-doctor-flow.md +64 -0
- package/skills/peaks-doctor/test_prompts.json +17 -0
- package/skills/peaks-final-review/SKILL.md +157 -0
- package/skills/peaks-final-review/references/4-dimensions.md +117 -0
- package/skills/peaks-ide/SKILL.md +161 -0
- package/skills/peaks-ide/references/audit-log-helper.md +52 -0
- package/skills/peaks-perf-audit/SKILL.md +166 -0
- package/skills/peaks-perf-audit/references/audit-protocol.md +173 -0
- package/skills/peaks-prd/SKILL.md +319 -0
- package/skills/peaks-prd/references/artifact-contracts.md +7 -0
- package/skills/peaks-prd/references/artifact-per-request.md +78 -0
- package/skills/peaks-prd/references/command-migration.md +3 -0
- package/skills/peaks-prd/references/prd-for-multi-pass.md +49 -0
- package/skills/peaks-prd/references/workflow.md +43 -0
- package/skills/peaks-qa/SKILL.md +240 -0
- package/skills/peaks-qa/references/artifact-contracts.md +7 -0
- package/skills/peaks-qa/references/artifact-per-request.md +25 -0
- package/skills/peaks-qa/references/browser-validation-contracts.md +51 -0
- package/skills/peaks-qa/references/codegraph-regression-focus.md +5 -0
- package/skills/peaks-qa/references/command-migration.md +3 -0
- package/skills/peaks-qa/references/external-capability-guidance.md +9 -0
- package/skills/peaks-qa/references/openspec-validation-gate.md +55 -0
- package/skills/peaks-qa/references/qa-compact-handoff.md +3 -0
- package/skills/peaks-qa/references/qa-context-governance.md +24 -0
- package/skills/peaks-qa/references/qa-fanout-contract.md +158 -0
- package/skills/peaks-qa/references/qa-gstack-integration.md +7 -0
- package/skills/peaks-qa/references/qa-local-artifacts.md +3 -0
- package/skills/peaks-qa/references/qa-matt-pocock-integration.md +9 -0
- package/skills/peaks-qa/references/qa-perf-test-plan.md +67 -0
- package/skills/peaks-qa/references/qa-refactor-role.md +3 -0
- package/skills/peaks-qa/references/qa-runbook.md +72 -0
- package/skills/peaks-qa/references/qa-security-test-plan.md +73 -0
- package/skills/peaks-qa/references/qa-skill-presence.md +22 -0
- package/skills/peaks-qa/references/qa-standards-preflight.md +8 -0
- package/skills/peaks-qa/references/qa-sub-agent-dispatch.md +46 -0
- package/skills/peaks-qa/references/qa-transition-gates.md +86 -0
- package/skills/peaks-qa/references/reading-handoff-frontmatter.md +30 -0
- package/skills/peaks-qa/references/regression-gates.md +24 -0
- package/skills/peaks-qa/references/requirement-boundary-recheck.md +9 -0
- package/skills/peaks-qa/references/test-case-generation.md +27 -0
- package/skills/peaks-qa/references/test-report-output.md +14 -0
- package/skills/peaks-rd/SKILL.md +279 -0
- package/skills/peaks-rd/references/artifact-and-standards-output.md +9 -0
- package/skills/peaks-rd/references/artifact-contracts.md +7 -0
- package/skills/peaks-rd/references/artifact-per-request.md +112 -0
- package/skills/peaks-rd/references/browser-action-wrapper.md +39 -0
- package/skills/peaks-rd/references/browser-self-test-contracts.md +29 -0
- package/skills/peaks-rd/references/code-reviewer-4dim-hint.md +72 -0
- package/skills/peaks-rd/references/codegraph-project-analysis.md +5 -0
- package/skills/peaks-rd/references/command-migration.md +3 -0
- package/skills/peaks-rd/references/compact-handoff.md +3 -0
- package/skills/peaks-rd/references/external-references.md +11 -0
- package/skills/peaks-rd/references/frontend-project-generation.md +11 -0
- package/skills/peaks-rd/references/karpathy-reviewer-prompt.md +2 -0
- package/skills/peaks-rd/references/library-version-awareness.md +30 -0
- package/skills/peaks-rd/references/mandatory-perf-baseline.md +42 -0
- package/skills/peaks-rd/references/matt-pocock-integration.md +11 -0
- package/skills/peaks-rd/references/mock-data-placement.md +40 -0
- package/skills/peaks-rd/references/ocr-integration.md +229 -0
- package/skills/peaks-rd/references/openspec-cli.md +62 -0
- package/skills/peaks-rd/references/parallel-review-fanout.md +90 -0
- package/skills/peaks-rd/references/rd-context-governance.md +36 -0
- package/skills/peaks-rd/references/rd-fanout-contracts.md +216 -0
- package/skills/peaks-rd/references/rd-gstack-integration.md +16 -0
- package/skills/peaks-rd/references/rd-runbook.md +190 -0
- package/skills/peaks-rd/references/rd-standards-preflight.md +8 -0
- package/skills/peaks-rd/references/rd-sub-agent-dispatch.md +111 -0
- package/skills/peaks-rd/references/rd-transition-gates.md +148 -0
- package/skills/peaks-rd/references/reading-v2-slice-results.md +54 -0
- package/skills/peaks-rd/references/refactor-workflow.md +39 -0
- package/skills/peaks-rd/references/skill-presence-and-title.md +22 -0
- package/skills/peaks-rd/references/v2-12-fanout-collapse.md +64 -0
- package/skills/peaks-rd/references/writing-handoff-frontmatter.md +68 -0
- package/skills/peaks-reviewer/SKILL.md +76 -0
- package/skills/peaks-reviewer/references/reviewer-prompt.md +50 -0
- package/skills/peaks-reviewer/references/reviewer-schema.md +49 -0
- package/skills/peaks-sc/SKILL.md +166 -0
- package/skills/peaks-sc/references/artifact-contracts.md +3 -0
- package/skills/peaks-sc/references/artifact-retention.md +14 -0
- package/skills/peaks-sc/references/command-migration.md +3 -0
- package/skills/peaks-sc/references/openspec-commit-boundaries.md +33 -0
- package/skills/peaks-security-audit/SKILL.md +167 -0
- package/skills/peaks-security-audit/references/audit-protocol.md +175 -0
- package/skills/peaks-slice-decompose/SKILL.md +111 -0
- package/skills/peaks-slice-decompose/references/cross-pass-edge-interpretation.md +158 -0
- package/skills/peaks-slice-decompose/references/granularity-decision.md +129 -0
- package/skills/peaks-slice-decompose/references/v2-schema.md +156 -0
- package/skills/peaks-solo/SKILL.md +316 -0
- package/skills/peaks-solo/references/a2a-artifact-mapping.md +115 -0
- package/skills/peaks-solo/references/anchoring-and-session-info.md +34 -0
- package/skills/peaks-solo/references/artifact-contracts.md +65 -0
- package/skills/peaks-solo/references/boundaries.md +21 -0
- package/skills/peaks-solo/references/browser-workflow.md +127 -0
- package/skills/peaks-solo/references/checkpoint-resume.md +70 -0
- package/skills/peaks-solo/references/codegraph-orchestration.md +5 -0
- package/skills/peaks-solo/references/command-migration.md +3 -0
- package/skills/peaks-solo/references/completion-handoff.md +18 -0
- package/skills/peaks-solo/references/context-governance.md +204 -0
- package/skills/peaks-solo/references/cross-date-session-check.md +67 -0
- package/skills/peaks-solo/references/dag-orchestrator.md +56 -0
- package/skills/peaks-solo/references/envelope-contract.md +130 -0
- package/skills/peaks-solo/references/existing-system-extraction.md +78 -0
- package/skills/peaks-solo/references/external-references.md +17 -0
- package/skills/peaks-solo/references/external-skill-invocation.md +72 -0
- package/skills/peaks-solo/references/fanout-mandatory.md +109 -0
- package/skills/peaks-solo/references/fast-mode.md +23 -0
- package/skills/peaks-solo/references/frontend-only-mode.md +87 -0
- package/skills/peaks-solo/references/gstack-integration.md +7 -0
- package/skills/peaks-solo/references/headroom-integration.md +107 -0
- package/skills/peaks-solo/references/local-artifact-workspace.md +79 -0
- package/skills/peaks-solo/references/micro-cycle.md +316 -0
- package/skills/peaks-solo/references/mode-selection-with-stale-presence.md +124 -0
- package/skills/peaks-solo/references/mode-selection.md +21 -0
- package/skills/peaks-solo/references/openspec-workflow.md +81 -0
- package/skills/peaks-solo/references/periodic-checkpoint.md +71 -0
- package/skills/peaks-solo/references/playwright-mcp-multi-terminal.md +114 -0
- package/skills/peaks-solo/references/project-memory-loading.md +17 -0
- package/skills/peaks-solo/references/project-scan-checklist.md +136 -0
- package/skills/peaks-solo/references/quality-gate-cheatsheet.md +13 -0
- package/skills/peaks-solo/references/refactor-mode.md +24 -0
- package/skills/peaks-solo/references/resume-detection.md +63 -0
- package/skills/peaks-solo/references/runbook.md +188 -0
- package/skills/peaks-solo/references/skill-presence-and-title.md +31 -0
- package/skills/peaks-solo/references/standards-preflight.md +23 -0
- package/skills/peaks-solo/references/step-0-55-1x-detection.md +82 -0
- package/skills/peaks-solo/references/sub-agent-dispatch.md +334 -0
- package/skills/peaks-solo/references/swarm-dispatch-contract.md +230 -0
- package/skills/peaks-solo/references/workflow-gates-and-types.md +186 -0
- package/skills/peaks-solo/references/workflow.md +38 -0
- package/skills/peaks-solo-resume/SKILL.md +81 -0
- package/skills/peaks-solo-status/SKILL.md +120 -0
- package/skills/peaks-solo-test/SKILL.md +84 -0
- package/skills/peaks-sop/SKILL.md +209 -0
- package/skills/peaks-sop/references/sop-authoring.md +161 -0
- package/skills/peaks-txt/SKILL.md +303 -0
- package/skills/peaks-txt/references/artifact-contracts.md +7 -0
- package/skills/peaks-txt/references/command-migration.md +3 -0
- package/skills/peaks-txt/references/context-capsule.md +21 -0
- package/skills/peaks-ui/SKILL.md +369 -0
- package/skills/peaks-ui/references/artifact-contracts.md +3 -0
- package/skills/peaks-ui/references/artifact-per-request.md +71 -0
- package/skills/peaks-ui/references/command-migration.md +3 -0
- package/skills/peaks-ui/references/workflow.md +27 -0
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* peaks-loop v3.0.0 — Slice B.1
|
|
3
|
+
*
|
|
4
|
+
* Evaluator-as-primitive dispatcher. Each of the 4 evaluator types
|
|
5
|
+
* (karpathy / code-review / security-review / perf-baseline) maps to
|
|
6
|
+
* an existing peaks-cli CLI surface; the dispatcher shells out to the
|
|
7
|
+
* same binary so verdict shape stays byte-compatible with the
|
|
8
|
+
* `verdict-aggregator` envelope union (`karpathy` / `security` / `perf`).
|
|
9
|
+
*
|
|
10
|
+
* Karpathy §2 Simplicity First: no new dependencies, no LLM scheduling,
|
|
11
|
+
* one binary per evaluator. Each evaluator returns the same envelope
|
|
12
|
+
* shape the existing reviewer fan-out produces; verdict-aggregator
|
|
13
|
+
* accepts them via `envelopesToAggregatorInput` unchanged (BC).
|
|
14
|
+
*
|
|
15
|
+
* File budget: ≤ 800 lines.
|
|
16
|
+
*/
|
|
17
|
+
import { execFileSync } from 'node:child_process';
|
|
18
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { runMonotonicCheck } from './monotonic-runner.js';
|
|
21
|
+
/** Dispatch a single evaluator against the given rid and project. */
|
|
22
|
+
export function dispatchEvaluator(kind, options) {
|
|
23
|
+
const started = Date.now();
|
|
24
|
+
switch (kind) {
|
|
25
|
+
case 'karpathy':
|
|
26
|
+
return dispatchKarpathy(options, started);
|
|
27
|
+
case 'code-review':
|
|
28
|
+
return dispatchCodeReview(options, started);
|
|
29
|
+
case 'security-review':
|
|
30
|
+
return dispatchSecurityReview(options, started);
|
|
31
|
+
case 'perf-baseline':
|
|
32
|
+
return dispatchPerfBaseline(options, started);
|
|
33
|
+
case 'verdict-aggregate':
|
|
34
|
+
return dispatchVerdictAggregate(options, started);
|
|
35
|
+
case 'monotonic-improvement':
|
|
36
|
+
return dispatchMonotonicImprovement(options, started);
|
|
37
|
+
case 'impact-scan':
|
|
38
|
+
return dispatchImpactScan(options, started);
|
|
39
|
+
case 'smoke-run':
|
|
40
|
+
return dispatchSmokeRun(options, started);
|
|
41
|
+
case 'canary-watch':
|
|
42
|
+
return dispatchCanaryWatch(options, started);
|
|
43
|
+
default: {
|
|
44
|
+
// Exhaustiveness guard.
|
|
45
|
+
const exhaustive = kind;
|
|
46
|
+
throw new Error(`dispatchEvaluator: unknown evaluator kind ${String(exhaustive)}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function peaksCommand(opts) {
|
|
51
|
+
if (opts.peaksBin !== undefined) {
|
|
52
|
+
// Already a full command (e.g. `node bin/peaks.js` or `/usr/local/bin/peaks`).
|
|
53
|
+
return [opts.peaksBin];
|
|
54
|
+
}
|
|
55
|
+
return ['node', 'bin/peaks.js'];
|
|
56
|
+
}
|
|
57
|
+
function execPeaks(args, cwd, peaksBin) {
|
|
58
|
+
try {
|
|
59
|
+
const cmd = peaksCommand({ projectRoot: cwd, rid: '', ...(peaksBin !== undefined ? { peaksBin } : {}) });
|
|
60
|
+
const stdout = execFileSync(cmd[0], [...cmd.slice(1), ...args], {
|
|
61
|
+
cwd,
|
|
62
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
63
|
+
encoding: 'utf8'
|
|
64
|
+
});
|
|
65
|
+
return { stdout, exitCode: 0 };
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
// Surface the error envelope as stdout so the dispatcher can still
|
|
69
|
+
// parse it; treat non-zero exit as a degraded verdict (not a hard
|
|
70
|
+
// throw — evaluators must always return an envelope).
|
|
71
|
+
const err = error;
|
|
72
|
+
return {
|
|
73
|
+
stdout: typeof err.stdout === 'string' ? err.stdout : Buffer.isBuffer(err.stdout) ? err.stdout.toString('utf8') : '',
|
|
74
|
+
exitCode: typeof err.status === 'number' ? err.status : 1
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function dispatchKarpathy(opts, started) {
|
|
79
|
+
const args = [
|
|
80
|
+
'code-review',
|
|
81
|
+
'karpathy',
|
|
82
|
+
'--project', opts.projectRoot,
|
|
83
|
+
'--rid', opts.rid,
|
|
84
|
+
'--json'
|
|
85
|
+
];
|
|
86
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
87
|
+
return parseKarpathyEnvelope(stdout, exitCode, started);
|
|
88
|
+
}
|
|
89
|
+
function dispatchCodeReview(opts, started) {
|
|
90
|
+
const args = [
|
|
91
|
+
'code-review',
|
|
92
|
+
'run',
|
|
93
|
+
'--project', opts.projectRoot,
|
|
94
|
+
'--rid', opts.rid,
|
|
95
|
+
'--json'
|
|
96
|
+
];
|
|
97
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
98
|
+
return parseCodeReviewEnvelope(stdout, exitCode, started);
|
|
99
|
+
}
|
|
100
|
+
function dispatchSecurityReview(opts, started) {
|
|
101
|
+
const args = [
|
|
102
|
+
'security-audit',
|
|
103
|
+
'run',
|
|
104
|
+
'--project', opts.projectRoot,
|
|
105
|
+
'--rid', opts.rid,
|
|
106
|
+
'--json'
|
|
107
|
+
];
|
|
108
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
109
|
+
return parseSecurityEnvelope(stdout, exitCode, started);
|
|
110
|
+
}
|
|
111
|
+
function dispatchPerfBaseline(opts, started) {
|
|
112
|
+
const args = [
|
|
113
|
+
'perf-audit',
|
|
114
|
+
'run',
|
|
115
|
+
'--project', opts.projectRoot,
|
|
116
|
+
'--rid', opts.rid,
|
|
117
|
+
'--json'
|
|
118
|
+
];
|
|
119
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
120
|
+
return parsePerfEnvelope(stdout, exitCode, started);
|
|
121
|
+
}
|
|
122
|
+
function dispatchVerdictAggregate(opts, started) {
|
|
123
|
+
const args = [
|
|
124
|
+
'verdict',
|
|
125
|
+
'aggregate',
|
|
126
|
+
'--from-rid', opts.rid,
|
|
127
|
+
'--project', opts.projectRoot,
|
|
128
|
+
'--json'
|
|
129
|
+
];
|
|
130
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
131
|
+
return parseVerdictAggregateEnvelope(stdout, exitCode, started);
|
|
132
|
+
}
|
|
133
|
+
function dispatchImpactScan(opts, started) {
|
|
134
|
+
// `peaks impact scan --files <list>` requires a comma-separated file
|
|
135
|
+
// list. From the loop dispatcher we forward `scope` (which is the
|
|
136
|
+
// evaluator scope expression) as the file list when present; when
|
|
137
|
+
// absent we degrade to a warn envelope (sketch-grade acceptance).
|
|
138
|
+
const files = opts.scope && opts.scope.length > 0 ? opts.scope : '';
|
|
139
|
+
if (files.length === 0) {
|
|
140
|
+
const wall = (Date.now() - started) / 1000;
|
|
141
|
+
return {
|
|
142
|
+
kind: 'impact-scan',
|
|
143
|
+
passed: false,
|
|
144
|
+
gateAction: 'warn',
|
|
145
|
+
violations: [{
|
|
146
|
+
severity: 'MED',
|
|
147
|
+
file: '<loop>',
|
|
148
|
+
line: 0,
|
|
149
|
+
hint: 'impact-scan dispatcher requires scope (a comma-separated file list); set the evaluator scope on the workflow yaml'
|
|
150
|
+
}],
|
|
151
|
+
summary: 'impact-scan: missing scope/files',
|
|
152
|
+
wallSeconds: wall,
|
|
153
|
+
degraded: true
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const args = ['impact', 'scan', '--files', files, '--project', opts.projectRoot, '--json'];
|
|
157
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
158
|
+
return parseGenericEnvelope(stdout, exitCode, started, 'impact-scan', 'impact-scan: ');
|
|
159
|
+
}
|
|
160
|
+
function dispatchSmokeRun(opts, started) {
|
|
161
|
+
// `peaks smoke run` is a no-op recorder (returns a dry summary by
|
|
162
|
+
// default). Pure sketch-grade surface.
|
|
163
|
+
const args = ['smoke', 'run', '--project', opts.projectRoot, '--json'];
|
|
164
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
165
|
+
return parseGenericEnvelope(stdout, exitCode, started, 'smoke-run', 'smoke-run: ');
|
|
166
|
+
}
|
|
167
|
+
function dispatchCanaryWatch(opts, started) {
|
|
168
|
+
// `peaks release canary --version <v>` requires a version label. We
|
|
169
|
+
// forward `scope` when supplied (interpreted as the canary version),
|
|
170
|
+
// otherwise degrade to a warn envelope (sketch-grade acceptance).
|
|
171
|
+
const version = opts.scope && opts.scope.length > 0 ? opts.scope : '';
|
|
172
|
+
if (version.length === 0) {
|
|
173
|
+
const wall = (Date.now() - started) / 1000;
|
|
174
|
+
return {
|
|
175
|
+
kind: 'canary-watch',
|
|
176
|
+
passed: false,
|
|
177
|
+
gateAction: 'warn',
|
|
178
|
+
violations: [{
|
|
179
|
+
severity: 'MED',
|
|
180
|
+
file: '<loop>',
|
|
181
|
+
line: 0,
|
|
182
|
+
hint: 'canary-watch dispatcher requires scope (the canary version label); set the evaluator scope on the workflow yaml'
|
|
183
|
+
}],
|
|
184
|
+
summary: 'canary-watch: missing version',
|
|
185
|
+
wallSeconds: wall,
|
|
186
|
+
degraded: true
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
const args = ['release', 'canary', '--version', version, '--project', opts.projectRoot, '--json'];
|
|
190
|
+
const { stdout, exitCode } = execPeaks(args, opts.projectRoot, opts.peaksBin);
|
|
191
|
+
return parseGenericEnvelope(stdout, exitCode, started, 'canary-watch', 'canary-watch: ');
|
|
192
|
+
}
|
|
193
|
+
/** Generic envelope parser for the 3 G13/G14/G15 sketch-grade evaluators
|
|
194
|
+
* — they share shape (data.ok + data.count + data.summary). */
|
|
195
|
+
function parseGenericEnvelope(stdout, exitCode, started, kind, summaryPrefix) {
|
|
196
|
+
const wall = (Date.now() - started) / 1000;
|
|
197
|
+
const parsed = safeJson(stdout);
|
|
198
|
+
if (parsed === null) {
|
|
199
|
+
return {
|
|
200
|
+
kind,
|
|
201
|
+
passed: exitCode === 0,
|
|
202
|
+
gateAction: exitCode === 0 ? 'pass' : 'warn',
|
|
203
|
+
violations: [],
|
|
204
|
+
summary: stdout.slice(0, 200),
|
|
205
|
+
wallSeconds: wall,
|
|
206
|
+
degraded: true
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
const obj = parsed;
|
|
210
|
+
const data = (obj['data'] ?? obj);
|
|
211
|
+
return {
|
|
212
|
+
kind,
|
|
213
|
+
passed: exitCode === 0,
|
|
214
|
+
gateAction: exitCode === 0 ? 'pass' : 'warn',
|
|
215
|
+
violations: [],
|
|
216
|
+
summary: typeof data['summary'] === 'string' ? summaryPrefix + data['summary'] : summaryPrefix + (exitCode === 0 ? 'ok' : 'failed'),
|
|
217
|
+
wallSeconds: wall,
|
|
218
|
+
degraded: false
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function dispatchMonotonicImprovement(opts, started) {
|
|
222
|
+
// The monotonic guard is intra-process logic — we do not need to
|
|
223
|
+
// shell out to the peaks CLI for the score walk itself. The CLI
|
|
224
|
+
// shapes (`peaks loop check-monotonic`, `peaks loop eval
|
|
225
|
+
// --evaluator monotonic-improvement`) both converge here.
|
|
226
|
+
const sid = opts.sessionId;
|
|
227
|
+
if (sid === undefined || sid.length === 0) {
|
|
228
|
+
return {
|
|
229
|
+
kind: 'monotonic-improvement',
|
|
230
|
+
passed: false,
|
|
231
|
+
gateAction: 'warn',
|
|
232
|
+
violations: [{
|
|
233
|
+
severity: 'MED',
|
|
234
|
+
file: '<loop>',
|
|
235
|
+
line: 0,
|
|
236
|
+
hint: 'monotonic-improvement dispatcher requires sessionId; pass --session <sid> or call peaks loop check-monotonic directly'
|
|
237
|
+
}],
|
|
238
|
+
summary: 'monotonic-improvement: missing sessionId',
|
|
239
|
+
wallSeconds: 0,
|
|
240
|
+
degraded: true
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const thresholdNum = opts.threshold !== undefined ? Number(opts.threshold) : undefined;
|
|
244
|
+
if (thresholdNum !== undefined && !Number.isFinite(thresholdNum)) {
|
|
245
|
+
return {
|
|
246
|
+
kind: 'monotonic-improvement',
|
|
247
|
+
passed: false,
|
|
248
|
+
gateAction: 'warn',
|
|
249
|
+
violations: [{
|
|
250
|
+
severity: 'MED',
|
|
251
|
+
file: '<loop>',
|
|
252
|
+
line: 0,
|
|
253
|
+
hint: `invalid threshold "${opts.threshold}" — must be a finite number in [0,1]`
|
|
254
|
+
}],
|
|
255
|
+
summary: 'monotonic-improvement: invalid threshold',
|
|
256
|
+
wallSeconds: 0,
|
|
257
|
+
degraded: true
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
try {
|
|
261
|
+
const result = runMonotonicCheck({
|
|
262
|
+
projectRoot: opts.projectRoot,
|
|
263
|
+
sid,
|
|
264
|
+
rid: opts.rid,
|
|
265
|
+
...(thresholdNum !== undefined ? { threshold: thresholdNum } : {})
|
|
266
|
+
});
|
|
267
|
+
const wall = (Date.now() - started) / 1000;
|
|
268
|
+
const violations = result.report.regressions.map((r) => ({
|
|
269
|
+
severity: 'HIGH',
|
|
270
|
+
file: '<loop>',
|
|
271
|
+
line: 0,
|
|
272
|
+
hint: `${r.evaluator} regressed ${r.previousScore.toFixed(4)}→${r.currentScore.toFixed(4)} (Δ=${r.delta.toFixed(4)})`
|
|
273
|
+
}));
|
|
274
|
+
return {
|
|
275
|
+
kind: 'monotonic-improvement',
|
|
276
|
+
passed: !result.report.monotonicityViolation,
|
|
277
|
+
gateAction: result.report.monotonicityViolation ? 'block' : result.report.status === 'skip' ? 'warn' : 'pass',
|
|
278
|
+
violations,
|
|
279
|
+
summary: result.report.reason,
|
|
280
|
+
wallSeconds: wall,
|
|
281
|
+
degraded: false
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
const wall = (Date.now() - started) / 1000;
|
|
286
|
+
return {
|
|
287
|
+
kind: 'monotonic-improvement',
|
|
288
|
+
passed: false,
|
|
289
|
+
gateAction: 'warn',
|
|
290
|
+
violations: [{
|
|
291
|
+
severity: 'MED',
|
|
292
|
+
file: '<loop>',
|
|
293
|
+
line: 0,
|
|
294
|
+
hint: `runMonotonicCheck threw: ${error instanceof Error ? error.message : String(error)}`
|
|
295
|
+
}],
|
|
296
|
+
summary: 'monotonic-improvement: dispatcher error',
|
|
297
|
+
wallSeconds: wall,
|
|
298
|
+
degraded: true
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
// ─── envelope parsers (pure, never throw) ──────────────────────────────
|
|
303
|
+
function gateActionFromVerdict(verdict) {
|
|
304
|
+
if (verdict === 'pass' || verdict === 'warn' || verdict === 'block')
|
|
305
|
+
return verdict;
|
|
306
|
+
return 'warn';
|
|
307
|
+
}
|
|
308
|
+
function parseKarpathyEnvelope(stdout, exitCode, started) {
|
|
309
|
+
const wall = (Date.now() - started) / 1000;
|
|
310
|
+
const parsed = safeJson(stdout);
|
|
311
|
+
if (parsed === null) {
|
|
312
|
+
return {
|
|
313
|
+
kind: 'karpathy',
|
|
314
|
+
passed: exitCode === 0,
|
|
315
|
+
gateAction: exitCode === 0 ? 'pass' : 'block',
|
|
316
|
+
violations: [],
|
|
317
|
+
summary: stdout.slice(0, 200),
|
|
318
|
+
wallSeconds: wall,
|
|
319
|
+
degraded: true
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
const obj = parsed;
|
|
323
|
+
const data = (obj['data'] ?? obj);
|
|
324
|
+
const passed = data['passed'] === true;
|
|
325
|
+
const gateAction = typeof data['gateAction'] === 'string' ? gateActionFromVerdict(data['gateAction']) : (passed ? 'pass' : 'block');
|
|
326
|
+
const violationsRaw = Array.isArray(data['violations']) ? data['violations'] : [];
|
|
327
|
+
const violations = violationsRaw.map((v) => normalizeViolation(v));
|
|
328
|
+
return {
|
|
329
|
+
kind: 'karpathy',
|
|
330
|
+
passed,
|
|
331
|
+
gateAction,
|
|
332
|
+
violations,
|
|
333
|
+
summary: typeof data['summary'] === 'string' ? data['summary'] : 'karpathy review',
|
|
334
|
+
wallSeconds: wall,
|
|
335
|
+
degraded: false
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function parseCodeReviewEnvelope(stdout, exitCode, started) {
|
|
339
|
+
// code-review emits the same shape as karpathy (Karpathy §4 envelope).
|
|
340
|
+
return envelopeAs(parseKarpathyEnvelope(stdout, exitCode, started), 'code-review');
|
|
341
|
+
}
|
|
342
|
+
function parseSecurityEnvelope(stdout, exitCode, started) {
|
|
343
|
+
const wall = (Date.now() - started) / 1000;
|
|
344
|
+
const parsed = safeJson(stdout);
|
|
345
|
+
if (parsed === null) {
|
|
346
|
+
return {
|
|
347
|
+
kind: 'security-review',
|
|
348
|
+
passed: exitCode === 0,
|
|
349
|
+
gateAction: exitCode === 0 ? 'pass' : 'warn',
|
|
350
|
+
violations: [],
|
|
351
|
+
summary: stdout.slice(0, 200),
|
|
352
|
+
wallSeconds: wall,
|
|
353
|
+
degraded: true
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
const obj = parsed;
|
|
357
|
+
const data = (obj['data'] ?? obj);
|
|
358
|
+
const verdict = typeof data['verdict'] === 'string' ? data['verdict'] : (exitCode === 0 ? 'pass' : 'warn');
|
|
359
|
+
const violationsRaw = Array.isArray(data['violations']) ? data['violations'] : [];
|
|
360
|
+
const violations = violationsRaw.map((v) => normalizeViolation(v));
|
|
361
|
+
return {
|
|
362
|
+
kind: 'security-review',
|
|
363
|
+
passed: verdict === 'pass',
|
|
364
|
+
gateAction: gateActionFromVerdict(verdict),
|
|
365
|
+
violations,
|
|
366
|
+
summary: typeof data['summary'] === 'string' ? data['summary'] : 'security review',
|
|
367
|
+
wallSeconds: wall,
|
|
368
|
+
degraded: false
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function parsePerfEnvelope(stdout, exitCode, started) {
|
|
372
|
+
const wall = (Date.now() - started) / 1000;
|
|
373
|
+
const parsed = safeJson(stdout);
|
|
374
|
+
if (parsed === null) {
|
|
375
|
+
return {
|
|
376
|
+
kind: 'perf-baseline',
|
|
377
|
+
passed: exitCode === 0,
|
|
378
|
+
gateAction: exitCode === 0 ? 'pass' : 'warn',
|
|
379
|
+
violations: [],
|
|
380
|
+
summary: stdout.slice(0, 200),
|
|
381
|
+
wallSeconds: wall,
|
|
382
|
+
degraded: true
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
const obj = parsed;
|
|
386
|
+
const data = (obj['data'] ?? obj);
|
|
387
|
+
const verdict = typeof data['verdict'] === 'string' ? data['verdict'] : (exitCode === 0 ? 'pass' : 'warn');
|
|
388
|
+
const violationsRaw = Array.isArray(data['violations']) ? data['violations'] : [];
|
|
389
|
+
const violations = violationsRaw.map((v) => normalizeViolation(v));
|
|
390
|
+
return {
|
|
391
|
+
kind: 'perf-baseline',
|
|
392
|
+
passed: verdict === 'pass',
|
|
393
|
+
gateAction: gateActionFromVerdict(verdict),
|
|
394
|
+
violations,
|
|
395
|
+
summary: typeof data['summary'] === 'string' ? data['summary'] : 'perf baseline review',
|
|
396
|
+
wallSeconds: wall,
|
|
397
|
+
degraded: false
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
function parseVerdictAggregateEnvelope(stdout, exitCode, started) {
|
|
401
|
+
const wall = (Date.now() - started) / 1000;
|
|
402
|
+
const parsed = safeJson(stdout);
|
|
403
|
+
if (parsed === null) {
|
|
404
|
+
return {
|
|
405
|
+
kind: 'verdict-aggregate',
|
|
406
|
+
passed: exitCode === 0,
|
|
407
|
+
gateAction: exitCode === 0 ? 'pass' : 'block',
|
|
408
|
+
violations: [],
|
|
409
|
+
summary: stdout.slice(0, 200),
|
|
410
|
+
wallSeconds: wall,
|
|
411
|
+
degraded: true
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
const obj = parsed;
|
|
415
|
+
const data = (obj['data'] ?? obj);
|
|
416
|
+
const verdict = typeof data['verdict'] === 'string' ? data['verdict'] : (exitCode === 0 ? 'pass' : 'block');
|
|
417
|
+
const reasonsRaw = Array.isArray(data['reasons']) ? data['reasons'] : [];
|
|
418
|
+
const violations = reasonsRaw.map((r) => reasonToViolation(r));
|
|
419
|
+
return {
|
|
420
|
+
kind: 'verdict-aggregate',
|
|
421
|
+
passed: verdict === 'pass',
|
|
422
|
+
gateAction: gateActionFromVerdict(verdict),
|
|
423
|
+
violations,
|
|
424
|
+
summary: `verdict-aggregate: ${verdict}`,
|
|
425
|
+
wallSeconds: wall,
|
|
426
|
+
degraded: false
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
function reasonToViolation(reason) {
|
|
430
|
+
if (typeof reason === 'string') {
|
|
431
|
+
return { severity: 'MED', file: '<verdict>', line: 0, hint: reason };
|
|
432
|
+
}
|
|
433
|
+
if (reason !== null && typeof reason === 'object') {
|
|
434
|
+
const r = reason;
|
|
435
|
+
return {
|
|
436
|
+
severity: typeof r['severity'] === 'string' ? r['severity'] : 'MED',
|
|
437
|
+
file: typeof r['file'] === 'string' ? r['file'] : '<verdict>',
|
|
438
|
+
line: typeof r['line'] === 'number' ? r['line'] : 0,
|
|
439
|
+
hint: typeof r['hint'] === 'string' ? r['hint'] : JSON.stringify(reason)
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
return { severity: 'MED', file: '<verdict>', line: 0, hint: String(reason) };
|
|
443
|
+
}
|
|
444
|
+
function normalizeViolation(raw) {
|
|
445
|
+
if (raw === null || typeof raw !== 'object') {
|
|
446
|
+
return { severity: 'MED', file: '<unknown>', line: 0, hint: String(raw) };
|
|
447
|
+
}
|
|
448
|
+
const v = raw;
|
|
449
|
+
const sev = typeof v['severity'] === 'string' ? v['severity'] : 'MED';
|
|
450
|
+
const file = typeof v['file'] === 'string' ? v['file'] : '<unknown>';
|
|
451
|
+
const line = typeof v['line'] === 'number' ? v['line'] : 0;
|
|
452
|
+
const hint = typeof v['hint'] === 'string' ? v['hint'] : '';
|
|
453
|
+
const dimension = typeof v['dimension'] === 'string' ? v['dimension'] : undefined;
|
|
454
|
+
const out = dimension !== undefined
|
|
455
|
+
? { severity: sev, file, line, hint, dimension }
|
|
456
|
+
: { severity: sev, file, line, hint };
|
|
457
|
+
return out;
|
|
458
|
+
}
|
|
459
|
+
function safeJson(raw) {
|
|
460
|
+
if (typeof raw !== 'string' || raw.length === 0)
|
|
461
|
+
return null;
|
|
462
|
+
try {
|
|
463
|
+
return JSON.parse(raw);
|
|
464
|
+
}
|
|
465
|
+
catch {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
// Tiny ergonomic helper so we can re-emit an envelope with a different `kind`.
|
|
470
|
+
// (Implementation note: this is a free function rather than a method — the
|
|
471
|
+
// EvaluatorVerdictEnvelope interface is plain data, and adding methods via
|
|
472
|
+
// `declare module` makes TS treat them as required properties.)
|
|
473
|
+
export function envelopeAs(envelope, kind) {
|
|
474
|
+
return { ...envelope, kind };
|
|
475
|
+
}
|
|
476
|
+
// ─── Markdown → envelope fallbacks (used when peaks CLI is unavailable) ─
|
|
477
|
+
/**
|
|
478
|
+
* Best-effort markdown parse for karpathy-review.md / security.md / perf.md.
|
|
479
|
+
* Mirrors the shape accepted by `parseKarpathyEnvelope` /
|
|
480
|
+
* `parseSecurityEnvelope` / `parsePerfEnvelope` in `services/verdict/envelopes.ts`,
|
|
481
|
+
* keeping verdict-aggregator backward-compat intact.
|
|
482
|
+
*/
|
|
483
|
+
export function parseAuditMarkdownEnvelope(md, kind) {
|
|
484
|
+
if (typeof md !== 'string' || md.length === 0)
|
|
485
|
+
return null;
|
|
486
|
+
const verdict = matchVerdict(md);
|
|
487
|
+
if (verdict === null)
|
|
488
|
+
return null;
|
|
489
|
+
const violations = parseFindingBullets(md).map((b) => ({ ...b, dimension: kind }));
|
|
490
|
+
return {
|
|
491
|
+
kind,
|
|
492
|
+
passed: verdict === 'pass',
|
|
493
|
+
gateAction: verdict,
|
|
494
|
+
violations,
|
|
495
|
+
summary: extractSection(md, 'Summary') ?? '',
|
|
496
|
+
wallSeconds: 0,
|
|
497
|
+
degraded: true
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
function matchVerdict(md) {
|
|
501
|
+
const m = md.match(/^\s*verdict\s*:\s*(pass|warn|block)\s*$/m);
|
|
502
|
+
if (m === null)
|
|
503
|
+
return null;
|
|
504
|
+
return m[1];
|
|
505
|
+
}
|
|
506
|
+
function parseFindingBullets(body) {
|
|
507
|
+
const section = body.split(/^##\s+Findings\s*$/m)[1];
|
|
508
|
+
if (section === undefined)
|
|
509
|
+
return [];
|
|
510
|
+
const lines = section.split('\n').filter((l) => l.trim().startsWith('- '));
|
|
511
|
+
const out = [];
|
|
512
|
+
for (const line of lines) {
|
|
513
|
+
const a = line.match(/^\s*-\s*\[(CRITICAL|HIGH|MED|LOW)\]\s+(\S+)\s+@\s+([^:\s]+):(\d+)\s+[—-]\s+(.+)$/);
|
|
514
|
+
if (a !== null) {
|
|
515
|
+
const [, severity, , file, lineNo, hint] = a;
|
|
516
|
+
out.push({ severity: severity, file: file ?? '<unknown>', line: parseInt(lineNo ?? '0', 10), hint: (hint ?? '').trim() });
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
const b = line.match(/^\s*-\s*(CRITICAL|HIGH|MED|LOW)\s*:\s+(.+?)\s+in\s+([^:\s]+):(\d+)\s*$/);
|
|
520
|
+
if (b !== null) {
|
|
521
|
+
const [, severity, hint, file, lineNo] = b;
|
|
522
|
+
out.push({ severity: severity, file: file ?? '<unknown>', line: parseInt(lineNo ?? '0', 10), hint: (hint ?? '').trim() });
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return out;
|
|
526
|
+
}
|
|
527
|
+
function extractSection(body, heading) {
|
|
528
|
+
const re = new RegExp(`^##\\s+${heading}\\s*$`, 'm');
|
|
529
|
+
const sectionStart = body.search(re);
|
|
530
|
+
if (sectionStart === -1)
|
|
531
|
+
return null;
|
|
532
|
+
const after = body.slice(sectionStart).split('\n');
|
|
533
|
+
after.shift();
|
|
534
|
+
const lines = [];
|
|
535
|
+
for (const line of after) {
|
|
536
|
+
if (/^##\s+/.test(line))
|
|
537
|
+
break;
|
|
538
|
+
lines.push(line);
|
|
539
|
+
}
|
|
540
|
+
return lines.join('\n').trim();
|
|
541
|
+
}
|
|
542
|
+
/** Load an on-disk audit file (e.g. `.peaks/_runtime/<sid>/audit/security.md`)
|
|
543
|
+
* and project it to an `EvaluatorVerdictEnvelope`. Used by workflow yaml
|
|
544
|
+
* evaluators that point at on-disk artifacts. */
|
|
545
|
+
export function loadEnvelopeFromDisk(projectRoot, sid, rel, kind) {
|
|
546
|
+
const path = join(projectRoot, '.peaks', '_runtime', sid, rel);
|
|
547
|
+
if (!existsSync(path))
|
|
548
|
+
return null;
|
|
549
|
+
const md = readFileSync(path, 'utf8');
|
|
550
|
+
return parseAuditMarkdownEnvelope(md, kind);
|
|
551
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* peaks-loop v3.0.0 — Slice C.1
|
|
3
|
+
*
|
|
4
|
+
* Monotonic-improvement guard for the loop runtime. Compares adjacent
|
|
5
|
+
* cycles' per-evaluator scores (rescaled gateAction → 0..1) and
|
|
6
|
+
* returns a structured envelope indicating:
|
|
7
|
+
*
|
|
8
|
+
* - status: 'pass' | 'warn' | 'block' | 'skip'
|
|
9
|
+
* - regressions: per-evaluator score deltas where current < previous
|
|
10
|
+
* - reason: human-readable summary
|
|
11
|
+
*
|
|
12
|
+
* Karpathy §2 Simplicity First: pure function, no IO, no new deps.
|
|
13
|
+
*
|
|
14
|
+
* File budget: ≤ 800 lines (Karpathy §2).
|
|
15
|
+
*/
|
|
16
|
+
/** Per-evaluator score row, derived from an `EvaluatorVerdictEnvelope`. */
|
|
17
|
+
export interface MonotonicScoreRow {
|
|
18
|
+
readonly evaluator: string;
|
|
19
|
+
readonly score: number;
|
|
20
|
+
readonly gateAction: 'pass' | 'warn' | 'block';
|
|
21
|
+
readonly degraded: boolean;
|
|
22
|
+
/** ISO-8601 timestamp the verdict was recorded. */
|
|
23
|
+
readonly observedAt: string;
|
|
24
|
+
}
|
|
25
|
+
/** Cycle index — a single attempt at the loop. */
|
|
26
|
+
export interface MonotonicCycle {
|
|
27
|
+
readonly cycle: number;
|
|
28
|
+
/** Per-evaluator score rows. Same evaluator appearing twice collapses
|
|
29
|
+
* to the last entry (BC: deterministic, no merging surprises). */
|
|
30
|
+
readonly scores: readonly MonotonicScoreRow[];
|
|
31
|
+
}
|
|
32
|
+
export interface MonotonicRegression {
|
|
33
|
+
readonly evaluator: string;
|
|
34
|
+
readonly previousScore: number;
|
|
35
|
+
readonly currentScore: number;
|
|
36
|
+
readonly delta: number;
|
|
37
|
+
}
|
|
38
|
+
/** Result of a `checkMonotonicImprovement` call. */
|
|
39
|
+
export interface MonotonicReport {
|
|
40
|
+
readonly status: 'pass' | 'warn' | 'block' | 'skip';
|
|
41
|
+
readonly ok: boolean;
|
|
42
|
+
readonly reason: string;
|
|
43
|
+
readonly threshold: number;
|
|
44
|
+
readonly previousCycle: number | null;
|
|
45
|
+
readonly currentCycle: number;
|
|
46
|
+
/** Per-evaluator regressions exceeding the threshold (sorted by |delta| desc). */
|
|
47
|
+
readonly regressions: readonly MonotonicRegression[];
|
|
48
|
+
/** Convenience boolean — true iff a regression exceeds the threshold. */
|
|
49
|
+
readonly monotonicityViolation: boolean;
|
|
50
|
+
/** Diagnostic hint surfaced as `MONOTONICITY_VIOLATION` in the CLI envelope. */
|
|
51
|
+
readonly code: 'MONOTONIC_OK' | 'MONOTONIC_NO_PREVIOUS' | 'MONOTONIC_VIOLATION' | 'MONOTONIC_INCOMPARABLE_EVALUATORS';
|
|
52
|
+
}
|
|
53
|
+
/** Convert an envelope-shaped verdict row to `MonotonicScoreRow`.
|
|
54
|
+
* Pure helper, exported for the CLI layer. */
|
|
55
|
+
export declare function toScoreRow(evaluator: string, gateAction: 'pass' | 'warn' | 'block', degraded: boolean, observedAtIso?: string): MonotonicScoreRow;
|
|
56
|
+
/** Default threshold = 5% of [0,1] scale → 0.05. */
|
|
57
|
+
export declare const DEFAULT_MONOTONIC_THRESHOLD = 0.05;
|
|
58
|
+
export interface CheckMonotonicOptions {
|
|
59
|
+
/** Maximum regression permitted (in [0,1] scale). Default 0.05 (5%). */
|
|
60
|
+
readonly threshold?: number;
|
|
61
|
+
/** When provided, the guard logs the cycle id this report refers to. */
|
|
62
|
+
readonly nowIso?: string;
|
|
63
|
+
}
|
|
64
|
+
/** Compare `previous` against `current` and report monotonicity.
|
|
65
|
+
*
|
|
66
|
+
* Rules (reflected in `tests/unit/loop/monotonic-guard.test.ts`):
|
|
67
|
+
* - missing previous cycle → skip (`MONOTONIC_NO_PREVIOUS`)
|
|
68
|
+
* - evaluators not present in both cycles → skip that evaluator
|
|
69
|
+
* - score unchanged / up → ok
|
|
70
|
+
* - score ↓ ≤ threshold → ok
|
|
71
|
+
* - score ↓ > threshold → regression row + status 'block'
|
|
72
|
+
* with `code = MONOTONICITY_VIOLATION`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function checkMonotonicImprovement(previous: MonotonicCycle | null, current: MonotonicCycle, options?: CheckMonotonicOptions): MonotonicReport;
|
|
75
|
+
/** Read `.peaks/_sub_agents/<sid>/shared/` cross-session signal — on
|
|
76
|
+
* any IO error, return `null` so the guard never crashes on missing
|
|
77
|
+
* cross-batch signal (per Slice C (b) case "跨 session 读
|
|
78
|
+
* .peaks/_sub_agents/<sid>/shared/ 跨批 signal → 不 crash").
|
|
79
|
+
* Pure helper; only present for the cross-session case. */
|
|
80
|
+
export declare function loadCrossSessionSignal(projectRoot: string, sid: string): MonotonicCycle | null;
|