@webpieces/rules-config 0.4.801 → 0.4.803
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/package.json +1 -1
- package/src/checklist-instructions.js +8 -7
- package/src/checklist-instructions.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +12 -4
- package/src/index.js.map +1 -1
- package/src/review-identity-stamp.d.ts +82 -0
- package/src/review-identity-stamp.js +172 -0
- package/src/review-identity-stamp.js.map +1 -0
- package/src/review-json.d.ts +6 -5
- package/src/review-json.js +16 -32
- package/src/review-json.js.map +1 -1
- package/src/reviewer-instructions.d.ts +1 -1
- package/src/reviewer-instructions.js +10 -5
- package/src/reviewer-instructions.js.map +1 -1
- package/src/subagent-provenance.d.ts +1 -0
- package/src/subagent-provenance.js +13 -13
- package/src/subagent-provenance.js.map +1 -1
- package/src/verdict-schema-renderer.d.ts +14 -0
- package/src/verdict-schema-renderer.js +44 -0
- package/src/verdict-schema-renderer.js.map +1 -0
- package/templates/webpieces.git-workflow.md +1 -1
- package/templates/webpieces.location-matrix.md +1 -1
- package/templates/webpieces.review-checklists.md +28 -9
|
@@ -19,7 +19,7 @@ That question is already answered: **yes, always.** Run the flow:
|
|
|
19
19
|
pnpm wp-start-upsert-pr # ① 3-point update from main. Does NOT push and does NOT build.
|
|
20
20
|
pnpm wp-review-upsert-pr # ② validates that merge, runs the BUILD GATE, extracts the diff,
|
|
21
21
|
# and prints the reviewer subagents to spawn
|
|
22
|
-
# → spawn each reviewer it names (each
|
|
22
|
+
# → spawn each reviewer it names (each submits its own verdict: pnpm wp-write-review --checklist <id>)
|
|
23
23
|
# → write review.json at the exact path it prints
|
|
24
24
|
# (.webpieces/pr-review/<feature>/review.json — its `title` becomes the PR title)
|
|
25
25
|
pnpm wp-finish-upsert-pr # ③ creates/updates the PR (and pushes — the ONE push)
|
|
@@ -197,7 +197,7 @@ section head (neither the shell's cwd nor a `cd`'s persistence can be assumed).
|
|
|
197
197
|
| 13 | the same command from a **subagent** runs normally | `w` / `y` — row 8 does not match | ALLOW (handed to L2) | none — a subagent pinned to a worktree is the correct pattern |
|
|
198
198
|
| 14 | inspection inside a SKEWED worktree still runs — `cd <worktree> && ls`/`cat`/`grep` | `w` / `n` / `y` — row 8 does not match | ALLOW (handed to L2) | none — inspection is always open; so are the `Read` tool, `git -C <dir INSIDE this tree> …` and `git show <branch>:<file>`, none of which move you. `git -C <ANOTHER tree>` is a different matter: the harness refuses cross-tree git to a subagent, so it is never the cure for a skew — tell the MAIN agent instead |
|
|
199
199
|
| 15 | `cd <worktree> && pnpm install` still runs while row 8 is live — it is the CURE | L0 allowlist, ahead of L1 | ALLOW | none — a cure must stay reachable from every tree |
|
|
200
|
-
| 16 | a SUBAGENT hits the same block inside `.claude/worktrees/agent-XXXX` | `w` / `n` / `n` — row 8; in-repo placement is still `w` | BLOCK_AI_CURE | READ THE DIRECTION FIRST — the deny prints it. If the MAIN tree is AHEAD (the common case) a subagent fixes this ITSELF, here, by raising this tree's pin to what main already runs; there is nothing to escalate and the deny prints no escalation. Only when main is BEHIND, or when this branch bumped the pin on purpose, is the subagent stuck — the main tree is outside its tree, and a worktree-isolated agent may not even still be in the tree it was launched in (measured: auto-reaped at a turn boundary, resumed on the primary). Then, and only then, forward the deny's verbatim ask to the coordinator and
|
|
200
|
+
| 16 | a SUBAGENT hits the same block inside `.claude/worktrees/agent-XXXX` | `w` / `n` / `n` — row 8; in-repo placement is still `w` | BLOCK_AI_CURE | READ THE DIRECTION FIRST — the deny prints it. If the MAIN tree is AHEAD (the common case) a subagent fixes this ITSELF, here, by raising this tree's pin to what main already runs; there is nothing to escalate and the deny prints no escalation. Only when main is BEHIND, or when this branch bumped the pin on purpose, is the subagent stuck — the main tree is outside its tree, and a worktree-isolated agent may not even still be in the tree it was launched in (measured: auto-reaped at a turn boundary, resumed on the primary). Then, and only then, forward the deny's verbatim ask to the coordinator, and do NOT retry the blocked call — it re-fires the identical deny and buries the ask<br>Do NOT: expect exemption because it sits under the repo — K is git's `--git-common-dir` answer, not a path test |
|
|
201
201
|
| 17 | the printed cure REPLACES your `cd`, it does not stack in front of it | `pw` / `y` / `sub` — row 5, on the cure itself | BLOCK_AI_CURE | Option 1 (preferred): run the printed line VERBATIM — `cd <root> && <the work>`, with your own leading `cd` dropped<br>Do NOT: paste `cd <root> && cd <subdir> && <work>`; `effectiveCwd` resolves the leading `cd`s left to right, so that lands in `<subdir>` again and re-fires this exact block |
|
|
202
202
|
| 18 | every command from a worktree another agent REAPED mid-session is blocked | `m` — row 7 | BLOCK_AI_CURE | Option 1 (preferred): run the printed `cd <root> && <the work>` line — it does NOT route back through the dead path<br>Do NOT: re-`cd` into the worktree, or `git worktree add` it back expecting your uncommitted work; that work is gone |
|
|
203
203
|
| 19 | the same block for a NON-git command there — `m` does not care about G | `m` — row 7; K alone decides it | BLOCK_AI_CURE | Option 1 (preferred): the same printed line. A vanished cwd is not a git question — nothing at all can run in a directory that does not exist |
|
|
@@ -121,8 +121,8 @@ hand can drift out of date if nothing is restated by hand.
|
|
|
121
121
|
Unlike the report-only command it replaces, this one **can fail** — on an unresolved merge or a red build.
|
|
122
122
|
It fails before any reviewer is spawned, which is the point.
|
|
123
123
|
|
|
124
|
-
Checklists already reviewed on this branch are **not** re-listed
|
|
125
|
-
start/review/finish cycle re-instructs
|
|
124
|
+
Checklists already reviewed on this branch are **not** re-listed while their in-scope files are unchanged
|
|
125
|
+
— verdict files persist, so a second start/review/finish cycle re-instructs only what changed.
|
|
126
126
|
|
|
127
127
|
`wp-finish-upsert-pr` recomputes the same set and **refuses to open the PR** while any reviewer still owes
|
|
128
128
|
a passing verdict, naming only the ones still missing. An optional checklist that was offered and declined
|
|
@@ -153,8 +153,22 @@ When `reviewerAgents` is positive, for each matched **required** checklist — a
|
|
|
153
153
|
`git diff <base> HEAD -- <file>` (base is in `pr-context.json`) — and decide whether the change
|
|
154
154
|
satisfies the checklist. (A path-coarse checklist like "new API/queues" simply reports
|
|
155
155
|
`"status": "green"` when the diffs add no new route/queue.)
|
|
156
|
-
3. Have it **
|
|
157
|
-
|
|
156
|
+
3. Have it **submit its verdict** with `pnpm wp-write-review --checklist <id>` (the JSON on stdin, or
|
|
157
|
+
`--file <path>`). The bin writes `review-<id>.json` beside the branch's `review.json` — one file per
|
|
158
|
+
checklist, so concurrent reviewers never clobber each other — plus `review-<id>.provenance.json`
|
|
159
|
+
recording WHO submitted it (the harness's own session/agent ids, stamped by the PreToolUse hook), the
|
|
160
|
+
commit it was briefed on, and a hash of the checklist's in-scope diff. It is the ONLY way a verdict is
|
|
161
|
+
written: it refuses the coordinating agent, and `wp-finish-upsert-pr` rejects a `review-<id>.json` that
|
|
162
|
+
has no provenance or was edited after submission. There is no second route.
|
|
163
|
+
|
|
164
|
+
**Codex has no agent types**, so spawn a generic subagent with NO forked turns — fresh context, never a fork
|
|
165
|
+
of your own conversation — and hand it only the instructions files. The brief on disk is its whole input;
|
|
166
|
+
a forked conversation hands a reviewer the author's reasoning, which costs tokens and its independence.
|
|
167
|
+
|
|
168
|
+
**Verdicts CARRY while their scope is unchanged.** On a re-run, `wp-review-upsert-pr` keeps a checklist's
|
|
169
|
+
green or yellow verdict while the hash of that checklist's in-scope diff is the one its provenance
|
|
170
|
+
recorded, and prints it as `<id> — carried GREEN from <sha>, in-scope files unchanged`. It briefs only the
|
|
171
|
+
checklists that are red, never ran, were rejected, or whose in-scope files changed. A red is never carried.
|
|
158
172
|
|
|
159
173
|
**How to ask about the optional ones.** `wp-review-upsert-pr` prints them as their own step, listing each
|
|
160
174
|
with the files it matched and the doc it reviews against. Put them to the human in **ONE multi-select
|
|
@@ -163,11 +177,15 @@ answering "no" nine times in a row is being worn down rather than consulted, and
|
|
|
163
177
|
cheap answer is yes to everything — which is exactly the state `required: false` exists to fix. If they
|
|
164
178
|
pick none, that is a complete answer; go straight to finish.
|
|
165
179
|
|
|
166
|
-
**You may never write a reviewer's `review
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
**You may never write or submit a reviewer's verdict yourself.** `wp-write-review` refuses the
|
|
181
|
+
coordinating agent, and a hand-written `review-<id>.json` is rejected at finish. If the reviewer agent cannot
|
|
182
|
+
be spawned, that is a config bug, not your cue to self-certify — report it to the human.
|
|
169
183
|
|
|
170
|
-
|
|
184
|
+
**From a plain terminal** (no AI harness in the environment, no hook stamp) `wp-write-review` records the
|
|
185
|
+
submitter as `terminal` — a HUMAN reviewer — and finish accepts it. CI never submits or reads verdicts:
|
|
186
|
+
the review state is local and never committed.
|
|
187
|
+
|
|
188
|
+
## The verdict each reviewer subagent submits through `wp-write-review`
|
|
171
189
|
|
|
172
190
|
```json
|
|
173
191
|
{
|
|
@@ -262,7 +280,8 @@ review must not read as a fully-reviewed one.
|
|
|
262
280
|
```
|
|
263
281
|
|
|
264
282
|
Then run `pnpm wp-finish-upsert-pr`. It re-computes the matched checklists, requires a well-formed,
|
|
265
|
-
passing (or overridden) `review-<id>.json` for each
|
|
283
|
+
passing (or overridden) `review-<id>.json` for each — submitted through `wp-write-review`, unedited, and
|
|
284
|
+
judging the in-scope diff as it is now — verifies a reviewer subagent ran for each, and
|
|
266
285
|
only then opens/updates the PR.
|
|
267
286
|
|
|
268
287
|
> Provenance is verified from Claude Code's own subagent records — it is not tamper-proof (a determined
|