jig-plan 2.1.0 → 2.4.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.
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: review
3
+ description: Reviews a change after it is built, with or without a jig plan. It gets the brief from `jig review`, gates on `jig verify` or the repo's verify command, reviews blind against the owner's intent and then against the builder's claims, validates each Important finding, sends UI, prose and security files to their partner skills, and records a review tied to the working tree. Use after building with jig, when a jig plan's slice is done, or to review a jig plan's diff, slice or branch. Not for a generic "review this PR" with no jig context, which the built-in /code-review covers.
4
+ allowed-tools: Read Glob Grep Bash(jig review:*) Bash(jig status:*) Bash(gh pr view:*) Bash(git diff:*) Bash(git log:*) Bash(git show:*) Bash(git status:*)
5
+ argument-hint: --base <ref>, --pr <number>, or nothing (the doing slice)
6
+ ---
7
+
8
+ # Review
9
+
10
+ Deterministic checks decide, and a model's review advises. A model checking its own work without outside feedback doesn't reliably catch its errors, so the gate runs first and a red gate ends the review. The reviewer reads the change before it reads the builder's account of it, because a persuasive description gets bad changes approved.
11
+
12
+ ## 1. Brief
13
+
14
+ Run `jig review --json`, adding `--base <ref>` or `--pr <number>` if you were given one. Read:
15
+ - `base`, `head`, `how` and `fallback`: what is being compared, and any step that was skipped to get there
16
+ - `files`, `stats` and `triggers`: what changed, and which partners apply
17
+ - `intent`: the owner-approved part of the plan, when there is one
18
+ - `reviewMd`: REVIEW.md entries from the base that match, and those left for the reviewer to judge
19
+ - `checks`, `gate`, `evidence`: what the gate runs, and whether the last `jig verify` covers this tree
20
+ - `round` and `review`: the round number on this base, and the last review's head and findings
21
+
22
+ If it prints an error, report it and stop.
23
+
24
+ **Someone else's code:** with `--pr`, or when the commits aren't the builder's in this session, ask the owner before step 2 runs anything. Running a PR's tests runs its author's code on this machine.
25
+
26
+ ## 2. Gate
27
+
28
+ - **With checks.json:** if `evidence.current` and `evidence.pass` are true and `evidence.slice` is the brief's `slice`, the gate already passed for this tree. Say so. Otherwise run `jig verify` (with `--slice <id>` when the brief names a slice).
29
+ - **Without:** when `gate.D1.level` is `ok`, run the first command in `gate.D1.commands`. Also run the runner `gate.D7` names when its level is `ok`.
30
+ - **No gate at all:** put "Not checked: no gate (no checks.json and no one-command verify)" in the report. The verdict can't be `ready` with nothing run.
31
+
32
+ **A red gate ends the review.** Report the failing check and its deciding line, and stop. Don't model-review code that fails its own checks.
33
+
34
+ **Light path:** when `triggers` has `trivial` (a small docs-only diff), run the gate and one reviewer pass (step 3, phase 1 only), then go to step 6. Put the skipped partners under Not checked, with "light path" as the reason.
35
+
36
+ ## 3. Review in two phases
37
+
38
+ **Phase 1.** Run `jig review --json --blind`, which leaves out the earlier verdict and the evidence record. Start the `jig-reviewer` agent in diff mode, and tell it "Phase 1 only". Give it:
39
+ - with a plan: the plan path and slice ID
40
+ - without one: the base and head from the brief, and the owner's request or the linked issue as the spec
41
+ - the blind brief's JSON
42
+ - the brief's `round`. On round 2 or later, also the earlier findings (`review.findings`) and the last reviewed commit (`review.head`)
43
+
44
+ Don't give it the plan's Log, commit messages, the PR description or your own summary of the work. It returns its Phase 1 findings and stops.
45
+
46
+ **Phase 2.** Use SendMessage to send the same agent (its ID from the Phase 1 call) the builder's claims: the PR title and body (`gh pr view <n> --json title,body` for a PR), the `evidence` from the full brief, and your summary of what was done and verified. If you can't reach it, start a new `jig-reviewer` with the Phase 1 findings quoted verbatim, then the claims. It checks each claim against the diff and the evidence, and can add findings but not remove them. Because the claims arrive only after the Phase 1 findings exist, the blind pass is blind by construction.
47
+
48
+ ## 4. Validate the Important findings
49
+
50
+ For each Important finding, start a fresh `jig-reviewer` in validate mode. Give it only the claim, `file:line: <the defect>`, never the finder's evidence or reasoning. Run these in parallel.
51
+ - `confirmed`: keep the finding, with the validator's evidence.
52
+ - `dropped`: remove it, and count it in the report.
53
+
54
+ Don't validate Nits or Pre-existing findings. Don't retry a dropped finding, and don't count a second run of the same model as a second vote.
55
+
56
+ **The verdict after validation:** `rethink` if the reviewer returned it. Otherwise `fix first` while a confirmed Important finding remains, else `ready`. Don't let the gate's absence give `ready` (step 2).
57
+
58
+ ## 5. Partners
59
+
60
+ Each partner reviews only the files its trigger matched, so none of them becomes a second reviewer of the code.
61
+
62
+ | Trigger | Partner | Files | Notes |
63
+ |---|---|---|---|
64
+ | `ui` | loupe | the trigger's files | the screens those files render |
65
+ | `prose` | humanizing-writing | prose an agent wrote in this change | the files in `voice` are people-facing docs (README, CHANGELOG, docs/, SECURITY, CONTRIBUTING) and use the owner's voice profile when humanizing-writing has one. In jig's own repo that's `voices/ashwin-sathian.md`. Skills, agents and references get the plain rules and no voice. |
66
+ | `security` | owasp-security | the trigger's files | its Important findings are validated like the reviewer's (step 4) |
67
+
68
+ humanizing-writing excludes proofreading a person's own writing, so run it only on prose an agent wrote in this change, and say that in the report. Prose a person wrote, such as most of a PR you didn't build, goes under Not checked with that reason.
69
+
70
+ A partner that isn't installed goes under "Not checked", with the reason. Never skip one silently. loupe and humanizing-writing findings are listed under the partner's name and don't change the verdict.
71
+
72
+ ## 6. Record
73
+
74
+ Write the findings JSON to a scratch file outside the repo:
75
+
76
+ ```json
77
+ { "base": "<from the brief>", "head": "<from the brief>", "tree": "<from the brief>", "verdict": "fix first",
78
+ "findings": [{ "severity": "Important", "confidence": "Confirmed", "file": "src/a.js", "line": 12, "class": "swallowed-error", "title": "catch drops the parse error" }],
79
+ "dropped": 1 }
80
+ ```
81
+
82
+ Record only the findings that are kept: the reviewer's, after validation, and owasp-security's confirmed ones. `dropped` is the count from step 4. Each finding's `title` is the reviewer's one-line finding, word for word. For a finding still open from an earlier round, reuse its earlier `title` and `class`, so it keeps its id.
83
+
84
+ Then run `jig review --record <file>`. It prints the `Reviewed:` trailer. If jig refuses because the tree changed, files moved during the review: run the brief again and review the new diff, rather than recording the old review against the new tree.
85
+
86
+ ## 7. Report
87
+
88
+ Keep it short. Long review comments get acted on less, and AI review can slow a change down.
89
+
90
+ ```
91
+ Verdict: <ready | fix first | rethink> · Gate: <the jig verify line, or the command and its result> · Validator: <n> confirmed, <m> dropped
92
+ 1. [Important] [Confirmed] <class>: <finding>. <file:line>. Fix: <inline fix>.
93
+ ... at most five shown, Important first, then Confirmed before Likely
94
+ <k> more: <one line each, folded>
95
+ Partners: <which ran, on which files>
96
+ Not checked: <each with its reason>
97
+ Declined to judge: <from the reviewer>
98
+ Would miss: <one line on what these checks would miss here>
99
+ Reviewed: <verdict>, <n> findings (tree <short>)
100
+ ```
101
+
102
+ The owner's attention is the audit budget, so the top five carry the report. `ready` with no findings is a normal result.
103
+
104
+ ## Replies, rounds and outcomes
105
+
106
+ - **The builder answers a finding only with evidence:** a run, or a file:line. A prose rebuttal goes to the owner, never back to the reviewer, because models flip correct answers when asked whether they're sure.
107
+ - **Three rounds, then the owner.** On round 3 with Important findings still open, the reviewer returns `rethink`. Stop and take the approach to the owner.
108
+ - **Outcomes:** when a finding is settled, record it with `jig review --outcome <id> fixed|wrong|intentional|didnt-matter`. The finding ids are in the record. These outcomes are how jig learns which findings were worth raising.