peaks-loop 4.0.21 → 4.0.24
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 +109 -0
- package/dist/cli/commands/_register.js +2 -1
- package/dist/cli/commands/best-practice-scan-command.d.ts +36 -0
- package/dist/cli/commands/best-practice-scan-command.js +118 -0
- package/dist/cli/commands/request-commands.js +21 -9
- package/dist/services/best-practice/language-detector.d.ts +7 -0
- package/dist/services/best-practice/language-detector.js +96 -0
- package/dist/services/best-practice/output-formatter.d.ts +41 -0
- package/dist/services/best-practice/output-formatter.js +116 -0
- package/dist/services/best-practice/scan-orchestrator.d.ts +39 -0
- package/dist/services/best-practice/scan-orchestrator.js +85 -0
- package/dist/services/context/collector.d.ts +5 -12
- package/dist/services/context/context-builder.d.ts +12 -20
- package/dist/services/context/context-builder.js +1 -1
- package/dist/services/context/context-schema.d.ts +51 -364
- package/dist/services/context/context-schema.js +3 -3
- package/dist/services/crystallization/crystallization-service.d.ts +2 -12
- package/dist/services/crystallization/crystallization-service.js +3 -9
- package/dist/services/crystallization/crystallization-types.d.ts +45 -153
- package/dist/services/crystallization/crystallization-types.js +17 -11
- package/dist/services/crystallization/evidence-brief-builder.d.ts +12 -112
- package/dist/services/evolution/evolution-types.d.ts +83 -497
- package/dist/services/evolution/evolution-types.js +6 -10
- package/dist/services/fixture/fixture-sanitize-service.d.ts +10 -36
- package/dist/services/fixture/fixture-sanitize-service.js +1 -1
- package/dist/services/job/job-progress-store.d.ts +1 -17
- package/dist/services/job/job-progress-store.js +2 -2
- package/dist/services/job/job-types.d.ts +63 -370
- package/dist/services/job/job-types.js +46 -11
- package/dist/services/loop/loop-bee-relation-types.d.ts +20 -32
- package/dist/services/loop/loop-bee-relation-types.js +2 -2
- package/dist/services/loop/loop-release-types.d.ts +31 -110
- package/dist/services/migrate-skill-name/schema.d.ts +3 -19
- package/dist/services/migrate-skill-name/schema.js +4 -4
- package/dist/services/observability/observability-service.d.ts +21 -19
- package/dist/services/observability/observability-service.js +1 -1
- package/dist/services/prd/best-practice-auto-trigger.d.ts +61 -0
- package/dist/services/prd/best-practice-auto-trigger.js +126 -0
- package/dist/services/rd/types.d.ts +25 -194
- package/dist/services/sediment/json-schema.d.ts +39 -224
- package/dist/services/sediment/json-schema.js +2 -2
- package/dist/services/session/binding-store.d.ts +5 -47
- package/dist/services/session/binding-store.js +1 -1
- package/dist/services/share/bundle-types.d.ts +12 -180
- package/dist/services/share/bundle-types.js +15 -9
- package/dist/services/share/run-state-contract.d.ts +8 -25
- package/dist/services/skill/skill-search-service.d.ts +26 -46
- package/dist/services/skill/skill-search-service.js +2 -2
- package/dist/services/skills/hooks-settings-service.d.ts +9 -0
- package/dist/services/skills/hooks-settings-service.js +31 -1
- package/dist/services/skills/skill-presence-service.d.ts +24 -0
- package/dist/services/skills/skill-presence-service.js +33 -0
- package/package.json +8 -8
- package/schemas/context.schema.json +17 -8
- package/skills/bee/peaks-prd/SKILL.md +17 -0
- package/skills/peaks-code/SKILL.md +28 -1
- package/skills/peaks-code/references/skill-presence-and-title.md +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2
3
|
"type": "object",
|
|
3
4
|
"properties": {
|
|
4
5
|
"version": {
|
|
@@ -11,7 +12,8 @@
|
|
|
11
12
|
},
|
|
12
13
|
"generatedAt": {
|
|
13
14
|
"type": "string",
|
|
14
|
-
"format": "date-time"
|
|
15
|
+
"format": "date-time",
|
|
16
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
|
|
15
17
|
},
|
|
16
18
|
"sha256": {
|
|
17
19
|
"type": "string",
|
|
@@ -39,7 +41,8 @@
|
|
|
39
41
|
},
|
|
40
42
|
"lines": {
|
|
41
43
|
"type": "integer",
|
|
42
|
-
"minimum": 0
|
|
44
|
+
"minimum": 0,
|
|
45
|
+
"maximum": 9007199254740991
|
|
43
46
|
},
|
|
44
47
|
"hash": {
|
|
45
48
|
"type": "string"
|
|
@@ -105,6 +108,9 @@
|
|
|
105
108
|
},
|
|
106
109
|
"deps": {
|
|
107
110
|
"type": "object",
|
|
111
|
+
"propertyNames": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
108
114
|
"additionalProperties": {
|
|
109
115
|
"type": "object",
|
|
110
116
|
"properties": {
|
|
@@ -166,7 +172,8 @@
|
|
|
166
172
|
},
|
|
167
173
|
"fetchedAt": {
|
|
168
174
|
"type": "string",
|
|
169
|
-
"format": "date-time"
|
|
175
|
+
"format": "date-time",
|
|
176
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
|
|
170
177
|
},
|
|
171
178
|
"contentHash": {
|
|
172
179
|
"type": "string"
|
|
@@ -181,7 +188,8 @@
|
|
|
181
188
|
},
|
|
182
189
|
"tokenEstimate": {
|
|
183
190
|
"type": "integer",
|
|
184
|
-
"minimum": 0
|
|
191
|
+
"minimum": 0,
|
|
192
|
+
"maximum": 9007199254740991
|
|
185
193
|
},
|
|
186
194
|
"excerpt": {
|
|
187
195
|
"type": "string"
|
|
@@ -319,11 +327,13 @@
|
|
|
319
327
|
},
|
|
320
328
|
"renderedAt": {
|
|
321
329
|
"type": "string",
|
|
322
|
-
"format": "date-time"
|
|
330
|
+
"format": "date-time",
|
|
331
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
|
|
323
332
|
},
|
|
324
333
|
"sizeBytes": {
|
|
325
334
|
"type": "integer",
|
|
326
|
-
"minimum": 0
|
|
335
|
+
"minimum": 0,
|
|
336
|
+
"maximum": 9007199254740991
|
|
327
337
|
},
|
|
328
338
|
"truncated": {
|
|
329
339
|
"type": "boolean"
|
|
@@ -355,6 +365,5 @@
|
|
|
355
365
|
"tokenizer",
|
|
356
366
|
"renderer"
|
|
357
367
|
],
|
|
358
|
-
"additionalProperties": false
|
|
359
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
368
|
+
"additionalProperties": false
|
|
360
369
|
}
|
|
@@ -339,3 +339,20 @@ Verify the surface (no need to re-derive):
|
|
|
339
339
|
1. `peaks audit red-lines --project .` reports `proseOnly: 0` for any shipped L2 surface.
|
|
340
340
|
2. `peaks lease-metrics --rate` after a clean run reports `estimatedLeaked: 0`.
|
|
341
341
|
3. `peaks worktree list` returns 0 active leases after a clean run.
|
|
342
|
+
|
|
343
|
+
## Peaks-Loop Step 2.5 sub-step: best-practice scan handoff
|
|
344
|
+
|
|
345
|
+
When peaks-prd's `businessGoal` artifact transitions to `complete` + the sub-step has not
|
|
346
|
+
yet fired for this intent, peaks-prd MUST emit a sub-step handoff to Step 2.5 best-practice
|
|
347
|
+
scan BEFORE transitioning to Step 3 RD.
|
|
348
|
+
|
|
349
|
+
**Handoff contract:**
|
|
350
|
+
- Input: `businessGoal` (natural language) + `.peaks/project-scan/project-scan.md` (auto-generated by `peaks workspace init`)
|
|
351
|
+
- Output: best-practice scan artifact at `.peaks/_runtime/<sessionId>/best-practice/<requestId>.md`
|
|
352
|
+
- Trigger CLI: `peaks best-practice-scan --project <repo> --intent "<businessGoal>" --json`
|
|
353
|
+
- Status: `awaiting-user-ack` (3 valid user responses per spec §7: 接受 / 接受方案 N / 拒绝 + 原因)
|
|
354
|
+
|
|
355
|
+
**State machine:** peak-prd's state machine refuses `--allow-incomplete` style bypass for
|
|
356
|
+
this sub-step. Silent auto-accept is NOT allowed — user explicit ack is mandatory.
|
|
357
|
+
|
|
358
|
+
**Reference:** See `skills/peaks-code/SKILL.md` §Step 2.5 for the full sub-step contract.
|
|
@@ -189,7 +189,7 @@ See also: references/session-overload-signal-index.md for the 7-signal lookup ta
|
|
|
189
189
|
| Drift ID | Step | Symptom | Fix | Inline location |
|
|
190
190
|
|---|---|---|---|---|
|
|
191
191
|
| **D-001** | 0.8 | `peaks code detect-job --is-job ...` rejected with `error: unknown option '--is-job'` | Use `peaks job init --job-id <jid> --slice-list <list> --main-loop-strategy <single\|rotating>` | §Step 0.8 first paragraph |
|
|
192
|
-
| **D-002** | 2.5 | `peaks session title --session-id <sid> ...` rejected with `error: unknown option '--session-id'` (this is the bare `<sid>` anti-pattern) | sid is positional: `peaks session title <sessionId> "<title>" --json` | §Step 2.
|
|
192
|
+
| **D-002** | 2.5 | `peaks session title --session-id <sid> ...` rejected with `error: unknown option '--session-id'` (this is the bare `<sid>` anti-pattern) | sid is positional: `peaks session title <sessionId> "<title>" --json` | §Step 2.5a |
|
|
193
193
|
| **D-003** | 0.8 | `JOB_SHAPE_NOT_DECIDED` exception expected but never thrown | Current behavior is `peaks job status` reports `done: 0` passively — treat as recoverable miss, not hard error | §Step 0.8 third paragraph |
|
|
194
194
|
| **D-010** | 11c | `peaks memory extract` returns `extractedCount: 0` despite `<!-- peaks-memory:start -->` existing | Block requires YAML frontmatter (`title:` + `kind:` + `---`) + closing `<!-- peaks-memory:end -->`. Bare `peaks-memory:start` is parsed silently but produces no writes | §Step 11c + 11d |
|
|
195
195
|
|
|
@@ -213,6 +213,33 @@ Before handing off to `peaks-rd`, scan the project and record findings to `.peak
|
|
|
213
213
|
|
|
214
214
|
When the project has no live backend (no swagger.json, no API server), Code must activate frontend-only mode. The CLI is authoritative — read `frontendOnly` and `frontendOnlyReason` from `peaks scan archetype --json`. → `references/frontend-only-mode.md`.
|
|
215
215
|
|
|
216
|
+
## Peaks-Loop Step 2.5: Best-practice scan (BPS) (NEW 2026-08-12)
|
|
217
|
+
|
|
218
|
+
Inserted between current Step 2 (PRD) and Step 3 (RD). Sub-step does a **business-aware,
|
|
219
|
+
language-aware, LLM-recommended best-practice scan** before RD kicks off.
|
|
220
|
+
|
|
221
|
+
**Trigger:** Fires at peak-prd exit when business-goal is non-empty + sub-step not yet
|
|
222
|
+
triggered for this intent.
|
|
223
|
+
|
|
224
|
+
**Action sequence:**
|
|
225
|
+
1. Detect project language (TS / JS / Python / Go / Java) via `language-detector` (5-lang
|
|
226
|
+
priority chain).
|
|
227
|
+
2. Query Context7 (`@upstash/context7-mcp@^4.0.2`, installed as peaks-loop production dep)
|
|
228
|
+
priority-1 with 30s timeout.
|
|
229
|
+
3. WebSearch fallback when Context7 returns empty / errors.
|
|
230
|
+
4. Synthesize 8-row markdown comparison table per `output-formatter`.
|
|
231
|
+
5. LLM picks one recommendation (★ marker) with reasoning block.
|
|
232
|
+
6. **Mandatory ⚠️ catch gate** — user explicitly acks / picks alt / rejects + reason.
|
|
233
|
+
|
|
234
|
+
**Out of scope for this sub-step:**
|
|
235
|
+
- ❌ No changes to RD dispatch Karpathy prose (Step 3 unchanged)
|
|
236
|
+
- ❌ No changes to QA / SC / TXT skills
|
|
237
|
+
- ❌ No new `peaks-best-practice` standalone skill (sub-step inside peaks-prd only)
|
|
238
|
+
- ❌ No framework-knowledge persistent index (future slice)
|
|
239
|
+
|
|
240
|
+
**Reference:** Spec at `.peaks/_runtime/<sessionId>/sc/spec-step-2-5-best-practice-scan.md`
|
|
241
|
+
§4-7. Implementation: `src/cli/commands/best-practice-scan-command.ts` + `src/services/best-practice/`.
|
|
242
|
+
|
|
216
243
|
## Peaks-Loop Request type classification + Workflow order + Transition verification gates
|
|
217
244
|
|
|
218
245
|
The 6-type table + 11-step order + 7 transition gates (A-G) live in `references/workflow-gates-and-types.md`. peaks-code narrative references Gate A-G — keep both files in lockstep.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Step 2 + 2.
|
|
1
|
+
# Step 2 + 2.5a — Skill presence and session title
|
|
2
2
|
|
|
3
|
-
> Combined body for `### Peaks-Loop Step 2: Re-set skill presence with the chosen mode` and `### Peaks-Loop Step 2.
|
|
3
|
+
> Combined body for `### Peaks-Loop Step 2: Re-set skill presence with the chosen mode` and `### Peaks-Loop Step 2.5a: Set session title`.
|
|
4
4
|
|
|
5
5
|
## Step 2 — Re-set skill presence
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ Then display the compact status header: `Peaks-Loop Skill: peaks-code | Peaks-Lo
|
|
|
20
20
|
|
|
21
21
|
Update with `peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate <gate>` when gates change. The presence file persists across the full workflow lifecycle — clear is owned by workflow terminalize; follow-up workflows re-claim via new workflow init.
|
|
22
22
|
|
|
23
|
-
## Step 2.
|
|
23
|
+
## Step 2.5a — Set session title
|
|
24
24
|
|
|
25
25
|
Extract a short (8-20 Chinese characters, or 4-10 English words) descriptive title from the user's first request. The title should capture the core task — e.g. "修复登录页OAuth回调异常", "添加暗色模式开关", "搭建项目基础架构". Then run:
|
|
26
26
|
|