peaks-loop 4.0.0-beta.8 → 4.0.0-beta.9
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/CHANGELOG.md +45 -0
- package/bin/peaks.js +1 -1
- package/dist/cli/cli-helpers.d.ts +43 -0
- package/dist/cli/cli-helpers.js +86 -0
- package/dist/cli/commands/_cli-error-envelope.d.ts +19 -0
- package/dist/cli/commands/_cli-error-envelope.js +50 -0
- package/dist/cli/commands/adapter-commands-s2a.d.ts +34 -0
- package/dist/cli/commands/adapter-commands-s2a.js +92 -0
- package/dist/cli/commands/adapter-commands.d.ts +30 -0
- package/dist/cli/commands/adapter-commands.js +35 -0
- package/dist/cli/commands/agent-commands.d.ts +20 -0
- package/dist/cli/commands/agent-commands.js +48 -0
- package/dist/cli/commands/asset-commands.d.ts +45 -0
- package/dist/cli/commands/asset-commands.js +404 -0
- package/dist/cli/commands/audit-commands.d.ts +28 -0
- package/dist/cli/commands/audit-commands.js +437 -0
- package/dist/cli/commands/bee-commands.d.ts +26 -0
- package/dist/cli/commands/bee-commands.js +169 -0
- package/dist/cli/commands/capability-commands.d.ts +16 -0
- package/dist/cli/commands/capability-commands.js +45 -0
- package/dist/cli/commands/capability-worker-config-sc-commands.d.ts +3 -0
- package/dist/cli/commands/capability-worker-config-sc-commands.js +10 -0
- package/dist/cli/commands/classify-classify-commands.d.ts +19 -0
- package/dist/cli/commands/classify-classify-commands.js +151 -0
- package/dist/cli/commands/code-commands.d.ts +80 -0
- package/dist/cli/commands/code-commands.js +798 -0
- package/dist/cli/commands/code-review-commands.d.ts +34 -0
- package/dist/cli/commands/code-review-commands.js +83 -0
- package/dist/cli/commands/codegraph-commands.d.ts +3 -0
- package/dist/cli/commands/codegraph-commands.js +99 -0
- package/dist/cli/commands/compact-command.d.ts +21 -0
- package/dist/cli/commands/compact-command.js +252 -0
- package/dist/cli/commands/complexity-commands.d.ts +9 -0
- package/dist/cli/commands/complexity-commands.js +34 -0
- package/dist/cli/commands/config-commands.d.ts +3 -0
- package/dist/cli/commands/config-commands.js +220 -0
- package/dist/cli/commands/context-builder-commands.d.ts +11 -0
- package/dist/cli/commands/context-builder-commands.js +85 -0
- package/dist/cli/commands/context-commands.d.ts +21 -0
- package/dist/cli/commands/context-commands.js +254 -0
- package/dist/cli/commands/contract-commands.d.ts +26 -0
- package/dist/cli/commands/contract-commands.js +114 -0
- package/dist/cli/commands/core/artifacts-command.d.ts +3 -0
- package/dist/cli/commands/core/artifacts-command.js +62 -0
- package/dist/cli/commands/core/binding-commands.d.ts +3 -0
- package/dist/cli/commands/core/binding-commands.js +58 -0
- package/dist/cli/commands/core/doctor-command.d.ts +11 -0
- package/dist/cli/commands/core/doctor-command.js +204 -0
- package/dist/cli/commands/core/memory-command.d.ts +3 -0
- package/dist/cli/commands/core/memory-command.js +98 -0
- package/dist/cli/commands/core/profile-command.d.ts +3 -0
- package/dist/cli/commands/core/profile-command.js +9 -0
- package/dist/cli/commands/core/proxy-command.d.ts +3 -0
- package/dist/cli/commands/core/proxy-command.js +26 -0
- package/dist/cli/commands/core/session-command.d.ts +3 -0
- package/dist/cli/commands/core/session-command.js +241 -0
- package/dist/cli/commands/core/skill-command.d.ts +3 -0
- package/dist/cli/commands/core/skill-command.js +300 -0
- package/dist/cli/commands/core/standards-command.d.ts +3 -0
- package/dist/cli/commands/core/standards-command.js +95 -0
- package/dist/cli/commands/core-artifact-commands.d.ts +15 -0
- package/dist/cli/commands/core-artifact-commands.js +31 -0
- package/dist/cli/commands/dispatch-commands.d.ts +10 -0
- package/dist/cli/commands/dispatch-commands.js +351 -0
- package/dist/cli/commands/dispatch-from-dag.d.ts +3 -0
- package/dist/cli/commands/dispatch-from-dag.js +251 -0
- package/dist/cli/commands/doc-commands.d.ts +11 -0
- package/dist/cli/commands/doc-commands.js +65 -0
- package/dist/cli/commands/evolution-commands.d.ts +27 -0
- package/dist/cli/commands/evolution-commands.js +393 -0
- package/dist/cli/commands/feedback-commands.d.ts +18 -0
- package/dist/cli/commands/feedback-commands.js +145 -0
- package/dist/cli/commands/final-review-commands.d.ts +31 -0
- package/dist/cli/commands/final-review-commands.js +161 -0
- package/dist/cli/commands/fixture-commands.d.ts +32 -0
- package/dist/cli/commands/fixture-commands.js +91 -0
- package/dist/cli/commands/fork-commands.d.ts +16 -0
- package/dist/cli/commands/fork-commands.js +163 -0
- package/dist/cli/commands/gate-commands.d.ts +3 -0
- package/dist/cli/commands/gate-commands.js +117 -0
- package/dist/cli/commands/heartbeat-commands.d.ts +3 -0
- package/dist/cli/commands/heartbeat-commands.js +135 -0
- package/dist/cli/commands/hook-handle.d.ts +17 -0
- package/dist/cli/commands/hook-handle.js +157 -0
- package/dist/cli/commands/hooks-commands.d.ts +3 -0
- package/dist/cli/commands/hooks-commands.js +156 -0
- package/dist/cli/commands/ide-commands.d.ts +25 -0
- package/dist/cli/commands/ide-commands.js +42 -0
- package/dist/cli/commands/impact-commands.d.ts +15 -0
- package/dist/cli/commands/impact-commands.js +62 -0
- package/dist/cli/commands/job-commands.d.ts +3 -0
- package/dist/cli/commands/job-commands.js +289 -0
- package/dist/cli/commands/legacy-commands.d.ts +11 -0
- package/dist/cli/commands/legacy-commands.js +32 -0
- package/dist/cli/commands/log-commands.d.ts +17 -0
- package/dist/cli/commands/log-commands.js +64 -0
- package/dist/cli/commands/loop-commands.d.ts +27 -0
- package/dist/cli/commands/loop-commands.js +262 -0
- package/dist/cli/commands/loop-eval-commands.d.ts +20 -0
- package/dist/cli/commands/loop-eval-commands.js +526 -0
- package/dist/cli/commands/memory-commands.d.ts +23 -0
- package/dist/cli/commands/memory-commands.js +129 -0
- package/dist/cli/commands/migrate-1-4-1-command.d.ts +11 -0
- package/dist/cli/commands/migrate-1-4-1-command.js +34 -0
- package/dist/cli/commands/migrate-v2-10-to-v2-11-command.d.ts +20 -0
- package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +52 -0
- package/dist/cli/commands/mut-commands.d.ts +20 -0
- package/dist/cli/commands/mut-commands.js +239 -0
- package/dist/cli/commands/observability-commands.d.ts +22 -0
- package/dist/cli/commands/observability-commands.js +201 -0
- package/dist/cli/commands/openspec-commands.d.ts +3 -0
- package/dist/cli/commands/openspec-commands.js +237 -0
- package/dist/cli/commands/perf-audit-commands.d.ts +22 -0
- package/dist/cli/commands/perf-audit-commands.js +132 -0
- package/dist/cli/commands/perf-commands.d.ts +3 -0
- package/dist/cli/commands/perf-commands.js +41 -0
- package/dist/cli/commands/playwright-commands.d.ts +95 -0
- package/dist/cli/commands/playwright-commands.js +432 -0
- package/dist/cli/commands/polyrepo-commands.d.ts +37 -0
- package/dist/cli/commands/polyrepo-commands.js +155 -0
- package/dist/cli/commands/prd-blocks-commands.d.ts +18 -0
- package/dist/cli/commands/prd-blocks-commands.js +50 -0
- package/dist/cli/commands/prd-commands.d.ts +18 -0
- package/dist/cli/commands/prd-commands.js +141 -0
- package/dist/cli/commands/preferences-commands.d.ts +2 -0
- package/dist/cli/commands/preferences-commands.js +197 -0
- package/dist/cli/commands/project-commands.d.ts +3 -0
- package/dist/cli/commands/project-commands.js +253 -0
- package/dist/cli/commands/qa-business-review-commands.d.ts +17 -0
- package/dist/cli/commands/qa-business-review-commands.js +148 -0
- package/dist/cli/commands/qa-commands.d.ts +94 -0
- package/dist/cli/commands/qa-commands.js +271 -0
- package/dist/cli/commands/release-commands.d.ts +24 -0
- package/dist/cli/commands/release-commands.js +231 -0
- package/dist/cli/commands/request-commands.d.ts +3 -0
- package/dist/cli/commands/request-commands.js +548 -0
- package/dist/cli/commands/retrospective-commands.d.ts +12 -0
- package/dist/cli/commands/retrospective-commands.js +175 -0
- package/dist/cli/commands/reviewer-commands.d.ts +14 -0
- package/dist/cli/commands/reviewer-commands.js +64 -0
- package/dist/cli/commands/role-commands.d.ts +13 -0
- package/dist/cli/commands/role-commands.js +85 -0
- package/dist/cli/commands/runtime-commands.d.ts +52 -0
- package/dist/cli/commands/runtime-commands.js +150 -0
- package/dist/cli/commands/sc-commands.d.ts +3 -0
- package/dist/cli/commands/sc-commands.js +45 -0
- package/dist/cli/commands/scan-commands.d.ts +3 -0
- package/dist/cli/commands/scan-commands.js +445 -0
- package/dist/cli/commands/security-audit-commands.d.ts +23 -0
- package/dist/cli/commands/security-audit-commands.js +132 -0
- package/dist/cli/commands/sediment-commands.d.ts +80 -0
- package/dist/cli/commands/sediment-commands.js +649 -0
- package/dist/cli/commands/session-auto-compact-hook-command.d.ts +37 -0
- package/dist/cli/commands/session-auto-compact-hook-command.js +127 -0
- package/dist/cli/commands/session-checkpoint-command.d.ts +10 -0
- package/dist/cli/commands/session-checkpoint-command.js +100 -0
- package/dist/cli/commands/session-migrate-skill-name.d.ts +17 -0
- package/dist/cli/commands/session-migrate-skill-name.js +41 -0
- package/dist/cli/commands/session-resume-command.d.ts +11 -0
- package/dist/cli/commands/session-resume-command.js +83 -0
- package/dist/cli/commands/share-commands.d.ts +17 -0
- package/dist/cli/commands/share-commands.js +296 -0
- package/dist/cli/commands/skill-conformance-commands.d.ts +9 -0
- package/dist/cli/commands/skill-conformance-commands.js +39 -0
- package/dist/cli/commands/skill-loop-engineering-readiness-commands.d.ts +67 -0
- package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +173 -0
- package/dist/cli/commands/skill-search-commands.d.ts +25 -0
- package/dist/cli/commands/skill-search-commands.js +68 -0
- package/dist/cli/commands/skill-visibility.d.ts +8 -0
- package/dist/cli/commands/skill-visibility.js +63 -0
- package/dist/cli/commands/slice-commands.d.ts +24 -0
- package/dist/cli/commands/slice-commands.js +492 -0
- package/dist/cli/commands/slice-integrate-commands.d.ts +11 -0
- package/dist/cli/commands/slice-integrate-commands.js +74 -0
- package/dist/cli/commands/slice-review-commands.d.ts +23 -0
- package/dist/cli/commands/slice-review-commands.js +162 -0
- package/dist/cli/commands/smoke-commands.d.ts +21 -0
- package/dist/cli/commands/smoke-commands.js +203 -0
- package/dist/cli/commands/sop-commands.d.ts +3 -0
- package/dist/cli/commands/sop-commands.js +215 -0
- package/dist/cli/commands/statusline-commands.d.ts +3 -0
- package/dist/cli/commands/statusline-commands.js +169 -0
- package/dist/cli/commands/sub-agent-commands.d.ts +22 -0
- package/dist/cli/commands/sub-agent-commands.js +19 -0
- package/dist/cli/commands/sub-agent-dispatch-guard.d.ts +55 -0
- package/dist/cli/commands/sub-agent-dispatch-guard.js +57 -0
- package/dist/cli/commands/sub-agent-shared.d.ts +99 -0
- package/dist/cli/commands/sub-agent-shared.js +67 -0
- package/dist/cli/commands/test-commands.d.ts +47 -0
- package/dist/cli/commands/test-commands.js +204 -0
- package/dist/cli/commands/understand-commands.d.ts +3 -0
- package/dist/cli/commands/understand-commands.js +148 -0
- package/dist/cli/commands/upgrade-commands.d.ts +23 -0
- package/dist/cli/commands/upgrade-commands.js +119 -0
- package/dist/cli/commands/user-touchpoint-commands.d.ts +18 -0
- package/dist/cli/commands/user-touchpoint-commands.js +78 -0
- package/dist/cli/commands/verdict-aggregate-command.d.ts +14 -0
- package/dist/cli/commands/verdict-aggregate-command.js +106 -0
- package/dist/cli/commands/worker-commands.d.ts +3 -0
- package/dist/cli/commands/worker-commands.js +52 -0
- package/dist/cli/commands/workflow-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-commands.js +544 -0
- package/dist/cli/commands/workflow-plan-commands.d.ts +39 -0
- package/dist/cli/commands/workflow-plan-commands.js +163 -0
- package/dist/cli/commands/workspace/clean-command.d.ts +14 -0
- package/dist/cli/commands/workspace/clean-command.js +49 -0
- package/dist/cli/commands/workspace/helpers.d.ts +28 -0
- package/dist/cli/commands/workspace/helpers.js +87 -0
- package/dist/cli/commands/workspace/init-command.d.ts +139 -0
- package/dist/cli/commands/workspace/init-command.js +505 -0
- package/dist/cli/commands/workspace/migrate-command.d.ts +11 -0
- package/dist/cli/commands/workspace/migrate-command.js +91 -0
- package/dist/cli/commands/workspace/reconcile-command.d.ts +14 -0
- package/dist/cli/commands/workspace/reconcile-command.js +103 -0
- package/dist/cli/commands/workspace-commands.d.ts +18 -0
- package/dist/cli/commands/workspace-commands.js +50 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +30 -0
- package/dist/cli/program.d.ts +5 -0
- package/dist/cli/program.js +408 -0
- package/dist/hooks/pre-tool-use-sub-agent.d.ts +28 -0
- package/dist/hooks/pre-tool-use-sub-agent.js +105 -0
- package/dist/lib/render/message-renderer.d.ts +20 -0
- package/dist/lib/render/message-renderer.js +80 -0
- package/dist/services/adapter/adapter-registry.d.ts +48 -0
- package/dist/services/adapter/adapter-registry.js +186 -0
- package/dist/services/adapter/adapter.d.ts +27 -0
- package/dist/services/adapter/adapter.js +5 -0
- package/dist/services/adapter/auto-adapter.d.ts +11 -0
- package/dist/services/adapter/auto-adapter.js +15 -0
- package/dist/services/adapter/claude-adapter.d.ts +14 -0
- package/dist/services/adapter/claude-adapter.js +40 -0
- package/dist/services/adapter/codex-adapter.d.ts +14 -0
- package/dist/services/adapter/codex-adapter.js +14 -0
- package/dist/services/adapter/copilot-adapter.d.ts +14 -0
- package/dist/services/adapter/copilot-adapter.js +14 -0
- package/dist/services/agent/ecc-agent-service.d.ts +47 -0
- package/dist/services/agent/ecc-agent-service.js +143 -0
- package/dist/services/artifacts/artifact-lint-service.d.ts +23 -0
- package/dist/services/artifacts/artifact-lint-service.js +99 -0
- package/dist/services/artifacts/artifact-prerequisites.d.ts +78 -0
- package/dist/services/artifacts/artifact-prerequisites.js +491 -0
- package/dist/services/artifacts/artifact-service.d.ts +43 -0
- package/dist/services/artifacts/artifact-service.js +98 -0
- package/dist/services/artifacts/artifact-templates.d.ts +30 -0
- package/dist/services/artifacts/artifact-templates.js +302 -0
- package/dist/services/artifacts/repair-cycle-service.d.ts +23 -0
- package/dist/services/artifacts/repair-cycle-service.js +52 -0
- package/dist/services/artifacts/request-artifact-service.d.ts +116 -0
- package/dist/services/artifacts/request-artifact-service.js +451 -0
- package/dist/services/artifacts/request-artifact-state-helpers.d.ts +51 -0
- package/dist/services/artifacts/request-artifact-state-helpers.js +114 -0
- package/dist/services/artifacts/workspace-service.d.ts +34 -0
- package/dist/services/artifacts/workspace-service.js +272 -0
- package/dist/services/audit/artifact-writer.d.ts +93 -0
- package/dist/services/audit/artifact-writer.js +303 -0
- package/dist/services/audit/audit-goal-service.d.ts +35 -0
- package/dist/services/audit/audit-goal-service.js +75 -0
- package/dist/services/audit/audit-goal-types.d.ts +40 -0
- package/dist/services/audit/audit-goal-types.js +15 -0
- package/dist/services/audit/backing-detector.d.ts +24 -0
- package/dist/services/audit/backing-detector.js +59 -0
- package/dist/services/audit/classifier.d.ts +38 -0
- package/dist/services/audit/classifier.js +134 -0
- package/dist/services/audit/decision-writer.d.ts +76 -0
- package/dist/services/audit/decision-writer.js +217 -0
- package/dist/services/audit/enforcers/active-skill-resolver.d.ts +29 -0
- package/dist/services/audit/enforcers/active-skill-resolver.js +71 -0
- package/dist/services/audit/enforcers/code-ban.d.ts +23 -0
- package/dist/services/audit/enforcers/code-ban.js +27 -0
- package/dist/services/audit/enforcers/design-draft-confirm.d.ts +24 -0
- package/dist/services/audit/enforcers/design-draft-confirm.js +58 -0
- package/dist/services/audit/enforcers/lint-audit-regression.d.ts +21 -0
- package/dist/services/audit/enforcers/lint-audit-regression.js +86 -0
- package/dist/services/audit/enforcers/lint-catalog-governance.d.ts +32 -0
- package/dist/services/audit/enforcers/lint-catalog-governance.js +48 -0
- package/dist/services/audit/enforcers/lint-cli-back.d.ts +16 -0
- package/dist/services/audit/enforcers/lint-cli-back.js +35 -0
- package/dist/services/audit/enforcers/lint-output-style.d.ts +11 -0
- package/dist/services/audit/enforcers/lint-output-style.js +94 -0
- package/dist/services/audit/enforcers/lint-reference-integrity.d.ts +6 -0
- package/dist/services/audit/enforcers/lint-reference-integrity.js +83 -0
- package/dist/services/audit/enforcers/lint-reference-shape.d.ts +30 -0
- package/dist/services/audit/enforcers/lint-reference-shape.js +272 -0
- package/dist/services/audit/enforcers/lint-style.d.ts +49 -0
- package/dist/services/audit/enforcers/lint-style.js +173 -0
- package/dist/services/audit/enforcers/lint-workflow-shape.d.ts +4 -0
- package/dist/services/audit/enforcers/lint-workflow-shape.js +100 -0
- package/dist/services/audit/enforcers/login-gate.d.ts +23 -0
- package/dist/services/audit/enforcers/login-gate.js +40 -0
- package/dist/services/audit/enforcers/mock-placement.d.ts +25 -0
- package/dist/services/audit/enforcers/mock-placement.js +48 -0
- package/dist/services/audit/enforcers/no-root-pollution.d.ts +21 -0
- package/dist/services/audit/enforcers/no-root-pollution.js +56 -0
- package/dist/services/audit/enforcers/pre-rd-scan.d.ts +22 -0
- package/dist/services/audit/enforcers/pre-rd-scan.js +23 -0
- package/dist/services/audit/enforcers/prototype-fidelity.d.ts +25 -0
- package/dist/services/audit/enforcers/prototype-fidelity.js +75 -0
- package/dist/services/audit/enforcers/resume-detection.d.ts +21 -0
- package/dist/services/audit/enforcers/resume-detection.js +52 -0
- package/dist/services/audit/enforcers/sub-agent-sid.d.ts +25 -0
- package/dist/services/audit/enforcers/sub-agent-sid.js +63 -0
- package/dist/services/audit/prose-ratio-calculator.d.ts +45 -0
- package/dist/services/audit/prose-ratio-calculator.js +52 -0
- package/dist/services/audit/red-line-catalog-p2-a.d.ts +21 -0
- package/dist/services/audit/red-line-catalog-p2-a.js +229 -0
- package/dist/services/audit/red-line-catalog-p2-b.d.ts +19 -0
- package/dist/services/audit/red-line-catalog-p2-b.js +225 -0
- package/dist/services/audit/red-line-catalog.d.ts +51 -0
- package/dist/services/audit/red-line-catalog.js +195 -0
- package/dist/services/audit/red-lines-service.d.ts +23 -0
- package/dist/services/audit/red-lines-service.js +464 -0
- package/dist/services/audit/scanners/openspec-scanner.d.ts +15 -0
- package/dist/services/audit/scanners/openspec-scanner.js +55 -0
- package/dist/services/audit/scanners/rules-tree-scanner.d.ts +16 -0
- package/dist/services/audit/scanners/rules-tree-scanner.js +56 -0
- package/dist/services/audit/scanners/skills-tree-scanner.d.ts +17 -0
- package/dist/services/audit/scanners/skills-tree-scanner.js +68 -0
- package/dist/services/audit/static-service.d.ts +60 -0
- package/dist/services/audit/static-service.js +130 -0
- package/dist/services/audit/types.d.ts +86 -0
- package/dist/services/audit/types.js +13 -0
- package/dist/services/audit-independent/perf-audit-service.d.ts +151 -0
- package/dist/services/audit-independent/perf-audit-service.js +316 -0
- package/dist/services/audit-independent/security-audit-service.d.ts +155 -0
- package/dist/services/audit-independent/security-audit-service.js +316 -0
- package/dist/services/classify/classify-service.d.ts +42 -0
- package/dist/services/classify/classify-service.js +122 -0
- package/dist/services/classify/classify-types.d.ts +79 -0
- package/dist/services/classify/classify-types.js +90 -0
- package/dist/services/code/auto-compact-orchestrator.d.ts +98 -0
- package/dist/services/code/auto-compact-orchestrator.js +343 -0
- package/dist/services/code/batch-heartbeat-poller.d.ts +51 -0
- package/dist/services/code/batch-heartbeat-poller.js +88 -0
- package/dist/services/code/dag-orchestrator.d.ts +128 -0
- package/dist/services/code/dag-orchestrator.js +304 -0
- package/dist/services/code/emit-handoff.d.ts +49 -0
- package/dist/services/code/emit-handoff.js +79 -0
- package/dist/services/code/job-shape-decision.d.ts +71 -0
- package/dist/services/code/job-shape-decision.js +151 -0
- package/dist/services/code/mode-gate.d.ts +163 -0
- package/dist/services/code/mode-gate.js +212 -0
- package/dist/services/code/post-compact-detector.d.ts +61 -0
- package/dist/services/code/post-compact-detector.js +240 -0
- package/dist/services/code/status-line-renderer.d.ts +34 -0
- package/dist/services/code/status-line-renderer.js +55 -0
- package/dist/services/code/step-08-gate.d.ts +90 -0
- package/dist/services/code/step-08-gate.js +136 -0
- package/dist/services/code/user-touchpoint-classifier.d.ts +44 -0
- package/dist/services/code/user-touchpoint-classifier.js +145 -0
- package/dist/services/code-review/ecc-bridge.d.ts +148 -0
- package/dist/services/code-review/ecc-bridge.js +242 -0
- package/dist/services/code-review/ocr-service.d.ts +129 -0
- package/dist/services/code-review/ocr-service.js +369 -0
- package/dist/services/codegraph/codegraph-process-runner.d.ts +2 -0
- package/dist/services/codegraph/codegraph-process-runner.js +93 -0
- package/dist/services/codegraph/codegraph-service.d.ts +43 -0
- package/dist/services/codegraph/codegraph-service.js +160 -0
- package/dist/services/compact/decision-tables.d.ts +66 -0
- package/dist/services/compact/decision-tables.js +127 -0
- package/dist/services/compact/request-transition-hook.d.ts +20 -0
- package/dist/services/compact/request-transition-hook.js +110 -0
- package/dist/services/compact/suggest-service.d.ts +74 -0
- package/dist/services/compact/suggest-service.js +203 -0
- package/dist/services/complexity/complexity-estimator.d.ts +34 -0
- package/dist/services/complexity/complexity-estimator.js +64 -0
- package/dist/services/config/config-migration.d.ts +45 -0
- package/dist/services/config/config-migration.js +154 -0
- package/dist/services/config/config-restore.d.ts +10 -0
- package/dist/services/config/config-restore.js +47 -0
- package/dist/services/config/config-rollback.d.ts +13 -0
- package/dist/services/config/config-rollback.js +26 -0
- package/dist/services/config/config-safety.d.ts +40 -0
- package/dist/services/config/config-safety.js +359 -0
- package/dist/services/config/config-service.d.ts +69 -0
- package/dist/services/config/config-service.js +814 -0
- package/dist/services/config/config-types.d.ts +119 -0
- package/dist/services/config/config-types.js +18 -0
- package/dist/services/config/model-routing.d.ts +66 -0
- package/dist/services/config/model-routing.js +105 -0
- package/dist/services/config/provider-service.d.ts +48 -0
- package/dist/services/config/provider-service.js +143 -0
- package/dist/services/config/proxy-service.d.ts +21 -0
- package/dist/services/config/proxy-service.js +44 -0
- package/dist/services/config/sidecar-store.d.ts +25 -0
- package/dist/services/config/sidecar-store.js +61 -0
- package/dist/services/config/workspace-state-service.d.ts +30 -0
- package/dist/services/config/workspace-state-service.js +142 -0
- package/dist/services/context/artifact-meta.d.ts +72 -0
- package/dist/services/context/artifact-meta.js +105 -0
- package/dist/services/context/auto-compact-dispatcher.d.ts +37 -0
- package/dist/services/context/auto-compact-dispatcher.js +240 -0
- package/dist/services/context/auto-compact-reader.d.ts +51 -0
- package/dist/services/context/auto-compact-reader.js +164 -0
- package/dist/services/context/auto-compact-types.d.ts +143 -0
- package/dist/services/context/auto-compact-types.js +36 -0
- package/dist/services/context/collector.d.ts +24 -0
- package/dist/services/context/collector.js +133 -0
- package/dist/services/context/context-builder.d.ts +30 -0
- package/dist/services/context/context-builder.js +78 -0
- package/dist/services/context/context-guard.d.ts +49 -0
- package/dist/services/context/context-guard.js +91 -0
- package/dist/services/context/context-schema.d.ts +415 -0
- package/dist/services/context/context-schema.js +73 -0
- package/dist/services/context/dispatch-context-guard.d.ts +27 -0
- package/dist/services/context/dispatch-context-guard.js +192 -0
- package/dist/services/context/doc-retriever.d.ts +26 -0
- package/dist/services/context/doc-retriever.js +51 -0
- package/dist/services/context/headroom-client.d.ts +34 -0
- package/dist/services/context/headroom-client.js +117 -0
- package/dist/services/context/headroom-fetcher.d.ts +6 -0
- package/dist/services/context/headroom-fetcher.js +28 -0
- package/dist/services/context/headroom-prefs.d.ts +46 -0
- package/dist/services/context/headroom-prefs.js +34 -0
- package/dist/services/context/index.d.ts +7 -0
- package/dist/services/context/index.js +6 -0
- package/dist/services/context/main-session-monitor.d.ts +89 -0
- package/dist/services/context/main-session-monitor.js +142 -0
- package/dist/services/context/renderer.d.ts +20 -0
- package/dist/services/context/renderer.js +30 -0
- package/dist/services/context/shared-channel.d.ts +93 -0
- package/dist/services/context/shared-channel.js +308 -0
- package/dist/services/context/threshold.d.ts +35 -0
- package/dist/services/context/threshold.js +76 -0
- package/dist/services/context/tokenizer.d.ts +12 -0
- package/dist/services/context/tokenizer.js +43 -0
- package/dist/services/context/types.d.ts +93 -0
- package/dist/services/context/types.js +9 -0
- package/dist/services/crystallization/crystallization-service.d.ts +239 -0
- package/dist/services/crystallization/crystallization-service.js +397 -0
- package/dist/services/crystallization/crystallization-store.d.ts +75 -0
- package/dist/services/crystallization/crystallization-store.js +193 -0
- package/dist/services/crystallization/crystallization-types.d.ts +313 -0
- package/dist/services/crystallization/crystallization-types.js +299 -0
- package/dist/services/crystallization/evidence-brief-builder.d.ts +237 -0
- package/dist/services/crystallization/evidence-brief-builder.js +240 -0
- package/dist/services/dashboard/project-dashboard-service.d.ts +91 -0
- package/dist/services/dashboard/project-dashboard-service.js +147 -0
- package/dist/services/dispatch/batch-counter.d.ts +27 -0
- package/dist/services/dispatch/batch-counter.js +102 -0
- package/dist/services/dispatch/contract-store.d.ts +63 -0
- package/dist/services/dispatch/contract-store.js +157 -0
- package/dist/services/dispatch/dispatch-record-writer.d.ts +138 -0
- package/dist/services/dispatch/dispatch-record-writer.js +460 -0
- package/dist/services/dispatch/heartbeat-truncator.d.ts +26 -0
- package/dist/services/dispatch/heartbeat-truncator.js +13 -0
- package/dist/services/dispatch/leak-detector.d.ts +11 -0
- package/dist/services/dispatch/leak-detector.js +72 -0
- package/dist/services/dispatch/slice-dag.d.ts +81 -0
- package/dist/services/dispatch/slice-dag.js +238 -0
- package/dist/services/dispatch/sub-agent-dispatcher.d.ts +239 -0
- package/dist/services/dispatch/sub-agent-dispatcher.js +382 -0
- package/dist/services/dispatch/test-tool-detection.d.ts +36 -0
- package/dist/services/dispatch/test-tool-detection.js +46 -0
- package/dist/services/doc/doc-generator.d.ts +38 -0
- package/dist/services/doc/doc-generator.js +122 -0
- package/dist/services/doctor/doctor-service.d.ts +149 -0
- package/dist/services/doctor/doctor-service.js +929 -0
- package/dist/services/evolution/evolution-service.d.ts +137 -0
- package/dist/services/evolution/evolution-service.js +281 -0
- package/dist/services/evolution/evolution-store.d.ts +57 -0
- package/dist/services/evolution/evolution-store.js +232 -0
- package/dist/services/evolution/evolution-types.d.ts +706 -0
- package/dist/services/evolution/evolution-types.js +286 -0
- package/dist/services/evolution/independent-evaluator-runner.d.ts +90 -0
- package/dist/services/evolution/independent-evaluator-runner.js +106 -0
- package/dist/services/evolution/regression-skeptic-runner.d.ts +64 -0
- package/dist/services/evolution/regression-skeptic-runner.js +113 -0
- package/dist/services/feedback/feedback-promotion-service.d.ts +123 -0
- package/dist/services/feedback/feedback-promotion-service.js +300 -0
- package/dist/services/filesystem/file-lock.d.ts +11 -0
- package/dist/services/filesystem/file-lock.js +152 -0
- package/dist/services/final-review/final-review-service.d.ts +12 -0
- package/dist/services/final-review/final-review-service.js +52 -0
- package/dist/services/final-review/final-review-types.d.ts +42 -0
- package/dist/services/final-review/final-review-types.js +18 -0
- package/dist/services/fixture/fixture-capture-service.d.ts +87 -0
- package/dist/services/fixture/fixture-capture-service.js +317 -0
- package/dist/services/fixture/fixture-sanitize-service.d.ts +117 -0
- package/dist/services/fixture/fixture-sanitize-service.js +161 -0
- package/dist/services/fixture/index.d.ts +8 -0
- package/dist/services/fixture/index.js +8 -0
- package/dist/services/fork/fork-sync-state.d.ts +85 -0
- package/dist/services/fork/fork-sync-state.js +130 -0
- package/dist/services/fuzzy-matching/fuzzy-match-service.d.ts +15 -0
- package/dist/services/fuzzy-matching/fuzzy-match-service.js +56 -0
- package/dist/services/fuzzy-matching/fzf-pick-service.d.ts +68 -0
- package/dist/services/fuzzy-matching/fzf-pick-service.js +158 -0
- package/dist/services/fuzzy-matching/types.d.ts +20 -0
- package/dist/services/fuzzy-matching/types.js +1 -0
- package/dist/services/handoff/handoff-parser.d.ts +28 -0
- package/dist/services/handoff/handoff-parser.js +69 -0
- package/dist/services/handoff/handoff-types.d.ts +39 -0
- package/dist/services/handoff/handoff-types.js +19 -0
- package/dist/services/handoff/handoff-writer.d.ts +23 -0
- package/dist/services/handoff/handoff-writer.js +30 -0
- package/dist/services/hooks/auto-compact-hook-install.d.ts +104 -0
- package/dist/services/hooks/auto-compact-hook-install.js +157 -0
- package/dist/services/hooks/output.d.ts +92 -0
- package/dist/services/hooks/output.js +111 -0
- package/dist/services/hooks/presence-marker-detector.d.ts +16 -0
- package/dist/services/hooks/presence-marker-detector.js +105 -0
- package/dist/services/ide/adapters/claude-code-adapter.d.ts +18 -0
- package/dist/services/ide/adapters/claude-code-adapter.js +103 -0
- package/dist/services/ide/adapters/codex-adapter.d.ts +46 -0
- package/dist/services/ide/adapters/codex-adapter.js +97 -0
- package/dist/services/ide/adapters/cursor-adapter.d.ts +36 -0
- package/dist/services/ide/adapters/cursor-adapter.js +84 -0
- package/dist/services/ide/adapters/hermes-adapter.d.ts +21 -0
- package/dist/services/ide/adapters/hermes-adapter.js +51 -0
- package/dist/services/ide/adapters/openclaw-adapter.d.ts +14 -0
- package/dist/services/ide/adapters/openclaw-adapter.js +42 -0
- package/dist/services/ide/adapters/trae-adapter.d.ts +42 -0
- package/dist/services/ide/adapters/trae-adapter.js +83 -0
- package/dist/services/ide/adapters/zcode-adapter.d.ts +40 -0
- package/dist/services/ide/adapters/zcode-adapter.js +220 -0
- package/dist/services/ide/current-model-detector.d.ts +14 -0
- package/dist/services/ide/current-model-detector.js +60 -0
- package/dist/services/ide/hook-protocol.d.ts +47 -0
- package/dist/services/ide/hook-protocol.js +74 -0
- package/dist/services/ide/hook-translator.d.ts +72 -0
- package/dist/services/ide/hook-translator.js +128 -0
- package/dist/services/ide/ide-detector.d.ts +10 -0
- package/dist/services/ide/ide-detector.js +19 -0
- package/dist/services/ide/ide-registry.d.ts +14 -0
- package/dist/services/ide/ide-registry.js +63 -0
- package/dist/services/ide/ide-types.d.ts +253 -0
- package/dist/services/ide/ide-types.js +2 -0
- package/dist/services/ide/resource-profile.d.ts +52 -0
- package/dist/services/ide/resource-profile.js +33 -0
- package/dist/services/ide/shared/atomic-json.d.ts +15 -0
- package/dist/services/ide/shared/atomic-json.js +58 -0
- package/dist/services/ide/shared/safe-path.d.ts +11 -0
- package/dist/services/ide/shared/safe-path.js +29 -0
- package/dist/services/impact/impact-scan-service.d.ts +66 -0
- package/dist/services/impact/impact-scan-service.js +197 -0
- package/dist/services/job/job-event-emitter.d.ts +30 -0
- package/dist/services/job/job-event-emitter.js +5 -0
- package/dist/services/job/job-orchestrator.d.ts +50 -0
- package/dist/services/job/job-orchestrator.js +104 -0
- package/dist/services/job/job-progress-store.d.ts +60 -0
- package/dist/services/job/job-progress-store.js +70 -0
- package/dist/services/job/job-resource-snapshot.d.ts +7 -0
- package/dist/services/job/job-resource-snapshot.js +75 -0
- package/dist/services/job/job-rotation.d.ts +17 -0
- package/dist/services/job/job-rotation.js +30 -0
- package/dist/services/job/job-state-store.d.ts +24 -0
- package/dist/services/job/job-state-store.js +60 -0
- package/dist/services/job/job-types.d.ts +444 -0
- package/dist/services/job/job-types.js +87 -0
- package/dist/services/job/subagent-job-wrapper.d.ts +35 -0
- package/dist/services/job/subagent-job-wrapper.js +30 -0
- package/dist/services/legacy/legacy-detector.d.ts +34 -0
- package/dist/services/legacy/legacy-detector.js +111 -0
- package/dist/services/log/log-commands-service.d.ts +54 -0
- package/dist/services/log/log-commands-service.js +83 -0
- package/dist/services/log/logger.d.ts +103 -0
- package/dist/services/log/logger.js +224 -0
- package/dist/services/log/redact.d.ts +32 -0
- package/dist/services/log/redact.js +89 -0
- package/dist/services/log/retention.d.ts +34 -0
- package/dist/services/log/retention.js +78 -0
- package/dist/services/loop/evaluator-dispatcher.d.ts +50 -0
- package/dist/services/loop/evaluator-dispatcher.js +552 -0
- package/dist/services/loop/loop-bee-relation-service.d.ts +107 -0
- package/dist/services/loop/loop-bee-relation-service.js +211 -0
- package/dist/services/loop/loop-bee-relation-store.d.ts +53 -0
- package/dist/services/loop/loop-bee-relation-store.js +130 -0
- package/dist/services/loop/loop-bee-relation-types.d.ts +118 -0
- package/dist/services/loop/loop-bee-relation-types.js +114 -0
- package/dist/services/loop/loop-release-service.d.ts +46 -0
- package/dist/services/loop/loop-release-service.js +66 -0
- package/dist/services/loop/loop-release-store.d.ts +55 -0
- package/dist/services/loop/loop-release-store.js +134 -0
- package/dist/services/loop/loop-release-types.d.ts +250 -0
- package/dist/services/loop/loop-release-types.js +162 -0
- package/dist/services/loop/monotonic-guard.d.ts +80 -0
- package/dist/services/loop/monotonic-guard.js +232 -0
- package/dist/services/loop/monotonic-runner.d.ts +58 -0
- package/dist/services/loop/monotonic-runner.js +231 -0
- package/dist/services/loop/run-driver.d.ts +70 -0
- package/dist/services/loop/run-driver.js +400 -0
- package/dist/services/loop/spec-service.d.ts +90 -0
- package/dist/services/loop/spec-service.js +497 -0
- package/dist/services/memory/llm-reranker.d.ts +174 -0
- package/dist/services/memory/llm-reranker.js +284 -0
- package/dist/services/memory/memory-search-service.d.ts +93 -0
- package/dist/services/memory/memory-search-service.js +117 -0
- package/dist/services/memory/project-context-service.d.ts +21 -0
- package/dist/services/memory/project-context-service.js +161 -0
- package/dist/services/memory/project-memory-service.d.ts +167 -0
- package/dist/services/memory/project-memory-service.js +817 -0
- package/dist/services/migrate-skill-name/migrate.d.ts +17 -0
- package/dist/services/migrate-skill-name/migrate.js +152 -0
- package/dist/services/migrate-skill-name/schema.d.ts +42 -0
- package/dist/services/migrate-skill-name/schema.js +25 -0
- package/dist/services/migration/v2-10-to-v2-11-service.d.ts +44 -0
- package/dist/services/migration/v2-10-to-v2-11-service.js +190 -0
- package/dist/services/migration/v2-10-to-v2-11-types.d.ts +41 -0
- package/dist/services/migration/v2-10-to-v2-11-types.js +23 -0
- package/dist/services/mode/bypass-tracker.d.ts +4 -0
- package/dist/services/mode/bypass-tracker.js +31 -0
- package/dist/services/mode/mode-enforcement.d.ts +14 -0
- package/dist/services/mode/mode-enforcement.js +84 -0
- package/dist/services/mut/assert-scanner.d.ts +6 -0
- package/dist/services/mut/assert-scanner.js +116 -0
- package/dist/services/mut/index.d.ts +8 -0
- package/dist/services/mut/index.js +7 -0
- package/dist/services/mut/mut-runner.d.ts +39 -0
- package/dist/services/mut/mut-runner.js +29 -0
- package/dist/services/mut/production-stryker.d.ts +2 -0
- package/dist/services/mut/production-stryker.js +75 -0
- package/dist/services/mut/report-builder.d.ts +11 -0
- package/dist/services/mut/report-builder.js +110 -0
- package/dist/services/mut/report-loader.d.ts +31 -0
- package/dist/services/mut/report-loader.js +78 -0
- package/dist/services/mut/thresholds.d.ts +21 -0
- package/dist/services/mut/thresholds.js +22 -0
- package/dist/services/mut/types.d.ts +336 -0
- package/dist/services/mut/types.js +59 -0
- package/dist/services/observability/aggregation.d.ts +64 -0
- package/dist/services/observability/aggregation.js +217 -0
- package/dist/services/observability/jsonl-store.d.ts +59 -0
- package/dist/services/observability/jsonl-store.js +120 -0
- package/dist/services/observability/observability-service.d.ts +95 -0
- package/dist/services/observability/observability-service.js +119 -0
- package/dist/services/observability/report-formatter.d.ts +42 -0
- package/dist/services/observability/report-formatter.js +156 -0
- package/dist/services/openspec/openspec-archive-service.d.ts +12 -0
- package/dist/services/openspec/openspec-archive-service.js +28 -0
- package/dist/services/openspec/openspec-bridge-service.d.ts +16 -0
- package/dist/services/openspec/openspec-bridge-service.js +76 -0
- package/dist/services/openspec/openspec-init-service.d.ts +23 -0
- package/dist/services/openspec/openspec-init-service.js +122 -0
- package/dist/services/openspec/openspec-propose-from-doctor-service.d.ts +31 -0
- package/dist/services/openspec/openspec-propose-from-doctor-service.js +95 -0
- package/dist/services/openspec/openspec-render-service.d.ts +38 -0
- package/dist/services/openspec/openspec-render-service.js +130 -0
- package/dist/services/openspec/openspec-scan-service.d.ts +6 -0
- package/dist/services/openspec/openspec-scan-service.js +123 -0
- package/dist/services/openspec/openspec-types.d.ts +39 -0
- package/dist/services/openspec/openspec-types.js +1 -0
- package/dist/services/openspec/openspec-validate-service.d.ts +27 -0
- package/dist/services/openspec/openspec-validate-service.js +77 -0
- package/dist/services/perf/perf-baseline-service.d.ts +70 -0
- package/dist/services/perf/perf-baseline-service.js +214 -0
- package/dist/services/polyrepo/polyrepo-dispatcher.d.ts +34 -0
- package/dist/services/polyrepo/polyrepo-dispatcher.js +119 -0
- package/dist/services/polyrepo/polyrepo-scanner.d.ts +9 -0
- package/dist/services/polyrepo/polyrepo-scanner.js +94 -0
- package/dist/services/polyrepo/polyrepo-service.d.ts +34 -0
- package/dist/services/polyrepo/polyrepo-service.js +49 -0
- package/dist/services/polyrepo/polyrepo-types.d.ts +55 -0
- package/dist/services/polyrepo/polyrepo-types.js +1 -0
- package/dist/services/prd/handoff-auto-regen.d.ts +22 -0
- package/dist/services/prd/handoff-auto-regen.js +73 -0
- package/dist/services/prd/handoff-service.d.ts +54 -0
- package/dist/services/prd/handoff-service.js +142 -0
- package/dist/services/prd/handoff-types.d.ts +64 -0
- package/dist/services/prd/handoff-types.js +22 -0
- package/dist/services/prd/prd-blocks-checker.d.ts +51 -0
- package/dist/services/prd/prd-blocks-checker.js +130 -0
- package/dist/services/prd/project-scan-bootstrap-service.d.ts +52 -0
- package/dist/services/prd/project-scan-bootstrap-service.js +445 -0
- package/dist/services/prd/project-scan-reader.d.ts +24 -0
- package/dist/services/prd/project-scan-reader.js +150 -0
- package/dist/services/prd/project-scan-sediment.d.ts +97 -0
- package/dist/services/prd/project-scan-sediment.js +445 -0
- package/dist/services/prd/project-scan-types.d.ts +66 -0
- package/dist/services/prd/project-scan-types.js +20 -0
- package/dist/services/preferences/preferences-service.d.ts +38 -0
- package/dist/services/preferences/preferences-service.js +198 -0
- package/dist/services/preferences/preferences-types.d.ts +148 -0
- package/dist/services/preferences/preferences-types.js +53 -0
- package/dist/services/profiles/profile-service.d.ts +6 -0
- package/dist/services/profiles/profile-service.js +19 -0
- package/dist/services/progress/progress-service.d.ts +125 -0
- package/dist/services/progress/progress-service.js +192 -0
- package/dist/services/providers/minimax-provider-service.d.ts +24 -0
- package/dist/services/providers/minimax-provider-service.js +143 -0
- package/dist/services/providers/minimax-worker-service.d.ts +21 -0
- package/dist/services/providers/minimax-worker-service.js +83 -0
- package/dist/services/proxy/proxy-service.d.ts +7 -0
- package/dist/services/proxy/proxy-service.js +31 -0
- package/dist/services/qa/browser-event-logger.d.ts +40 -0
- package/dist/services/qa/browser-event-logger.js +54 -0
- package/dist/services/qa/browser-restart-detector.d.ts +74 -0
- package/dist/services/qa/browser-restart-detector.js +138 -0
- package/dist/services/qa/browser-reuse-hint.d.ts +18 -0
- package/dist/services/qa/browser-reuse-hint.js +18 -0
- package/dist/services/qa/browser-wrapper-service.d.ts +37 -0
- package/dist/services/qa/browser-wrapper-service.js +88 -0
- package/dist/services/qa/qa-business-review-state.d.ts +47 -0
- package/dist/services/qa/qa-business-review-state.js +96 -0
- package/dist/services/rd/ast-gate.d.ts +19 -0
- package/dist/services/rd/ast-gate.js +71 -0
- package/dist/services/rd/impl.d.ts +9 -0
- package/dist/services/rd/impl.js +57 -0
- package/dist/services/rd/rd-service.d.ts +129 -0
- package/dist/services/rd/rd-service.js +441 -0
- package/dist/services/rd/reviewer-dispatch-policy.d.ts +122 -0
- package/dist/services/rd/reviewer-dispatch-policy.js +148 -0
- package/dist/services/rd/standards-diagnostic.d.ts +76 -0
- package/dist/services/rd/standards-diagnostic.js +166 -0
- package/dist/services/rd/strategic-stage.d.ts +4 -0
- package/dist/services/rd/strategic-stage.js +15 -0
- package/dist/services/rd/strategy.d.ts +13 -0
- package/dist/services/rd/strategy.js +60 -0
- package/dist/services/rd/tactical-stage.d.ts +33 -0
- package/dist/services/rd/tactical-stage.js +62 -0
- package/dist/services/rd/types.d.ts +252 -0
- package/dist/services/rd/types.js +47 -0
- package/dist/services/recommendations/capability-availability.d.ts +5 -0
- package/dist/services/recommendations/capability-availability.js +40 -0
- package/dist/services/recommendations/capability-map-service.d.ts +7 -0
- package/dist/services/recommendations/capability-map-service.js +131 -0
- package/dist/services/recommendations/capability-seed-items.d.ts +2 -0
- package/dist/services/recommendations/capability-seed-items.js +140 -0
- package/dist/services/recommendations/capability-seed-mappings.d.ts +2 -0
- package/dist/services/recommendations/capability-seed-mappings.js +54 -0
- package/dist/services/recommendations/capability-seed-sources.d.ts +2 -0
- package/dist/services/recommendations/capability-seed-sources.js +35 -0
- package/dist/services/recommendations/recommendation-service.d.ts +8 -0
- package/dist/services/recommendations/recommendation-service.js +106 -0
- package/dist/services/recommendations/recommendation-types.d.ts +129 -0
- package/dist/services/recommendations/recommendation-types.js +1 -0
- package/dist/services/recommendations/seed-capability-catalog.d.ts +3 -0
- package/dist/services/recommendations/seed-capability-catalog.js +3 -0
- package/dist/services/refactor/refactor-service.d.ts +9 -0
- package/dist/services/refactor/refactor-service.js +36 -0
- package/dist/services/release/release-state.d.ts +70 -0
- package/dist/services/release/release-state.js +140 -0
- package/dist/services/retrospective/retrospective-index.d.ts +37 -0
- package/dist/services/retrospective/retrospective-index.js +110 -0
- package/dist/services/retrospective/retrospective-search-service.d.ts +55 -0
- package/dist/services/retrospective/retrospective-search-service.js +107 -0
- package/dist/services/retrospective/retrospective-show.d.ts +40 -0
- package/dist/services/retrospective/retrospective-show.js +109 -0
- package/dist/services/reviewer/model-family.d.ts +18 -0
- package/dist/services/reviewer/model-family.js +70 -0
- package/dist/services/reviewer/providers/anthropic.d.ts +2 -0
- package/dist/services/reviewer/providers/anthropic.js +61 -0
- package/dist/services/reviewer/providers/ollama.d.ts +26 -0
- package/dist/services/reviewer/providers/ollama.js +38 -0
- package/dist/services/reviewer/providers/openai.d.ts +2 -0
- package/dist/services/reviewer/providers/openai.js +63 -0
- package/dist/services/reviewer/reviewer-config.d.ts +34 -0
- package/dist/services/reviewer/reviewer-config.js +100 -0
- package/dist/services/reviewer/reviewer-service.d.ts +56 -0
- package/dist/services/reviewer/reviewer-service.js +263 -0
- package/dist/services/reviewer/selection-strategies.d.ts +27 -0
- package/dist/services/reviewer/selection-strategies.js +53 -0
- package/dist/services/role/role-registry.d.ts +38 -0
- package/dist/services/role/role-registry.js +83 -0
- package/dist/services/runtime/runtime-detector.d.ts +15 -0
- package/dist/services/runtime/runtime-detector.js +62 -0
- package/dist/services/runtime/runtime-service.d.ts +59 -0
- package/dist/services/runtime/runtime-service.js +51 -0
- package/dist/services/runtime/vendor-adapter.d.ts +59 -0
- package/dist/services/runtime/vendor-adapter.js +1 -0
- package/dist/services/runtime/vendors/claude-code.d.ts +7 -0
- package/dist/services/runtime/vendors/claude-code.js +39 -0
- package/dist/services/runtime/vendors/codex.d.ts +7 -0
- package/dist/services/runtime/vendors/codex.js +43 -0
- package/dist/services/runtime/vendors/copilot.d.ts +7 -0
- package/dist/services/runtime/vendors/copilot.js +40 -0
- package/dist/services/sc/index.d.ts +1 -0
- package/dist/services/sc/index.js +1 -0
- package/dist/services/sc/sc-service.d.ts +131 -0
- package/dist/services/sc/sc-service.js +552 -0
- package/dist/services/scan/acceptance-coverage-service.d.ts +42 -0
- package/dist/services/scan/acceptance-coverage-service.js +140 -0
- package/dist/services/scan/api-surface-service.d.ts +69 -0
- package/dist/services/scan/api-surface-service.js +239 -0
- package/dist/services/scan/archetype-service.d.ts +5 -0
- package/dist/services/scan/archetype-service.js +254 -0
- package/dist/services/scan/diff-scope-service.d.ts +40 -0
- package/dist/services/scan/diff-scope-service.js +198 -0
- package/dist/services/scan/existing-system-service.d.ts +7 -0
- package/dist/services/scan/existing-system-service.js +300 -0
- package/dist/services/scan/file-size-scan.d.ts +23 -0
- package/dist/services/scan/file-size-scan.js +68 -0
- package/dist/services/scan/karpathy-service.d.ts +60 -0
- package/dist/services/scan/karpathy-service.js +228 -0
- package/dist/services/scan/libraries-service.d.ts +24 -0
- package/dist/services/scan/libraries-service.js +419 -0
- package/dist/services/scan/libraries-types.d.ts +59 -0
- package/dist/services/scan/libraries-types.js +9 -0
- package/dist/services/scan/orphan-service.d.ts +76 -0
- package/dist/services/scan/orphan-service.js +538 -0
- package/dist/services/scan/scan-types.d.ts +59 -0
- package/dist/services/scan/scan-types.js +1 -0
- package/dist/services/scan/type-sanity-service.d.ts +23 -0
- package/dist/services/scan/type-sanity-service.js +116 -0
- package/dist/services/security/safe-settings-path.d.ts +12 -0
- package/dist/services/security/safe-settings-path.js +104 -0
- package/dist/services/sediment/dispose-confirm.d.ts +9 -0
- package/dist/services/sediment/dispose-confirm.js +5 -0
- package/dist/services/sediment/json-schema.d.ts +247 -0
- package/dist/services/sediment/json-schema.js +26 -0
- package/dist/services/sediment/manifest-lint.d.ts +13 -0
- package/dist/services/sediment/manifest-lint.js +11 -0
- package/dist/services/sediment/pool-paths.d.ts +22 -0
- package/dist/services/sediment/pool-paths.js +25 -0
- package/dist/services/sediment/pool-read.d.ts +20 -0
- package/dist/services/sediment/pool-read.js +73 -0
- package/dist/services/sediment/pool-rebuild-index.d.ts +15 -0
- package/dist/services/sediment/pool-rebuild-index.js +28 -0
- package/dist/services/sediment/pool-write.d.ts +14 -0
- package/dist/services/sediment/pool-write.js +25 -0
- package/dist/services/sediment/promotion-gate.d.ts +12 -0
- package/dist/services/sediment/promotion-gate.js +20 -0
- package/dist/services/sediment/types.d.ts +52 -0
- package/dist/services/sediment/types.js +1 -0
- package/dist/services/session/binding-status-service.d.ts +56 -0
- package/dist/services/session/binding-status-service.js +106 -0
- package/dist/services/session/binding-store.d.ts +161 -0
- package/dist/services/session/binding-store.js +509 -0
- package/dist/services/session/caller-binding-service.d.ts +70 -0
- package/dist/services/session/caller-binding-service.js +148 -0
- package/dist/services/session/caller-id-types.d.ts +77 -0
- package/dist/services/session/caller-id-types.js +46 -0
- package/dist/services/session/getSessionDir.d.ts +1 -0
- package/dist/services/session/getSessionDir.js +27 -0
- package/dist/services/session/index.d.ts +6 -0
- package/dist/services/session/index.js +7 -0
- package/dist/services/session/platform-fallbacks.d.ts +31 -0
- package/dist/services/session/platform-fallbacks.js +35 -0
- package/dist/services/session/resolve-caller-id.d.ts +57 -0
- package/dist/services/session/resolve-caller-id.js +88 -0
- package/dist/services/session/session-binding-bridge.d.ts +76 -0
- package/dist/services/session/session-binding-bridge.js +247 -0
- package/dist/services/session/session-checkpoint-service.d.ts +57 -0
- package/dist/services/session/session-checkpoint-service.js +143 -0
- package/dist/services/session/session-manager.d.ts +168 -0
- package/dist/services/session/session-manager.js +502 -0
- package/dist/services/session/session-resume-service.d.ts +25 -0
- package/dist/services/session/session-resume-service.js +101 -0
- package/dist/services/share/bundle-reader.d.ts +100 -0
- package/dist/services/share/bundle-reader.js +434 -0
- package/dist/services/share/bundle-types.d.ts +392 -0
- package/dist/services/share/bundle-types.js +318 -0
- package/dist/services/share/bundle-writer.d.ts +97 -0
- package/dist/services/share/bundle-writer.js +429 -0
- package/dist/services/share/run-state-contract.d.ts +133 -0
- package/dist/services/share/run-state-contract.js +138 -0
- package/dist/services/signal/cancel-handler.d.ts +14 -0
- package/dist/services/signal/cancel-handler.js +76 -0
- package/dist/services/skill/resume-detector.d.ts +54 -0
- package/dist/services/skill/resume-detector.js +334 -0
- package/dist/services/skill/skill-scheduler.d.ts +40 -0
- package/dist/services/skill/skill-scheduler.js +53 -0
- package/dist/services/skill/skill-search-service.d.ts +88 -0
- package/dist/services/skill/skill-search-service.js +228 -0
- package/dist/services/skillhub/release-diff.d.ts +18 -0
- package/dist/services/skillhub/release-diff.js +38 -0
- package/dist/services/skillhub/release-export.d.ts +8 -0
- package/dist/services/skillhub/release-export.js +31 -0
- package/dist/services/skillhub/release-gc-blobs.d.ts +13 -0
- package/dist/services/skillhub/release-gc-blobs.js +32 -0
- package/dist/services/skillhub/release-import.d.ts +7 -0
- package/dist/services/skillhub/release-import.js +64 -0
- package/dist/services/skillhub/release-retain.d.ts +23 -0
- package/dist/services/skillhub/release-retain.js +94 -0
- package/dist/services/skillhub/sqlite-store.d.ts +22 -0
- package/dist/services/skillhub/sqlite-store.js +63 -0
- package/dist/services/skillhub/tar-runtime.d.ts +21 -0
- package/dist/services/skillhub/tar-runtime.js +91 -0
- package/dist/services/skillhub/types.d.ts +115 -0
- package/dist/services/skillhub/types.js +1 -0
- package/dist/services/skills/hooks-settings-service.d.ts +137 -0
- package/dist/services/skills/hooks-settings-service.js +396 -0
- package/dist/services/skills/skill-conformance-service.d.ts +40 -0
- package/dist/services/skills/skill-conformance-service.js +139 -0
- package/dist/services/skills/skill-presence-service.d.ts +158 -0
- package/dist/services/skills/skill-presence-service.js +474 -0
- package/dist/services/skills/skill-registry.d.ts +17 -0
- package/dist/services/skills/skill-registry.js +67 -0
- package/dist/services/skills/skill-runbook-service.d.ts +11 -0
- package/dist/services/skills/skill-runbook-service.js +128 -0
- package/dist/services/skills/skill-statusline-renderer.d.ts +6 -0
- package/dist/services/skills/skill-statusline-renderer.js +55 -0
- package/dist/services/skills/skill-statusline-service.d.ts +24 -0
- package/dist/services/skills/skill-statusline-service.js +110 -0
- package/dist/services/skills/statusline-settings-service.d.ts +59 -0
- package/dist/services/skills/statusline-settings-service.js +141 -0
- package/dist/services/skills/sync-service.d.ts +86 -0
- package/dist/services/skills/sync-service.js +271 -0
- package/dist/services/slice/calibration-store.d.ts +39 -0
- package/dist/services/slice/calibration-store.js +68 -0
- package/dist/services/slice/cross-pass-edge-merger.d.ts +53 -0
- package/dist/services/slice/cross-pass-edge-merger.js +246 -0
- package/dist/services/slice/granularity-decider.d.ts +37 -0
- package/dist/services/slice/granularity-decider.js +40 -0
- package/dist/services/slice/llm-arbitrator.d.ts +35 -0
- package/dist/services/slice/llm-arbitrator.js +63 -0
- package/dist/services/slice/multi-pass-orchestrator.d.ts +67 -0
- package/dist/services/slice/multi-pass-orchestrator.js +225 -0
- package/dist/services/slice/schema-router.d.ts +44 -0
- package/dist/services/slice/schema-router.js +61 -0
- package/dist/services/slice/slice-archive-service.d.ts +20 -0
- package/dist/services/slice/slice-archive-service.js +111 -0
- package/dist/services/slice/slice-benchmark-service.d.ts +19 -0
- package/dist/services/slice/slice-benchmark-service.js +60 -0
- package/dist/services/slice/slice-check-service.d.ts +2 -0
- package/dist/services/slice/slice-check-service.js +459 -0
- package/dist/services/slice/slice-check-types.d.ts +104 -0
- package/dist/services/slice/slice-check-types.js +28 -0
- package/dist/services/slice/slice-decompose-runners.d.ts +23 -0
- package/dist/services/slice/slice-decompose-runners.js +174 -0
- package/dist/services/slice/slice-decompose-service.d.ts +24 -0
- package/dist/services/slice/slice-decompose-service.js +532 -0
- package/dist/services/slice/slice-decompose-types.d.ts +263 -0
- package/dist/services/slice/slice-decompose-types.js +30 -0
- package/dist/services/slice/slice-integration.d.ts +43 -0
- package/dist/services/slice/slice-integration.js +106 -0
- package/dist/services/slice/slice-pick-service.d.ts +32 -0
- package/dist/services/slice/slice-pick-service.js +75 -0
- package/dist/services/slice/slice-review-state.d.ts +70 -0
- package/dist/services/slice/slice-review-state.js +109 -0
- package/dist/services/slice/slice-topology-types.d.ts +115 -0
- package/dist/services/slice/slice-topology-types.js +20 -0
- package/dist/services/smoke/smoke-paths-state.d.ts +73 -0
- package/dist/services/smoke/smoke-paths-state.js +117 -0
- package/dist/services/sop/gate-enforce-service.d.ts +33 -0
- package/dist/services/sop/gate-enforce-service.js +168 -0
- package/dist/services/sop/sop-advance-service.d.ts +74 -0
- package/dist/services/sop/sop-advance-service.js +115 -0
- package/dist/services/sop/sop-check-service.d.ts +45 -0
- package/dist/services/sop/sop-check-service.js +181 -0
- package/dist/services/sop/sop-paths.d.ts +62 -0
- package/dist/services/sop/sop-paths.js +92 -0
- package/dist/services/sop/sop-registry-service.d.ts +46 -0
- package/dist/services/sop/sop-registry-service.js +89 -0
- package/dist/services/sop/sop-service.d.ts +55 -0
- package/dist/services/sop/sop-service.js +222 -0
- package/dist/services/sop/sop-types.d.ts +95 -0
- package/dist/services/sop/sop-types.js +11 -0
- package/dist/services/standards/ide-aware-standards-service.d.ts +94 -0
- package/dist/services/standards/ide-aware-standards-service.js +91 -0
- package/dist/services/standards/loop-engineering-lint.d.ts +38 -0
- package/dist/services/standards/loop-engineering-lint.js +101 -0
- package/dist/services/standards/loop-engineering-readiness-lint.d.ts +111 -0
- package/dist/services/standards/loop-engineering-readiness-lint.js +248 -0
- package/dist/services/standards/migrate-claude-rules-service.d.ts +19 -0
- package/dist/services/standards/migrate-claude-rules-service.js +214 -0
- package/dist/services/standards/migrate-service.d.ts +63 -0
- package/dist/services/standards/migrate-service.js +193 -0
- package/dist/services/standards/missing-standards-detector.d.ts +81 -0
- package/dist/services/standards/missing-standards-detector.js +139 -0
- package/dist/services/standards/project-context.d.ts +24 -0
- package/dist/services/standards/project-context.js +314 -0
- package/dist/services/standards/project-standards-service.d.ts +114 -0
- package/dist/services/standards/project-standards-service.js +693 -0
- package/dist/services/tech/tech-service.d.ts +69 -0
- package/dist/services/tech/tech-service.js +299 -0
- package/dist/services/test-cache/test-cache-service.d.ts +70 -0
- package/dist/services/test-cache/test-cache-service.js +175 -0
- package/dist/services/understand/hybrid-types.d.ts +32 -0
- package/dist/services/understand/hybrid-types.js +1 -0
- package/dist/services/understand/understand-hybrid-service.d.ts +10 -0
- package/dist/services/understand/understand-hybrid-service.js +100 -0
- package/dist/services/understand/understand-scan-service.d.ts +28 -0
- package/dist/services/understand/understand-scan-service.js +170 -0
- package/dist/services/understand/understand-types.d.ts +50 -0
- package/dist/services/understand/understand-types.js +1 -0
- package/dist/services/upgrade/1x-detector-service.d.ts +7 -0
- package/dist/services/upgrade/1x-detector-service.js +94 -0
- package/dist/services/upgrade/gitignore-migrate-service.d.ts +56 -0
- package/dist/services/upgrade/gitignore-migrate-service.js +170 -0
- package/dist/services/upgrade/upgrade-service.d.ts +81 -0
- package/dist/services/upgrade/upgrade-service.js +403 -0
- package/dist/services/verdict/envelopes.d.ts +93 -0
- package/dist/services/verdict/envelopes.js +349 -0
- package/dist/services/verdict/verdict-aggregator.d.ts +94 -0
- package/dist/services/verdict/verdict-aggregator.js +112 -0
- package/dist/services/workflow/artifact-paths.d.ts +59 -0
- package/dist/services/workflow/artifact-paths.js +166 -0
- package/dist/services/workflow/autonomous-resume-writer.d.ts +16 -0
- package/dist/services/workflow/autonomous-resume-writer.js +170 -0
- package/dist/services/workflow/pipeline-verify-service.d.ts +90 -0
- package/dist/services/workflow/pipeline-verify-service.js +449 -0
- package/dist/services/workflow/plan-reader.d.ts +29 -0
- package/dist/services/workflow/plan-reader.js +174 -0
- package/dist/services/workflow/plan-refresher.d.ts +32 -0
- package/dist/services/workflow/plan-refresher.js +353 -0
- package/dist/services/workflow/plan-trigger-detector.d.ts +55 -0
- package/dist/services/workflow/plan-trigger-detector.js +142 -0
- package/dist/services/workflow/workflow-autonomous-resume-helpers.d.ts +19 -0
- package/dist/services/workflow/workflow-autonomous-resume-helpers.js +300 -0
- package/dist/services/workflow/workflow-autonomous-service.d.ts +100 -0
- package/dist/services/workflow/workflow-autonomous-service.js +306 -0
- package/dist/services/workflow/workflow-loader.d.ts +63 -0
- package/dist/services/workflow/workflow-loader.js +168 -0
- package/dist/services/workflow/workflow-router-service.d.ts +85 -0
- package/dist/services/workflow/workflow-router-service.js +233 -0
- package/dist/services/workflow/workflow-skip-service.d.ts +106 -0
- package/dist/services/workflow/workflow-skip-service.js +209 -0
- package/dist/services/workflow/workflow-spec.d.ts +116 -0
- package/dist/services/workflow/workflow-spec.js +431 -0
- package/dist/services/workflow/workflow-state-store.d.ts +27 -0
- package/dist/services/workflow/workflow-state-store.js +95 -0
- package/dist/services/workspace/claude-settings-template.d.ts +101 -0
- package/dist/services/workspace/claude-settings-template.js +254 -0
- package/dist/services/workspace/migrate-1-4-1-service.d.ts +44 -0
- package/dist/services/workspace/migrate-1-4-1-service.js +195 -0
- package/dist/services/workspace/migrate-service.d.ts +2 -0
- package/dist/services/workspace/migrate-service.js +613 -0
- package/dist/services/workspace/migrate-types.d.ts +127 -0
- package/dist/services/workspace/migrate-types.js +21 -0
- package/dist/services/workspace/reconcile-service.d.ts +188 -0
- package/dist/services/workspace/reconcile-service.js +683 -0
- package/dist/services/workspace/reconcile-types.d.ts +130 -0
- package/dist/services/workspace/reconcile-types.js +13 -0
- package/dist/services/workspace/sid-naming-guard.d.ts +17 -0
- package/dist/services/workspace/sid-naming-guard.js +34 -0
- package/dist/services/workspace/templates/project-scan/audit-output-schema.md +100 -0
- package/dist/services/workspace/templates/project-scan/business-knowledge.md +44 -0
- package/dist/services/workspace/templates/project-scan/index.d.ts +34 -0
- package/dist/services/workspace/templates/project-scan/index.js +60 -0
- package/dist/services/workspace/templates/project-scan/perf-template.md +109 -0
- package/dist/services/workspace/templates/project-scan/security-template.md +99 -0
- package/dist/services/workspace/workspace-claude-settings-materializer.d.ts +45 -0
- package/dist/services/workspace/workspace-claude-settings-materializer.js +194 -0
- package/dist/services/workspace/workspace-clean-service.d.ts +28 -0
- package/dist/services/workspace/workspace-clean-service.js +46 -0
- package/dist/services/workspace/workspace-service.d.ts +177 -0
- package/dist/services/workspace/workspace-service.js +432 -0
- package/dist/services/workspace/workspace-state-service.d.ts +7 -0
- package/dist/services/workspace/workspace-state-service.js +43 -0
- package/dist/shared/format-md-compact.d.ts +32 -0
- package/dist/shared/format-md-compact.js +297 -0
- package/dist/shared/frontmatter.d.ts +6 -0
- package/dist/shared/frontmatter.js +165 -0
- package/dist/shared/fs-utils.d.ts +4 -0
- package/dist/shared/fs-utils.js +16 -0
- package/dist/shared/fs.d.ts +4 -0
- package/dist/shared/fs.js +26 -0
- package/dist/shared/incrementing-number.d.ts +23 -0
- package/dist/shared/incrementing-number.js +68 -0
- package/dist/shared/json-schema-mini.d.ts +10 -0
- package/dist/shared/json-schema-mini.js +113 -0
- package/dist/shared/path-safety.d.ts +21 -0
- package/dist/shared/path-safety.js +54 -0
- package/dist/shared/path-utils.d.ts +13 -0
- package/dist/shared/path-utils.js +56 -0
- package/dist/shared/paths.d.ts +6 -0
- package/dist/shared/paths.js +50 -0
- package/dist/shared/planner-response.d.ts +21 -0
- package/dist/shared/planner-response.js +26 -0
- package/dist/shared/platform.d.ts +6 -0
- package/dist/shared/platform.js +11 -0
- package/dist/shared/process.d.ts +5 -0
- package/dist/shared/process.js +12 -0
- package/dist/shared/result.d.ts +22 -0
- package/dist/shared/result.js +46 -0
- package/dist/shared/stale-policy.d.ts +67 -0
- package/dist/shared/stale-policy.js +85 -0
- package/dist/shared/version.d.ts +1 -0
- package/dist/shared/version.js +1 -0
- package/dist/skills/peaks-maker/index.d.ts +5 -0
- package/dist/skills/peaks-maker/index.js +32 -0
- package/package.json +5 -4
- package/scripts/copy-templates.mjs +1 -1
|
@@ -0,0 +1,552 @@
|
|
|
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-loop 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.ok) {
|
|
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.value;
|
|
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.ok) {
|
|
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.value;
|
|
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.ok) {
|
|
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.value;
|
|
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.ok) {
|
|
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.value;
|
|
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.ok) {
|
|
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.value;
|
|
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 { ok: false, reason: 'PARSE_ERROR' };
|
|
462
|
+
}
|
|
463
|
+
try {
|
|
464
|
+
return { ok: true, value: JSON.parse(raw) };
|
|
465
|
+
}
|
|
466
|
+
catch {
|
|
467
|
+
return { ok: false, reason: 'PARSE_ERROR' };
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
// Tiny ergonomic helper so we can re-emit an envelope with a different `kind`.
|
|
471
|
+
// (Implementation note: this is a free function rather than a method — the
|
|
472
|
+
// EvaluatorVerdictEnvelope interface is plain data, and adding methods via
|
|
473
|
+
// `declare module` makes TS treat them as required properties.)
|
|
474
|
+
export function envelopeAs(envelope, kind) {
|
|
475
|
+
return { ...envelope, kind };
|
|
476
|
+
}
|
|
477
|
+
// ─── Markdown → envelope fallbacks (used when peaks CLI is unavailable) ─
|
|
478
|
+
/**
|
|
479
|
+
* Best-effort markdown parse for karpathy-review.md / security.md / perf.md.
|
|
480
|
+
* Mirrors the shape accepted by `parseKarpathyEnvelope` /
|
|
481
|
+
* `parseSecurityEnvelope` / `parsePerfEnvelope` in `services/verdict/envelopes.ts`,
|
|
482
|
+
* keeping verdict-aggregator backward-compat intact.
|
|
483
|
+
*/
|
|
484
|
+
export function parseAuditMarkdownEnvelope(md, kind) {
|
|
485
|
+
if (typeof md !== 'string' || md.length === 0)
|
|
486
|
+
return null;
|
|
487
|
+
const verdict = matchVerdict(md);
|
|
488
|
+
if (verdict === null)
|
|
489
|
+
return null;
|
|
490
|
+
const violations = parseFindingBullets(md).map((b) => ({ ...b, dimension: kind }));
|
|
491
|
+
return {
|
|
492
|
+
kind,
|
|
493
|
+
passed: verdict === 'pass',
|
|
494
|
+
gateAction: verdict,
|
|
495
|
+
violations,
|
|
496
|
+
summary: extractSection(md, 'Summary') ?? '',
|
|
497
|
+
wallSeconds: 0,
|
|
498
|
+
degraded: true
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function matchVerdict(md) {
|
|
502
|
+
const m = md.match(/^\s*verdict\s*:\s*(pass|warn|block)\s*$/m);
|
|
503
|
+
if (m === null)
|
|
504
|
+
return null;
|
|
505
|
+
return m[1];
|
|
506
|
+
}
|
|
507
|
+
function parseFindingBullets(body) {
|
|
508
|
+
const section = body.split(/^##\s+Findings\s*$/m)[1];
|
|
509
|
+
if (section === undefined)
|
|
510
|
+
return [];
|
|
511
|
+
const lines = section.split('\n').filter((l) => l.trim().startsWith('- '));
|
|
512
|
+
const out = [];
|
|
513
|
+
for (const line of lines) {
|
|
514
|
+
const a = line.match(/^\s*-\s*\[(CRITICAL|HIGH|MED|LOW)\]\s+(\S+)\s+@\s+([^:\s]+):(\d+)\s+[—-]\s+(.+)$/);
|
|
515
|
+
if (a !== null) {
|
|
516
|
+
const [, severity, , file, lineNo, hint] = a;
|
|
517
|
+
out.push({ severity: severity, file: file ?? '<unknown>', line: parseInt(lineNo ?? '0', 10), hint: (hint ?? '').trim() });
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
const b = line.match(/^\s*-\s*(CRITICAL|HIGH|MED|LOW)\s*:\s+(.+?)\s+in\s+([^:\s]+):(\d+)\s*$/);
|
|
521
|
+
if (b !== null) {
|
|
522
|
+
const [, severity, hint, file, lineNo] = b;
|
|
523
|
+
out.push({ severity: severity, file: file ?? '<unknown>', line: parseInt(lineNo ?? '0', 10), hint: (hint ?? '').trim() });
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return out;
|
|
527
|
+
}
|
|
528
|
+
function extractSection(body, heading) {
|
|
529
|
+
const re = new RegExp(`^##\\s+${heading}\\s*$`, 'm');
|
|
530
|
+
const sectionStart = body.search(re);
|
|
531
|
+
if (sectionStart === -1)
|
|
532
|
+
return null;
|
|
533
|
+
const after = body.slice(sectionStart).split('\n');
|
|
534
|
+
after.shift();
|
|
535
|
+
const lines = [];
|
|
536
|
+
for (const line of after) {
|
|
537
|
+
if (/^##\s+/.test(line))
|
|
538
|
+
break;
|
|
539
|
+
lines.push(line);
|
|
540
|
+
}
|
|
541
|
+
return lines.join('\n').trim();
|
|
542
|
+
}
|
|
543
|
+
/** Load an on-disk audit file (e.g. `.peaks/_runtime/<sid>/audit/security.md`)
|
|
544
|
+
* and project it to an `EvaluatorVerdictEnvelope`. Used by workflow yaml
|
|
545
|
+
* evaluators that point at on-disk artifacts. */
|
|
546
|
+
export function loadEnvelopeFromDisk(projectRoot, sid, rel, kind) {
|
|
547
|
+
const path = join(projectRoot, '.peaks', '_runtime', sid, rel);
|
|
548
|
+
if (!existsSync(path))
|
|
549
|
+
return null;
|
|
550
|
+
const md = readFileSync(path, 'utf8');
|
|
551
|
+
return parseAuditMarkdownEnvelope(md, kind);
|
|
552
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type Database from "better-sqlite3";
|
|
2
|
+
import { ZodError } from "zod";
|
|
3
|
+
import { type LoopBeeRelation, type LoopBeeRelationInput, type LoopBeeRelationRole } from "./loop-bee-relation-types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Domain error thrown by LoopBeeRelationService when an invariant is
|
|
6
|
+
* violated. The error code is machine-readable; the message is
|
|
7
|
+
* NL-friendly. The CLI layer (M5) maps these into user-facing prompts.
|
|
8
|
+
*/
|
|
9
|
+
export type LoopBeeRelationIntegrityErrorCode = "LOOP_RETIRED" | "DUP_RELATION" | "TWO_MAIN_BEES" | "FK_LOOP_NOT_FOUND" | "FK_BEE_NOT_FOUND";
|
|
10
|
+
export declare class LoopBeeRelationIntegrityError extends Error {
|
|
11
|
+
readonly code: LoopBeeRelationIntegrityErrorCode;
|
|
12
|
+
readonly findings: ReadonlyArray<{
|
|
13
|
+
path: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
constructor(code: LoopBeeRelationIntegrityErrorCode, message: string, findings?: ReadonlyArray<{
|
|
17
|
+
path: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}>);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* LoopBeeRelationService — thin service over the loop_bee_relation
|
|
23
|
+
* store. M2 keeps the surface narrow: create / listByLoop / listByBee /
|
|
24
|
+
* updateRole / remove. Promotion, evaluation, and crystallization
|
|
25
|
+
* flows land in later slices.
|
|
26
|
+
*
|
|
27
|
+
* Integrity rules enforced here (spec §4.6 + RL-3):
|
|
28
|
+
*
|
|
29
|
+
* 1. The referenced loop_release row must exist (FK to loop_release.id).
|
|
30
|
+
* — enforced at DB level (FK constraint).
|
|
31
|
+
* — surfaced as FK_LOOP_NOT_FOUND for friendlier errors.
|
|
32
|
+
*
|
|
33
|
+
* 2. The referenced bee_release row must exist (FK to bee_release.id).
|
|
34
|
+
* — enforced at DB level (FK constraint).
|
|
35
|
+
* — surfaced as FK_BEE_NOT_FOUND for friendlier errors.
|
|
36
|
+
*
|
|
37
|
+
* 3. Cannot relate a bee to a retired loop.
|
|
38
|
+
* — enforced in service by checking loop_release.lifecycle_status.
|
|
39
|
+
* — Throws LoopBeeRelationIntegrityError(LOOP_RETIRED).
|
|
40
|
+
*
|
|
41
|
+
* 4. A loop cannot have two `main` bees.
|
|
42
|
+
* — enforced at DB level via partial unique index.
|
|
43
|
+
* — surfaced as TWO_MAIN_BEES for friendlier errors.
|
|
44
|
+
*
|
|
45
|
+
* 5. (loop_release_id, bee_release_id) must be unique per row.
|
|
46
|
+
* — enforced at DB level (UNIQUE).
|
|
47
|
+
* — surfaced as DUP_RELATION for friendlier errors.
|
|
48
|
+
*
|
|
49
|
+
* The constructor takes an open better-sqlite3 database (the existing
|
|
50
|
+
* `peaks state` boundary) so callers do not have to thread a path
|
|
51
|
+
* through this layer; this matches the LoopReleaseService pattern.
|
|
52
|
+
*
|
|
53
|
+
* All write paths re-validate the input via the Zod schema, mirroring
|
|
54
|
+
* the boundary-check discipline used elsewhere.
|
|
55
|
+
*/
|
|
56
|
+
export declare class LoopBeeRelationService {
|
|
57
|
+
private readonly db;
|
|
58
|
+
constructor(db: Database.Database);
|
|
59
|
+
/**
|
|
60
|
+
* Persist a new LoopBeeRelation row.
|
|
61
|
+
*
|
|
62
|
+
* Throws:
|
|
63
|
+
* - ZodError if the input fails schema validation.
|
|
64
|
+
* - LoopBeeRelationIntegrityError(LOOP_RETIRED) if the loop's
|
|
65
|
+
* lifecycle_status is "retired".
|
|
66
|
+
* - LoopBeeRelationIntegrityError(FK_LOOP_NOT_FOUND) if the loop
|
|
67
|
+
* row does not exist.
|
|
68
|
+
* - LoopBeeRelationIntegrityError(FK_BEE_NOT_FOUND) if the bee
|
|
69
|
+
* row does not exist.
|
|
70
|
+
* - LoopBeeRelationIntegrityError(DUP_RELATION) if a relation
|
|
71
|
+
* for the same (loop, bee) already exists.
|
|
72
|
+
* - LoopBeeRelationIntegrityError(TWO_MAIN_BEES) if a `main` row
|
|
73
|
+
* already exists for the loop.
|
|
74
|
+
*/
|
|
75
|
+
create(input: LoopBeeRelationInput): LoopBeeRelation;
|
|
76
|
+
/** Read a LoopBeeRelation row by id; returns undefined if absent. */
|
|
77
|
+
read(id: number): LoopBeeRelation | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* List relations for a given loop. Filter by `role` when supplied.
|
|
80
|
+
*/
|
|
81
|
+
listByLoop(opts: {
|
|
82
|
+
loop_release_id: string;
|
|
83
|
+
role?: LoopBeeRelationRole;
|
|
84
|
+
}): LoopBeeRelation[];
|
|
85
|
+
/**
|
|
86
|
+
* List relations for a given bee. Filter by `role` when supplied.
|
|
87
|
+
*/
|
|
88
|
+
listByBee(opts: {
|
|
89
|
+
bee_release_id: number;
|
|
90
|
+
role?: LoopBeeRelationRole;
|
|
91
|
+
}): LoopBeeRelation[];
|
|
92
|
+
/**
|
|
93
|
+
* Update the role of an existing relation. The storage-level partial
|
|
94
|
+
* unique index on `main` re-asserts "at most one main per loop" if
|
|
95
|
+
* the new role is `main`. Returns the updated row or undefined if
|
|
96
|
+
* the id is absent.
|
|
97
|
+
*/
|
|
98
|
+
updateRole(id: number, newRole: LoopBeeRelationRole): LoopBeeRelation | undefined;
|
|
99
|
+
/** Remove a relation by id. Returns true if a row was deleted. */
|
|
100
|
+
remove(id: number): boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Convenience: re-export the Zod error class guard so callers can do
|
|
104
|
+
* `if (err instanceof ZodError)`. Avoids forcing every caller to import
|
|
105
|
+
* zod directly.
|
|
106
|
+
*/
|
|
107
|
+
export declare function isZodError(err: unknown): err is ZodError;
|