peaks-loop 4.0.0-beta → 4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -87
- package/README-en.md +17 -4
- package/README.md +17 -4
- package/dist/src/cli/commands/asset-commands.d.ts +45 -0
- package/dist/src/cli/commands/asset-commands.js +404 -0
- package/dist/src/cli/commands/bee-commands.d.ts +26 -0
- package/dist/src/cli/commands/bee-commands.js +169 -0
- package/dist/src/cli/commands/{solo-commands.d.ts → code-commands.d.ts} +24 -24
- package/dist/src/cli/commands/{solo-commands.js → code-commands.js} +78 -78
- package/dist/src/cli/commands/core/skill-command.js +1 -1
- package/dist/src/cli/commands/dispatch-from-dag.js +1 -1
- package/dist/src/cli/commands/evolution-commands.d.ts +27 -0
- package/dist/src/cli/commands/evolution-commands.js +393 -0
- package/dist/src/cli/commands/hook-handle.js +7 -7
- package/dist/src/cli/commands/job-commands.js +2 -2
- package/dist/src/cli/commands/loop-commands.d.ts +19 -13
- package/dist/src/cli/commands/loop-commands.js +147 -13
- package/dist/src/cli/commands/sediment-commands.js +9 -0
- package/dist/src/cli/commands/session-auto-compact-hook-command.js +2 -2
- package/dist/src/cli/commands/skill-loop-engineering-readiness-commands.d.ts +67 -0
- package/dist/src/cli/commands/skill-loop-engineering-readiness-commands.js +173 -0
- package/dist/src/cli/commands/sub-agent-shared.d.ts +1 -1
- package/dist/src/cli/commands/user-touchpoint-commands.d.ts +4 -4
- package/dist/src/cli/commands/user-touchpoint-commands.js +14 -14
- package/dist/src/cli/commands/workflow-commands.js +22 -22
- package/dist/src/cli/program.js +23 -6
- 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 +5 -5
- package/dist/src/services/audit/types.d.ts +2 -2
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.d.ts +1 -1
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.js +3 -3
- package/dist/src/services/{solo → code}/dag-orchestrator.d.ts +1 -1
- package/dist/src/services/{solo → code}/dag-orchestrator.js +1 -1
- 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 +9 -9
- 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 +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 +2 -2
- 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/crystallization/crystallization-service.d.ts +239 -0
- package/dist/src/services/crystallization/crystallization-service.js +397 -0
- package/dist/src/services/crystallization/crystallization-store.d.ts +75 -0
- package/dist/src/services/crystallization/crystallization-store.js +193 -0
- package/dist/src/services/crystallization/crystallization-types.d.ts +313 -0
- package/dist/src/services/crystallization/crystallization-types.js +299 -0
- package/dist/src/services/crystallization/evidence-brief-builder.d.ts +237 -0
- package/dist/src/services/crystallization/evidence-brief-builder.js +240 -0
- 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/evolution/evolution-service.d.ts +137 -0
- package/dist/src/services/evolution/evolution-service.js +281 -0
- package/dist/src/services/evolution/evolution-store.d.ts +57 -0
- package/dist/src/services/evolution/evolution-store.js +232 -0
- package/dist/src/services/evolution/evolution-types.d.ts +706 -0
- package/dist/src/services/evolution/evolution-types.js +286 -0
- package/dist/src/services/evolution/independent-evaluator-runner.d.ts +90 -0
- package/dist/src/services/evolution/independent-evaluator-runner.js +106 -0
- package/dist/src/services/evolution/regression-skeptic-runner.d.ts +64 -0
- package/dist/src/services/evolution/regression-skeptic-runner.js +113 -0
- 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/loop/loop-bee-relation-service.d.ts +107 -0
- package/dist/src/services/loop/loop-bee-relation-service.js +211 -0
- package/dist/src/services/loop/loop-bee-relation-store.d.ts +53 -0
- package/dist/src/services/loop/loop-bee-relation-store.js +130 -0
- package/dist/src/services/loop/loop-bee-relation-types.d.ts +118 -0
- package/dist/src/services/loop/loop-bee-relation-types.js +114 -0
- package/dist/src/services/loop/loop-release-service.d.ts +46 -0
- package/dist/src/services/loop/loop-release-service.js +66 -0
- package/dist/src/services/loop/loop-release-store.d.ts +55 -0
- package/dist/src/services/loop/loop-release-store.js +134 -0
- package/dist/src/services/loop/loop-release-types.d.ts +250 -0
- package/dist/src/services/loop/loop-release-types.js +162 -0
- 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/rd/standards-diagnostic.d.ts +1 -1
- package/dist/src/services/rd/standards-diagnostic.js +2 -2
- 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/share/bundle-reader.d.ts +100 -0
- package/dist/src/services/share/bundle-reader.js +434 -0
- package/dist/src/services/share/bundle-types.d.ts +392 -0
- package/dist/src/services/share/bundle-types.js +318 -0
- package/dist/src/services/share/bundle-writer.d.ts +97 -0
- package/dist/src/services/share/bundle-writer.js +429 -0
- package/dist/src/services/share/run-state-contract.d.ts +133 -0
- package/dist/src/services/share/run-state-contract.js +138 -0
- package/dist/src/services/signal/cancel-handler.js +3 -3
- package/dist/src/services/skill/resume-detector.js +1 -1
- package/dist/src/services/skillhub/release-import.js +7 -2
- package/dist/src/services/skillhub/release-retain.js +6 -1
- package/dist/src/services/skillhub/sqlite-store.js +17 -1
- package/dist/src/services/skillhub/types.d.ts +10 -0
- package/dist/src/services/skills/skill-presence-service.d.ts +1 -1
- package/dist/src/services/standards/loop-engineering-lint.d.ts +38 -0
- package/dist/src/services/standards/loop-engineering-lint.js +101 -0
- package/dist/src/services/standards/loop-engineering-readiness-lint.d.ts +111 -0
- package/dist/src/services/standards/loop-engineering-readiness-lint.js +248 -0
- package/dist/src/services/upgrade/1x-detector-service.js +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 +6 -6
- package/dist/src/services/workflow/workflow-router-service.js +33 -33
- package/dist/src/services/workspace/claude-settings-template.d.ts +1 -1
- package/dist/src/services/workspace/claude-settings-template.js +5 -5
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/examples/video-demo/README.md +57 -0
- package/examples/video-demo/out/en-closing-960.png +0 -0
- package/examples/video-demo/out/zh-closing-960.png +0 -0
- package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
- package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
- package/output-styles/peaks-skill-swarm.md +3 -3
- package/package.json +6 -2
- package/skills/bee/peaks-qa/SKILL.md +1 -1
- package/skills/bee/peaks-qa/references/artifact-per-request.md +3 -3
- package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +6 -6
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +1 -1
- package/skills/bee/peaks-rd/references/rd-runbook.md +1 -1
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +11 -11
- package/skills/bee/peaks-rd/references/rd-transition-gates.md +1 -1
- package/skills/bee/peaks-sc/SKILL.md +1 -1
- package/skills/bee/peaks-txt/SKILL.md +3 -3
- package/skills/bee/peaks-ui/SKILL.md +8 -8
- package/skills/peaks-code/SKILL.md +34 -21
- package/skills/peaks-code/references/anchoring-and-session-info.md +2 -2
- package/skills/peaks-code/references/artifact-contracts.md +1 -1
- package/skills/peaks-code/references/boundaries.md +3 -3
- package/skills/peaks-code/references/codegraph-orchestration.md +1 -1
- package/skills/peaks-code/references/dag-orchestrator.md +7 -7
- package/skills/peaks-code/references/external-references.md +2 -2
- package/skills/peaks-code/references/fanout-mandatory.md +3 -3
- package/skills/peaks-code/references/fast-mode.md +2 -2
- package/skills/peaks-code/references/frontend-only-mode.md +9 -9
- package/skills/peaks-code/references/job-loop.md +1 -1
- package/skills/peaks-code/references/local-artifact-workspace.md +2 -2
- package/skills/peaks-code/references/micro-cycle.md +14 -14
- package/skills/peaks-code/references/mode-selection-with-stale-presence.md +5 -5
- package/skills/peaks-code/references/mode-selection.md +3 -3
- package/skills/peaks-code/references/openspec-workflow.md +16 -16
- package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
- package/skills/peaks-code/references/quality-gate-cheatsheet.md +1 -1
- package/skills/peaks-code/references/refactor-mode.md +1 -1
- package/skills/peaks-code/references/runbook.md +15 -15
- package/skills/peaks-code/references/step-0-55-1x-detection.md +1 -1
- package/skills/peaks-code/references/step-0-8-gate.md +11 -11
- package/skills/peaks-code/references/sub-agent-dispatch.md +8 -8
- package/skills/peaks-code/references/swarm-dispatch-contract.md +17 -17
- package/skills/peaks-code/references/workflow-gates-and-types.md +2 -2
- package/skills/peaks-code/references/workflow.md +5 -5
- package/skills/peaks-content/SKILL.md +272 -0
- package/skills/peaks-issue-fix-orchestrator/SKILL.md +307 -0
- package/skills/peaks-resume/SKILL.md +2 -2
- package/skills/peaks-status/SKILL.md +2 -2
- package/skills/peaks-test/SKILL.md +2 -2
- /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.d.ts +0 -0
- /package/dist/src/services/{solo → code}/status-line-renderer.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRdSwarmPlan } from '../../services/rd/rd-service.js';
|
|
2
2
|
import { createTechPlan, getTechStatus } from '../../services/tech/tech-service.js';
|
|
3
|
-
import { createWorkflowRouterPlan,
|
|
3
|
+
import { createWorkflowRouterPlan, isCodeMode, isWorkflowMode } from '../../services/workflow/workflow-router-service.js';
|
|
4
4
|
import { createAutonomousWorkflowPlan } from '../../services/workflow/workflow-autonomous-service.js';
|
|
5
5
|
import { writeAutonomousResumeArtifacts } from '../../services/workflow/autonomous-resume-writer.js';
|
|
6
6
|
import { createRecommendationPlan } from '../../services/recommendations/recommendation-service.js';
|
|
@@ -87,21 +87,21 @@ function validatePlanningInput(goal) {
|
|
|
87
87
|
throw new Error('Goal must be non-empty');
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
if (mode !== '
|
|
92
|
-
printResult(io, fail(command, '
|
|
90
|
+
function parseCodeMode(io, command, mode, codeMode, asJson) {
|
|
91
|
+
if (mode !== 'code' && codeMode) {
|
|
92
|
+
printResult(io, fail(command, 'CODE_MODE_REQUIRES_CODE_WORKFLOW', '--code-mode can only be used with --mode code', {}, ['Remove --code-mode or use --mode code']), asJson);
|
|
93
93
|
process.exitCode = 1;
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
|
-
if (mode !== '
|
|
96
|
+
if (mode !== 'code' || !codeMode) {
|
|
97
97
|
return undefined;
|
|
98
98
|
}
|
|
99
|
-
if (!
|
|
100
|
-
printResult(io, fail(command, '
|
|
99
|
+
if (!isCodeMode(codeMode)) {
|
|
100
|
+
printResult(io, fail(command, 'UNSUPPORTED_CODE_MODE', `Unsupported code mode ${codeMode}`, {}, ['Use --code-mode full-auto, guided, or rnd']), asJson);
|
|
101
101
|
process.exitCode = 1;
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
|
-
return
|
|
104
|
+
return codeMode;
|
|
105
105
|
}
|
|
106
106
|
function runTechPlan(io, options) {
|
|
107
107
|
if (options.dryRun === false) {
|
|
@@ -145,15 +145,15 @@ function runWorkflowRoute(io, options) {
|
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (!isWorkflowMode(options.mode)) {
|
|
148
|
-
printResult(io, fail('workflow.route', 'UNSUPPORTED_WORKFLOW_MODE', `Unsupported workflow mode ${options.mode}`, {}, ['Use --mode
|
|
148
|
+
printResult(io, fail('workflow.route', 'UNSUPPORTED_WORKFLOW_MODE', `Unsupported workflow mode ${options.mode}`, {}, ['Use --mode code or --mode team']), options.json);
|
|
149
149
|
process.exitCode = 1;
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
const maxWorkers = parseMaxWorkers(io, 'workflow.route', options.maxWorkers, options.json);
|
|
153
153
|
if (maxWorkers === null)
|
|
154
154
|
return;
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
155
|
+
const codeMode = parseCodeMode(io, 'workflow.route', options.mode, options.codeMode, options.json);
|
|
156
|
+
if (codeMode === null)
|
|
157
157
|
return;
|
|
158
158
|
try {
|
|
159
159
|
validatePlanningInput(options.goal);
|
|
@@ -162,7 +162,7 @@ function runWorkflowRoute(io, options) {
|
|
|
162
162
|
sessionId: '',
|
|
163
163
|
goal: options.goal,
|
|
164
164
|
mode: options.mode,
|
|
165
|
-
...(
|
|
165
|
+
...(codeMode ? { codeMode } : {}),
|
|
166
166
|
maxWorkers,
|
|
167
167
|
dryRun: true,
|
|
168
168
|
config: readConfig(),
|
|
@@ -181,15 +181,15 @@ function runAutonomousWorkflow(io, options) {
|
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
if (!isWorkflowMode(options.mode)) {
|
|
184
|
-
printResult(io, fail('workflow.autonomous', 'UNSUPPORTED_WORKFLOW_MODE', `Unsupported workflow mode ${options.mode}`, {}, ['Use --mode
|
|
184
|
+
printResult(io, fail('workflow.autonomous', 'UNSUPPORTED_WORKFLOW_MODE', `Unsupported workflow mode ${options.mode}`, {}, ['Use --mode code or --mode team']), options.json);
|
|
185
185
|
process.exitCode = 1;
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
188
|
const maxWorkers = parseMaxWorkers(io, 'workflow.autonomous', options.maxWorkers, options.json);
|
|
189
189
|
if (maxWorkers === null)
|
|
190
190
|
return;
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
191
|
+
const codeMode = parseCodeMode(io, 'workflow.autonomous', options.mode, options.codeMode, options.json);
|
|
192
|
+
if (codeMode === null)
|
|
193
193
|
return;
|
|
194
194
|
try {
|
|
195
195
|
validatePlanningInput(options.goal);
|
|
@@ -198,7 +198,7 @@ function runAutonomousWorkflow(io, options) {
|
|
|
198
198
|
sessionId: '',
|
|
199
199
|
goal: options.goal,
|
|
200
200
|
mode: options.mode,
|
|
201
|
-
...(
|
|
201
|
+
...(codeMode ? { codeMode } : {}),
|
|
202
202
|
maxWorkers,
|
|
203
203
|
dryRun: true,
|
|
204
204
|
config: readConfig(),
|
|
@@ -300,9 +300,9 @@ function addTechStatusOptions(command) {
|
|
|
300
300
|
function addWorkflowRouteOptions(command, description) {
|
|
301
301
|
return addJsonOption(command
|
|
302
302
|
.description(description)
|
|
303
|
-
.requiredOption('--mode <mode>', 'workflow mode:
|
|
303
|
+
.requiredOption('--mode <mode>', 'workflow mode: code or team')
|
|
304
304
|
.requiredOption('--goal <goal>', 'planning goal')
|
|
305
|
-
.option('--
|
|
305
|
+
.option('--code-mode <mode>', 'code mode: full-auto, guided, or rnd')
|
|
306
306
|
.option('--max-workers <count>', 'maximum worker count', '40')
|
|
307
307
|
.option('--dry-run', 'preview without writing files', true)
|
|
308
308
|
.option('--no-dry-run', 'unsupported: do not execute workflow planning from this CLI'));
|
|
@@ -330,7 +330,7 @@ function addAutonomousResumeInitOptions(command) {
|
|
|
330
330
|
export function registerWorkflowCommands(program, io) {
|
|
331
331
|
const refactor = program.command('refactor').description('Plan a Peaks refactor run without modifying code');
|
|
332
332
|
addJsonOption(refactor
|
|
333
|
-
.option('--
|
|
333
|
+
.option('--code', 'use peaks-code orchestration mode')
|
|
334
334
|
.option('--rd', 'use peaks-rd direct mode')
|
|
335
335
|
.option('--dry-run', 'print gates and required artifacts', true)
|
|
336
336
|
.option('--no-dry-run', 'unsupported: do not modify code from this command')).action((options) => {
|
|
@@ -338,12 +338,12 @@ export function registerWorkflowCommands(program, io) {
|
|
|
338
338
|
failUnsupportedNonDryRun(io, 'refactor', options.json);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
if (options.
|
|
342
|
-
printResult(io, fail('refactor', 'CONFLICTING_REFACTOR_MODE', 'Choose either --
|
|
341
|
+
if (options.code && options.rd) {
|
|
342
|
+
printResult(io, fail('refactor', 'CONFLICTING_REFACTOR_MODE', 'Choose either --code or --rd, not both', {}, ['Run peaks refactor --code --dry-run']), options.json);
|
|
343
343
|
process.exitCode = 1;
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
|
-
const mode = options.rd ? 'rd' : '
|
|
346
|
+
const mode = options.rd ? 'rd' : 'code';
|
|
347
347
|
printResult(io, ok('refactor', createRefactorDryRun(mode), [], ['This dry run never edits code']), options.json);
|
|
348
348
|
});
|
|
349
349
|
const tech = program.command('tech').description('Plan and inspect technical dry-run gates');
|
package/dist/src/cli/program.js
CHANGED
|
@@ -52,8 +52,12 @@ import { registerClassifyCommands } from './commands/classify-classify-commands.
|
|
|
52
52
|
import { registerContextCommands } from './commands/context-commands.js';
|
|
53
53
|
import { registerContractCommands } from './commands/contract-commands.js';
|
|
54
54
|
import { registerSkillConformanceCommands } from './commands/skill-conformance-commands.js';
|
|
55
|
+
import { registerSkillLoopEngineeringReadinessCommands } from './commands/skill-loop-engineering-readiness-commands.js';
|
|
55
56
|
import { registerLoopCommands } from './commands/loop-commands.js';
|
|
56
57
|
import { registerWorkflowEvalCommands } from './commands/loop-eval-commands.js';
|
|
58
|
+
import { registerEvolutionCommands } from './commands/evolution-commands.js';
|
|
59
|
+
import { registerAssetCommands } from './commands/asset-commands.js';
|
|
60
|
+
import { registerBeeCommands } from './commands/bee-commands.js';
|
|
57
61
|
import { registerAgentCommands } from './commands/agent-commands.js';
|
|
58
62
|
import { registerUpgradeCommands } from './commands/upgrade-commands.js';
|
|
59
63
|
import { registerCodeReviewCommands } from './commands/code-review-commands.js';
|
|
@@ -64,7 +68,7 @@ import { registerLogCommands } from './commands/log-commands.js';
|
|
|
64
68
|
import { registerQaCommands } from './commands/qa-commands.js';
|
|
65
69
|
import { registerTestCommands } from './commands/test-commands.js';
|
|
66
70
|
import { registerPlaywrightCommands } from './commands/playwright-commands.js';
|
|
67
|
-
import {
|
|
71
|
+
import { registerCodeCommands } from './commands/code-commands.js';
|
|
68
72
|
import { registerMutCommands } from './commands/mut-commands.js';
|
|
69
73
|
import { registerFixtureCommands } from './commands/fixture-commands.js';
|
|
70
74
|
import { registerReviewerCommands } from './commands/reviewer-commands.js';
|
|
@@ -289,16 +293,29 @@ Run peaks (no arguments) for a quickstart. You likely want one of:
|
|
|
289
293
|
registerContextCommands(program, io);
|
|
290
294
|
// Slice #12: peaks skills:audit-conformance — skill family alignment pass.
|
|
291
295
|
registerSkillConformanceCommands(program, io);
|
|
296
|
+
// M6 (2026-07-07 spec §7.5 / §8.4): peaks skill lint --category
|
|
297
|
+
// loop-engineering-readiness — readiness gate for any new peaks-*
|
|
298
|
+
// skill that participates in Loop Engineering.
|
|
299
|
+
registerSkillLoopEngineeringReadinessCommands(program, io);
|
|
292
300
|
// Slice #13: peaks swarm * — additional subcommands (pipeline /
|
|
293
301
|
// dispatch / verify / loop) are added inline in workflow-commands.ts
|
|
294
302
|
// alongside the existing swarm.plan. This avoids the duplicate top-level
|
|
295
303
|
// command conflict (peaks-loop-when-adding-a-new-subcommand-check-for-existing-top-level-first).
|
|
296
304
|
// Slice #14: peaks loop * + peaks goal compose — L4 Agent Loop sub-features.
|
|
297
305
|
registerLoopCommands(program, io);
|
|
298
|
-
// Slice v3.0.0 loop-eng-native-
|
|
306
|
+
// Slice v3.0.0 loop-eng-native-code-a-b: peaks workflow run|plan|lint
|
|
299
307
|
// + peaks loop eval. Wraps the existing workflow + loop groups so the
|
|
300
308
|
// add-a-new-subcommand-check-for-existing-top-level-first rule is honoured.
|
|
301
309
|
registerWorkflowEvalCommands(program, io);
|
|
310
|
+
// M4 (2026-07-07 spec): `peaks evolution propose|evaluate|revert|status|mark-keep`
|
|
311
|
+
// — Darwin-style ratchet CLI surface.
|
|
312
|
+
registerEvolutionCommands(program, io);
|
|
313
|
+
// M5 (2026-07-07 spec): `peaks asset crystallize|dispose|status` —
|
|
314
|
+
// umbrella cross-asset crystallization surface.
|
|
315
|
+
registerAssetCommands(program, io);
|
|
316
|
+
// M7 (2026-07-07 spec §7A.2 / §10 RL-9): `peaks bee export|import`
|
|
317
|
+
// — cross-user share surface for bee_release rows.
|
|
318
|
+
registerBeeCommands(program, io);
|
|
302
319
|
// Slice: ECC 64 agents soft-optional (per spec §7.2 line 818).
|
|
303
320
|
registerAgentCommands(program, io);
|
|
304
321
|
// Slice: 1.x → 2.0 umbrella (per "one-key completion" + "minimal-user-operation" tenets).
|
|
@@ -321,10 +338,10 @@ Run peaks (no arguments) for a quickstart. You likely want one of:
|
|
|
321
338
|
// Slice 2026-06-17-2.5.0-sub-fix-C: `peaks playwright start|ls|stop`
|
|
322
339
|
// (multi-terminal Playwright MCP lifecycle).
|
|
323
340
|
registerPlaywrightCommands(program, io);
|
|
324
|
-
// Slice 2 (peaks-code fast mode): `peaks
|
|
325
|
-
// v2.11.0 Group F (D5 + D7): also registers `peaks
|
|
326
|
-
// `peaks
|
|
327
|
-
|
|
341
|
+
// Slice 2 (peaks-code fast mode): `peaks code plan [--fast] <change-id>`
|
|
342
|
+
// v2.11.0 Group F (D5 + D7): also registers `peaks code should-pause` and
|
|
343
|
+
// `peaks code post-compact-detect` for runtime-friction probes.
|
|
344
|
+
registerCodeCommands(program, io);
|
|
328
345
|
// Plan 2 / Task 6: `peaks mut run|mutants|asserts|report` — mutation
|
|
329
346
|
// testing + assertion validity scan (spec §4.2 / §7). The
|
|
330
347
|
// production Stryker invoker is wired here; tests use the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { showRequestArtifact } from './request-artifact-service.js';
|
|
2
2
|
const DEFAULT_MAX_CYCLES = 3;
|
|
3
|
-
// Matches transition notes
|
|
3
|
+
// Matches transition notes Code writes during repair routing.
|
|
4
4
|
// Format example:
|
|
5
5
|
// - transition note (2026-05-25T08:00:00.000Z): QA return-to-rd cycle 1: failing acceptance items A, B
|
|
6
6
|
// - transition note (2026-05-25T09:00:00.000Z): QA cycle 2: regression in module X
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* active-skill-resolver — utility for hook enforcers.
|
|
3
3
|
*
|
|
4
4
|
* Resolves the active peak skill name for the current session, so hook
|
|
5
|
-
* enforcers (e.g.
|
|
5
|
+
* enforcers (e.g. code-ban) can decide whether to fire.
|
|
6
6
|
*
|
|
7
7
|
* Per `src/services/session/caller-id-types.ts`: the active-skill file is
|
|
8
8
|
* at `.peaks/_runtime/<peakSessionId>/active-skill-<callerId>.json`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* active-skill-resolver — utility for hook enforcers.
|
|
3
3
|
*
|
|
4
4
|
* Resolves the active peak skill name for the current session, so hook
|
|
5
|
-
* enforcers (e.g.
|
|
5
|
+
* enforcers (e.g. code-ban) can decide whether to fire.
|
|
6
6
|
*
|
|
7
7
|
* Per `src/services/session/caller-id-types.ts`: the active-skill file is
|
|
8
8
|
* at `.peaks/_runtime/<peakSessionId>/active-skill-<callerId>.json`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Code-commit-ban enforcer — PreToolUse Bash guard.
|
|
3
3
|
*
|
|
4
4
|
* Per L2 redesign §5.4. Deny `git commit` or `git apply` invocations from
|
|
5
|
-
* a peaks-* skill. The
|
|
5
|
+
* a peaks-* skill. The Code Commit Ban Red Line says peaks-code / peaks-rd
|
|
6
6
|
* are orchestrators, not implementers; the actual `git commit` step must
|
|
7
7
|
* go through `peaks request transition`, which itself enforces spec-locked
|
|
8
8
|
* + tech-doc-presence.
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
* manifest read fails, the hook must fail-OPEN (warn + allow). The LLM is
|
|
12
12
|
* never bricked by a peaks bug.
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface CodeBanInput {
|
|
15
15
|
readonly skill: string;
|
|
16
16
|
readonly command: string;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface CodeBanResult {
|
|
19
19
|
readonly denied: boolean;
|
|
20
20
|
readonly reason: string;
|
|
21
21
|
}
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function
|
|
22
|
+
export declare function isCodeCommit(skill: string, command: string): boolean;
|
|
23
|
+
export declare function evaluateCodeBan(input: CodeBanInput): CodeBanResult;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Code-commit-ban enforcer — PreToolUse Bash guard.
|
|
3
3
|
*
|
|
4
4
|
* Per L2 redesign §5.4. Deny `git commit` or `git apply` invocations from
|
|
5
|
-
* a peaks-* skill. The
|
|
5
|
+
* a peaks-* skill. The Code Commit Ban Red Line says peaks-code / peaks-rd
|
|
6
6
|
* are orchestrators, not implementers; the actual `git commit` step must
|
|
7
7
|
* go through `peaks request transition`, which itself enforces spec-locked
|
|
8
8
|
* + tech-doc-presence.
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
* never bricked by a peaks bug.
|
|
13
13
|
*/
|
|
14
14
|
const COMMIT_APPLY_PATTERN = /^\s*git\s+(commit|apply)\b/;
|
|
15
|
-
const DENY_REASON = '
|
|
15
|
+
const DENY_REASON = 'Code Commit Ban Red Line: peaks-* skills must go through peaks-code / peaks-rd. ' +
|
|
16
16
|
'Use `peaks request transition` instead of `git commit` / `git apply` directly.';
|
|
17
|
-
export function
|
|
17
|
+
export function isCodeCommit(skill, command) {
|
|
18
18
|
if (!skill.startsWith('peaks-'))
|
|
19
19
|
return false;
|
|
20
20
|
return COMMIT_APPLY_PATTERN.test(command);
|
|
21
21
|
}
|
|
22
|
-
export function
|
|
23
|
-
if (
|
|
22
|
+
export function evaluateCodeBan(input) {
|
|
23
|
+
if (isCodeCommit(input.skill, input.command)) {
|
|
24
24
|
return { denied: true, reason: DENY_REASON };
|
|
25
25
|
}
|
|
26
26
|
return { denied: false, reason: '' };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { RedLineMarker } from './types.js';
|
|
9
9
|
export interface RedLineCatalogEntry {
|
|
10
|
-
/** Stable id, e.g. "rl-
|
|
10
|
+
/** Stable id, e.g. "rl-code-ban-001". */
|
|
11
11
|
readonly id: string;
|
|
12
12
|
readonly rule: string;
|
|
13
13
|
/** Markers that, if found near the rule's text, identify this red line. */
|
|
@@ -26,7 +26,7 @@ export declare const RED_LINE_CATALOG: readonly RedLineCatalogEntry[];
|
|
|
26
26
|
* the integration seam is missing. When the integration lands, the entry
|
|
27
27
|
* is removed from this set in a single-line follow-up commit.
|
|
28
28
|
*
|
|
29
|
-
* L2.1 final state: Tasks 5 (
|
|
29
|
+
* L2.1 final state: Tasks 5 (code-ban) + 6 (no-root-pollution) are
|
|
30
30
|
* wired into peaks hook handle (Tasks 1-4: framework + 3 enforcers also
|
|
31
31
|
* integrated). Tasks 3 (tech-doc-presence) and 4 (mock-placement) are
|
|
32
32
|
* deferred — their request-transition / slice-check integrations are
|
|
@@ -9,15 +9,15 @@ import { RED_LINE_CATALOG_P2_A } from './red-line-catalog-p2-a.js';
|
|
|
9
9
|
import { RED_LINE_CATALOG_P2_B } from './red-line-catalog-p2-b.js';
|
|
10
10
|
export const RED_LINE_CATALOG = [
|
|
11
11
|
{
|
|
12
|
-
id: 'rl-
|
|
13
|
-
rule: '
|
|
12
|
+
id: 'rl-code-ban-001',
|
|
13
|
+
rule: 'Code Commit Ban',
|
|
14
14
|
markers: ['BLOCKING', 'MANDATORY'],
|
|
15
15
|
phrases: [
|
|
16
16
|
'peaks-code',
|
|
17
17
|
'orchestrator, NOT an implementer',
|
|
18
|
-
'
|
|
18
|
+
'code',
|
|
19
19
|
],
|
|
20
|
-
enforcerRef: 'src/services/audit/enforcers/
|
|
20
|
+
enforcerRef: 'src/services/audit/enforcers/code-ban.ts',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
id: 'rl-no-root-pollution-001',
|
|
@@ -146,7 +146,7 @@ export const RED_LINE_CATALOG = [
|
|
|
146
146
|
* the integration seam is missing. When the integration lands, the entry
|
|
147
147
|
* is removed from this set in a single-line follow-up commit.
|
|
148
148
|
*
|
|
149
|
-
* L2.1 final state: Tasks 5 (
|
|
149
|
+
* L2.1 final state: Tasks 5 (code-ban) + 6 (no-root-pollution) are
|
|
150
150
|
* wired into peaks hook handle (Tasks 1-4: framework + 3 enforcers also
|
|
151
151
|
* integrated). Tasks 3 (tech-doc-presence) and 4 (mock-placement) are
|
|
152
152
|
* deferred — their request-transition / slice-check integrations are
|
|
@@ -21,9 +21,9 @@ export interface RedLineSource {
|
|
|
21
21
|
readonly context: string;
|
|
22
22
|
}
|
|
23
23
|
export interface RedLineEntry {
|
|
24
|
-
/** Stable id, e.g. "rl-
|
|
24
|
+
/** Stable id, e.g. "rl-code-ban-001". */
|
|
25
25
|
readonly id: string;
|
|
26
|
-
/** Human-readable rule name, e.g. "
|
|
26
|
+
/** Human-readable rule name, e.g. "Code Commit Ban". */
|
|
27
27
|
readonly rule: string;
|
|
28
28
|
readonly source: RedLineSource;
|
|
29
29
|
readonly backing: RedLineBacking;
|
|
@@ -20,7 +20,7 @@ export interface AutoCompactInput {
|
|
|
20
20
|
/** Injectable clock for mtime checks (test seam). */
|
|
21
21
|
readonly now?: Date | undefined;
|
|
22
22
|
/**
|
|
23
|
-
* Slice 2026-06-28-
|
|
23
|
+
* Slice 2026-06-28-code-mode-bypass-fix (defect #4): which session
|
|
24
24
|
* the compact should target. Default `'main'` — the orchestrator
|
|
25
25
|
* (peaks-code body) runs in the main-session Claude Code window and
|
|
26
26
|
* wants to compress *its* context. Sub-agent shells pass
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* 3. If 0.85 ≤ ratio < 0.95 (pre-compact zone): peaks-loop prepares
|
|
17
17
|
* the convergence toolkit (checkpoint + auto-decisions log +
|
|
18
18
|
* IDE-dispatch handle) and surfaces it to the LLM. The LLM
|
|
19
|
-
* DECIDES when to fire `peaks
|
|
19
|
+
* DECIDES when to fire `peaks code auto-compact --execute`;
|
|
20
20
|
* peaks-loop does NOT auto-fire. The toolkit is ready so the
|
|
21
21
|
* LLM doesn't lose context to a last-second `/compact` panic.
|
|
22
22
|
* 4. If ratio < 0.85: skip — return a one-line info row.
|
|
@@ -64,7 +64,7 @@ export function evaluateCompactTrigger(ratio) {
|
|
|
64
64
|
kind: 'pre-compact',
|
|
65
65
|
ratio,
|
|
66
66
|
toolkitReady: true,
|
|
67
|
-
message: `Context at ${(ratio * 100).toFixed(1)}% in pre-compact zone (0.85–0.95). Convergence toolkit is ready; LLM decides when to fire \`peaks
|
|
67
|
+
message: `Context at ${(ratio * 100).toFixed(1)}% in pre-compact zone (0.85–0.95). Convergence toolkit is ready; LLM decides when to fire \`peaks code auto-compact --execute\`.`
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
@@ -146,7 +146,7 @@ function appendAutoDecisionLog(input) {
|
|
|
146
146
|
writeFileSync(logPath, `${existing}${row}`, 'utf8');
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Slice 2026-06-28-
|
|
149
|
+
* Slice 2026-06-28-code-mode-bypass-fix (defect #4): write the
|
|
150
150
|
* main-session compact intent so the main-session LLM picks it up on
|
|
151
151
|
* its next turn and fires `/compact` in-band. Without this file the
|
|
152
152
|
* orchestrator's "main-session compact" request is invisible to the
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* orchestrator writes its public contract to disk via `writeContract`,
|
|
21
21
|
* and the next dispatch's prompt is built with `formatContractInjection`.
|
|
22
22
|
*
|
|
23
|
-
* Why this lives in `services/
|
|
23
|
+
* Why this lives in `services/code/`:
|
|
24
24
|
* `peaks-code` is the natural caller. The CLI surface (`peaks sub-agent
|
|
25
25
|
* dispatch --from-dag`) consumes the planner's output but the planner
|
|
26
26
|
* itself is a library.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* orchestrator writes its public contract to disk via `writeContract`,
|
|
21
21
|
* and the next dispatch's prompt is built with `formatContractInjection`.
|
|
22
22
|
*
|
|
23
|
-
* Why this lives in `services/
|
|
23
|
+
* Why this lives in `services/code/`:
|
|
24
24
|
* `peaks-code` is the natural caller. The CLI surface (`peaks sub-agent
|
|
25
25
|
* dispatch --from-dag`) consumes the planner's output but the planner
|
|
26
26
|
* itself is a library.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* --force-under-job → ALLOW (override path)
|
|
17
17
|
*
|
|
18
18
|
* Karpathy §2 (Simplicity First): ~70 lines, no LLM call, no regex.
|
|
19
|
-
* Pure read + arithmetic. The CLI wrapper in
|
|
19
|
+
* Pure read + arithmetic. The CLI wrapper in code-commands.ts
|
|
20
20
|
* translates the verdict into exit code + JSON envelope.
|
|
21
21
|
*/
|
|
22
22
|
export declare const JOB_NOT_INITIALIZED: "JOB_NOT_INITIALIZED";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* --force-under-job → ALLOW (override path)
|
|
17
17
|
*
|
|
18
18
|
* Karpathy §2 (Simplicity First): ~70 lines, no LLM call, no regex.
|
|
19
|
-
* Pure read + arithmetic. The CLI wrapper in
|
|
19
|
+
* Pure read + arithmetic. The CLI wrapper in code-commands.ts
|
|
20
20
|
* translates the verdict into exit code + JSON envelope.
|
|
21
21
|
*/
|
|
22
22
|
import { existsSync, readFileSync } from 'node:fs';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The CLI is a *recorder and gate*, not a judge. The LLM makes the
|
|
5
5
|
* semantic call ("is this a Job?") and writes the verdict via
|
|
6
|
-
* `peaks
|
|
6
|
+
* `peaks code detect-job`; this service persists the verdict to
|
|
7
7
|
* `.peaks/_runtime/<sessionId>/job-shape.json` and refuses downstream
|
|
8
8
|
* steps that need a decision when the file is missing.
|
|
9
9
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The CLI is a *recorder and gate*, not a judge. The LLM makes the
|
|
5
5
|
* semantic call ("is this a Job?") and writes the verdict via
|
|
6
|
-
* `peaks
|
|
6
|
+
* `peaks code detect-job`; this service persists the verdict to
|
|
7
7
|
* `.peaks/_runtime/<sessionId>/job-shape.json` and refuses downstream
|
|
8
8
|
* steps that need a decision when the file is missing.
|
|
9
9
|
*
|
|
@@ -73,7 +73,7 @@ export function readJobShapeDecision(projectRoot, sessionId) {
|
|
|
73
73
|
if (!existsSync(path)) {
|
|
74
74
|
throw new JobShapeDecisionError({
|
|
75
75
|
code: JOB_SHAPE_NOT_DECIDED,
|
|
76
|
-
message: `No Job-shape decision recorded for session ${sessionId}. Run \`peaks
|
|
76
|
+
message: `No Job-shape decision recorded for session ${sessionId}. Run \`peaks code detect-job\` to record a decision.`,
|
|
77
77
|
details: { path }
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -84,7 +84,7 @@ export function readJobShapeDecision(projectRoot, sessionId) {
|
|
|
84
84
|
catch (err) {
|
|
85
85
|
throw new JobShapeDecisionError({
|
|
86
86
|
code: JOB_SHAPE_NOT_DECIDED,
|
|
87
|
-
message: `Job-shape decision file is unreadable for session ${sessionId}. Run \`peaks
|
|
87
|
+
message: `Job-shape decision file is unreadable for session ${sessionId}. Run \`peaks code detect-job\` to re-record.`,
|
|
88
88
|
details: { path, cause: err instanceof Error ? err.message : String(err) }
|
|
89
89
|
});
|
|
90
90
|
}
|
|
@@ -95,7 +95,7 @@ export function readJobShapeDecision(projectRoot, sessionId) {
|
|
|
95
95
|
catch (err) {
|
|
96
96
|
throw new JobShapeDecisionError({
|
|
97
97
|
code: JOB_SHAPE_NOT_DECIDED,
|
|
98
|
-
message: `Job-shape decision file is malformed JSON for session ${sessionId}. Run \`peaks
|
|
98
|
+
message: `Job-shape decision file is malformed JSON for session ${sessionId}. Run \`peaks code detect-job --force\` to overwrite.`,
|
|
99
99
|
details: { path, cause: err instanceof Error ? err.message : String(err) }
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -105,7 +105,7 @@ export function readJobShapeDecision(projectRoot, sessionId) {
|
|
|
105
105
|
catch (err) {
|
|
106
106
|
throw new JobShapeDecisionError({
|
|
107
107
|
code: JOB_SHAPE_NOT_DECIDED,
|
|
108
|
-
message: `Job-shape decision file is schema-invalid for session ${sessionId}. Run \`peaks
|
|
108
|
+
message: `Job-shape decision file is schema-invalid for session ${sessionId}. Run \`peaks code detect-job --force\` to overwrite.`,
|
|
109
109
|
details: { path, cause: err instanceof Error ? err.message : String(err) }
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* 4 mode values stay in lockstep with the rest of the runtime.
|
|
21
21
|
*/
|
|
22
22
|
import type { SkillPresenceMode } from '../skills/skill-presence-service.js';
|
|
23
|
-
export type
|
|
24
|
-
export declare const
|
|
23
|
+
export type CodeMode = SkillPresenceMode;
|
|
24
|
+
export declare const CODE_MODES: readonly CodeMode[];
|
|
25
25
|
export type HardFloorCategory = 'irreversible-external-side-effect' | 'authentication-credential' | 'multi-day-investment'
|
|
26
26
|
/**
|
|
27
27
|
* v2.15.0 slice 002 AC-4: actions that are past the user's
|
|
@@ -42,7 +42,7 @@ export declare const HARD_FLOOR_CATEGORIES: readonly HardFloorCategory[];
|
|
|
42
42
|
export type GatedStepId = 'step-0.5-openspec-opt-in' | 'step-0.6-audit-goal' | 'step-0.7-resume-detection' | 'step-0.55-1x-upgrade' | 'step-1-mode-select' | 'step-2.5-session-title' | 'phase-2-prd-confirm' | 'phase-3-swarm-gate-b' | 'phase-6-qa-gate-d' | 'phase-10-txt-memory-extract' | 'step-n+1-final-review' | 'frontend-only-mismatch' | 'step-0.75-checkpoint-resume' | 'standards-preflight';
|
|
43
43
|
export declare const GATED_STEPS: readonly GatedStepId[];
|
|
44
44
|
/**
|
|
45
|
-
* Slice 2026-06-28-
|
|
45
|
+
* Slice 2026-06-28-code-mode-bypass-fix: the kind of gate that
|
|
46
46
|
* produced this decision. The LLM-side caller (peaks-code body) reads
|
|
47
47
|
* this to distinguish "you paused because the user must choose the
|
|
48
48
|
* mode" (`mode-selection-itself`) from "you paused because the mode
|
|
@@ -63,23 +63,23 @@ export declare const GATED_STEPS: readonly GatedStepId[];
|
|
|
63
63
|
export type GateKind = 'mode-selection-itself' | 'mode-driven' | 'hard-floor';
|
|
64
64
|
export interface GateDecision {
|
|
65
65
|
readonly shouldPause: boolean;
|
|
66
|
-
/** Human-readable rationale; surfaces in `peaks
|
|
66
|
+
/** Human-readable rationale; surfaces in `peaks code should-pause --json` */
|
|
67
67
|
readonly reason: string;
|
|
68
68
|
/** Hard-floor override applied? Surfaces in audit log when true */
|
|
69
69
|
readonly hardFloorCategory?: HardFloorCategory;
|
|
70
|
-
/** Slice 2026-06-28-
|
|
70
|
+
/** Slice 2026-06-28-code-mode-bypass-fix: kind of gate that produced
|
|
71
71
|
* this decision. Always present; defaults to `'mode-driven'` for the
|
|
72
72
|
* assisted/strict pause branch. */
|
|
73
73
|
readonly gateKind: GateKind;
|
|
74
74
|
}
|
|
75
|
-
export declare function
|
|
75
|
+
export declare function isCodeMode(value: string): value is CodeMode;
|
|
76
76
|
export declare function isHardFloorCategory(value: string): value is HardFloorCategory;
|
|
77
77
|
/**
|
|
78
78
|
* `true` when the current mode should auto-proceed (skip the
|
|
79
79
|
* AskUserQuestion round-trip). Mirrors D5.a: "recommended = chosen
|
|
80
80
|
* in full-auto / swarm; always log, never silently skip".
|
|
81
81
|
*/
|
|
82
|
-
export declare function shouldAutoProceed(mode:
|
|
82
|
+
export declare function shouldAutoProceed(mode: CodeMode): boolean;
|
|
83
83
|
/**
|
|
84
84
|
* Should the LLM emit an AskUserQuestion at `step` given `mode`?
|
|
85
85
|
* Pure function: no IO, no LLM call. The LLM-side caller passes the
|
|
@@ -107,7 +107,7 @@ export type CommitBoundaryActionId = 'git-push' | 'git-tag' | 'npm-publish' | 'n
|
|
|
107
107
|
export declare const COMMIT_BOUNDARY_ACTIONS: readonly CommitBoundaryActionId[];
|
|
108
108
|
export declare function isCommitBoundaryAction(value: string): value is CommitBoundaryActionId;
|
|
109
109
|
export declare function shouldPauseAtGate(opts: {
|
|
110
|
-
mode:
|
|
110
|
+
mode: CodeMode;
|
|
111
111
|
step: GatedStepId;
|
|
112
112
|
hardFloorCategory?: HardFloorCategory | undefined;
|
|
113
113
|
/**
|
|
@@ -125,7 +125,7 @@ export declare function shouldPauseAtGate(opts: {
|
|
|
125
125
|
* system. The CLI / LLM is responsible for appending.
|
|
126
126
|
*/
|
|
127
127
|
export declare function formatAutoProceedLogLine(opts: {
|
|
128
|
-
mode:
|
|
128
|
+
mode: CodeMode;
|
|
129
129
|
step: GatedStepId;
|
|
130
130
|
recommendedOption: string;
|
|
131
131
|
hardFloorCategory?: HardFloorCategory | undefined;
|
|
@@ -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;
|