gentle-pi 0.13.0 → 0.14.0
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/README.md +14 -0
- package/assets/agents/jd-fix-agent.md +3 -1
- package/assets/agents/jd-judge-a.md +7 -3
- package/assets/agents/jd-judge-b.md +7 -3
- package/assets/agents/review-readability.md +5 -3
- package/assets/agents/review-refuter.md +33 -0
- package/assets/agents/review-reliability.md +5 -3
- package/assets/agents/review-resilience.md +5 -3
- package/assets/agents/review-risk.md +5 -3
- package/assets/chains/4r-review.chain.md +11 -14
- package/assets/migrations/managed-assets-v0.13.json +33 -0
- package/assets/orchestrator-delegation.md +31 -11
- package/assets/orchestrator.md +2 -2
- package/extensions/gentle-ai.ts +223 -56
- package/lib/review-triggers.ts +147 -382
- package/lib/sdd-preflight.ts +246 -6
- package/package.json +1 -1
- package/scripts/verify-package-files.mjs +2 -0
- package/skills/_shared/review-ledger-contract.md +25 -63
- package/skills/gentle-ai/SKILL.md +5 -1
- package/skills/judgment-day/SKILL.md +16 -12
- package/skills/judgment-day/references/prompts-and-formats.md +13 -8
- package/tests/fixtures/v0.13/assets/agents/review-risk.md +56 -0
- package/tests/orchestrator-budget.test.ts +17 -3
- package/tests/package-manifest.test.ts +456 -0
- package/tests/review-gate.test.ts +274 -1
- package/tests/review-ledger-contract.test.ts +170 -51
- package/tests/review-triggers.test.ts +292 -365
- package/tests/runtime-harness.mjs +94 -5
- package/tests/sdd-agent-tools.test.ts +22 -0
package/README.md
CHANGED
|
@@ -149,6 +149,20 @@ Fresh review lenses are intentionally not token-saving devices; they buy indepen
|
|
|
149
149
|
|
|
150
150
|
If multiple rows match, run the narrow set that covers the risk. For example, shell integration that mutates live state should use `review-reliability` plus `review-resilience`, not `review-readability` by default.
|
|
151
151
|
|
|
152
|
+
### Review routing and refutation
|
|
153
|
+
|
|
154
|
+
Review advice never blocks commands. Dangerous-command confirmation remains independently authoritative.
|
|
155
|
+
|
|
156
|
+
- Objectively trivial diffs use zero review lenses.
|
|
157
|
+
- Ordinary or ambiguous executable/configuration diffs use one dominant-risk lens.
|
|
158
|
+
- 400 changed lines remains standard; 401 changed lines routes to full 4R.
|
|
159
|
+
- Non-trivial hot paths use full 4R, while objectively trivial hot-path documentation remains trivial.
|
|
160
|
+
- Pre-commit and pre-push are capped at standard and never run full 4R.
|
|
161
|
+
|
|
162
|
+
The parent merges one authoritative ledger. WARNING and SUGGESTION stay informational; only surviving BLOCKER/CRITICAL findings can enter at most two scoped fix/re-review rounds. Standard review uses one decisive general refuter. Full 4R uses exactly three complete-list refuters and independent two-of-three voting per finding. Judgment Day uses two blind judges and zero refuters.
|
|
163
|
+
|
|
164
|
+
`review-refuter` uses exactly `read`, `grep`, and `find` in a package-managed isolated installation. Project and user overrides may shadow the package asset; `gentle-pi` preserves those definitions and does not claim their effective permissions are package-compliant.
|
|
165
|
+
|
|
152
166
|
## SDD/OpenSpec flow
|
|
153
167
|
|
|
154
168
|
```text
|
|
@@ -29,9 +29,11 @@ This agent does NOT run the exhaustive first-pass sweep and does NOT emit a find
|
|
|
29
29
|
|
|
30
30
|
**Update status, do not add rows.** After fixing a confirmed entry, set that entry's `status` to `fixed`. Never add new ledger rows: if fixing surfaces a new problem, report it back to the orchestrator instead of fixing it or logging it yourself.
|
|
31
31
|
|
|
32
|
+
Only surviving BLOCKER/CRITICAL rows may be fixed; WARNING and SUGGESTION remain `info`.
|
|
33
|
+
|
|
32
34
|
Valid enum values (same as the judge ledger schema, for reference only — this agent never emits ledger rows itself):
|
|
33
35
|
- `severity`: BLOCKER \| CRITICAL \| WARNING \| SUGGESTION
|
|
34
|
-
- `status`: open \| fixed \| verified \| wont-fix \| info
|
|
36
|
+
- `status`: open \| refuted \| fixed \| verified \| wont-fix \| info
|
|
35
37
|
- `lens`: risk \| readability \| reliability \| resilience \| judgment-day
|
|
36
38
|
|
|
37
39
|
Fix execution-mode: jd-fix-agent applies only confirmed ledger findings and hands control back to the orchestrator, which runs the scoped re-judge.
|
|
@@ -21,7 +21,7 @@ Rules:
|
|
|
21
21
|
|
|
22
22
|
## Review ledger contract
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Each Judgment Day judge runs exactly one complete blind sweep. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
25
25
|
|
|
26
26
|
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
27
27
|
|
|
@@ -31,11 +31,13 @@ Rules:
|
|
|
31
31
|
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
32
32
|
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
33
33
|
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
34
|
-
| `status` | open \| fixed \| verified \| wont-fix \| info |
|
|
34
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
35
35
|
| `evidence` | why it matters |
|
|
36
36
|
|
|
37
37
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
38
38
|
|
|
39
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
40
|
+
|
|
39
41
|
Persistence below is executed by the orchestrator after it merges your returned ledger rows; you never write ledger artifacts yourself.
|
|
40
42
|
|
|
41
43
|
**Ledger persistence honors the artifact store.**
|
|
@@ -43,6 +45,8 @@ Persistence below is executed by the orchestrator after it merges your returned
|
|
|
43
45
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
44
46
|
- `none`: keep the ledger inline in the response; do not write files or Engram artifacts — the ledger lives only in this conversation; complete the review → fix → re-review loop within the session because it is not persisted across compaction.
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
Judgment Day launches exactly two blind judges in parallel and zero refuters. Judgment Day applies the same two-round limit to surviving BLOCKER/CRITICAL rows. Judgment Day WARNING and SUGGESTION rows remain `info` and MUST NOT schedule fixes.
|
|
49
|
+
|
|
50
|
+
Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix.
|
|
47
51
|
|
|
48
52
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
@@ -21,7 +21,7 @@ Rules:
|
|
|
21
21
|
|
|
22
22
|
## Review ledger contract
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Each Judgment Day judge runs exactly one complete blind sweep. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
25
25
|
|
|
26
26
|
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
27
27
|
|
|
@@ -31,11 +31,13 @@ Rules:
|
|
|
31
31
|
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
32
32
|
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
33
33
|
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
34
|
-
| `status` | open \| fixed \| verified \| wont-fix \| info |
|
|
34
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
35
35
|
| `evidence` | why it matters |
|
|
36
36
|
|
|
37
37
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
38
38
|
|
|
39
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
40
|
+
|
|
39
41
|
Persistence below is executed by the orchestrator after it merges your returned ledger rows; you never write ledger artifacts yourself.
|
|
40
42
|
|
|
41
43
|
**Ledger persistence honors the artifact store.**
|
|
@@ -43,6 +45,8 @@ Persistence below is executed by the orchestrator after it merges your returned
|
|
|
43
45
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
44
46
|
- `none`: keep the ledger inline in the response; do not write files or Engram artifacts — the ledger lives only in this conversation; complete the review → fix → re-review loop within the session because it is not persisted across compaction.
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
Judgment Day launches exactly two blind judges in parallel and zero refuters. Judgment Day applies the same two-round limit to surviving BLOCKER/CRITICAL rows. Judgment Day WARNING and SUGGESTION rows remain `info` and MUST NOT schedule fixes.
|
|
49
|
+
|
|
50
|
+
Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix.
|
|
47
51
|
|
|
48
52
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
@@ -29,7 +29,7 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
29
29
|
|
|
30
30
|
## Review ledger contract
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Precision limits.** Standard review runs exactly one complete sweep. Full 4R runs at most two complete sweeps per lens. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
33
33
|
|
|
34
34
|
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
35
35
|
|
|
@@ -39,11 +39,13 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
39
39
|
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
40
40
|
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
41
41
|
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
42
|
-
| `status` | open \| fixed \| verified \| wont-fix \| info |
|
|
42
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
43
43
|
| `evidence` | why it matters |
|
|
44
44
|
|
|
45
45
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
46
46
|
|
|
47
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
48
|
+
|
|
47
49
|
Persistence below is executed by the orchestrator after it merges your returned ledger rows; you never write ledger artifacts yourself.
|
|
48
50
|
|
|
49
51
|
**Ledger persistence honors the artifact store.**
|
|
@@ -51,6 +53,6 @@ Persistence below is executed by the orchestrator after it merges your returned
|
|
|
51
53
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
52
54
|
- `none`: keep the ledger inline in the response; do not write files or Engram artifacts — the ledger lives only in this conversation; complete the review → fix → re-review loop within the session because it is not persisted across compaction.
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix.
|
|
55
57
|
|
|
56
58
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-refuter
|
|
3
|
+
description: Read-only review finding refuter for complete-list correctness, impact, and reproducibility checks.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- find
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are **review-refuter**, a read-only adversarial verifier. Challenge severe review findings; never modify the repository.
|
|
11
|
+
|
|
12
|
+
## Boundary
|
|
13
|
+
|
|
14
|
+
- Use only `read`, `grep`, and `find`.
|
|
15
|
+
- Do not mutate files, run shell commands, delegate, or write memory.
|
|
16
|
+
- Assess every BLOCKER/CRITICAL finding in the complete candidate list supplied by the parent.
|
|
17
|
+
- Do not create replacement findings or omit difficult candidates.
|
|
18
|
+
|
|
19
|
+
## Assignment
|
|
20
|
+
|
|
21
|
+
The parent assigns exactly one role: general, correctness, impact/exploitability, or reproducibility. Apply only that role while still returning one verdict for every supplied finding ID.
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
|
|
25
|
+
Return exactly one row per candidate in the original order:
|
|
26
|
+
|
|
27
|
+
| Field | Values |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `id` | Exact supplied finding ID |
|
|
30
|
+
| `verdict` | `refuted` or `stands` |
|
|
31
|
+
| `evidence` | Concrete repository evidence supporting the verdict |
|
|
32
|
+
|
|
33
|
+
Use `stands` whenever the available evidence does not conclusively refute the finding. The parent owns voting, ledger mutation, persistence, and all fix decisions.
|
|
@@ -30,7 +30,7 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
30
30
|
|
|
31
31
|
## Review ledger contract
|
|
32
32
|
|
|
33
|
-
**
|
|
33
|
+
**Precision limits.** Standard review runs exactly one complete sweep. Full 4R runs at most two complete sweeps per lens. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
34
34
|
|
|
35
35
|
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
36
36
|
|
|
@@ -40,11 +40,13 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
40
40
|
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
41
41
|
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
42
42
|
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
43
|
-
| `status` | open \| fixed \| verified \| wont-fix \| info |
|
|
43
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
44
44
|
| `evidence` | why it matters |
|
|
45
45
|
|
|
46
46
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
47
47
|
|
|
48
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
49
|
+
|
|
48
50
|
Persistence below is executed by the orchestrator after it merges your returned ledger rows; you never write ledger artifacts yourself.
|
|
49
51
|
|
|
50
52
|
**Ledger persistence honors the artifact store.**
|
|
@@ -52,6 +54,6 @@ Persistence below is executed by the orchestrator after it merges your returned
|
|
|
52
54
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
53
55
|
- `none`: keep the ledger inline in the response; do not write files or Engram artifacts — the ledger lives only in this conversation; complete the review → fix → re-review loop within the session because it is not persisted across compaction.
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix.
|
|
56
58
|
|
|
57
59
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
@@ -29,7 +29,7 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
29
29
|
|
|
30
30
|
## Review ledger contract
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Precision limits.** Standard review runs exactly one complete sweep. Full 4R runs at most two complete sweeps per lens. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
33
33
|
|
|
34
34
|
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
35
35
|
|
|
@@ -39,11 +39,13 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
39
39
|
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
40
40
|
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
41
41
|
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
42
|
-
| `status` | open \| fixed \| verified \| wont-fix \| info |
|
|
42
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
43
43
|
| `evidence` | why it matters |
|
|
44
44
|
|
|
45
45
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
46
46
|
|
|
47
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
48
|
+
|
|
47
49
|
Persistence below is executed by the orchestrator after it merges your returned ledger rows; you never write ledger artifacts yourself.
|
|
48
50
|
|
|
49
51
|
**Ledger persistence honors the artifact store.**
|
|
@@ -51,6 +53,6 @@ Persistence below is executed by the orchestrator after it merges your returned
|
|
|
51
53
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
52
54
|
- `none`: keep the ledger inline in the response; do not write files or Engram artifacts — the ledger lives only in this conversation; complete the review → fix → re-review loop within the session because it is not persisted across compaction.
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix.
|
|
55
57
|
|
|
56
58
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
@@ -29,7 +29,7 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
29
29
|
|
|
30
30
|
## Review ledger contract
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Precision limits.** Standard review runs exactly one complete sweep. Full 4R runs at most two complete sweeps per lens. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
33
33
|
|
|
34
34
|
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
35
35
|
|
|
@@ -39,11 +39,13 @@ Report findings only. Each finding must include `severity: BLOCKER | CRITICAL |
|
|
|
39
39
|
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
40
40
|
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
41
41
|
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
42
|
-
| `status` | open \| fixed \| verified \| wont-fix \| info |
|
|
42
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
43
43
|
| `evidence` | why it matters |
|
|
44
44
|
|
|
45
45
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
46
46
|
|
|
47
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
48
|
+
|
|
47
49
|
Persistence below is executed by the orchestrator after it merges your returned ledger rows; you never write ledger artifacts yourself.
|
|
48
50
|
|
|
49
51
|
**Ledger persistence honors the artifact store.**
|
|
@@ -51,6 +53,6 @@ Persistence below is executed by the orchestrator after it merges your returned
|
|
|
51
53
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
52
54
|
- `none`: keep the ledger inline in the response; do not write files or Engram artifacts — the ledger lives only in this conversation; complete the review → fix → re-review loop within the session because it is not persisted across compaction.
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix.
|
|
55
57
|
|
|
56
58
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: 4r-review
|
|
3
|
-
description:
|
|
3
|
+
description: Lens-only full 4R discovery in stable risk, resilience, readability, reliability order; the parent owns merge and orchestration.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## review-risk
|
|
@@ -9,31 +9,28 @@ output: review-risk-report.md
|
|
|
9
9
|
outputMode: file-only
|
|
10
10
|
progress: true
|
|
11
11
|
|
|
12
|
-
Run R1 Risk review on the current diff.
|
|
12
|
+
Run R1 Risk review on the current diff. Return the complete findings ledger for security, privilege boundaries, data exposure, dependencies, and merge-blocking vulnerabilities. If clean, return an empty ledger record rather than omit the report.
|
|
13
13
|
|
|
14
|
-
## review-
|
|
14
|
+
## review-resilience
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
output: review-readability-report.md
|
|
16
|
+
output: review-resilience-report.md
|
|
18
17
|
outputMode: file-only
|
|
19
18
|
progress: true
|
|
20
19
|
|
|
21
|
-
Run
|
|
20
|
+
Run R4 Resilience review on the current diff. Return the complete findings ledger for fallbacks, retry/backoff, graceful degradation, observability, load, rollback, and SLO risks. If clean, return an empty ledger record rather than omit the report.
|
|
22
21
|
|
|
23
|
-
## review-
|
|
22
|
+
## review-readability
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
output: review-reliability-report.md
|
|
24
|
+
output: review-readability-report.md
|
|
27
25
|
outputMode: file-only
|
|
28
26
|
progress: true
|
|
29
27
|
|
|
30
|
-
Run
|
|
28
|
+
Run R2 Readability review on the current diff. Return the complete findings ledger for naming, complexity, intention, maintainability, review size, and context clarity. If clean, return an empty ledger record rather than omit the report.
|
|
31
29
|
|
|
32
|
-
## review-
|
|
30
|
+
## review-reliability
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
output: review-resilience-report.md
|
|
32
|
+
output: review-reliability-report.md
|
|
36
33
|
outputMode: file-only
|
|
37
34
|
progress: true
|
|
38
35
|
|
|
39
|
-
Run
|
|
36
|
+
Run R3 Reliability review on the current diff. Return the complete findings ledger for behavior-first test coverage, edge cases, determinism, contracts, and regressions. If clean, return an empty ledger record rather than omit the report.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packageVersion": "0.13.0",
|
|
4
|
+
"assets": {
|
|
5
|
+
"agents/gentle-ai-worker.md": "b34488c0e91f134e38c595ab4659b47c0f38b8e74d2a52b12fc9fcac96dc0dd3",
|
|
6
|
+
"agents/jd-fix-agent.md": "4dfef5d62f6306d81d23a2babbbca42801f446181fed44eef07dc81d84a725c5",
|
|
7
|
+
"agents/jd-judge-a.md": "66e78e7210aee297a2968d1cf885f735ec7324d1cb3a297aa47360e7bfab60cc",
|
|
8
|
+
"agents/jd-judge-b.md": "aeb2485340c2beb7e0cc84b66105a0db2b51caa9aa4498940bd121baf952173b",
|
|
9
|
+
"agents/review-readability.md": "d27417efe6f3401f27908f2fcb8b5cd47c68c4bf17ed28fb8e76ea6446ddbf93",
|
|
10
|
+
"agents/review-reliability.md": "0bd10599c00a3f6fa505787021e14fafc8357bf7f4391513c420a179561e5358",
|
|
11
|
+
"agents/review-resilience.md": "f61ffb1fb813fed24e125accb0e4ee394750e719443266b7a8bec7c78c03e135",
|
|
12
|
+
"agents/review-risk.md": "0b673a54091b7b06c266da9686900ef53fd812e049d9df1f59997cf449a85081",
|
|
13
|
+
"agents/sdd-apply.md": "5e74256d56af1d5f99890e9c55f36239f2fbadd5b69e960a38cca6828a74eafb",
|
|
14
|
+
"agents/sdd-archive.md": "7ad865caf6a90a856b07f5d9b279a2ca6d13e2f5c804de9dc340296862b26869",
|
|
15
|
+
"agents/sdd-design.md": "143d37997b844a0dd9f8492878472026ecbf77f3961dce3454d91085f08ce5a3",
|
|
16
|
+
"agents/sdd-explore.md": "c1cffeca8bcf1c90537c537ac870f0da9101c0837606c231aa40585c8585e49d",
|
|
17
|
+
"agents/sdd-init.md": "cd1f88d78c97b4f3757589f5281baf9c6133604c1748dfa18c689c30da0f1f5a",
|
|
18
|
+
"agents/sdd-onboard.md": "4b179f360caa30a0dac82425ce75cd40da6cc9dd16a6152eb6aa2a6e6684f814",
|
|
19
|
+
"agents/sdd-proposal.md": "92500f275f0926b83e385ff0689e725b49fa03cc0630c582c63c81f1e429fc42",
|
|
20
|
+
"agents/sdd-spec.md": "18e9e33673f5ebb0a3830077204960e93f82ad28c566b44a343692d77af5ca33",
|
|
21
|
+
"agents/sdd-status.md": "0eb5be811512f7297ea6783915c7cda4cd14edb2a874b1d5d57cd55c3bacd4d6",
|
|
22
|
+
"agents/sdd-sync.md": "90d18cd53af48b3f654819768a12e81c41bd43e01fdc9595b5cbf9f553533b06",
|
|
23
|
+
"agents/sdd-tasks.md": "f22281433b80edf2079a6d8597bfb079bc442dbc42750aa46aef82e5818ffd2b",
|
|
24
|
+
"agents/sdd-verify.md": "8b58832fbf25489aae12034e9e8c4e64e7f38acdcbb610884841adb49a34ea60",
|
|
25
|
+
"chains/4r-review.chain.md": "659f08968bbf1e0293e794eebb3ed35d7e74c640ebd4f604f032f27463411cd3",
|
|
26
|
+
"chains/sdd-full.chain.md": "4af3ff8b5b1d4f17cdfbda26f150fc017f82aa7f43aa4db3a2eb4fd2fd20f81b",
|
|
27
|
+
"chains/sdd-plan.chain.md": "938c39f711539eae5b3f04c3aa031387ad420f7d7049906213a71c2e2704928c",
|
|
28
|
+
"chains/sdd-verify.chain.md": "48c3861eb5912631e54658281064c2c346b633fa36cf8d43cf862a1d5e56b40e",
|
|
29
|
+
"gentle-ai/support/sdd-status-contract.md": "b6796a3958e24f747446e9514a62bce1cbeab26a115e79f500eeb8fbdde5a1ae",
|
|
30
|
+
"gentle-ai/support/strict-tdd-verify.md": "becb50da4841aae5f6b157462efbfcd4f20332c0c054c82a55970450be8e649c",
|
|
31
|
+
"gentle-ai/support/strict-tdd.md": "2b0340bfa1160db7f609a4e1b6a24bbd3a1b1a8347b2b65d400865c104fdd237"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -165,22 +165,34 @@ If multiple rows match, run the narrow set that covers the risk. Example: shell
|
|
|
165
165
|
|
|
166
166
|
## 4R Review Triggers
|
|
167
167
|
|
|
168
|
-
The extension
|
|
168
|
+
The extension classifies recognized git/gh workflow diffs and emits advice only:
|
|
169
169
|
|
|
170
|
-
- **
|
|
171
|
-
- **
|
|
172
|
-
- **
|
|
173
|
-
|
|
174
|
-
- Diff exceeds 400 changed lines (added + deleted)
|
|
175
|
-
- When blocked, the reason names all four agents to run first.
|
|
176
|
-
- **post-sdd-phase** (design, apply): **strong gate** for the packaged `gentle-ai-judgment-day` skill. Handled separately by SDD phase orchestration, not this diff-based hook.
|
|
170
|
+
- **Trivial**: use zero lenses only when complete evidence proves every change is documentation, comments, formatting, or a string typo and no executable/configuration content changed.
|
|
171
|
+
- **Standard**: use exactly one dominant lens. Precedence is risk, resilience, reliability, then readability fallback. Ambiguous executable/configuration changes fail conservatively to standard.
|
|
172
|
+
- **Full 4R**: for a non-trivial hot path or strictly more than 400 changed lines, use `review-risk`, `review-resilience`, `review-readability`, and `review-reliability` in that order. Exactly 400 remains standard; 401 is full.
|
|
173
|
+
- **Event ceiling**: pre-commit and pre-push never run full 4R; cap them at one standard lens. Pre-PR, CI, and schedule may run full 4R.
|
|
177
174
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
Prohibition: do NOT configure the full 4R fan-out on `pre-commit` or `pre-push` with `always: true`. Everyday events must use a single advisory lens to keep development-loop cost low (spec G token-budget rule). The `validateTriggerRuleSet` function in `lib/review-triggers.ts` enforces this at config load time.
|
|
175
|
+
Review advice never pauses, denies, or requires a receipt. Continue to independent command safety after notification; dangerous-command denial or confirmation remains authoritative. Post-SDD design/apply uses the separate Judgment Day path.
|
|
181
176
|
|
|
182
177
|
### Review Execution Contract
|
|
183
178
|
|
|
179
|
+
The parent owns merge, persistence, refutation, voting, fixes, and scoped re-review. The static `4r-review` chain performs lens discovery and returns reports only.
|
|
180
|
+
|
|
181
|
+
**Precision limits.** Standard review runs exactly one complete sweep. Full 4R runs at most two complete sweeps per lens. Every finding MUST include concrete evidence of user impact; speculative findings are rejected.
|
|
182
|
+
|
|
183
|
+
**Findings ledger.** Emit a findings ledger with this schema for every entry:
|
|
184
|
+
|
|
185
|
+
| Field | Values |
|
|
186
|
+
|-------|--------|
|
|
187
|
+
| `id` | `{LENS}-{NNN}` (e.g. `R1-001`) |
|
|
188
|
+
| `lens` | risk \| readability \| reliability \| resilience \| judgment-day |
|
|
189
|
+
| `location` | `path/to/file.ext:line` or `:start-end` |
|
|
190
|
+
| `severity` | BLOCKER \| CRITICAL \| WARNING \| SUGGESTION |
|
|
191
|
+
| `status` | open \| refuted \| fixed \| verified \| wont-fix \| info |
|
|
192
|
+
| `evidence` | why it matters |
|
|
193
|
+
|
|
194
|
+
`refuted` is terminal and MUST NOT be reopened by later rounds. WARNING and SUGGESTION rows are recorded once with status `info` and MUST NOT schedule fixes.
|
|
195
|
+
|
|
184
196
|
**Ledger persistence honors the artifact store.**
|
|
185
197
|
- `openspec`: write `openspec/changes/{change-name}/review-ledger.md`.
|
|
186
198
|
- `engram`: upsert topic `sdd/{change-name}/review-ledger` (ad-hoc judgment-day without a change: `review/{target-slug}/ledger`, where `target-slug` = `pr-{number}` when reviewing a PR, else the current branch name kebab-cased, else a kebab-case slug of the user-stated review target). If the engram upsert fails or the memory tool is unavailable, fall back to keeping the ledger inline in the response and explicitly report the degradation — never continue as if persistence succeeded.
|
|
@@ -188,6 +200,14 @@ Prohibition: do NOT configure the full 4R fan-out on `pre-commit` or `pre-push`
|
|
|
188
200
|
|
|
189
201
|
If the first pass finds nothing, persist an empty ledger record rather than skip persistence.
|
|
190
202
|
|
|
203
|
+
**Constant refutation.** When no surviving BLOCKER/CRITICAL candidates exist, refutation launches zero actors. Standard review launches exactly one non-parallel general refuter. Full 4R launches exactly three parallel refuters: correctness, impact/exploitability, and reproducibility. Every active refuter receives the complete merged BLOCKER/CRITICAL candidate list. Per-finding refuter tasks and replacement refuters are forbidden.
|
|
204
|
+
|
|
205
|
+
**Mode-specific voting.** Refuter outputs are keyed by finding ID. In standard review, the general refuter's single `refuted` verdict terminally refutes only that finding. In full 4R, at least two of three valid `refuted` verdicts terminally refute only that finding. `stands`, unknown, duplicate, malformed, omitted, or missing verdicts preserve the finding.
|
|
206
|
+
|
|
207
|
+
**Scoped convergence.** Re-review receives only the authoritative ledger and the fix diff. Re-review assesses affected ledger rows and regressions introduced by the fix. Only surviving BLOCKER/CRITICAL rows MAY schedule a fix round. At most two scoped fix/re-review rounds may run. Severe rows surviving round two MUST escalate; a third round MUST NOT run.
|
|
208
|
+
|
|
209
|
+
**Judgment Day exception.** Each Judgment Day judge runs exactly one complete blind sweep. Judgment Day launches exactly two blind judges in parallel and zero refuters. Judgment Day applies the same two-round limit to surviving BLOCKER/CRITICAL rows. Judgment Day WARNING and SUGGESTION rows remain `info` and MUST NOT schedule fixes.
|
|
210
|
+
|
|
191
211
|
Subagent execution-mode: this agent runs its lens exhaustively as a dedicated Pi subagent and returns its own ledger rows in its Output; the orchestrator merges those ledger rows into the persisted ledger.
|
|
192
212
|
|
|
193
213
|
Fix execution-mode: jd-fix-agent applies only confirmed ledger findings and hands control back to the orchestrator, which runs the scoped re-judge.
|
package/assets/orchestrator.md
CHANGED
|
@@ -107,9 +107,9 @@ For skill-shaped requests, do not treat injected `<available_skills>` as complet
|
|
|
107
107
|
|
|
108
108
|
## 4R Review Triggers
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
Route objectively trivial diffs to zero lenses. Route ordinary or ambiguous executable/configuration diffs to standard review with exactly one dominant lens: `review-risk`, `review-resilience`, `review-reliability`, or `review-readability` fallback. Exactly 400 changed lines remains standard; 401 changed lines or a non-trivial hot path runs full 4R in stable risk, resilience, readability, reliability order.
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Pre-commit and pre-push never run full 4R. Review advice never blocks a command. Dangerous-command confirmation remains authoritative. Post-SDD design/apply remains the separate `gentle-ai-judgment-day` path.
|
|
113
113
|
|
|
114
114
|
### Review Execution Contract
|
|
115
115
|
|