peaks-loop 4.0.0-beta.9 → 4.0.3
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 +572 -234
- package/README-en.md +67 -30
- package/README.md +67 -30
- 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 +91 -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
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: gateguard-fact-force hook does not intercept `.peaks/`
|
|
3
|
+
* writes (`integration:gateguard-peaks-conflict`).
|
|
4
|
+
*
|
|
5
|
+
* 2026-06-10 — the `gateguard-fact-force` hook is a third-party
|
|
6
|
+
* PreToolUse hook (NOT peaks-loop) that fires on Edit/Write and
|
|
7
|
+
* demands a 4-fact questionnaire before allowing the edit. When
|
|
8
|
+
* the LLM is in a peaks-qa flow and edits
|
|
9
|
+
* `.peaks/_runtime/<sid>/qa/requests/*.md`, the questionnaire
|
|
10
|
+
* demands facts that do not apply. We warn when the hook is
|
|
11
|
+
* installed and no `.peaks/**` skip is configured.
|
|
12
|
+
*
|
|
13
|
+
* Probing is split out of the check so the check itself stays a
|
|
14
|
+
* pure mapping over `GateguardProbeResult`. Tests inject the probe
|
|
15
|
+
* to keep `~/.claude/settings.json` from leaking into fixtures.
|
|
16
|
+
*/
|
|
17
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
18
|
+
import { homedir } from 'node:os';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { getErrorMessage } from 'peaks-loop-shared/result';
|
|
21
|
+
/** Hook command fragments that identify the gateguard-fact-force hook. */
|
|
22
|
+
const GATEGUARD_HOOK_NEEDLES = ['gateguard', 'fact-force', 'fact_force'];
|
|
23
|
+
/** Token the gateguard hook exposes for "skip these paths" — the
|
|
24
|
+
* check treats any match against `.peaks` (path or globs) as a
|
|
25
|
+
* routed configuration. We accept a few common spellings because
|
|
26
|
+
* the third-party hook's CLI surface is not part of peaks-loop's
|
|
27
|
+
* contract. */
|
|
28
|
+
const GATEGUARD_PEAKS_SKIP_NEEDLES = [
|
|
29
|
+
'.peaks',
|
|
30
|
+
'peaks-skip',
|
|
31
|
+
'skip-glob',
|
|
32
|
+
'--skip',
|
|
33
|
+
'skip_paths'
|
|
34
|
+
];
|
|
35
|
+
function commandMentionsGateguard(command) {
|
|
36
|
+
if (typeof command !== 'string' || command.length === 0)
|
|
37
|
+
return false;
|
|
38
|
+
const lower = command.toLowerCase();
|
|
39
|
+
return GATEGUARD_HOOK_NEEDLES.some((needle) => lower.includes(needle));
|
|
40
|
+
}
|
|
41
|
+
function entrySkipsPeaks(entry) {
|
|
42
|
+
const matcher = typeof entry.matcher === 'string' ? entry.matcher : '';
|
|
43
|
+
const matcherMentionsPeaks = matcher.toLowerCase().includes('.peaks');
|
|
44
|
+
if (matcherMentionsPeaks)
|
|
45
|
+
return true;
|
|
46
|
+
for (const hook of entry.hooks) {
|
|
47
|
+
const command = typeof hook.command === 'string' ? hook.command : '';
|
|
48
|
+
const lower = command.toLowerCase();
|
|
49
|
+
if (GATEGUARD_PEAKS_SKIP_NEEDLES.some((needle) => lower.includes(needle))) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
function extractGateguardEntries(source, sourcePath, settings) {
|
|
56
|
+
if (settings === null || typeof settings !== 'object')
|
|
57
|
+
return [];
|
|
58
|
+
const hooks = settings.hooks;
|
|
59
|
+
if (hooks === null || typeof hooks !== 'object')
|
|
60
|
+
return [];
|
|
61
|
+
const preToolUse = hooks.PreToolUse;
|
|
62
|
+
if (!Array.isArray(preToolUse))
|
|
63
|
+
return [];
|
|
64
|
+
const out = [];
|
|
65
|
+
for (const rawEntry of preToolUse) {
|
|
66
|
+
if (rawEntry === null || typeof rawEntry !== 'object')
|
|
67
|
+
continue;
|
|
68
|
+
const entry = rawEntry;
|
|
69
|
+
if (!Array.isArray(entry.hooks))
|
|
70
|
+
continue;
|
|
71
|
+
const hooks = [];
|
|
72
|
+
for (const rawHook of entry.hooks) {
|
|
73
|
+
if (rawHook === null || typeof rawHook !== 'object')
|
|
74
|
+
continue;
|
|
75
|
+
const h = rawHook;
|
|
76
|
+
const hookEntry = {};
|
|
77
|
+
if (typeof h.type === 'string')
|
|
78
|
+
hookEntry.type = h.type;
|
|
79
|
+
if (typeof h.command === 'string')
|
|
80
|
+
hookEntry.command = h.command;
|
|
81
|
+
hooks.push(hookEntry);
|
|
82
|
+
}
|
|
83
|
+
if (!hooks.some((h) => commandMentionsGateguard(h.command)))
|
|
84
|
+
continue;
|
|
85
|
+
const outEntry = { hooks };
|
|
86
|
+
if (typeof entry.matcher === 'string')
|
|
87
|
+
outEntry.matcher = entry.matcher;
|
|
88
|
+
out.push({ source, sourcePath, entry: outEntry });
|
|
89
|
+
}
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
function readSettingsJson(path) {
|
|
93
|
+
if (!existsSync(path))
|
|
94
|
+
return null;
|
|
95
|
+
try {
|
|
96
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
97
|
+
}
|
|
98
|
+
catch { // TODO(g2): legacy silent catch — grace: 1 minor release (v2.14.0)
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function defaultGateguardProbe(projectRootResolver) {
|
|
103
|
+
const projectRoot = projectRootResolver();
|
|
104
|
+
const globalPath = join(homedir(), '.claude', 'settings.json');
|
|
105
|
+
const projectPath = projectRoot === null ? null : join(projectRoot, '.claude', 'settings.json');
|
|
106
|
+
return {
|
|
107
|
+
globalSettingsPath: globalPath,
|
|
108
|
+
globalSettings: readSettingsJson(globalPath),
|
|
109
|
+
projectSettingsPath: projectPath,
|
|
110
|
+
projectSettings: projectPath === null ? null : readSettingsJson(projectPath)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Pure mapping over a `GateguardProbeResult`. Exported so tests
|
|
115
|
+
* can drive the entry extraction without monkey-patching
|
|
116
|
+
* `~/.claude/settings.json`.
|
|
117
|
+
*/
|
|
118
|
+
export function collectGateguardEntries(probe) {
|
|
119
|
+
const fromGlobal = extractGateguardEntries('global', probe.globalSettingsPath ?? '~/.claude/settings.json', probe.globalSettings);
|
|
120
|
+
const fromProject = probe.projectSettingsPath === null
|
|
121
|
+
? []
|
|
122
|
+
: extractGateguardEntries('project', probe.projectSettingsPath, probe.projectSettings);
|
|
123
|
+
return [...fromGlobal, ...fromProject];
|
|
124
|
+
}
|
|
125
|
+
function run({ options, projectRootResolver }) {
|
|
126
|
+
const gateguardProbe = options.gateguardProbe ?? (() => defaultGateguardProbe(projectRootResolver));
|
|
127
|
+
try {
|
|
128
|
+
const probe = gateguardProbe();
|
|
129
|
+
const offending = collectGateguardEntries(probe);
|
|
130
|
+
if (offending.length === 0) {
|
|
131
|
+
return [{
|
|
132
|
+
id: 'integration:gateguard-peaks-conflict',
|
|
133
|
+
ok: true,
|
|
134
|
+
message: 'No gateguard-fact-force PreToolUse hook detected in ~/.claude/settings.json or project .claude/settings.json; the Edit/Write fact-forcing flow will not interfere with peaks-qa .peaks/ artifact writes'
|
|
135
|
+
}];
|
|
136
|
+
}
|
|
137
|
+
const unrouted = offending.filter((location) => !entrySkipsPeaks(location.entry));
|
|
138
|
+
if (unrouted.length === 0) {
|
|
139
|
+
return [{
|
|
140
|
+
id: 'integration:gateguard-peaks-conflict',
|
|
141
|
+
ok: true,
|
|
142
|
+
message: `gateguard-fact-force hook is installed in ${offending.map((l) => l.source).join(' + ')} but a .peaks/** skip pattern is configured; peaks-qa .peaks/ artifact writes are not blocked`
|
|
143
|
+
}];
|
|
144
|
+
}
|
|
145
|
+
const sources = Array.from(new Set(unrouted.map((u) => u.sourcePath))).join(' + ');
|
|
146
|
+
const matchers = unrouted.map((u) => u.entry.matcher ?? '*').join(', ');
|
|
147
|
+
return [{
|
|
148
|
+
id: 'integration:gateguard-peaks-conflict',
|
|
149
|
+
ok: false,
|
|
150
|
+
message: `gateguard-fact-force PreToolUse hook is installed (${sources}, matcher: ${matchers}) with no .peaks/** skip pattern; every Edit/Write of a peaks-qa envelope (.peaks/_runtime/<sid>/qa/requests/*.md) will be intercepted and demand a 4-fact questionnaire that does not apply to QA templates. Workaround: set \`ECC_DISABLED_HOOKS=pre:edit-write:gateguard-fact-force\` for the session, OR add a paired PreToolUse entry whose matcher restricts the hook to non-.peaks paths. peaks-loop is NOT the source of this hook.`
|
|
151
|
+
}];
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
return [{
|
|
155
|
+
id: 'integration:gateguard-peaks-conflict',
|
|
156
|
+
ok: true,
|
|
157
|
+
message: `gateguard probe failed (${getErrorMessage(error)}); skipping check`
|
|
158
|
+
}];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export const check = {
|
|
162
|
+
name: 'gateguard-conflict',
|
|
163
|
+
run
|
|
164
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: `.peaks/memory/index.json` is well-formed JSON
|
|
3
|
+
* (`L3:l3-memory-health`).
|
|
4
|
+
*
|
|
5
|
+
* Slice 2026-06-13-repair-pre-existing-test-failures: the
|
|
6
|
+
* production MemoryIndex schema (see
|
|
7
|
+
* `src/services/memory/project-memory-service.ts`) uses
|
|
8
|
+
* `version: 1` as the schema marker, NOT `schema_version`.
|
|
9
|
+
* We accept BOTH names for back-compat with any external index
|
|
10
|
+
* writers (e.g. a future `schema_version: '2.0.0'` form).
|
|
11
|
+
*
|
|
12
|
+
* When no `.peaks/memory/index.json` exists yet, the check passes
|
|
13
|
+
* (fresh project — no memories have been extracted).
|
|
14
|
+
*/
|
|
15
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
16
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: `.peaks/memory/index.json` is well-formed JSON
|
|
3
|
+
* (`L3:l3-memory-health`).
|
|
4
|
+
*
|
|
5
|
+
* Slice 2026-06-13-repair-pre-existing-test-failures: the
|
|
6
|
+
* production MemoryIndex schema (see
|
|
7
|
+
* `src/services/memory/project-memory-service.ts`) uses
|
|
8
|
+
* `version: 1` as the schema marker, NOT `schema_version`.
|
|
9
|
+
* We accept BOTH names for back-compat with any external index
|
|
10
|
+
* writers (e.g. a future `schema_version: '2.0.0'` form).
|
|
11
|
+
*
|
|
12
|
+
* When no `.peaks/memory/index.json` exists yet, the check passes
|
|
13
|
+
* (fresh project — no memories have been extracted).
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import { getErrorMessage } from 'peaks-loop-shared/result';
|
|
18
|
+
function run({ resolvedL3Root }) {
|
|
19
|
+
const memoryIndexPath = join(resolvedL3Root, '.peaks/memory/index.json');
|
|
20
|
+
if (!existsSync(memoryIndexPath)) {
|
|
21
|
+
return [{
|
|
22
|
+
id: 'L3:l3-memory-health',
|
|
23
|
+
ok: true,
|
|
24
|
+
message: 'No .peaks/memory/index.json yet (no memories extracted)'
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const raw = readFileSync(memoryIndexPath, 'utf8');
|
|
29
|
+
const parsed = JSON.parse(raw);
|
|
30
|
+
const schemaMarker = parsed.schema_version ?? parsed.version;
|
|
31
|
+
if (schemaMarker === undefined) {
|
|
32
|
+
return [{
|
|
33
|
+
id: 'L3:l3-memory-health',
|
|
34
|
+
ok: false,
|
|
35
|
+
message: '.peaks/memory/index.json missing schema_version / version field'
|
|
36
|
+
}];
|
|
37
|
+
}
|
|
38
|
+
const hotCount = Object.values(parsed.hot ?? {}).reduce((sum, arr) => sum + (Array.isArray(arr) ? arr.length : 0), 0);
|
|
39
|
+
const warmCount = Object.values(parsed.warm ?? {}).reduce((sum, arr) => sum + (Array.isArray(arr) ? arr.length : 0), 0);
|
|
40
|
+
return [{
|
|
41
|
+
id: 'L3:l3-memory-health',
|
|
42
|
+
ok: true,
|
|
43
|
+
message: `.peaks/memory/index.json is well-formed JSON; version=${schemaMarker}; ${hotCount} hot + ${warmCount} warm memory entries`
|
|
44
|
+
}];
|
|
45
|
+
}
|
|
46
|
+
catch (parseError) {
|
|
47
|
+
return [{
|
|
48
|
+
id: 'L3:l3-memory-health',
|
|
49
|
+
ok: false,
|
|
50
|
+
message: `.peaks/memory/index.json is not valid JSON: ${getErrorMessage(parseError)}`
|
|
51
|
+
}];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export const check = {
|
|
55
|
+
name: 'l3-memory-health',
|
|
56
|
+
run
|
|
57
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: orphan sessions under `.peaks/_runtime/` (`L3:l3-orphan-sessions`).
|
|
3
|
+
*
|
|
4
|
+
* Flags bare sids under `.peaks/_runtime/` that fail the
|
|
5
|
+
* `isValidSessionId` regex. The reducer skips canonical system
|
|
6
|
+
* subdirs that intentionally live under `.peaks/_runtime/`
|
|
7
|
+
* (e.g. `change/`, which routes reviewable artifacts per F3).
|
|
8
|
+
*
|
|
9
|
+
* Slice 2026-06-24-doctor-1xdetector-residual regression net: the
|
|
10
|
+
* reducer MUST exclude `change/` (and other system subdirs added
|
|
11
|
+
* by future F3 changes) — without the exclude-list the doctor
|
|
12
|
+
* flips the summary to fail on every clean workspace, which broke
|
|
13
|
+
* 7 doctor-family tests.
|
|
14
|
+
*
|
|
15
|
+
* When `.peaks/_runtime/` does not exist, the check passes
|
|
16
|
+
* (nothing to scan).
|
|
17
|
+
*/
|
|
18
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
19
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: orphan sessions under `.peaks/_runtime/` (`L3:l3-orphan-sessions`).
|
|
3
|
+
*
|
|
4
|
+
* Flags bare sids under `.peaks/_runtime/` that fail the
|
|
5
|
+
* `isValidSessionId` regex. The reducer skips canonical system
|
|
6
|
+
* subdirs that intentionally live under `.peaks/_runtime/`
|
|
7
|
+
* (e.g. `change/`, which routes reviewable artifacts per F3).
|
|
8
|
+
*
|
|
9
|
+
* Slice 2026-06-24-doctor-1xdetector-residual regression net: the
|
|
10
|
+
* reducer MUST exclude `change/` (and other system subdirs added
|
|
11
|
+
* by future F3 changes) — without the exclude-list the doctor
|
|
12
|
+
* flips the summary to fail on every clean workspace, which broke
|
|
13
|
+
* 7 doctor-family tests.
|
|
14
|
+
*
|
|
15
|
+
* When `.peaks/_runtime/` does not exist, the check passes
|
|
16
|
+
* (nothing to scan).
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { getErrorMessage } from 'peaks-loop-shared/result';
|
|
21
|
+
/**
|
|
22
|
+
* Canonical system subdirs that intentionally live under
|
|
23
|
+
* `.peaks/_runtime/` and must NOT be flagged as orphan sessions.
|
|
24
|
+
*
|
|
25
|
+
* `change/` is the routing target for change-id reviewable
|
|
26
|
+
* artifacts per F3 audit-p1. Adding a new entry here requires
|
|
27
|
+
* also updating `RUNTIME_SYSTEM_SUBDIRS_DOC` in the comments
|
|
28
|
+
* below so the next maintainer knows why each entry is listed.
|
|
29
|
+
*/
|
|
30
|
+
const RUNTIME_SYSTEM_SUBDIRS = new Set(['change']);
|
|
31
|
+
function run({ resolvedL3Root, isValidSessionId }) {
|
|
32
|
+
try {
|
|
33
|
+
const runtimeDir = join(resolvedL3Root, '.peaks/_runtime');
|
|
34
|
+
if (!existsSync(runtimeDir)) {
|
|
35
|
+
return [{
|
|
36
|
+
id: 'L3:l3-orphan-sessions',
|
|
37
|
+
ok: true,
|
|
38
|
+
message: 'No .peaks/_runtime/ directory; nothing to check.'
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
const entries = readdirSync(runtimeDir, { withFileTypes: true })
|
|
42
|
+
.filter((e) => e.isDirectory())
|
|
43
|
+
.map((e) => e.name)
|
|
44
|
+
.filter((name) => !RUNTIME_SYSTEM_SUBDIRS.has(name));
|
|
45
|
+
const validSids = entries.filter((sid) => isValidSessionId(sid));
|
|
46
|
+
const invalidSids = entries.filter((sid) => !isValidSessionId(sid));
|
|
47
|
+
return [{
|
|
48
|
+
id: 'L3:l3-orphan-sessions',
|
|
49
|
+
ok: invalidSids.length === 0,
|
|
50
|
+
message: invalidSids.length === 0
|
|
51
|
+
? `All ${validSids.length} session(s) under .peaks/_runtime/ are valid (isValidSessionId)`
|
|
52
|
+
: `${invalidSids.length} orphan session(s) under .peaks/_runtime/ fail isValidSessionId: ${invalidSids.slice(0, 5).join(', ')}${invalidSids.length > 5 ? '...' : ''}. Run \`peaks workspace clean --project <repo>\` to archive.`
|
|
53
|
+
}];
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return [{
|
|
57
|
+
id: 'L3:l3-orphan-sessions',
|
|
58
|
+
ok: true,
|
|
59
|
+
message: `L3:l3-orphan-sessions probe failed (${getErrorMessage(error)}); skipping check`
|
|
60
|
+
}];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export const check = {
|
|
64
|
+
name: 'l3-orphan-sessions',
|
|
65
|
+
run
|
|
66
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: foundation schemas are valid JSON (`schema:<file>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per `requiredSchemaFiles` entry. Passes
|
|
5
|
+
* when the file parses as JSON; fails with the parse error message
|
|
6
|
+
* (so the operator sees e.g. "Unexpected token } in JSON at position
|
|
7
|
+
* 42" rather than a generic "invalid").
|
|
8
|
+
*/
|
|
9
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
10
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: foundation schemas are valid JSON (`schema:<file>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per `requiredSchemaFiles` entry. Passes
|
|
5
|
+
* when the file parses as JSON; fails with the parse error message
|
|
6
|
+
* (so the operator sees e.g. "Unexpected token } in JSON at position
|
|
7
|
+
* 42" rather than a generic "invalid").
|
|
8
|
+
*/
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import { readText } from 'peaks-loop-shared/fs';
|
|
11
|
+
import { requiredSchemaFiles } from 'peaks-loop-shared/paths';
|
|
12
|
+
import { getErrorMessage } from 'peaks-loop-shared/result';
|
|
13
|
+
async function run({ schemaRoot }) {
|
|
14
|
+
const checks = [];
|
|
15
|
+
for (const schemaFile of requiredSchemaFiles) {
|
|
16
|
+
try {
|
|
17
|
+
JSON.parse(await readText(join(schemaRoot, schemaFile)));
|
|
18
|
+
checks.push({ id: `schema:${schemaFile}`, ok: true, message: `Schema ${schemaFile} is valid JSON` });
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
checks.push({
|
|
22
|
+
id: `schema:${schemaFile}`,
|
|
23
|
+
ok: false,
|
|
24
|
+
message: `Schema ${schemaFile} is missing or invalid: ${getErrorMessage(error)}`
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return checks;
|
|
29
|
+
}
|
|
30
|
+
export const check = {
|
|
31
|
+
name: 'schema-validity',
|
|
32
|
+
run
|
|
33
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: destructive `--apply` commands in the runbook carry an
|
|
3
|
+
* authorization/dry-run note (`skill-apply-note:<skill-name>`).
|
|
4
|
+
*
|
|
5
|
+
* Emits one `DoctorCheck` per *required* skill that has a
|
|
6
|
+
* `## Default runbook` section. The check extracts the runbook
|
|
7
|
+
* section, scans it for known destructive `--apply` patterns
|
|
8
|
+
* (`peaks memory sync --apply`, `peaks openspec archive --apply`,
|
|
9
|
+
* etc.), and requires an authorization-style note when any match
|
|
10
|
+
* is found. Skills with no destructive `--apply` commands emit a
|
|
11
|
+
* passing "no destructive --apply commands to gate" check so the
|
|
12
|
+
* CLI summary still surfaces a 1:1 row per required skill.
|
|
13
|
+
*
|
|
14
|
+
* The destructive-apply regex table and authorization keyword regex
|
|
15
|
+
* live in this file (not a shared util) because they are doctor-
|
|
16
|
+
* internal heuristics; the CLI's `runs/apply.ts` has its own
|
|
17
|
+
* (slightly different) authorisation gate.
|
|
18
|
+
*/
|
|
19
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
20
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: destructive `--apply` commands in the runbook carry an
|
|
3
|
+
* authorization/dry-run note (`skill-apply-note:<skill-name>`).
|
|
4
|
+
*
|
|
5
|
+
* Emits one `DoctorCheck` per *required* skill that has a
|
|
6
|
+
* `## Default runbook` section. The check extracts the runbook
|
|
7
|
+
* section, scans it for known destructive `--apply` patterns
|
|
8
|
+
* (`peaks memory sync --apply`, `peaks openspec archive --apply`,
|
|
9
|
+
* etc.), and requires an authorization-style note when any match
|
|
10
|
+
* is found. Skills with no destructive `--apply` commands emit a
|
|
11
|
+
* passing "no destructive --apply commands to gate" check so the
|
|
12
|
+
* CLI summary still surfaces a 1:1 row per required skill.
|
|
13
|
+
*
|
|
14
|
+
* The destructive-apply regex table and authorization keyword regex
|
|
15
|
+
* live in this file (not a shared util) because they are doctor-
|
|
16
|
+
* internal heuristics; the CLI's `runs/apply.ts` has its own
|
|
17
|
+
* (slightly different) authorisation gate.
|
|
18
|
+
*/
|
|
19
|
+
import { readText } from 'peaks-loop-shared/fs';
|
|
20
|
+
import { requiredSkillNames } from 'peaks-loop-shared/paths';
|
|
21
|
+
import { getErrorMessage } from 'peaks-loop-shared/result';
|
|
22
|
+
const REQUIRED_SKILL_NAMES = new Set(requiredSkillNames);
|
|
23
|
+
const DESTRUCTIVE_APPLY_PATTERNS = [
|
|
24
|
+
/peaks\s+memory\s+sync[^\n]*--apply/,
|
|
25
|
+
/peaks\s+memory\s+extract[^\n]*--apply/,
|
|
26
|
+
/peaks\s+artifacts\s+sync[^\n]*--apply/,
|
|
27
|
+
/peaks\s+openspec\s+archive[^\n]*--apply/,
|
|
28
|
+
/peaks\s+standards\s+(?:init|update)[^\n]*--apply/
|
|
29
|
+
];
|
|
30
|
+
const AUTHORIZATION_KEYWORDS_PATTERN = /authoriz|explicit|--dry-run|approv|only after|only when/i;
|
|
31
|
+
function extractRunbookSection(body) {
|
|
32
|
+
const match = /## Default runbook\n+([\s\S]*?)(?=\n## |$)/.exec(body);
|
|
33
|
+
return match === null ? null : (match[1] ?? null);
|
|
34
|
+
}
|
|
35
|
+
function findDestructiveApplyLines(section) {
|
|
36
|
+
const lines = section.split(/\r?\n/);
|
|
37
|
+
return lines.filter((line) => DESTRUCTIVE_APPLY_PATTERNS.some((pattern) => pattern.test(line)));
|
|
38
|
+
}
|
|
39
|
+
async function run({ registry }) {
|
|
40
|
+
const checks = [];
|
|
41
|
+
for (const skill of registry.skills) {
|
|
42
|
+
if (!REQUIRED_SKILL_NAMES.has(skill.name)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const body = await readText(skill.skillPath);
|
|
47
|
+
const runbookSection = extractRunbookSection(body);
|
|
48
|
+
if (runbookSection === null) {
|
|
49
|
+
// No runbook section → the runbook check is the canonical
|
|
50
|
+
// signal for this failure; we intentionally do NOT emit a
|
|
51
|
+
// second `skill-apply-note:<name>` here so the doctor
|
|
52
|
+
// summary surfaces exactly one row per required skill.
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const destructiveLines = findDestructiveApplyLines(runbookSection);
|
|
56
|
+
if (destructiveLines.length === 0) {
|
|
57
|
+
checks.push({
|
|
58
|
+
id: `skill-apply-note:${skill.name}`,
|
|
59
|
+
ok: true,
|
|
60
|
+
message: `Skill ${skill.name} runbook has no destructive --apply commands to gate`
|
|
61
|
+
});
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const hasAuthorizationNote = AUTHORIZATION_KEYWORDS_PATTERN.test(runbookSection);
|
|
65
|
+
checks.push({
|
|
66
|
+
id: `skill-apply-note:${skill.name}`,
|
|
67
|
+
ok: hasAuthorizationNote,
|
|
68
|
+
message: hasAuthorizationNote
|
|
69
|
+
? `Skill ${skill.name} gates ${destructiveLines.length} destructive --apply command(s) with an authorization note`
|
|
70
|
+
: `Skill ${skill.name} has ${destructiveLines.length} destructive --apply command(s) without an authorization/dry-run note in the runbook section`
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
// Mirror the legacy behaviour: a read failure surfaces as a
|
|
75
|
+
// runbook failure (already emitted by the runbook check) and
|
|
76
|
+
// does NOT double-report here.
|
|
77
|
+
void getErrorMessage(error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return checks;
|
|
81
|
+
}
|
|
82
|
+
export const check = {
|
|
83
|
+
name: 'skill-apply-note',
|
|
84
|
+
run
|
|
85
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill existence (`skill:<name>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per `requiredSkillNames` entry. The check
|
|
5
|
+
* passes when the loaded registry contains a skill whose `name`
|
|
6
|
+
* equals the required skill name. Fails with an actionable message
|
|
7
|
+
* identifying which required skill is missing.
|
|
8
|
+
*
|
|
9
|
+
* The required skill names come from `peaks-loop-shared/paths` so the
|
|
10
|
+
* doctor and the CLI agree on what "required" means.
|
|
11
|
+
*/
|
|
12
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
13
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill existence (`skill:<name>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per `requiredSkillNames` entry. The check
|
|
5
|
+
* passes when the loaded registry contains a skill whose `name`
|
|
6
|
+
* equals the required skill name. Fails with an actionable message
|
|
7
|
+
* identifying which required skill is missing.
|
|
8
|
+
*
|
|
9
|
+
* The required skill names come from `peaks-loop-shared/paths` so the
|
|
10
|
+
* doctor and the CLI agree on what "required" means.
|
|
11
|
+
*/
|
|
12
|
+
import { requiredSkillNames } from 'peaks-loop-shared/paths';
|
|
13
|
+
function run({ registry }) {
|
|
14
|
+
const skillNames = new Set(registry.skills.map((skill) => skill.name));
|
|
15
|
+
const checks = [];
|
|
16
|
+
for (const requiredSkill of requiredSkillNames) {
|
|
17
|
+
checks.push({
|
|
18
|
+
id: `skill:${requiredSkill}`,
|
|
19
|
+
ok: skillNames.has(requiredSkill),
|
|
20
|
+
message: skillNames.has(requiredSkill)
|
|
21
|
+
? `Required skill ${requiredSkill} exists`
|
|
22
|
+
: `Missing required skill ${requiredSkill}`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return checks;
|
|
26
|
+
}
|
|
27
|
+
export const check = {
|
|
28
|
+
name: 'skill-existence',
|
|
29
|
+
run
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill name matches its directory (`skill-name:<directory>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per loaded skill. Passes when the parsed
|
|
5
|
+
* frontmatter `name` matches the on-disk directory name. A mismatch
|
|
6
|
+
* is a hard failure — the LLM picks skills by directory, so a drift
|
|
7
|
+
* between name and directory would silently lose routing.
|
|
8
|
+
*/
|
|
9
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
10
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill name matches its directory (`skill-name:<directory>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per loaded skill. Passes when the parsed
|
|
5
|
+
* frontmatter `name` matches the on-disk directory name. A mismatch
|
|
6
|
+
* is a hard failure — the LLM picks skills by directory, so a drift
|
|
7
|
+
* between name and directory would silently lose routing.
|
|
8
|
+
*/
|
|
9
|
+
function run({ registry }) {
|
|
10
|
+
const checks = [];
|
|
11
|
+
for (const skill of registry.skills) {
|
|
12
|
+
checks.push({
|
|
13
|
+
id: `skill-name:${skill.directory}`,
|
|
14
|
+
ok: skill.name === skill.directory,
|
|
15
|
+
message: skill.name === skill.directory
|
|
16
|
+
? `Skill ${skill.name} matches its directory`
|
|
17
|
+
: `Skill ${skill.directory} declares mismatched name ${skill.name}`
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return checks;
|
|
21
|
+
}
|
|
22
|
+
export const check = {
|
|
23
|
+
name: 'skill-name-match',
|
|
24
|
+
run
|
|
25
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill parse failures (`skill-parse:<directory>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per registry failure (one per skill whose
|
|
5
|
+
* SKILL.md frontmatter did not parse). All checks fail — the skill
|
|
6
|
+
* is unusable, so the doctor surfaces it. The message echoes the
|
|
7
|
+
* parse error so the operator can locate the broken metadata.
|
|
8
|
+
*/
|
|
9
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
10
|
+
export declare const check: DoctorCheckPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill parse failures (`skill-parse:<directory>`).
|
|
3
|
+
*
|
|
4
|
+
* Emits one `DoctorCheck` per registry failure (one per skill whose
|
|
5
|
+
* SKILL.md frontmatter did not parse). All checks fail — the skill
|
|
6
|
+
* is unusable, so the doctor surfaces it. The message echoes the
|
|
7
|
+
* parse error so the operator can locate the broken metadata.
|
|
8
|
+
*/
|
|
9
|
+
function run({ registry }) {
|
|
10
|
+
return registry.failures.map((failure) => ({
|
|
11
|
+
id: `skill-parse:${failure.directory}`,
|
|
12
|
+
ok: false,
|
|
13
|
+
message: `Skill ${failure.directory} has invalid metadata: ${failure.message}`
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
export const check = {
|
|
17
|
+
name: 'skill-parse',
|
|
18
|
+
run
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check: skill presence current + freshness
|
|
3
|
+
* (`skill-presence:current` and `skill-presence:freshness`).
|
|
4
|
+
*
|
|
5
|
+
* Two checks sharing one read of the `presence` context field.
|
|
6
|
+
* - `skill-presence:current` is informational: passes when the
|
|
7
|
+
* presence is wired, with a message describing the active
|
|
8
|
+
* skill / mode / gate / setAt. When no presence is wired, it
|
|
9
|
+
* also passes (absence is the common case outside peaks-qa
|
|
10
|
+
* flows).
|
|
11
|
+
* - `skill-presence:freshness` is the operational gate: fails
|
|
12
|
+
* when the presence's `setAt` is older than the freshness
|
|
13
|
+
* threshold (default 24h) OR when `setAt` is unparsable. When
|
|
14
|
+
* no presence is wired it passes trivially ("nothing to age-
|
|
15
|
+
* check").
|
|
16
|
+
*
|
|
17
|
+
* Both checks share the presence signal computed once in
|
|
18
|
+
* `index.ts`; the legacy monolithic function probed it inline.
|
|
19
|
+
*/
|
|
20
|
+
import type { DoctorCheckPlugin } from '../types.js';
|
|
21
|
+
export declare const check: DoctorCheckPlugin;
|