peaks-loop 4.0.50 → 4.0.52
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 +34 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/commands/baseline-commands.js +11 -1
- package/dist/cli/commands/codegraph-command-runtime.d.ts +28 -0
- package/dist/cli/commands/codegraph-command-runtime.js +72 -0
- package/dist/cli/commands/codegraph-commands.d.ts +2 -11
- package/dist/cli/commands/codegraph-commands.js +173 -228
- package/dist/cli/commands/codegraph-status-command.d.ts +22 -0
- package/dist/cli/commands/codegraph-status-command.js +299 -0
- package/dist/cli/commands/core/memory-command.js +6 -2
- package/dist/cli/commands/job-commands.js +121 -30
- package/dist/cli/commands/project-commands.js +13 -3
- package/dist/cli/commands/request-commands.js +19 -8
- package/dist/cli/commands/share-commands.js +85 -18
- package/dist/cli/commands/slice-commands.js +2 -2
- package/dist/services/artifacts/artifact-prerequisites.js +23 -1
- package/dist/services/codegraph/codegraph-autorefresh.d.ts +16 -0
- package/dist/services/codegraph/codegraph-autorefresh.js +51 -5
- package/dist/services/codegraph/codegraph-config-repair-writer.d.ts +88 -0
- package/dist/services/codegraph/codegraph-config-repair-writer.js +322 -0
- package/dist/services/codegraph/codegraph-exclude-integrity.d.ts +20 -2
- package/dist/services/codegraph/codegraph-exclude-integrity.js +24 -3
- package/dist/services/codegraph/codegraph-exclude-reconciler.d.ts +23 -2
- package/dist/services/codegraph/codegraph-exclude-reconciler.js +123 -12
- package/dist/services/codegraph/codegraph-exclude-repair.d.ts +109 -55
- package/dist/services/codegraph/codegraph-exclude-repair.js +249 -195
- package/dist/services/codegraph/codegraph-include-reconciler.d.ts +10 -0
- package/dist/services/codegraph/codegraph-include-reconciler.js +160 -0
- package/dist/services/codegraph/codegraph-index-integrity.d.ts +268 -0
- package/dist/services/codegraph/codegraph-index-integrity.js +471 -0
- package/dist/services/codegraph/codegraph-service.d.ts +54 -0
- package/dist/services/codegraph/codegraph-service.js +84 -1
- package/dist/services/dispatch/sub-agent-dispatcher.d.ts +11 -30
- package/dist/services/dispatch/sub-agent-dispatcher.js +5 -48
- package/dist/services/doctor/doctor-service/checks/codegraph-exclude-integrity.js +19 -4
- package/dist/services/doctor/doctor-service/checks/codegraph-index-integrity.d.ts +54 -0
- package/dist/services/doctor/doctor-service/checks/codegraph-index-integrity.js +151 -0
- package/dist/services/doctor/doctor-service/checks/l3-orphan-sessions.js +10 -10
- package/dist/services/doctor/doctor-service/plugin-registry.js +2 -0
- package/dist/services/doctor/doctor-service/types.d.ts +25 -0
- package/dist/services/ide/adapters/claude-code-adapter.js +0 -1
- package/dist/services/ide/adapters/codex-adapter.js +1 -2
- package/dist/services/ide/adapters/cursor-adapter.js +1 -2
- package/dist/services/ide/adapters/hermes-adapter.js +1 -2
- package/dist/services/ide/adapters/openclaw-adapter.js +1 -2
- package/dist/services/ide/adapters/qoder-adapter.js +1 -2
- package/dist/services/ide/adapters/tongyi-lingma-adapter.js +1 -2
- package/dist/services/ide/adapters/trae-adapter.js +1 -2
- package/dist/services/ide/adapters/zcode-adapter.js +0 -1
- package/dist/services/ide/ide-types.d.ts +0 -2
- package/dist/services/memory/project-memory-service/index/kind-dispatch.js +48 -13
- package/dist/services/memory/project-memory-service/index.d.ts +5 -3
- package/dist/services/memory/project-memory-service/index.js +2 -2
- package/dist/services/memory/project-memory-service/parsers/frontmatter.d.ts +15 -1
- package/dist/services/memory/project-memory-service/parsers/frontmatter.js +34 -6
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.d.ts +27 -1
- package/dist/services/memory/project-memory-service/parsers/markdown-pure.js +92 -7
- package/dist/services/memory/project-memory-service/types.d.ts +86 -0
- package/dist/services/slice/slice-check-types.d.ts +1 -1
- package/dist/services/workspace/runtime-layout.d.ts +91 -0
- package/dist/services/workspace/runtime-layout.js +148 -0
- package/dist/services/workspace/workspace-claude-settings-materializer.js +14 -0
- package/package.json +6 -6
- package/scripts/clean-dist.mjs +15 -3
- package/scripts/sync-version.mjs +26 -4
- package/skills/bee/peaks-perf-audit/SKILL.md +2 -2
- package/skills/bee/peaks-perf-audit/references/audit-protocol.md +1 -1
- package/skills/bee/peaks-prd/SKILL.md +4 -4
- package/skills/bee/peaks-prd/references/prd-for-multi-pass.md +1 -1
- package/skills/bee/peaks-prd/references/workflow.md +1 -1
- package/skills/bee/peaks-qa/SKILL.md +6 -6
- package/skills/bee/peaks-qa/references/external-capability-guidance.md +1 -1
- package/skills/bee/peaks-qa/references/qa-fanout-contract.md +1 -1
- package/skills/bee/peaks-qa/references/qa-skill-presence.md +1 -1
- package/skills/bee/peaks-qa/references/reading-handoff-frontmatter.md +2 -2
- package/skills/bee/peaks-rd/SKILL.md +2 -2
- package/skills/bee/peaks-rd/references/code-reviewer-4dim-hint.md +1 -1
- package/skills/bee/peaks-rd/references/external-references.md +1 -1
- package/skills/bee/peaks-rd/references/mandatory-perf-baseline.md +1 -1
- package/skills/bee/peaks-rd/references/ocr-multilang-1.8.md +2 -2
- package/skills/bee/peaks-rd/references/parallel-review-fanout.md +2 -2
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +11 -8
- package/skills/bee/peaks-rd/references/rd-runbook.md +1 -1
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +7 -7
- package/skills/bee/peaks-rd/references/rd-transition-gates.md +1 -1
- package/skills/bee/peaks-rd/references/reading-v2-slice-results.md +1 -1
- package/skills/bee/peaks-rd/references/skill-presence-and-title.md +1 -1
- package/skills/bee/peaks-rd/references/v2-12-fanout-collapse.md +7 -5
- package/skills/bee/peaks-rd/references/writing-handoff-frontmatter.md +3 -3
- package/skills/bee/peaks-reviewer/SKILL.md +1 -1
- package/skills/bee/peaks-sc/SKILL.md +1 -1
- package/skills/bee/peaks-security-audit/SKILL.md +3 -3
- package/skills/bee/peaks-security-audit/references/audit-protocol.md +1 -1
- package/skills/bee/peaks-txt/SKILL.md +3 -3
- package/skills/bee/peaks-txt/references/context-capsule.md +1 -1
- package/skills/bee/peaks-ui/SKILL.md +1 -1
- package/skills/peaks-audit/SKILL.md +1 -1
- package/skills/peaks-code/SKILL.md +9 -9
- package/skills/peaks-code/references/context-governance.md +1 -1
- package/skills/peaks-code/references/dag-orchestrator.md +3 -4
- package/skills/peaks-code/references/external-references.md +1 -1
- package/skills/peaks-code/references/external-skill-invocation.md +2 -2
- package/skills/peaks-code/references/fanout-mandatory.md +3 -3
- package/skills/peaks-code/references/frontend-only-mode.md +2 -2
- package/skills/peaks-code/references/gstack-integration.md +1 -1
- package/skills/peaks-code/references/micro-cycle.md +1 -1
- package/skills/peaks-code/references/periodic-checkpoint.md +2 -2
- package/skills/peaks-code/references/project-memory-loading.md +19 -1
- package/skills/peaks-code/references/project-scan-checklist.md +1 -1
- package/skills/peaks-code/references/resume-detection.md +1 -1
- package/skills/peaks-code/references/runbook.md +3 -3
- package/skills/peaks-code/references/session-overload-signal-index.md +2 -2
- package/skills/peaks-code/references/startup-sequence.md +16 -16
- package/skills/peaks-code/references/step-11-memory-sediment.md +3 -3
- package/skills/peaks-code/references/sub-agent-dispatch.md +7 -6
- package/skills/peaks-code/references/swarm-dispatch-contract.md +1 -1
- package/skills/peaks-code/references/workflow-gates-and-types.md +3 -3
- package/skills/peaks-code/references/worktree-governance.md +1 -1
- package/skills/peaks-final-review/SKILL.md +3 -3
- package/skills/peaks-ide/references/audit-log-helper.md +5 -4
- package/skills/peaks-resume/SKILL.md +1 -1
- package/skills/peaks-slice-decompose/SKILL.md +4 -4
- package/skills/peaks-slice-decompose/references/cross-pass-edge-interpretation.md +1 -1
- package/skills/peaks-slice-decompose/references/granularity-decision.md +1 -1
- package/skills/peaks-slice-decompose/references/v2-schema.md +2 -2
- package/skills/peaks-solo/SKILL.md +1 -2
|
@@ -11,23 +11,23 @@ description: peaks-code startup sequence Steps 0 / 0.5-0.87 / 1 / 2 / 2.3 / 2.5
|
|
|
11
11
|
|
|
12
12
|
### Peaks-Loop Slice 011 — workspace consolidate + session checkpoint/resume
|
|
13
13
|
|
|
14
|
-
`peaks workspace consolidate` is the slice-011 umbrella primitive. `peaks session checkpoint` (context-overflow defense) and `peaks session resume` surface as Step 0.75 + Step N. See `
|
|
14
|
+
`peaks workspace consolidate` is the slice-011 umbrella primitive. `peaks session checkpoint` (context-overflow defense) and `peaks session resume` surface as Step 0.75 + Step N. See `cross-date-session-check.md`.
|
|
15
15
|
|
|
16
16
|
### Peaks-Loop Step 0.75: Resume from checkpoint (BLOCKING on same-day re-invocation)
|
|
17
17
|
|
|
18
|
-
When a NEW conversation opens on a session whose `lastActivity` is from today AND `.peaks/_runtime/<sessionId>/checkpoints/` has `*.json`, surface via `peaks session info --active --json` + `peaks session resume --from <path> --project <repo>`. Prompt via `AskUserQuestion` (resume / fresh); if "resume", prepend the block. Step 0.75 is no-op on precondition fail. See `
|
|
18
|
+
When a NEW conversation opens on a session whose `lastActivity` is from today AND `.peaks/_runtime/<sessionId>/checkpoints/` has `*.json`, surface via `peaks session info --active --json` + `peaks session resume --from <path> --project <repo>`. Prompt via `AskUserQuestion` (resume / fresh); if "resume", prepend the block. Step 0.75 is no-op on precondition fail. See `checkpoint-resume.md`.
|
|
19
19
|
|
|
20
20
|
### Peaks-Loop Step N: Periodic checkpoint (auto-fire, no user action)
|
|
21
21
|
|
|
22
|
-
Proactive context-overflow defense. CLI: `peaks session checkpoint [--reason <r>] [...flags]`. Fire `--reason periodic` every 20 tool calls (G1 hard-coded), `--reason artifact-written` per PRD/RD/QA/TXT write. See `
|
|
22
|
+
Proactive context-overflow defense. CLI: `peaks session checkpoint [--reason <r>] [...flags]`. Fire `--reason periodic` every 20 tool calls (G1 hard-coded), `--reason artifact-written` per PRD/RD/QA/TXT write. See `periodic-checkpoint.md` (no guard fails on a missed cadence — the test that did was deleted in `f17aa377`).
|
|
23
23
|
|
|
24
24
|
### Peaks-Loop Step 0.6: Audit + Goal (NEW)
|
|
25
25
|
|
|
26
|
-
Invoke peaks-audit after need expressed; store approved goal at `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json`. **All autonomous work requires approved goal.** → `
|
|
26
|
+
Invoke peaks-audit after need expressed; store approved goal at `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json`. **All autonomous work requires approved goal.** → `skills/peaks-audit/SKILL.md`.
|
|
27
27
|
|
|
28
28
|
### Peaks-Loop Step N+1: Final Review (NEW)
|
|
29
29
|
|
|
30
|
-
After autonomous work (RD, QA, security, perf), invoke peaks-final-review for 4-dim evidence. All 4 pass → final delivery; else loop back. See `
|
|
30
|
+
After autonomous work (RD, QA, security, perf), invoke peaks-final-review for 4-dim evidence. All 4 pass → final delivery; else loop back. See `skills/peaks-final-review/SKILL.md`.
|
|
31
31
|
|
|
32
32
|
### Peaks-Loop Step N+2: Main-session context monitor (D6 + slice 2026-07-02)
|
|
33
33
|
|
|
@@ -37,21 +37,21 @@ After every 4th tool call, probe via `peaks code context-now --project <repo> --
|
|
|
37
37
|
|
|
38
38
|
Run `peaks workspace init` + `peaks skill presence:set peaks-code` BEFORE any analysis, role handoff, or mode-selection question. Even "分析下这个项目" / "看一下代码" / one-line questions anchor first.
|
|
39
39
|
|
|
40
|
-
→ see `
|
|
40
|
+
→ see `anchoring-and-session-info.md` for the full Step 0 contract + session-conflict resolution.
|
|
41
41
|
|
|
42
42
|
#### Step 0 bypass — Claude Code [Fact-Forcing Gate] (slice 2.0.1-bug3)
|
|
43
43
|
|
|
44
44
|
`peaks workspace init` materializes `.claude/settings.local.json` (a PreToolUse hook allow-list for `.peaks/**` paths and `peaks <subcommand>` Bash) so the [Fact-Forcing Gate] does not block Step 0. Pass `--no-claude-hooks` to opt out.
|
|
45
45
|
|
|
46
|
-
→ see `
|
|
46
|
+
→ see `anchoring-and-session-info.md` for the full bypass contract, recovery flow, and anti-bail-out rule.
|
|
47
47
|
|
|
48
48
|
### Peaks-Loop Step 0.7: Detect unfinished work and offer resume (BLOCKING on first invocation per session)
|
|
49
49
|
|
|
50
|
-
After Step 0, run the resume-detection probe; surface via `AskUserQuestion` if a slice is in flight. **v3.1.2 resume rule:** if `.peaks/_runtime/<sessionId>/job/<jid>/progress.json` exists, read FIRST and surface `Next: slice #N of M`. **v2.11.0 D7 override:** if user just `/compact`ed, run `peaks code post-compact-detect --project <repo> --json` FIRST; `shouldAutoResume: true` skips AskUserQuestion. → `
|
|
50
|
+
After Step 0, run the resume-detection probe; surface via `AskUserQuestion` if a slice is in flight. **v3.1.2 resume rule:** if `.peaks/_runtime/<sessionId>/job/<jid>/progress.json` exists, read FIRST and surface `Next: slice #N of M`. **v2.11.0 D7 override:** if user just `/compact`ed, run `peaks code post-compact-detect --project <repo> --json` FIRST; `shouldAutoResume: true` skips AskUserQuestion. → `resume-detection.md`.
|
|
51
51
|
|
|
52
52
|
### Peaks-Loop Step 0.55: 1.x → 2.0 detection (BLOCKING on first invocation per session, when the project is not on a 2.0 layout)
|
|
53
53
|
|
|
54
|
-
After Step 0.7 returns "fresh", run `peaks upgrade --detect-1x --project <root> --json`. If `isOneX: true`, surface `AskUserQuestion`. → `
|
|
54
|
+
After Step 0.7 returns "fresh", run `peaks upgrade --detect-1x --project <root> --json`. If `isOneX: true`, surface `AskUserQuestion`. → `step-0-55-1x-detection.md`.
|
|
55
55
|
|
|
56
56
|
### Peaks-Loop Step 0.8 — Job 启动 (BLOCKING on LLM judgement — v3.1.1 patch + v3.1.2 mechanical gates)
|
|
57
57
|
|
|
@@ -65,7 +65,7 @@ The CLI is a **recorder + gate** for job-shape (the LLM judges). LLM calls `peak
|
|
|
65
65
|
|
|
66
66
|
**v3.1.2 mechanical gates** (recorder-only was bypassed twice):
|
|
67
67
|
|
|
68
|
-
PreToolUse hook on `peaks code gate-step-08`; size-fear ban on `peaks code emit-handoff`; forced auto-compact from ≥ 0.80 (`auto-fire`, every mode); on-disk slice progress via `peaks job checkpoint` (canonical reader `peaks job progress --job-id <jid>`). Full mechanics (judgement criteria, hook table, backup-regex rationale, hook wiring) at `
|
|
68
|
+
PreToolUse hook on `peaks code gate-step-08`; size-fear ban on `peaks code emit-handoff`; forced auto-compact from ≥ 0.80 (`auto-fire`, every mode); on-disk slice progress via `peaks job checkpoint` (canonical reader `peaks job progress --job-id <jid>`). Full mechanics (judgement criteria, hook table, backup-regex rationale, hook wiring) at `step-0-8-gate.md`.
|
|
69
69
|
|
|
70
70
|
### Peaks-Loop Step 0.81 — per-slice 收尾
|
|
71
71
|
|
|
@@ -83,23 +83,23 @@ Active in rotating mode; fires every `rotateEvery` slices or via `peaks job rota
|
|
|
83
83
|
|
|
84
84
|
After every `peaks sub-agent dispatch --batch-id <id>` inside a Job, BEFORE next slice checkpoint: `peaks job subagent-cleanup --job-id <jid> --batch-id <id> --force`. Non-zero → block.
|
|
85
85
|
|
|
86
|
-
→ see `
|
|
86
|
+
→ see `job-loop.md` for state machine, visibility, rotation cadence, cross-day recovery, 9 red lines.
|
|
87
87
|
|
|
88
88
|
### Peaks-Loop Step 1: Mode selection
|
|
89
89
|
|
|
90
|
-
Use `AskUserQuestion` with `Full auto (Recommended)` first when user did not name a profile OR skill presence is stale (run `peaks skill presence:check-stale --project <path> --json` first; `stale: true` ⇒ re-ask). → `
|
|
90
|
+
Use `AskUserQuestion` with `Full auto (Recommended)` first when user did not name a profile OR skill presence is stale (run `peaks skill presence:check-stale --project <path> --json` first; `stale: true` ⇒ re-ask). → `mode-selection.md`, `fast-mode.md`, `mode-selection-with-stale-presence.md`.
|
|
91
91
|
|
|
92
92
|
### Peaks-Loop Step 2: Re-set skill presence with the chosen mode
|
|
93
93
|
|
|
94
|
-
Re-run `peaks skill presence:set peaks-code --mode <mode-value> --gate startup`. Install statusline on first run (`peaks statusline install`). → `
|
|
94
|
+
Re-run `peaks skill presence:set peaks-code --mode <mode-value> --gate startup`. Install statusline on first run (`peaks statusline install`). → `skill-presence-and-title.md`.
|
|
95
95
|
|
|
96
96
|
### Peaks-Loop Step 2.3: Load project memory (durable, LLM-authored memories)
|
|
97
97
|
|
|
98
|
-
Run `peaks project memories --project <repo> --json` to read decisions / conventions / modules / rules / lessons from `.peaks/memory`. → `
|
|
98
|
+
Run `peaks project memories --project <repo> --json` to read decisions / conventions / modules / rules / lessons from `.peaks/memory`. → `project-memory-loading.md`.
|
|
99
99
|
|
|
100
100
|
### Peaks-Loop Step 2.5: Set session title
|
|
101
101
|
|
|
102
|
-
Extract a short title from the user's first request (8-20 Chinese chars or 4-10 English words). Run `peaks session title <sessionId> "<title>" --json`. Skip if a title is already set. → `
|
|
102
|
+
Extract a short title from the user's first request (8-20 Chinese chars or 4-10 English words). Run `peaks session title <sessionId> "<title>" --json`. Skip if a title is already set. → `skill-presence-and-title.md` (same file as Step 2). D-002: sid is positional, NOT `--session-id` flag (rejected with `error: unknown option`).
|
|
103
103
|
|
|
104
104
|
## Sub-agent session sharing (MANDATORY — one conversation = one sid)
|
|
105
105
|
|
|
@@ -107,4 +107,4 @@ When peaks-code dispatches a sub-agent (peaks-rd, peaks-qa, peaks-ui, peaks-txt,
|
|
|
107
107
|
|
|
108
108
|
## Boundaries
|
|
109
109
|
|
|
110
|
-
Peaks-Loop Code may identify scenarios, recommend profiles, coordinate role skills via artifacts, coordinate project memory extraction, request user confirmation at risk/commit boundaries. MUST NOT silently install hooks / create agents / enable MCP / modify Claude settings / create GitHub repos / bypass role-skill artifacts. → `
|
|
110
|
+
Peaks-Loop Code may identify scenarios, recommend profiles, coordinate role skills via artifacts, coordinate project memory extraction, request user confirmation at risk/commit boundaries. MUST NOT silently install hooks / create agents / enable MCP / modify Claude settings / create GitHub repos / bypass role-skill artifacts. → `boundaries.md`.
|
|
@@ -41,7 +41,7 @@ peaks memory extract --project <repo> --artifact .peaks/_runtime/<sessionId>/txt
|
|
|
41
41
|
|
|
42
42
|
`--apply` is REQUIRED (without it the command only previews — no files land).
|
|
43
43
|
|
|
44
|
-
> **CLI reality check (D-010 sediment, 2026-07-09):** The `<!-- peaks-memory:start -->` block must be followed immediately by a **YAML frontmatter** (`title: ...`, `kind: lesson | decision | convention`) and a `---` separator. Each block must close with `<!-- peaks-memory:end -->`. A
|
|
44
|
+
> **CLI reality check (D-010 sediment, 2026-07-09; warnings added 2026-09-17):** The `<!-- peaks-memory:start -->` block must be followed immediately by a **YAML frontmatter** (`title: ...`, `kind: lesson | decision | convention`) and a `---` separator. Each block must close with `<!-- peaks-memory:end -->`. A marker whose body lacks those fields produces no `plannedWrites`, so `extractedCount` stays 0 — and the CLI now says why: the rejected block is named, with the failed precondition, in the envelope's `warnings[]`. The same channel catches a marker that is not the exact literal (e.g. a `kind=…` written inside it), which `warnings` reports as "… is not the exact marker …". Read `warnings` before treating `extractedCount: 0` as "there was no block" — but note the warning reports the loss, it does not recover it: fix the marker and re-run.
|
|
45
45
|
|
|
46
46
|
### 11d — Gate C (zero-write outcome)
|
|
47
47
|
|
|
@@ -87,5 +87,5 @@ The artifact-scoped extract is canonical; the batch-scoped sibling is for non-ha
|
|
|
87
87
|
|
|
88
88
|
## Related
|
|
89
89
|
|
|
90
|
-
- `
|
|
91
|
-
- `
|
|
90
|
+
- `runbook.md` §Step 11 — full bash + flow.
|
|
91
|
+
- `project-memory-loading.md` — Step 2.3 memory loading (read-side).
|
|
@@ -315,9 +315,10 @@ reply. The two surfaces are not redundant — the field is for
|
|
|
315
315
|
downstream tooling, the prose is for the human. Same payload,
|
|
316
316
|
different readers.
|
|
317
317
|
|
|
318
|
-
**Regression guard**:
|
|
319
|
-
|
|
320
|
-
|
|
318
|
+
**Regression guard**: none. The unit test that parsed the same SKILL.md
|
|
319
|
+
text and asserted the G11.5 paragraph is present was deleted in
|
|
320
|
+
`f17aa377`; do not delete the heading — convention is the only thing
|
|
321
|
+
holding it now.
|
|
321
322
|
|
|
322
323
|
---
|
|
323
324
|
|
|
@@ -379,7 +380,7 @@ When writing a SKILL.md that fans out sub-agents:
|
|
|
379
380
|
- `.peaks/memory/sub-agent-resource-lifecycle-red-line.md` (G5 red line)
|
|
380
381
|
- `.peaks/memory/sub-agent-heartbeat-progress-red-line.md` (G6 red line)
|
|
381
382
|
- `skills/peaks-code/references/swarm-dispatch-contract.md` (predecessor contract)
|
|
382
|
-
- `skills/peaks-qa/references/qa-fanout-contract.md` (QA-specific fan-out)
|
|
383
|
+
- `skills/bee/peaks-qa/references/qa-fanout-contract.md` (QA-specific fan-out)
|
|
383
384
|
|
|
384
385
|
---
|
|
385
386
|
|
|
@@ -404,7 +405,7 @@ peaks sub-agent dispatch <role> \
|
|
|
404
405
|
|
|
405
406
|
Then the LLM takes `data.toolCall` from the envelope (a `{name, args}` descriptor), looks up the tool by `name` in its environment, and invokes it with `args` — IDE-private, no SKILL.md hardcoding.
|
|
406
407
|
|
|
407
|
-
The role's required artefact paths (also see peaks-ui/rd/qa SKILL.md and `
|
|
408
|
+
The role's required artefact paths (also see peaks-ui/rd/qa SKILL.md and `swarm-dispatch-contract.md`):
|
|
408
409
|
|
|
409
410
|
| Role | Writes | Reads (PRD-side) |
|
|
410
411
|
|---|---|---|
|
|
@@ -433,7 +434,7 @@ The role's required artefact paths (also see peaks-ui/rd/qa SKILL.md and `refere
|
|
|
433
434
|
`verdict: blocked-by-orchestrator-policy` and explain. Do NOT commit
|
|
434
435
|
yourself even in emergencies.
|
|
435
436
|
```
|
|
436
|
-
- **Do write heartbeats** — call `peaks sub-agent heartbeat --record <dispatchRecordPath> --status running --progress <pct> --note "<text>"` at least every 30s (see `
|
|
437
|
+
- **Do write heartbeats** — call `peaks sub-agent heartbeat --record <dispatchRecordPath> --status running --progress <pct> --note "<text>"` at least every 30s (see `sub-agent-dispatch.md` §G6 for the full contract). The parent Dispatcher uses these to render the live status line during the wait.
|
|
437
438
|
|
|
438
439
|
After every sub-agent dispatch returns, Code **restores presence** once (not per-agent), then continues to Gate B verification:
|
|
439
440
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
> rules. As of 2.8.4 the `'serial'` opt-out was removed by user
|
|
16
16
|
> direction — single-sub-agent dispatch is no longer permitted when
|
|
17
17
|
> ≥ 2 leaves exist at one topological level (see
|
|
18
|
-
> `
|
|
18
|
+
> `fanout-mandatory.md`).
|
|
19
19
|
|
|
20
20
|
The Swarm phase is the **default** for any DAG with ≥ 2 leaves at
|
|
21
21
|
the same topological level. Code derives the fan-out set from the
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> **Maintenance**: This reference holds the canonical contract for (a) how Code sequences the 11 workflow steps, (b) which `--type` to pass to `peaks request init` for which slice shape, and (c) the executable `ls` / `grep` gate commands that physically block progression. SKILL.md keeps the narrative ("what peaks-code does"); this file keeps the contract.
|
|
4
4
|
>
|
|
5
|
-
> **Why extracted from SKILL.md**: this content is 165 lines of mostly-tabular + bash-block contract — reference data, not orchestration prose. Inlining it bloats SKILL.md past the 800-line cap (per
|
|
5
|
+
> **Why extracted from SKILL.md**: this content is 165 lines of mostly-tabular + bash-block contract — reference data, not orchestration prose. Inlining it bloats SKILL.md past the 800-line cap (per `.peaks/standards/common/coding-style.md`). The numbers, gate command shapes, and type-classification rules change rarely; the SKILL.md prose around them (orchestration flow, repair-loop intent, swarm fan-out shape) changes more often.
|
|
6
6
|
>
|
|
7
7
|
> **How peaks-loop tooling reads this file**:
|
|
8
8
|
> - `peaks skill runbook peaks-code` (CLI) and the in-line LLM reading the SKILL.md should reference this file when the gate-machine or type-classification contract is in play.
|
|
9
|
-
> -
|
|
9
|
+
> - No test reads this file, so nothing detects drift between it and the SKILL.md prose. The test that once checked the runbook fallback was deleted in `f17aa377`.
|
|
10
10
|
|
|
11
11
|
## Peaks-Loop Request type classification (MANDATORY before `peaks request init`)
|
|
12
12
|
|
|
@@ -30,7 +30,7 @@ When Peaks-Loop Code coordinates development in a code repository, keep this ord
|
|
|
30
30
|
0. **Peaks-Loop Snapshot** — `peaks doctor` + `peaks project dashboard` to capture baseline state before anything else;
|
|
31
31
|
0.5. **Peaks-Loop Workspace initialization** — `.peaks/_runtime/<session-id>/` created, directory structure verified;
|
|
32
32
|
0.6. **Peaks-Loop Project scan** — archetype, component library, CSS framework, build tool, state management, routing, data fetching, legacy signals detected and recorded to `.peaks/project-scan/project-scan.md`;
|
|
33
|
-
0.7. **Peaks-Loop Existing-system extraction** (MANDATORY when archetype ∈ {legacy-frontend, legacy-fullstack, frontend-monorepo}; SKIP for greenfield) — extract visual tokens and code conventions from the live codebase to `.peaks/_runtime/<session-id>/system/existing-system.md`. The path lives under `system/` (not `ui/`) because the file also records non-UI conventions (service-layer signatures, hooks, naming) that backend-only or legacy-fullstack work consumes. See `
|
|
33
|
+
0.7. **Peaks-Loop Existing-system extraction** (MANDATORY when archetype ∈ {legacy-frontend, legacy-fullstack, frontend-monorepo}; SKIP for greenfield) — extract visual tokens and code conventions from the live codebase to `.peaks/_runtime/<session-id>/system/existing-system.md`. The path lives under `system/` (not `ui/`) because the file also records non-UI conventions (service-layer signatures, hooks, naming) that backend-only or legacy-fullstack work consumes. See `existing-system-extraction.md`. UI design-draft and RD implementation MUST treat the extracted tokens and conventions as hard constraints;
|
|
34
34
|
1. **Peaks-Loop Standards preflight** — `peaks standards init/update --dry-run`, must reference concrete project-scan findings (never emit generic templates);
|
|
35
35
|
2. **Peaks-Loop PRD phase** — capture request as canonical artifact, extract scope and acceptance criteria:
|
|
36
36
|
- Full-auto/Swarm: auto-transition to `confirmed-by-user` once the artifact is complete;
|
|
@@ -23,7 +23,7 @@ The 3 layers stack. L3 is the strongest because it operates BELOW the LLM's tool
|
|
|
23
23
|
## L1 — Sub-agent system prompt
|
|
24
24
|
|
|
25
25
|
The explicit `MUST NOT` block lives in:
|
|
26
|
-
-
|
|
26
|
+
- `../../bee/peaks-rd/references/rd-sub-agent-dispatch.md`
|
|
27
27
|
- `peaks-qa/...`
|
|
28
28
|
- `peaks-ui/...`
|
|
29
29
|
- `peaks sub-agent dispatch` CLI prompt template
|
|
@@ -41,7 +41,7 @@ denied again after a long pause. That is the gate resetting, not you regressing.
|
|
|
41
41
|
|
|
42
42
|
> **Read once at the top of this file; the rest of the skill is written against it.**
|
|
43
43
|
|
|
44
|
-
The `.peaks/` workspace is partitioned by a **single scope axis** (session-id, at `.peaks/_runtime/<sessionId>/...`) with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. Use `<sessionId>` placeholders (NEVER bare `<sid>`). The peaks-loop change-id axis was removed in slice `2026-06-29-change-id-root-removal`; reviewable artifacts now live under `.peaks/_runtime/<sessionId>/<role>/...` only. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched. CLI mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`.
|
|
44
|
+
The `.peaks/` workspace is partitioned by a **single scope axis** (session-id, at `.peaks/_runtime/<sessionId>/...`) with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. Use `<sessionId>` placeholders (NEVER bare `<sid>`). The peaks-loop change-id axis was removed in slice `2026-06-29-change-id-root-removal`; reviewable artifacts now live under `.peaks/_runtime/<sessionId>/<role>/...` only. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched. CLI mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`. Normative by documentation only — the guard that once asserted (a) zero bare `<sid>`, (b) an axis label on every runtime path, and (c) this callout's presence was deleted in `457b9a87`. Comply by convention.
|
|
45
45
|
|
|
46
46
|
# Peaks-Loop Final Review
|
|
47
47
|
|
|
@@ -80,7 +80,7 @@ The service is the **gate primitive** that closes the 10% human / 90% LLM loop.
|
|
|
80
80
|
All of the following MUST be true before invoking this skill:
|
|
81
81
|
|
|
82
82
|
- **RD complete** — implementation merged and the slice boundary recorded at `.peaks/sc/slice-decomposition/<rid>.json` (or `peaks slice check --rid <rid> --json` returns `pass`).
|
|
83
|
-
- **QA complete** — `test-cases` + `test-reports` + `security-findings` + `performance-findings` present under `.peaks/_runtime/<sessionId>/qa/...` and all applicable gates A/A2/A3/A4/B/C/E/F satisfied (per `skills/peaks-qa/references/qa-transition-gates.md`).
|
|
83
|
+
- **QA complete** — `test-cases` + `test-reports` + `security-findings` + `performance-findings` present under `.peaks/_runtime/<sessionId>/qa/...` and all applicable gates A/A2/A3/A4/B/C/E/F satisfied (per `skills/bee/peaks-qa/references/qa-transition-gates.md`).
|
|
84
84
|
- **Security check complete** — slice 025 project-level security test plan executed; no open CRITICAL/HIGH findings.
|
|
85
85
|
- **Performance baseline complete** — slice 025 project-level perf baseline recorded; no regression beyond the agreed threshold.
|
|
86
86
|
- **Approved audit-goal on disk** — `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json` exists and contains `successCriteria` (the service feeds these into the LLM user prompt verbatim).
|
|
@@ -231,5 +231,5 @@ When handing off, emit: rid, `allPass`, `needsAttention[]`, output path, source
|
|
|
231
231
|
| `src/services/audit/audit-goal-service.ts:16` | Line of evidence that `LlmRunner` is reusable across audit + final-review (service-level integration). |
|
|
232
232
|
| `tests/unit/final-review/final-review-service.test.ts` | Service-level unit tests (8 cases: evidence inlining, the no-evidence⇒no-`pass` gate, prompt bounds, plus contract guards). |
|
|
233
233
|
| `docs/superpowers/plans/2026-06-25-slice-topology-multipass-phase-4.md:127` | Phase-4 plan prose (Task 14). |
|
|
234
|
-
| `skills/peaks-qa/SKILL.md` | Upstream QA skill — 4-dim review is downstream of all QA gates. |
|
|
234
|
+
| `skills/bee/peaks-qa/SKILL.md` | Upstream QA skill — 4-dim review is downstream of all QA gates. |
|
|
235
235
|
| `skills/peaks-audit/SKILL.md` | Sibling skill — produces the `audit-goal` JSON that this skill consumes. |
|
|
@@ -44,9 +44,10 @@ node scripts/peaks-ide-audit-log.mjs --project <repo> --event <name> --adapter <
|
|
|
44
44
|
The log file path is `<projectRoot>/.peaks/audit/peaks-ide-<UTC-date>.log`
|
|
45
45
|
and is gitignored per the repo root `.gitignore` (`.peaks/audit/`).
|
|
46
46
|
|
|
47
|
-
## Contract
|
|
47
|
+
## Contract
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
No test pins this — the suite that asserted the 4 sub-cases below (per
|
|
50
|
+
AC-5) was deleted in `f17aa377`. They remain the contract: helper is at
|
|
51
|
+
the documented path, write emits one JSONL line with
|
|
52
|
+
`timestamp + event + adapter + ok`, the log path is in `.gitignore`,
|
|
52
53
|
and `--dry-run` returns the would-be line without writing.
|
|
@@ -110,6 +110,6 @@ Then tell the user: "Resuming from `<gate>`. The main peaks-code skill will take
|
|
|
110
110
|
|
|
111
111
|
## Cross-references
|
|
112
112
|
|
|
113
|
-
- The detection logic is canonical at `tests/fixtures/skill-resume-mode-detect.sh` (added in slice 003).
|
|
113
|
+
- The detection logic is canonical at `tests/fixtures/skill-resume-mode-detect.sh` (added in slice 003). Nothing covers the classification outcomes in unit tests today — the 8-case suite was deleted in `f17aa377`.
|
|
114
114
|
- The SKILL.md prose at `skills/peaks-code/SKILL.md` Step 0.7 (added in slice 003) is the same logic, written for LLM consumption. This wrapper reuses the same script — there is no parallel implementation.
|
|
115
115
|
- The "drives a CLI on the user's behalf" pattern (mirror of `peaks-sop`) is the closest existing precedent for this wrapper.
|
|
@@ -41,7 +41,7 @@ denied again after a long pause. That is the gate resetting, not you regressing.
|
|
|
41
41
|
|
|
42
42
|
> **Read once at the top of this file; the rest of the skill is written against it.**
|
|
43
43
|
|
|
44
|
-
The `.peaks/` workspace is partitioned by a **single scope axis** (session-id, at `.peaks/_runtime/<sessionId>/...`) with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. Use `<sessionId>` placeholders (NEVER bare `<sid>`). The peaks-loop change-id axis was removed in slice `2026-06-29-change-id-root-removal`; reviewable artifacts now live under `.peaks/_runtime/<sessionId>/<role>/...` only. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched. CLI mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`.
|
|
44
|
+
The `.peaks/` workspace is partitioned by a **single scope axis** (session-id, at `.peaks/_runtime/<sessionId>/...`) with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. Use `<sessionId>` placeholders (NEVER bare `<sid>`). The peaks-loop change-id axis was removed in slice `2026-06-29-change-id-root-removal`; reviewable artifacts now live under `.peaks/_runtime/<sessionId>/<role>/...` only. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched. CLI mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`. Normative by documentation only — the guard that once asserted (a) zero bare `<sid>`, (b) an axis label on every runtime path, and (c) this callout's presence was deleted in `457b9a87`. Comply by convention.
|
|
45
45
|
|
|
46
46
|
## Read via `SchemaRouter.readResult()` — never parse the file directly
|
|
47
47
|
|
|
@@ -164,7 +164,7 @@ Why: RID-003 SC §3.5 originally specified the CJS guard for `scripts/install-sk
|
|
|
164
164
|
|
|
165
165
|
### Rule 2 — Whitelist fixture sync is NOT collateral (D-009a)
|
|
166
166
|
|
|
167
|
-
When a slice adds a new entry to a **whitelist fixture** (e.g. `
|
|
167
|
+
When a slice adds a new entry to a **whitelist fixture** (a test that asserts an exact set size, e.g. `expect(adapters).toHaveLength(7)`, and must be bumped when the 8th adapter is added), that fixture sync is a **primary task**, not a "by the way" footnote.
|
|
168
168
|
|
|
169
169
|
Mandatory structure for any slice that adds to a known set:
|
|
170
170
|
|
|
@@ -175,8 +175,8 @@ Mandatory structure for any slice that adds to a known set:
|
|
|
175
175
|
|---|---|---|
|
|
176
176
|
| T-1 | `src/services/ide/ide-types.ts` | Add `'zcode'` to IdeId |
|
|
177
177
|
| T-2 | `src/services/ide/ide-registry.ts` | Register ZCODE_ADAPTER |
|
|
178
|
-
| T-3 |
|
|
179
|
-
| T-4 |
|
|
178
|
+
| T-3 | the adapter-registry whitelist fixture | Update whitelist: 7 → 8 adapters, add 'zcode' |
|
|
179
|
+
| T-4 | the install-skills platform whitelist fixture | Update whitelist: 5 → 6 platforms, add 'zcode' |
|
|
180
180
|
```
|
|
181
181
|
|
|
182
182
|
If you find a whitelist fixture during execution but didn't pre-list it as a task, treat it as a **NEW TASK** and run the SC ↔ QA repair loop, not as "necessary collateral". Pre-listing prevents surprises at Gate 1.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Cross-pass edge interpretation
|
|
2
2
|
|
|
3
|
-
Source of truth: `src/services/slice/cross-pass-edge-merger.ts` (`merge` function) + `src/services/slice/llm-arbitrator.ts` (`arbitrate`). Read this together with `
|
|
3
|
+
Source of truth: `src/services/slice/cross-pass-edge-merger.ts` (`merge` function) + `src/services/slice/llm-arbitrator.ts` (`arbitrate`). Read this together with `v2-schema.md` for the field-level definitions.
|
|
4
4
|
|
|
5
5
|
## What is a `CrossPassEdge`
|
|
6
6
|
|
|
@@ -61,7 +61,7 @@ The function returns one of three branches:
|
|
|
61
61
|
|
|
62
62
|
### Tie-break behavior
|
|
63
63
|
|
|
64
|
-
`auto` mode does NOT itself consult the LLM — the `'tie-break'` branch only signals that the workUnit is borderline. The actual LLM call happens during cross-pass edge detection in `cross-pass-edge-merger.ts` (see `
|
|
64
|
+
`auto` mode does NOT itself consult the LLM — the `'tie-break'` branch only signals that the workUnit is borderline. The actual LLM call happens during cross-pass edge detection in `cross-pass-edge-merger.ts` (see `cross-pass-edge-interpretation.md`). The merge step may add an `llm-arbitrated` edge even when the parent was subdivided as `'tie-break'`.
|
|
65
65
|
|
|
66
66
|
## `auto` decision tree
|
|
67
67
|
|
|
@@ -76,7 +76,7 @@ The CLI serialises via `SchemaRouter.writeResult()` → `JSON.stringify(result,
|
|
|
76
76
|
| `toPass` | `PassNumber` | The lower (finer) pass number. Always `fromPass < toPass`. |
|
|
77
77
|
| `fromSliceId` | `string` | Slice id in `fromPass`. |
|
|
78
78
|
| `toSliceId` | `string` | Slice id in `toPass`. |
|
|
79
|
-
| `kind` | `CrossPassEdgeKind` (`'type-shares' \| 'fixture-shares' \| 'import-re-export' \| 'llm-arbitrated'`) | See `
|
|
79
|
+
| `kind` | `CrossPassEdgeKind` (`'type-shares' \| 'fixture-shares' \| 'import-re-export' \| 'llm-arbitrated'`) | See `cross-pass-edge-interpretation.md`. |
|
|
80
80
|
| `confidence` | `EdgeConfidence \| 'llm'` | `'llm'` only when `kind === 'llm-arbitrated'`. Structural detectors emit `'structural'`. |
|
|
81
81
|
| `evidence` | `string` | Human-readable: the import line, the shared fixture id, or `llm:<callId>: <reason>` for LLM edges. |
|
|
82
82
|
| `arbitratedBy` | `string \| null` | The `LlmArbitration.callId` that produced this edge, or `null` for static-detected edges. |
|
|
@@ -140,6 +140,6 @@ Any future schema change MUST:
|
|
|
140
140
|
2. Extend `SchemaRouter.readResult()` to accept and dispatch it.
|
|
141
141
|
3. Bump `DecompositionResultV3.schemaVersion: 'v3'`.
|
|
142
142
|
4. Keep the v2 reader path intact (no in-place rewrite of v2 files).
|
|
143
|
-
5. Update this reference + add a
|
|
143
|
+
5. Update this reference + add a sibling v3 schema reference next to it.
|
|
144
144
|
|
|
145
145
|
In-place edits to v1/v2 fields are forbidden: any consumer that already wrote a v2 file expects its schema to remain stable.
|
|
@@ -247,6 +247,5 @@ peaks-solo 是 dispatcher,**不**是 orchestrator,**不**是 implementer。下
|
|
|
247
247
|
- `references/triage-decision-table.md` — 关键词 → leaf skill 完整映射表(≥ 10 行)
|
|
248
248
|
- `references/fallback-tool-inventory.md` — 自规划允许 + 禁止工具清单
|
|
249
249
|
- `references/sediment-prompt-template.md` — 4-option AskUserQuestion 沉淀模板
|
|
250
|
-
- spec: `docs/
|
|
251
|
-
- plan: `docs/superpowers/plans/2026-07-08-peaks-solo-dispatcher/s1-peaks-solo-skill.md`
|
|
250
|
+
- spec / plan: the `2026-07-08-peaks-solo-dispatcher` design + plan docs were retired in `e6e35842`; the surviving record of that slice is `.peaks/memory/2026-07-08-peaks-solo-dogfood.md` and the decision memo below.
|
|
252
251
|
- decision memo: `.peaks/memory/user-decision-2026-07-08-revive-peaks-solo-as-dispatcher.md`
|