peaks-loop 4.0.53 → 4.0.54
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 +49 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/commands/codegraph-commands.js +164 -5
- package/dist/cli/commands/core/memory-command.js +35 -2
- package/dist/cli/commands/dispatch-commands.js +4 -2
- package/dist/cli/commands/prd-commands.js +15 -0
- package/dist/cli/commands/sub-agent-shared.d.ts +23 -0
- package/dist/cli/commands/sub-agent-shared.js +39 -0
- package/dist/services/artifacts/artifact-prerequisites.js +34 -0
- package/dist/services/audit/enforcer-liveness.js +1 -1
- package/dist/services/codegraph/codegraph-config-repair-writer.d.ts +44 -0
- package/dist/services/codegraph/codegraph-config-repair-writer.js +112 -13
- package/dist/services/codegraph/codegraph-exclude-repair.d.ts +23 -1
- package/dist/services/codegraph/codegraph-exclude-repair.js +6 -0
- package/dist/services/evidence/evidence-generator.js +11 -3
- package/dist/services/memory/project-memory-service/index.d.ts +1 -1
- package/dist/services/memory/project-memory-service/index.js +1 -1
- package/dist/services/memory/project-memory-service/store/atomic-write.d.ts +59 -0
- package/dist/services/memory/project-memory-service/store/atomic-write.js +167 -7
- package/dist/services/prd/gate-evidence-derivation.d.ts +160 -0
- package/dist/services/prd/gate-evidence-derivation.js +270 -0
- package/dist/services/prd/handoff-auto-regen.js +13 -1
- package/dist/services/prd/handoff-frontmatter.d.ts +1 -1
- package/dist/services/prd/handoff-frontmatter.js +62 -0
- package/dist/services/prd/handoff-gate-evidence.d.ts +95 -1
- package/dist/services/prd/handoff-gate-evidence.js +125 -57
- package/dist/services/prd/handoff-service.d.ts +21 -1
- package/dist/services/prd/handoff-service.js +45 -2
- package/dist/services/prd/handoff-types.d.ts +40 -0
- package/dist/services/prd/handoff-types.js +28 -1
- package/dist/services/prd/project-scan-reader.d.ts +7 -0
- package/dist/services/prd/project-scan-reader.js +7 -1
- package/dist/services/rd/reviewer-dispatch-policy.d.ts +36 -8
- package/dist/services/rd/reviewer-dispatch-policy.js +36 -8
- package/package.json +6 -6
- package/skills/bee/peaks-rd/SKILL.md +1 -1
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +26 -10
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +1 -1
- package/skills/bee/peaks-rd/references/writing-handoff-frontmatter.md +6 -1
- package/skills/peaks-code/references/periodic-checkpoint.md +7 -5
- package/skills/peaks-code/references/startup-sequence.md +1 -1
- package/skills/peaks-final-review/SKILL.md +1 -1
- /package/{docs → contracts}/test-style-contract.md +0 -0
|
@@ -20,10 +20,12 @@ end of implementation, RD fires 3 sub-agents in parallel via
|
|
|
20
20
|
> `.peaks/project-scan/{security-template, perf-template, audit-output-schema}.md`.
|
|
21
21
|
> The handoff presence is enforced by the `AUDIT_REQUIRES_HANDOFF` prereq.
|
|
22
22
|
> The 1-minor-release back-compat window (`v2.12.0`) keeps the old
|
|
23
|
-
> `rd/{security-review,perf-baseline}.md` paths readable via
|
|
23
|
+
> `rd/{security-review,perf-baseline}.md` paths readable via
|
|
24
|
+
> `legacyRelativePaths` —
|
|
24
25
|
> see `RD_DEPRECATED_REVIEWERS` in
|
|
25
26
|
> `src/services/rd/reviewer-dispatch-policy.ts`. The two unit tests that
|
|
26
|
-
> once pinned this were deleted in `f17aa377
|
|
27
|
+
> once pinned this were deleted in `f17aa377`; see §"Deprecated reviewer
|
|
28
|
+
> back-compat" for which half has been re-pinned since and which has not.
|
|
27
29
|
|
|
28
30
|
## The 3 sub-agents
|
|
29
31
|
|
|
@@ -72,15 +74,16 @@ end of implementation, RD fires 3 sub-agents in parallel via
|
|
|
72
74
|
> - ~~Sub-agent — security-reviewer~~ — moved to standalone
|
|
73
75
|
> `peaks-security-audit` skill; output `audit/security-<rid>.md`. The legacy
|
|
74
76
|
> path `.peaks/_runtime/<sessionId>/rd/security-review.md` remains
|
|
75
|
-
> readable via `
|
|
77
|
+
> readable via `legacyRelativePaths` for the v2.12.0 1-minor-release window.
|
|
76
78
|
> - ~~Sub-agent — perf-baseline-reviewer~~ — moved to standalone
|
|
77
79
|
> `peaks-perf-audit` skill; output `audit/perf-<rid>.md`. The legacy path
|
|
78
80
|
> `.peaks/_runtime/<sessionId>/rd/perf-baseline.md` remains readable
|
|
79
|
-
> via `
|
|
81
|
+
> via `legacyRelativePaths` for the v2.12.0 1-minor-release window.
|
|
80
82
|
>
|
|
81
83
|
> See `RD_DEPRECATED_REVIEWERS` in
|
|
82
84
|
> `src/services/rd/reviewer-dispatch-policy.ts`. The unit test that once
|
|
83
|
-
> pinned this was deleted in `f17aa377
|
|
85
|
+
> pinned this was deleted in `f17aa377`; see §"Deprecated reviewer
|
|
86
|
+
> back-compat" for what replaced it.
|
|
84
87
|
|
|
85
88
|
## Hard prohibitions on all 3 sub-agents (single block)
|
|
86
89
|
|
|
@@ -199,13 +202,26 @@ failing the gate.
|
|
|
199
202
|
- **Legacy review artifact paths**
|
|
200
203
|
(`.peaks/_runtime/<sessionId>/rd/security-review.md`,
|
|
201
204
|
`.peaks/_runtime/<sessionId>/rd/perf-baseline.md`) are accepted via
|
|
202
|
-
`
|
|
205
|
+
`legacyRelativePaths` on the `AUDIT_SECURITY` / `AUDIT_PERF` prereqs
|
|
203
206
|
during the back-compat window. v2.13.0 hard-deletes the legacy paths.
|
|
204
207
|
|
|
205
|
-
**Pinning
|
|
206
|
-
`RD_DEPRECATED_REVIEWERS`
|
|
207
|
-
`
|
|
208
|
-
|
|
208
|
+
**Pinning — half of it.** The **predicate half**
|
|
209
|
+
(`RD_DEPRECATED_REVIEWERS` + `isDeprecatedReviewer`) is pinned by
|
|
210
|
+
`tests/unit/rd/reviewer-dispatch-policy.test.ts` (`7191140f`, 6 cases), and
|
|
211
|
+
its dispatch-side *use* by
|
|
212
|
+
`tests/unit/cli/sub-agent-dispatch-deprecated-reviewer.test.ts`
|
|
213
|
+
(slice F2, `rid-f2-ac1-wiring`) — that one drives the real dispatch action
|
|
214
|
+
and fails if the reroute notice stops being emitted.
|
|
215
|
+
|
|
216
|
+
The **decision-table half** (`RD_FANOUT_REVIEWERS`' 3-element membership,
|
|
217
|
+
`reviewerListFor`, `karpathySlotIndex`, `shouldDispatchKarpathy`) has **no
|
|
218
|
+
pin**: the file that carried it was deleted in `f17aa377` and was not
|
|
219
|
+
replaced. The routing + legacy-path acceptance live in
|
|
220
|
+
`src/services/rd/reviewer-dispatch-policy.ts`; the module had **no caller
|
|
221
|
+
at all** until slice F2 wired `deprecatedReviewerWarnings`
|
|
222
|
+
(`src/cli/commands/sub-agent-shared.ts`) into the dispatch chokepoint. The
|
|
223
|
+
dispatch side therefore ACCEPTS the legacy slot and warns, rather than
|
|
224
|
+
refusing — matching the prereq-side acceptance above.
|
|
209
225
|
|
|
210
226
|
## Gate C evidence (RD-side, type-specific)
|
|
211
227
|
|
|
@@ -109,7 +109,7 @@ Any RD/QA/SC sub-agent dispatched by `peaks sub-agent dispatch --from-dag` (or b
|
|
|
109
109
|
|
|
110
110
|
**Where the orchestrator reads the values from**: `data.orchestratorVisibleHint` (one line, copy verbatim) and `data.artifactsPublicPaths` (the public list of artifact paths the sub-agent will own). The CLI fills these in; the orchestrator just transcribes.
|
|
111
111
|
|
|
112
|
-
**Regression guard**:
|
|
112
|
+
**Regression guard**: `tests/unit/skills/g11-5-title-lock.test.ts` — it pins this file's G11.5 heading and the `⏳ Spawning sub-agent via Task tool: <description>` form. The original guard (the unit test that parsed `rd-sub-agent-dispatch.md` and asserted the G11.5 heading is present) was deleted in `f17aa377`; the pin was restored in slice D2 (2026-09-18), which found that the AC-3 title-lock had covered only the peaks-code sibling of this file. Do not delete the heading.
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
|
@@ -42,6 +42,7 @@ schemaVersion: '2.0'
|
|
|
42
42
|
---
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
> The `gateEvidence` block above is the **feature-shaped** set, shown because it is the largest one. It is not a template to copy by hand: the producer derives the block from the request `type` (see the `gateEvidence` rule below), so a `config` slice's carries two keys and a `docs` / `chore` slice's capsule carries no such block at all.
|
|
45
46
|
## Field rules
|
|
46
47
|
|
|
47
48
|
- `requestId` — kebab-case; matches the PRD `requestId`.
|
|
@@ -50,7 +51,11 @@ schemaVersion: '2.0'
|
|
|
50
51
|
- `decisions[]` — every decision an LLM made that an implementer could question. `id` is local; `summary` is one line; `rationale` is ≤ 2 sentences.
|
|
51
52
|
- `risks[]` — same shape; `mitigation` is required. A risk without a mitigation is a red line (gate blocked).
|
|
52
53
|
- `nextActions[]` — verb-first; what peaks-qa should do next, in order.
|
|
53
|
-
- `gateEvidence` — paths to the gate files peaks-qa will validate.
|
|
54
|
+
- `gateEvidence` — paths to the gate files peaks-qa will validate. **DERIVED, never hand-written**: the producer computes it from the request `type` (`src/services/prd/gate-evidence-derivation.ts`), and Gate C reads the same `rd:qa-handoff` row, so the block and the gate cannot disagree. It declares that row's evidence, plus `projectScan` (Gate A's artifact — declared only where Gate C runs, since a path nothing verifies should not be declared):
|
|
55
|
+
- `feature` / `refactor` / `bugfix` → **5 keys**: `projectScan`, `prdHandoff`, `codeReview`, `securityReview`, `perfBaseline`
|
|
56
|
+
- `config` → **2 keys**: `projectScan`, `securityReview`. `CONFIG_TABLE['rd:qa-handoff']` is the security review alone, so a config slice has **no** `prdHandoff`; and its security evidence is the genuinely ridless `rd/security-review.md`, not `audit/security-<rid>.md`.
|
|
57
|
+
- `docs` / `chore` → **no `gateEvidence` block at all**. Those types have no `rd:qa-handoff` row: there is no evidence to declare and nothing for Gate C to check, so the block is omitted rather than filled with an unverified statement. Such a capsule is byte-identical to a pre-B2 one.
|
|
58
|
+
**The Gate C failure rule is scoped to the types above** — where that gate runs: a declared path that does not exist fails `peaks request transition --state qa-handoff` (`PREREQUISITES_MISSING`), naming the key. Two shapes are deliberately NOT failures: a capsule for a type with no `rd:qa-handoff` row (the check does not run), and an **empty** declaration (`gateEvidence: {}`) — a weak claim, not a false one, since the type's artifacts remain enforced by the table itself, so an empty map cannot open the gate. When the request type cannot be resolved at all, the block is omitted rather than half-declared.
|
|
54
59
|
- `schemaVersion: '2.0'` — pinned (bumped from `'1.0'` in v2.11.0); bump only when the field set changes.
|
|
55
60
|
|
|
56
61
|
> **v2.11.0 Group A change:** `schemaVersion` was bumped to `'2.0'`. The consumers listed under §Validation anchor on that value, so a file still carrying `'1.0'` is rejected at read time.
|
|
@@ -20,14 +20,16 @@ checkpoint as often as it wants.
|
|
|
20
20
|
|
|
21
21
|
> **Slice 2026-06-24-efficiency-4p-bundle / G1 (P0.1) — frequency lock**:
|
|
22
22
|
> The `--reason periodic` row above is hard-locked at **20 tool calls**.
|
|
23
|
-
> The threshold is a textual contract between
|
|
24
|
-
> this reference doc; the LLM runner is expected to
|
|
25
|
-
> `peaks session checkpoint --reason periodic` once every 20 tool calls
|
|
23
|
+
> The threshold is a textual contract between `startup-sequence.md` (Step N:
|
|
24
|
+
> Periodic checkpoint) and this reference doc; the LLM runner is expected to
|
|
25
|
+
> fire `peaks session checkpoint --reason periodic` once every 20 tool calls
|
|
26
26
|
> (i.e. on each 20-call mark, not "approximately every 20"). The CLI
|
|
27
27
|
> does **not** expose a `--periodic-every <n>` override flag — the
|
|
28
28
|
> cadence is owned by the skill, not the CLI. Any patch that relaxes
|
|
29
|
-
> this must update both files in lockstep
|
|
30
|
-
>
|
|
29
|
+
> this must update both files in lockstep —
|
|
30
|
+
> `tests/unit/skills/periodic-checkpoint-cadence.test.ts` fails on the
|
|
31
|
+
> drift (it pins the number in both files, the hard-lock wording, and the
|
|
32
|
+
> CLI's lack of the override).
|
|
31
33
|
|
|
32
34
|
## Checkpoint CLI contract
|
|
33
35
|
|
|
@@ -19,7 +19,7 @@ When a NEW conversation opens on a session whose `lastActivity` is from today AN
|
|
|
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 `periodic-checkpoint.md` (
|
|
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` (the cadence is pinned by `tests/unit/skills/periodic-checkpoint-cadence.test.ts`, which fails if either file's number drifts).
|
|
23
23
|
|
|
24
24
|
### Peaks-Loop Step 0.6: Audit + Goal (NEW)
|
|
25
25
|
|
|
@@ -230,6 +230,6 @@ When handing off, emit: rid, `allPass`, `needsAttention[]`, output path, source
|
|
|
230
230
|
| `src/services/final-review/final-review-types.ts` | `FinalReviewOutput`, `DimensionEvidence`, verdict/evidence/confidence enums. |
|
|
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
|
+
| *(retired — no file)* | The Phase-4 plan prose (Task 14) this row used to cite was deleted in `e6e35842`; no file on this tree carries it, and nothing pins it since. |
|
|
234
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. |
|
|
File without changes
|