peaks-loop 4.0.33 → 4.0.35
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 +38 -0
- package/dist/cli/commands/code-commands.js +2 -0
- package/dist/cli/commands/code-mode-gate-commands.js +3 -3
- package/dist/cli/commands/code-mode-status-command.d.ts +17 -0
- package/dist/cli/commands/code-mode-status-command.js +51 -0
- package/dist/cli/commands/code-run-command.js +8 -1
- package/dist/cli/commands/code-runtime-commands.js +13 -5
- package/dist/cli/commands/core/memory-command.js +61 -3
- package/dist/cli/commands/core/skill-command.js +1 -1
- package/dist/cli/commands/dispatch-commands.js +4 -2
- package/dist/cli/commands/memory-commands.d.ts +35 -0
- package/dist/cli/commands/memory-commands.js +119 -10
- package/dist/cli/commands/request-commands.js +3 -7
- package/dist/cli/commands/session-24h-mode.js +9 -1
- package/dist/services/24h-mode/auto-engage.d.ts +39 -0
- package/dist/services/24h-mode/auto-engage.js +46 -0
- package/dist/services/24h-mode/decider.d.ts +11 -5
- package/dist/services/24h-mode/decider.js +13 -13
- package/dist/services/audit/enforcers/active-skill-resolver.d.ts +3 -1
- package/dist/services/audit/enforcers/active-skill-resolver.js +3 -5
- package/dist/services/code/auto-compact-lifecycle.d.ts +1 -1
- package/dist/services/code/auto-compact-lifecycle.js +1 -1
- package/dist/services/code/auto-compact-modes.d.ts +1 -1
- package/dist/services/code/auto-compact-modes.js +1 -1
- package/dist/services/code/auto-compact-orchestrator.js +18 -22
- package/dist/services/code/mode-gate.d.ts +6 -2
- package/dist/services/code/mode-gate.js +9 -5
- package/dist/services/code/orchestrator-can-do.js +2 -2
- package/dist/services/config/config-service.d.ts +17 -0
- package/dist/services/config/config-service.js +34 -0
- package/dist/services/context/auto-compact-dispatcher.d.ts +2 -2
- package/dist/services/context/auto-compact-dispatcher.js +4 -4
- package/dist/services/context/auto-compact-reader.js +8 -1
- package/dist/services/context/auto-compact-types.d.ts +13 -1
- package/dist/services/context/build-dispatch-system-prompt.js +2 -2
- package/dist/services/context/memory-index-reader.d.ts +26 -0
- package/dist/services/context/memory-index-reader.js +62 -30
- package/dist/services/context/memory-preflight-config.d.ts +33 -0
- package/dist/services/context/memory-preflight-config.js +32 -2
- package/dist/services/context/memory-preflight-service.d.ts +20 -1
- package/dist/services/context/memory-preflight-service.js +198 -31
- package/dist/services/doctor/doctor-service/checks/l3-memory-health.d.ts +19 -2
- package/dist/services/doctor/doctor-service/checks/l3-memory-health.js +143 -19
- package/dist/services/hooks/auto-compact-hook-install.d.ts +2 -2
- package/dist/services/hooks/auto-compact-hook-install.js +2 -2
- package/dist/services/ide/adapters/claude-code-adapter.d.ts +51 -0
- package/dist/services/ide/adapters/claude-code-adapter.js +84 -14
- package/dist/services/ide/ide-types.d.ts +10 -1
- package/dist/services/job/job-types.d.ts +3 -3
- package/dist/services/memory/memory-ingest-service.d.ts +79 -0
- package/dist/services/memory/memory-ingest-service.js +225 -0
- package/dist/services/memory/memory-rotate-service.d.ts +88 -0
- package/dist/services/memory/memory-rotate-service.js +373 -0
- package/dist/services/memory/project-memory-service/index/ranking.d.ts +9 -1
- package/dist/services/memory/project-memory-service/index/ranking.js +25 -13
- package/dist/services/memory/project-memory-service/index/reindex.d.ts +75 -0
- package/dist/services/memory/project-memory-service/index/reindex.js +207 -0
- package/dist/services/memory/project-memory-service/index/search.js +14 -24
- package/dist/services/memory/project-memory-service/index.d.ts +7 -3
- package/dist/services/memory/project-memory-service/index.js +6 -2
- package/dist/services/memory/project-memory-service/parsers/frontmatter.d.ts +75 -3
- package/dist/services/memory/project-memory-service/parsers/frontmatter.js +113 -24
- package/dist/services/memory/project-memory-service/types.d.ts +31 -1
- package/dist/services/memory/project-memory-service/types.js +76 -1
- package/dist/services/mode/mode-enforcement.d.ts +4 -1
- package/dist/services/mode/mode-enforcement.js +26 -28
- package/dist/services/mode/mode-status-service.d.ts +81 -0
- package/dist/services/mode/mode-status-service.js +108 -0
- package/dist/services/preferences/preferences-types.d.ts +14 -0
- package/dist/services/preferences/preferences-types.js +8 -0
- package/dist/services/share/run-state-contract.d.ts +1 -1
- package/dist/services/skills/presence-lease-service.d.ts +21 -0
- package/dist/services/skills/presence-lease-service.js +26 -0
- package/dist/services/skills/skill-presence-service.d.ts +10 -1
- package/dist/services/skills/skill-presence-service.js +32 -4
- package/dist/services/skills/skill-statusline-service.js +6 -3
- package/package.json +5 -5
- package/skills/peaks-code/SKILL.md +10 -10
- package/skills/peaks-code/references/mode-selection.md +7 -3
- package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
- package/skills/peaks-code/references/runbook.md +16 -5
- package/skills/peaks-code/references/session-overload-signal-index.md +2 -2
- package/skills/peaks-code/references/standards-preflight.md +1 -1
- package/skills/peaks-code/references/startup-sequence.md +1 -1
- package/skills/peaks-code/references/step-0-8-gate.md +1 -1
- package/skills/peaks-code/references/step-11-memory-sediment.md +35 -0
- package/skills/peaks-code/references/swarm-dispatch-contract.md +2 -2
- package/skills/peaks-code/references/workflow-gates-and-types.md +1 -1
|
@@ -175,6 +175,32 @@ export function setPresenceLease(input) {
|
|
|
175
175
|
gc,
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Slice 2026-09-09-mode-consolidation (Slice B): stamp `mode` onto every
|
|
180
|
+
* in-flight lease of the bound session, in place.
|
|
181
|
+
*
|
|
182
|
+
* Used by the 24h auto-engage path (T3/T4, `peaks code run --24h`,
|
|
183
|
+
* `peaks session 24h-mode transition --state 24H_ACTIVE`) to record the
|
|
184
|
+
* autonomy level without re-creating the lease (a fresh `setPresenceLease`
|
|
185
|
+
* would reset `startedAt` / `status`). `lastHeartbeat` is intentionally
|
|
186
|
+
* NOT touched — stamping a mode is not a liveness signal.
|
|
187
|
+
*
|
|
188
|
+
* Returns the number of leases updated; 0 when there is nothing in flight.
|
|
189
|
+
* Callers are responsible for the "only `24h` may be auto-set" guard.
|
|
190
|
+
*/
|
|
191
|
+
export function stampPresenceLeaseMode(input) {
|
|
192
|
+
const sessionId = validateSessionId(input.sessionId);
|
|
193
|
+
const leasePaths = [];
|
|
194
|
+
for (const lease of listPresenceLeases(input.projectRoot, sessionId)) {
|
|
195
|
+
if (lease.status !== 'preparing' && lease.status !== 'running')
|
|
196
|
+
continue;
|
|
197
|
+
const path = leaseFilePath(input.projectRoot, sessionId, lease.callerId, lease.workflowId);
|
|
198
|
+
const next = { ...lease, mode: input.mode };
|
|
199
|
+
writeAtomic(path, JSON.stringify(next, null, 2));
|
|
200
|
+
leasePaths.push(path);
|
|
201
|
+
}
|
|
202
|
+
return { updated: leasePaths.length, leasePaths };
|
|
203
|
+
}
|
|
178
204
|
export function readPresenceLease(input) {
|
|
179
205
|
const sessionId = validateSessionId(input.sessionId ?? null);
|
|
180
206
|
const callerId = validateCallerId(input.callerId);
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
export type SkillPresenceMode = 'full-auto' | 'assisted' | '
|
|
1
|
+
export type SkillPresenceMode = 'full-auto' | 'assisted' | 'strict' | '24h';
|
|
2
2
|
export declare const VALID_SKILL_PRESENCE_MODES: ReadonlyArray<SkillPresenceMode>;
|
|
3
|
+
export declare const LEGACY_SKILL_PRESENCE_MODE_ALIASES: Readonly<Record<string, SkillPresenceMode>>;
|
|
3
4
|
export declare function isSkillPresenceMode(value: string): value is SkillPresenceMode;
|
|
5
|
+
/**
|
|
6
|
+
* Normalize a raw on-disk / CLI mode token to a current
|
|
7
|
+
* `SkillPresenceMode`. Current values pass through; the legacy
|
|
8
|
+
* `'swarm'` alias maps to `'full-auto'`; anything else returns
|
|
9
|
+
* `undefined` so the caller can decide (drop the field, not the
|
|
10
|
+
* presence). Never throws.
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeSkillPresenceMode(value: string | undefined | null): SkillPresenceMode | undefined;
|
|
4
13
|
export type SkillPresence = {
|
|
5
14
|
skill: string;
|
|
6
15
|
mode?: SkillPresenceMode;
|
|
@@ -20,12 +20,33 @@ void null;
|
|
|
20
20
|
export const VALID_SKILL_PRESENCE_MODES = [
|
|
21
21
|
'full-auto',
|
|
22
22
|
'assisted',
|
|
23
|
-
'
|
|
24
|
-
'
|
|
23
|
+
'strict',
|
|
24
|
+
'24h'
|
|
25
25
|
];
|
|
26
|
+
// Migration note (slice 2026-09-09-mode-consolidation): `swarm` was REMOVED
|
|
27
|
+
// as a mode — parallel fan-out is now the default execution strategy in
|
|
28
|
+
// every mode. A legacy on-disk `mode: 'swarm'` is normalized on read to
|
|
29
|
+
// `'full-auto'` (never crash, never drop the presence).
|
|
30
|
+
export const LEGACY_SKILL_PRESENCE_MODE_ALIASES = {
|
|
31
|
+
swarm: 'full-auto'
|
|
32
|
+
};
|
|
26
33
|
export function isSkillPresenceMode(value) {
|
|
27
34
|
return VALID_SKILL_PRESENCE_MODES.includes(value);
|
|
28
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Normalize a raw on-disk / CLI mode token to a current
|
|
38
|
+
* `SkillPresenceMode`. Current values pass through; the legacy
|
|
39
|
+
* `'swarm'` alias maps to `'full-auto'`; anything else returns
|
|
40
|
+
* `undefined` so the caller can decide (drop the field, not the
|
|
41
|
+
* presence). Never throws.
|
|
42
|
+
*/
|
|
43
|
+
export function normalizeSkillPresenceMode(value) {
|
|
44
|
+
if (typeof value !== 'string' || value.length === 0)
|
|
45
|
+
return undefined;
|
|
46
|
+
if (isSkillPresenceMode(value))
|
|
47
|
+
return value;
|
|
48
|
+
return LEGACY_SKILL_PRESENCE_MODE_ALIASES[value];
|
|
49
|
+
}
|
|
29
50
|
/**
|
|
30
51
|
* The current outer session id, exposed to Bash tool calls via the
|
|
31
52
|
* `PEAKS_OUTER_SESSION_ID` environment variable. Stamping it onto the
|
|
@@ -118,8 +139,15 @@ function readSkillPresenceFromLease(projectRootOverride) {
|
|
|
118
139
|
// The lease carries `callerId` (the adapter / harness session id),
|
|
119
140
|
// not the legacy `outerSessionId` field. Project it for back-compat
|
|
120
141
|
// with `clearStalePresenceOnRotation`'s outer-mismatch check.
|
|
142
|
+
//
|
|
143
|
+
// Slice 2026-09-09-mode-consolidation: `mode` is projected too (it was
|
|
144
|
+
// silently dropped before, which made `getSkillPresence().mode` always
|
|
145
|
+
// undefined and left every `presence.mode` consumer dead). Normalize on
|
|
146
|
+
// read so a legacy `'swarm'` lease surfaces as `'full-auto'`.
|
|
147
|
+
const leaseMode = normalizeSkillPresenceMode(lease.mode);
|
|
121
148
|
return {
|
|
122
149
|
skill: lease.skill,
|
|
150
|
+
...(leaseMode !== undefined ? { mode: leaseMode } : {}),
|
|
123
151
|
sessionId,
|
|
124
152
|
outerSessionId: lease.callerId,
|
|
125
153
|
setAt: lease.startedAt,
|
|
@@ -208,7 +236,7 @@ function getPreviousOuterSessionId(projectRootOverride) {
|
|
|
208
236
|
* `peakSessionId`, OR via `ensureSession` for the first-time case).
|
|
209
237
|
*/
|
|
210
238
|
export function setSkillPresenceForCaller(projectRootOverride, callerId, peakSessionId, skill, mode, gate) {
|
|
211
|
-
const validatedMode =
|
|
239
|
+
const validatedMode = normalizeSkillPresenceMode(mode);
|
|
212
240
|
const now = new Date().toISOString();
|
|
213
241
|
const presence = {
|
|
214
242
|
skill,
|
|
@@ -257,7 +285,7 @@ export function setSkillPresence(skill, mode, gate, projectRootOverride) {
|
|
|
257
285
|
// the old shape don't break) but we surface a warning to the
|
|
258
286
|
// CLI boundary via the `outerSessionMismatch` field.
|
|
259
287
|
// 3. delegates the canonical write to `setPresenceLease`.
|
|
260
|
-
const validatedMode =
|
|
288
|
+
const validatedMode = normalizeSkillPresenceMode(mode);
|
|
261
289
|
const sessionId = getCurrentSessionId(projectRootOverride);
|
|
262
290
|
const outerSessionId = getCurrentOuterSessionId();
|
|
263
291
|
const previousOuterSessionId = getPreviousOuterSessionId(projectRootOverride);
|
|
@@ -30,6 +30,7 @@ import { readActiveDispatchIndex } from '../dispatch/dispatch-record-writer.js';
|
|
|
30
30
|
* picks the most recent in-flight lease across all callers; this is the
|
|
31
31
|
* documented back-compat path.
|
|
32
32
|
*/
|
|
33
|
+
import { normalizeSkillPresenceMode } from './skill-presence-service.js';
|
|
33
34
|
const STALE_THRESHOLD_MS = 24 * 60 * 60 * 1000;
|
|
34
35
|
/**
|
|
35
36
|
* Slice rid-statusline-24h-overlay (2026-08-10): name-distinct from
|
|
@@ -245,12 +246,14 @@ function readPresenceReadOnly(projectRoot, callerId) {
|
|
|
245
246
|
}
|
|
246
247
|
// Leases on disk may carry an optional `mode` field (the lease constructor
|
|
247
248
|
// spreads `input.mode` when present); the typed `SkillPresenceLease` does
|
|
248
|
-
// not declare it, so widen the read shape here.
|
|
249
|
-
|
|
249
|
+
// not declare it, so widen the read shape here. Normalized on read: a
|
|
250
|
+
// legacy `'swarm'` lease renders as `'full-auto'` (slice
|
|
251
|
+
// 2026-09-09-mode-consolidation).
|
|
252
|
+
const latestMode = normalizeSkillPresenceMode(latest.mode);
|
|
250
253
|
return {
|
|
251
254
|
presence: {
|
|
252
255
|
skill: latest.skill,
|
|
253
|
-
...(
|
|
256
|
+
...(latestMode !== undefined ? { mode: latestMode } : {}),
|
|
254
257
|
setAt: latest.startedAt,
|
|
255
258
|
},
|
|
256
259
|
invalid: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peaks-loop",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.35",
|
|
4
4
|
"description": "Loop Engineering CLI — workflow primitive / loop guards / evaluators / slice orchestration",
|
|
5
5
|
"author": "SquabbyZ",
|
|
6
6
|
"keywords": [
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"fzf": "^0.5.2",
|
|
102
102
|
"yaml": "^2.9.0",
|
|
103
103
|
"zod": "^4.4.3",
|
|
104
|
-
"peaks-loop-internal-runtime": "0.0.
|
|
105
|
-
"peaks-loop-
|
|
106
|
-
"peaks-loop-
|
|
107
|
-
"peaks-loop-shared-channel": "0.0.
|
|
104
|
+
"peaks-loop-internal-runtime": "0.0.20",
|
|
105
|
+
"peaks-loop-mut": "0.1.33",
|
|
106
|
+
"peaks-loop-shared": "0.0.69",
|
|
107
|
+
"peaks-loop-shared-channel": "0.0.37"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@changesets/cli": "2.31.1",
|
|
@@ -104,7 +104,7 @@ peaks sub-agent dispatch rd --prompt '<your task>' --graph-node <nid> --workflow
|
|
|
104
104
|
**Integration surfaces:** `peaks code run --24h` / `peaks dashboard long-run --since 24h` / `peaks session 24h-mode state|transition|attempts|reset`.
|
|
105
105
|
|
|
106
106
|
**Red lines (peaks-code side):**
|
|
107
|
-
- No auto-compact prose ban: never write "ask the user to compact" / "prompt the user to run `/compact`" / "the user should run `peaks
|
|
107
|
+
- No auto-compact prose ban: never write "ask the user to compact" / "prompt the user to run `/compact`" / "the user should run `peaks code auto-compact` manually" / "the user is responsible for context management" / legacy 50/75/90 percent tiers. **0.85 / 0.95 contract is mandatory.**
|
|
108
108
|
- SquabbyZ sole-author rule: no `Co-Authored-By: Claude/Anthropic` trailer.
|
|
109
109
|
- 24h mode is a flag on `peaks-code`; MUST NOT introduce a sibling `peaks-24h` skill or competing top-level verb.
|
|
110
110
|
|
|
@@ -151,7 +151,7 @@ Before the first planning action, run `peaks fresh-context preflight --prompt "<
|
|
|
151
151
|
1. **PreToolUse hook — `peaks code gate-step-08`.** Installed by `peaks workspace init` on the `Bash` matcher; checks `job-shape.json` presence + fail-closed backup regex. If `job-shape.json` AND `progress.json` exist, surfaces `Next: slice #N of M (<currentSlice>)` so the LLM cannot wake up cold.
|
|
152
152
|
2. **Size-fear ban — `peaks code emit-handoff`.** Refuses to emit a final handoff while `remaining > 0` under Job mode. Pass `--force-under-job` only with explicit user approval.
|
|
153
153
|
3. **On-disk slice progress — `peaks job progress`.** `peaks job checkpoint --state done` writes `progress.json`. `peaks job progress --job-id <jid> [--allow-missing]` is the canonical reader.
|
|
154
|
-
4. **Forced auto-compact — `--enforce-job-mode`.** `peaks code context-now --enforce-job-mode` returns `action: 'auto-compact-now'` at ≥ 0.85. **Job mode at ≥ 0.85 is MANDATORY auto-compact** — Code MUST call `peaks
|
|
154
|
+
4. **Forced auto-compact — `--enforce-job-mode`.** `peaks code context-now --enforce-job-mode` returns `action: 'auto-compact-now'` at ≥ 0.85. **Job mode at ≥ 0.85 is MANDATORY auto-compact** — Code MUST call `peaks code auto-compact` without confirmation.
|
|
155
155
|
|
|
156
156
|
**Step 0.7 resume rule (read-FIRST):** on resume, `peaks code gate-step-08` reads `progress.json` first and surfaces `Next: slice #N of M (<currentSlice>)` so the orchestrator picks up at the right slice without re-reading the artifact tree.
|
|
157
157
|
|
|
@@ -161,26 +161,26 @@ Before the first planning action, run `peaks fresh-context preflight --prompt "<
|
|
|
161
161
|
|
|
162
162
|
### Peaks-Loop Step N+2: Auto-compact at the warning line (v2.13.0 zero-pause contract)
|
|
163
163
|
|
|
164
|
-
> **Zero-pause contract.** When context usage crosses the pre-compact threshold, peaks-loop **automatically fires `peaks
|
|
164
|
+
> **Zero-pause contract.** When context usage crosses the pre-compact threshold, peaks-loop **automatically fires `peaks code auto-compact` — the LLM does NOT prompt the user to run `/compact` manually**. Stale prose that says "ask the user to compact" silently stalls the workflow. The v2.13.0 contract makes auto-compact a system responsibility, not a user action.
|
|
165
165
|
|
|
166
166
|
**Thresholds (v2.13.0, replacing legacy 50/75/90):**
|
|
167
167
|
|
|
168
168
|
| ratio zone | zone name | action |
|
|
169
169
|
|---|---|---|
|
|
170
170
|
| `< 0.85` | normal | skip — LLM keeps working |
|
|
171
|
-
| `0.85 ≤ ratio < 0.95` | **pre-compact zone** | `peaks
|
|
172
|
-
| `ratio ≥ 0.95` | **red-line (Karpathy §4)** | synchronous gate — `peaks
|
|
171
|
+
| `0.85 ≤ ratio < 0.95` | **pre-compact zone** | `peaks code auto-compact` fires **automatically** (deferred only when in-flight sub-agent batch is running; fires the moment the batch lands). The LLM does not prompt the user. |
|
|
172
|
+
| `ratio ≥ 0.95` | **red-line (Karpathy §4)** | synchronous gate — `peaks code auto-compact` invoked immediately; `peaks code context-now` returns `action: 'red-line'` and refuses to advance until ratio drops below 0.85. **Karpathy §4 automatic exception** — LLM cannot opt out. |
|
|
173
173
|
|
|
174
|
-
**Probe primitive (single source of truth):** `peaks code context-now --json`. Do NOT use `peaks context check --prompt-size` (deprecated, will silently under-report ratio). Returns `{ ratio, action: 'ok' | 'soft-warn' | 'auto-compact-now' | 'red-line' }` — Code reads `action` and dispatches `peaks
|
|
174
|
+
**Probe primitive (single source of truth):** `peaks code context-now --json`. Do NOT use `peaks context check --prompt-size` (deprecated, will silently under-report ratio). Returns `{ ratio, action: 'ok' | 'soft-warn' | 'auto-compact-now' | 'red-line' }` — Code reads `action` and dispatches `peaks code auto-compact` on `auto-compact-now` or `red-line` without user confirmation.
|
|
175
175
|
|
|
176
176
|
**Enforcement layers (defense in depth):**
|
|
177
177
|
1. `src/services/code/auto-compact-orchestrator.ts` — `evaluateAutoCompactDecision` default-returns `shouldCompact: true` for both `pre-compact` and `red-line`. Only deferral is `inFlightBatch.hasInFlightBatch` (D6.e); no LLM/human approval branch.
|
|
178
178
|
2. `--enforce-job-mode` (v3.1.2) — Job mode elevates ≥0.85 to MANDATORY regardless of in-flight batch.
|
|
179
179
|
3. `peaks code gate-step-08` (PreToolUse hook) — surfaces `auto-compact-now` on every Bash call when ratio is in the zone, so the LLM cannot wake up cold and forget.
|
|
180
|
-
4. Karpathy §4 exception: `peaks
|
|
180
|
+
4. Karpathy §4 exception: `peaks code auto-compact` is fired *by the orchestrator*, not by the user. If you find yourself about to write "ask the user to compact" / "prompt the user to run `/compact`", STOP — that is the regression.
|
|
181
181
|
|
|
182
182
|
**Anti-pattern (DO NOT introduce):** any of these strings in skills/* or comments signals the zero-pause contract has been broken:
|
|
183
|
-
- "ask the user to compact" / "prompt the user to run `/compact`" / "the user should run `peaks
|
|
183
|
+
- "ask the user to compact" / "prompt the user to run `/compact`" / "the user should run `peaks code auto-compact` manually" / "the user is responsible for context management" / legacy mid/seventy-five/ninety percent tiers (current is 0.85 / 0.95).
|
|
184
184
|
|
|
185
185
|
If the prose audit (`peaks audit red-lines`) flags any of the above, the slice is **blocked** until the prose is rewritten.
|
|
186
186
|
|
|
@@ -270,7 +270,7 @@ After `peaks-rd` finishes, Code MUST auto-route to `peaks-qa` without waiting fo
|
|
|
270
270
|
|
|
271
271
|
## Default runbook
|
|
272
272
|
|
|
273
|
-
The end-to-end CLI sequence for `full-auto` lives in `references/runbook.md`. `assisted`/`strict` pause at `[CONFIRM]`; `full-auto`/`
|
|
273
|
+
The end-to-end CLI sequence for `full-auto` lives in `references/runbook.md`. `assisted`/`strict` pause at `[CONFIRM]`; `full-auto`/`24h` auto-proceed. At a `[CONFIRM]` gate the CLI never prompts: the transition throws `CONFIRMATION_REQUIRED`, so Code asks the user via `AskUserQuestion` and, on approval, re-runs the same command with `--confirm`. Never expect or ask for a terminal `y/N` prompt.
|
|
274
274
|
|
|
275
275
|
When adding new CLI commands, mirror into `references/runbook.md` and `tests/unit/skill-default-runbook.test.ts` (test falls back to the reference).
|
|
276
276
|
|
|
@@ -296,7 +296,7 @@ After final validation, refresh project-local standards via `peaks standards ini
|
|
|
296
296
|
|
|
297
297
|
## Peaks-Loop Step 11: Memory sediment (BLOCKING on workflow complete)
|
|
298
298
|
|
|
299
|
-
> **Hard rule.** Code MUST NOT declare a workflow complete until Step 11 has produced ≥ 1 file in `.peaks/memory/` OR the user has explicitly approved a no-sediment outcome via AskUserQuestion. Canonical CLI: `peaks memory extract --project <repo> --artifact .peaks/_runtime/<sessionId>/txt/handoff.md --apply --json` (the artifact-scoped extract; the batch-scoped sibling `peaks project memories:extract` is for non-handoff flows only). Substeps 11a/11b/11c/11d (Gate A/B/C), D-010 fix root cause check → `references/step-11-memory-sediment.md` + `references/runbook.md` §Step 11.
|
|
299
|
+
> **Hard rule.** Code MUST NOT declare a workflow complete until Step 11 has produced ≥ 1 file in `.peaks/memory/` OR the user has explicitly approved a no-sediment outcome via AskUserQuestion. Canonical CLI: `peaks memory extract --project <repo> --artifact .peaks/_runtime/<sessionId>/txt/handoff.md --apply --json` (the artifact-scoped extract; the batch-scoped sibling `peaks project memories:extract` is for non-handoff flows only). **Single authority:** inside a peaks-code workflow, sedimenting memory writes to `.peaks/memory/`; the IDE-side memory dir (`~/.claude/projects/<hash>/memory/`) is a session note, not the authority and is read-only for peaks — pull any session note in with `peaks memory ingest --apply`, and keep the index in sync with `peaks memory reindex --apply`. Substeps 11a/11b/11c/11d (Gate A/B/C), 11e (index hygiene), 11f (IDE-side ingest), D-010 fix root cause check → `references/step-11-memory-sediment.md` + `references/runbook.md` §Step 11.
|
|
300
300
|
|
|
301
301
|
## Peaks-Loop External references and lifecycle
|
|
302
302
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
> Body of `### Peaks-Loop Step 1`. After Step 0 has anchored the workspace and presence, when the user invokes Peaks-Loop Code without explicitly naming an execution profile, use `AskUserQuestion` to pick the profile. Present the recommended full-auto path as the first/default option with a practical description for each:
|
|
4
4
|
|
|
5
5
|
1. **Full auto (Recommended)** — Peaks-Loop handles planning, role coordination, validation, and compact handoff end-to-end while preserving required confirmation gates for risky or shared-state actions.
|
|
6
|
-
2. **
|
|
7
|
-
3. **
|
|
6
|
+
2. **24h** — Long-run autonomy profile: auto-proceed gates, periodic checkpoints, and the partial auto-compact cadence for overnight / multi-hour runs. It may be auto-engaged by the T1–T5 triggers without a pick.
|
|
7
|
+
3. **Assisted** — Peaks-Loop proposes plans, artifacts, and checks, then pauses for user decisions at major workflow boundaries.
|
|
8
8
|
4. **Strict** — Peaks-Loop uses the most conservative gates: explicit confirmations, strict slice specs, coverage evidence, QA acceptance, and commit boundaries before continuing.
|
|
9
9
|
|
|
10
10
|
Map the user's selection to the `--mode` flag value (used by `peaks skill presence:set`; `presence:set --mode` accepts any string, so the name matches the user-facing label rather than overloading "code" which is also the skill name):
|
|
@@ -12,10 +12,14 @@ Map the user's selection to the `--mode` flag value (used by `peaks skill presen
|
|
|
12
12
|
| User selects | `--mode` value |
|
|
13
13
|
|---|---|
|
|
14
14
|
| Full auto | `full-auto` |
|
|
15
|
+
| 24h | `24h` |
|
|
15
16
|
| Assisted | `assisted` |
|
|
16
|
-
| Swarm | `swarm` |
|
|
17
17
|
| Strict | `strict` |
|
|
18
18
|
|
|
19
|
+
> Note: in `assisted` / `strict`, a workflow-boundary confirmation is resolved by asking the user via `AskUserQuestion` and, on approval, re-running the same CLI command with `--confirm`. The CLI never opens a terminal prompt (no stdin read, no `y/N`) — an LLM-driven session has no TTY.
|
|
20
|
+
|
|
21
|
+
> Note: parallel role/worker fan-out is the default execution strategy in **every** mode — it is not a mode of its own. The old `swarm` profile was removed; a legacy on-disk `mode: 'swarm'` is read as `full-auto`.
|
|
22
|
+
|
|
19
23
|
> Note: `peaks workflow route --mode code|team` is a **different** CLI dimension (code developer vs team flow) and is unrelated to the profile choice here. Do not conflate them.
|
|
20
24
|
|
|
21
25
|
If the user already names a profile in their invocation (e.g. `/peaks-code --full-auto`, "用全自动模式"), skip this question and use the named profile directly.
|
|
@@ -72,10 +72,10 @@ This step is strictly IDE-agnostic. The LLM calls the peaks CLI; no IDE-specific
|
|
|
72
72
|
|
|
73
73
|
## Companion surface — auto-compact (zero-pause)
|
|
74
74
|
|
|
75
|
-
When the runner crosses the v2.13.0 auto-compact thresholds (0.85 pre-compact / 0.95 red-line), `peaks session checkpoint` is NOT enough on its own — the LLM must also fire `peaks
|
|
75
|
+
When the runner crosses the v2.13.0 auto-compact thresholds (0.85 pre-compact / 0.95 red-line), `peaks session checkpoint` is NOT enough on its own — the LLM must also fire `peaks code auto-compact` (or wait for the in-band PreToolUse hook at ratio ≥ 0.95 to compact the runner itself). See:
|
|
76
76
|
|
|
77
|
-
- `peaks
|
|
78
|
-
- `peaks
|
|
77
|
+
- `peaks code auto-compact` — orchestrator that writes the convergence plan + dispatches the compact pathway
|
|
78
|
+
- `peaks code auto-compact` — the PreToolUse hook entrypoint fired by `.claude/settings.local.json` (slice 2026-07-02-auto-compact-zero-pause)
|
|
79
79
|
- `.peaks/memory/2026-06-27-auto-compact-design.md` — zero-human-intervention design rationale
|
|
80
80
|
|
|
81
|
-
The two surfaces compose: `peaks session checkpoint` persists the context state, `peaks
|
|
81
|
+
The two surfaces compose: `peaks session checkpoint` persists the context state, `peaks code auto-compact` collapses the runner's window. The LLM fires both in the 0.85–0.95 zone; the hook fires alone at ≥ 0.95.
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
## Default runbook — CLI sequence
|
|
12
12
|
|
|
13
|
-
The end-to-end CLI sequence for the `full-auto` profile. `assisted` and `strict` profiles pause at `[CONFIRM]` markers below. `full-auto` and `
|
|
13
|
+
The end-to-end CLI sequence for the `full-auto` profile. `assisted` and `strict` profiles pause at `[CONFIRM]` markers below. `full-auto` and `24h` auto-proceed through all gates. See Transition Gates for artifact verification at each stage.
|
|
14
|
+
|
|
15
|
+
> **How to resolve a `[CONFIRM]` marker (never a terminal prompt):** the CLI does not read stdin. Without `--confirm` / `--force-confirm` the transition fails with `CONFIRMATION_REQUIRED` and `nextActions`. Code must ask the user via `AskUserQuestion` whether to proceed; if the user approves, re-run the *same* command with `--confirm`. Never wait for a `y/N` prompt — no TTY exists in an LLM-driven session.
|
|
14
16
|
|
|
15
17
|
Canonical single-shot sub-agent dispatch (the `--prompt` flag is required):
|
|
16
18
|
|
|
@@ -34,11 +36,11 @@ peaks scan existing-system --project <repo> --json
|
|
|
34
36
|
# → copy tokens, sources, conventions, inconsistencies into .peaks/_runtime/<session-id>/system/existing-system.md (Peaks-Loop Gate A.5)
|
|
35
37
|
|
|
36
38
|
# 1. Peaks-Loop Standards preflight + apply
|
|
37
|
-
# Run dry-run first to inspect deltas, then APPLY. In full-auto and
|
|
39
|
+
# Run dry-run first to inspect deltas, then APPLY. In full-auto and 24h modes,
|
|
38
40
|
# --apply is the default — Standards files (CLAUDE.md, .claude/rules/**) live INSIDE
|
|
39
41
|
# the target project and are required for downstream skill preflight, so producing
|
|
40
42
|
# them is part of completing the workflow. Assisted/Strict modes pause for [CONFIRM]
|
|
41
|
-
# between dry-run and apply.
|
|
43
|
+
# between dry-run and apply (AskUserQuestion → re-run with --confirm; no terminal prompt).
|
|
42
44
|
peaks standards init --project <repo> --dry-run --json
|
|
43
45
|
# or: peaks standards update --project <repo> --dry-run --json
|
|
44
46
|
peaks standards init --project <repo> --apply --json
|
|
@@ -57,7 +59,8 @@ peaks standards init --project <repo> --apply --json
|
|
|
57
59
|
# 若 LLM 看到 peaks-code runbook 里出现老命令(>9 之外的 raw 名字),
|
|
58
60
|
# 先 `peaks --help` 校验当前 surface,再决定改 runbook 还是改命令。
|
|
59
61
|
|
|
60
|
-
# 2. Peaks-Loop PRD (Assisted/Strict: [CONFIRM] before confirmed-by-user
|
|
62
|
+
# 2. Peaks-Loop PRD (Assisted/Strict: [CONFIRM] before confirmed-by-user
|
|
63
|
+
# → AskUserQuestion; on approval re-run the transition with --confirm)
|
|
61
64
|
# Classify the request type from the PRD: feature | bugfix | refactor | docs | config | chore
|
|
62
65
|
# This drives RD/QA gate strictness — see "Mandatory RD QA repair loop" for the matrix.
|
|
63
66
|
peaks request init --role prd --id <rid> --project <repo> --apply --type <type> --json
|
|
@@ -139,6 +142,7 @@ ls .peaks/_runtime/<sid>/qa/test-cases/<rid>.md # QA test-cases (
|
|
|
139
142
|
ls .peaks/_runtime/<sid>/ui/design-draft.md 2>&1 # non-blocking (Gate B info)
|
|
140
143
|
# Apply the degradation rules in the main SKILL.md if any artefact is missing.
|
|
141
144
|
# → Peaks-Loop Gate B convergence check. Assisted/Strict: [CONFIRM]
|
|
145
|
+
# → AskUserQuestion; on approval re-run the transition with --confirm
|
|
142
146
|
|
|
143
147
|
# 4. Peaks-Loop RD planning artifact (the file required by the prerequisite gate)
|
|
144
148
|
# feature / refactor → write .peaks/_runtime/<id>/rd/tech-doc.md
|
|
@@ -163,6 +167,7 @@ peaks request transition <rid> --role qa --state running --project <repo> --json
|
|
|
163
167
|
# + .peaks/_runtime/<id>/qa/performance-findings.md (feature/refactor only)
|
|
164
168
|
peaks request transition <rid> --role qa --state verdict-issued --project <repo> --json
|
|
165
169
|
# → Peaks-Loop Gate D check. Assisted/Strict: [CONFIRM]
|
|
170
|
+
# → AskUserQuestion; on approval re-run the transition with --confirm
|
|
166
171
|
|
|
167
172
|
# 7. Peaks-Loop RD↔QA repair loop — if verdict is return-to-rd, re-run 4 through 6 until QA passes or blocked TXT.
|
|
168
173
|
# Before invoking peaks-rd again, check the cycle count so you don't blow past the cap silently:
|
|
@@ -210,6 +215,12 @@ peaks memory extract --project <repo> --artifact .peaks/_runtime/<id>/txt/handof
|
|
|
210
215
|
# --apply is REQUIRED to write .peaks/memory/; without it the command only
|
|
211
216
|
# previews. The extract regenerates index.json in the same call.
|
|
212
217
|
|
|
218
|
+
# 10d. Index hygiene (single authority: .peaks/memory/ is peaks-owned):
|
|
219
|
+
peaks memory reindex --project <repo> --json # drift report (unclassified / orphans both ways)
|
|
220
|
+
peaks memory reindex --project <repo> --apply --json # rebuild index.json + regenerate MEMORY.md
|
|
221
|
+
peaks memory ingest --project <repo> --json # preview IDE-side session notes
|
|
222
|
+
peaks memory ingest --project <repo> --apply --json # import them into .peaks/memory (IDE side stays read-only)
|
|
223
|
+
|
|
213
224
|
# 11. Peaks-Loop Final snapshot
|
|
214
225
|
peaks project dashboard --project <repo> --json
|
|
215
226
|
peaks skill doctor --json
|
|
@@ -289,7 +300,7 @@ peaks code emit-handoff --project <repo> --job-id <jid> --json
|
|
|
289
300
|
# job-shape.json says isJob=true, ≥0.85 is MANDATORY auto-compact.
|
|
290
301
|
# Code MUST call this without confirmation under Job mode.
|
|
291
302
|
peaks code context-now --project <repo> --enforce-job-mode --json
|
|
292
|
-
peaks
|
|
303
|
+
peaks code auto-compact --project <repo> --json
|
|
293
304
|
|
|
294
305
|
# v3.1.2 PreToolUse gate (installed by `peaks workspace init`):
|
|
295
306
|
# every Bash tool call runs `peaks code gate-step-08` automatically.
|
|
@@ -15,8 +15,8 @@ the lookup table the LLM must consult in lieu of intuition.
|
|
|
15
15
|
|
|
16
16
|
| # | Signal source | Threshold | File / CLI | LLM action |
|
|
17
17
|
|---|---|---|---|---|
|
|
18
|
-
| 1 | prompt size (main session) | 50% / 75% / 80% / 90% | `src/services/context/threshold.ts`; probe via `peaks code context-now` | soft-warn at 50%; consider compact at 75%; MUST NOT auto-compact mid-batch (D6.e); Job mode ≥ 0.85 ⇒ MANDATORY `peaks
|
|
19
|
-
| 2 | auto-compact zone | 0.85 pre-compact / 0.95 red-line | `src/services/code/auto-compact-orchestrator.ts`; `--enforce-job-mode` flag | Auto-fires `peaks
|
|
18
|
+
| 1 | prompt size (main session) | 50% / 75% / 80% / 90% | `src/services/context/threshold.ts`; probe via `peaks code context-now` | soft-warn at 50%; consider compact at 75%; MUST NOT auto-compact mid-batch (D6.e); Job mode ≥ 0.85 ⇒ MANDATORY `peaks code auto-compact` |
|
|
19
|
+
| 2 | auto-compact zone | 0.85 pre-compact / 0.95 red-line | `src/services/code/auto-compact-orchestrator.ts`; `--enforce-job-mode` flag | Auto-fires `peaks code auto-compact`; LLM MUST NOT prompt user to compact (zero-pause contract v2.13.0) |
|
|
20
20
|
| 3 | sub-agent dispatch prompt size | 50% / 75% / 80% | `src/services/context/context-guard.ts`; `peaks sub-agent-dispatch-guard` PreToolUse hook | soft-warn at 50%; CONTEXT_NEAR_LIMIT at 75%; hard-reject at 80% (CLI + hook double-guard) |
|
|
21
21
|
| 4 | statusline compact bar | visual | `src/services/compact-statusline/compact-statusline-service.ts` | ambient UI; surfaces queued/preparing/compacting/verifying/completed/failed/stalled |
|
|
22
22
|
| 5 | in-flight batch deferral | D6.e | `src/services/code/auto-compact-modes.ts` | defer compact until batch lands (NOT "new session") |
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- `peaks standards init --project <path> --dry-run`
|
|
6
6
|
- `peaks standards update --project <path> --dry-run`
|
|
7
7
|
|
|
8
|
-
Use `standards init` for first-time creation and `standards update` for existing `CLAUDE.md` append/review behavior. In `full-auto` and `
|
|
8
|
+
Use `standards init` for first-time creation and `standards update` for existing `CLAUDE.md` append/review behavior. In `full-auto` and `24h` profiles, `--apply` runs automatically after `--dry-run` succeeds — these files live inside the target project, are required for downstream skill preflight, and producing them is part of finishing the workflow (Peaks-Loop Gate G enforces this). `assisted` and `strict` profiles pause for explicit user confirmation between dry-run and apply.
|
|
9
9
|
|
|
10
10
|
**CRITICAL — Standards must reflect the project scan.** When generating or updating `CLAUDE.md`, the content must reference concrete findings from `.peaks/project-scan/project-scan.md`: the detected component library (e.g. "This project uses antd 5.x"), CSS solution (e.g. "Uses Less via Umi"), build tool, state management, and routing. Never emit a generic template that says "read .claude/rules/..." without naming the actual project stack. If the project-scan has not been run yet, run it before standards init/update.
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ After autonomous work (RD, QA, security, perf), invoke peaks-final-review for 4-
|
|
|
31
31
|
|
|
32
32
|
### Peaks-Loop Step N+2: Main-session context monitor (D6 + slice 2026-07-02)
|
|
33
33
|
|
|
34
|
-
After every 4th tool call, probe via `peaks code context-now --project <repo> --json`. Thresholds: 50% / **0.85 pre-compact / 0.95 red-line** (v2.13.0). **In Job mode ≥ 0.85 is MANDATORY auto-compact** (`peaks
|
|
34
|
+
After every 4th tool call, probe via `peaks code context-now --project <repo> --json`. Thresholds: 50% / **0.85 pre-compact / 0.95 red-line** (v2.13.0). **In Job mode ≥ 0.85 is MANDATORY auto-compact** (`peaks code auto-compact`). Pass `--enforce-job-mode` for single-rid. **≥ 0.95** red line: next Bash/Task fires `peaks code auto-compact`. **Karpathy §4 exception**: compact red line keeps runner alive — zero-intervention wins; LLM MUST NOT ask user to run `/compact`. Honor `--in-flight-batch` (D6.e).
|
|
35
35
|
|
|
36
36
|
### Peaks-Loop Step 0: Anchor the workflow (MANDATORY FIRST ACTIONS — no bail-out)
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ Refuses to emit a final handoff while `remaining > 0` under Job mode. Pass `--fo
|
|
|
45
45
|
|
|
46
46
|
### 3. Forced auto-compact — `--enforce-job-mode`
|
|
47
47
|
|
|
48
|
-
`peaks code context-now --enforce-job-mode` (auto-enabled when `job-shape.json` says `isJob=true`) returns `action: 'auto-compact-now'` at ≥ 0.85; Code MUST call `peaks
|
|
48
|
+
`peaks code context-now --enforce-job-mode` (auto-enabled when `job-shape.json` says `isJob=true`) returns `action: 'auto-compact-now'` at ≥ 0.85; Code MUST call `peaks code auto-compact` without confirmation.
|
|
49
49
|
|
|
50
50
|
### 4. On-disk slice progress — `progress.json`
|
|
51
51
|
|
|
@@ -6,6 +6,15 @@ Companion to `SKILL.md` §"Peaks-Loop Step 11". This file holds the substep-by-s
|
|
|
6
6
|
|
|
7
7
|
Code MUST NOT declare a workflow complete until Step 11 has produced ≥ 1 file in `.peaks/memory/` OR the user has explicitly approved a no-sediment outcome via AskUserQuestion. Applies to **all modes** including `assisted` and `strict`.
|
|
8
8
|
|
|
9
|
+
## Single authority (2026-09-09)
|
|
10
|
+
|
|
11
|
+
**Inside a peaks-code workflow, sedimenting memory writes to `.peaks/memory/`. The IDE-side memory dir is a session note, not the authority.**
|
|
12
|
+
|
|
13
|
+
- `.peaks/memory/` is peaks-owned and authoritative. Every sediment action ends there.
|
|
14
|
+
- Claude Code's per-project memory dir (`~/.claude/projects/<project-hash>/memory/*.md`) is the IDE's own scratch memory. It is **read-only** for peaks — never write there (same rule as `~/.claude/agents/`).
|
|
15
|
+
- If a session note was written to the IDE-side dir instead of `.peaks/memory/`, pull it in with `peaks memory ingest --apply` (LLM-run; read-only on the IDE side, normalizes frontmatter to `metadata.type`, idempotent by filename stem). Conflicts leave both copies in place — resolve by hand.
|
|
16
|
+
- Never let a memory exist only in the IDE-side dir when the workflow claims the memory was sedimented.
|
|
17
|
+
|
|
9
18
|
## Substeps
|
|
10
19
|
|
|
11
20
|
### 11a — Gate A (txt/ inventory)
|
|
@@ -42,6 +51,32 @@ If `extractedCount === 0` after 11c, fire AskUserQuestion:
|
|
|
42
51
|
|
|
43
52
|
> **D-010 fix root cause check:** When firing 11d, first inspect whether the block has the YAML frontmatter (`title:` + `kind:` + `---`). If the `<!-- peaks-memory:start -->` exists but no `title:` line follows, fix the block format and re-run 11c — don't ask the user yet. Default option = (a). Code MUST NOT silently accept (b) without user pick.
|
|
44
53
|
|
|
54
|
+
### 11e — Index hygiene (run after any sediment)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
peaks memory reindex --project <repo> --json # drift report (dry run)
|
|
58
|
+
peaks memory reindex --project <repo> --apply --json # rebuild index.json + MEMORY.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`reindex` re-scans **every** `.peaks/memory/*.md` (including `archived/`), resolves each file's kind as `metadata.type` → top-level `kind:` → top-level `type:`, rebuilds `index.json` deterministically, and regenerates `MEMORY.md` (generated banner; do not hand-edit). It reports, never silently drops:
|
|
62
|
+
|
|
63
|
+
- `unclassified[]` — files with no resolvable kind (add `metadata.type` to fix);
|
|
64
|
+
- `orphanIndex[]` — index entries whose `sourcePath` no longer exists;
|
|
65
|
+
- `orphanDisk[]` — files on disk the rebuilt index does not contain.
|
|
66
|
+
|
|
67
|
+
Run it whenever Step 11 wrote or imported memories, so the machine index and `MEMORY.md` never drift apart again.
|
|
68
|
+
|
|
69
|
+
### 11f — Pull in IDE-side session notes (only when needed)
|
|
70
|
+
|
|
71
|
+
If a memory was written to Claude Code's own memory dir during the session instead of `.peaks/memory/`:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
peaks memory ingest --project <repo> --json # preview
|
|
75
|
+
peaks memory ingest --project <repo> --apply --json # write into .peaks/memory
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Source defaults to `~/.claude/projects/<project-hash>/memory/` (read-only). Import is idempotent by filename stem; differing destinations are reported as conflicts and both copies are left in place. Files whose kind cannot be resolved are reported as needing classification — never invented.
|
|
79
|
+
|
|
45
80
|
## Why Step 11 exists
|
|
46
81
|
|
|
47
82
|
Audit 2026-07-03 confirmed 2 consecutive sessions produced zero `.peaks/memory/` files despite completing RD + QA + handoff artifacts; `assisted` mode silently skipped runbook Step 10 (no STOP condition).
|
|
@@ -48,7 +48,7 @@ Return a compact JSON envelope — do not write prose.
|
|
|
48
48
|
- session-id: <sid> (from .peaks/.active-skill.json or .peaks/.session.json)
|
|
49
49
|
- request-id: <rid> (PRD id)
|
|
50
50
|
- type: <type> (feature | bugfix | refactor | config | docs | chore)
|
|
51
|
-
- mode: <mode> (full-auto |
|
|
51
|
+
- mode: <mode> (full-auto | assisted | strict | 24h)
|
|
52
52
|
- project-scan-path: <path> (read this for component library / CSS / build tool)
|
|
53
53
|
- existing-system-path: <path> (legacy projects only)
|
|
54
54
|
- frontendOnly: <bool> (from project-scan)
|
|
@@ -209,7 +209,7 @@ Sub-agent presence in this list = Code launched a Task for it. Absence = the rol
|
|
|
209
209
|
| Mode | How the swarm plan is decided | What Code does |
|
|
210
210
|
|---|---|---|
|
|
211
211
|
| `full-auto` | Compute plan from signals above, no question to user | Auto-launch all sub-agents in the plan in parallel |
|
|
212
|
-
| `
|
|
212
|
+
| `24h` | Same as `full-auto` | Same as `full-auto` (long-run profile; the fan-out shape is identical, only the auto-compact cadence differs) |
|
|
213
213
|
| `assisted` | `AskUserQuestion` with three options: (a) Full — UI + RD(planning) + QA(test-cases); (b) Backend-only — RD(planning) + QA(test-cases); (c) Sequential — run RD first, then QA, skip UI | Use the user's choice as the plan |
|
|
214
214
|
| `strict` | Same as `assisted` (the question is informational; strict still enforces confirmation gates later) | Same as `assisted` |
|
|
215
215
|
|
|
@@ -182,5 +182,5 @@ ls <repo>/.claude/rules/common/coding-style.md \
|
|
|
182
182
|
# standards init/update with --apply and re-verify.
|
|
183
183
|
# Skipping Peaks-Loop Gate G (e.g. because the user did not explicitly authorize writes) is
|
|
184
184
|
# only acceptable in `assisted`/`strict` modes where the user actively declined; in
|
|
185
|
-
# `full-auto`/`
|
|
185
|
+
# `full-auto`/`24h` the absence of these files is a workflow violation.
|
|
186
186
|
```
|