peaks-loop 4.0.54 → 4.1.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 +61 -0
- package/README-en.md +16 -1
- package/README.md +15 -1
- package/config/eslint/.peaks-rules.cjs +158 -13
- package/config/eslint/tsconfig.lint.json +47 -0
- package/dist/cli/cli-envelope.d.ts +114 -0
- package/dist/cli/cli-envelope.js +85 -0
- package/dist/cli/cli-helpers.d.ts +1 -1
- package/dist/cli/cli-helpers.js +8 -4
- package/dist/cli/commands/_cli-error-envelope.js +1 -1
- package/dist/cli/commands/_register.js +86 -39
- package/dist/cli/commands/_super.js +40 -7
- package/dist/cli/commands/adapter-commands-s2a.js +8 -7
- package/dist/cli/commands/adapter-commands.d.ts +2 -2
- package/dist/cli/commands/adapter-commands.js +7 -8
- package/dist/cli/commands/api-diff-commands.js +5 -4
- package/dist/cli/commands/asset-commands.d.ts +2 -2
- package/dist/cli/commands/asset-commands.js +135 -132
- package/dist/cli/commands/audit-commands.d.ts +1 -1
- package/dist/cli/commands/audit-commands.js +75 -32
- package/dist/cli/commands/autonomous-swarm-commands.d.ts +1 -1
- package/dist/cli/commands/autonomous-swarm-commands.js +14 -8
- package/dist/cli/commands/baseline-commands.js +34 -9
- package/dist/cli/commands/bee-commands.d.ts +1 -1
- package/dist/cli/commands/bee-commands.js +18 -21
- package/dist/cli/commands/best-practice-scan-command.js +6 -34
- package/dist/cli/commands/best-practice-scan-helpers.d.ts +12 -0
- package/dist/cli/commands/best-practice-scan-helpers.js +37 -0
- package/dist/cli/commands/capability-commands.d.ts +1 -1
- package/dist/cli/commands/capability-commands.js +14 -4
- package/dist/cli/commands/capability-worker-config-sc-commands.d.ts +1 -1
- package/dist/cli/commands/changeset-commands.js +21 -18
- package/dist/cli/commands/code-gate-command.js +9 -2
- package/dist/cli/commands/code-job-shape-commands-read-job-shape.d.ts +15 -0
- package/dist/cli/commands/code-job-shape-commands-read-job-shape.js +70 -0
- package/dist/cli/commands/code-job-shape-commands.js +21 -45
- package/dist/cli/commands/code-mode-gate-commands.d.ts +15 -1
- package/dist/cli/commands/code-mode-gate-commands.js +19 -199
- package/dist/cli/commands/code-mode-gate-plan-command.d.ts +14 -0
- package/dist/cli/commands/code-mode-gate-plan-command.js +23 -0
- package/dist/cli/commands/code-mode-gate-should-pause-command.d.ts +24 -0
- package/dist/cli/commands/code-mode-gate-should-pause-command.js +137 -0
- package/dist/cli/commands/code-mode-gate-should-pause-envelope.d.ts +59 -0
- package/dist/cli/commands/code-mode-gate-should-pause-envelope.js +144 -0
- package/dist/cli/commands/code-orchestrator-can-do.js +4 -4
- package/dist/cli/commands/code-review-commands.js +18 -3
- package/dist/cli/commands/code-run-command.js +44 -7
- package/dist/cli/commands/code-runtime-commands.d.ts +17 -0
- package/dist/cli/commands/code-runtime-commands.js +105 -73
- package/dist/cli/commands/codegraph-commands.js +11 -6
- package/dist/cli/commands/codegraph-status-command.js +6 -2
- package/dist/cli/commands/comments-commands.d.ts +14 -0
- package/dist/cli/commands/comments-commands.js +96 -0
- package/dist/cli/commands/compact-command.js +52 -26
- package/dist/cli/commands/complexity-commands.js +6 -7
- package/dist/cli/commands/config-commands.d.ts +1 -1
- package/dist/cli/commands/config-commands.js +33 -9
- package/dist/cli/commands/container-commands.js +39 -15
- package/dist/cli/commands/context-commands.d.ts +1 -1
- package/dist/cli/commands/context-commands.js +40 -13
- package/dist/cli/commands/core/artifacts-command.js +11 -3
- package/dist/cli/commands/core/binding-commands.js +9 -6
- package/dist/cli/commands/core/doctor-command.js +7 -4
- package/dist/cli/commands/core/memory-command.js +57 -21
- package/dist/cli/commands/core/proxy-command.js +3 -1
- package/dist/cli/commands/core/session-command.js +16 -8
- package/dist/cli/commands/core/skill-command.js +32 -17
- package/dist/cli/commands/core/standards-command.js +56 -14
- package/dist/cli/commands/cron-commands-actions.d.ts +43 -0
- package/dist/cli/commands/cron-commands-actions.js +128 -0
- package/dist/cli/commands/cron-commands-schedule.d.ts +86 -0
- package/dist/cli/commands/cron-commands-schedule.js +151 -0
- package/dist/cli/commands/cron-commands.d.ts +35 -32
- package/dist/cli/commands/cron-commands.js +167 -211
- package/dist/cli/commands/cron-scheduler-commands.js +40 -20
- package/dist/cli/commands/cron-scheduler-persist.d.ts +110 -0
- package/dist/cli/commands/cron-scheduler-persist.js +171 -0
- package/dist/cli/commands/dashboard-long-run.js +45 -14
- package/dist/cli/commands/dashboard-summary.js +15 -5
- package/dist/cli/commands/dispatch-commands.js +65 -32
- package/dist/cli/commands/dispatch-from-dag.js +9 -10
- package/dist/cli/commands/doc-commands.js +8 -9
- package/dist/cli/commands/doctor/invoke-from-code.js +1 -1
- package/dist/cli/commands/e2e-verify-env.d.ts +19 -0
- package/dist/cli/commands/e2e-verify-env.js +19 -0
- package/dist/cli/commands/e2e-verify.d.ts +3 -14
- package/dist/cli/commands/e2e-verify.js +49 -29
- package/dist/cli/commands/ecc-commands.d.ts +18 -23
- package/dist/cli/commands/ecc-commands.js +39 -36
- package/dist/cli/commands/evidence-commands.js +10 -6
- package/dist/cli/commands/evolution-commands.d.ts +2 -2
- package/dist/cli/commands/evolution-commands.js +109 -115
- package/dist/cli/commands/feedback-commands-helpers.d.ts +22 -0
- package/dist/cli/commands/feedback-commands-helpers.js +33 -0
- package/dist/cli/commands/feedback-commands.js +15 -38
- package/dist/cli/commands/final-review-commands.d.ts +1 -1
- package/dist/cli/commands/final-review-commands.js +24 -22
- package/dist/cli/commands/fixture-commands.d.ts +1 -1
- package/dist/cli/commands/fixture-commands.js +17 -6
- package/dist/cli/commands/fork-commands-sync-verify.d.ts +12 -0
- package/dist/cli/commands/fork-commands-sync-verify.js +72 -0
- package/dist/cli/commands/fork-commands.js +19 -51
- package/dist/cli/commands/fresh-context-commands.js +3 -1
- package/dist/cli/commands/gate-commands-enforce.d.ts +82 -0
- package/dist/cli/commands/gate-commands-enforce.js +210 -0
- package/dist/cli/commands/gate-commands.d.ts +1 -1
- package/dist/cli/commands/gate-commands.js +85 -205
- package/dist/cli/commands/governance-classify-contract-commands.d.ts +1 -1
- package/dist/cli/commands/governance-classify-contract-commands.js +28 -17
- package/dist/cli/commands/heartbeat-commands-action.d.ts +7 -0
- package/dist/cli/commands/heartbeat-commands-action.js +192 -0
- package/dist/cli/commands/heartbeat-commands-validation.d.ts +57 -0
- package/dist/cli/commands/heartbeat-commands-validation.js +120 -0
- package/dist/cli/commands/heartbeat-commands.d.ts +27 -6
- package/dist/cli/commands/heartbeat-commands.js +19 -198
- package/dist/cli/commands/hook-handle.d.ts +1 -1
- package/dist/cli/commands/hook-handle.js +46 -13
- package/dist/cli/commands/hooks-commands.d.ts +1 -1
- package/dist/cli/commands/hooks-commands.js +18 -6
- package/dist/cli/commands/ide-commands.d.ts +1 -1
- package/dist/cli/commands/ide-commands.js +5 -3
- package/dist/cli/commands/impact-commands.js +8 -2
- package/dist/cli/commands/job-add-slice-command.d.ts +43 -0
- package/dist/cli/commands/job-add-slice-command.js +151 -0
- package/dist/cli/commands/job-commands.d.ts +64 -0
- package/dist/cli/commands/job-commands.js +134 -63
- package/dist/cli/commands/lease-metrics-commands-support.d.ts +73 -0
- package/dist/cli/commands/lease-metrics-commands-support.js +67 -0
- package/dist/cli/commands/lease-metrics-commands.d.ts +3 -44
- package/dist/cli/commands/lease-metrics-commands.js +21 -61
- package/dist/cli/commands/lease-stats-commands.d.ts +1 -1
- package/dist/cli/commands/lease-stats-commands.js +9 -6
- package/dist/cli/commands/lint-commands.d.ts +9 -3
- package/dist/cli/commands/lint-commands.js +15 -8
- package/dist/cli/commands/log-commands.d.ts +1 -1
- package/dist/cli/commands/log-commands.js +8 -6
- package/dist/cli/commands/loop-commands.d.ts +1 -1
- package/dist/cli/commands/loop-commands.js +50 -50
- package/dist/cli/commands/loop-eval-commands.d.ts +1 -1
- package/dist/cli/commands/loop-eval-commands.js +101 -30
- package/dist/cli/commands/memory-commands.js +21 -13
- package/dist/cli/commands/migrate-1-4-1-command.js +1 -1
- package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +2 -2
- package/dist/cli/commands/mut-commands-helpers.d.ts +30 -0
- package/dist/cli/commands/mut-commands-helpers.js +43 -0
- package/dist/cli/commands/mut-commands.js +16 -58
- package/dist/cli/commands/observability-commands-queries.d.ts +37 -0
- package/dist/cli/commands/observability-commands-queries.js +113 -0
- package/dist/cli/commands/observability-commands.d.ts +1 -1
- package/dist/cli/commands/observability-commands.js +7 -92
- package/dist/cli/commands/openspec-commands.d.ts +1 -1
- package/dist/cli/commands/openspec-commands.js +20 -8
- package/dist/cli/commands/outer-cache-commands.js +18 -7
- package/dist/cli/commands/perf-audit-commands.d.ts +1 -1
- package/dist/cli/commands/perf-audit-commands.js +12 -7
- package/dist/cli/commands/perf-commands.d.ts +1 -1
- package/dist/cli/commands/perf-commands.js +5 -5
- package/dist/cli/commands/playwright-commands.d.ts +1 -1
- package/dist/cli/commands/playwright-commands.js +20 -8
- package/dist/cli/commands/polyrepo-commands.js +21 -19
- package/dist/cli/commands/prd-blocks-commands.js +1 -3
- package/dist/cli/commands/prd-commands.d.ts +1 -1
- package/dist/cli/commands/prd-commands.js +16 -6
- package/dist/cli/commands/preferences-commands.js +13 -12
- package/dist/cli/commands/primer-command.js +5 -5
- package/dist/cli/commands/project-commands.d.ts +1 -1
- package/dist/cli/commands/project-commands.js +33 -9
- package/dist/cli/commands/qa-business-review-commands.js +16 -12
- package/dist/cli/commands/qa-commands.d.ts +1 -1
- package/dist/cli/commands/qa-commands.js +3 -5
- package/dist/cli/commands/release-commands.d.ts +3 -1
- package/dist/cli/commands/release-commands.js +33 -22
- package/dist/cli/commands/request-commands.js +47 -30
- package/dist/cli/commands/request-format-helpers.js +1 -1
- package/dist/cli/commands/retrospective-commands.d.ts +18 -11
- package/dist/cli/commands/retrospective-commands.js +24 -173
- package/dist/cli/commands/retrospective-index-command.d.ts +26 -0
- package/dist/cli/commands/retrospective-index-command.js +99 -0
- package/dist/cli/commands/retrospective-project-root.d.ts +9 -0
- package/dist/cli/commands/retrospective-project-root.js +15 -0
- package/dist/cli/commands/retrospective-search-command.d.ts +27 -0
- package/dist/cli/commands/retrospective-search-command.js +97 -0
- package/dist/cli/commands/retrospective-show-command.d.ts +23 -0
- package/dist/cli/commands/retrospective-show-command.js +80 -0
- package/dist/cli/commands/reviewer-commands.d.ts +1 -1
- package/dist/cli/commands/role-commands.js +14 -9
- package/dist/cli/commands/runtime-commands.js +14 -7
- package/dist/cli/commands/sc-commands.d.ts +1 -1
- package/dist/cli/commands/sc-commands.js +39 -6
- package/dist/cli/commands/scan-commands.js +36 -13
- package/dist/cli/commands/security-audit-commands.d.ts +1 -1
- package/dist/cli/commands/security-audit-commands.js +12 -7
- package/dist/cli/commands/sediment-commands.d.ts +2 -2
- package/dist/cli/commands/sediment-commands.js +146 -139
- package/dist/cli/commands/session-24h-mode.js +15 -2
- package/dist/cli/commands/session-checkpoint-command.js +1 -1
- package/dist/cli/commands/session-migrate-skill-name.js +1 -1
- package/dist/cli/commands/shadcn-commands.d.ts +1 -1
- package/dist/cli/commands/shadcn-commands.js +3 -1
- package/dist/cli/commands/share-commands.js +38 -39
- package/dist/cli/commands/skill-conformance-commands.d.ts +1 -1
- package/dist/cli/commands/skill-conformance-commands.js +1 -1
- package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +16 -17
- package/dist/cli/commands/skill-visibility.js +2 -2
- package/dist/cli/commands/slice-commands.d.ts +1 -1
- package/dist/cli/commands/slice-commands.js +36 -12
- package/dist/cli/commands/slice-integrate-commands.js +6 -7
- package/dist/cli/commands/slice-review-commands-helpers.d.ts +26 -0
- package/dist/cli/commands/slice-review-commands-helpers.js +26 -0
- package/dist/cli/commands/slice-review-commands.js +16 -24
- package/dist/cli/commands/smoke-commands-add-path.d.ts +14 -0
- package/dist/cli/commands/smoke-commands-add-path.js +39 -0
- package/dist/cli/commands/smoke-commands-define.d.ts +18 -0
- package/dist/cli/commands/smoke-commands-define.js +97 -0
- package/dist/cli/commands/smoke-commands-run.d.ts +18 -0
- package/dist/cli/commands/smoke-commands-run.js +119 -0
- package/dist/cli/commands/smoke-commands.d.ts +10 -1
- package/dist/cli/commands/smoke-commands.js +17 -179
- package/dist/cli/commands/sop-commands.d.ts +1 -1
- package/dist/cli/commands/sop-commands.js +38 -10
- package/dist/cli/commands/statusline-commands.d.ts +1 -1
- package/dist/cli/commands/statusline-commands.js +21 -10
- package/dist/cli/commands/sub-agent/detached.js +3 -3
- package/dist/cli/commands/sub-agent-dispatch-guard.d.ts +1 -1
- package/dist/cli/commands/sub-agent-shared.js +1 -1
- package/dist/cli/commands/sub-agent-shutdown-commands.js +17 -9
- package/dist/cli/commands/swarm-commands.d.ts +1 -1
- package/dist/cli/commands/swarm-commands.js +13 -6
- package/dist/cli/commands/tech-commands-helpers.d.ts +37 -0
- package/dist/cli/commands/tech-commands-helpers.js +24 -0
- package/dist/cli/commands/tech-commands.d.ts +2 -29
- package/dist/cli/commands/tech-commands.js +15 -28
- package/dist/cli/commands/test-commands.js +27 -7
- package/dist/cli/commands/user-touchpoint-commands.js +1 -3
- package/dist/cli/commands/verdict-aggregate-command.d.ts +1 -1
- package/dist/cli/commands/verdict-aggregate-command.js +20 -7
- package/dist/cli/commands/vm-commands.js +48 -19
- package/dist/cli/commands/wave-plan-commands.js +5 -2
- package/dist/cli/commands/web-commands.js +14 -4
- package/dist/cli/commands/web-lifecycle-commands.js +5 -3
- package/dist/cli/commands/workflow-commands.d.ts +1 -1
- package/dist/cli/commands/workflow-commands.js +64 -29
- package/dist/cli/commands/workflow-lifecycle-commands.js +19 -17
- package/dist/cli/commands/workflow-plan-commands-actions.d.ts +20 -0
- package/dist/cli/commands/workflow-plan-commands-actions.js +115 -0
- package/dist/cli/commands/workflow-plan-commands-session.d.ts +17 -0
- package/dist/cli/commands/workflow-plan-commands-session.js +59 -0
- package/dist/cli/commands/workflow-plan-commands.d.ts +10 -21
- package/dist/cli/commands/workflow-plan-commands.js +15 -141
- package/dist/cli/commands/workspace/clean-command.js +4 -1
- package/dist/cli/commands/workspace/helpers.js +2 -1
- package/dist/cli/commands/workspace/init-command.js +80 -20
- package/dist/cli/commands/workspace/reconcile-command.js +3 -1
- package/dist/cli/commands/workspace-commands.d.ts +1 -1
- package/dist/cli/commands/workspace-commands.js +1 -1
- package/dist/cli/commands/worktree-auth-commands.d.ts +1 -1
- package/dist/cli/commands/worktree-auth-commands.js +16 -169
- package/dist/cli/commands/worktree-auth-grant-command.d.ts +14 -0
- package/dist/cli/commands/worktree-auth-grant-command.js +118 -0
- package/dist/cli/commands/worktree-auth-manage-commands.d.ts +17 -0
- package/dist/cli/commands/worktree-auth-manage-commands.js +128 -0
- package/dist/cli/commands/worktree-lease-commands.d.ts +1 -1
- package/dist/cli/commands/worktree-lease-commands.js +65 -37
- package/dist/cli/index.js +6 -2
- package/dist/cli/program.js +8 -10
- package/dist/hooks/pre-tool-use-sub-agent.js +1 -6
- package/dist/reporters/bdd-reporter.js +9 -3
- package/dist/services/24h-mode/auto-engage.d.ts +19 -0
- package/dist/services/24h-mode/auto-engage.js +35 -0
- package/dist/services/24h-mode/decider.js +5 -1
- package/dist/services/24h-mode/store.js +4 -2
- package/dist/services/adapter/adapter-registry.js +20 -8
- package/dist/services/adapter/adapter.d.ts +2 -2
- package/dist/services/adapter/auto-adapter.d.ts +2 -2
- package/dist/services/adapter/auto-adapter.js +1 -1
- package/dist/services/adapter/claude-adapter.d.ts +1 -1
- package/dist/services/adapter/claude-adapter.js +8 -8
- package/dist/services/adapter/codex-adapter.d.ts +2 -2
- package/dist/services/adapter/codex-adapter.js +20 -8
- package/dist/services/adapter/copilot-adapter.d.ts +2 -2
- package/dist/services/adapter/copilot-adapter.js +20 -8
- package/dist/services/artifacts/artifact-prerequisites.js +10 -8
- package/dist/services/artifacts/artifact-service.js +3 -1
- package/dist/services/artifacts/artifact-template-bodies.d.ts +12 -0
- package/dist/services/artifacts/artifact-template-bodies.js +165 -0
- package/dist/services/artifacts/artifact-templates.js +26 -168
- package/dist/services/artifacts/request-artifact-service.js +14 -7
- package/dist/services/artifacts/request-artifact-state-helpers.d.ts +3 -2
- package/dist/services/artifacts/request-artifact-state-helpers.js +3 -5
- package/dist/services/artifacts/workspace-artifact-helpers.d.ts +28 -0
- package/dist/services/artifacts/workspace-artifact-helpers.js +54 -0
- package/dist/services/artifacts/workspace-service.d.ts +3 -22
- package/dist/services/artifacts/workspace-service.js +10 -60
- package/dist/services/audit/artifact-writer.js +21 -21
- package/dist/services/audit/audit-goal-service.js +2 -2
- package/dist/services/audit/backing-detector.js +7 -4
- package/dist/services/audit/classifier.js +3 -3
- package/dist/services/audit/decision-writer.js +13 -9
- package/dist/services/audit/enforcers/active-skill-resolver.js +15 -7
- package/dist/services/audit/enforcers/design-draft-confirm.js +4 -4
- package/dist/services/audit/enforcers/lint-audit-regression.js +10 -5
- package/dist/services/audit/enforcers/lint-bee-runtime-contract.js +16 -8
- package/dist/services/audit/enforcers/lint-catalog-governance.js +8 -4
- package/dist/services/audit/enforcers/lint-output-style.js +4 -2
- package/dist/services/audit/enforcers/lint-peaks-code-runtime.js +8 -3
- package/dist/services/audit/enforcers/lint-peaks-skill-runtime.js +8 -3
- package/dist/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.js +20 -20
- package/dist/services/audit/enforcers/lint-prd-artifact-handoff.js +5 -5
- package/dist/services/audit/enforcers/lint-prd-source-snapshot.d.ts +1 -1
- package/dist/services/audit/enforcers/lint-prd-source-snapshot.js +5 -5
- package/dist/services/audit/enforcers/lint-qa-gateguard-and-runtime.js +10 -10
- package/dist/services/audit/enforcers/lint-rd-handoff-coverage.js +10 -8
- package/dist/services/audit/enforcers/lint-reference-shape.js +50 -18
- package/dist/services/audit/enforcers/lint-skill-presence-mandatory.js +5 -5
- package/dist/services/audit/enforcers/lint-style.js +44 -11
- package/dist/services/audit/enforcers/lint-workflow-shape.js +4 -2
- package/dist/services/audit/enforcers/login-gate.js +2 -6
- package/dist/services/audit/enforcers/mock-placement.js +2 -2
- package/dist/services/audit/enforcers/no-root-pollution.js +38 -9
- package/dist/services/audit/enforcers/pre-rd-scan.js +1 -1
- package/dist/services/audit/enforcers/prototype-fidelity.js +1 -1
- package/dist/services/audit/enforcers/resume-detection.js +5 -4
- package/dist/services/audit/prose-ratio-calculator.js +1 -1
- package/dist/services/audit/red-line-catalog-p2-a-bee-runtime.d.ts +39 -0
- package/dist/services/audit/red-line-catalog-p2-a-bee-runtime.js +205 -0
- package/dist/services/audit/red-line-catalog-p2-a-lint-style.d.ts +52 -0
- package/dist/services/audit/red-line-catalog-p2-a-lint-style.js +205 -0
- package/dist/services/audit/red-line-catalog-p2-a.js +3 -374
- package/dist/services/audit/red-line-catalog-p2-b.js +26 -26
- package/dist/services/audit/red-line-catalog.js +26 -38
- package/dist/services/audit/red-lines-service.js +64 -49
- package/dist/services/audit/scanners/openspec-scanner.js +2 -2
- package/dist/services/audit/scanners/rules-tree-scanner.js +2 -2
- package/dist/services/audit/scanners/skills-tree-scanner.js +2 -2
- package/dist/services/audit/static-service.js +3 -3
- package/dist/services/audit-independent/index.d.ts +2 -2
- package/dist/services/audit-independent/index.js +2 -2
- package/dist/services/audit-independent/perf-audit-service.js +19 -8
- package/dist/services/audit-independent/security-audit-service.js +31 -16
- package/dist/services/autonomous-swarm/autonomous-swarm-service.js +75 -46
- package/dist/services/best-practice/output-formatter.js +7 -1
- package/dist/services/capability-audit-service/cross-check.js +11 -5
- package/dist/services/capability-audit-service/runner.js +15 -7
- package/dist/services/capability-baseline/store.js +16 -4
- package/dist/services/capability-baseline/types.js +15 -3
- package/dist/services/capability-baseline/validator.js +43 -7
- package/dist/services/capability-guard-runner/contracts/J02.js +36 -6
- package/dist/services/capability-guard-runner/contracts/J03.js +20 -11
- package/dist/services/capability-guard-runner/contracts/J04.js +24 -15
- package/dist/services/capability-guard-runner/contracts/J05.js +26 -10
- package/dist/services/capability-guard-runner/contracts/J07.js +8 -2
- package/dist/services/capability-guard-runner/contracts/J08.js +22 -5
- package/dist/services/capability-guard-runner/contracts/J10.js +6 -2
- package/dist/services/capability-guard-runner/contracts/J11.d.ts +5 -0
- package/dist/services/capability-guard-runner/contracts/J11.js +14 -2
- package/dist/services/capability-guard-runner/contracts/J12.js +12 -3
- package/dist/services/capability-guard-runner/diff.js +1 -5
- package/dist/services/changeset/changeset-check-service.js +1 -3
- package/dist/services/classify/classify-service.js +20 -8
- package/dist/services/classify/classify-types.js +22 -9
- package/dist/services/code/auto-compact-lifecycle.js +62 -39
- package/dist/services/code/auto-compact-modes.js +2 -2
- package/dist/services/code/auto-compact-orchestrator.js +14 -9
- package/dist/services/code/batch-heartbeat-poller.d.ts +10 -0
- package/dist/services/code/batch-heartbeat-poller.js +17 -1
- package/dist/services/code/compact-event-settle-types.d.ts +80 -0
- package/dist/services/code/compact-event-settle-types.js +20 -0
- package/dist/services/code/compact-event-settle.d.ts +3 -68
- package/dist/services/code/compact-event-settle.js +14 -10
- package/dist/services/code/dag-orchestrator.js +32 -26
- package/dist/services/code/job-shape-decision.js +3 -1
- package/dist/services/code/mode-gate-types.d.ts +57 -0
- package/dist/services/code/mode-gate-types.js +66 -0
- package/dist/services/code/mode-gate.d.ts +4 -58
- package/dist/services/code/mode-gate.js +25 -69
- package/dist/services/code/orchestrator-can-do-advisories.d.ts +30 -0
- package/dist/services/code/orchestrator-can-do-advisories.js +81 -0
- package/dist/services/code/orchestrator-can-do-probes.d.ts +30 -0
- package/dist/services/code/orchestrator-can-do-probes.js +77 -0
- package/dist/services/code/orchestrator-can-do.d.ts +11 -22
- package/dist/services/code/orchestrator-can-do.js +37 -137
- package/dist/services/code/post-compact-checkpoint.d.ts +28 -0
- package/dist/services/code/post-compact-checkpoint.js +57 -0
- package/dist/services/code/post-compact-detector.js +16 -48
- package/dist/services/code/step-08-gate.d.ts +4 -3
- package/dist/services/code/step-08-gate.js +21 -9
- package/dist/services/code/user-touchpoint-classifier.js +0 -7
- package/dist/services/code-review/ecc-bridge.d.ts +6 -6
- package/dist/services/code-review/ecc-bridge.js +23 -23
- package/dist/services/codegraph/codegraph-autorefresh.js +56 -39
- package/dist/services/codegraph/codegraph-config-repair-writer.js +4 -1
- package/dist/services/codegraph/codegraph-exclude-integrity.js +4 -1
- package/dist/services/codegraph/codegraph-exclude-repair.js +1 -2
- package/dist/services/codegraph/codegraph-index-integrity.js +1 -1
- package/dist/services/codegraph/codegraph-preflight-service.d.ts +3 -26
- package/dist/services/codegraph/codegraph-preflight-service.js +16 -37
- package/dist/services/codegraph/codegraph-preflight-structure.d.ts +32 -0
- package/dist/services/codegraph/codegraph-preflight-structure.js +33 -0
- package/dist/services/codegraph/codegraph-process-runner.js +12 -1
- package/dist/services/codegraph/codegraph-service.js +9 -1
- package/dist/services/comments/citation-rules.d.ts +154 -0
- package/dist/services/comments/citation-rules.js +241 -0
- package/dist/services/comments/comment-audit.d.ts +57 -0
- package/dist/services/comments/comment-audit.js +100 -0
- package/dist/services/comments/comment-citations.d.ts +60 -0
- package/dist/services/comments/comment-citations.js +186 -0
- package/dist/services/comments/comment-hygiene.d.ts +79 -0
- package/dist/services/comments/comment-hygiene.js +133 -0
- package/dist/services/comments/comment-prune.d.ts +88 -0
- package/dist/services/comments/comment-prune.js +148 -0
- package/dist/services/comments/prune-apply.d.ts +60 -0
- package/dist/services/comments/prune-apply.js +150 -0
- package/dist/services/comments/repo-path-probe.d.ts +43 -0
- package/dist/services/comments/repo-path-probe.js +78 -0
- package/dist/services/compact/request-transition-hook.js +2 -1
- package/dist/services/compact/suggest-service.d.ts +3 -61
- package/dist/services/compact/suggest-service.js +9 -12
- package/dist/services/compact/suggest-types.d.ts +76 -0
- package/dist/services/compact/suggest-types.js +10 -0
- package/dist/services/compact-history/compact-history-service.js +2 -2
- package/dist/services/compact-statusline/compact-lifecycle-store.d.ts +2 -32
- package/dist/services/compact-statusline/compact-lifecycle-store.js +7 -12
- package/dist/services/compact-statusline/compact-lifecycle-types.d.ts +32 -0
- package/dist/services/compact-statusline/compact-lifecycle-types.js +8 -0
- package/dist/services/compact-statusline/compact-statusline-cell-table.d.ts +42 -0
- package/dist/services/compact-statusline/compact-statusline-cell-table.js +63 -0
- package/dist/services/compact-statusline/compact-statusline-service.d.ts +4 -21
- package/dist/services/compact-statusline/compact-statusline-service.js +9 -101
- package/dist/services/compact-statusline/compact-statusline-state.d.ts +4 -0
- package/dist/services/compact-statusline/compact-statusline-state.js +50 -0
- package/dist/services/config/config-migration.js +2 -2
- package/dist/services/config/config-restore.js +1 -1
- package/dist/services/config/config-rollback.js +1 -1
- package/dist/services/config/config-safety.js +28 -10
- package/dist/services/config/config-service.js +114 -31
- package/dist/services/config/model-routing.js +5 -2
- package/dist/services/config/proxy-service.js +6 -1
- package/dist/services/config/workspace-state-service.js +17 -5
- package/dist/services/context/auto-compact-dispatcher-input.d.ts +38 -0
- package/dist/services/context/auto-compact-dispatcher-input.js +9 -0
- package/dist/services/context/auto-compact-dispatcher.d.ts +2 -30
- package/dist/services/context/auto-compact-reader-input.d.ts +30 -0
- package/dist/services/context/auto-compact-reader-input.js +8 -0
- package/dist/services/context/auto-compact-reader.d.ts +2 -24
- package/dist/services/context/auto-compact-reader.js +4 -1
- package/dist/services/context/auto-compact-thresholds.d.ts +54 -0
- package/dist/services/context/auto-compact-thresholds.js +19 -0
- package/dist/services/context/auto-compact-types.d.ts +2 -46
- package/dist/services/context/auto-compact-types.js +1 -11
- package/dist/services/context/build-dispatch-system-prompt.js +2 -2
- package/dist/services/context/collector.js +8 -10
- package/dist/services/context/context-audit-hint.js +7 -5
- package/dist/services/context/context-audit-keys.d.ts +15 -0
- package/dist/services/context/context-audit-keys.js +77 -0
- package/dist/services/context/context-audit-limits.d.ts +20 -0
- package/dist/services/context/context-audit-limits.js +31 -0
- package/dist/services/context/context-audit-scan.d.ts +19 -0
- package/dist/services/context/context-audit-scan.js +246 -0
- package/dist/services/context/context-audit-types.d.ts +65 -0
- package/dist/services/context/context-audit-types.js +10 -0
- package/dist/services/context/context-audit.d.ts +13 -59
- package/dist/services/context/context-audit.js +38 -254
- package/dist/services/context/context-builder.js +4 -4
- package/dist/services/context/context-schema.d.ts +1 -1
- package/dist/services/context/context-schema.js +13 -13
- package/dist/services/context/doc-retriever.js +2 -2
- package/dist/services/context/harness-context-witness.js +43 -24
- package/dist/services/context/harness-window-config.js +27 -7
- package/dist/services/context/ide-detect.js +2 -1
- package/dist/services/context/index.d.ts +1 -1
- package/dist/services/context/memory-index-reader.js +3 -9
- package/dist/services/context/memory-preflight-config.js +3 -5
- package/dist/services/context/memory-preflight-service.d.ts +2 -20
- package/dist/services/context/memory-preflight-service.js +37 -68
- package/dist/services/context/memory-preflight-support.d.ts +48 -0
- package/dist/services/context/memory-preflight-support.js +56 -0
- package/dist/services/context/post-compact-reinjection.js +3 -3
- package/dist/services/context/renderer.js +7 -3
- package/dist/services/context/spillover-store.js +3 -1
- package/dist/services/context/summary-view.js +1 -1
- package/dist/services/context/threshold.js +2 -2
- package/dist/services/context/tokenizer.js +3 -3
- package/dist/services/crystallization/crystallization-brief-schema.d.ts +80 -0
- package/dist/services/crystallization/crystallization-brief-schema.js +159 -0
- package/dist/services/crystallization/crystallization-service.d.ts +7 -7
- package/dist/services/crystallization/crystallization-service.js +56 -55
- package/dist/services/crystallization/crystallization-store.d.ts +2 -2
- package/dist/services/crystallization/crystallization-store.js +37 -20
- package/dist/services/crystallization/crystallization-types.d.ts +4 -56
- package/dist/services/crystallization/crystallization-types.js +31 -184
- package/dist/services/crystallization/evidence-brief-builder.d.ts +3 -3
- package/dist/services/crystallization/evidence-brief-builder.js +32 -38
- package/dist/services/crystallization/index.d.ts +4 -4
- package/dist/services/crystallization/index.js +4 -4
- package/dist/services/dashboard/project-dashboard-service.js +7 -1
- package/dist/services/dispatch/await-batch-helpers.d.ts +55 -0
- package/dist/services/dispatch/await-batch-helpers.js +206 -0
- package/dist/services/dispatch/await-batch.d.ts +50 -7
- package/dist/services/dispatch/await-batch.js +97 -194
- package/dist/services/dispatch/batch-counter.js +2 -1
- package/dist/services/dispatch/conflict-replay.js +2 -2
- package/dist/services/dispatch/contract-store.js +5 -2
- package/dist/services/dispatch/dispatch-record-input-types.d.ts +81 -0
- package/dist/services/dispatch/dispatch-record-input-types.js +1 -0
- package/dist/services/dispatch/dispatch-record-types.d.ts +6 -73
- package/dist/services/dispatch/dispatch-record-upgrade-fields.d.ts +72 -0
- package/dist/services/dispatch/dispatch-record-upgrade-fields.js +242 -0
- package/dist/services/dispatch/dispatch-record-upgrade-guards.d.ts +15 -0
- package/dist/services/dispatch/dispatch-record-upgrade-guards.js +55 -0
- package/dist/services/dispatch/dispatch-record-upgrade.d.ts +2 -4
- package/dist/services/dispatch/dispatch-record-upgrade.js +21 -213
- package/dist/services/dispatch/dispatch-record-writer.js +54 -26
- package/dist/services/dispatch/dispatch-sub-agent.js +7 -2
- package/dist/services/dispatch/e2e-fixtures.js +1 -1
- package/dist/services/dispatch/isolation-lease.js +39 -17
- package/dist/services/dispatch/merge-back-runner.js +51 -11
- package/dist/services/dispatch/service-shutdown.js +4 -1
- package/dist/services/dispatch/slice-dag-types.d.ts +116 -0
- package/dist/services/dispatch/slice-dag-types.js +41 -0
- package/dist/services/dispatch/slice-dag.d.ts +3 -109
- package/dist/services/dispatch/slice-dag.js +13 -36
- package/dist/services/dispatch/sub-agent-batch-await.d.ts +47 -0
- package/dist/services/dispatch/sub-agent-batch-await.js +73 -0
- package/dist/services/dispatch/sub-agent-dispatcher-types.d.ts +122 -0
- package/dist/services/dispatch/sub-agent-dispatcher-types.js +12 -0
- package/dist/services/dispatch/sub-agent-dispatcher.d.ts +3 -145
- package/dist/services/dispatch/sub-agent-dispatcher.js +14 -70
- package/dist/services/dispatch/test-tool-detection.js +12 -1
- package/dist/services/doc/doc-generator.js +19 -4
- package/dist/services/doctor/doctor-service/checks/check-id-schema.js +16 -8
- package/dist/services/doctor/doctor-service/checks/codegraph-capability.d.ts +7 -2
- package/dist/services/doctor/doctor-service/checks/codegraph-capability.js +26 -8
- package/dist/services/doctor/doctor-service/checks/codegraph-exclude-integrity.js +16 -8
- package/dist/services/doctor/doctor-service/checks/codegraph-index-integrity.js +16 -8
- package/dist/services/doctor/doctor-service/checks/dist-source-version.js +18 -9
- package/dist/services/doctor/doctor-service/checks/ecc-hooks-schema-drift.js +20 -10
- package/dist/services/doctor/doctor-service/checks/gateguard-conflict.js +18 -9
- package/dist/services/doctor/doctor-service/checks/l3-memory-health.js +25 -11
- package/dist/services/doctor/doctor-service/checks/l3-orphan-sessions.js +12 -6
- package/dist/services/doctor/doctor-service/checks/multi-binary-drift.d.ts +7 -16
- package/dist/services/doctor/doctor-service/checks/multi-binary-drift.js +50 -70
- package/dist/services/doctor/doctor-service/checks/schema-validity.js +5 -1
- package/dist/services/doctor/doctor-service/checks/skill-presence.js +4 -2
- package/dist/services/doctor/doctor-service/checks/statusline-install.js +8 -4
- package/dist/services/doctor/doctor-service/checks/statusline-runtime.js +8 -4
- package/dist/services/doctor/doctor-service/checks/user-config.js +4 -2
- package/dist/services/doctor/doctor-service/checks/workspace-init.js +8 -4
- package/dist/services/doctor/doctor-service/checks/workspace-layout.js +19 -11
- package/dist/services/doctor/doctor-service/index.js +4 -2
- package/dist/services/doctor/doctor-service/multi-binary-drift-helpers.d.ts +40 -0
- package/dist/services/doctor/doctor-service/multi-binary-drift-helpers.js +49 -0
- package/dist/services/doctor/doctor-service/plugin-registry.js +1 -1
- package/dist/services/doctor/doctor-service/probe-types.d.ts +210 -0
- package/dist/services/doctor/doctor-service/probe-types.js +14 -0
- package/dist/services/doctor/doctor-service/types.d.ts +7 -197
- package/dist/services/doctor/index.d.ts +1 -1
- package/dist/services/doctor/index.js +1 -1
- package/dist/services/env/shell-probe.js +8 -2
- package/dist/services/evidence/evidence-body-builders.d.ts +23 -0
- package/dist/services/evidence/evidence-body-builders.js +197 -0
- package/dist/services/evidence/evidence-generator.js +6 -187
- package/dist/services/evolution/evolution-constraints.d.ts +43 -0
- package/dist/services/evolution/evolution-constraints.js +54 -0
- package/dist/services/evolution/evolution-evaluation-schema.d.ts +43 -0
- package/dist/services/evolution/evolution-evaluation-schema.js +43 -0
- package/dist/services/evolution/evolution-service.d.ts +6 -6
- package/dist/services/evolution/evolution-service.js +58 -58
- package/dist/services/evolution/evolution-store.d.ts +2 -2
- package/dist/services/evolution/evolution-store.js +37 -51
- package/dist/services/evolution/evolution-types.d.ts +2 -22
- package/dist/services/evolution/evolution-types.js +41 -101
- package/dist/services/evolution/independent-evaluator-runner.d.ts +3 -3
- package/dist/services/evolution/independent-evaluator-runner.js +20 -22
- package/dist/services/evolution/regression-skeptic-runner.d.ts +2 -2
- package/dist/services/evolution/regression-skeptic-runner.js +18 -18
- package/dist/services/feedback/feedback-promotion-service.js +48 -12
- package/dist/services/feedback/promotion-artifact-evidence.d.ts +2 -16
- package/dist/services/feedback/promotion-artifact-evidence.js +6 -83
- package/dist/services/feedback/promotion-artifact-json-evidence.d.ts +29 -0
- package/dist/services/feedback/promotion-artifact-json-evidence.js +39 -0
- package/dist/services/feedback/promotion-source-comments.d.ts +47 -0
- package/dist/services/feedback/promotion-source-comments.js +61 -0
- package/dist/services/final-review/final-review-contract.d.ts +26 -0
- package/dist/services/final-review/final-review-contract.js +14 -0
- package/dist/services/final-review/final-review-delivery.d.ts +63 -0
- package/dist/services/final-review/final-review-delivery.js +124 -0
- package/dist/services/final-review/final-review-evidence-budget.d.ts +125 -0
- package/dist/services/final-review/final-review-evidence-budget.js +218 -0
- package/dist/services/final-review/final-review-evidence-collect.d.ts +4 -0
- package/dist/services/final-review/final-review-evidence-collect.js +230 -0
- package/dist/services/final-review/final-review-evidence-sources.d.ts +138 -0
- package/dist/services/final-review/final-review-evidence-sources.js +139 -0
- package/dist/services/final-review/final-review-fifth-dim.d.ts +8 -0
- package/dist/services/final-review/final-review-fifth-dim.js +20 -0
- package/dist/services/final-review/final-review-gates.d.ts +119 -0
- package/dist/services/final-review/final-review-gates.js +214 -0
- package/dist/services/final-review/final-review-output-budget.d.ts +88 -0
- package/dist/services/final-review/final-review-output-budget.js +161 -0
- package/dist/services/final-review/final-review-prompt.d.ts +35 -0
- package/dist/services/final-review/final-review-prompt.js +112 -0
- package/dist/services/final-review/final-review-reviewer.d.ts +57 -0
- package/dist/services/final-review/final-review-reviewer.js +95 -0
- package/dist/services/final-review/final-review-runner.d.ts +3 -0
- package/dist/services/final-review/final-review-runner.js +158 -0
- package/dist/services/final-review/final-review-service.d.ts +119 -373
- package/dist/services/final-review/final-review-service.js +48 -1380
- package/dist/services/final-review/final-review-verdicts.d.ts +60 -0
- package/dist/services/final-review/final-review-verdicts.js +91 -0
- package/dist/services/final-review/index.d.ts +3 -3
- package/dist/services/final-review/index.js +2 -2
- package/dist/services/final-review/pre-post-diff.js +32 -29
- package/dist/services/fixture/fixture-capture-service.js +14 -6
- package/dist/services/fresh-context/trigger-scan.js +13 -2
- package/dist/services/fuzzy-matching/fuzzy-match-service.js +1 -1
- package/dist/services/fuzzy-matching/fzf-pick-service.js +6 -1
- package/dist/services/hooks/pre-tool-code-gate.js +2 -2
- package/dist/services/hooks/presence-marker-detector.js +12 -2
- package/dist/services/hooks/worktree-authorization-gate.js +21 -7
- package/dist/services/ide/adapters/claude-code-adapter.js +30 -17
- package/dist/services/ide/adapters/codex-adapter.js +3 -5
- package/dist/services/ide/adapters/cursor-adapter.js +3 -5
- package/dist/services/ide/adapters/hermes-adapter.js +2 -4
- package/dist/services/ide/adapters/openclaw-adapter.js +2 -4
- package/dist/services/ide/adapters/qoder-adapter.js +2 -4
- package/dist/services/ide/adapters/tongyi-lingma-adapter.js +1 -1
- package/dist/services/ide/adapters/trae-adapter.js +3 -5
- package/dist/services/ide/adapters/zcode-adapter.js +8 -7
- package/dist/services/ide/current-model-detector.js +2 -1
- package/dist/services/ide/ide-compact-types.d.ts +153 -0
- package/dist/services/ide/ide-compact-types.js +1 -0
- package/dist/services/ide/ide-registry.js +1 -1
- package/dist/services/ide/ide-types.d.ts +7 -145
- package/dist/services/ide/resource-profile.js +1 -1
- package/dist/services/ide/shared/atomic-json.js +2 -1
- package/dist/services/impact/impact-scan-service.js +12 -5
- package/dist/services/job/job-commit-verification.d.ts +73 -0
- package/dist/services/job/job-commit-verification.js +72 -0
- package/dist/services/job/job-orchestrator.d.ts +42 -0
- package/dist/services/job/job-orchestrator.js +110 -10
- package/dist/services/job/job-progress-store.d.ts +75 -5
- package/dist/services/job/job-progress-store.js +83 -6
- package/dist/services/job/job-rotation.d.ts +1 -1
- package/dist/services/job/job-rotation.js +5 -1
- package/dist/services/job/job-state-store.js +2 -2
- package/dist/services/job/job-types.js +49 -20
- package/dist/services/job/subagent-job-wrapper.d.ts +1 -1
- package/dist/services/job/subagent-job-wrapper.js +5 -1
- package/dist/services/job-snapshot/snapshot.js +2 -2
- package/dist/services/karpathy-cost/karpathy-cost-check-service.js +23 -13
- package/dist/services/legacy/legacy-detector.js +51 -5
- package/dist/services/lint/detect-eslint.js +10 -4
- package/dist/services/lint/detect-ocr-18.js +11 -3
- package/dist/services/lint/eslint-runner-support.d.ts +22 -0
- package/dist/services/lint/eslint-runner-support.js +185 -0
- package/dist/services/lint/eslint-runner-types.d.ts +69 -0
- package/dist/services/lint/eslint-runner-types.js +11 -0
- package/dist/services/lint/eslint-runner.d.ts +4 -56
- package/dist/services/lint/eslint-runner.js +24 -178
- package/dist/services/lint/npx-resolver.js +1 -3
- package/dist/services/lint/ocr-18-acquire.js +15 -4
- package/dist/services/lint/ocr-multilang-adapter.js +4 -5
- package/dist/services/llm/anthropic-runner.js +4 -1
- package/dist/services/log/log-commands-service.js +2 -6
- package/dist/services/log/logger.js +15 -12
- package/dist/services/log/retention.d.ts +0 -16
- package/dist/services/log/retention.js +2 -18
- package/dist/services/loop/evaluator-dispatcher.js +78 -42
- package/dist/services/loop/loop-bee-relation-service.d.ts +4 -4
- package/dist/services/loop/loop-bee-relation-service.js +36 -40
- package/dist/services/loop/loop-bee-relation-store.d.ts +3 -3
- package/dist/services/loop/loop-bee-relation-store.js +9 -11
- package/dist/services/loop/loop-bee-relation-types.d.ts +1 -1
- package/dist/services/loop/loop-bee-relation-types.js +14 -25
- package/dist/services/loop/loop-release-service.d.ts +2 -2
- package/dist/services/loop/loop-release-service.js +3 -3
- package/dist/services/loop/loop-release-store.d.ts +2 -2
- package/dist/services/loop/loop-release-store.js +4 -6
- package/dist/services/loop/loop-release-types.d.ts +1 -1
- package/dist/services/loop/loop-release-types.js +21 -31
- package/dist/services/loop/monotonic-guard-types.d.ts +51 -0
- package/dist/services/loop/monotonic-guard-types.js +9 -0
- package/dist/services/loop/monotonic-guard.d.ts +2 -43
- package/dist/services/loop/monotonic-runner-types.d.ts +63 -0
- package/dist/services/loop/monotonic-runner-types.js +17 -0
- package/dist/services/loop/monotonic-runner.d.ts +3 -34
- package/dist/services/loop/monotonic-runner.js +10 -20
- package/dist/services/loop/run-driver.js +16 -8
- package/dist/services/loop/spec-service.d.ts +0 -5
- package/dist/services/loop/spec-service.js +49 -9
- package/dist/services/memory/llm-reranker-core.d.ts +108 -0
- package/dist/services/memory/llm-reranker-core.js +105 -0
- package/dist/services/memory/llm-reranker.d.ts +3 -94
- package/dist/services/memory/llm-reranker.js +13 -102
- package/dist/services/memory/memory-ingest-service.d.ts +1 -22
- package/dist/services/memory/memory-ingest-service.js +29 -76
- package/dist/services/memory/memory-ingest-support.d.ts +23 -0
- package/dist/services/memory/memory-ingest-support.js +81 -0
- package/dist/services/memory/memory-rotate-service.js +41 -8
- package/dist/services/memory/memory-search-service.js +8 -4
- package/dist/services/memory/project-context-service.js +26 -5
- package/dist/services/memory/project-memory-service/index/kind-dispatch.d.ts +2 -7
- package/dist/services/memory/project-memory-service/index/kind-dispatch.js +17 -136
- package/dist/services/memory/project-memory-service/index/project-memory-plan-exec.d.ts +7 -0
- package/dist/services/memory/project-memory-service/index/project-memory-plan-exec.js +150 -0
- package/dist/services/memory/project-memory-service/index/ranking.js +6 -3
- package/dist/services/memory/project-memory-service/index/reindex.js +14 -5
- package/dist/services/memory/project-memory-service/index.d.ts +1 -1
- package/dist/services/memory/project-memory-service/index.js +1 -1
- package/dist/services/memory/project-memory-service/memory-kinds.d.ts +31 -0
- package/dist/services/memory/project-memory-service/memory-kinds.js +87 -0
- package/dist/services/memory/project-memory-service/parsers/frontmatter-parse.d.ts +24 -0
- package/dist/services/memory/project-memory-service/parsers/frontmatter-parse.js +104 -0
- package/dist/services/memory/project-memory-service/parsers/frontmatter.d.ts +2 -24
- package/dist/services/memory/project-memory-service/parsers/frontmatter.js +28 -79
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.js +15 -3
- package/dist/services/memory/project-memory-service/store/atomic-write.d.ts +19 -7
- package/dist/services/memory/project-memory-service/store/atomic-write.js +144 -38
- package/dist/services/memory/project-memory-service/store/paths.js +2 -1
- package/dist/services/memory/project-memory-service/types.d.ts +3 -31
- package/dist/services/memory/project-memory-service/types.js +1 -76
- package/dist/services/migrate-skill-name/migrate.js +1 -1
- package/dist/services/migrate-skill-name/schema.js +1 -1
- package/dist/services/mode/mode-enforcement.js +4 -2
- package/dist/services/mode/mode-status-service.d.ts +27 -9
- package/dist/services/mode/mode-status-service.js +64 -12
- package/dist/services/observability/aggregation-helpers.d.ts +22 -0
- package/dist/services/observability/aggregation-helpers.js +65 -0
- package/dist/services/observability/aggregation-types.d.ts +66 -0
- package/dist/services/observability/aggregation-types.js +34 -0
- package/dist/services/observability/aggregation.d.ts +5 -53
- package/dist/services/observability/aggregation.js +17 -80
- package/dist/services/observability/jsonl-store.js +2 -1
- package/dist/services/observability/observability-schema.d.ts +71 -0
- package/dist/services/observability/observability-schema.js +64 -0
- package/dist/services/observability/observability-service.d.ts +3 -56
- package/dist/services/observability/observability-service.js +9 -49
- package/dist/services/openspec/coverage-evidence-reader.js +18 -11
- package/dist/services/openspec/openspec-archive-service.js +31 -24
- package/dist/services/openspec/openspec-init-service.js +8 -2
- package/dist/services/openspec/openspec-propose-from-doctor-service.js +1 -1
- package/dist/services/openspec/openspec-scan-service.js +4 -1
- package/dist/services/openspec/openspec-validate-service.js +26 -5
- package/dist/services/perf/perf-baseline-service.js +2 -6
- package/dist/services/polyrepo/polyrepo-dispatcher.js +2 -1
- package/dist/services/polyrepo/polyrepo-scanner.js +4 -1
- package/dist/services/prd/handoff-frontmatter-shape.d.ts +42 -0
- package/dist/services/prd/handoff-frontmatter-shape.js +67 -0
- package/dist/services/prd/handoff-frontmatter.js +62 -1
- package/dist/services/prd/handoff-gate-evidence.js +14 -10
- package/dist/services/prd/handoff-path-resolution.d.ts +37 -0
- package/dist/services/prd/handoff-path-resolution.js +101 -0
- package/dist/services/prd/handoff-service.d.ts +12 -38
- package/dist/services/prd/handoff-service.js +25 -147
- package/dist/services/prd/handoff-types.d.ts +33 -1
- package/dist/services/prd/prd-blocks-checker.js +28 -8
- package/dist/services/prd/project-scan-bootstrap-service.js +1 -5
- package/dist/services/prd/project-scan-reader.js +1 -4
- package/dist/services/prd/project-scan-sediment.js +1 -4
- package/dist/services/preferences/preferences-service.js +6 -8
- package/dist/services/preferences/preferences-types.js +4 -4
- package/dist/services/qa/bdd-test-style-contract.d.ts +41 -0
- package/dist/services/qa/bdd-test-style-contract.js +37 -0
- package/dist/services/qa/bdd-test-style-verifier.d.ts +2 -24
- package/dist/services/qa/bdd-test-style-verifier.js +5 -31
- package/dist/services/qa/browser-event-logger.js +2 -1
- package/dist/services/qa/qa-business-review-state.js +20 -5
- package/dist/services/qa/screenshot-archive-service.js +1 -3
- package/dist/services/rd/ast-gate.js +2 -2
- package/dist/services/rd/impl.js +1 -1
- package/dist/services/rd/rd-service.js +117 -43
- package/dist/services/rd/reviewer-dispatch-policy.js +4 -7
- package/dist/services/rd/standards-diagnostic.js +4 -1
- package/dist/services/rd/strategy.js +10 -3
- package/dist/services/rd/tactical-stage.js +2 -2
- package/dist/services/rd/types.js +9 -7
- package/dist/services/rd-swarm/rd-swarm-service.d.ts +2 -45
- package/dist/services/rd-swarm/rd-swarm-service.js +140 -21
- package/dist/services/rd-swarm/rd-swarm-types.d.ts +54 -0
- package/dist/services/rd-swarm/rd-swarm-types.js +10 -0
- package/dist/services/recommendations/capability-map-service.js +10 -2
- package/dist/services/recommendations/capability-seed-items.js +81 -14
- package/dist/services/recommendations/capability-seed-mappings.js +420 -48
- package/dist/services/recommendations/capability-seed-sources-mcp-server.d.ts +9 -0
- package/dist/services/recommendations/capability-seed-sources-mcp-server.js +233 -0
- package/dist/services/recommendations/capability-seed-sources.js +127 -32
- package/dist/services/recommendations/installed-capability-detector.d.ts +5 -5
- package/dist/services/recommendations/installed-capability-detector.js +11 -10
- package/dist/services/release/release-state.d.ts +2 -2
- package/dist/services/release/release-state.js +44 -15
- package/dist/services/release/version-precheck-layer-changeset.d.ts +2 -0
- package/dist/services/release/version-precheck-layer-changeset.js +43 -0
- package/dist/services/release/version-precheck-service.d.ts +11 -36
- package/dist/services/release/version-precheck-service.js +20 -104
- package/dist/services/release/version-precheck-support.d.ts +53 -0
- package/dist/services/release/version-precheck-support.js +64 -0
- package/dist/services/retrospective/retrospective-index.js +17 -3
- package/dist/services/retrospective/retrospective-search-service.js +6 -2
- package/dist/services/retrospective/retrospective-show.js +4 -1
- package/dist/services/reviewer/model-family.js +7 -1
- package/dist/services/reviewer/providers/anthropic.d.ts +5 -0
- package/dist/services/reviewer/providers/anthropic.js +10 -1
- package/dist/services/reviewer/providers/openai.d.ts +5 -0
- package/dist/services/reviewer/providers/openai.js +10 -1
- package/dist/services/reviewer/reviewer-config.js +4 -2
- package/dist/services/reviewer/reviewer-service.d.ts +2 -36
- package/dist/services/reviewer/reviewer-service.js +2 -1
- package/dist/services/reviewer/reviewer-types.d.ts +43 -0
- package/dist/services/reviewer/reviewer-types.js +1 -0
- package/dist/services/role/role-registry.js +9 -1
- package/dist/services/runtime/runtime-detector.js +4 -1
- package/dist/services/runtime/vendors/claude-code.js +14 -6
- package/dist/services/runtime/vendors/codex.js +11 -3
- package/dist/services/runtime/vendors/copilot.js +11 -3
- package/dist/services/sc/sc-service.js +28 -15
- package/dist/services/scan/acceptance-coverage-service.js +4 -1
- package/dist/services/scan/api-diff-openapi-schema-read.d.ts +67 -0
- package/dist/services/scan/api-diff-openapi-schema-read.js +154 -0
- package/dist/services/scan/api-diff-openapi.d.ts +16 -2
- package/dist/services/scan/api-diff-openapi.js +19 -123
- package/dist/services/scan/api-diff-recorded.js +16 -3
- package/dist/services/scan/api-diff-service.js +49 -16
- package/dist/services/scan/api-diff-types.js +12 -3
- package/dist/services/scan/api-surface-helpers.d.ts +13 -0
- package/dist/services/scan/api-surface-helpers.js +31 -0
- package/dist/services/scan/api-surface-service.d.ts +2 -45
- package/dist/services/scan/api-surface-service.js +15 -26
- package/dist/services/scan/api-surface-types.d.ts +54 -0
- package/dist/services/scan/api-surface-types.js +10 -0
- package/dist/services/scan/archetype-detection.d.ts +74 -0
- package/dist/services/scan/archetype-detection.js +315 -0
- package/dist/services/scan/archetype-service.js +58 -133
- package/dist/services/scan/diff-scope-service.js +35 -15
- package/dist/services/scan/existing-system-service.js +16 -99
- package/dist/services/scan/existing-system-visual-tokens.d.ts +20 -0
- package/dist/services/scan/existing-system-visual-tokens.js +123 -0
- package/dist/services/scan/file-size-policy.d.ts +86 -0
- package/dist/services/scan/file-size-policy.js +184 -0
- package/dist/services/scan/file-size-scan.d.ts +30 -3
- package/dist/services/scan/file-size-scan.js +47 -9
- package/dist/services/scan/karpathy-service.js +6 -1
- package/dist/services/scan/orphan-service.js +86 -20
- package/dist/services/scan/scan-types.d.ts +9 -0
- package/dist/services/scan/type-sanity-service.js +104 -10
- package/dist/services/sediment/dispose-confirm.d.ts +2 -2
- package/dist/services/sediment/dispose-confirm.js +2 -2
- package/dist/services/sediment/json-schema.d.ts +1 -1
- package/dist/services/sediment/json-schema.js +25 -13
- package/dist/services/sediment/manifest-lint.d.ts +1 -12
- package/dist/services/sediment/manifest-lint.js +1 -7
- package/dist/services/sediment/pool-paths.js +13 -9
- package/dist/services/sediment/pool-read.d.ts +1 -1
- package/dist/services/sediment/pool-read.js +42 -18
- package/dist/services/sediment/pool-rebuild-index.d.ts +1 -1
- package/dist/services/sediment/pool-rebuild-index.js +5 -5
- package/dist/services/sediment/pool-write.d.ts +1 -1
- package/dist/services/sediment/pool-write.js +7 -7
- package/dist/services/sediment/promotion-gate.d.ts +1 -1
- package/dist/services/sediment/promotion-gate.js +9 -9
- package/dist/services/sediment/types.d.ts +8 -8
- package/dist/services/session/binding-status-service.js +14 -4
- package/dist/services/session/caller-binding-service.js +2 -1
- package/dist/services/session/getSessionDir.js +4 -1
- package/dist/services/session/index.d.ts +1 -1
- package/dist/services/session/index.js +1 -1
- package/dist/services/session/resolve-caller-id.js +7 -5
- package/dist/services/session/session-binding-bridge.js +26 -25
- package/dist/services/session/session-checkpoint-service.js +1 -1
- package/dist/services/session/session-file-schema.d.ts +70 -0
- package/dist/services/session/session-file-schema.js +68 -0
- package/dist/services/session/session-manager.d.ts +6 -6
- package/dist/services/session/session-manager.js +30 -29
- package/dist/services/session/session-resume-service.js +2 -1
- package/dist/services/share/bundle-format-constants.d.ts +85 -0
- package/dist/services/share/bundle-format-constants.js +100 -0
- package/dist/services/share/bundle-reader.d.ts +3 -3
- package/dist/services/share/bundle-reader.js +75 -68
- package/dist/services/share/bundle-types.d.ts +3 -70
- package/dist/services/share/bundle-types.js +38 -107
- package/dist/services/share/bundle-writer.d.ts +3 -3
- package/dist/services/share/bundle-writer.js +101 -91
- package/dist/services/share/run-state-contract.d.ts +1 -1
- package/dist/services/share/run-state-contract.js +7 -13
- package/dist/services/signal/cancel-handler.js +2 -1
- package/dist/services/skill/resume-detector.js +6 -4
- package/dist/services/skill/skill-scheduler.js +3 -1
- package/dist/services/skill/skill-search-service.js +4 -4
- package/dist/services/skillhub/release-diff.d.ts +2 -2
- package/dist/services/skillhub/release-diff.js +6 -10
- package/dist/services/skillhub/release-export.d.ts +2 -2
- package/dist/services/skillhub/release-export.js +15 -17
- package/dist/services/skillhub/release-gc-blobs.d.ts +2 -2
- package/dist/services/skillhub/release-gc-blobs.js +4 -4
- package/dist/services/skillhub/release-import.d.ts +2 -2
- package/dist/services/skillhub/release-import.js +13 -12
- package/dist/services/skillhub/release-retain.d.ts +3 -3
- package/dist/services/skillhub/release-retain.js +22 -22
- package/dist/services/skillhub/sqlite-store.d.ts +1 -1
- package/dist/services/skillhub/sqlite-store.js +12 -11
- package/dist/services/skillhub/tar-runtime.js +15 -15
- package/dist/services/skillhub/types.d.ts +4 -4
- package/dist/services/skills/hooks-codegate-superpowers.js +16 -7
- package/dist/services/skills/hooks-settings-service.js +61 -19
- package/dist/services/skills/presence-lease-service.js +26 -16
- package/dist/services/skills/presence-lease-types.d.ts +1 -1
- package/dist/services/skills/presence-lease-types.js +1 -1
- package/dist/services/skills/skill-conformance-service.js +40 -8
- package/dist/services/skills/skill-presence-service.js +16 -14
- package/dist/services/skills/skill-runbook-service.js +2 -1
- package/dist/services/skills/skill-statusline-model.d.ts +128 -0
- package/dist/services/skills/skill-statusline-model.js +163 -0
- package/dist/services/skills/skill-statusline-renderer.js +4 -3
- package/dist/services/skills/skill-statusline-service.d.ts +3 -100
- package/dist/services/skills/skill-statusline-service.js +56 -163
- package/dist/services/skills/statusline-palette.js +11 -6
- package/dist/services/skills/statusline-settings-service.js +2 -1
- package/dist/services/skills/sync-service-support.d.ts +65 -0
- package/dist/services/skills/sync-service-support.js +50 -0
- package/dist/services/skills/sync-service.d.ts +3 -66
- package/dist/services/skills/sync-service.js +15 -53
- package/dist/services/slice/calibration-store.js +8 -2
- package/dist/services/slice/cross-pass-edge-merger.d.ts +3 -28
- package/dist/services/slice/cross-pass-edge-merger.js +13 -63
- package/dist/services/slice/cross-pass-edge-static-scan-support.d.ts +69 -0
- package/dist/services/slice/cross-pass-edge-static-scan-support.js +74 -0
- package/dist/services/slice/granularity-decider.js +2 -2
- package/dist/services/slice/slice-archive-service.js +8 -3
- package/dist/services/slice/slice-check-service.js +19 -8
- package/dist/services/slice/slice-decompose-runners.js +61 -23
- package/dist/services/slice/slice-decompose-service.js +4 -4
- package/dist/services/slice/slice-review-state.js +8 -2
- package/dist/services/smoke/smoke-paths-state.js +9 -2
- package/dist/services/sop/gate-enforce-service.js +9 -2
- package/dist/services/sop/sop-advance-service.js +14 -2
- package/dist/services/sop/sop-check-service.js +16 -4
- package/dist/services/sop/sop-paths.js +3 -1
- package/dist/services/sop/sop-registry-service.js +5 -1
- package/dist/services/sop/sop-service.js +29 -7
- package/dist/services/sop/sop-types.js +5 -1
- package/dist/services/standards/ide-aware-standards-service.js +2 -2
- package/dist/services/standards/loop-engineering-lint.js +12 -5
- package/dist/services/standards/loop-engineering-readiness-lint.js +5 -5
- package/dist/services/standards/migrate-claude-rules-service.js +9 -7
- package/dist/services/standards/missing-standards-detector.js +1 -3
- package/dist/services/standards/project-context-support.d.ts +50 -0
- package/dist/services/standards/project-context-support.js +244 -0
- package/dist/services/standards/project-context-types.d.ts +30 -0
- package/dist/services/standards/project-context-types.js +11 -0
- package/dist/services/standards/project-context.d.ts +10 -22
- package/dist/services/standards/project-context.js +27 -214
- package/dist/services/standards/project-standards-service.js +43 -12
- package/dist/services/standards/standards-render-common.d.ts +15 -0
- package/dist/services/standards/standards-render-common.js +49 -0
- package/dist/services/standards/standards-render.d.ts +1 -2
- package/dist/services/standards/standards-render.js +31 -58
- package/dist/services/standards/ui-library-dispatch-block.js +1 -1
- package/dist/services/tech/tech-change-id-service.js +7 -7
- package/dist/services/tech/tech-service.js +73 -26
- package/dist/services/test-cache/test-cache-service.js +8 -3
- package/dist/services/verdict/envelope-parsers.d.ts +84 -0
- package/dist/services/verdict/envelope-parsers.js +146 -0
- package/dist/services/verdict/envelopes.d.ts +50 -60
- package/dist/services/verdict/envelopes.js +18 -156
- package/dist/services/verdict/verdict-aggregator.js +27 -3
- package/dist/services/vm/vm-lease.js +15 -3
- package/dist/services/web/aria-node.d.ts +27 -0
- package/dist/services/web/aria-node.js +1 -0
- package/dist/services/web/browser-acquire.js +3 -1
- package/dist/services/web/browser-cache-probe.d.ts +18 -0
- package/dist/services/web/browser-cache-probe.js +110 -0
- package/dist/services/web/browser-session-manager.js +6 -2
- package/dist/services/web/daemon-registry.js +4 -1
- package/dist/services/web/playwright-loader.d.ts +2 -70
- package/dist/services/web/playwright-types.d.ts +75 -0
- package/dist/services/web/playwright-types.js +1 -0
- package/dist/services/web/snapshot-pruner.d.ts +2 -23
- package/dist/services/web/snapshot-pruner.js +8 -3
- package/dist/services/web/web-daemon-service.js +1 -3
- package/dist/services/web/web-install-service.d.ts +3 -32
- package/dist/services/web/web-install-service.js +21 -100
- package/dist/services/web/web-install-types.d.ts +31 -0
- package/dist/services/web/web-install-types.js +13 -0
- package/dist/services/web/web-login-profile.js +7 -5
- package/dist/services/web/web-protocol.js +3 -1
- package/dist/services/workflow/pipeline-verify-gate-support.js +63 -17
- package/dist/services/workflow/pipeline-verify-service.js +17 -6
- package/dist/services/workflow/plan-reader.js +5 -1
- package/dist/services/workflow/plan-refresher.js +20 -6
- package/dist/services/workflow/plan-trigger-detector.js +31 -8
- package/dist/services/workflow/provision-dispatch-node.js +8 -3
- package/dist/services/workflow/workflow-autonomous-resume-helpers.d.ts +3 -1
- package/dist/services/workflow/workflow-autonomous-resume-helpers.js +35 -144
- package/dist/services/workflow/workflow-autonomous-resume-validation.d.ts +16 -0
- package/dist/services/workflow/workflow-autonomous-resume-validation.js +155 -0
- package/dist/services/workflow/workflow-autonomous-service.js +25 -13
- package/dist/services/workflow/workflow-graph-store-helpers.d.ts +51 -0
- package/dist/services/workflow/workflow-graph-store-helpers.js +111 -0
- package/dist/services/workflow/workflow-graph-store.d.ts +2 -35
- package/dist/services/workflow/workflow-graph-store.js +30 -107
- package/dist/services/workflow/workflow-graph-types.js +3 -3
- package/dist/services/workflow/workflow-inflight-probe.js +14 -7
- package/dist/services/workflow/workflow-loader.js +5 -1
- package/dist/services/workflow/workflow-node-lifecycle.js +22 -21
- package/dist/services/workflow/workflow-presence-lifecycle-types.d.ts +50 -0
- package/dist/services/workflow/workflow-presence-lifecycle-types.js +1 -0
- package/dist/services/workflow/workflow-presence-lifecycle.d.ts +2 -42
- package/dist/services/workflow/workflow-presence-lifecycle.js +19 -21
- package/dist/services/workflow/workflow-router-service.js +169 -27
- package/dist/services/workflow/workflow-skip-service.js +14 -4
- package/dist/services/workflow/workflow-spec-builders.d.ts +15 -0
- package/dist/services/workflow/workflow-spec-builders.js +121 -0
- package/dist/services/workflow/workflow-spec.d.ts +7 -6
- package/dist/services/workflow/workflow-spec.js +22 -116
- package/dist/services/workflow/workflow-state-store.js +2 -1
- package/dist/services/workspace/generated-artifacts-stamp.d.ts +2 -2
- package/dist/services/workspace/generated-artifacts-stamp.js +2 -2
- package/dist/services/workspace/migrate-1-4-1-service.js +80 -14
- package/dist/services/workspace/migrate-service.js +66 -16
- package/dist/services/workspace/reconcile-migrate.js +6 -2
- package/dist/services/workspace/reconcile-service.js +37 -16
- package/dist/services/workspace/workspace-claude-settings-materializer.js +7 -5
- package/dist/services/workspace/workspace-clean-service.js +4 -1
- package/dist/services/workspace/workspace-service.js +12 -4
- package/dist/services/workspace/workspace-state-service.js +1 -1
- package/dist/services/worktree/git-worktree-parser.js +13 -3
- package/dist/services/worktree/host-worktree-reconciler.js +8 -4
- package/dist/services/worktree/long-path-cleanup.js +23 -6
- package/dist/services/worktree/worktree-gc-guard.js +3 -1
- package/dist/services/worktree/worktree-lease-types.d.ts +53 -0
- package/dist/services/worktree/worktree-lease-types.js +10 -0
- package/dist/services/worktree/worktree-lease.d.ts +2 -44
- package/dist/shared/array-guards.d.ts +30 -0
- package/dist/shared/array-guards.js +32 -0
- package/dist/shared/format-md-compact-internals.d.ts +26 -0
- package/dist/shared/format-md-compact-internals.js +125 -0
- package/dist/shared/format-md-compact.js +1 -117
- package/dist/shared/fs-utils.js +2 -1
- package/dist/shared/incrementing-number.js +3 -3
- package/dist/shared/json-parse.d.ts +71 -0
- package/dist/shared/json-parse.js +32 -0
- package/dist/shared/json-schema-mini.js +3 -1
- package/dist/shared/path-safety.js +3 -1
- package/dist/shared/path-utils.d.ts +20 -0
- package/dist/shared/path-utils.js +26 -0
- package/dist/shared/planner-response.js +3 -3
- package/dist/shared/stale-policy.js +1 -3
- package/dist/skills/peaks-maker/index.js +11 -11
- package/package.json +31 -8
- package/scripts/clean-dist.mjs +1 -2
- package/scripts/copy-templates.mjs +2 -4
- package/scripts/install-skills.mjs +286 -283
- package/scripts/sync-version.mjs +25 -8
- package/scripts/watch.mjs +8 -2
- package/skills/bee/peaks-qa/references/reading-handoff-frontmatter.md +3 -1
- package/skills/bee/peaks-rd/references/parallel-review-fanout.md +1 -1
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +3 -2
- package/skills/bee/peaks-rd/references/writing-handoff-frontmatter.md +29 -7
- package/skills/peaks-code/SKILL.md +1 -1
- package/skills/peaks-code/references/frontend-only-mode.md +2 -2
- package/skills/peaks-code/references/startup-sequence.md +0 -4
- package/dist/cli/commands/upgrade-commands.d.ts +0 -25
- package/dist/cli/commands/upgrade-commands.js +0 -154
- package/dist/services/upgrade/1x-detector-service.d.ts +0 -7
- package/dist/services/upgrade/1x-detector-service.js +0 -94
- package/dist/services/upgrade/gitignore-migrate-service.d.ts +0 -56
- package/dist/services/upgrade/gitignore-migrate-service.js +0 -170
- package/dist/services/upgrade/upgrade-service.d.ts +0 -81
- package/dist/services/upgrade/upgrade-service.js +0 -405
- package/skills/peaks-code/references/step-0-55-1x-detection.md +0 -83
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* .gitignore 1.x → 2.0 migration service.
|
|
3
|
-
*
|
|
4
|
-
* Real bug surfaced by ice-cola dogfood 2026-06-12:
|
|
5
|
-
* - 1.x consumer projects often have a wholesale `/.peaks/` (or
|
|
6
|
-
* `.peaks/` / `.peaks`) entry in their .gitignore — the 1.x
|
|
7
|
-
* install treated .peaks/ as the tool's ephemeral working
|
|
8
|
-
* directory.
|
|
9
|
-
* - In 2.0 the .peaks/ tree is split: most subdirectories
|
|
10
|
-
* remain ignored (_runtime, _sub_agents, audit, etc.) but
|
|
11
|
-
* several MUST be tracked: .peaks/standards/,
|
|
12
|
-
* .peaks/memory/*.md (durable LLM-authored memories),
|
|
13
|
-
* .peaks/PROJECT.md, and the user opt-in dotfiles.
|
|
14
|
-
* - A wholesale `.peaks/` ignore silently hides every 2.0
|
|
15
|
-
* tracked artifact, violating the "one-key completion" tenet
|
|
16
|
-
* because the user runs upgrade, sees 6/6 pass, then git
|
|
17
|
-
* status shows no new tracked files — the upgrade looks
|
|
18
|
-
* "done" but nothing landed in git.
|
|
19
|
-
*
|
|
20
|
-
* The service:
|
|
21
|
-
* 1. Reads the project's .gitignore (string in / string out;
|
|
22
|
-
* no I/O in the pure function).
|
|
23
|
-
* 2. Detects every line that is a wholesale-ignore of .peaks/
|
|
24
|
-
* (with or without leading slash, with or without trailing
|
|
25
|
-
* slash, ignoring surrounding whitespace).
|
|
26
|
-
* 3. Removes those lines and appends the canonical 2.0 block
|
|
27
|
-
* (granular subpaths) if not already present.
|
|
28
|
-
* 4. The FS variant `migrateGitignoreFile` adds backup +
|
|
29
|
-
* atomic write on top.
|
|
30
|
-
*
|
|
31
|
-
* Idempotent: re-running on a migrated .gitignore is a no-op.
|
|
32
|
-
*
|
|
33
|
-
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-loop-l1-l2-l3-redesign.md §8.4
|
|
34
|
-
* (per-project state in .peaks/preferences.json, durable
|
|
35
|
-
* memories in .peaks/memory/*.md).
|
|
36
|
-
*/
|
|
37
|
-
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
38
|
-
import { join } from 'node:path';
|
|
39
|
-
/**
|
|
40
|
-
* The 2.0 canonical ignore block. Mirrors the same paths
|
|
41
|
-
* peaks-loop's own .gitignore uses; kept in lockstep manually
|
|
42
|
-
* (the peaks-loop root .gitignore is the source of truth).
|
|
43
|
-
*
|
|
44
|
-
* Sentinel: every emitted line carries the marker comment so
|
|
45
|
-
* the migration can detect "already-migrated" and stay
|
|
46
|
-
* idempotent.
|
|
47
|
-
*/
|
|
48
|
-
export const PEAKS_2_0_BLOCK_SENTINEL = '# peaks-loop 2.0 canonical ignore block — managed by `peaks upgrade --to 2.0`';
|
|
49
|
-
export const CANONICAL_2_0_PEAKS_BLOCK = [
|
|
50
|
-
PEAKS_2_0_BLOCK_SENTINEL,
|
|
51
|
-
'.peaks/_runtime/',
|
|
52
|
-
'.peaks/_dogfood/',
|
|
53
|
-
'.peaks/_sub_agents/',
|
|
54
|
-
'.peaks/audit/',
|
|
55
|
-
'.peaks/system/',
|
|
56
|
-
'.peaks/runtime/',
|
|
57
|
-
'.peaks/preferences.json',
|
|
58
|
-
'.peaks/memory/upgrade-2.0-*.md',
|
|
59
|
-
].join('\n');
|
|
60
|
-
/**
|
|
61
|
-
* Returns true when `line` is a wholesale ignore of the entire
|
|
62
|
-
* `.peaks/` tree (the 1.x pattern that breaks 2.0 tracking).
|
|
63
|
-
*
|
|
64
|
-
* Examples that match: `.peaks` `.peaks/` `/.peaks` `/.peaks/` ` .peaks/ `
|
|
65
|
-
* Examples that DON'T: `.peaks/_runtime/` `# .peaks/ comment` `.peaks_other`
|
|
66
|
-
*/
|
|
67
|
-
export function isStaleWholesalePeaksRule(line) {
|
|
68
|
-
const trimmed = line.trim();
|
|
69
|
-
if (trimmed.length === 0)
|
|
70
|
-
return false;
|
|
71
|
-
if (trimmed.startsWith('#'))
|
|
72
|
-
return false;
|
|
73
|
-
// Strip leading slash (relative-to-repo-root convention) and
|
|
74
|
-
// trailing slash (directory marker); both equivalent in
|
|
75
|
-
// .gitignore semantics for wholesale ignore.
|
|
76
|
-
const normalized = trimmed.replace(/^\//, '').replace(/\/$/, '');
|
|
77
|
-
return normalized === '.peaks';
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Pure function: takes the .gitignore content, returns the
|
|
81
|
-
* migrated content + diff summary. No I/O.
|
|
82
|
-
*/
|
|
83
|
-
export function migrateGitignoreContent(input) {
|
|
84
|
-
const lines = input.split('\n');
|
|
85
|
-
const removed = [];
|
|
86
|
-
const kept = [];
|
|
87
|
-
for (const line of lines) {
|
|
88
|
-
if (isStaleWholesalePeaksRule(line)) {
|
|
89
|
-
removed.push(line.trim());
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
kept.push(line);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
// Already-migrated detection: if the canonical block is
|
|
96
|
-
// already present AND nothing was removed, this is a no-op.
|
|
97
|
-
const hasCanonicalBlock = input.includes(PEAKS_2_0_BLOCK_SENTINEL);
|
|
98
|
-
if (removed.length === 0 && hasCanonicalBlock) {
|
|
99
|
-
return { changed: false, removedRules: [], content: input };
|
|
100
|
-
}
|
|
101
|
-
// Already-migrated AND nothing stale: no-op, return original
|
|
102
|
-
// verbatim so byte-equality holds for idempotency.
|
|
103
|
-
if (removed.length === 0 && !hasCanonicalBlock) {
|
|
104
|
-
// Check whether there's anything peaks-related at all; if
|
|
105
|
-
// not, treat as no-op (the user explicitly chose not to
|
|
106
|
-
// ignore .peaks/ — respect that).
|
|
107
|
-
return { changed: false, removedRules: [], content: input };
|
|
108
|
-
}
|
|
109
|
-
// Removed at least one stale rule. Append canonical block
|
|
110
|
-
// if not already present.
|
|
111
|
-
let body = kept.join('\n');
|
|
112
|
-
if (!body.endsWith('\n') && body.length > 0) {
|
|
113
|
-
body += '\n';
|
|
114
|
-
}
|
|
115
|
-
if (!hasCanonicalBlock) {
|
|
116
|
-
body += CANONICAL_2_0_PEAKS_BLOCK + '\n';
|
|
117
|
-
}
|
|
118
|
-
return { changed: true, removedRules: removed, content: body };
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* FS variant: reads .gitignore, runs migration, optionally
|
|
122
|
-
* writes the result + a timestamped backup of the original.
|
|
123
|
-
*
|
|
124
|
-
* Date.now() is used for the backup suffix; in test environments
|
|
125
|
-
* where determinism matters, the caller can stub Date via vi.
|
|
126
|
-
*/
|
|
127
|
-
export function migrateGitignoreFile(input) {
|
|
128
|
-
const path = join(input.projectRoot, '.gitignore');
|
|
129
|
-
if (!existsSync(path)) {
|
|
130
|
-
return {
|
|
131
|
-
missing: true,
|
|
132
|
-
changed: false,
|
|
133
|
-
appliedWrite: false,
|
|
134
|
-
backupPath: null,
|
|
135
|
-
removedRules: [],
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const before = readFileSync(path, 'utf8');
|
|
139
|
-
const result = migrateGitignoreContent(before);
|
|
140
|
-
if (!result.changed) {
|
|
141
|
-
return {
|
|
142
|
-
missing: false,
|
|
143
|
-
changed: false,
|
|
144
|
-
appliedWrite: false,
|
|
145
|
-
backupPath: null,
|
|
146
|
-
removedRules: [],
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
if (input.apply !== true) {
|
|
150
|
-
return {
|
|
151
|
-
missing: false,
|
|
152
|
-
changed: true,
|
|
153
|
-
appliedWrite: false,
|
|
154
|
-
backupPath: null,
|
|
155
|
-
removedRules: result.removedRules,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
// Apply: write backup first, then atomic-overwrite the original.
|
|
159
|
-
const ts = new Date().toISOString().replace(/[:.]/g, '-');
|
|
160
|
-
const backupPath = join(input.projectRoot, `.gitignore.peaks-2.0-backup-${ts}`);
|
|
161
|
-
writeFileSync(backupPath, before, 'utf8');
|
|
162
|
-
writeFileSync(path, result.content, 'utf8');
|
|
163
|
-
return {
|
|
164
|
-
missing: false,
|
|
165
|
-
changed: true,
|
|
166
|
-
appliedWrite: true,
|
|
167
|
-
backupPath,
|
|
168
|
-
removedRules: result.removedRules,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pluggable executor for sub-step command spawns. Production
|
|
3
|
-
* callers omit `executor` on `UpgradeInput`; the default
|
|
4
|
-
* (`defaultSubstepExecutor`) wraps `node:child_process` `spawnSync`.
|
|
5
|
-
* Tests pass a synchronous fake executor to avoid the spawn cost.
|
|
6
|
-
*
|
|
7
|
-
* Contract:
|
|
8
|
-
* - Return `status: 0` for success, non-zero for failure, `null`
|
|
9
|
-
* for synchronous spawn errors (binary not found, EACCES, …).
|
|
10
|
-
* - `stdout` / `stderr` are captured as UTF-8 strings.
|
|
11
|
-
* - `durationMs` is the wall-clock duration of the spawn
|
|
12
|
-
* (caller-facing field on `SubStepResult`).
|
|
13
|
-
*/
|
|
14
|
-
export type SubstepExecutor = (command: string, args: readonly string[], timeoutMs: number) => {
|
|
15
|
-
status: number | null;
|
|
16
|
-
stdout: string;
|
|
17
|
-
stderr: string;
|
|
18
|
-
durationMs: number;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Default substep executor — wraps `spawnSync` with the same
|
|
22
|
-
* stdio / encoding / timeout config the umbrella has used since
|
|
23
|
-
* v1. Exported for test coverage: the seam-preservation test
|
|
24
|
-
* imports this directly to verify the normalized return shape
|
|
25
|
-
* on a spawn failure (e.g. a non-existent command).
|
|
26
|
-
*/
|
|
27
|
-
export declare const defaultSubstepExecutor: SubstepExecutor;
|
|
28
|
-
export interface UpgradeInput {
|
|
29
|
-
readonly projectRoot: string;
|
|
30
|
-
/**
|
|
31
|
-
* When true, the umbrella is being invoked from the
|
|
32
|
-
* `npm i -g peaks-loop` postinstall. Suppresses the
|
|
33
|
-
* interactive prompts and accepts soft-fail on any
|
|
34
|
-
* sub-step.
|
|
35
|
-
*/
|
|
36
|
-
readonly auto?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* When omitted, the sub-commands are inferred from PATH
|
|
39
|
-
* (the postinstall puts the binary there). The umbrella
|
|
40
|
-
* never blocks on a missing binary — it surfaces the
|
|
41
|
-
* install hint in `nextActions` instead.
|
|
42
|
-
*/
|
|
43
|
-
readonly peaksBin?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Optional injectable executor for sub-step command execution.
|
|
46
|
-
* When omitted, the umbrella uses `defaultSubstepExecutor`
|
|
47
|
-
* (real `spawnSync`). Tests pass a synchronous fake to avoid
|
|
48
|
-
* the per-sub-step `node peaks.js …` spawn cost.
|
|
49
|
-
*/
|
|
50
|
-
readonly executor?: SubstepExecutor;
|
|
51
|
-
}
|
|
52
|
-
export interface SubStepResult {
|
|
53
|
-
readonly name: string;
|
|
54
|
-
readonly status: 'pass' | 'fail' | 'skipped';
|
|
55
|
-
readonly exitCode: number | null;
|
|
56
|
-
readonly stdout: string;
|
|
57
|
-
readonly stderr: string;
|
|
58
|
-
readonly durationMs: number;
|
|
59
|
-
}
|
|
60
|
-
export interface UpgradeResult {
|
|
61
|
-
readonly applied: boolean;
|
|
62
|
-
readonly fromVersion: string | null;
|
|
63
|
-
readonly toVersion: string;
|
|
64
|
-
readonly projectRoot: string;
|
|
65
|
-
readonly steps: readonly SubStepResult[];
|
|
66
|
-
readonly passedCount: number;
|
|
67
|
-
readonly failedCount: number;
|
|
68
|
-
readonly skippedCount: number;
|
|
69
|
-
readonly auditBefore: {
|
|
70
|
-
totalRedLines: number;
|
|
71
|
-
cliBacked: number;
|
|
72
|
-
} | null;
|
|
73
|
-
readonly auditAfter: {
|
|
74
|
-
totalRedLines: number;
|
|
75
|
-
cliBacked: number;
|
|
76
|
-
} | null;
|
|
77
|
-
readonly upgradeRecordPath: string | null;
|
|
78
|
-
readonly nextActions: readonly string[];
|
|
79
|
-
readonly warnings: readonly string[];
|
|
80
|
-
}
|
|
81
|
-
export declare function runUpgrade(input: UpgradeInput): UpgradeResult;
|
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* peaks upgrade --to 2.0 — umbrella service for the 1.x → 2.0
|
|
3
|
-
* migration.
|
|
4
|
-
*
|
|
5
|
-
* Per the "one-key completion" + "minimal-user-operation" tenets
|
|
6
|
-
* (2026-06-11), the typical upgrade path is:
|
|
7
|
-
*
|
|
8
|
-
* $ npm i -g peaks-loop@2.0 # postinstall does everything
|
|
9
|
-
*
|
|
10
|
-
* OR (postinstall skipped / manual fallback):
|
|
11
|
-
*
|
|
12
|
-
* $ peaks upgrade --to 2.0
|
|
13
|
-
*
|
|
14
|
-
* The umbrella orchestrates 7 sub-commands:
|
|
15
|
-
* 1. config migrate (already ships as `peaks config migrate`)
|
|
16
|
-
* 2. standards migrate (`peaks standards migrate --from-claude-rules`)
|
|
17
|
-
* 3. memory extract (already ships as `peaks memory extract`)
|
|
18
|
-
* 4. hooks install (already ships as `peaks hooks install`)
|
|
19
|
-
* 5. skill sync (this session, `peaks skill sync --all`)
|
|
20
|
-
* 6. audit verify (already ships as `peaks audit red-lines`)
|
|
21
|
-
* 7. write upgrade record (in-process, .peaks/memory/upgrade-2.0-*.md)
|
|
22
|
-
*
|
|
23
|
-
* Each sub-step is a thin shell-out to the existing CLI; the
|
|
24
|
-
* umbrella's only in-process work is the audit and the upgrade
|
|
25
|
-
* record write. Sub-step failures are SOFT (logged + nextActions
|
|
26
|
-
* populated) so the umbrella never blocks a successful partial
|
|
27
|
-
* upgrade.
|
|
28
|
-
*/
|
|
29
|
-
import { spawnSync } from 'node:child_process';
|
|
30
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
31
|
-
import { join, dirname, relative, resolve } from 'node:path';
|
|
32
|
-
import { fileURLToPath } from 'node:url';
|
|
33
|
-
import { runRedLinesAudit } from '../audit/red-lines-service.js';
|
|
34
|
-
import { savePreferences } from '../preferences/preferences-service.js';
|
|
35
|
-
import { migrateGitignoreFile } from './gitignore-migrate-service.js';
|
|
36
|
-
/**
|
|
37
|
-
* Default substep executor — wraps `spawnSync` with the same
|
|
38
|
-
* stdio / encoding / timeout config the umbrella has used since
|
|
39
|
-
* v1. Exported for test coverage: the seam-preservation test
|
|
40
|
-
* imports this directly to verify the normalized return shape
|
|
41
|
-
* on a spawn failure (e.g. a non-existent command).
|
|
42
|
-
*/
|
|
43
|
-
export const defaultSubstepExecutor = (command, args, timeoutMs) => {
|
|
44
|
-
const start = Date.now();
|
|
45
|
-
try {
|
|
46
|
-
const result = spawnSync(command, args, {
|
|
47
|
-
encoding: 'utf8',
|
|
48
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
49
|
-
timeout: timeoutMs,
|
|
50
|
-
windowsHide: true,
|
|
51
|
-
});
|
|
52
|
-
return {
|
|
53
|
-
status: result.status,
|
|
54
|
-
stdout: result.stdout ?? '',
|
|
55
|
-
stderr: result.stderr ?? '',
|
|
56
|
-
durationMs: Date.now() - start,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
61
|
-
return {
|
|
62
|
-
status: null,
|
|
63
|
-
stdout: '',
|
|
64
|
-
stderr: message,
|
|
65
|
-
durationMs: Date.now() - start,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
const STEPS = [
|
|
70
|
-
{ name: 'config-migrate', args: (p) => ['config', 'migrate', '--project', p, '--apply', '--json'] },
|
|
71
|
-
{ name: 'standards-migrate', args: (p) => ['standards', 'migrate', '--from-claude-rules', '--project', p, '--apply', '--json'] },
|
|
72
|
-
// memory extract is special: its --artifact takes literal file
|
|
73
|
-
// paths (memory-service rejects glob patterns via realpathSync).
|
|
74
|
-
// The umbrella expands the three documented patterns
|
|
75
|
-
// (skills/**/SKILL.md, CLAUDE.md, .claude/rules/**/*.md) on disk
|
|
76
|
-
// and passes the resulting literal list. See runUpgrade's special
|
|
77
|
-
// case below for the args resolution; the args function here is
|
|
78
|
-
// a placeholder so the STEPS table stays uniform.
|
|
79
|
-
{ name: 'memory-extract', args: (p) => ['memory', 'extract', '--project', p, '--json'] },
|
|
80
|
-
{ name: 'hooks-install', args: (p) => ['hooks', 'install', '--project', p, '--json'] },
|
|
81
|
-
{ name: 'skill-sync', args: (p) => ['skill', 'sync', '--all', '--project', p, '--json'] },
|
|
82
|
-
{ name: 'audit-verify', args: (p) => ['audit', 'red-lines', '--project', p, '--json'] },
|
|
83
|
-
];
|
|
84
|
-
/**
|
|
85
|
-
* Walk `<root>` recursively and collect every file whose basename
|
|
86
|
-
* matches `predicate`. Returns absolute paths.
|
|
87
|
-
*
|
|
88
|
-
* Mirrors `readMarkdownFilesRecursive` in
|
|
89
|
-
* src/services/standards/migrate-claude-rules-service.ts so the
|
|
90
|
-
* umbrella does not pull a new glob dependency (Node 20+ engine
|
|
91
|
-
* constraint — `fs.globSync` requires Node 22+).
|
|
92
|
-
*/
|
|
93
|
-
function collectFilesRecursive(root, predicate) {
|
|
94
|
-
if (!existsSync(root))
|
|
95
|
-
return [];
|
|
96
|
-
const stat = statSync(root);
|
|
97
|
-
if (stat.isFile()) {
|
|
98
|
-
return predicate(root.split(/[\\/]/).pop() ?? '') ? [root] : [];
|
|
99
|
-
}
|
|
100
|
-
if (!stat.isDirectory())
|
|
101
|
-
return [];
|
|
102
|
-
const out = [];
|
|
103
|
-
for (const entry of readdirSync(root)) {
|
|
104
|
-
const child = join(root, entry);
|
|
105
|
-
let childStat;
|
|
106
|
-
try {
|
|
107
|
-
childStat = statSync(child);
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (childStat.isFile()) {
|
|
113
|
-
if (predicate(entry))
|
|
114
|
-
out.push(child);
|
|
115
|
-
}
|
|
116
|
-
else if (childStat.isDirectory()) {
|
|
117
|
-
out.push(...collectFilesRecursive(child, predicate));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return out;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Resolve the three documented memory-extract artifact patterns
|
|
124
|
-
* against a real project tree. Returns project-relative paths
|
|
125
|
-
* (memory-service joins them with --project root) so the
|
|
126
|
-
* realpathSync inside memory-service's assertInsideProject
|
|
127
|
-
* succeeds.
|
|
128
|
-
*
|
|
129
|
-
* Patterns:
|
|
130
|
-
* - skills/[asterisk][asterisk]/SKILL.md (project-root convention)
|
|
131
|
-
* - .claude/skills/[asterisk][asterisk]/SKILL.md (Claude-Code consumer convention; ice-cola)
|
|
132
|
-
* - CLAUDE.md
|
|
133
|
-
* - .claude/rules/[asterisk][asterisk]/[asterisk].md
|
|
134
|
-
*
|
|
135
|
-
* Returns an empty list when none of the roots exist. The
|
|
136
|
-
* caller marks the step skipped in that case.
|
|
137
|
-
*/
|
|
138
|
-
function expandMemoryArtifacts(projectRoot) {
|
|
139
|
-
const out = [];
|
|
140
|
-
// skills/**/SKILL.md (peaks-loop repo convention)
|
|
141
|
-
const skillFiles = collectFilesRecursive(join(projectRoot, 'skills'), (name) => name === 'SKILL.md');
|
|
142
|
-
for (const abs of skillFiles) {
|
|
143
|
-
out.push(relative(projectRoot, abs));
|
|
144
|
-
}
|
|
145
|
-
// .claude/skills/**/SKILL.md (Claude-Code consumer convention;
|
|
146
|
-
// surfaced by ice-cola dogfood 2026-06-12 — the 1.x install
|
|
147
|
-
// landed skills under .claude/skills/, not <root>/skills/)
|
|
148
|
-
const claudeSkillFiles = collectFilesRecursive(join(projectRoot, '.claude', 'skills'), (name) => name === 'SKILL.md');
|
|
149
|
-
for (const abs of claudeSkillFiles) {
|
|
150
|
-
out.push(relative(projectRoot, abs));
|
|
151
|
-
}
|
|
152
|
-
// CLAUDE.md (literal)
|
|
153
|
-
const claudeMd = join(projectRoot, 'CLAUDE.md');
|
|
154
|
-
if (existsSync(claudeMd) && statSync(claudeMd).isFile()) {
|
|
155
|
-
out.push('CLAUDE.md');
|
|
156
|
-
}
|
|
157
|
-
// .claude/rules/**/*.md
|
|
158
|
-
const claudeRules = collectFilesRecursive(join(projectRoot, '.claude', 'rules'), (name) => name.endsWith('.md'));
|
|
159
|
-
for (const abs of claudeRules) {
|
|
160
|
-
out.push(relative(projectRoot, abs));
|
|
161
|
-
}
|
|
162
|
-
return out;
|
|
163
|
-
}
|
|
164
|
-
function read1xVersion(cwd) {
|
|
165
|
-
const home = process.env['HOME'] ?? process.env['USERPROFILE'] ?? '';
|
|
166
|
-
if (home.length === 0)
|
|
167
|
-
return null;
|
|
168
|
-
const global = join(home, '.peaks', 'config.json');
|
|
169
|
-
if (!existsSync(global))
|
|
170
|
-
return null;
|
|
171
|
-
try {
|
|
172
|
-
const raw = JSON.parse(readFileSync(global, 'utf8'));
|
|
173
|
-
if (typeof raw.version === 'string')
|
|
174
|
-
return raw.version;
|
|
175
|
-
}
|
|
176
|
-
catch { // TODO(g2): legacy silent catch — grace: 1 minor release (v2.14.0)
|
|
177
|
-
// ignore
|
|
178
|
-
}
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
function runStep(peaksBin, name, args, timeoutMs = 60_000, executor = defaultSubstepExecutor) {
|
|
182
|
-
// The global `peaks` shim is a `/bin/sh` symlink script (the
|
|
183
|
-
// npm install postinstall creates `peaks` → `peaks.sh` on
|
|
184
|
-
// Windows). cmd.exe (the default Windows shell) cannot run
|
|
185
|
-
// `.sh` scripts directly, so the shim fails with "unknown
|
|
186
|
-
// command 'migrate'" etc. The fix: prefer the local node
|
|
187
|
-
// binary + the peaks.js script path. The umbrella resolves
|
|
188
|
-
// the script path at startup; only falls back to `peaks` if
|
|
189
|
-
// no script path is available (Unix-only).
|
|
190
|
-
let command;
|
|
191
|
-
let spawnArgs;
|
|
192
|
-
if (peaksBin.includes('\\') || peaksBin.includes('/')) {
|
|
193
|
-
// peaksBin is a real path (e.g. /c/.../bin/peaks.js);
|
|
194
|
-
// invoke directly via node.
|
|
195
|
-
command = process.execPath;
|
|
196
|
-
spawnArgs = [peaksBin, ...args];
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
// peaksBin is just "peaks" — best-effort shell exec.
|
|
200
|
-
command = peaksBin;
|
|
201
|
-
spawnArgs = args;
|
|
202
|
-
}
|
|
203
|
-
// The executor normalizes spawn errors to { status: null, stderr: ... }
|
|
204
|
-
// so no try/catch wrapper is needed here — the call always returns
|
|
205
|
-
// a shaped record. See defaultSubstepExecutor for the reference impl.
|
|
206
|
-
const result = executor(command, spawnArgs, timeoutMs);
|
|
207
|
-
return {
|
|
208
|
-
name,
|
|
209
|
-
status: result.status === 0 ? 'pass' : 'fail',
|
|
210
|
-
exitCode: result.status,
|
|
211
|
-
stdout: result.stdout,
|
|
212
|
-
stderr: result.stderr,
|
|
213
|
-
durationMs: result.durationMs,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
function writeUpgradeRecord(projectRoot, result) {
|
|
217
|
-
try {
|
|
218
|
-
const memoryDir = join(projectRoot, '.peaks', 'memory');
|
|
219
|
-
mkdirSync(memoryDir, { recursive: true });
|
|
220
|
-
const date = new Date().toISOString().slice(0, 10);
|
|
221
|
-
const file = join(memoryDir, `upgrade-2.0-${date}.md`);
|
|
222
|
-
const lines = [];
|
|
223
|
-
lines.push(`# Upgrade to peaks-loop 2.0 — ${date}`);
|
|
224
|
-
lines.push('');
|
|
225
|
-
lines.push(`> Auto-generated by \`peaks upgrade --to 2.0${result.applied ? ' --auto' : ''}\`.`);
|
|
226
|
-
lines.push(`> Per the "one-key completion" + "minimal-user-operation" tenets.`);
|
|
227
|
-
lines.push('');
|
|
228
|
-
if (result.fromVersion !== null) {
|
|
229
|
-
lines.push(`**From version**: ${result.fromVersion}`);
|
|
230
|
-
}
|
|
231
|
-
lines.push(`**To version**: 2.0.0`);
|
|
232
|
-
lines.push(`**Project root**: \`${result.projectRoot}\``);
|
|
233
|
-
lines.push('');
|
|
234
|
-
lines.push('## Sub-step results');
|
|
235
|
-
lines.push('');
|
|
236
|
-
lines.push('| step | status | exitCode | durationMs |');
|
|
237
|
-
lines.push('|------|--------|----------|------------|');
|
|
238
|
-
for (const step of result.steps) {
|
|
239
|
-
lines.push(`| ${step.name} | ${step.status} | ${step.exitCode ?? 'n/a'} | ${step.durationMs} |`);
|
|
240
|
-
}
|
|
241
|
-
lines.push('');
|
|
242
|
-
if (result.auditBefore !== null || result.auditAfter !== null) {
|
|
243
|
-
lines.push('## Audit snapshot');
|
|
244
|
-
lines.push('');
|
|
245
|
-
if (result.auditBefore !== null) {
|
|
246
|
-
lines.push(`- Before: totalRedLines=${result.auditBefore.totalRedLines}, cliBacked=${result.auditBefore.cliBacked}`);
|
|
247
|
-
}
|
|
248
|
-
if (result.auditAfter !== null) {
|
|
249
|
-
lines.push(`- After: totalRedLines=${result.auditAfter.totalRedLines}, cliBacked=${result.auditAfter.cliBacked}`);
|
|
250
|
-
}
|
|
251
|
-
lines.push('');
|
|
252
|
-
}
|
|
253
|
-
lines.push('## Next actions');
|
|
254
|
-
lines.push('');
|
|
255
|
-
for (const a of result.nextActions) {
|
|
256
|
-
lines.push(`- ${a}`);
|
|
257
|
-
}
|
|
258
|
-
writeFileSync(file, lines.join('\n') + '\n', 'utf8');
|
|
259
|
-
return file;
|
|
260
|
-
}
|
|
261
|
-
catch (err) {
|
|
262
|
-
process.stderr.write(`peaks upgrade: failed to write upgrade record: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
export function runUpgrade(input) {
|
|
267
|
-
// Resolve the peaks binary. Default: the peaks.js script
|
|
268
|
-
// co-located with this compiled module (the user just installed
|
|
269
|
-
// peaks-loop globally, but the global `peaks` shim is a .sh
|
|
270
|
-
// script that cmd.exe can't run on Windows). Falling back
|
|
271
|
-
// to just "peaks" lets the umbrella work when invoked from
|
|
272
|
-
// a Unix-style environment that can run the shim directly.
|
|
273
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
274
|
-
// Walk up from the compiled location to find bin/peaks.js.
|
|
275
|
-
// The compiled service lives at dist/services/upgrade/upgrade-service.js
|
|
276
|
-
// (rootDir=src in tsconfig.build.json trims the "src" segment); bin/peaks.js
|
|
277
|
-
// is at the peaks-loop root, 3 dirs up.
|
|
278
|
-
const peaksBin = input.peaksBin ??
|
|
279
|
-
resolve(here, '..', '..', '..', 'bin', 'peaks.js');
|
|
280
|
-
const fallbackPeaks = 'peaks';
|
|
281
|
-
const resolvedPeaksBin = existsSync(peaksBin) ? peaksBin : fallbackPeaks;
|
|
282
|
-
// Resolve the executor once at the top of runUpgrade so every
|
|
283
|
-
// sub-step call shares the same instance. Tests pass a fake
|
|
284
|
-
// executor via UpgradeInput.executor; production callers omit
|
|
285
|
-
// it and get the default spawnSync wrapper.
|
|
286
|
-
const executor = input.executor ?? defaultSubstepExecutor;
|
|
287
|
-
const fromVersion = read1xVersion(input.projectRoot);
|
|
288
|
-
const steps = [];
|
|
289
|
-
const warnings = [];
|
|
290
|
-
const nextActions = [];
|
|
291
|
-
// Ensure .peaks/preferences.json exists. This is the file the
|
|
292
|
-
// 1.x detector keys off — without it, `peaks upgrade --detect-1x`
|
|
293
|
-
// keeps returning isOneX=true after a successful upgrade and the
|
|
294
|
-
// user gets stuck in a re-prompt loop. savePreferences with an
|
|
295
|
-
// empty override merges with DEFAULT_PREFERENCES and writes; if
|
|
296
|
-
// the file already exists the user's values are preserved.
|
|
297
|
-
// Real bug surfaced by ice-cola dogfood 2026-06-12.
|
|
298
|
-
try {
|
|
299
|
-
savePreferences(input.projectRoot, {});
|
|
300
|
-
}
|
|
301
|
-
catch (err) {
|
|
302
|
-
warnings.push(`ensure-preferences failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
303
|
-
}
|
|
304
|
-
// Migrate .gitignore so 2.0 tracked artifacts
|
|
305
|
-
// (.peaks/standards/, .peaks/memory/*.md durable memories,
|
|
306
|
-
// .peaks/PROJECT.md) aren't silently hidden by a 1.x wholesale
|
|
307
|
-
// `/.peaks/` ignore rule. Real bug surfaced by ice-cola dogfood
|
|
308
|
-
// 2026-06-12: every consumer artifact was being dropped from git
|
|
309
|
-
// status. Service is idempotent + creates a timestamped backup
|
|
310
|
-
// before any write.
|
|
311
|
-
try {
|
|
312
|
-
const giResult = migrateGitignoreFile({ projectRoot: input.projectRoot, apply: true });
|
|
313
|
-
if (giResult.changed && giResult.appliedWrite && giResult.backupPath !== null) {
|
|
314
|
-
nextActions.push(`Updated .gitignore — removed stale wholesale .peaks rule(s): ${giResult.removedRules.join(', ')}. Backup at ${giResult.backupPath}.`);
|
|
315
|
-
}
|
|
316
|
-
else if (giResult.missing) {
|
|
317
|
-
warnings.push('gitignore-migrate skipped: project has no .gitignore');
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
catch (err) {
|
|
321
|
-
warnings.push(`gitignore-migrate failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
322
|
-
}
|
|
323
|
-
// Audit BEFORE the upgrade (baseline)
|
|
324
|
-
let auditBefore = null;
|
|
325
|
-
try {
|
|
326
|
-
const r = runRedLinesAudit({ projectRoot: input.projectRoot });
|
|
327
|
-
auditBefore = { totalRedLines: r.audit.totalRedLines, cliBacked: r.audit.cliBacked };
|
|
328
|
-
}
|
|
329
|
-
catch (err) {
|
|
330
|
-
warnings.push(`audit-before failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
331
|
-
}
|
|
332
|
-
// Run the 6 sub-steps
|
|
333
|
-
for (const step of STEPS) {
|
|
334
|
-
if (step.name === 'memory-extract') {
|
|
335
|
-
// Special case: expand the three glob patterns to literal
|
|
336
|
-
// paths before spawning. memory-service rejects literal
|
|
337
|
-
// '**' in artifact paths (assertInsideProject's realpathSync
|
|
338
|
-
// throws ENOENT) and refuses to run without --artifact.
|
|
339
|
-
const artifacts = expandMemoryArtifacts(input.projectRoot);
|
|
340
|
-
if (artifacts.length === 0) {
|
|
341
|
-
steps.push({
|
|
342
|
-
name: 'memory-extract',
|
|
343
|
-
status: 'skipped',
|
|
344
|
-
exitCode: null,
|
|
345
|
-
stdout: '',
|
|
346
|
-
stderr: 'no skills/, CLAUDE.md, or .claude/rules/ artifacts found in the project',
|
|
347
|
-
durationMs: 0,
|
|
348
|
-
});
|
|
349
|
-
continue;
|
|
350
|
-
}
|
|
351
|
-
const args = ['memory', 'extract', '--project', input.projectRoot, '--artifact', ...artifacts, '--apply', '--json'];
|
|
352
|
-
const r = runStep(resolvedPeaksBin, 'memory-extract', args, 60_000, executor);
|
|
353
|
-
steps.push(r);
|
|
354
|
-
if (r.status === 'fail') {
|
|
355
|
-
warnings.push(`memory-extract failed: ${r.stderr.slice(0, 200)}`);
|
|
356
|
-
}
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
const args = step.args(input.projectRoot);
|
|
360
|
-
const r = runStep(resolvedPeaksBin, step.name, args, 60_000, executor);
|
|
361
|
-
steps.push(r);
|
|
362
|
-
if (r.status === 'fail') {
|
|
363
|
-
warnings.push(`${step.name} failed: ${r.stderr.slice(0, 200)}`);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
// Audit AFTER the upgrade (verify)
|
|
367
|
-
let auditAfter = null;
|
|
368
|
-
try {
|
|
369
|
-
const r = runRedLinesAudit({ projectRoot: input.projectRoot });
|
|
370
|
-
auditAfter = { totalRedLines: r.audit.totalRedLines, cliBacked: r.audit.cliBacked };
|
|
371
|
-
}
|
|
372
|
-
catch (err) {
|
|
373
|
-
warnings.push(`audit-after failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
374
|
-
}
|
|
375
|
-
const passedCount = steps.filter((s) => s.status === 'pass').length;
|
|
376
|
-
const failedCount = steps.filter((s) => s.status === 'fail').length;
|
|
377
|
-
const skippedCount = steps.filter((s) => s.status === 'skipped').length;
|
|
378
|
-
const applied = failedCount === 0;
|
|
379
|
-
if (failedCount > 0) {
|
|
380
|
-
nextActions.push(`${failedCount} sub-step(s) failed. Run \`peaks upgrade --to 2.0\` again to retry the failed steps.`);
|
|
381
|
-
}
|
|
382
|
-
if (input.auto !== true) {
|
|
383
|
-
nextActions.push('Run `peaks audit red-lines --project .` to verify the L2 catalog is healthy.');
|
|
384
|
-
}
|
|
385
|
-
nextActions.push('See `docs/UPGRADING-2.0.md` for the manual fallback if this auto-upgrade fails.');
|
|
386
|
-
// Write the upgrade record (always, even on partial failure —
|
|
387
|
-
// the user gets a forensic artifact either way)
|
|
388
|
-
const partial = {
|
|
389
|
-
applied,
|
|
390
|
-
fromVersion,
|
|
391
|
-
toVersion: '2.0.0',
|
|
392
|
-
projectRoot: input.projectRoot,
|
|
393
|
-
steps,
|
|
394
|
-
passedCount,
|
|
395
|
-
failedCount,
|
|
396
|
-
skippedCount,
|
|
397
|
-
auditBefore,
|
|
398
|
-
auditAfter,
|
|
399
|
-
upgradeRecordPath: null,
|
|
400
|
-
nextActions,
|
|
401
|
-
warnings,
|
|
402
|
-
};
|
|
403
|
-
const upgradeRecordPath = writeUpgradeRecord(input.projectRoot, partial);
|
|
404
|
-
return { ...partial, upgradeRecordPath };
|
|
405
|
-
}
|