peaks-cli 1.0.25 → 1.0.26
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.
|
@@ -10,19 +10,36 @@ export function isSkillPresenceMode(value) {
|
|
|
10
10
|
return VALID_SKILL_PRESENCE_MODES.includes(value);
|
|
11
11
|
}
|
|
12
12
|
const PRESENCE_FILE = '.peaks/.active-skill.json';
|
|
13
|
+
const SESSION_FILE = '.peaks/.session.json';
|
|
13
14
|
function resolvePresencePath() {
|
|
14
15
|
return resolve(process.cwd(), PRESENCE_FILE);
|
|
15
16
|
}
|
|
17
|
+
function getCurrentSessionId() {
|
|
18
|
+
const sessionPath = resolve(process.cwd(), SESSION_FILE);
|
|
19
|
+
if (!existsSync(sessionPath))
|
|
20
|
+
return null;
|
|
21
|
+
try {
|
|
22
|
+
const data = JSON.parse(readFileSync(sessionPath, 'utf8'));
|
|
23
|
+
return typeof data.sessionId === 'string' && data.sessionId.length > 0
|
|
24
|
+
? data.sessionId
|
|
25
|
+
: null;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
16
31
|
export function exportSkillPresence() {
|
|
17
32
|
return resolvePresencePath();
|
|
18
33
|
}
|
|
19
34
|
export function setSkillPresence(skill, mode, gate) {
|
|
20
35
|
const validatedMode = mode && isSkillPresenceMode(mode) ? mode : undefined;
|
|
36
|
+
const sessionId = getCurrentSessionId();
|
|
21
37
|
const now = new Date().toISOString();
|
|
22
38
|
const presence = {
|
|
23
39
|
skill,
|
|
24
40
|
...(validatedMode ? { mode: validatedMode } : {}),
|
|
25
41
|
...(gate ? { gate } : {}),
|
|
42
|
+
...(sessionId ? { sessionId } : {}),
|
|
26
43
|
setAt: now,
|
|
27
44
|
lastHeartbeat: now
|
|
28
45
|
};
|
|
@@ -45,6 +62,13 @@ export function getSkillPresence() {
|
|
|
45
62
|
if (typeof parsed?.skill !== 'string' || parsed.skill.length === 0) {
|
|
46
63
|
return null;
|
|
47
64
|
}
|
|
65
|
+
if (typeof parsed.sessionId === 'string' && parsed.sessionId.length > 0) {
|
|
66
|
+
const currentSessionId = getCurrentSessionId();
|
|
67
|
+
if (currentSessionId && parsed.sessionId !== currentSessionId) {
|
|
68
|
+
unlinkSync(presencePath);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
48
72
|
return parsed;
|
|
49
73
|
}
|
|
50
74
|
catch {
|
|
@@ -62,6 +86,13 @@ export function touchSkillHeartbeat() {
|
|
|
62
86
|
if (typeof parsed?.skill !== 'string' || parsed.skill.length === 0) {
|
|
63
87
|
return null;
|
|
64
88
|
}
|
|
89
|
+
if (typeof parsed.sessionId === 'string' && parsed.sessionId.length > 0) {
|
|
90
|
+
const currentSessionId = getCurrentSessionId();
|
|
91
|
+
if (currentSessionId && parsed.sessionId !== currentSessionId) {
|
|
92
|
+
unlinkSync(presencePath);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
65
96
|
parsed.lastHeartbeat = new Date().toISOString();
|
|
66
97
|
writeFileSync(presencePath, JSON.stringify(parsed, null, 2), 'utf8');
|
|
67
98
|
return parsed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "1.0.
|
|
1
|
+
export declare const CLI_VERSION = "1.0.26";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "1.0.
|
|
1
|
+
export const CLI_VERSION = "1.0.26";
|
package/package.json
CHANGED
|
@@ -576,6 +576,14 @@ After `peaks-rd` finishes any implementation, repair, or code-output slice, Peak
|
|
|
576
576
|
|
|
577
577
|
Solo is itself a skill running in the current session. To "invoke peaks-rd" or "peaks-qa", Solo MUST use the `Skill` tool with the role's name (e.g. `Skill(skill="peaks-rd")` or `Skill(skill="peaks-qa")`), passing the `<request-id>` and `<session-id>` as arguments so the role reads the same artifacts Solo wrote. Do NOT re-implement the role's logic inline in Solo. Do NOT use the `Agent` tool with a sub-agent — role skills are skills, not agents. After the role skill returns, Solo reads the artifacts the role wrote (via the request artifact path or `peaks request show <rid> --role <role>`) to decide the next step.
|
|
578
578
|
|
|
579
|
+
**Presence restoration after role skill returns (MANDATORY):** Role skills (peaks-rd, peaks-qa, peaks-ui) call `peaks skill presence:set <role>` internally, which overwrites `.peaks/.active-skill.json`. After EVERY role skill returns — whether success, repair-needed, or failure — Solo MUST immediately restore the orchestrator presence by re-running the same presence command from Step 2:
|
|
580
|
+
|
|
581
|
+
```bash
|
|
582
|
+
peaks skill presence:set peaks-solo --mode <mode> --gate <current-gate>
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
This keeps the CLAUDE.md status header accurate (`Peaks-Cli Skill: peaks-solo`) instead of showing a stale role name. Use the current mode and gate values; the gate may have advanced since startup. Skipping this step causes the header to display the last role skill name permanently.
|
|
586
|
+
|
|
579
587
|
**Full-auto auto-proceed rule**: In the `full-auto` profile, when RD transitions to `qa-handoff`, Solo immediately invokes `peaks-qa` via the Skill tool with the same `<request-id>`. Do not pause, do not ask the user, do not summarize RD results as if they were final. The only valid reason to skip QA is when `--type` is `docs` or `chore` (no acceptance surface).
|
|
580
588
|
|
|
581
589
|
A QA report with any failing, blocked, missing, or unverified acceptance item is not a pass.
|
|
@@ -596,12 +604,16 @@ When `peaks-qa` returns `verdict=return-to-rd`, Solo does NOT manually rewrite R
|
|
|
596
604
|
4. peaks-rd fixes the reported issues only (red-line scope: do not modify unrelated surfaces), regenerates code-review and security-review evidence if changes touched reviewed surfaces, then transitions `rd → implemented → qa-handoff` again.
|
|
597
605
|
5. Solo invokes `peaks-qa` again with the same `<request-id>` (the same Skill call as before). QA re-runs gates against the new diff.
|
|
598
606
|
6. Repeat steps 1-5 until QA returns `verdict=pass`, or the cap below fires.
|
|
607
|
+
**After each repair iteration** (after peaks-rd and peaks-qa both return), Solo MUST restore presence:
|
|
608
|
+
```bash
|
|
609
|
+
peaks skill presence:set peaks-solo --mode <mode> --gate repair-cycle-<N>
|
|
610
|
+
```
|
|
599
611
|
|
|
600
612
|
**Repair cycle cap**: After 3 repair cycles without a passing QA verdict, emit a blocked TXT handoff regardless of remaining issues. Do not loop indefinitely. If a specific issue cannot be resolved within 3 cycles, mark it as a known blocker in the TXT handoff and proceed to the SC phase.
|
|
601
613
|
|
|
602
614
|
In full-auto mode, treat the RD↔QA repair loop as a built-in controller objective: loop through RD→QA until all acceptance items pass (max 3 cycles). Do not exit the loop on a non-passing QA verdict unless the TXT handoff marks the workflow as blocked.
|
|
603
615
|
|
|
604
|
-
##
|
|
616
|
+
## Default runbook
|
|
605
617
|
|
|
606
618
|
> **Maintenance**: The numbered workflow list above (steps 0-11) is the canonical phase sequence. This runbook is the executable CLI transcription. When updating this skill, keep both in lockstep — a change to one must be reflected in the other.
|
|
607
619
|
|
|
@@ -775,7 +787,7 @@ Do NOT call `peaks skill presence:clear` at workflow end. The presence file and
|
|
|
775
787
|
|
|
776
788
|
**Codegraph**: Optional project-analysis before RD handoff. Use `peaks codegraph affected --project <path> <changed-files...> --json` for regression-surface hints. Output as untrusted supporting evidence only; never commit `.codegraph/` artifacts.
|
|
777
789
|
|
|
778
|
-
##
|
|
790
|
+
## Codegraph orchestration context
|
|
779
791
|
|
|
780
792
|
Solo treats `peaks codegraph affected --project <path> <changed-files...> --json` as an optional project-analysis enhancement that informs the role handoff between PRD, RD, and QA. The output is untrusted supporting evidence — Solo must not treat codegraph output as approval for scope, design, or QA verdict.
|
|
781
793
|
|