peaks-loop 3.1.2 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +62 -12
- package/CHANGELOG.md +148 -116
- package/README-en.md +58 -240
- package/README.md +49 -325
- package/agents/karpathy-reviewer.md +3 -3
- package/dist/src/cli/cli-helpers.d.ts +18 -0
- package/dist/src/cli/cli-helpers.js +8 -0
- package/dist/src/cli/commands/adapter-commands.d.ts +30 -0
- package/dist/src/cli/commands/adapter-commands.js +35 -0
- package/dist/src/cli/commands/{solo-commands.d.ts → code-commands.d.ts} +25 -25
- package/dist/src/cli/commands/{solo-commands.js → code-commands.js} +82 -82
- package/dist/src/cli/commands/context-commands.d.ts +1 -1
- package/dist/src/cli/commands/context-commands.js +1 -1
- package/dist/src/cli/commands/contract-commands.d.ts +1 -1
- package/dist/src/cli/commands/contract-commands.js +1 -1
- package/dist/src/cli/commands/core/session-command.js +12 -0
- package/dist/src/cli/commands/core/skill-command.js +4 -4
- package/dist/src/cli/commands/dispatch-commands.js +2 -2
- package/dist/src/cli/commands/dispatch-from-dag.js +1 -1
- package/dist/src/cli/commands/hook-handle.js +7 -7
- package/dist/src/cli/commands/job-commands.js +7 -7
- package/dist/src/cli/commands/observability-commands.js +1 -1
- package/dist/src/cli/commands/perf-audit-commands.js +2 -2
- package/dist/src/cli/commands/security-audit-commands.js +2 -2
- package/dist/src/cli/commands/sediment-commands.d.ts +80 -0
- package/dist/src/cli/commands/sediment-commands.js +640 -0
- package/dist/src/cli/commands/session-auto-compact-hook-command.js +2 -2
- package/dist/src/cli/commands/session-migrate-skill-name.d.ts +17 -0
- package/dist/src/cli/commands/session-migrate-skill-name.js +41 -0
- package/dist/src/cli/commands/skill-visibility.d.ts +8 -0
- package/dist/src/cli/commands/skill-visibility.js +63 -0
- package/dist/src/cli/commands/slice-commands.js +2 -2
- package/dist/src/cli/commands/sub-agent-commands.d.ts +1 -1
- package/dist/src/cli/commands/sub-agent-commands.js +1 -1
- package/dist/src/cli/commands/sub-agent-shared.d.ts +1 -1
- package/dist/src/cli/commands/understand-commands.js +1 -1
- package/dist/src/cli/commands/upgrade-commands.d.ts +1 -1
- package/dist/src/cli/commands/upgrade-commands.js +3 -3
- package/dist/src/cli/commands/user-touchpoint-commands.d.ts +4 -4
- package/dist/src/cli/commands/user-touchpoint-commands.js +15 -15
- package/dist/src/cli/commands/verdict-aggregate-command.d.ts +1 -1
- package/dist/src/cli/commands/verdict-aggregate-command.js +2 -2
- package/dist/src/cli/commands/workflow-commands.js +23 -23
- package/dist/src/cli/commands/workspace/init-command.d.ts +3 -3
- package/dist/src/cli/commands/workspace/init-command.js +7 -7
- package/dist/src/cli/program.js +24 -7
- package/dist/src/services/adapter/adapter.d.ts +27 -0
- package/dist/src/services/adapter/adapter.js +5 -0
- package/dist/src/services/adapter/auto-adapter.d.ts +11 -0
- package/dist/src/services/adapter/auto-adapter.js +15 -0
- package/dist/src/services/adapter/claude-adapter.d.ts +14 -0
- package/dist/src/services/adapter/claude-adapter.js +40 -0
- package/dist/src/services/adapter/codex-adapter.d.ts +14 -0
- package/dist/src/services/adapter/codex-adapter.js +14 -0
- package/dist/src/services/adapter/copilot-adapter.d.ts +14 -0
- package/dist/src/services/adapter/copilot-adapter.js +14 -0
- package/dist/src/services/artifacts/repair-cycle-service.js +1 -1
- package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +1 -1
- package/dist/src/services/audit/enforcers/active-skill-resolver.js +1 -1
- package/dist/src/services/audit/enforcers/{solo-code-ban.d.ts → code-ban.d.ts} +6 -6
- package/dist/src/services/audit/enforcers/{solo-code-ban.js → code-ban.js} +6 -6
- package/dist/src/services/audit/red-line-catalog.d.ts +2 -2
- package/dist/src/services/audit/red-line-catalog.js +6 -6
- package/dist/src/services/audit/scanners/skills-tree-scanner.js +22 -0
- package/dist/src/services/audit/types.d.ts +2 -2
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.d.ts +2 -2
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.js +5 -5
- package/dist/src/services/{solo → code}/dag-orchestrator.d.ts +4 -4
- package/dist/src/services/{solo → code}/dag-orchestrator.js +5 -5
- package/dist/src/services/{solo → code}/emit-handoff.d.ts +1 -1
- package/dist/src/services/{solo → code}/emit-handoff.js +1 -1
- package/dist/src/services/{solo → code}/job-shape-decision.d.ts +1 -1
- package/dist/src/services/{solo → code}/job-shape-decision.js +5 -5
- package/dist/src/services/{solo → code}/mode-gate.d.ts +11 -11
- package/dist/src/services/{solo → code}/mode-gate.js +5 -5
- package/dist/src/services/{solo → code}/post-compact-detector.d.ts +3 -3
- package/dist/src/services/{solo → code}/post-compact-detector.js +6 -6
- package/dist/src/services/{solo → code}/status-line-renderer.d.ts +4 -4
- package/dist/src/services/{solo → code}/step-08-gate.d.ts +4 -4
- package/dist/src/services/{solo → code}/step-08-gate.js +4 -4
- package/dist/src/services/{solo → code}/user-touchpoint-classifier.d.ts +1 -1
- package/dist/src/services/{solo → code}/user-touchpoint-classifier.js +1 -1
- package/dist/src/services/context/auto-compact-dispatcher.d.ts +3 -3
- package/dist/src/services/context/auto-compact-dispatcher.js +2 -2
- package/dist/src/services/context/auto-compact-types.d.ts +1 -1
- package/dist/src/services/dispatch/batch-counter.js +1 -1
- package/dist/src/services/dispatch/leak-detector.js +1 -1
- package/dist/src/services/dispatch/slice-dag.d.ts +2 -2
- package/dist/src/services/dispatch/test-tool-detection.d.ts +1 -1
- package/dist/src/services/dispatch/test-tool-detection.js +1 -1
- package/dist/src/services/doctor/doctor-service.js +2 -2
- package/dist/src/services/feedback/feedback-promotion-service.js +2 -2
- package/dist/src/services/job/job-progress-store.d.ts +1 -1
- package/dist/src/services/job/job-progress-store.js +1 -1
- package/dist/src/services/job/job-resource-snapshot.js +29 -1
- package/dist/src/services/memory/project-memory-service.js +1 -1
- package/dist/src/services/migrate-skill-name/migrate.d.ts +17 -0
- package/dist/src/services/migrate-skill-name/migrate.js +152 -0
- package/dist/src/services/migrate-skill-name/schema.d.ts +42 -0
- package/dist/src/services/migrate-skill-name/schema.js +25 -0
- package/dist/src/services/observability/aggregation.d.ts +1 -1
- package/dist/src/services/observability/aggregation.js +1 -1
- package/dist/src/services/perf/perf-baseline-service.d.ts +1 -1
- package/dist/src/services/perf/perf-baseline-service.js +1 -1
- package/dist/src/services/prd/handoff-types.d.ts +1 -1
- package/dist/src/services/prd/handoff-types.js +1 -1
- package/dist/src/services/preferences/preferences-service.d.ts +1 -1
- package/dist/src/services/preferences/preferences-types.d.ts +1 -1
- package/dist/src/services/progress/progress-service.d.ts +1 -1
- package/dist/src/services/progress/progress-service.js +1 -1
- package/dist/src/services/rd/standards-diagnostic.d.ts +1 -1
- package/dist/src/services/rd/standards-diagnostic.js +3 -3
- package/dist/src/services/recommendations/capability-seed-items.js +1 -1
- package/dist/src/services/recommendations/capability-seed-mappings.js +1 -1
- package/dist/src/services/recommendations/recommendation-service.js +1 -1
- package/dist/src/services/refactor/refactor-service.d.ts +1 -1
- package/dist/src/services/sc/sc-service.js +1 -1
- package/dist/src/services/sediment/dispose-confirm.d.ts +9 -0
- package/dist/src/services/sediment/dispose-confirm.js +5 -0
- package/dist/src/services/sediment/json-schema.d.ts +247 -0
- package/dist/src/services/sediment/json-schema.js +26 -0
- package/dist/src/services/sediment/manifest-lint.d.ts +13 -0
- package/dist/src/services/sediment/manifest-lint.js +11 -0
- package/dist/src/services/sediment/pool-paths.d.ts +22 -0
- package/dist/src/services/sediment/pool-paths.js +25 -0
- package/dist/src/services/sediment/pool-read.d.ts +20 -0
- package/dist/src/services/sediment/pool-read.js +73 -0
- package/dist/src/services/sediment/pool-rebuild-index.d.ts +15 -0
- package/dist/src/services/sediment/pool-rebuild-index.js +28 -0
- package/dist/src/services/sediment/pool-write.d.ts +14 -0
- package/dist/src/services/sediment/pool-write.js +25 -0
- package/dist/src/services/sediment/promotion-gate.d.ts +12 -0
- package/dist/src/services/sediment/promotion-gate.js +20 -0
- package/dist/src/services/sediment/types.d.ts +52 -0
- package/dist/src/services/sediment/types.js +1 -0
- package/dist/src/services/session/binding-store.d.ts +1 -1
- package/dist/src/services/session/binding-store.js +1 -1
- package/dist/src/services/session/caller-id-types.d.ts +1 -1
- package/dist/src/services/session/session-manager.d.ts +1 -1
- package/dist/src/services/session/session-manager.js +1 -1
- package/dist/src/services/signal/cancel-handler.js +3 -3
- package/dist/src/services/skill/resume-detector.js +2 -2
- package/dist/src/services/skill/skill-scheduler.d.ts +1 -1
- package/dist/src/services/skill/skill-scheduler.js +1 -1
- package/dist/src/services/skillhub/release-diff.d.ts +18 -0
- package/dist/src/services/skillhub/release-diff.js +38 -0
- package/dist/src/services/skillhub/release-export.d.ts +8 -0
- package/dist/src/services/skillhub/release-export.js +31 -0
- package/dist/src/services/skillhub/release-gc-blobs.d.ts +13 -0
- package/dist/src/services/skillhub/release-gc-blobs.js +32 -0
- package/dist/src/services/skillhub/release-import.d.ts +7 -0
- package/dist/src/services/skillhub/release-import.js +59 -0
- package/dist/src/services/skillhub/release-retain.d.ts +23 -0
- package/dist/src/services/skillhub/release-retain.js +89 -0
- package/dist/src/services/skillhub/sqlite-store.d.ts +22 -0
- package/dist/src/services/skillhub/sqlite-store.js +47 -0
- package/dist/src/services/skillhub/tar-runtime.d.ts +21 -0
- package/dist/src/services/skillhub/tar-runtime.js +91 -0
- package/dist/src/services/skillhub/types.d.ts +105 -0
- package/dist/src/services/skillhub/types.js +1 -0
- package/dist/src/services/skills/skill-conformance-service.js +8 -5
- package/dist/src/services/skills/skill-presence-service.d.ts +5 -5
- package/dist/src/services/skills/skill-presence-service.js +2 -2
- package/dist/src/services/skills/skill-registry.js +27 -0
- package/dist/src/services/skills/skill-runbook-service.js +2 -2
- package/dist/src/services/slice/slice-check-service.js +1 -1
- package/dist/src/services/slice/slice-check-types.d.ts +1 -1
- package/dist/src/services/slice/slice-check-types.js +1 -1
- package/dist/src/services/slice/slice-decompose-types.d.ts +1 -1
- package/dist/src/services/slice/slice-decompose-types.js +1 -1
- package/dist/src/services/standards/missing-standards-detector.d.ts +1 -1
- package/dist/src/services/standards/missing-standards-detector.js +1 -1
- package/dist/src/services/standards/project-standards-service.d.ts +1 -1
- package/dist/src/services/standards/project-standards-service.js +4 -4
- package/dist/src/services/understand/understand-types.d.ts +1 -1
- package/dist/src/services/upgrade/1x-detector-service.js +2 -2
- package/dist/src/services/upgrade/upgrade-service.d.ts +34 -0
- package/dist/src/services/upgrade/upgrade-service.js +52 -30
- package/dist/src/services/verdict/verdict-aggregator.d.ts +1 -1
- package/dist/src/services/workflow/pipeline-verify-service.d.ts +1 -1
- package/dist/src/services/workflow/pipeline-verify-service.js +3 -3
- package/dist/src/services/workflow/workflow-autonomous-service.d.ts +3 -3
- package/dist/src/services/workflow/workflow-autonomous-service.js +2 -2
- package/dist/src/services/workflow/workflow-router-service.d.ts +7 -7
- package/dist/src/services/workflow/workflow-router-service.js +33 -33
- package/dist/src/services/workspace/claude-settings-template.d.ts +2 -2
- package/dist/src/services/workspace/claude-settings-template.js +7 -7
- package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +1 -1
- package/dist/src/services/workspace/workspace-claude-settings-materializer.js +1 -1
- package/dist/src/services/workspace/workspace-service.d.ts +4 -4
- package/dist/src/services/workspace/workspace-service.js +2 -2
- package/dist/src/shared/paths.d.ts +1 -1
- package/dist/src/shared/paths.js +1 -1
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/dist/src/skills/peaks-maker/index.d.ts +5 -0
- package/dist/src/skills/peaks-maker/index.js +32 -0
- package/output-styles/peaks-skill-swarm.md +3 -3
- package/package.json +8 -3
- package/scripts/install-skills.mjs +29 -4
- package/skills/{peaks-prd → bee/peaks-prd}/SKILL.md +8 -2
- package/skills/{peaks-prd → bee/peaks-prd}/references/workflow.md +1 -1
- package/skills/{peaks-qa → bee/peaks-qa}/SKILL.md +10 -4
- package/skills/{peaks-qa → bee/peaks-qa}/references/artifact-per-request.md +3 -3
- package/skills/{peaks-qa → bee/peaks-qa}/references/browser-validation-contracts.md +2 -2
- package/skills/{peaks-qa → bee/peaks-qa}/references/external-capability-guidance.md +1 -1
- package/skills/{peaks-qa → bee/peaks-qa}/references/qa-fanout-contract.md +3 -3
- package/skills/{peaks-qa → bee/peaks-qa}/references/qa-sub-agent-dispatch.md +7 -7
- package/skills/{peaks-rd → bee/peaks-rd}/SKILL.md +13 -6
- package/skills/{peaks-rd → bee/peaks-rd}/references/browser-self-test-contracts.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/mock-data-placement.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/parallel-review-fanout.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-fanout-contracts.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-runbook.md +2 -2
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-sub-agent-dispatch.md +13 -13
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-transition-gates.md +2 -2
- package/skills/{peaks-rd → bee/peaks-rd}/references/skill-presence-and-title.md +1 -1
- package/skills/{peaks-reviewer → bee/peaks-reviewer}/SKILL.md +2 -2
- package/skills/{peaks-sc → bee/peaks-sc}/SKILL.md +8 -2
- package/skills/{peaks-txt → bee/peaks-txt}/SKILL.md +11 -5
- package/skills/{peaks-ui → bee/peaks-ui}/SKILL.md +19 -13
- package/skills/peaks-audit/SKILL.md +1 -1
- package/skills/{peaks-solo → peaks-code}/SKILL.md +29 -29
- package/skills/{peaks-solo → peaks-code}/references/a2a-artifact-mapping.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/anchoring-and-session-info.md +6 -6
- package/skills/{peaks-solo → peaks-code}/references/artifact-contracts.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/boundaries.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/browser-workflow.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/codegraph-orchestration.md +1 -1
- package/skills/peaks-code/references/command-migration.md +3 -0
- package/skills/{peaks-solo → peaks-code}/references/completion-handoff.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/context-governance.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/dag-orchestrator.md +7 -7
- package/skills/{peaks-solo → peaks-code}/references/external-references.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/fanout-mandatory.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/fast-mode.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/frontend-only-mode.md +10 -10
- package/skills/{peaks-solo → peaks-code}/references/job-loop.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/local-artifact-workspace.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/micro-cycle.md +23 -23
- package/skills/{peaks-solo → peaks-code}/references/mode-selection-with-stale-presence.md +16 -16
- package/skills/{peaks-solo → peaks-code}/references/mode-selection.md +4 -4
- package/skills/{peaks-solo → peaks-code}/references/openspec-workflow.md +17 -17
- package/skills/{peaks-solo → peaks-code}/references/periodic-checkpoint.md +4 -4
- package/skills/{peaks-solo → peaks-code}/references/project-scan-checklist.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/quality-gate-cheatsheet.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/refactor-mode.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/resume-detection.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/runbook.md +20 -20
- package/skills/{peaks-solo → peaks-code}/references/skill-presence-and-title.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/standards-preflight.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/step-0-55-1x-detection.md +6 -6
- package/skills/{peaks-solo → peaks-code}/references/step-0-8-gate.md +11 -11
- package/skills/{peaks-solo → peaks-code}/references/sub-agent-dispatch.md +17 -17
- package/skills/{peaks-solo → peaks-code}/references/swarm-dispatch-contract.md +22 -22
- package/skills/{peaks-solo → peaks-code}/references/workflow-gates-and-types.md +4 -4
- package/skills/{peaks-solo → peaks-code}/references/workflow.md +5 -5
- package/skills/peaks-doctor/SKILL.md +1 -1
- package/skills/peaks-doctor/references/doctor-check-catalog.md +1 -1
- package/skills/peaks-final-review/SKILL.md +3 -3
- package/skills/peaks-final-review/references/4-dimensions.md +1 -1
- package/skills/peaks-ide/SKILL.md +1 -1
- package/skills/{peaks-solo-resume → peaks-resume}/SKILL.md +15 -15
- package/skills/peaks-sop/SKILL.md +1 -1
- package/skills/{peaks-solo-status → peaks-status}/SKILL.md +14 -14
- package/skills/{peaks-solo-test → peaks-test}/SKILL.md +12 -12
- package/skills/peaks-solo/references/command-migration.md +0 -3
- /package/dist/src/services/{solo → code}/batch-heartbeat-poller.d.ts +0 -0
- /package/dist/src/services/{solo → code}/batch-heartbeat-poller.js +0 -0
- /package/dist/src/services/{solo → code}/status-line-renderer.js +0 -0
- /package/skills/{peaks-perf-audit → bee/peaks-perf-audit}/SKILL.md +0 -0
- /package/skills/{peaks-perf-audit → bee/peaks-perf-audit}/references/audit-protocol.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/artifact-per-request.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/command-migration.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/prd-for-multi-pass.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/codegraph-regression-focus.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/command-migration.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/openspec-validation-gate.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-compact-handoff.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-context-governance.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-gstack-integration.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-local-artifacts.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-matt-pocock-integration.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-perf-test-plan.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-refactor-role.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-runbook.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-security-test-plan.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-skill-presence.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-standards-preflight.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-transition-gates.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/reading-handoff-frontmatter.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/regression-gates.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/requirement-boundary-recheck.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/test-case-generation.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/test-report-output.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-and-standards-output.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-per-request.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/browser-action-wrapper.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/code-reviewer-4dim-hint.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/codegraph-project-analysis.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/command-migration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/compact-handoff.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/external-references.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/frontend-project-generation.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/karpathy-reviewer-prompt.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/library-version-awareness.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/mandatory-perf-baseline.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/matt-pocock-integration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/ocr-integration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/openspec-cli.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-context-governance.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-gstack-integration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-standards-preflight.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/reading-v2-slice-results.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/refactor-workflow.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/v2-12-fanout-collapse.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/writing-handoff-frontmatter.md +0 -0
- /package/skills/{peaks-reviewer → bee/peaks-reviewer}/references/reviewer-prompt.md +0 -0
- /package/skills/{peaks-reviewer → bee/peaks-reviewer}/references/reviewer-schema.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/artifact-retention.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/command-migration.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/openspec-commit-boundaries.md +0 -0
- /package/skills/{peaks-security-audit → bee/peaks-security-audit}/SKILL.md +0 -0
- /package/skills/{peaks-security-audit → bee/peaks-security-audit}/references/audit-protocol.md +0 -0
- /package/skills/{peaks-txt → bee/peaks-txt}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-txt → bee/peaks-txt}/references/command-migration.md +0 -0
- /package/skills/{peaks-txt → bee/peaks-txt}/references/context-capsule.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/artifact-per-request.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/command-migration.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/workflow.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/checkpoint-resume.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/cross-date-session-check.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/envelope-contract.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/existing-system-extraction.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/external-skill-invocation.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/gstack-integration.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/headroom-integration.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/playwright-mcp-multi-terminal.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/project-memory-loading.md +0 -0
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Re-uses `SkillPresenceMode` from `skill-presence-service.ts` so the
|
|
20
20
|
* 4 mode values stay in lockstep with the rest of the runtime.
|
|
21
21
|
*/
|
|
22
|
-
export const
|
|
22
|
+
export const CODE_MODES = [
|
|
23
23
|
'full-auto',
|
|
24
24
|
'assisted',
|
|
25
25
|
'swarm',
|
|
@@ -47,8 +47,8 @@ export const GATED_STEPS = [
|
|
|
47
47
|
'step-0.75-checkpoint-resume',
|
|
48
48
|
'standards-preflight'
|
|
49
49
|
];
|
|
50
|
-
export function
|
|
51
|
-
return
|
|
50
|
+
export function isCodeMode(value) {
|
|
51
|
+
return CODE_MODES.includes(value);
|
|
52
52
|
}
|
|
53
53
|
export function isHardFloorCategory(value) {
|
|
54
54
|
return HARD_FLOOR_CATEGORIES.includes(value);
|
|
@@ -75,7 +75,7 @@ export function isCommitBoundaryAction(value) {
|
|
|
75
75
|
* Hard-pause steps: these pause regardless of mode. They are the gates
|
|
76
76
|
* whose decision *creates* or *recreates* the mode/state under which
|
|
77
77
|
* later gates run. Auto-proceeding on them would silently fix the mode
|
|
78
|
-
* without user consent (defect #1: new
|
|
78
|
+
* without user consent (defect #1: new Code session skipped Step 1
|
|
79
79
|
* AskUserQuestion because `full-auto` mode triggered `shouldAutoProceed`
|
|
80
80
|
* on `step-1-mode-select` itself).
|
|
81
81
|
*
|
|
@@ -115,7 +115,7 @@ export function shouldPauseAtGate(opts) {
|
|
|
115
115
|
gateKind: 'hard-floor'
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
// Slice 2026-06-28-
|
|
118
|
+
// Slice 2026-06-28-code-mode-bypass-fix: hard-pause steps that
|
|
119
119
|
// determine the active mode or session context MUST prompt the
|
|
120
120
|
// user. Otherwise full-auto silently locks in `mode=full-auto` on
|
|
121
121
|
// the first tool call, skipping the AskUserQuestion Step 1 mandates.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 1. `.peaks/_runtime/<sessionId>/` is bound
|
|
8
8
|
* 2. Latest checkpoint mtime is from today (UTC date)
|
|
9
9
|
* 3. Latest checkpoint has a parseable `mode` field
|
|
10
|
-
* 4. The peak-
|
|
10
|
+
* 4. The peak-code skill is the active skill
|
|
11
11
|
* 5. Exactly one session has a today's checkpoint (no ambiguity)
|
|
12
12
|
*
|
|
13
13
|
* On a hit, the LLM MUST auto-resume (D7.b override of "never silently
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
* No writes (caller logs the decision via the auto-decisions channel).
|
|
23
23
|
*/
|
|
24
24
|
import type { SkillPresenceMode } from '../skills/skill-presence-service.js';
|
|
25
|
-
import { type
|
|
25
|
+
import { type CodeMode } from './mode-gate.js';
|
|
26
26
|
export type PostCompactResumeReason = 'post-compact-match' | 'sid-unbound' | 'runtime-dir-missing' | 'no-checkpoint-today' | 'no-mode-field' | 'stale-checkpoint' | 'multiple-checkpoints-ambiguous' | 'active-skill-mismatch' | 'checkpoint-read-failed';
|
|
27
27
|
export declare const POST_COMPACT_RESUME_REASONS: readonly PostCompactResumeReason[];
|
|
28
28
|
export interface PostCompactResumeProbe {
|
|
29
29
|
readonly shouldAutoResume: boolean;
|
|
30
30
|
readonly reason: PostCompactResumeReason;
|
|
31
|
-
readonly mode?:
|
|
31
|
+
readonly mode?: CodeMode;
|
|
32
32
|
readonly checkpointPath?: string;
|
|
33
33
|
readonly checkpointMtime?: string;
|
|
34
34
|
readonly task?: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 1. `.peaks/_runtime/<sessionId>/` is bound
|
|
8
8
|
* 2. Latest checkpoint mtime is from today (UTC date)
|
|
9
9
|
* 3. Latest checkpoint has a parseable `mode` field
|
|
10
|
-
* 4. The peak-
|
|
10
|
+
* 4. The peak-code skill is the active skill
|
|
11
11
|
* 5. Exactly one session has a today's checkpoint (no ambiguity)
|
|
12
12
|
*
|
|
13
13
|
* On a hit, the LLM MUST auto-resume (D7.b override of "never silently
|
|
@@ -25,7 +25,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
|
25
25
|
import { join } from 'node:path';
|
|
26
26
|
import { getSkillPresence } from '../skills/skill-presence-service.js';
|
|
27
27
|
import { emitObservabilityEvent } from '../observability/observability-service.js';
|
|
28
|
-
import {
|
|
28
|
+
import { isCodeMode } from './mode-gate.js';
|
|
29
29
|
export const POST_COMPACT_RESUME_REASONS = [
|
|
30
30
|
'post-compact-match',
|
|
31
31
|
'sid-unbound',
|
|
@@ -146,7 +146,7 @@ export async function detectPostCompactResume(opts) {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
// Active skill check (D7.a.4). Defaults to reading from skill presence.
|
|
149
|
-
const expectedActiveSkill = 'peaks-
|
|
149
|
+
const expectedActiveSkill = 'peaks-code';
|
|
150
150
|
const observedActiveSkill = opts.activeSkill ?? readActiveSkillName(opts.projectRoot);
|
|
151
151
|
if (observedActiveSkill !== expectedActiveSkill) {
|
|
152
152
|
return {
|
|
@@ -154,13 +154,13 @@ export async function detectPostCompactResume(opts) {
|
|
|
154
154
|
reason: 'active-skill-mismatch',
|
|
155
155
|
checkpointPath: file.path,
|
|
156
156
|
checkpointMtime: file.mtime.toISOString(),
|
|
157
|
-
warnings: [`active skill "${observedActiveSkill ?? 'unset'}" is not peaks-
|
|
157
|
+
warnings: [`active skill "${observedActiveSkill ?? 'unset'}" is not peaks-code`]
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
// Mode: prefer the checkpoint's mode; fall back to the presence override
|
|
161
161
|
// (test seam) or to a fresh skill-presence read.
|
|
162
162
|
let mode;
|
|
163
|
-
if (
|
|
163
|
+
if (isCodeMode(checkpointMode)) {
|
|
164
164
|
mode = checkpointMode;
|
|
165
165
|
}
|
|
166
166
|
else if (opts.presenceModeOverride !== undefined) {
|
|
@@ -170,7 +170,7 @@ export async function detectPostCompactResume(opts) {
|
|
|
170
170
|
try {
|
|
171
171
|
const presence = getSkillPresence(opts.projectRoot);
|
|
172
172
|
const presenceMode = presence?.mode;
|
|
173
|
-
if (presenceMode !== undefined &&
|
|
173
|
+
if (presenceMode !== undefined && isCodeMode(presenceMode)) {
|
|
174
174
|
mode = presenceMode;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* G6.5 — status line renderer for the peaks-
|
|
2
|
+
* G6.5 — status line renderer for the peaks-code batch-sync wait period.
|
|
3
3
|
*
|
|
4
4
|
* Single line, 80-120 chars, status-line-friendly. The shape is
|
|
5
5
|
* documented in PRD §G6.5:
|
|
6
6
|
*
|
|
7
|
-
* [peaks-
|
|
8
|
-
* [peaks-
|
|
7
|
+
* [peaks-code] swarm 3/3 running | rd-planning 45% (12s ago) | qa-test-cases 30% (5s ago) | ui-design 20% (2s ago)
|
|
8
|
+
* [peaks-code] swarm 3/3 running | rd-planning 70% (8s ago) | qa-test-cases 50% (3s ago) | ui-design 30% (6s ago)
|
|
9
9
|
* ...
|
|
10
|
-
* [peaks-
|
|
10
|
+
* [peaks-code] swarm 3/3 done in 47.3s
|
|
11
11
|
*
|
|
12
12
|
* Pure helper; the poller calls it once per tick. No IO.
|
|
13
13
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Wire-installed by `peaks workspace init` (extends the existing hook
|
|
5
5
|
* installer; does NOT replace the Write|Edit|MultiEdit fact-forcing
|
|
6
|
-
* bypass). The hook runs `peaks
|
|
6
|
+
* bypass). The hook runs `peaks code gate-step-08 --project .` before
|
|
7
7
|
* every Bash tool call. Exit code is the load-bearing contract:
|
|
8
8
|
*
|
|
9
9
|
* exit 0 → allow (with structured stdout describing the decision)
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* regex is the FIRST time peaks-loop accepts hardcoded keywords —
|
|
30
30
|
* explicitly scoped as a *fail-closed backup* (case 3), NOT a primary
|
|
31
31
|
* judgement. The LLM still owns the semantic call via
|
|
32
|
-
* `peaks
|
|
32
|
+
* `peaks code detect-job`. The regex is a safety net for the v3.1.1
|
|
33
33
|
* incident class (LLM under load never records the decision at all).
|
|
34
34
|
*/
|
|
35
35
|
export declare const STEP_08_GATE_FILE_NAME: "job-shape.json";
|
|
@@ -38,7 +38,7 @@ export declare const STEP_08_PROGRESS_FILE_NAME: "progress.json";
|
|
|
38
38
|
* Fail-closed backup regex — see module docstring case 3 for why this
|
|
39
39
|
* exists. Kept short and explicit; if the prompt mentions any of these
|
|
40
40
|
* triggers and `job-shape.json` is missing, the LLM is treated as
|
|
41
|
-
* having skipped `peaks
|
|
41
|
+
* having skipped `peaks code detect-job` and the gate blocks.
|
|
42
42
|
*
|
|
43
43
|
* The list mirrors the v3.1.0 / v3.1.1 incident triggers verbatim:
|
|
44
44
|
* 继续执行下个 slice (until next slice) → until / 直到
|
|
@@ -84,7 +84,7 @@ export interface EvaluateStep08Result {
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* Pure evaluator — does NOT write, does NOT exit. CLI wrapper in
|
|
87
|
-
* `src/cli/commands/
|
|
87
|
+
* `src/cli/commands/code-commands.ts` reads `allow` to set the process
|
|
88
88
|
* exit code (0 allow / 2 block) and prints the structured envelope.
|
|
89
89
|
*/
|
|
90
90
|
export declare function evaluateStep08(input: EvaluateStep08Input): EvaluateStep08Result;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Wire-installed by `peaks workspace init` (extends the existing hook
|
|
5
5
|
* installer; does NOT replace the Write|Edit|MultiEdit fact-forcing
|
|
6
|
-
* bypass). The hook runs `peaks
|
|
6
|
+
* bypass). The hook runs `peaks code gate-step-08 --project .` before
|
|
7
7
|
* every Bash tool call. Exit code is the load-bearing contract:
|
|
8
8
|
*
|
|
9
9
|
* exit 0 → allow (with structured stdout describing the decision)
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* regex is the FIRST time peaks-loop accepts hardcoded keywords —
|
|
30
30
|
* explicitly scoped as a *fail-closed backup* (case 3), NOT a primary
|
|
31
31
|
* judgement. The LLM still owns the semantic call via
|
|
32
|
-
* `peaks
|
|
32
|
+
* `peaks code detect-job`. The regex is a safety net for the v3.1.1
|
|
33
33
|
* incident class (LLM under load never records the decision at all).
|
|
34
34
|
*/
|
|
35
35
|
import { existsSync, readFileSync } from 'node:fs';
|
|
@@ -41,7 +41,7 @@ export const STEP_08_PROGRESS_FILE_NAME = 'progress.json';
|
|
|
41
41
|
* Fail-closed backup regex — see module docstring case 3 for why this
|
|
42
42
|
* exists. Kept short and explicit; if the prompt mentions any of these
|
|
43
43
|
* triggers and `job-shape.json` is missing, the LLM is treated as
|
|
44
|
-
* having skipped `peaks
|
|
44
|
+
* having skipped `peaks code detect-job` and the gate blocks.
|
|
45
45
|
*
|
|
46
46
|
* The list mirrors the v3.1.0 / v3.1.1 incident triggers verbatim:
|
|
47
47
|
* 继续执行下个 slice (until next slice) → until / 直到
|
|
@@ -102,7 +102,7 @@ function readPromptFromLastPromptFile(projectRoot, sessionId) {
|
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Pure evaluator — does NOT write, does NOT exit. CLI wrapper in
|
|
105
|
-
* `src/cli/commands/
|
|
105
|
+
* `src/cli/commands/code-commands.ts` reads `allow` to set the process
|
|
106
106
|
* exit code (0 allow / 2 block) and prints the structured envelope.
|
|
107
107
|
*/
|
|
108
108
|
export function evaluateStep08(input) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* v2.15.0 follow-up — G4: user touchpoint classifier.
|
|
3
3
|
*
|
|
4
4
|
* 12 Gaps positioning memory: "user 介入 = 业务/产品审阅,不是技术决策".
|
|
5
|
-
* This service classifies every
|
|
5
|
+
* This service classifies every Code gate by the kind of decision it
|
|
6
6
|
* represents, so the CLI / status line can show user which gates
|
|
7
7
|
* actually need their attention vs which are technical defaults
|
|
8
8
|
* (AI auto-decides in full-auto).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* v2.15.0 follow-up — G4: user touchpoint classifier.
|
|
3
3
|
*
|
|
4
4
|
* 12 Gaps positioning memory: "user 介入 = 业务/产品审阅,不是技术决策".
|
|
5
|
-
* This service classifies every
|
|
5
|
+
* This service classifies every Code gate by the kind of decision it
|
|
6
6
|
* represents, so the CLI / status line can show user which gates
|
|
7
7
|
* actually need their attention vs which are technical defaults
|
|
8
8
|
* (AI auto-decides in full-auto).
|
|
@@ -7,11 +7,11 @@ export interface DispatchIdeCompactInput {
|
|
|
7
7
|
/** Spawn timeout (ms). Default 30s — Claude Code `/compact` is sync. */
|
|
8
8
|
readonly timeoutMs?: number | undefined;
|
|
9
9
|
/**
|
|
10
|
-
* Slice 2026-06-28-
|
|
10
|
+
* Slice 2026-06-28-code-mode-bypass-fix (defect #4): which session
|
|
11
11
|
* the compact should target. Default `'main'` — the orchestrator
|
|
12
|
-
* (peaks-
|
|
12
|
+
* (peaks-code body) runs in the main-session Claude Code window and
|
|
13
13
|
* wants to compress *its* context, not a sub-agent's. Sub-agent
|
|
14
|
-
* shells that spawn their own `peaks
|
|
14
|
+
* shells that spawn their own `peaks code auto-compact` flow pass
|
|
15
15
|
* `'sub-agent'` to preserve the legacy shell-spawn behaviour.
|
|
16
16
|
*
|
|
17
17
|
* Behaviour matrix (claude-code MVP):
|
|
@@ -47,7 +47,7 @@ export async function dispatchIdeCompact(input) {
|
|
|
47
47
|
// See auto-compact-reader.ts for the IdeKind→IdeId cast rationale.
|
|
48
48
|
const ideId = (detected === 'unknown' ? 'claude-code' : detected);
|
|
49
49
|
const adapter = getAdapter(ideId);
|
|
50
|
-
// Slice 2026-06-28-
|
|
50
|
+
// Slice 2026-06-28-code-mode-bypass-fix (defect #4): default to
|
|
51
51
|
// `'main'` so the orchestrator's auto-compact actually compresses
|
|
52
52
|
// the main-session context. The orchestrator passes `'sub-agent'`
|
|
53
53
|
// explicitly when a sub-agent shell dispatches the call.
|
|
@@ -123,7 +123,7 @@ export async function dispatchIdeCompact(input) {
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
// Lazy install: we only get here when the caller explicitly
|
|
126
|
-
// invokes `peaks
|
|
126
|
+
// invokes `peaks code auto-compact --execute`, so the user has
|
|
127
127
|
// already opted in. No zero-touch surprise on workspace init.
|
|
128
128
|
return await dispatchIdeNativeHook({
|
|
129
129
|
projectRoot: input.projectRoot,
|
|
@@ -107,7 +107,7 @@ export type AutoCompactResult = {
|
|
|
107
107
|
readonly convergencePlan?: ConvergencePlan;
|
|
108
108
|
readonly dispatch?: CompactDispatchResult;
|
|
109
109
|
/**
|
|
110
|
-
* Slice 2026-06-28-
|
|
110
|
+
* Slice 2026-06-28-code-mode-bypass-fix (defect #4): which
|
|
111
111
|
* session the compact targeted. `'main'` (default) means the
|
|
112
112
|
* main-session Claude Code window will fire `/compact` on its
|
|
113
113
|
* next turn; `'sub-agent'` means the dispatcher shell-spawned
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Empirical upper bound for one Dispatcher × one batch: 6 sub-agents.
|
|
5
5
|
* Above 6, the LLM / human is encouraged to split into multiple
|
|
6
|
-
* batches with an explicit reducer step in between. peaks-
|
|
6
|
+
* batches with an explicit reducer step in between. peaks-code's
|
|
7
7
|
* swarm phase dispatches 3; peaks-rd's 4-way fan-out dispatches 4;
|
|
8
8
|
* peaks-qa's 3-way fan-out dispatches 3. The 6 limit leaves headroom
|
|
9
9
|
* for "qa-business-api" / "qa-business-frontend" / "qa-business-regression"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slice #009 / G5 RL-7 — dispatch record leak detector.
|
|
3
3
|
*
|
|
4
|
-
* After peaks-
|
|
4
|
+
* After peaks-code's reducer consumes a batch, any dispatch record that
|
|
5
5
|
* is still `disposed === false` AND was created more than `thresholdMs`
|
|
6
6
|
* ago is a **leak**. This helper scans the on-disk records under
|
|
7
7
|
* `.peaks/_sub_agents/<sid>/` and returns the leaked ones. The CLI or
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slice complexity tier (v2.15.0 follow-up, G2 in 12 Gaps).
|
|
3
|
-
* Used by
|
|
3
|
+
* Used by Code to schedule complex slices during user-attended hours
|
|
4
4
|
* and trivial / simple slices overnight.
|
|
5
5
|
*/
|
|
6
6
|
export type SliceComplexity = 'trivial' | 'simple' | 'complex';
|
|
@@ -27,7 +27,7 @@ export interface SliceNode {
|
|
|
27
27
|
*/
|
|
28
28
|
readonly upstreamSync?: boolean;
|
|
29
29
|
/**
|
|
30
|
-
* v2.15.0 follow-up — G2: complexity tier. Drives
|
|
30
|
+
* v2.15.0 follow-up — G2: complexity tier. Drives Code's scheduling
|
|
31
31
|
* (complex = user-attended, simple/trivial = overnight). Optional.
|
|
32
32
|
*/
|
|
33
33
|
readonly complexity?: SliceComplexity;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The Test Tool Detection block is prepended to every sub-agent prompt
|
|
5
5
|
* dispatched by peaks-loop (both the single-dispatch chokepoint in
|
|
6
6
|
* `src/cli/commands/dispatch-commands.ts` and the DAG-dispatch chokepoint
|
|
7
|
-
* in `src/services/
|
|
7
|
+
* in `src/services/code/dag-orchestrator.ts`). It tells the sub-agent
|
|
8
8
|
* to read `package.json#scripts.test` first and use the project-local
|
|
9
9
|
* runner — never `npx <runner>` — so it cannot bypass the lockfile or
|
|
10
10
|
* spawn a network-bound tool call.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The Test Tool Detection block is prepended to every sub-agent prompt
|
|
5
5
|
* dispatched by peaks-loop (both the single-dispatch chokepoint in
|
|
6
6
|
* `src/cli/commands/dispatch-commands.ts` and the DAG-dispatch chokepoint
|
|
7
|
-
* in `src/services/
|
|
7
|
+
* in `src/services/code/dag-orchestrator.ts`). It tells the sub-agent
|
|
8
8
|
* to read `package.json#scripts.test` first and use the project-local
|
|
9
9
|
* runner — never `npx <runner>` — so it cannot bypass the lockfile or
|
|
10
10
|
* spawn a network-bound tool call.
|
|
@@ -538,7 +538,7 @@ export async function runDoctor(options = {}) {
|
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
// Workspace guard: an active workflow presence (peaks-
|
|
541
|
+
// Workspace guard: an active workflow presence (peaks-code) with no workspace
|
|
542
542
|
// session means the skill was anchored but `peaks workspace init` never ran —
|
|
543
543
|
// the #1 reported failure where .peaks/ artifacts are never created. This
|
|
544
544
|
// turns the SKILL.md "MUST create the workspace" prose into an executable check.
|
|
@@ -554,7 +554,7 @@ export async function runDoctor(options = {}) {
|
|
|
554
554
|
checks.push({
|
|
555
555
|
id: 'skill-presence:workspace',
|
|
556
556
|
ok: false,
|
|
557
|
-
message: `Skill ${presence.skill} is active but no workspace session exists (.peaks/_runtime/session.json missing); run \`peaks workspace init --project <repo>\` — peaks-
|
|
557
|
+
message: `Skill ${presence.skill} is active but no workspace session exists (.peaks/_runtime/session.json missing); run \`peaks workspace init --project <repo>\` — peaks-code Step 0 must anchor the workspace before any work`
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
else {
|
|
@@ -223,8 +223,8 @@ export function generatePromotionStub(opts) {
|
|
|
223
223
|
}
|
|
224
224
|
// layer === 'C'
|
|
225
225
|
return {
|
|
226
|
-
snippet: `// src/services/
|
|
227
|
-
targetFiles: ['src/services/
|
|
226
|
+
snippet: `// src/services/code/mode-gate.ts\n// 1. Add to HardFloorCategory union: '${feedbackName}-rule'\n// 2. Add to HARD_FLOOR_CATEGORIES\n// 3. Wire shouldPauseAtGate to recognise the new category\n// Tests: tests/unit/services/code/<name>-hard-floor.test.ts (≥6 cases per AC-4)`,
|
|
227
|
+
targetFiles: ['src/services/code/mode-gate.ts', `tests/unit/services/code/${feedbackName}-hard-floor.test.ts`]
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* jobId, done, total, currentSlice, lastCommitSha, updatedAt
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
|
-
* The `peaks
|
|
13
|
+
* The `peaks code gate-step-08` hook reads this file in its case-1 path
|
|
14
14
|
* (job-shape.json says isJob=true) and surfaces `Next: slice #N+1 of M
|
|
15
15
|
* (<currentSlice>)` to stdout. The LLM cannot "wake up cold" — the
|
|
16
16
|
* next-slice context is mechanically injected on every Bash call.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* jobId, done, total, currentSlice, lastCommitSha, updatedAt
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
|
-
* The `peaks
|
|
13
|
+
* The `peaks code gate-step-08` hook reads this file in its case-1 path
|
|
14
14
|
* (job-shape.json says isJob=true) and surfaces `Next: slice #N+1 of M
|
|
15
15
|
* (<currentSlice>)` to stdout. The LLM cannot "wake up cold" — the
|
|
16
16
|
* next-slice context is mechanically injected on every Bash call.
|
|
@@ -26,10 +26,37 @@ export function collectResourceSnapshot(jobDir) {
|
|
|
26
26
|
contextRatio,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
// Non-enumerable internal attachment for test-time access via
|
|
30
|
+
// `collectResourceSnapshot.dirSizeMb`. NOT a public export — keeps
|
|
31
|
+
// the prod module surface clean per PRD while still allowing
|
|
32
|
+
// targeted AC-1/AC-2/AC-3 unit tests to drive `dirSizeMb` directly.
|
|
33
|
+
Object.defineProperty(collectResourceSnapshot, 'dirSizeMb', {
|
|
34
|
+
value: dirSizeMb,
|
|
35
|
+
enumerable: false,
|
|
36
|
+
writable: false,
|
|
37
|
+
configurable: false,
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Best-effort, non-recursive size of one directory level, in rounded megabytes.
|
|
41
|
+
*
|
|
42
|
+
* - Missing directory → 0.
|
|
43
|
+
* - Per-entry stat failures (race with deletion, EBUSY on Windows) → silently skipped.
|
|
44
|
+
* - When `opts.maxEntries` > 0 and the directory has more entries than the cap,
|
|
45
|
+
* the returned value is a partial sum (a lower bound), and no further `stat`
|
|
46
|
+
* calls are issued past the cap. Callers must treat the value as a lower bound.
|
|
47
|
+
* - `opts.maxEntries` defaults to 0 (unbounded, legacy behaviour).
|
|
48
|
+
*
|
|
49
|
+
* NOTE: when maxEntries > 0 and the directory contains more entries than the
|
|
50
|
+
* cap, this is a partial sum. Callers must treat the value as a lower bound.
|
|
51
|
+
*/
|
|
52
|
+
function dirSizeMb(dir, opts) {
|
|
53
|
+
const cap = opts?.maxEntries ?? 0;
|
|
30
54
|
let total = 0;
|
|
55
|
+
let index = 0;
|
|
31
56
|
try {
|
|
32
57
|
for (const name of readdirSync(dir)) {
|
|
58
|
+
if (cap > 0 && index >= cap)
|
|
59
|
+
break;
|
|
33
60
|
try {
|
|
34
61
|
total += statSync(join(dir, name)).size;
|
|
35
62
|
}
|
|
@@ -37,6 +64,7 @@ function dirSizeMb(dir) {
|
|
|
37
64
|
// best-effort: missing entries (race with deletion) are silently skipped
|
|
38
65
|
void e;
|
|
39
66
|
}
|
|
67
|
+
index++;
|
|
40
68
|
}
|
|
41
69
|
}
|
|
42
70
|
catch (e) {
|
|
@@ -600,7 +600,7 @@ export function executeProjectMemoryExtract(options) {
|
|
|
600
600
|
const safeMemoryDir = assertSafeProjectMemoryDir(plan.projectRoot);
|
|
601
601
|
// Idempotency: skip writes for memories whose slug already lives in
|
|
602
602
|
// .peaks/memory/. Re-running `peaks memory extract --apply` on the
|
|
603
|
-
// same handoff is a normal peaks-
|
|
603
|
+
// same handoff is a normal peaks-code / peaks-txt retry pattern (the
|
|
604
604
|
// skill prompt may invoke extract more than once when a handoff is
|
|
605
605
|
// edited and re-extracted). Without this, writeNewFile's O_EXCL
|
|
606
606
|
// throws EEXIST and aborts the whole batch. Symmetric with
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MigrateResult } from './schema.js';
|
|
2
|
+
export interface MigrateOpts {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
/** false = dry-run (default); true = write through. */
|
|
7
|
+
apply: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** True iff `absPath` falls under any skip-path (substring match). */
|
|
10
|
+
export declare function shouldSkip(projectRoot: string, absPath: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Recursively walk a directory and return every `.json` / `.md`
|
|
13
|
+
* path. Missing root → empty list (the CLI reports scannedFiles:0,
|
|
14
|
+
* which is the truthful "nothing to look at" signal).
|
|
15
|
+
*/
|
|
16
|
+
export declare function walkRuntimeFiles(root: string): string[];
|
|
17
|
+
export declare function migrateSkillName(opts: MigrateOpts): MigrateResult;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `peaks session migrate-skill-name` core service (slice 2 of the
|
|
3
|
+
* peaks-code → peaks-code rename plan).
|
|
4
|
+
*
|
|
5
|
+
* Walks `.peaks/_runtime/**` and rewrites two patterns:
|
|
6
|
+
* 1. Key-value: `"skill": "<old>"` → `"skill": "<new>"`
|
|
7
|
+
* 2. Slash-trig: `/<old>` → `/<new>`
|
|
8
|
+
*
|
|
9
|
+
* Files under known skip-paths (`.peaks/memory/**`,
|
|
10
|
+
* `.peaks/skills/.system/bees/<old>/manifest.json`) are recorded in
|
|
11
|
+
* `skipped` but never opened. The operation is idempotent: re-running
|
|
12
|
+
* with the same `--from` on a tree already migrated reports 0
|
|
13
|
+
* modifications.
|
|
14
|
+
*
|
|
15
|
+
* Dry-run (`apply: false`) counts what WOULD change without writing;
|
|
16
|
+
* apply (`apply: true`) validates each `.json` payload with
|
|
17
|
+
* `JSON.parse` before writing so a broken mid-edit never lands on
|
|
18
|
+
* disk. Errors are pushed into `result.errors` (never swallowed).
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
|
|
21
|
+
import { join, relative } from 'node:path';
|
|
22
|
+
/**
|
|
23
|
+
* Skip-paths are matched against the path relative to `projectRoot`,
|
|
24
|
+
* forward-slashed (Windows-friendly). Each entry is a SUBSTRING —
|
|
25
|
+
* the brief pins two specific exclusions: the memory dir, and the
|
|
26
|
+
* .system bee manifest for the old skill (which the renamer must
|
|
27
|
+
* leave alone until the bee itself is moved in a later slice).
|
|
28
|
+
*/
|
|
29
|
+
const SKIP_DIRS = ['.peaks/memory', '.peaks/skills/.system/bees'];
|
|
30
|
+
const TARGET_ROOT = '.peaks/_runtime';
|
|
31
|
+
const KEY_VALUE_PATTERN = (from, to) => new RegExp(`"skill"\\s*:\\s*"${escapeRe(from)}"`, 'g');
|
|
32
|
+
const STRING_PATTERN = (from, to) => new RegExp(`/${escapeRe(from)}`, 'g');
|
|
33
|
+
/**
|
|
34
|
+
* Escape regex metachars so an aggressive `--from` value (e.g.
|
|
35
|
+
* `peaks.code`) doesn't blow up the regex compiler. The two regexes
|
|
36
|
+
* above use `from` inside both body and character-class territory,
|
|
37
|
+
* so escaping is the safe path regardless of input.
|
|
38
|
+
*/
|
|
39
|
+
function escapeRe(input) {
|
|
40
|
+
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
41
|
+
}
|
|
42
|
+
/** True iff `absPath` falls under any skip-path (substring match). */
|
|
43
|
+
export function shouldSkip(projectRoot, absPath) {
|
|
44
|
+
const rel = relative(projectRoot, absPath).replace(/\\/g, '/');
|
|
45
|
+
return SKIP_DIRS.some((skip) => rel.includes(skip));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Recursively walk a directory and return every `.json` / `.md`
|
|
49
|
+
* path. Missing root → empty list (the CLI reports scannedFiles:0,
|
|
50
|
+
* which is the truthful "nothing to look at" signal).
|
|
51
|
+
*/
|
|
52
|
+
export function walkRuntimeFiles(root) {
|
|
53
|
+
const out = [];
|
|
54
|
+
if (!existsSync(root))
|
|
55
|
+
return out;
|
|
56
|
+
const visit = (dir) => {
|
|
57
|
+
for (const entry of readdirSync(dir)) {
|
|
58
|
+
const full = join(dir, entry);
|
|
59
|
+
const stat = statSync(full);
|
|
60
|
+
if (stat.isDirectory()) {
|
|
61
|
+
visit(full);
|
|
62
|
+
}
|
|
63
|
+
else if (entry.endsWith('.json') || entry.endsWith('.md')) {
|
|
64
|
+
out.push(full);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
visit(root);
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
export function migrateSkillName(opts) {
|
|
72
|
+
const runtimeRoot = join(opts.projectRoot, TARGET_ROOT);
|
|
73
|
+
const files = walkRuntimeFiles(runtimeRoot);
|
|
74
|
+
const result = {
|
|
75
|
+
ok: true,
|
|
76
|
+
scannedFiles: files.length,
|
|
77
|
+
modifiedFiles: 0,
|
|
78
|
+
keyValueReplacements: 0,
|
|
79
|
+
stringReplacements: 0,
|
|
80
|
+
skipped: [...SKIP_DIRS],
|
|
81
|
+
errors: [],
|
|
82
|
+
};
|
|
83
|
+
for (const file of files) {
|
|
84
|
+
if (shouldSkip(opts.projectRoot, file))
|
|
85
|
+
continue;
|
|
86
|
+
let original;
|
|
87
|
+
try {
|
|
88
|
+
original = readFileSync(file, 'utf-8');
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
// Unreadable file: surface the error and keep going (other
|
|
92
|
+
// files may be fine). `ok` flips to false; reporting stops
|
|
93
|
+
// hiding the failure from the operator.
|
|
94
|
+
result.errors.push(`${file}: read failed: ${e.message}`);
|
|
95
|
+
result.ok = false;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
// Pin the broken-JSON test: any .json runtime file that fails
|
|
99
|
+
// to parse MUST be surfaced as an error, EVEN when it does not
|
|
100
|
+
// contain the from-name (the operator still needs to know the
|
|
101
|
+
// file is unparseable so they can fix it before re-running).
|
|
102
|
+
// Per Karpathy §4 honesty, silent skip is the worst kind of
|
|
103
|
+
// fake-green.
|
|
104
|
+
if (file.endsWith('.json')) {
|
|
105
|
+
try {
|
|
106
|
+
JSON.parse(original);
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
result.errors.push(`${file}: invalid JSON: ${e.message}`);
|
|
110
|
+
result.ok = false;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
let mutated = original;
|
|
115
|
+
const kvPattern = KEY_VALUE_PATTERN(opts.from, opts.to);
|
|
116
|
+
const kvMatches = mutated.match(kvPattern);
|
|
117
|
+
if (kvMatches) {
|
|
118
|
+
mutated = mutated.replace(kvPattern, `"skill": "${opts.to}"`);
|
|
119
|
+
result.keyValueReplacements += kvMatches.length;
|
|
120
|
+
}
|
|
121
|
+
const strPattern = STRING_PATTERN(opts.from, opts.to);
|
|
122
|
+
const strMatches = mutated.match(strPattern);
|
|
123
|
+
if (strMatches) {
|
|
124
|
+
mutated = mutated.replace(strPattern, `/${opts.to}`);
|
|
125
|
+
result.stringReplacements += strMatches.length;
|
|
126
|
+
}
|
|
127
|
+
if (mutated === original)
|
|
128
|
+
continue;
|
|
129
|
+
if (opts.apply) {
|
|
130
|
+
try {
|
|
131
|
+
if (file.endsWith('.json')) {
|
|
132
|
+
// Validate the post-edit JSON before touching the disk —
|
|
133
|
+
// catches accidents (e.g., stray quotes in the renamed
|
|
134
|
+
// from/to values) without leaving a corrupted runtime file
|
|
135
|
+
// behind.
|
|
136
|
+
JSON.parse(mutated);
|
|
137
|
+
}
|
|
138
|
+
writeFileSync(file, mutated, 'utf-8');
|
|
139
|
+
result.modifiedFiles += 1;
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
result.errors.push(`${file}: ${e.message}`);
|
|
143
|
+
result.ok = false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Dry-run path intentionally does not bump `modifiedFiles` —
|
|
147
|
+
// pin: `expect(result.modifiedFiles).toBe(0)` in the dry-run
|
|
148
|
+
// test. The would-be count lives implicitly in the *Replacement
|
|
149
|
+
// counters, which both dry-run and apply share.
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
}
|