peaks-loop 4.0.0-beta.9 → 4.0.1
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 +910 -141
- package/README-en.md +26 -7
- package/README.md +75 -6
- package/agents/karpathy-reviewer.md +33 -0
- package/bin/peaks.js +0 -0
- package/dist/cli/cli-helpers.d.ts +31 -6
- package/dist/cli/cli-helpers.js +48 -25
- package/dist/cli/commands/_register.d.ts +3 -0
- package/dist/cli/commands/_register.js +139 -0
- package/dist/cli/commands/_super.d.ts +10 -0
- package/dist/cli/commands/_super.js +97 -0
- package/dist/cli/commands/adapter-commands-s2a.js +1 -1
- package/dist/cli/commands/asset-commands.js +33 -16
- package/dist/cli/commands/audit-commands.js +2 -2
- package/dist/cli/commands/autonomous-swarm-commands.d.ts +12 -0
- package/dist/cli/commands/autonomous-swarm-commands.js +120 -0
- package/dist/cli/commands/bee-commands.js +1 -1
- package/dist/cli/commands/capability-commands.js +1 -1
- package/dist/cli/commands/capability-worker-config-sc-commands.js +0 -2
- package/dist/cli/commands/changeset-commands.d.ts +13 -0
- package/dist/cli/commands/changeset-commands.js +46 -0
- package/dist/cli/commands/code-commands.d.ts +11 -1
- package/dist/cli/commands/code-commands.js +19 -699
- package/dist/cli/commands/code-job-shape-commands.d.ts +9 -0
- package/dist/cli/commands/code-job-shape-commands.js +164 -0
- package/dist/cli/commands/code-mode-gate-commands.d.ts +9 -0
- package/dist/cli/commands/code-mode-gate-commands.js +223 -0
- package/dist/cli/commands/code-review-commands.js +2 -2
- package/dist/cli/commands/code-run-command.d.ts +12 -0
- package/dist/cli/commands/code-run-command.js +68 -0
- package/dist/cli/commands/code-runtime-commands.d.ts +11 -0
- package/dist/cli/commands/code-runtime-commands.js +391 -0
- package/dist/cli/commands/codegraph-commands.js +1 -1
- package/dist/cli/commands/compact-command.js +53 -1
- package/dist/cli/commands/complexity-commands.js +1 -1
- package/dist/cli/commands/config-commands.js +4 -75
- package/dist/cli/commands/container-commands.d.ts +28 -0
- package/dist/cli/commands/container-commands.js +221 -0
- package/dist/cli/commands/context-commands.js +3 -2
- package/dist/cli/commands/core/artifacts-command.js +1 -1
- package/dist/cli/commands/core/binding-commands.js +1 -1
- package/dist/cli/commands/core/doctor-command.js +63 -3
- package/dist/cli/commands/core/memory-command.js +1 -1
- package/dist/cli/commands/core/profile-command.js +1 -1
- package/dist/cli/commands/core/proxy-command.js +1 -1
- package/dist/cli/commands/core/session-command.js +9 -7
- package/dist/cli/commands/core/skill-command.js +7 -4
- package/dist/cli/commands/core/standards-command.js +1 -1
- package/dist/cli/commands/cron-commands.d.ts +57 -0
- package/dist/cli/commands/cron-commands.js +257 -0
- package/dist/cli/commands/cron-scheduler-commands.d.ts +47 -0
- package/dist/cli/commands/cron-scheduler-commands.js +284 -0
- package/dist/cli/commands/dashboard-commands.d.ts +4 -0
- package/dist/cli/commands/dashboard-commands.js +10 -0
- package/dist/cli/commands/dashboard-long-run.d.ts +25 -0
- package/dist/cli/commands/dashboard-long-run.js +122 -0
- package/dist/cli/commands/dashboard-summary.d.ts +12 -0
- package/dist/cli/commands/dashboard-summary.js +58 -0
- package/dist/cli/commands/dispatch-commands.d.ts +0 -7
- package/dist/cli/commands/dispatch-commands.js +372 -8
- package/dist/cli/commands/dispatch-from-dag.js +4 -1
- package/dist/cli/commands/doc-commands.js +1 -1
- package/dist/cli/commands/ecc-commands.d.ts +30 -0
- package/dist/cli/commands/ecc-commands.js +119 -0
- package/dist/cli/commands/evolution-commands.js +1 -1
- package/dist/cli/commands/feedback-commands.js +1 -1
- package/dist/cli/commands/final-review-commands.js +1 -1
- package/dist/cli/commands/fixture-commands.js +1 -1
- package/dist/cli/commands/fork-commands.js +1 -1
- package/dist/cli/commands/gate-commands.js +128 -6
- package/dist/cli/commands/governance-classify-contract-commands.d.ts +21 -0
- package/dist/cli/commands/governance-classify-contract-commands.js +273 -0
- package/dist/cli/commands/heartbeat-commands.js +76 -5
- package/dist/cli/commands/heartbeat-watch-command.d.ts +31 -0
- package/dist/cli/commands/heartbeat-watch-command.js +146 -0
- package/dist/cli/commands/hook-handle.js +1 -1
- package/dist/cli/commands/hooks-commands.js +126 -10
- package/dist/cli/commands/ide-commands.js +1 -1
- package/dist/cli/commands/impact-commands.js +1 -1
- package/dist/cli/commands/job-commands.js +34 -1
- package/dist/cli/commands/lease-metrics-commands.d.ts +67 -0
- package/dist/cli/commands/lease-metrics-commands.js +231 -0
- package/dist/cli/commands/lease-stats-commands.d.ts +65 -0
- package/dist/cli/commands/lease-stats-commands.js +107 -0
- package/dist/cli/commands/legacy-commands.js +1 -1
- package/dist/cli/commands/log-commands.js +1 -1
- package/dist/cli/commands/loop-commands.js +1 -1
- package/dist/cli/commands/loop-eval-commands.js +1 -1
- package/dist/cli/commands/memory-commands.js +1 -1
- package/dist/cli/commands/migrate-1-4-1-command.js +1 -1
- package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +1 -1
- package/dist/cli/commands/mut-commands.d.ts +1 -1
- package/dist/cli/commands/mut-commands.js +1 -5
- package/dist/cli/commands/observability-commands.js +1 -1
- package/dist/cli/commands/openspec-commands.js +65 -4
- package/dist/cli/commands/perf-audit-commands.js +3 -3
- package/dist/cli/commands/perf-commands.js +1 -1
- package/dist/cli/commands/polyrepo-commands.js +1 -1
- package/dist/cli/commands/prd-blocks-commands.js +1 -1
- package/dist/cli/commands/prd-commands.js +4 -2
- package/dist/cli/commands/preferences-commands.js +23 -3
- package/dist/cli/commands/project-commands.js +1 -1
- package/dist/cli/commands/qa-business-review-commands.js +1 -1
- package/dist/cli/commands/qa-commands.d.ts +1 -1
- package/dist/cli/commands/qa-commands.js +39 -3
- package/dist/cli/commands/release-commands.d.ts +15 -0
- package/dist/cli/commands/release-commands.js +113 -21
- package/dist/cli/commands/request-commands.js +1 -1
- package/dist/cli/commands/retrospective-commands.js +1 -1
- package/dist/cli/commands/reviewer-commands.js +1 -1
- package/dist/cli/commands/role-commands.js +1 -1
- package/dist/cli/commands/runtime-commands-helpers.d.ts +7 -0
- package/dist/cli/commands/runtime-commands-helpers.js +24 -0
- package/dist/cli/commands/runtime-commands.js +1 -2
- package/dist/cli/commands/sc-commands.js +4 -2
- package/dist/cli/commands/scan-commands.js +1 -1
- package/dist/cli/commands/security-audit-commands.js +3 -3
- package/dist/cli/commands/sediment-commands.js +10 -1
- package/dist/cli/commands/session-24h-mode.d.ts +26 -0
- package/dist/cli/commands/session-24h-mode.js +196 -0
- package/dist/cli/commands/share-commands.d.ts +19 -0
- package/dist/cli/commands/share-commands.js +121 -2
- package/dist/cli/commands/skill-conformance-commands.js +1 -1
- package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +1 -1
- package/dist/cli/commands/skill-search-commands.js +4 -1
- package/dist/cli/commands/slice-commands.js +1 -1
- package/dist/cli/commands/slice-integrate-commands.js +1 -1
- package/dist/cli/commands/slice-review-commands.js +1 -1
- package/dist/cli/commands/smoke-commands.js +1 -1
- package/dist/cli/commands/sop-commands.js +1 -1
- package/dist/cli/commands/spill-demo-command.d.ts +7 -0
- package/dist/cli/commands/spill-demo-command.js +29 -0
- package/dist/cli/commands/statusline-commands.d.ts +12 -0
- package/dist/cli/commands/statusline-commands.js +79 -17
- package/dist/cli/commands/sub-agent-commands.js +2 -1
- package/dist/cli/commands/sub-agent-shared.d.ts +10 -0
- package/dist/cli/commands/sub-agent-shared.js +24 -1
- package/dist/cli/commands/swarm-commands.d.ts +13 -0
- package/dist/cli/commands/swarm-commands.js +77 -0
- package/dist/cli/commands/tech-commands.d.ts +64 -0
- package/dist/cli/commands/tech-commands.js +195 -0
- package/dist/cli/commands/understand-commands.js +1 -1
- package/dist/cli/commands/upgrade-commands.d.ts +2 -0
- package/dist/cli/commands/upgrade-commands.js +40 -5
- package/dist/cli/commands/user-touchpoint-commands.js +1 -1
- package/dist/cli/commands/verdict-aggregate-command.js +1 -1
- package/dist/cli/commands/vm-commands.d.ts +31 -0
- package/dist/cli/commands/vm-commands.js +274 -0
- package/dist/cli/commands/workflow-commands.js +24 -1
- package/dist/cli/commands/workflow-plan-commands.js +1 -1
- package/dist/cli/commands/workspace/init-command.js +1 -1
- package/dist/cli/commands/workspace/migrate-command.js +1 -1
- package/dist/cli/commands/workspace/reconcile-command.js +1 -1
- package/dist/cli/commands/worktree-auth-commands.d.ts +29 -0
- package/dist/cli/commands/worktree-auth-commands.js +652 -0
- package/dist/cli/index.js +58 -13
- package/dist/cli/program.d.ts +2 -2
- package/dist/cli/program.js +86 -281
- package/dist/services/24h-mode/decider.d.ts +103 -0
- package/dist/services/24h-mode/decider.js +144 -0
- package/dist/services/24h-mode/index.d.ts +12 -0
- package/dist/services/24h-mode/index.js +12 -0
- package/dist/services/24h-mode/state.d.ts +48 -0
- package/dist/services/24h-mode/state.js +51 -0
- package/dist/services/24h-mode/store.d.ts +27 -0
- package/dist/services/24h-mode/store.js +119 -0
- package/dist/services/artifacts/artifact-prerequisites.js +1 -1
- package/dist/services/artifacts/request-artifact-service.js +1 -1
- package/dist/services/artifacts/workspace-service.js +1 -1
- package/dist/services/audit/enforcers/lint-bee-runtime-contract.d.ts +25 -0
- package/dist/services/audit/enforcers/lint-bee-runtime-contract.js +91 -0
- package/dist/services/audit/enforcers/lint-peaks-code-runtime.d.ts +16 -0
- package/dist/services/audit/enforcers/lint-peaks-code-runtime.js +31 -0
- package/dist/services/audit/enforcers/lint-peaks-skill-runtime.d.ts +23 -0
- package/dist/services/audit/enforcers/lint-peaks-skill-runtime.js +59 -0
- package/dist/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.d.ts +28 -0
- package/dist/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.js +86 -0
- package/dist/services/audit/enforcers/lint-prd-artifact-handoff.d.ts +16 -0
- package/dist/services/audit/enforcers/lint-prd-artifact-handoff.js +41 -0
- package/dist/services/audit/enforcers/lint-prd-source-snapshot.d.ts +27 -0
- package/dist/services/audit/enforcers/lint-prd-source-snapshot.js +47 -0
- package/dist/services/audit/enforcers/lint-qa-gateguard-and-runtime.d.ts +19 -0
- package/dist/services/audit/enforcers/lint-qa-gateguard-and-runtime.js +47 -0
- package/dist/services/audit/enforcers/lint-rd-handoff-coverage.d.ts +18 -0
- package/dist/services/audit/enforcers/lint-rd-handoff-coverage.js +70 -0
- package/dist/services/audit/enforcers/lint-skill-presence-mandatory.d.ts +25 -0
- package/dist/services/audit/enforcers/lint-skill-presence-mandatory.js +53 -0
- package/dist/services/audit/red-line-catalog-p2-a.d.ts +0 -6
- package/dist/services/audit/red-line-catalog-p2-a.js +230 -1
- package/dist/services/audit/static-service.d.ts +32 -25
- package/dist/services/audit/static-service.js +30 -109
- package/dist/services/audit-independent/index.d.ts +2 -0
- package/dist/services/audit-independent/index.js +2 -0
- package/dist/services/autonomous-swarm/autonomous-swarm-service.d.ts +127 -0
- package/dist/services/autonomous-swarm/autonomous-swarm-service.js +446 -0
- package/dist/services/changeset/changeset-check-service.d.ts +22 -0
- package/dist/services/changeset/changeset-check-service.js +47 -0
- package/dist/services/code/auto-compact-modes.d.ts +30 -0
- package/dist/services/code/auto-compact-modes.js +38 -0
- package/dist/services/code/auto-compact-orchestrator.d.ts +43 -5
- package/dist/services/code/auto-compact-orchestrator.js +101 -21
- package/dist/services/code/dag-orchestrator.d.ts +30 -1
- package/dist/services/code/dag-orchestrator.js +106 -1
- package/dist/services/code/status-line-renderer.d.ts +2 -0
- package/dist/services/code/status-line-renderer.js +21 -3
- package/dist/services/code-review/ocr-service.d.ts +1 -1
- package/dist/services/code-review/ocr-service.js +6 -3
- package/dist/services/compact-history/compact-history-service.d.ts +41 -0
- package/dist/services/compact-history/compact-history-service.js +62 -0
- package/dist/services/compact-statusline/compact-statusline-service.d.ts +16 -0
- package/dist/services/compact-statusline/compact-statusline-service.js +83 -0
- package/dist/services/config/config-service.d.ts +1 -12
- package/dist/services/config/config-service.js +3 -72
- package/dist/services/config/config-types.d.ts +2 -4
- package/dist/services/config/config-types.js +1 -1
- package/dist/services/container/container-lease.d.ts +67 -0
- package/dist/services/container/container-lease.js +135 -0
- package/dist/services/context/auto-compact-dispatcher.d.ts +40 -5
- package/dist/services/context/auto-compact-dispatcher.js +32 -102
- package/dist/services/context/auto-compact-reader.js +1 -1
- package/dist/services/context/auto-compact-types.d.ts +27 -2
- package/dist/services/context/auto-compact-types.js +8 -1
- package/dist/services/context/build-dispatch-system-prompt.d.ts +75 -0
- package/dist/services/context/build-dispatch-system-prompt.js +117 -0
- package/dist/services/context/collector.d.ts +2 -2
- package/dist/services/context/context-builder.d.ts +4 -4
- package/dist/services/context/context-schema.d.ts +48 -48
- package/dist/services/context/ide-detect.d.ts +4 -0
- package/dist/services/context/ide-detect.js +24 -0
- package/dist/services/context/main-session-monitor.d.ts +1 -4
- package/dist/services/context/main-session-monitor.js +1 -24
- package/dist/services/context/memory-index-reader.d.ts +8 -0
- package/dist/services/context/memory-index-reader.js +57 -0
- package/dist/services/context/memory-lru-cache.d.ts +12 -0
- package/dist/services/context/memory-lru-cache.js +60 -0
- package/dist/services/context/memory-preflight-config.d.ts +19 -0
- package/dist/services/context/memory-preflight-config.js +25 -0
- package/dist/services/context/memory-preflight-service.d.ts +19 -0
- package/dist/services/context/memory-preflight-service.js +120 -0
- package/dist/services/context/spillover-store.d.ts +23 -0
- package/dist/services/context/spillover-store.js +155 -0
- package/dist/services/context/spillover-types.d.ts +18 -0
- package/dist/services/context/spillover-types.js +1 -0
- package/dist/services/crystallization/crystallization-service.d.ts +22 -5
- package/dist/services/crystallization/crystallization-service.js +8 -14
- package/dist/services/crystallization/crystallization-types.d.ts +6 -6
- package/dist/services/crystallization/evidence-brief-builder.d.ts +1 -1
- package/dist/services/crystallization/index.d.ts +13 -0
- package/dist/services/crystallization/index.js +13 -0
- package/dist/services/dashboard/project-dashboard-service.js +2 -2
- package/dist/services/dispatch/await-batch.d.ts +70 -0
- package/dist/services/dispatch/await-batch.js +272 -0
- package/dist/services/dispatch/batch-counter.js +1 -1
- package/dist/services/dispatch/dispatch-record-writer.d.ts +126 -4
- package/dist/services/dispatch/dispatch-record-writer.js +239 -9
- package/dist/services/dispatch/slice-dag.d.ts +46 -0
- package/dist/services/dispatch/slice-dag.js +6 -0
- package/dist/services/dispatch/stage-enum.d.ts +27 -0
- package/dist/services/dispatch/stage-enum.js +48 -0
- package/dist/services/dispatch/startup-timeout.d.ts +86 -0
- package/dist/services/dispatch/startup-timeout.js +97 -0
- package/dist/services/dispatch/sub-agent-dispatcher.js +40 -89
- package/dist/services/dispatch/test-tool-detection.d.ts +25 -1
- package/dist/services/dispatch/test-tool-detection.js +80 -0
- package/dist/services/doctor/doctor-service/checks/check-id-schema.d.ts +18 -0
- package/dist/services/doctor/doctor-service/checks/check-id-schema.js +64 -0
- package/dist/services/doctor/doctor-service/checks/codegraph-capability.d.ts +14 -0
- package/dist/services/doctor/doctor-service/checks/codegraph-capability.js +69 -0
- package/dist/services/doctor/doctor-service/checks/dist-source-version.d.ts +32 -0
- package/dist/services/doctor/doctor-service/checks/dist-source-version.js +110 -0
- package/dist/services/doctor/doctor-service/checks/gateguard-conflict.d.ts +24 -0
- package/dist/services/doctor/doctor-service/checks/gateguard-conflict.js +164 -0
- package/dist/services/doctor/doctor-service/checks/l3-memory-health.d.ts +16 -0
- package/dist/services/doctor/doctor-service/checks/l3-memory-health.js +57 -0
- package/dist/services/doctor/doctor-service/checks/l3-orphan-sessions.d.ts +19 -0
- package/dist/services/doctor/doctor-service/checks/l3-orphan-sessions.js +66 -0
- package/dist/services/doctor/doctor-service/checks/schema-validity.d.ts +10 -0
- package/dist/services/doctor/doctor-service/checks/schema-validity.js +33 -0
- package/dist/services/doctor/doctor-service/checks/skill-apply-note.d.ts +20 -0
- package/dist/services/doctor/doctor-service/checks/skill-apply-note.js +85 -0
- package/dist/services/doctor/doctor-service/checks/skill-existence.d.ts +13 -0
- package/dist/services/doctor/doctor-service/checks/skill-existence.js +30 -0
- package/dist/services/doctor/doctor-service/checks/skill-name-match.d.ts +10 -0
- package/dist/services/doctor/doctor-service/checks/skill-name-match.js +25 -0
- package/dist/services/doctor/doctor-service/checks/skill-parse.d.ts +10 -0
- package/dist/services/doctor/doctor-service/checks/skill-parse.js +19 -0
- package/dist/services/doctor/doctor-service/checks/skill-presence.d.ts +21 -0
- package/dist/services/doctor/doctor-service/checks/skill-presence.js +75 -0
- package/dist/services/doctor/doctor-service/checks/skill-runbook.d.ts +14 -0
- package/dist/services/doctor/doctor-service/checks/skill-runbook.js +47 -0
- package/dist/services/doctor/doctor-service/checks/statusline-install.d.ts +14 -0
- package/dist/services/doctor/doctor-service/checks/statusline-install.js +32 -0
- package/dist/services/doctor/doctor-service/checks/statusline-runtime.d.ts +13 -0
- package/dist/services/doctor/doctor-service/checks/statusline-runtime.js +30 -0
- package/dist/services/doctor/doctor-service/checks/user-config.d.ts +11 -0
- package/dist/services/doctor/doctor-service/checks/user-config.js +27 -0
- package/dist/services/doctor/doctor-service/checks/workspace-init.d.ts +16 -0
- package/dist/services/doctor/doctor-service/checks/workspace-init.js +34 -0
- package/dist/services/doctor/doctor-service/checks/workspace-layout.d.ts +33 -0
- package/dist/services/doctor/doctor-service/checks/workspace-layout.js +180 -0
- package/dist/services/doctor/doctor-service/index.d.ts +48 -0
- package/dist/services/doctor/doctor-service/index.js +254 -0
- package/dist/services/doctor/doctor-service/plugin-registry.d.ts +41 -0
- package/dist/services/doctor/doctor-service/plugin-registry.js +77 -0
- package/dist/services/doctor/doctor-service/report/final-summary.d.ts +20 -0
- package/dist/services/doctor/doctor-service/report/final-summary.js +29 -0
- package/dist/services/doctor/doctor-service/types.d.ts +245 -0
- package/dist/services/doctor/doctor-service/types.js +15 -0
- package/dist/services/doctor/doctor-service.d.ts +15 -146
- package/dist/services/doctor/doctor-service.js +22 -926
- package/dist/services/doctor/index.d.ts +22 -0
- package/dist/services/doctor/index.js +22 -0
- package/dist/services/env/shell-probe.d.ts +71 -0
- package/dist/services/env/shell-probe.js +161 -0
- package/dist/services/evolution/evolution-types.d.ts +39 -39
- package/dist/services/final-review/final-review-service.d.ts +11 -1
- package/dist/services/final-review/index.d.ts +2 -0
- package/dist/services/final-review/index.js +1 -0
- package/dist/services/hooks/auto-compact-hook-install.d.ts +4 -5
- package/dist/services/hooks/auto-compact-hook-install.js +4 -5
- package/dist/services/hooks/worktree-authorization-gate.d.ts +205 -0
- package/dist/services/hooks/worktree-authorization-gate.js +492 -0
- package/dist/services/ide/adapters/claude-code-adapter.js +2 -2
- package/dist/services/ide/adapters/qoder-adapter.d.ts +25 -0
- package/dist/services/ide/adapters/qoder-adapter.js +57 -0
- package/dist/services/ide/adapters/tongyi-lingma-adapter.d.ts +16 -0
- package/dist/services/ide/adapters/tongyi-lingma-adapter.js +45 -0
- package/dist/services/ide/ide-registry.js +6 -0
- package/dist/services/ide/ide-types.d.ts +1 -1
- package/dist/services/job/job-types.d.ts +56 -56
- package/dist/services/job-snapshot/index.d.ts +8 -0
- package/dist/services/job-snapshot/index.js +7 -0
- package/dist/services/{job/job-resource-snapshot.d.ts → job-snapshot/snapshot.d.ts} +1 -1
- package/dist/services/job-snapshot/types.d.ts +7 -0
- package/dist/services/job-snapshot/types.js +1 -0
- package/dist/services/karpathy-cost/karpathy-cost-check-service.d.ts +67 -0
- package/dist/services/karpathy-cost/karpathy-cost-check-service.js +108 -0
- package/dist/services/log/retention.d.ts +16 -0
- package/dist/services/log/retention.js +17 -0
- package/dist/services/loop/loop-bee-relation-types.d.ts +6 -6
- package/dist/services/loop/loop-release-types.d.ts +24 -24
- package/dist/services/loop/monotonic-runner.d.ts +17 -11
- package/dist/services/loop/monotonic-runner.js +118 -79
- package/dist/services/memory/project-memory-service/index/kind-dispatch.d.ts +8 -0
- package/dist/services/memory/project-memory-service/index/kind-dispatch.js +253 -0
- package/dist/services/memory/project-memory-service/index/ranking.d.ts +6 -0
- package/dist/services/memory/project-memory-service/index/ranking.js +171 -0
- package/dist/services/memory/project-memory-service/index/search.d.ts +34 -0
- package/dist/services/memory/project-memory-service/index/search.js +194 -0
- package/dist/services/memory/project-memory-service/index.d.ts +9 -0
- package/dist/services/memory/project-memory-service/index.js +24 -0
- package/dist/services/memory/project-memory-service/parsers/frontmatter.d.ts +9 -0
- package/dist/services/memory/project-memory-service/parsers/frontmatter.js +106 -0
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.d.ts +7 -0
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.js +96 -0
- package/dist/services/memory/project-memory-service/store/atomic-write.d.ts +5 -0
- package/dist/services/memory/project-memory-service/store/atomic-write.js +56 -0
- package/dist/services/memory/project-memory-service/store/paths.d.ts +8 -0
- package/dist/services/memory/project-memory-service/store/paths.js +116 -0
- package/dist/services/memory/project-memory-service/types.d.ts +128 -0
- package/dist/services/memory/project-memory-service/types.js +9 -0
- package/dist/services/memory/project-memory-service.d.ts +1 -167
- package/dist/services/memory/project-memory-service.js +19 -816
- package/dist/services/migrate-skill-name/schema.d.ts +2 -2
- package/dist/services/observability/aggregation.d.ts +27 -0
- package/dist/services/observability/aggregation.js +72 -0
- package/dist/services/observability/observability-service.d.ts +73 -7
- package/dist/services/observability/observability-service.js +87 -1
- package/dist/services/openspec/artifact-boundary.d.ts +138 -0
- package/dist/services/openspec/artifact-boundary.js +150 -0
- package/dist/services/openspec/coverage-evidence-reader.d.ts +191 -0
- package/dist/services/openspec/coverage-evidence-reader.js +386 -0
- package/dist/services/openspec/openspec-archive-service.d.ts +70 -0
- package/dist/services/openspec/openspec-archive-service.js +320 -8
- package/dist/services/openspec/openspec-bridge-service.js +1 -1
- package/dist/services/openspec/openspec-init-service.js +1 -1
- package/dist/services/openspec/openspec-propose-from-doctor-service.js +1 -1
- package/dist/services/openspec/openspec-render-service.js +7 -4
- package/dist/services/openspec/openspec-scan-service.js +1 -1
- package/dist/services/openspec/openspec-validate-service.js +5 -4
- package/dist/services/preferences/preferences-service.js +10 -0
- package/dist/services/preferences/preferences-types.d.ts +13 -0
- package/dist/services/preferences/preferences-types.js +11 -0
- package/dist/services/qa/screenshot-archive-service.d.ts +51 -0
- package/dist/services/qa/screenshot-archive-service.js +134 -0
- package/dist/services/rd/rd-service.js +10 -11
- package/dist/services/rd/types.d.ts +32 -32
- package/dist/services/rd-swarm/rd-swarm-service.d.ts +60 -0
- package/dist/services/rd-swarm/rd-swarm-service.js +93 -0
- package/dist/services/recommendations/capability-seed-items.js +0 -1
- package/dist/services/recommendations/capability-seed-mappings.js +0 -1
- package/dist/services/recommendations/capability-seed-sources.js +0 -1
- package/dist/services/release/version-precheck-service.d.ts +51 -0
- package/dist/services/release/version-precheck-service.js +257 -0
- package/dist/services/scan/acceptance-coverage-service.js +1 -1
- package/dist/services/scan/archetype-service.js +1 -1
- package/dist/services/scan/existing-system-service.js +1 -1
- package/dist/services/scan/libraries-service.js +1 -1
- package/dist/services/sediment/json-schema.d.ts +40 -40
- package/dist/services/share/bundle-types.d.ts +12 -12
- package/dist/services/share/run-state-contract.d.ts +2 -2
- package/dist/services/skill/skill-search-service.d.ts +12 -7
- package/dist/services/skill/skill-search-service.js +8 -4
- package/dist/services/skillhub/migrations/001-initial.sql +71 -0
- package/dist/services/skillhub/migrations/002-loop-release.sql +32 -0
- package/dist/services/skillhub/migrations/003-loop-bee-relation.sql +35 -0
- package/dist/services/skillhub/migrations/004-loop-bee-extension.sql +65 -0
- package/dist/services/skillhub/migrations/005-evolution-evaluation.sql +81 -0
- package/dist/services/skillhub/migrations/006-crystallization-event.sql +92 -0
- package/dist/services/skills/hooks-settings-service.d.ts +75 -0
- package/dist/services/skills/hooks-settings-service.js +230 -2
- package/dist/services/skills/skill-registry.d.ts +1 -0
- package/dist/services/skills/skill-registry.js +6 -4
- package/dist/services/skills/skill-runbook-service.js +1 -1
- package/dist/services/slice/slice-check-service.js +1 -1
- package/dist/services/standards/main-session-monitor-ban-hook.d.ts +14 -0
- package/dist/services/standards/main-session-monitor-ban-hook.js +19 -0
- package/dist/services/standards/missing-standards-detector.d.ts +25 -0
- package/dist/services/standards/missing-standards-detector.js +43 -12
- package/dist/services/tech/tech-change-id-service.d.ts +82 -0
- package/dist/services/tech/tech-change-id-service.js +117 -0
- package/dist/services/understand/understand-hybrid-service.js +1 -1
- package/dist/services/understand/understand-scan-service.js +2 -2
- package/dist/services/upgrade/upgrade-service.js +4 -3
- package/dist/services/verdict/envelopes.d.ts +2 -2
- package/dist/services/verdict/envelopes.js +2 -2
- package/dist/services/verdict/verdict-aggregator.d.ts +3 -3
- package/dist/services/vm/vm-lease.d.ts +40 -0
- package/dist/services/vm/vm-lease.js +137 -0
- package/dist/services/workflow/autonomous-resume-writer.js +1 -1
- package/dist/services/workflow/pipeline-verify-gate-support.d.ts +47 -0
- package/dist/services/workflow/pipeline-verify-gate-support.js +194 -0
- package/dist/services/workflow/pipeline-verify-service.d.ts +17 -81
- package/dist/services/workflow/pipeline-verify-service.js +42 -218
- package/dist/services/workflow/pipeline-verify-types.d.ts +90 -0
- package/dist/services/workflow/pipeline-verify-types.js +10 -0
- package/dist/services/workflow/plan-reader.d.ts +1 -1
- package/dist/services/workflow/plan-reader.js +1 -1
- package/dist/services/workflow/plan-refresher.d.ts +1 -1
- package/dist/services/workflow/plan-refresher.js +1 -1
- package/dist/services/workflow/plan-trigger-detector.d.ts +1 -1
- package/dist/services/workflow/plan-trigger-detector.js +1 -1
- package/dist/services/workflow/workflow-autonomous-resume-helpers.d.ts +1 -1
- package/dist/services/workflow/workflow-autonomous-service.d.ts +2 -98
- package/dist/services/workflow/workflow-autonomous-types.d.ts +114 -0
- package/dist/services/workflow/workflow-autonomous-types.js +21 -0
- package/dist/services/workflow/workflow-router-service.js +18 -16
- package/dist/services/workflow/workflow-spec-lint.d.ts +13 -0
- package/dist/services/workflow/workflow-spec-lint.js +75 -0
- package/dist/services/workflow/workflow-spec-types.d.ts +100 -0
- package/dist/services/workflow/workflow-spec-types.js +13 -0
- package/dist/services/workflow/workflow-spec-yaml.d.ts +17 -0
- package/dist/services/workflow/workflow-spec-yaml.js +88 -0
- package/dist/services/workflow/workflow-spec.d.ts +11 -91
- package/dist/services/workflow/workflow-spec.js +16 -145
- package/dist/services/workspace/migrate-service.js +1 -1
- package/dist/services/workspace/workspace-service.js +1 -1
- package/dist/services/worktree/worktree-lease.d.ts +170 -0
- package/dist/services/worktree/worktree-lease.js +242 -0
- package/package.json +47 -51
- package/scripts/clean-dist.mjs +31 -1
- package/scripts/copy-templates.mjs +16 -0
- package/scripts/sync-version.mjs +53 -2
- package/skills/bee/peaks-perf-audit/SKILL.md +17 -0
- package/skills/bee/peaks-prd/SKILL.md +16 -0
- package/skills/bee/peaks-prd/test-prompts.json +12 -0
- package/skills/bee/peaks-qa/SKILL.md +16 -1
- package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +22 -0
- package/skills/bee/peaks-qa/test-prompts.json +12 -0
- package/skills/bee/peaks-rd/SKILL.md +29 -20
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +39 -0
- package/skills/bee/peaks-rd/test-prompts.json +12 -0
- package/skills/bee/peaks-reviewer/SKILL.md +17 -0
- package/skills/bee/peaks-sc/SKILL.md +16 -0
- package/skills/bee/peaks-security-audit/SKILL.md +17 -0
- package/skills/bee/peaks-txt/SKILL.md +16 -0
- package/skills/bee/peaks-txt/test-prompts.json +12 -0
- package/skills/bee/peaks-ui/SKILL.md +49 -43
- package/skills/bee/peaks-ui/test-prompts.json +12 -0
- package/skills/peaks-code/SKILL.md +54 -109
- package/skills/peaks-code/references/boundaries.md +15 -1
- package/skills/peaks-code/references/cron-scheduler-deployment.md +313 -0
- package/skills/peaks-code/references/external-skill-invocation.md +27 -0
- package/skills/peaks-code/references/lease-dashboard.html +224 -0
- package/skills/peaks-code/references/lease-stats.sample.json +26 -0
- package/skills/peaks-code/references/peaks-worktree-l2-enforcers.md +208 -0
- package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
- package/skills/peaks-code/references/runbook.md +63 -1
- package/skills/peaks-code/references/startup-sequence.md +110 -0
- package/skills/peaks-code/references/step-0-8-gate.md +1 -1
- package/skills/peaks-code/references/sub-agent-dispatch.md +92 -1
- package/skills/peaks-code/references/worktree-governance.md +123 -0
- package/skills/peaks-code/test-prompts.json +12 -0
- package/skills/peaks-doctor/SKILL.md +1 -1
- package/skills/peaks-ide/SKILL.md +1 -1
- package/skills/peaks-solo/SKILL.md +21 -0
- package/skills/peaks-solo/references/triage-decision-table.md +6 -0
- package/skills/peaks-sop/test-prompts.json +17 -0
- package/dist/cli/commands/agent-commands.d.ts +0 -20
- package/dist/cli/commands/agent-commands.js +0 -48
- package/dist/cli/commands/classify-classify-commands.d.ts +0 -19
- package/dist/cli/commands/classify-classify-commands.js +0 -151
- package/dist/cli/commands/contract-commands.d.ts +0 -26
- package/dist/cli/commands/contract-commands.js +0 -114
- package/dist/cli/commands/session-auto-compact-hook-command.d.ts +0 -37
- package/dist/cli/commands/session-auto-compact-hook-command.js +0 -127
- package/dist/cli/commands/worker-commands.d.ts +0 -3
- package/dist/cli/commands/worker-commands.js +0 -52
- package/dist/services/agent/ecc-agent-service.d.ts +0 -47
- package/dist/services/agent/ecc-agent-service.js +0 -143
- package/dist/services/config/provider-service.d.ts +0 -48
- package/dist/services/config/provider-service.js +0 -143
- package/dist/services/context/dispatch-context-guard.d.ts +0 -27
- package/dist/services/context/dispatch-context-guard.js +0 -192
- package/dist/services/context/shared-channel.d.ts +0 -93
- package/dist/services/context/shared-channel.js +0 -308
- package/dist/services/filesystem/file-lock.d.ts +0 -11
- package/dist/services/filesystem/file-lock.js +0 -152
- package/dist/services/mut/assert-scanner.d.ts +0 -6
- package/dist/services/mut/assert-scanner.js +0 -116
- package/dist/services/mut/index.d.ts +0 -8
- package/dist/services/mut/index.js +0 -7
- package/dist/services/mut/mut-runner.d.ts +0 -39
- package/dist/services/mut/mut-runner.js +0 -29
- package/dist/services/mut/production-stryker.d.ts +0 -2
- package/dist/services/mut/production-stryker.js +0 -75
- package/dist/services/mut/report-builder.d.ts +0 -11
- package/dist/services/mut/report-builder.js +0 -110
- package/dist/services/mut/report-loader.d.ts +0 -31
- package/dist/services/mut/report-loader.js +0 -78
- package/dist/services/mut/thresholds.d.ts +0 -21
- package/dist/services/mut/thresholds.js +0 -22
- package/dist/services/mut/types.d.ts +0 -336
- package/dist/services/mut/types.js +0 -59
- package/dist/services/providers/minimax-provider-service.d.ts +0 -24
- package/dist/services/providers/minimax-provider-service.js +0 -143
- package/dist/services/providers/minimax-worker-service.d.ts +0 -21
- package/dist/services/providers/minimax-worker-service.js +0 -83
- package/dist/shared/fs.d.ts +0 -4
- package/dist/shared/fs.js +0 -26
- package/dist/shared/paths.d.ts +0 -6
- package/dist/shared/paths.js +0 -50
- package/dist/shared/result.d.ts +0 -22
- package/dist/shared/result.js +0 -46
- package/dist/shared/version.d.ts +0 -1
- package/dist/shared/version.js +0 -1
- package/examples/video-demo/README.md +0 -142
- package/examples/video-demo/out/en-closing-960.png +0 -0
- package/examples/video-demo/out/zh-closing-960.png +0 -0
- package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
- package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
- /package/dist/services/{job/job-resource-snapshot.js → job-snapshot/snapshot.js} +0 -0
|
@@ -5,7 +5,7 @@ const SECTION_HARD_CONTRACTS = {
|
|
|
5
5
|
id: 'rl-section-hard-contracts-001',
|
|
6
6
|
rule: 'Section structure: Hard contracts for browser/IO surface',
|
|
7
7
|
markers: ['MANDATORY', 'BLOCKING'],
|
|
8
|
-
phrases: ['hard contract', 'hard contracts for browser', 'must be read before'],
|
|
8
|
+
phrases: ['hard contract', 'hard contracts for browser', 'hard contracts (blocking)', 'must be read before'],
|
|
9
9
|
enforcerRef: 'src/services/audit/enforcers/lint-style.ts',
|
|
10
10
|
};
|
|
11
11
|
const SECTION_MANDATORY_ARTIFACT = {
|
|
@@ -193,12 +193,184 @@ const CATALOG_PROSE_ONLY_RATIO = {
|
|
|
193
193
|
phrases: ['prose-only ratio', 'prose-only threshold', 'prose-only ≤ 5%', 'prose-only < 10%'],
|
|
194
194
|
enforcerRef: 'src/services/audit/enforcers/lint-catalog-governance.ts',
|
|
195
195
|
};
|
|
196
|
+
const SKILL_PRESENCE_MANDATORY = {
|
|
197
|
+
id: 'rl-skill-presence-mandatory-001',
|
|
198
|
+
rule: 'peaks-* bee SKILL.md must declare `## Skill presence (MANDATORY first action)` heading + body',
|
|
199
|
+
markers: ['MANDATORY'],
|
|
200
|
+
phrases: ['skill presence (mandatory first action)', 'skill presence ( first action', 'immediately run:'],
|
|
201
|
+
enforcerRef: 'src/services/audit/enforcers/lint-skill-presence-mandatory.ts',
|
|
202
|
+
};
|
|
203
|
+
const PRD_SOURCE_SNAPSHOT_PLACEMENT = {
|
|
204
|
+
id: 'rl-prd-source-snapshot-placement-001',
|
|
205
|
+
rule: 'peaks-prd SKILL.md must declare `## Document snapshot placement (BLOCKING)` heading + Prohibited paths + .peaks/_runtime/<session-id>/prd/source/ path',
|
|
206
|
+
markers: ['BLOCKING'],
|
|
207
|
+
phrases: ['document snapshot placement', 'prohibited paths', 'prd/source/'],
|
|
208
|
+
enforcerRef: 'src/services/audit/enforcers/lint-prd-source-snapshot.ts',
|
|
209
|
+
};
|
|
210
|
+
const PRD_ARTIFACT_HANDOFF = {
|
|
211
|
+
id: 'rl-prd-artifact-handoff-001',
|
|
212
|
+
rule: 'peaks-prd SKILL.md must declare the artifact handoff contract (Preserved behavior + step 5.5 + Transition verification gates)',
|
|
213
|
+
markers: ['BLOCKING'],
|
|
214
|
+
phrases: ['preserved behavior', '5.5 — write the immutable handoff', 'transition verification gates'],
|
|
215
|
+
enforcerRef: 'src/services/audit/enforcers/lint-prd-artifact-handoff.ts',
|
|
216
|
+
};
|
|
217
|
+
const RD_HANDOFF_CONTRACT = {
|
|
218
|
+
id: 'rl-rd-handoff-contract-001',
|
|
219
|
+
rule: 'peaks-rd SKILL.md must declare the QA-handoff BLOCKING contract (tech-doc + perf-baseline)',
|
|
220
|
+
markers: ['BLOCKING'],
|
|
221
|
+
phrases: ['do not hand off to qa without', 'tech-doc', 'perf-baseline'],
|
|
222
|
+
enforcerRef: 'src/services/audit/enforcers/lint-rd-handoff-coverage.ts',
|
|
223
|
+
};
|
|
224
|
+
const RD_COVERAGE_DISCIPLINE = {
|
|
225
|
+
id: 'rl-rd-coverage-discipline-001',
|
|
226
|
+
rule: 'peaks-rd SKILL.md must declare the coverage discipline (100% target + no-padding rule)',
|
|
227
|
+
markers: ['MANDATORY'],
|
|
228
|
+
phrases: ['100% coverage target on testable files', 'must not write coverage-padding tests'],
|
|
229
|
+
enforcerRef: 'src/services/audit/enforcers/lint-rd-handoff-coverage.ts',
|
|
230
|
+
};
|
|
231
|
+
const QA_GATEGUARD_PREFLIGHT = {
|
|
232
|
+
id: 'rl-qa-gateguard-preflight-001',
|
|
233
|
+
rule: 'peaks-qa SKILL.md must declare the gateguard-fact-force pre-flight BLOCKING section',
|
|
234
|
+
markers: ['BLOCKING'],
|
|
235
|
+
phrases: ['gateguard-fact-force conflict', 'pre-flight'],
|
|
236
|
+
enforcerRef: 'src/services/audit/enforcers/lint-qa-gateguard-and-runtime.ts',
|
|
237
|
+
};
|
|
238
|
+
const QA_RUNTIME_CONTRACT = {
|
|
239
|
+
id: 'rl-qa-runtime-contract-001',
|
|
240
|
+
rule: 'peaks-qa SKILL.md must declare the runtime contract (transition gates + Playwright MCP fallback + OpenSpec integration)',
|
|
241
|
+
markers: ['BLOCKING', 'MANDATORY'],
|
|
242
|
+
phrases: ['transition verification gates', 'playwright mcp is unavailable', 'when the target repository has openspec/'],
|
|
243
|
+
enforcerRef: 'src/services/audit/enforcers/lint-qa-gateguard-and-runtime.ts',
|
|
244
|
+
};
|
|
245
|
+
const PEAKS_UI_SUPERPOWERS_CHAIN = {
|
|
246
|
+
id: 'rl-peaks-ui-superpowers-chain-001',
|
|
247
|
+
rule: 'peaks-ui SKILL.md must declare the superpowers chain refusal + reference-material contract',
|
|
248
|
+
markers: ['BLOCKING'],
|
|
249
|
+
phrases: ['MUST NOT follow the superpowers chain', 'superpowers skills remain available as reference material'],
|
|
250
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.ts',
|
|
251
|
+
};
|
|
252
|
+
const PEAKS_UI_INVOLVEMENT = {
|
|
253
|
+
id: 'rl-peaks-ui-involvement-001',
|
|
254
|
+
rule: 'peaks-ui SKILL.md must declare the UI-involvement identification block',
|
|
255
|
+
markers: ['MANDATORY'],
|
|
256
|
+
phrases: ['identify ui involvement'],
|
|
257
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.ts',
|
|
258
|
+
};
|
|
259
|
+
const PEAKS_TXT_UPSTREAM = {
|
|
260
|
+
id: 'rl-peaks-txt-upstream-001',
|
|
261
|
+
rule: 'peaks-txt SKILL.md must declare the upstream-inspection + memory-block contract',
|
|
262
|
+
markers: ['MANDATORY'],
|
|
263
|
+
phrases: ['inspect upstream skill content before applying any method', 'memory block embedding rule'],
|
|
264
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.ts',
|
|
265
|
+
};
|
|
266
|
+
const PEAKS_PERF_AUDIT_SCOPE = {
|
|
267
|
+
id: 'rl-peaks-perf-audit-scope-001',
|
|
268
|
+
rule: 'peaks-perf-audit SKILL.md must declare the non-perf MUST NOT invoke clause',
|
|
269
|
+
markers: ['MUST NOT'],
|
|
270
|
+
phrases: ['MUST NOT invoke this skill', 'non-perf'],
|
|
271
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.ts',
|
|
272
|
+
};
|
|
273
|
+
const PEAKS_RD_RUNTIME_CONTRACT = {
|
|
274
|
+
id: 'rl-peaks-rd-runtime-contract-001',
|
|
275
|
+
rule: 'peaks-rd SKILL.md must declare the runtime contract (OpenSpec usage + Frontend project generation)',
|
|
276
|
+
markers: ['BLOCKING', 'MUST NOT'],
|
|
277
|
+
phrases: ['use openspec when the', 'rd work creates a frontend application'],
|
|
278
|
+
enforcerRef: 'src/services/audit/enforcers/lint-bee-runtime-contract.ts',
|
|
279
|
+
};
|
|
280
|
+
const PEAKS_UI_TRANSITION_GATES = {
|
|
281
|
+
id: 'rl-peaks-ui-transition-gates-001',
|
|
282
|
+
rule: 'peaks-ui SKILL.md must declare the Transition verification gates section',
|
|
283
|
+
markers: ['MANDATORY'],
|
|
284
|
+
phrases: ['transition verification gates'],
|
|
285
|
+
enforcerRef: 'src/services/audit/enforcers/lint-bee-runtime-contract.ts',
|
|
286
|
+
};
|
|
287
|
+
const PEAKS_SC_TRANSITION_GATES = {
|
|
288
|
+
id: 'rl-peaks-sc-transition-gates-001',
|
|
289
|
+
rule: 'peaks-sc SKILL.md must declare the Transition verification gates section',
|
|
290
|
+
markers: ['MANDATORY'],
|
|
291
|
+
phrases: ['transition verification gates'],
|
|
292
|
+
enforcerRef: 'src/services/audit/enforcers/lint-bee-runtime-contract.ts',
|
|
293
|
+
};
|
|
294
|
+
const PEAKS_TXT_RUNTIME_CONTRACT = {
|
|
295
|
+
id: 'rl-peaks-txt-runtime-contract-001',
|
|
296
|
+
rule: 'peaks-txt SKILL.md must declare the runtime contract (Transition verification gates + Memory block embedding rule)',
|
|
297
|
+
markers: ['MANDATORY'],
|
|
298
|
+
phrases: ['transition verification gates', 'memory block embedding rule'],
|
|
299
|
+
enforcerRef: 'src/services/audit/enforcers/lint-bee-runtime-contract.ts',
|
|
300
|
+
};
|
|
301
|
+
const PEAKS_CODE_RUNTIME_CONTRACT = {
|
|
302
|
+
id: 'rl-peaks-code-runtime-contract-001',
|
|
303
|
+
rule: 'peaks-code SKILL.md must declare the runbook section-marker skeleton (Scope, no auto-compact, superpowers bridge, npm-contract, startup sequence, step 0.8 job-shape, local intermediate artifact workspace, pre-rd project scan checklist, step 11 memory sediment, --enforce-job-mode v3.1.2).',
|
|
304
|
+
markers: ['BLOCKING', 'MANDATORY'],
|
|
305
|
+
phrases: [
|
|
306
|
+
'scope (rl-8',
|
|
307
|
+
'no auto-compact prose ban',
|
|
308
|
+
'peaks-loop superpowers 协作边界',
|
|
309
|
+
'npm-contract boundary',
|
|
310
|
+
'peaks-loop startup sequence',
|
|
311
|
+
'step 0.8',
|
|
312
|
+
'peaks-loop local intermediate artifact workspace',
|
|
313
|
+
'peaks-loop pre-rd project scan checklist',
|
|
314
|
+
'step 11',
|
|
315
|
+
'enforce-job-mode (v3.1.2)'
|
|
316
|
+
],
|
|
317
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-code-runtime.ts',
|
|
318
|
+
};
|
|
196
319
|
/**
|
|
197
320
|
* The 25 P2-a entries, in stable display order. Appending to a single
|
|
198
321
|
* readonly array keeps the catalog growable: future slices (L2.4, L3.x)
|
|
199
322
|
* can spread this list into RED_LINE_CATALOG and add their own without
|
|
200
323
|
* touching this file.
|
|
201
324
|
*/
|
|
325
|
+
const PEAKS_AUDIT_RUNTIME = {
|
|
326
|
+
id: 'rl-peaks-audit-runtime-001',
|
|
327
|
+
rule: 'peaks-audit SKILL.md must declare the audit-runtime contract (machine-readable audit log, six-dimension audit, author identity)',
|
|
328
|
+
markers: ['MANDATORY', 'BLOCKING'],
|
|
329
|
+
phrases: ['audit log is machine-readable', 'six dimensions', '6 dimensions', 'author identity.*local gitconfig'],
|
|
330
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
331
|
+
};
|
|
332
|
+
const PEAKS_CONTENT_RUNTIME = {
|
|
333
|
+
id: 'rl-peaks-content-runtime-001',
|
|
334
|
+
rule: 'peaks-content SKILL.md must declare the content-runtime contract (what this skill do, failure mode, each red line is written)',
|
|
335
|
+
markers: ['MANDATORY', 'BLOCKING'],
|
|
336
|
+
phrases: ['what this skill do', 'failure mode', 'each red line is written'],
|
|
337
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
338
|
+
};
|
|
339
|
+
const PEAKS_IDE_RUNTIME = {
|
|
340
|
+
id: 'rl-peaks-ide-runtime-001',
|
|
341
|
+
rule: 'peaks-ide SKILL.md must declare the ide-runtime contract (for any consumer, what this skill do, general workflow-gating tool)',
|
|
342
|
+
markers: ['MANDATORY'],
|
|
343
|
+
phrases: ['for any consumer of the v2 envelope', 'what this skill do', 'general workflow-gating tool'],
|
|
344
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
345
|
+
};
|
|
346
|
+
const PEAKS_DOCTOR_RUNTIME = {
|
|
347
|
+
id: 'rl-peaks-doctor-runtime-001',
|
|
348
|
+
rule: 'peaks-doctor SKILL.md must declare the doctor-orchestrator marker',
|
|
349
|
+
markers: ['MANDATORY'],
|
|
350
|
+
phrases: ['peaks-loop doctor is a doctor orchestrator'],
|
|
351
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
352
|
+
};
|
|
353
|
+
const PEAKS_ISSUE_FIX_ORCHESTRATOR_RUNTIME = {
|
|
354
|
+
id: 'rl-peaks-issue-fix-orchestrator-runtime-001',
|
|
355
|
+
rule: 'peaks-issue-fix-orchestrator SKILL.md must declare the deviation note + autonomous work proceed markers',
|
|
356
|
+
markers: ['MANDATORY'],
|
|
357
|
+
phrases: ['deviation note', 'autonomous work proceed'],
|
|
358
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
359
|
+
};
|
|
360
|
+
const PEAKS_SOP_RUNTIME = {
|
|
361
|
+
id: 'rl-peaks-sop-runtime-001',
|
|
362
|
+
rule: 'peaks-sop SKILL.md must declare the sop-runtime contract (each red line below, sop lint reports findings)',
|
|
363
|
+
markers: ['MANDATORY'],
|
|
364
|
+
phrases: ['each red line below is written', 'sop lint reports findings'],
|
|
365
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
366
|
+
};
|
|
367
|
+
const PEAKS_SLICE_DECOMPOSE_RUNTIME = {
|
|
368
|
+
id: 'rl-peaks-slice-decompose-runtime-001',
|
|
369
|
+
rule: 'peaks-slice-decompose SKILL.md must declare the slice-decompose contract (what this skill do, failure mode)',
|
|
370
|
+
markers: ['MANDATORY'],
|
|
371
|
+
phrases: ['what this skill do', 'failure mode ('],
|
|
372
|
+
enforcerRef: 'src/services/audit/enforcers/lint-peaks-skill-runtime.ts',
|
|
373
|
+
};
|
|
202
374
|
export const RED_LINE_CATALOG_P2_A = [
|
|
203
375
|
SECTION_HARD_CONTRACTS,
|
|
204
376
|
SECTION_MANDATORY_ARTIFACT,
|
|
@@ -226,4 +398,61 @@ export const RED_LINE_CATALOG_P2_A = [
|
|
|
226
398
|
PEAKS_DOCTOR_SKILL_ACKNOWLEDGED,
|
|
227
399
|
CATALOG_TOTAL_LE_45,
|
|
228
400
|
CATALOG_PROSE_ONLY_RATIO,
|
|
401
|
+
// Slice 2026-07-29-rid-prose-only-sweep-001: close the first
|
|
402
|
+
// discovered prose-only line. peaks-prd-skill-md-56 was a
|
|
403
|
+
// "MANDATORY first action" marker on a "Skill presence" heading
|
|
404
|
+
// in skills/bee/* SKILL.md. The MANDATORY marker + the heading
|
|
405
|
+
// are now enforced by lint-skill-presence-mandatory.ts.
|
|
406
|
+
SKILL_PRESENCE_MANDATORY,
|
|
407
|
+
// Slice 2026-07-29-rid-prose-only-sweep-002: close two more
|
|
408
|
+
// peaks-prd discovered lines (md-292, md-301) with one
|
|
409
|
+
// enforcer. The enforcer pattern-scans the source-snapshot
|
|
410
|
+
// placement guidance + prohibited-paths list.
|
|
411
|
+
PRD_SOURCE_SNAPSHOT_PLACEMENT,
|
|
412
|
+
// Slice 2026-07-29-rid-prose-only-sweep-004: close three
|
|
413
|
+
// peaks-prd discovered lines (md-99 / md-166 / md-193) with
|
|
414
|
+
// one enforcer. The handoff contract requires preserved
|
|
415
|
+
// behavior, step 5.5, and transition verification gates.
|
|
416
|
+
PRD_ARTIFACT_HANDOFF,
|
|
417
|
+
// Slice 2026-07-29-rid-prose-only-sweep-005: close three
|
|
418
|
+
// peaks-rd discovered lines (md-121 / md-127 / md-162) with
|
|
419
|
+
// two enforcers (handoff + coverage discipline).
|
|
420
|
+
RD_HANDOFF_CONTRACT,
|
|
421
|
+
RD_COVERAGE_DISCIPLINE,
|
|
422
|
+
// Slice 2026-07-29-rid-prose-only-sweep-006: close four
|
|
423
|
+
// peaks-qa discovered lines (md-26 gateguard + md-113
|
|
424
|
+
// transition gates + md-165 playwright + md-201 openspec).
|
|
425
|
+
QA_GATEGUARD_PREFLIGHT,
|
|
426
|
+
QA_RUNTIME_CONTRACT,
|
|
427
|
+
// Slice 2026-07-29-rid-prose-only-sweep-007: close six more
|
|
428
|
+
// discovered lines (3 peaks-ui + 2 peaks-txt + 1
|
|
429
|
+
// peaks-perf-audit) with four enforcers.
|
|
430
|
+
PEAKS_UI_SUPERPOWERS_CHAIN,
|
|
431
|
+
PEAKS_UI_INVOLVEMENT,
|
|
432
|
+
PEAKS_TXT_UPSTREAM,
|
|
433
|
+
PEAKS_PERF_AUDIT_SCOPE,
|
|
434
|
+
// Slice 2026-07-29-rid-prose-only-sweep-008: close six more
|
|
435
|
+
// discovered lines (2 peaks-rd + 1 peaks-sc + 1 peaks-txt +
|
|
436
|
+
// 1 peaks-ui + 1 peaks-ui) with four enforcers in
|
|
437
|
+
// lint-bee-runtime-contract.ts.
|
|
438
|
+
PEAKS_RD_RUNTIME_CONTRACT,
|
|
439
|
+
PEAKS_UI_TRANSITION_GATES,
|
|
440
|
+
PEAKS_SC_TRANSITION_GATES,
|
|
441
|
+
PEAKS_TXT_RUNTIME_CONTRACT,
|
|
442
|
+
// Slice 2026-07-29-rid-prose-only-sweep-009: close 13 of the
|
|
443
|
+
// remaining 33 discovered lines (all peaks-code) with one
|
|
444
|
+
// enforcer that checks the peaks-code runbook section-marker
|
|
445
|
+
// skeleton. Single catalog entry; multi-marker enforcer.
|
|
446
|
+
PEAKS_CODE_RUNTIME_CONTRACT,
|
|
447
|
+
// Slice 2026-07-29-rid-prose-only-sweep-010: 8 of the
|
|
448
|
+
// remaining 22 discovered lines (peaks-audit x4,
|
|
449
|
+
// peaks-content x2, peaks-ide x2) closed with 6 enforcers
|
|
450
|
+
// in one file.
|
|
451
|
+
PEAKS_AUDIT_RUNTIME,
|
|
452
|
+
PEAKS_CONTENT_RUNTIME,
|
|
453
|
+
PEAKS_IDE_RUNTIME,
|
|
454
|
+
PEAKS_DOCTOR_RUNTIME,
|
|
455
|
+
PEAKS_ISSUE_FIX_ORCHESTRATOR_RUNTIME,
|
|
456
|
+
PEAKS_SOP_RUNTIME,
|
|
457
|
+
PEAKS_SLICE_DECOMPOSE_RUNTIME,
|
|
229
458
|
];
|
|
@@ -1,52 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Static audit service — `peaks audit static`.
|
|
3
3
|
*
|
|
4
|
-
* Slice
|
|
4
|
+
* Slice 3 of 4.0.0-beta.11 dropped the ECC AgentShield subprocess
|
|
5
|
+
* integration entirely. The pre-Slice-3 implementation probed
|
|
6
|
+
* `npx ecc-agentshield --version` and shelled out to
|
|
7
|
+
* `npx ecc-agentshield scan --json --target <path>` on every audit
|
|
8
|
+
* call, but the upstream `affaan-m/everything-claude-code` v2.0.0
|
|
9
|
+
* release ships no `ecc-agentshield` binary — the repo is
|
|
10
|
+
* `agents/*.md` flat files plus SKILL.md descriptors.
|
|
5
11
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* The new contract: `peaks audit static` runs the peaks-loop lint
|
|
13
|
+
* layer only. There is no subprocess probe, no `installed` flag,
|
|
14
|
+
* no agent-shield reason code. The `agentShield` field is preserved
|
|
15
|
+
* on the result type as a frozen "always disabled" stub so any
|
|
16
|
+
* downstream consumer keeps compiling, but the merged findings list
|
|
17
|
+
* is always the peaks-loop findings list (no ECC findings).
|
|
11
18
|
*
|
|
12
|
-
* The subprocess
|
|
13
|
-
*
|
|
19
|
+
* The subprocess-runner seam (`SubprocessRunner`, `defaultSubprocessRunner`)
|
|
20
|
+
* is preserved as an EXPORTED TYPE so legacy tests can still
|
|
21
|
+
* mock it; the runner itself is never invoked from production code.
|
|
14
22
|
*/
|
|
15
23
|
import { type ProseRatioResult } from './prose-ratio-calculator.js';
|
|
16
24
|
import type { EnforcerFinding, RedLineAudit } from './types.js';
|
|
17
25
|
export interface StaticAuditInput {
|
|
18
26
|
readonly projectRoot: string;
|
|
19
|
-
/**
|
|
27
|
+
/** Slice 3: retained for backward-compat; no longer wired. */
|
|
20
28
|
readonly enableAgentShield?: boolean | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Optional subprocess runner injection point. Used by tests
|
|
23
|
-
* to mock `npx ecc-agentshield`. Production callers should
|
|
24
|
-
* leave this undefined; the default uses `child_process.spawnSync`.
|
|
25
|
-
*/
|
|
29
|
+
/** Slice 3: retained as a type seam; never invoked in production. */
|
|
26
30
|
readonly subprocessRunner?: SubprocessRunner | undefined;
|
|
27
31
|
}
|
|
28
32
|
export interface StaticAuditResult {
|
|
29
33
|
readonly audit: RedLineAudit;
|
|
30
34
|
readonly agentShield: AgentShieldState;
|
|
31
35
|
readonly warnings: readonly string[];
|
|
32
|
-
/** v2.14.0 Slice C: prose-only ratio with informational exclusion (per A3.1). */
|
|
33
36
|
readonly proseRatio: ProseRatioResult;
|
|
34
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Frozen stub. Slice 3 collapsed the agent-shield reason set to a
|
|
40
|
+
* single value (`'disabled-and-ecc-missing'`) because the
|
|
41
|
+
* subprocess integration was removed; we preserve the other
|
|
42
|
+
* reason literals as TYPE-LEVEL members so any test or
|
|
43
|
+
* downstream consumer that pattern-matches on `'flag-enabled-but-ecc-missing'`
|
|
44
|
+
* keeps type-checking, but the runtime value is always the
|
|
45
|
+
* single collapsed state.
|
|
46
|
+
*/
|
|
35
47
|
export interface AgentShieldState {
|
|
36
|
-
|
|
37
|
-
readonly
|
|
38
|
-
/** Whether ECC AgentShield is installed (regardless of whether it was spawned). */
|
|
39
|
-
readonly installed: boolean;
|
|
40
|
-
/** Why the subprocess was or was not spawned. */
|
|
48
|
+
readonly spawned: false;
|
|
49
|
+
readonly installed: false;
|
|
41
50
|
readonly reason: 'enabled-and-installed' | 'disabled-by-preference' | 'flag-disabled' | 'flag-enabled-but-ecc-missing' | 'disabled-and-ecc-missing';
|
|
42
|
-
/** The merged ECC findings (empty if not spawned). */
|
|
43
51
|
readonly findings: readonly EnforcerFinding[];
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
|
-
* Subprocess runner interface —
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `child_process.spawnSync` (synchronous, captures stdout).
|
|
54
|
+
* Subprocess runner interface — preserved as a TYPE for legacy
|
|
55
|
+
* test code. Production no longer invokes it; the audit always
|
|
56
|
+
* runs peaks-loop-only findings.
|
|
50
57
|
*/
|
|
51
58
|
export interface SubprocessRunner {
|
|
52
59
|
run(command: string, args: readonly string[], timeoutMs: number): SubprocessResult;
|
|
@@ -1,130 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Static audit service — `peaks audit static`.
|
|
3
3
|
*
|
|
4
|
-
* Slice
|
|
4
|
+
* Slice 3 of 4.0.0-beta.11 dropped the ECC AgentShield subprocess
|
|
5
|
+
* integration entirely. The pre-Slice-3 implementation probed
|
|
6
|
+
* `npx ecc-agentshield --version` and shelled out to
|
|
7
|
+
* `npx ecc-agentshield scan --json --target <path>` on every audit
|
|
8
|
+
* call, but the upstream `affaan-m/everything-claude-code` v2.0.0
|
|
9
|
+
* release ships no `ecc-agentshield` binary — the repo is
|
|
10
|
+
* `agents/*.md` flat files plus SKILL.md descriptors.
|
|
5
11
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* The new contract: `peaks audit static` runs the peaks-loop lint
|
|
13
|
+
* layer only. There is no subprocess probe, no `installed` flag,
|
|
14
|
+
* no agent-shield reason code. The `agentShield` field is preserved
|
|
15
|
+
* on the result type as a frozen "always disabled" stub so any
|
|
16
|
+
* downstream consumer keeps compiling, but the merged findings list
|
|
17
|
+
* is always the peaks-loop findings list (no ECC findings).
|
|
11
18
|
*
|
|
12
|
-
* The subprocess
|
|
13
|
-
*
|
|
19
|
+
* The subprocess-runner seam (`SubprocessRunner`, `defaultSubprocessRunner`)
|
|
20
|
+
* is preserved as an EXPORTED TYPE so legacy tests can still
|
|
21
|
+
* mock it; the runner itself is never invoked from production code.
|
|
14
22
|
*/
|
|
15
|
-
import { spawnSync } from 'node:child_process';
|
|
16
23
|
import { runRedLinesAudit } from './red-lines-service.js';
|
|
17
24
|
import { loadPreferences } from '../preferences/preferences-service.js';
|
|
18
25
|
import { computeProseRatio } from './prose-ratio-calculator.js';
|
|
19
|
-
const ECC_DETECT_TIMEOUT_MS = 5000;
|
|
20
|
-
const ECC_SCAN_TIMEOUT_MS = 30000;
|
|
21
|
-
const defaultSubprocessRunner = {
|
|
22
|
-
run(command, args, timeoutMs) {
|
|
23
|
-
try {
|
|
24
|
-
const r = spawnSync(command, args, {
|
|
25
|
-
timeout: timeoutMs,
|
|
26
|
-
encoding: 'utf8',
|
|
27
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
28
|
-
maxBuffer: 16 * 1024 * 1024,
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
status: r.status,
|
|
32
|
-
stdout: r.stdout ?? '',
|
|
33
|
-
stderr: r.stderr ?? '',
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
return {
|
|
38
|
-
status: null,
|
|
39
|
-
stdout: '',
|
|
40
|
-
stderr: '',
|
|
41
|
-
error: err,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
function isEccInstalled(runner) {
|
|
47
|
-
const result = runner.run('npx', ['ecc-agentshield', '--version'], ECC_DETECT_TIMEOUT_MS);
|
|
48
|
-
if (result.error)
|
|
49
|
-
return false;
|
|
50
|
-
return result.status === 0;
|
|
51
|
-
}
|
|
52
|
-
function runEccScan(projectRoot, runner) {
|
|
53
|
-
try {
|
|
54
|
-
// Per spec §7.2 line 828: the canonical ECC subprocess call uses
|
|
55
|
-
// `--target <path>`, NOT `--project`. The peaks-loop CLI flag
|
|
56
|
-
// (`peaks audit static --project <path>`) follows peaks-loop
|
|
57
|
-
// convention; the inner ecc-agentshield call follows the
|
|
58
|
-
// upstream ECC contract.
|
|
59
|
-
const result = runner.run('npx', ['ecc-agentshield', 'scan', '--json', '--target', projectRoot], ECC_SCAN_TIMEOUT_MS);
|
|
60
|
-
if (result.error || result.status !== 0)
|
|
61
|
-
return [];
|
|
62
|
-
const stdout = result.stdout;
|
|
63
|
-
let parsed;
|
|
64
|
-
try {
|
|
65
|
-
parsed = JSON.parse(stdout);
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
if (!parsed.findings)
|
|
71
|
-
return [];
|
|
72
|
-
return parsed.findings.map((f, idx) => ({
|
|
73
|
-
enforcerId: `ecc-agentshield:${f.ruleId ?? `unknown-${idx}`}`,
|
|
74
|
-
rule: f.rule ?? 'ECC AgentShield rule',
|
|
75
|
-
severity: f.severity ?? 'warn',
|
|
76
|
-
file: f.file ?? '(unknown)',
|
|
77
|
-
detail: f.detail ?? '',
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
26
|
export function runStaticAudit(input) {
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
//
|
|
91
|
-
// flagEnabled (CLI override) > preference > false
|
|
92
|
-
const shouldSpawn = flagEnabled ?? prefEnabled;
|
|
93
|
-
// Detect ECC.
|
|
94
|
-
const installed = isEccInstalled(runner);
|
|
95
|
-
const warnings = [];
|
|
96
|
-
let state;
|
|
97
|
-
if (!shouldSpawn) {
|
|
98
|
-
// Disabled path — no subprocess, no warnings.
|
|
99
|
-
const reason = flagEnabled === false
|
|
100
|
-
? 'flag-disabled'
|
|
101
|
-
: 'disabled-by-preference';
|
|
102
|
-
state = { spawned: false, installed, reason, findings: [] };
|
|
103
|
-
}
|
|
104
|
-
else if (!installed) {
|
|
105
|
-
// Enabled but ECC missing — soft-fail with a warning.
|
|
106
|
-
warnings.push('agentShieldEnabled is true but `npx ecc-agentshield --version` failed. ' +
|
|
107
|
-
'Run `npx ecc-agentshield --help` to install. Audit ran with peaks-loop findings only.');
|
|
108
|
-
state = { spawned: false, installed: false, reason: 'flag-enabled-but-ecc-missing', findings: [] };
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
// Enabled and installed — spawn the subprocess.
|
|
112
|
-
const findings = runEccScan(input.projectRoot, runner);
|
|
113
|
-
state = { spawned: true, installed: true, reason: 'enabled-and-installed', findings };
|
|
114
|
-
}
|
|
115
|
-
// Always run the peaks-loop lint layer; merge ECC findings.
|
|
27
|
+
// Slice 3: agent-shield integration removed. The CLI flag and
|
|
28
|
+
// preference are still read for backward-compat (a user with a
|
|
29
|
+
// stale preferences.json that sets `agentShieldEnabled: true`
|
|
30
|
+
// does not get a hard error) but neither spawns a subprocess.
|
|
31
|
+
loadPreferences(input.projectRoot);
|
|
32
|
+
// Always run the peaks-loop lint layer; no ECC findings merged.
|
|
116
33
|
const peaksResult = runRedLinesAudit({ projectRoot: input.projectRoot });
|
|
117
34
|
const mergedAudit = {
|
|
118
35
|
...peaksResult.audit,
|
|
119
|
-
enforcerFindings: [...peaksResult.audit.enforcerFindings
|
|
36
|
+
enforcerFindings: [...peaksResult.audit.enforcerFindings],
|
|
37
|
+
};
|
|
38
|
+
const state = {
|
|
39
|
+
spawned: false,
|
|
40
|
+
installed: false,
|
|
41
|
+
reason: 'disabled-and-ecc-missing',
|
|
42
|
+
findings: [],
|
|
120
43
|
};
|
|
121
|
-
// v2.14.0 Slice C: compute prose-only ratio with informational
|
|
122
|
-
// exclusion. Surfaced in the JSON envelope so CI can gate on it.
|
|
123
44
|
const proseRatio = computeProseRatio(mergedAudit.audit);
|
|
124
45
|
return {
|
|
125
46
|
audit: mergedAudit,
|
|
126
47
|
agentShield: state,
|
|
127
|
-
warnings,
|
|
48
|
+
warnings: [],
|
|
128
49
|
proseRatio,
|
|
129
50
|
};
|
|
130
51
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { runSecurityAudit, isSecurityAuditEnvelope, detectSecurityAudit, readSecurityTemplate, renderSecurityAuditArtifact, type SecurityAuditEnvelope, type SecurityAuditViolation, type SecurityAuditVerdict, type SecurityAuditDetectState, type SecurityAuditDetectResult, type HandoffFrontmatter, readAndVerifyHandoff, } from './security-audit-service.js';
|
|
2
|
+
export { runPerfAudit, isPerfAuditEnvelope, detectPerfAudit, readPerfTemplate, renderPerfAuditArtifact, type PerfAuditEnvelope, type PerfAuditViolation, type PerfAuditVerdict, type PerfAuditDetectState, type PerfAuditDetectResult, } from './perf-audit-service.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { runSecurityAudit, isSecurityAuditEnvelope, detectSecurityAudit, readSecurityTemplate, renderSecurityAuditArtifact, readAndVerifyHandoff, } from './security-audit-service.js';
|
|
2
|
+
export { runPerfAudit, isPerfAuditEnvelope, detectPerfAudit, readPerfTemplate, renderPerfAuditArtifact, } from './perf-audit-service.js';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* autonomous-swarm-service — slice rid-014.
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* Build a dry-run-only autonomous RD swarm planner that turns a
|
|
6
|
+
* user-supplied goal + change-id + mode into a *resumable* plan:
|
|
7
|
+
* goal package (done / resume conditions), capability reuse list,
|
|
8
|
+
* checkpoint queue, worker-queue placeholders (no spawn), evidence
|
|
9
|
+
* requirements, and resume instructions.
|
|
10
|
+
*
|
|
11
|
+
* Reuse (per rid-014 plan §1):
|
|
12
|
+
* - `validateChangeId` + `planArtifactPath` + `buildWorkspaceUnavailable`
|
|
13
|
+
* from `src/services/openspec/artifact-boundary.ts` (rid-009).
|
|
14
|
+
* - `getTechStatus` from `src/services/tech/tech-service.ts` (rid-012).
|
|
15
|
+
* - `planRdSwarmGraph` shape from `src/services/rd-swarm/rd-swarm-service.ts`
|
|
16
|
+
* (rid-013) — composed as the workerQueue feed.
|
|
17
|
+
*
|
|
18
|
+
* Style:
|
|
19
|
+
* - Named function exports — matches `rd-swarm-service.ts` + `artifact-boundary.ts`.
|
|
20
|
+
* - Hand-rolled `Result<T, E>` unions — no `neverthrow` dep.
|
|
21
|
+
* - Pure path math + intentional capability fs reads (no side effects).
|
|
22
|
+
* - No real workers, no MCP install, no settings mutation, no target-repo edit.
|
|
23
|
+
*
|
|
24
|
+
* Hard ban:
|
|
25
|
+
* - MUST NOT install / invoke / import any external skill or MCP server.
|
|
26
|
+
* - MUST NOT launch workers or mutate the target repo.
|
|
27
|
+
* - MUST NOT touch `src/services/openspec/artifact-boundary.ts`,
|
|
28
|
+
* `src/services/tech/`, or `src/services/rd-swarm/`.
|
|
29
|
+
*/
|
|
30
|
+
import { buildWorkspaceUnavailable, type Result, type BoundaryError } from '../openspec/artifact-boundary.js';
|
|
31
|
+
export type AutonomousMode = 'code' | 'team';
|
|
32
|
+
export type GoalCommandMarker = {
|
|
33
|
+
marker: '/goal';
|
|
34
|
+
nonDurable: true;
|
|
35
|
+
notes: string;
|
|
36
|
+
};
|
|
37
|
+
export type AutonomousGoalPackage = {
|
|
38
|
+
changeId: string;
|
|
39
|
+
goal: string;
|
|
40
|
+
mode: AutonomousMode;
|
|
41
|
+
autonomyMode: 'dry-run';
|
|
42
|
+
nonGoals: string[];
|
|
43
|
+
doneCondition: string;
|
|
44
|
+
resumeCondition: string;
|
|
45
|
+
riskNotes: string[];
|
|
46
|
+
goalCommand?: GoalCommandMarker;
|
|
47
|
+
};
|
|
48
|
+
export type CheckpointStatus = 'pending' | 'verified' | 'failed';
|
|
49
|
+
export type Checkpoint = {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
evidencePath: string;
|
|
53
|
+
status: CheckpointStatus;
|
|
54
|
+
};
|
|
55
|
+
export type WorkerQueueEntry = {
|
|
56
|
+
taskId: string;
|
|
57
|
+
wave: string;
|
|
58
|
+
status: 'planned' | 'running' | 'done' | 'blocked';
|
|
59
|
+
briefPath: string;
|
|
60
|
+
dependsOn: string[];
|
|
61
|
+
};
|
|
62
|
+
export type EvidenceRequirement = {
|
|
63
|
+
id: string;
|
|
64
|
+
kind: 'validation-report' | 'coverage-report' | 'reducer-report';
|
|
65
|
+
path: string;
|
|
66
|
+
required: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type CapabilityEntry = {
|
|
69
|
+
source: string;
|
|
70
|
+
purpose: string;
|
|
71
|
+
trustLevel: 'internal' | 'external' | 'unknown';
|
|
72
|
+
activation: string;
|
|
73
|
+
risk: string;
|
|
74
|
+
};
|
|
75
|
+
export type CapabilityReuseResult = {
|
|
76
|
+
entries: CapabilityEntry[];
|
|
77
|
+
truncated: boolean;
|
|
78
|
+
warnings: string[];
|
|
79
|
+
};
|
|
80
|
+
export type ResumeInstructions = {
|
|
81
|
+
summary: string;
|
|
82
|
+
steps: string[];
|
|
83
|
+
checkpointStates: Array<{
|
|
84
|
+
id: string;
|
|
85
|
+
status: CheckpointStatus;
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
export type AutonomousRdPlan = {
|
|
89
|
+
changeId: string;
|
|
90
|
+
goal: string;
|
|
91
|
+
mode: AutonomousMode;
|
|
92
|
+
autonomyMode: 'dry-run';
|
|
93
|
+
available: boolean;
|
|
94
|
+
goalPackage: AutonomousGoalPackage;
|
|
95
|
+
capabilityReuse: CapabilityReuseResult;
|
|
96
|
+
checkpoints: Checkpoint[];
|
|
97
|
+
workerQueue: WorkerQueueEntry[];
|
|
98
|
+
evidence: EvidenceRequirement[];
|
|
99
|
+
artifactRoot: string;
|
|
100
|
+
gateStatus: {
|
|
101
|
+
techApprovalRequired: boolean;
|
|
102
|
+
techStatus: string;
|
|
103
|
+
skipReason?: string;
|
|
104
|
+
};
|
|
105
|
+
blockedReasons: string[];
|
|
106
|
+
nextActions: string[];
|
|
107
|
+
resumeInstructions: ResumeInstructions;
|
|
108
|
+
};
|
|
109
|
+
export type BuildAutonomousGoalPackageInput = {
|
|
110
|
+
changeId: string;
|
|
111
|
+
goal: string;
|
|
112
|
+
mode: AutonomousMode;
|
|
113
|
+
maxWorkers: number;
|
|
114
|
+
dryRun: true;
|
|
115
|
+
workspaceRoot: string;
|
|
116
|
+
};
|
|
117
|
+
export type PlanAutonomousRdSwarmInput = BuildAutonomousGoalPackageInput & {
|
|
118
|
+
requiresTechApproval?: boolean;
|
|
119
|
+
};
|
|
120
|
+
export declare function buildAutonomousGoalPackage(input: BuildAutonomousGoalPackageInput): AutonomousGoalPackage;
|
|
121
|
+
export declare function planCapabilityReuse(input: {
|
|
122
|
+
workspaceRoot: string;
|
|
123
|
+
}): CapabilityReuseResult;
|
|
124
|
+
export declare function buildResumeInstructions(plan: AutonomousRdPlan): ResumeInstructions;
|
|
125
|
+
export declare function planAutonomousRdSwarm(input: PlanAutonomousRdSwarmInput): AutonomousRdPlan;
|
|
126
|
+
export type { Result, BoundaryError };
|
|
127
|
+
export { buildWorkspaceUnavailable };
|