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
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* peaks bee * CLI — M7 (spec §7A.2 / §10 RL-9 / AC-24 / AC-25 / AC-26).
|
|
3
|
+
*
|
|
4
|
+
* Adds:
|
|
5
|
+
* peaks bee export --bee <id> --out <path.tar.gz>
|
|
6
|
+
* peaks bee import --in <path.tar.gz> [--as <bee-name>]
|
|
7
|
+
*
|
|
8
|
+
* The bee-side counterparts of the loop-side `peaks loop export /
|
|
9
|
+
* import`. Same hard rules:
|
|
10
|
+
*
|
|
11
|
+
* - source `shareable=false` blocks export at the CLI layer.
|
|
12
|
+
* - bundle lands as `candidate`; promotion to `stable` requires
|
|
13
|
+
* an `evolution_evaluation` row with an independent
|
|
14
|
+
* `evaluator_id` (see `peaks evolution evaluate`).
|
|
15
|
+
*
|
|
16
|
+
* The bee bundle captures the bee's inline manifest/segment/file/change
|
|
17
|
+
* rows so the receiver can re-materialize the full bee + any
|
|
18
|
+
* loop↔bee relations that referenced it + any evidence briefs that
|
|
19
|
+
* touched it.
|
|
20
|
+
*
|
|
21
|
+
* The `peaks skill sediment export / import` alias lives in
|
|
22
|
+
* `src/cli/commands/skill-sediment.ts` for one release cycle.
|
|
23
|
+
*/
|
|
24
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
25
|
+
import { join } from 'node:path';
|
|
26
|
+
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
27
|
+
import { fail, ok } from '../../shared/result.js';
|
|
28
|
+
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
29
|
+
import { openStateDb } from '../../services/skillhub/sqlite-store.js';
|
|
30
|
+
import { writeBundle, BundleNotShareableError, BundleAssetNotFoundError, } from '../../services/share/bundle-writer.js';
|
|
31
|
+
import { readBundle, BundleMajorVersionMismatchError, BundleSchemaVersionsMismatchError, BundleImportToStableForbiddenError, BundleMalformedError, } from '../../services/share/bundle-reader.js';
|
|
32
|
+
export function registerBeeCommands(program, io) {
|
|
33
|
+
// Reuse the existing `bee` parent if one is registered; the
|
|
34
|
+
// add-a-new-subcommand-check-for-existing-top-level-first rule.
|
|
35
|
+
const existing = program.commands.find((c) => c.name() === 'bee');
|
|
36
|
+
const bee = existing ?? program
|
|
37
|
+
.command('bee')
|
|
38
|
+
.description('M7: peaks bee export / import (spec §7A.2 / §10 RL-9)');
|
|
39
|
+
// ---------- peaks bee export ----------
|
|
40
|
+
addJsonOption(bee
|
|
41
|
+
.command('export')
|
|
42
|
+
.description("M7: export a bee_release as a peaks.bundle/1 tarball (spec §7A.2). Refuses to export when shareable=false.")
|
|
43
|
+
.requiredOption('--bee <id>', 'bee_release numeric id (use `peaks asset status --bee <name>` to find the id)')
|
|
44
|
+
.requiredOption('--out <path>', 'output .tar.gz path')
|
|
45
|
+
.option('--project <path>', 'target project root (defaults to cwd)')).action((options) => {
|
|
46
|
+
const asJson = options.json === true;
|
|
47
|
+
const beeId = Number(options.bee);
|
|
48
|
+
if (!Number.isInteger(beeId) || beeId <= 0) {
|
|
49
|
+
printResult(io, fail('bee.export', 'INVALID_BEE_ID', `--bee must be a positive integer (got '${options.bee}')`, { bee: options.bee }, [
|
|
50
|
+
'Re-run with --bee <numeric-id>.',
|
|
51
|
+
]), asJson);
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const projectRoot = options.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
57
|
+
if (!existsSync(join(projectRoot, '.peaks'))) {
|
|
58
|
+
mkdirSync(join(projectRoot, '.peaks'), { recursive: true });
|
|
59
|
+
}
|
|
60
|
+
const db = openStateDb(join(projectRoot, '.peaks', 'state.db'));
|
|
61
|
+
try {
|
|
62
|
+
const result = writeBundle({
|
|
63
|
+
db,
|
|
64
|
+
blobsDir: join(projectRoot, '.peaks', 'blobs'),
|
|
65
|
+
kind: 'bee',
|
|
66
|
+
id: beeId,
|
|
67
|
+
outPath: options.out,
|
|
68
|
+
});
|
|
69
|
+
printResult(io, ok('bee.export', {
|
|
70
|
+
outPath: result.outPath,
|
|
71
|
+
kind: result.kind,
|
|
72
|
+
assetId: result.assetId,
|
|
73
|
+
importedAs: 'candidate',
|
|
74
|
+
}, [], [
|
|
75
|
+
`Receiver must run \`peaks bee import --in ${result.outPath}\` to land this bundle, then run an independent evolution_evaluation before any promote.`,
|
|
76
|
+
]), asJson);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
db.close();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error instanceof BundleNotShareableError) {
|
|
84
|
+
printResult(io, fail('bee.export', error.code, error.message, { bee: options.bee }, [
|
|
85
|
+
'Set shareable=true on the bee_release row, or stop sharing.',
|
|
86
|
+
]), asJson);
|
|
87
|
+
process.exitCode = 1;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (error instanceof BundleAssetNotFoundError) {
|
|
91
|
+
printResult(io, fail('bee.export', error.code, error.message, { bee: options.bee }, [
|
|
92
|
+
'Verify the bee id with `peaks asset status --bee <name>`.',
|
|
93
|
+
]), asJson);
|
|
94
|
+
process.exitCode = 1;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
printResult(io, fail('bee.export', 'BEE_EXPORT_FAILED', getErrorMessage(error), { bee: options.bee }, ['Verify --bee id and --out path.']), asJson);
|
|
98
|
+
process.exitCode = 1;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
// ---------- peaks bee import ----------
|
|
102
|
+
addJsonOption(bee
|
|
103
|
+
.command('import')
|
|
104
|
+
.description('M7: import a peaks.bundle/1 tarball. Lands as candidate only — promotion requires an evolution_evaluation row (spec §7A.2 / AC-25 / AC-26).')
|
|
105
|
+
.requiredOption('--in <path>', 'input .tar.gz path')
|
|
106
|
+
.option('--as <name>', 'optional rename for the bee name when landing')
|
|
107
|
+
.option('--project <path>', 'target project root (defaults to cwd)')).action((options) => {
|
|
108
|
+
const asJson = options.json === true;
|
|
109
|
+
try {
|
|
110
|
+
const projectRoot = options.project ?? findProjectRoot(process.cwd()) ?? process.cwd();
|
|
111
|
+
if (!existsSync(join(projectRoot, '.peaks'))) {
|
|
112
|
+
mkdirSync(join(projectRoot, '.peaks'), { recursive: true });
|
|
113
|
+
}
|
|
114
|
+
const db = openStateDb(join(projectRoot, '.peaks', 'state.db'));
|
|
115
|
+
try {
|
|
116
|
+
const result = readBundle({
|
|
117
|
+
db,
|
|
118
|
+
blobsDir: join(projectRoot, '.peaks', 'blobs'),
|
|
119
|
+
inPath: options.in,
|
|
120
|
+
...(options.as !== undefined ? { asName: options.as } : {}),
|
|
121
|
+
});
|
|
122
|
+
printResult(io, ok('bee.import', {
|
|
123
|
+
assetId: result.assetId,
|
|
124
|
+
kind: result.kind,
|
|
125
|
+
importedAs: result.importedAs,
|
|
126
|
+
warnings: result.warnings,
|
|
127
|
+
evidenceBriefCount: result.evidenceBriefCount,
|
|
128
|
+
}, result.warnings, [
|
|
129
|
+
`Run an independent evaluation against this release before promoting; peaks bee promote refuses without an evolution_evaluation row.`,
|
|
130
|
+
]), asJson);
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
db.close();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (error instanceof BundleMajorVersionMismatchError) {
|
|
138
|
+
printResult(io, fail('bee.import', error.code, error.message, { receivedMajor: error.receivedMajor }, [
|
|
139
|
+
'Use the matching peaks.bundle/<major> reader; this peaks build only supports major=1.',
|
|
140
|
+
]), asJson);
|
|
141
|
+
process.exitCode = 1;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (error instanceof BundleSchemaVersionsMismatchError) {
|
|
145
|
+
printResult(io, fail('bee.import', error.code, error.message, {}, [
|
|
146
|
+
'Source bundle did not declare the canonical schema versions; refuse the bundle.',
|
|
147
|
+
]), asJson);
|
|
148
|
+
process.exitCode = 1;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (error instanceof BundleImportToStableForbiddenError) {
|
|
152
|
+
printResult(io, fail('bee.import', error.code, error.message, {}, [
|
|
153
|
+
'Bundles always land as candidate; promotion to stable requires an evolution_evaluation row (AC-26).',
|
|
154
|
+
]), asJson);
|
|
155
|
+
process.exitCode = 1;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (error instanceof BundleMalformedError) {
|
|
159
|
+
printResult(io, fail('bee.import', error.code, error.message, { inPath: options.in }, [
|
|
160
|
+
'Re-export from the source via `peaks bee export`.',
|
|
161
|
+
]), asJson);
|
|
162
|
+
process.exitCode = 1;
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
printResult(io, fail('bee.import', 'BEE_IMPORT_FAILED', getErrorMessage(error), { inPath: options.in }, ['Verify the bundle path and integrity.']), asJson);
|
|
166
|
+
process.exitCode = 1;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Slice 2 — `peaks
|
|
2
|
+
* Slice 2 — `peaks code [--fast] <change-id>` (peaks-code fast mode).
|
|
3
3
|
*
|
|
4
4
|
* The `peaks-code` SKILL orchestrates an LLM-side workflow:
|
|
5
5
|
* load-memory -> standards-preflight -> rd-cycle -> qa-cycle -> emit-txt
|
|
6
6
|
*
|
|
7
|
-
* The CLI surface here is intentionally narrow: it builds a
|
|
8
|
-
* runs it via `
|
|
7
|
+
* The CLI surface here is intentionally narrow: it builds a CodePlan and
|
|
8
|
+
* runs it via `runCodeFast`. Fast mode skips memory full-load, standards
|
|
9
9
|
* preflight, and the QA repair loop. Round-trip KPI: ≤ 30s.
|
|
10
10
|
*
|
|
11
|
-
* No new service layer — the orchestrator is the in-file `
|
|
11
|
+
* No new service layer — the orchestrator is the in-file `runCodeFast`
|
|
12
12
|
* function. Hooks are injected so tests can mock at the boundary.
|
|
13
13
|
*
|
|
14
14
|
* v2.11.0 Group F (Tier 9) — D5 / D7 additions:
|
|
15
|
-
* - `peaks
|
|
16
|
-
* - `peaks
|
|
15
|
+
* - `peaks code should-pause --step <step> --mode <mode>` (D5)
|
|
16
|
+
* - `peaks code post-compact-detect --project <path>` (D7)
|
|
17
17
|
*/
|
|
18
18
|
import type { Command } from 'commander';
|
|
19
19
|
import { type ProgramIO } from '../cli-helpers.js';
|
|
20
|
-
export type
|
|
21
|
-
export interface
|
|
20
|
+
export type CodeStepKind = 'memory' | 'preflight' | 'rd' | 'qa' | 'emit';
|
|
21
|
+
export interface CodeStep {
|
|
22
22
|
readonly id: 'load-memory' | 'standards-preflight' | 'rd-cycle' | 'qa-cycle' | 'emit-txt';
|
|
23
|
-
readonly kind:
|
|
23
|
+
readonly kind: CodeStepKind;
|
|
24
24
|
readonly skipped: boolean;
|
|
25
25
|
/** QA-only: when true, qa hook retries on failure up to N rounds. */
|
|
26
26
|
readonly repairLoop?: boolean;
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface CodePlan {
|
|
29
29
|
readonly sessionId: string;
|
|
30
|
-
readonly steps: readonly
|
|
30
|
+
readonly steps: readonly CodeStep[];
|
|
31
31
|
}
|
|
32
|
-
export interface
|
|
32
|
+
export interface CodeHooks {
|
|
33
33
|
readonly memory: (ctx: {
|
|
34
34
|
sessionId: string;
|
|
35
35
|
}) => Promise<unknown>;
|
|
@@ -47,34 +47,34 @@ export interface SoloHooks {
|
|
|
47
47
|
sessionId: string;
|
|
48
48
|
}) => Promise<unknown>;
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface CodeRunResult {
|
|
51
51
|
readonly sessionId: string;
|
|
52
52
|
readonly ok: boolean;
|
|
53
|
-
readonly steps: readonly
|
|
53
|
+
readonly steps: readonly CodeStep[];
|
|
54
54
|
readonly skipped: readonly string[];
|
|
55
55
|
readonly elapsedMs: number;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Build a
|
|
58
|
+
* Build a CodePlan. `fast=true` marks memory + preflight as skipped and
|
|
59
59
|
* disables the QA repair loop. Step order is fixed; emit-txt always last.
|
|
60
60
|
*/
|
|
61
|
-
export declare function
|
|
61
|
+
export declare function buildCodePlan(opts: {
|
|
62
62
|
sessionId: string;
|
|
63
63
|
fast: boolean;
|
|
64
|
-
}):
|
|
64
|
+
}): CodePlan;
|
|
65
65
|
/**
|
|
66
|
-
* Run the
|
|
66
|
+
* Run the CodePlan. Skipped steps do NOT invoke their hook; emit-txt is
|
|
67
67
|
* always invoked last. Returns timing + skipped ids for KPI measurement.
|
|
68
68
|
*/
|
|
69
|
-
export declare function
|
|
69
|
+
export declare function runCodeFast(opts: {
|
|
70
70
|
sessionId: string;
|
|
71
|
-
plan:
|
|
72
|
-
hooks:
|
|
73
|
-
}): Promise<
|
|
71
|
+
plan: CodePlan;
|
|
72
|
+
hooks: CodeHooks;
|
|
73
|
+
}): Promise<CodeRunResult>;
|
|
74
74
|
/**
|
|
75
|
-
* Register the `peaks
|
|
75
|
+
* Register the `peaks code [--fast] <change-id>` command. The actual
|
|
76
76
|
* LLM-side orchestration is driven by the SKILL.md (LLM-side), so this
|
|
77
77
|
* CLI command is a thin surface that builds the plan and emits a JSON
|
|
78
78
|
* envelope for downstream tooling.
|
|
79
79
|
*/
|
|
80
|
-
export declare function
|
|
80
|
+
export declare function registerCodeCommands(program: Command, io: ProgramIO): void;
|