@jeffober/thatch 0.2.5 → 0.2.6
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 +48 -25
- package/artifacts/skills/common.md +1 -0
- package/artifacts/skills/thatch-code-archaeology.md +9 -0
- package/artifacts/skills/thatch-code-review.md +16 -8
- package/artifacts/skills/thatch-plan-refinement.md +33 -4
- package/artifacts/skills/thatch-refine-personal.md +5 -0
- package/artifacts/skills/thatch-refine.md +7 -1
- package/artifacts/skills/thatch-review-context.md +55 -2
- package/artifacts/skills/thatch-review-followup.md +4 -4
- package/artifacts/skills/thatch-review-response.md +1 -1
- package/artifacts/skills/thatch-review-synthesizer.md +21 -1
- package/bin/thatch +21 -12
- package/docs/dev/README.md +11 -8
- package/docs/dev/features/README.md +1 -1
- package/docs/dev/features/behavior-engine.md +10 -0
- package/docs/dev/features/cli.md +2 -1
- package/docs/dev/features/commands.md +40 -9
- package/docs/dev/features/cross-session-chat.md +85 -21
- package/docs/dev/features/database.md +4 -4
- package/docs/dev/features/nudge-pipeline.md +14 -0
- package/docs/dev/features/opencode-plugin.md +41 -15
- package/docs/dev/features/prediction-engine.md +27 -1
- package/docs/dev/features/qa-system.md +19 -3
- package/docs/dev/features/session-lifecycle.md +6 -6
- package/docs/dev/features/session-tabs.md +11 -5
- package/docs/dev/gotchas.md +21 -0
- package/docs/dev/mcp-parity.md +3 -3
- package/docs/dev/skills.md +11 -8
- package/docs/user/README.md +19 -12
- package/docs/user/behavior-engine.md +7 -1
- package/docs/user/cli.md +2 -1
- package/docs/user/code-review.md +43 -2
- package/docs/user/commands.md +27 -7
- package/docs/user/cross-session-chat.md +47 -20
- package/docs/user/prediction-engine.md +12 -1
- package/docs/user/skills.md +8 -6
- package/package.json +1 -1
- package/src/capabilities.ts +20 -6
- package/src/chat.ts +39 -17
- package/src/commands.ts +109 -18
- package/src/db.ts +23 -2
- package/src/mcp.ts +6 -2
- package/src/opencode/tui-plugin.ts +29 -9
- package/src/opencode/v2.ts +247 -66
- package/src/prompts.ts +54 -6
- package/src/runtime.ts +122 -17
- package/src/scoring-engine.ts +40 -9
- package/src/session-tab-shared.ts +55 -4
- package/src/skills.ts +5 -9
- package/src/tab-state.ts +125 -0
- package/src/tool-defs.ts +42 -21
package/README.md
CHANGED
|
@@ -44,10 +44,11 @@ synchronously (fire-and-forget) instead of asynchronously.
|
|
|
44
44
|
|
|
45
45
|
The v2 plugin API is missing a few surfaces the v1 API had. On 2.x:
|
|
46
46
|
|
|
47
|
-
- **
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
- **Toasts ride the session-tab bridge.** Every plugin toast (extraction
|
|
48
|
+
metrics, alerts, chat registration, blocked wrap-ups) travels the
|
|
49
|
+
session-tab rpc bridge to the TUI plugin's `ui.toast.show`. A TUI-less
|
|
50
|
+
environment (headless run, still connecting) shows nothing - toasts are
|
|
51
|
+
best-effort by design.
|
|
51
52
|
- **Plugin state survives reloads.** Editing the plugin (or `opencode
|
|
52
53
|
plugin update`) reloads it, but extraction buffers, watcher
|
|
53
54
|
registrations, and armed wrap-ups are journaled and restored; a process
|
|
@@ -56,14 +57,23 @@ The v2 plugin API is missing a few surfaces the v1 API had. On 2.x:
|
|
|
56
57
|
such a session re-arms its watches on the first message (expired ones
|
|
57
58
|
are dropped and reported), and a live session in the same project gets a
|
|
58
59
|
one-line notice that a dead session's watch will re-arm if resumed.
|
|
59
|
-
- **Extraction children are visible
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
- **Extraction children are visible on older 2.x builds.** Upstream exposed
|
|
61
|
+
`session.remove` on the plugin API (v2.0.22), so the fact-extractor
|
|
62
|
+
child sessions are deleted when they finish - the session picker stays
|
|
63
|
+
clean. On an older 2.x build (pre-`session.remove`) the deletion
|
|
64
|
+
degrades silently: children accumulate in the session picker, and
|
|
65
|
+
"continue last session" (`-c`) can land in one after any session that
|
|
66
|
+
triggered extraction.
|
|
67
|
+
- **Wrap-up actions need a new host (compact) or an open tab (exit).** The
|
|
68
|
+
compaction trigger rides `session.compact` on the plugin API (upstream
|
|
69
|
+
added it in v2.0.22); on an older 2.x build the checklist and memory
|
|
70
|
+
flush run but the compaction itself is skipped - run `/compact` yourself
|
|
71
|
+
there. `/thatch/exit` closes the session's own tab over the session-tab
|
|
72
|
+
bridge; with no tab open (headless run, tabs off) nothing visible happens,
|
|
73
|
+
but the session still unregisters from chat and its watches are
|
|
74
|
+
cancelled - on either host, and reopening or resuming the session does
|
|
75
|
+
not re-arm them. Re-create watches you still want with
|
|
76
|
+
`thatch_watch_create`.
|
|
67
77
|
- **No `-c` session listing.** The chat resume listing degrades.
|
|
68
78
|
|
|
69
79
|
Everything else - tools, memory, nudges, chat, watchers - behaves the
|
|
@@ -202,16 +212,24 @@ Thatch gives your agent:
|
|
|
202
212
|
- **Slash commands** -- `/thatch/defrag` (consolidate duplicate memories),
|
|
203
213
|
`/thatch/extract` (drain the extraction queue now), `/thatch/hygiene`
|
|
204
214
|
(tend stale and orphaned memories), `/thatch/reflect` (persist what
|
|
205
|
-
the session learned),
|
|
206
|
-
project type's requirements, classifying the project first)
|
|
207
|
-
|
|
208
|
-
|
|
215
|
+
the session learned), `/thatch/refine` (refine a plan under the
|
|
216
|
+
project type's requirements, classifying the project first),
|
|
217
|
+
`/thatch/self-review` (review your own completed work before
|
|
218
|
+
submitting it, weighted for reputation and simplicity),
|
|
219
|
+
`/thatch/peer-review` (review another author's change, weighted for
|
|
220
|
+
org velocity and sharing the project's persistent memory), and
|
|
221
|
+
`/thatch/whois` (report the session's chat identity) run on demand.
|
|
222
|
+
The nudge-backed actions (`defrag`, `extract`, `hygiene`, `reflect`)
|
|
223
|
+
mirror the same behaviors the nudges run on their own schedule; the
|
|
224
|
+
rest stand alone. Plus the opencode-only wrap-ups: `/thatch/compact` and
|
|
209
225
|
`/thatch/exit` run a pre-flight checklist before a compaction or an exit:
|
|
210
226
|
the agent flushes pending fact extraction, finishes promised memory
|
|
211
227
|
writes, and surfaces todos or follow-ups it never addressed. It ends its
|
|
212
228
|
response with a greenlight token only when the checklist is clean; thatch
|
|
213
|
-
then triggers the compaction or
|
|
214
|
-
the
|
|
229
|
+
then triggers the compaction or closes the session (its tab on opencode
|
|
230
|
+
2, the whole app on opencode 1 - either way its watches are cancelled).
|
|
231
|
+
With items outstanding, the agent lists them and nothing fires -- you
|
|
232
|
+
decide when to retry.
|
|
215
233
|
- **Notifications + user config** -- the agent can ping you out-of-band when a
|
|
216
234
|
long-running outcome lands: a desktop banner, a spoken voice
|
|
217
235
|
announcement, or both (macOS and Linux). On opencode, thatch also watches
|
|
@@ -235,19 +253,24 @@ host.
|
|
|
235
253
|
|
|
236
254
|
The memory tools, prediction and behavior engines, conversation search via
|
|
237
255
|
the `thatch session` CLI, cross-session chat (with stop-hook wake), skills,
|
|
238
|
-
and the on-demand actions `/thatch/defrag`, `/thatch/hygiene`,
|
|
239
|
-
`/thatch/reflect
|
|
240
|
-
|
|
241
|
-
|
|
256
|
+
and the on-demand actions `/thatch/defrag`, `/thatch/hygiene`,
|
|
257
|
+
`/thatch/reflect`, `/thatch/refine`, `/thatch/self-review`, and
|
|
258
|
+
`/thatch/peer-review` (synced by `thatch setup --claude`; the review-mode
|
|
259
|
+
commands run the specialist sequence inline, since the coordinator skill is
|
|
260
|
+
opencode-only). Not available: the
|
|
261
|
+
wrap-up commands (they need the plugin's host action routes),
|
|
262
|
+
`/thatch/extract` and `/thatch/whois` (they need the opencode plugin's
|
|
263
|
+
session identity), live recall/prediction nudges
|
|
242
264
|
beyond the hook-based flow, and toast notifications.
|
|
243
265
|
|
|
244
266
|
## What works in Cursor
|
|
245
267
|
|
|
246
268
|
The same core set as Claude Code (memory, predictions, behaviors, chat with
|
|
247
|
-
stop-hook wake, skills, and the `defrag`/`hygiene`/`reflect
|
|
269
|
+
stop-hook wake, skills, and the `defrag`/`hygiene`/`reflect`/`refine`/
|
|
270
|
+
`self-review`/`peer-review` actions). Cursor
|
|
248
271
|
has no file-based slash commands, so the actions surface through MCP prompts
|
|
249
|
-
instead. Not available: the wrap-up commands, `/thatch/extract`,
|
|
250
|
-
notifications.
|
|
272
|
+
instead. Not available: the wrap-up commands, `/thatch/extract`,
|
|
273
|
+
`/thatch/whois`, and toast notifications.
|
|
251
274
|
|
|
252
275
|
## Privacy
|
|
253
276
|
|
|
@@ -34,6 +34,7 @@ If your briefing includes a project context brief (from the coordinator or from
|
|
|
34
34
|
- **Deferred work** listed in the brief is intentionally excluded from this PR. Do not flag the absence of deferred pieces as bugs, inconsistencies, or missing functionality.
|
|
35
35
|
- **Dependencies** in the brief tell you whether base-branch behavior is expected to be present or not. Do not assert that base-branch behavior exists without verifying it landed.
|
|
36
36
|
- **Relevant constraints** may explain why code is structured a certain way. Consider them before flagging design choices.
|
|
37
|
+
- **Sibling PR context** in the brief (when related PRs were detected) tells you where the pieces outside this diff live. Before flagging something as "referenced but not implemented anywhere in this change", check the sibling register: a stack member or release-train sibling may deliver it.
|
|
37
38
|
|
|
38
39
|
## Workflow context awareness
|
|
39
40
|
If your briefing includes a workflow guide (from the coordinator or from loading thatch-code-archaeology), use it to understand the purpose and evolution of the code you are reviewing:
|
|
@@ -198,6 +198,15 @@ For each feature or workflow you investigated, teach the user what it is and how
|
|
|
198
198
|
|
|
199
199
|
Include sub-agent findings as their own per-feature sections, integrated into the same report.
|
|
200
200
|
|
|
201
|
+
### Cross-PR context (when a sibling register is supplied)
|
|
202
|
+
|
|
203
|
+
When the review coordinator dispatches you, your input may include the project context brief with a sibling register: related PRs detected as stack members or release-train siblings. Fold the register into the guide where it changes what a reviewer would flag:
|
|
204
|
+
|
|
205
|
+
- A comment or doc referencing work delivered by a sibling PR is intentional cross-referencing, not a dangling reference. Note it as a design decision, with the sibling PR number.
|
|
206
|
+
- A contract consumed from a sibling (an API, type, schema, or flag) is part of the workflow's data flow. Map it, and note the dependency direction.
|
|
207
|
+
- An ordering assumption across the stack or train (this change assumes a sibling lands first) is a workflow constraint. Note it with the claimed order from the register.
|
|
208
|
+
- Do not investigate a sibling's code beyond what the register and its consistency verdicts already established. The register is context, not a mandate to review the sibling.
|
|
209
|
+
|
|
201
210
|
### Recommendations
|
|
202
211
|
Tailor this section to the user's original ask:
|
|
203
212
|
- **Research or investigation**: summarize what you found and what remains unknown
|
|
@@ -18,11 +18,11 @@ Identify what to review:
|
|
|
18
18
|
- If a git range was specified (A..B form), use it directly.
|
|
19
19
|
- If no target was specified, review the current branch against its base, resolving the base from `origin/main` (or the appropriate remote tracking ref) after fetching.
|
|
20
20
|
|
|
21
|
-
Also detect whether the current branch has a **connected PR/MR** even when none was specified — this is what enables follow-up-round detection in Step 2. Inspect `git remote -v` to recognize the VCS host (github.com → GitHub/`gh`; gitlab.* → GitLab/`glab`; bitbucket.org → Bitbucket Cloud; dev.azure.com → Azure DevOps). Then probe for an open PR/MR on the current branch using the matching CLI or REST API:
|
|
22
|
-
- GitHub: `gh pr view
|
|
21
|
+
Also detect whether the current branch has a **connected PR/MR** even when none was specified — this is what enables follow-up-round detection and related-PR discovery in Step 2. Inspect `git remote -v` to recognize the VCS host (github.com → GitHub/`gh`; gitlab.* → GitLab/`glab`; bitbucket.org → Bitbucket Cloud; dev.azure.com → Azure DevOps). Then probe for an open PR/MR on the current branch using the matching CLI or REST API:
|
|
22
|
+
- GitHub: `gh pr view <branch> --json number,headRefOid,baseRefOid`
|
|
23
23
|
- GitLab: `glab mr list --source-branch <branch>`
|
|
24
24
|
- Other providers: equivalent detection via their CLI or REST API.
|
|
25
|
-
- If you cannot detect or cannot interact with the VCS (no CLI, no REST access), treat the change as a **local-branch review** and proceed with the existing procedure. A local-branch review is not a defect — it
|
|
25
|
+
- If you cannot detect or cannot interact with the VCS (no CLI, no REST access), treat the change as a **local-branch review** and proceed with the existing procedure. A local-branch review is not a defect — it means there is no prior-comments register to build and no connected PR to chain stack discovery from (release trains remain discoverable through tracker relations and linked PRs).
|
|
26
26
|
|
|
27
27
|
Also fetch any refs not locally reachable so branches and PRs that were never checked out can be reviewed (e.g. `git fetch origin <branch>` for a PR head).
|
|
28
28
|
|
|
@@ -43,8 +43,9 @@ Load the thatch-review-context skill and follow its methodology to build a conte
|
|
|
43
43
|
- **Links in the change** — docs, designs, tickets, and related PRs linked from the PR description, commit messages, or the changed files themselves; follow them for scope and design context (see source #8 in the review-context skill)
|
|
44
44
|
- **Staleness check** — whether main has moved past the merge-base touching the same paths (see source #3 in the review-context skill); when it has, record the commits in the brief
|
|
45
45
|
- **Prior review comments** — if Step 1 detected a connected PR/MR, fetch ALL prior review comments on it (see source #9 in the review-context skill) and build the prior-comments register with a preliminary addressed-check status per comment. This is what distinguishes a **follow-up round** (register non-empty) from the **first round** (register empty or PR has no prior reviews). If Step 1 found no connected PR/MR, the brief explicitly states `Local-branch review — no prior-comment fetch`.
|
|
46
|
+
- **Related PRs (stacks and release trains)** — discover the coordinated set this change belongs to (see source #11 in the review-context skill): stack members chained through base branches, and release-train siblings ordered by tracker relations or ticket DEPENDENCIES sections (the ticket section that names the change's blocking links). Build the sibling register with targeted consistency verdicts; source #11's early-out governs when to skip (a connected PR/MR is required to chain a stack, but a release train is discoverable from ticket references and linked PRs alone). When reading the siblings' descriptions and targeted diffs would crowd the orchestrator's context (a deep stack or a large train), dispatch one sub-agent instructed to follow source #11's methodology in the review-context skill, then fold its output into the brief.
|
|
46
47
|
|
|
47
|
-
Produce the context brief in the format the skill prescribes (project context, this change's scope, deferred work, dependencies, relevant constraints,
|
|
48
|
+
Produce the context brief in the format the skill prescribes (project context, this change's scope, deferred work, dependencies, relevant constraints, the prior review comments section when present, and the sibling PR context section when related PRs were detected).
|
|
48
49
|
|
|
49
50
|
If context is sparse (no PR description, no ticket references, no relevant memories), note that the change appears standalone. Even a sparse brief is valuable: it tells specialists you looked and found nothing, so they do not need to repeat the search.
|
|
50
51
|
|
|
@@ -57,7 +58,9 @@ Dispatch a sub-agent using the Task tool to research the code workflows affected
|
|
|
57
58
|
|
|
58
59
|
The sub-agent produces a code guide with one section per affected workflow or feature. Wait for it to complete and collect the guide.
|
|
59
60
|
|
|
60
|
-
This guide gives specialists the code-level context (purpose, data flow, evolutions, constraints) they need to avoid false positives about intentional behavior and long-standing design decisions, and reduces duplicate code-tracing across the
|
|
61
|
+
This guide gives specialists the code-level context (purpose, data flow, evolutions, constraints) they need to avoid false positives about intentional behavior and long-standing design decisions, and reduces duplicate code-tracing across the nine specialist lenses.
|
|
62
|
+
|
|
63
|
+
If the context brief includes a sibling register (from Step 2's related-PR discovery), fold it into the guide per the `Cross-PR context` section of the thatch-code-archaeology skill — whether you dispatch a sub-agent or do this research inline. The traps the guide exists to catch are comments referencing sibling work, contracts consumed from a sibling, and ordering assumptions across the stack or train.
|
|
61
64
|
|
|
62
65
|
For small changes (a single file or trivial diff), you may do this research inline instead of dispatching a sub-agent. Use your judgment: if the workflow research would require reading more than 3-4 files, dispatch a sub-agent to preserve your context for orchestration.
|
|
63
66
|
|
|
@@ -129,6 +132,7 @@ Pass the synthesizer:
|
|
|
129
132
|
- The workflow guide from Step 3.
|
|
130
133
|
- The specialist findings.
|
|
131
134
|
- The prior-comments register when present.
|
|
135
|
+
- The sibling register from Step 2 when present.
|
|
132
136
|
- The staleness signal from the brief (commits on main after the merge-base touching this change's paths), when present.
|
|
133
137
|
|
|
134
138
|
The final user-facing report MUST begin with a concise explanation of the workflow(s) this PR changes before listing findings. Use one `### Workflow changes` section, with one subheading per affected workflow when there are multiple. Use the before/now walkthrough shape from the thatch-pr-description skill: numbered step = existing behavior; `NOW` sub-bullet = what the PR changes; `N/A` for new stages. This gives the user a map of the change before the findings. Keep it short: 3-6 steps per workflow.
|
|
@@ -141,15 +145,18 @@ Technique notes (from the technique specialist) appear in a `### Technique notes
|
|
|
141
145
|
|
|
142
146
|
**Follow-up round cross-reference** — if Step 2 built a prior-comments register, the synthesizer must cross-reference every confirmed and rejected finding against it (see the synthesizer skill's "Cross-reference against prior review comments" section). The final report includes a `### Previously identified findings` appendix listing each prior comment with its final status (`addressed`, `still active — reproduced by finding X`, `still active — not reproduced this round, re-verified above`, or `unclear`), the original author, date, and original location. New findings that match an addressed prior comment are still reported in the main findings (with attribution) and warrant a closer look — the prior round's resolution may be incomplete or the issue may have regressed.
|
|
143
147
|
|
|
148
|
+
**Cross-PR consistency** — if Step 2 built a sibling register, the synthesizer must cross-reference findings against it (see the synthesizer skill's "Cross-reference against the sibling PR register" section). A finding claiming something is missing is rejected or downgraded to a stack note when a sibling delivers it. An inconsistency between this change and a sibling becomes a finding of THIS review only when it affects this change's safety or correctness, or when flagging it now heads off a bug the author will hit in imminent follow-up work in the same project; otherwise it lands in the `### Cross-PR notes` appendix, for the sibling's own review (the synthesizer skill's section carries the rule).
|
|
149
|
+
|
|
144
150
|
Alternatively, perform the synthesis yourself:
|
|
145
151
|
1. Read each finding's cited location to verify evidence accuracy.
|
|
146
152
|
2. Deduplicate findings flagged by multiple specialists.
|
|
147
153
|
3. Group findings by root cause where multiple findings stem from the same issue.
|
|
148
154
|
4. Classify each as CONFIRMED, REJECTED, or UNVERIFIABLE. For behavioral findings, apply citation verification, reachability, and intent verification. For mechanical findings, verify the cited text exists, is branch-introduced or newly made relevant, and violates the stated guideline or specialist taxonomy. For highlights, verify the cited text exists, the claim is accurate, and the highlighted thing genuinely rises above baseline competence. For technique notes, verify the cited alternative exists at the cited location and achieves the same behavior; if the code as written is actually a defect, hand the finding to the defect track instead. When the brief reports staleness (main moved past the merge-base touching this change's paths), re-verify each behavioral finding against current main first — a finding true only at the merge-base is a rebase note for the author, not a defect in this PR.
|
|
149
155
|
5. Cross-reference against the prior-comments register if one was built in Step 2: tag matching findings `Provenance: previously identified by @author, PR #N, DATE` and produce the `### Previously identified findings` appendix per the synthesizer skill.
|
|
150
|
-
6.
|
|
151
|
-
7.
|
|
152
|
-
8.
|
|
156
|
+
6. Cross-reference against the sibling register if one was built in Step 2: reject or downgrade to a stack note any finding whose "missing piece" a sibling delivers; confirm findings where this change consumes a contract a sibling does not provide; route sibling-side problems to the Cross-PR notes appendix unless they affect this change's safety or correctness or head off a bug the author will hit in imminent follow-up work in the same project; produce the `### Cross-PR notes` appendix per the synthesizer skill.
|
|
157
|
+
7. Calibrate severity (BLOCKING > HIGH > MEDIUM > LOW) based on your verification.
|
|
158
|
+
8. Produce a final report with a workflow-change preface, highlights (if any), technique notes (if any), findings grouped by severity, coverage gaps, and human-verifiable unknowns noted. Include every confirmed LOW finding.
|
|
159
|
+
9. Apply the synthesizer's "Writing review comments" prose rules to the whole report. Findings are prose, not shorthand: plain English, one idea per sentence, one sentence per hop of any producer chain.
|
|
153
160
|
|
|
154
161
|
## Specialist briefing template
|
|
155
162
|
|
|
@@ -162,6 +169,7 @@ When dispatching each sub-agent, include in the prompt:
|
|
|
162
169
|
- **The project context brief** from Step 2, filtered to what is relevant to this unit's scope. Explicitly list any deferred work that falls within this unit's files, and call out TODO ($ticket) markers the specialists should recognize as intentional.
|
|
163
170
|
- **The workflow guide** from Step 3, filtered to the workflows relevant to this unit's scope. Use it to understand the purpose and evolution of the code before flagging issues. It provides the code-level context (flows, contracts, history, constraints) that prevents false positives about intentional behavior and long-standing design decisions.
|
|
164
171
|
- **The prior review comments register** from Step 2 when present — the list of issues other reviewers already raised, with each comment's current-HEAD location and preliminary status. This is a **hint list, not a finding list**: it saves specialists the work of treating an already-identified issue as newly discovered. Specialists still produce their own findings normally. For any finding that matches a prior comment, set `Provenance` to `previously identified by @author, PR #N, DATE` in addition to the branch-introduced / pre-existing classification — the synthesizer does the final cross-reference and dedup.
|
|
172
|
+
- **The sibling register** from Step 2 when present — the related PRs (stack members and release-train siblings), what each implements, and the targeted consistency verdicts. Before flagging anything as "referenced but missing" or "not implemented anywhere in this change", check the register: a sibling may deliver the missing piece.
|
|
165
173
|
- Any design context or specific concerns
|
|
166
174
|
- Explicit scope boundaries ("your scope is X; do NOT review Y")
|
|
167
175
|
- Instruction to produce markdown findings with: severity, category, file:line, finding, evidence, trigger scenario, reachability, source of truth, producer chain, provenance
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thatch-plan-refinement
|
|
3
|
-
description: Refine a plan for a code change by dispatching a fresh-context reviewer subagent to hunt for gaps, unverified premises, and unexpected side effects, then revising and re-reviewing until consensus. Use when a plan is about to be implemented, when the user asks to refine, stress-test, or double-check a plan, or after a plan revision that incorporated prior findings. This is the generic core loop; when the project type should shape the refinement bar, load thatch-refine instead and it will apply a type delta on top of this loop. Quick mode is one fresh reviewer per round; deep mode adds a specialist lens fan-out (reuse, alternatives, hidden problems, safe-to-modify, archaeology).
|
|
3
|
+
description: Refine a plan for a code change by dispatching a fresh-context reviewer subagent to hunt for gaps, unverified premises, and unexpected side effects, then revising and re-reviewing until consensus. Use when a plan is about to be implemented, when the user asks to refine, stress-test, or double-check a plan, or after a plan revision that incorporated prior findings. This is the generic core loop; when the project type should shape the refinement bar, load thatch-refine instead and it will apply a type delta on top of this loop. Quick mode is one fresh reviewer per round; deep mode adds a specialist lens fan-out (reuse, alternatives, hidden problems, safe-to-modify, archaeology). Deep-mode triggers are binding; when one is met the fan-out runs, and project-type deltas relax round counts, never mode selection.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
You are refining a plan before code exists. A plan written by the same context that researched the problem inherits that context's blind spots. A reviewer with no stake in the plan and no memory of writing it finds what the author cannot. Refinement is the loop: draft, review, revise, repeat until consensus. Each pass tightens the plan; a round with no findings means the plan is done, not that the loop failed.
|
|
@@ -17,6 +17,16 @@ Pick the mode before starting, and say which you picked.
|
|
|
17
17
|
|
|
18
18
|
**Deep mode** — adds a one-time specialist lens fan-out (see below) before the consensus rounds. Use when the plan: touches shared or persistent state (database tables, files, config) that other consumers read; spans many files or multiple hosts/processes; introduces a new abstraction, table, or contract; or when the user asks for depth. Deep mode runs the lenses ONCE, in the first round; the remaining rounds are quick-mode consensus on the revised plan.
|
|
19
19
|
|
|
20
|
+
**These triggers are binding.** If any trigger is met, deep mode's lens fan-out runs for that plan; quick mode is not an option for it. Project-type deltas (`thatch-refine-personal` and its siblings) relax round counts and skip thresholds. They never relax mode selection. The triggers were met verbatim in a 26-round field refinement (October 2026) and quick mode ran anyway, which is why this paragraph is a rule and not advice.
|
|
21
|
+
|
|
22
|
+
## Plan format requirements
|
|
23
|
+
|
|
24
|
+
Two plan shapes earn their own plan section. Add them at draft time; retrofitting them mid-loop costs rounds, because every round after the retrofit re-reviews prose the section would have settled.
|
|
25
|
+
|
|
26
|
+
**State and transition matrix.** Any plan that adds or changes UI or session state (modes, statuses, retention, flags, caches) must carry a state-and-transition matrix as a plan section: every state, every transition between states, and the precedence rule that decides which transition wins when two compete. The first reviewer round verifies every user journey in the plan against the matrix, not against the prose. UX rules written as prose accrete; a matrix makes the unspecified combination impossible to miss. In a 26-round field refinement (October 2026), the state rules of a chat-and-UI plan lived as prose for 16 rounds, and reviewers kept finding combinations no one had written down; a matrix forced at round one would have collapsed most of those findings into the first two rounds.
|
|
27
|
+
|
|
28
|
+
**Deltas-from-template ledger.** When the plan ports or clones a template or twin feature, it must carry a table of deltas from that template. Each row names one divergence and what the twin actually does at that point, verified against the template's source, not remembered. Reviewers check template-behavior claims against the ledger instead of re-deriving the twin's behavior from scratch. In the same field refinement, a template fact flipped across three rounds because each fresh reviewer re-derived it and got a different answer; the ledger is the fix for that class.
|
|
29
|
+
|
|
20
30
|
## The loop
|
|
21
31
|
|
|
22
32
|
1. **Draft the plan.** Every factual premise carries a `file:line` citation you personally verified. A premise you did not check is a guess wearing a citation; verify it or mark it unverified.
|
|
@@ -26,9 +36,26 @@ Pick the mode before starting, and say which you picked.
|
|
|
26
36
|
- Hunt for gaps by severity (blocker / should-fix / nice-to-have), unexpected side effects, blast radius, and the question "how does this fail in production?" — concurrency, stale state, multi-host interactions, test flakiness, and behavior changes for existing callers.
|
|
27
37
|
- Say explicitly when it cannot verify something, rather than guessing.
|
|
28
38
|
3. **Revise the plan** from the findings. Fix what is wrong, adjust what needs adjusting, and record what you rejected and why.
|
|
29
|
-
4. **
|
|
30
|
-
5. **
|
|
31
|
-
6. **
|
|
39
|
+
4. **Run the revision self-check.** Before dispatching the next reviewer, re-read the revision diff against the plan it edits, in the same context, and check three things: does the fix contradict anything else in the plan, does it open a new unspecified corner, and is it consistent with findings already folded in. This is a contradiction check on the diff, not a fresh review, and it is cheap because it reuses context you already have. Skipping it hands the next fresh reviewer your own unfinished edges one round late. In the 26-round field refinement cited above, revision churn dominated rounds 8 through 19 because each fix opened corners no one checked until the next round caught them.
|
|
40
|
+
5. **Dispatch a NEW reviewer with fresh context** on the revised plan. Never continue the prior reviewer's session, and never tell it what previous reviewers said — prior findings anchor the next reviewer, and it will inherit the earlier reviewer's blind spots instead of finding its own. Present the revised plan as if it were the original.
|
|
41
|
+
6. **Consensus** is a round where the reviewer reports no blockers, no unaddressed should-fixes, and the plan's premises all verify. Two consecutive quiet rounds is strong consensus; one is enough to build. For a run extended past the cap, the stopping rule changes; see Extended runs below.
|
|
42
|
+
7. **Cap at three review rounds.** If the plan has not converged by then, stop looping and put the remaining disagreements in front of the user — continued revision usually means the design problem, not the plan, is unresolved. If the user explicitly extends the run past the cap, follow Extended runs below instead of stopping.
|
|
43
|
+
|
|
44
|
+
## Extended runs (past the cap)
|
|
45
|
+
|
|
46
|
+
The cap is a default, not a law. When the user explicitly extends the run ("keep going while it is useful"), do not stop, and do not repeat the general reviewer prompt either. In the 26-round field refinement cited above, the user overrode the cap, the extended rounds kept earning their keep, and the repeated prompt re-trod ground earlier rounds had already covered. Two mechanics govern the extension.
|
|
47
|
+
|
|
48
|
+
**Rotate the reviewer lens.** Each extended round's reviewer prompt carries one lens from a fixed schedule, instead of the general prompt:
|
|
49
|
+
|
|
50
|
+
1. Schema and data model: the tables, columns, constraints, and migrations the plan touches.
|
|
51
|
+
2. Cross-module contracts: the callers, imports, and API surfaces the plan changes.
|
|
52
|
+
3. Lifecycle and edge cases: creation, teardown, concurrency, and failure paths.
|
|
53
|
+
4. Prompt and UI surfaces: user-visible text, states, and flows.
|
|
54
|
+
5. General: the standard reviewer prompt, then restart the schedule.
|
|
55
|
+
|
|
56
|
+
This rotation applies only past the cap. The standard loop keeps the general prompt for all three of its rounds.
|
|
57
|
+
|
|
58
|
+
**Stop on a build-clean round.** For an extended run, consensus is a round with no build-changing findings, where build-changing means the finding would change what gets built, not how a sentence reads. Wording and editorial findings batch into one final editorial pass after the last round; they do not start new rounds. The quiet-round definition in the loop stays in force for standard runs.
|
|
32
59
|
|
|
33
60
|
## Deep mode: the lenses
|
|
34
61
|
|
|
@@ -68,6 +95,8 @@ Do not argue, and do not silently drop the findings. Reduce the risk of building
|
|
|
68
95
|
- Demand `file:line` evidence for every claim, and explicit "unverified" where it cannot check.
|
|
69
96
|
- Ask it to state whether the plan's own list of affected surfaces is complete or over-broad. Plan authors over-scope and under-scope in equal measure.
|
|
70
97
|
- Tell it the repo is read-only for this task.
|
|
98
|
+
- If the plan carries a state-and-transition matrix, tell the reviewer to verify each user journey against the matrix. This is the first round's job in particular.
|
|
99
|
+
- If the plan carries a deltas-from-template ledger, tell the reviewer to check template-behavior claims against the ledger and not re-derive the twin's behavior from its source. Each ledger row already records what the twin does, verified; independent re-derivation is how contradictory facts about the template flip-flop across rounds.
|
|
71
100
|
|
|
72
101
|
## Cost control
|
|
73
102
|
|
|
@@ -32,6 +32,11 @@ below; where they disagree, these win.
|
|
|
32
32
|
- **Degraded review is fine.** If the host cannot dispatch sub-agents, a
|
|
33
33
|
same-context self-review pass is usually enough. Saying so out loud, as
|
|
34
34
|
the core skill requires, is still worthwhile but the stakes are lower.
|
|
35
|
+
- **Round counts drop, not mode selection.** These deltas relax how many
|
|
36
|
+
rounds a run needs. If a deep-mode trigger in `thatch-plan-refinement`
|
|
37
|
+
is met (shared persistent state, many files or hosts, a new
|
|
38
|
+
abstraction, table, or contract, or the user asks for depth), the lens
|
|
39
|
+
fan-out still runs.
|
|
35
40
|
|
|
36
41
|
## Lens weights
|
|
37
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thatch-refine
|
|
3
|
-
description: Classify the current project (audience, lifecycle, surface) and refine a plan under that type's requirements. Entry point for the thatch-refine-* family. Use when the user asks to refine a plan, runs /thatch/refine, or when a plan is about to be implemented and the project type should shape the refinement bar. For a bare "refine this plan" request, load this skill rather than thatch-plan-refinement directly - the router picks the type and applies its delta on top of the core loop.
|
|
3
|
+
description: Classify the current project (audience, lifecycle, surface) and refine a plan under that type's requirements. Entry point for the thatch-refine-* family. Use when the user asks to refine a plan, runs /thatch/refine, or when a plan is about to be implemented and the project type should shape the refinement bar. For a bare "refine this plan" request, load this skill rather than thatch-plan-refinement directly - the router picks the type and applies its delta on top of the core loop. Deep-mode triggers in the core skill are binding; a type delta relaxes round counts, never mode selection.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
You are the entry point for project-type-aware plan refinement. The core
|
|
@@ -68,6 +68,12 @@ pass.
|
|
|
68
68
|
4. Load `thatch-plan-refinement` (the core loop) and the type's skill.
|
|
69
69
|
5. Run the core loop with the type skill's deltas applied. Where a delta
|
|
70
70
|
and the core skill disagree, the delta wins; that is its whole job.
|
|
71
|
+
One exception: mode selection. A delta relaxes round counts, skip
|
|
72
|
+
thresholds, and plan sections. It never turns off deep mode. When a
|
|
73
|
+
deep-mode trigger in `thatch-plan-refinement` is met (shared
|
|
74
|
+
persistent state, many files or hosts, a new abstraction, table, or
|
|
75
|
+
contract, or the user asks for depth), the lens fan-out runs
|
|
76
|
+
regardless of type.
|
|
71
77
|
|
|
72
78
|
If no type fits (the repo serves a niche the table misses), run plain
|
|
73
79
|
`thatch-plan-refinement` and say that the requirements are the generic
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thatch-review-context
|
|
3
|
-
description: Gather project and feature context before a code review. Investigates PR descriptions, git history, ticket references, linked docs/tickets, docs, and
|
|
3
|
+
description: Gather project and feature context before a code review. Investigates PR descriptions, git history, ticket references, linked docs/tickets, docs, memory, and related PRs (stack members, release trains) to build a context brief that prevents false positives about intentionally deferred work and about pieces delivered by sibling PRs. Use before dispatching review specialists or running a solo review.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
You are a review context builder. Your job is to gather project context that gives reviewers the background they need to avoid false positives about intentionally deferred work, incomplete features, and multi-ticket dependencies.
|
|
@@ -85,7 +85,7 @@ If the matching CLI tool (`gh`, `glab`, etc.) is not on PATH and you cannot call
|
|
|
85
85
|
#### Detect the connected PR/MR
|
|
86
86
|
|
|
87
87
|
Use the current branch name (without remote or merge-base prefix) to look up an open PR/MR:
|
|
88
|
-
- **GitHub**: `gh pr view
|
|
88
|
+
- **GitHub**: `gh pr view <branch> --json number,title,state,headRefName,baseRefName,headRefOid,baseRefOid`. Fallback: `gh api repos/{owner}/{repo}/pulls --jq ".[] | select(.head.ref==\"<branch>\")"`.
|
|
89
89
|
- **GitLab**: `glab mr list --source-branch <branch>`.
|
|
90
90
|
- **Bitbucket Cloud**: REST `https://api.bitbucket.org/2.0/repositories/<owner>/<slug>/pullrequests?q=source.branch.name="<branch>"` (no widely-adopted CLI; call via available HTTP tool).
|
|
91
91
|
- **Azure DevOps**: `az repos pr list --source-branch <branch> --org <org-url> -r <project>`.
|
|
@@ -132,6 +132,46 @@ Directory structure conventions are often undocumented. They live in the repo's
|
|
|
132
132
|
|
|
133
133
|
This gives the pedantic specialist the structural context without having to discover the pattern independently.
|
|
134
134
|
|
|
135
|
+
### 11. Related PRs: stacks and release trains
|
|
136
|
+
|
|
137
|
+
A change is often one piece of a coordinated set of PRs. The other pieces are outside this diff, so specialists cannot see them. Two false-positive patterns result: a comment references work that a sibling PR delivers, or the change consumes a contract that a sibling PR defines. Discover the set and record what each piece does.
|
|
138
|
+
|
|
139
|
+
Two shapes to look for:
|
|
140
|
+
- **Stack**: PRs that merge into each other. This PR's base branch is another PR's head branch.
|
|
141
|
+
- **Release train**: PRs that all target the main branch but must merge or deploy in a specific order. The order lives in tracker relations or ticket DEPENDENCIES sections (the ticket section that names the change's blocking links; the links carry the ordering, the bullets carry only the rationale), not in the branch structure.
|
|
142
|
+
|
|
143
|
+
#### Discovery
|
|
144
|
+
|
|
145
|
+
- **Stack chaining**: if the connected PR's base branch is not the main branch, another PR probably owns that branch as its head. Find it (`gh pr view <base-branch>` on GitHub, `glab mr list --source-branch <base-branch>` on GitLab), then repeat from that PR until the chain reaches the main branch. Walk at most 5 links in each direction; record deeper stack members as `unexplored` register entries. Also look downward: `gh pr list --base <this-branch>` (GitHub) or `glab mr list --target-branch <this-branch>` (GitLab) finds PRs stacked on top of this one.
|
|
146
|
+
- **Tracker relations**: tickets surfaced by the earlier sources carry blockedBy/blocks relations, parent epics, and DEPENDENCIES sections that name the ordered set. Stack chaining cannot find a release train, because every PR in a train targets main; this route is the primary way trains surface. Map each ticket in the set to its PR/MR (`gh pr list --search "TICKET-ID"` on GitHub, or the tracker's attached-PR link); a ticket with no open PR stays a dependency recorded in the brief's Dependencies section, not a register entry.
|
|
147
|
+
- **Linked PRs** from sources 1 and 8. Deduplicate against the two methods above.
|
|
148
|
+
|
|
149
|
+
A sibling that already merged to main is also covered by the staleness check (source 3). Record it in the register anyway, for context.
|
|
150
|
+
|
|
151
|
+
#### Build the sibling register
|
|
152
|
+
|
|
153
|
+
For each sibling PR/MR:
|
|
154
|
+
- PR/MR number, title, state (open/merged/closed/draft)
|
|
155
|
+
- Its base branch, and for stacks its position in the chain
|
|
156
|
+
- One line: what it implements, from its description and diff stat
|
|
157
|
+
|
|
158
|
+
This field list is canonical: the brief section below and the synthesizer's Cross-PR notes appendix render the register as built here. An `unexplored` entry (a stack member beyond the walk cap) carries the number, title, state, base branch, and chain position, but no what-it-implements line and no consistency verdicts; the sibling's description and diff were not read.
|
|
159
|
+
|
|
160
|
+
#### Targeted consistency verification
|
|
161
|
+
|
|
162
|
+
Read every sibling's description in full. Open a sibling's diff only to verify the specific contracts, symbols, and references this change consumes or mentions. Never run a full second review of a sibling. Checks:
|
|
163
|
+
|
|
164
|
+
1. **Contract check**: an API, type, schema, config key, or flag this change consumes from a sibling matches the sibling's actual implementation at its head SHA.
|
|
165
|
+
2. **Reference check**: a comment or doc in this change references a thing X. X exists in this change or in a sibling. If neither delivers X, the reference is dangling.
|
|
166
|
+
3. **Ordering check**: the change or its ticket claims a merge or release order for the set. Verify the claim is stated and consistent with the stack chain or the tracker relations.
|
|
167
|
+
4. **Overlap check**: two PRs in the set implement the same thing differently.
|
|
168
|
+
|
|
169
|
+
Tag each check that applied: `consistent`, `inconsistent` (with the evidence), or `unclear`.
|
|
170
|
+
|
|
171
|
+
#### Early-out
|
|
172
|
+
|
|
173
|
+
If the discovery routes above surfaced no related PR/MR and no coordinated ticket set, state `Standalone change — no sibling register` and skip this source. A coordinated ticket set with no open PRs is not standalone: record it under Dependencies. Most personal projects land here; the source costs one look.
|
|
174
|
+
|
|
135
175
|
## Context brief format
|
|
136
176
|
|
|
137
177
|
Produce a structured brief:
|
|
@@ -154,6 +194,7 @@ List each deferred piece:
|
|
|
154
194
|
- What other tickets or PRs this depends on (must merge first)
|
|
155
195
|
- What tickets or PRs depend on this (are blocked by it)
|
|
156
196
|
- Whether base branches have landed (for stacked PRs)
|
|
197
|
+
- **Release order**: when a ticket or the PR description claims a merge or deploy order for a set of changes, record the claimed order and where it is claimed (which ticket's DEPENDENCIES section, which tracker relation, or which PR description)
|
|
157
198
|
- **Staleness**: whether main has moved past the merge-base since the branch point. When the staleness check (source 3) found commits touching this change's paths, list them here — the synthesizer re-verifies behavioral findings against current main before classifying them
|
|
158
199
|
|
|
159
200
|
### Relevant constraints
|
|
@@ -175,6 +216,18 @@ If context gathering found a connected PR/MR but no prior reviews by other users
|
|
|
175
216
|
|
|
176
217
|
If context gathering found no connected PR/MR (local-branch review), state `Local-branch review — no prior-comment fetch`. This is not a gap; the existing review procedure applies.
|
|
177
218
|
|
|
219
|
+
### Sibling PR context (only when related PRs were detected)
|
|
220
|
+
|
|
221
|
+
List the sibling register as built above (one entry per sibling):
|
|
222
|
+
- PR/MR number, title, state, base branch, and for stacks the chain position
|
|
223
|
+
- What it implements (one line)
|
|
224
|
+
- Consistency verdicts from the targeted checks (`consistent` / `inconsistent` with evidence / `unclear`), only for the checks that applied
|
|
225
|
+
- An `unexplored` entry renders its fields only; the missing what-it-implements line and verdicts record the walk cap, not a gap
|
|
226
|
+
|
|
227
|
+
Whether base branches have landed is recorded under Dependencies above, not here.
|
|
228
|
+
|
|
229
|
+
If discovery found no related PRs and no coordinated ticket set, state `Standalone change — no sibling register`. This is not a gap; the change is not part of a coordinated set. A coordinated ticket set with no open PRs is not standalone: its claimed order is recorded under Dependencies.
|
|
230
|
+
|
|
178
231
|
## If context is sparse
|
|
179
232
|
|
|
180
233
|
Not every PR will have rich context. If you find minimal context:
|
|
@@ -30,7 +30,7 @@ Run `git fetch origin` (NOT `git pull`). Inspect `git remote -v` to recognize th
|
|
|
30
30
|
- `dev.azure.com` → Azure DevOps
|
|
31
31
|
|
|
32
32
|
Probe for an open PR/MR on the current branch:
|
|
33
|
-
- **GitHub**: `gh pr view
|
|
33
|
+
- **GitHub**: `gh pr view <branch> --json number,title,headRefOid,baseRefOid,baseRefName`
|
|
34
34
|
- **GitLab**: `glab mr list --source-branch <branch>`
|
|
35
35
|
|
|
36
36
|
If no PR/MR is found or no VCS CLI is available, you cannot re-check. Report this and stop.
|
|
@@ -79,7 +79,7 @@ Compare `LAST_ROUND_SHA` to `CURRENT_SHA`:
|
|
|
79
79
|
|
|
80
80
|
**Force-push check**: run `git merge-base --is-ancestor <LAST_ROUND_SHA> <CURRENT_SHA>`. If it fails, the author rewrote history (force-pushed). Line numbers may have drifted. You will need to locate each finding's equivalent location in the new HEAD by matching surrounding context, not by line number.
|
|
81
81
|
|
|
82
|
-
**Merge-from-
|
|
82
|
+
**Merge-from-base check**: if the author merged the default branch into the branch between rounds — or, on a stacked PR, merged or rebased onto the PR's base branch — plain `git log <LAST_ROUND_SHA>..<CURRENT_SHA>` and `git diff <LAST_ROUND_SHA> <CURRENT_SHA>` both pull in every base commit, burying the author's actual response commits. To see only the author's commits, run `git log <LAST_ROUND_SHA>..<CURRENT_SHA> --not origin/<default-branch>` after `git fetch origin` (usually main or master). On a stacked PR (Step 1's probe returned a base branch that is not the default branch — `baseRefName` on GitHub, the MR's target branch on GitLab), also fetch the base branch and exclude it too: `git fetch origin <base-branch>`, then `git log <LAST_ROUND_SHA>..<CURRENT_SHA> --not origin/<default-branch> origin/<base-branch>`. Then read each remaining commit's diff with `git show <sha>`. Do not assume a large diff stat means the author rewrote the PR. Check for a merge commit first.
|
|
83
83
|
|
|
84
84
|
### Read author responses
|
|
85
85
|
|
|
@@ -152,7 +152,7 @@ Produce a structured report for the user:
|
|
|
152
152
|
- PR/MR number, title
|
|
153
153
|
- Last-reviewed SHA, current SHA
|
|
154
154
|
- Whether the author pushed changes, responded to comments, or both
|
|
155
|
-
- Force-push or merge-from-
|
|
155
|
+
- Force-push or merge-from-base detected (if applicable)
|
|
156
156
|
|
|
157
157
|
### Finding verification
|
|
158
158
|
|
|
@@ -275,7 +275,7 @@ After all findings have been dealt with (adequately addressed and replied to, or
|
|
|
275
275
|
### How to offer
|
|
276
276
|
|
|
277
277
|
Present the offer as a choice:
|
|
278
|
-
1. **Re-run the full structured review**: load `thatch-code-review` on the current HEAD. It will dispatch all
|
|
278
|
+
1. **Re-run the full structured review**: load `thatch-code-review` on the current HEAD. It will dispatch all nine specialists on the merge-base..HEAD range. The existing follow-up detection will cross-reference your prior comments. On Claude Code or Cursor (no sub-agent support), run each specialist skill in sequence, then run `thatch-review-synthesizer` to aggregate.
|
|
279
279
|
2. **End the re-review here**: the user confirmed their concerns were addressed (or decided how to handle the unaddressed ones) and does not want another full round.
|
|
280
280
|
|
|
281
281
|
The offer is just an offer. The user may decline. They may have only wanted to confirm their concerns were addressed.
|
|
@@ -80,7 +80,7 @@ Identify the PR and VCS host:
|
|
|
80
80
|
recognize the VCS host: `github.com` -> GitHub (`gh`), `gitlab.*` ->
|
|
81
81
|
GitLab (`glab`), `bitbucket.org` -> Bitbucket Cloud, `dev.azure.com` ->
|
|
82
82
|
Azure DevOps.
|
|
83
|
-
- Probe for an open PR on the current branch: `gh pr view
|
|
83
|
+
- Probe for an open PR on the current branch: `gh pr view <branch>
|
|
84
84
|
--json number,title,headRefOid` (GitHub) or equivalent.
|
|
85
85
|
|
|
86
86
|
Fetch ALL review comments:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thatch-review-synthesizer
|
|
3
|
-
description: Verify and synthesize findings from multiple review specialist skills into a single deduplicated, severity-grouped report. Use after running one or more thatch-review-* specialist skills.
|
|
3
|
+
description: Verify and synthesize findings from multiple review specialist skills into a single deduplicated, severity-grouped report. Cross-references prior review comments and sibling PR registers when provided. Use after running one or more thatch-review-* specialist skills.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
You are a review synthesizer. You have received findings from one or more review specialists (pedantic, acceptance, state-flow, economy, no-slop, breadcrumbs, mark-and-sweep, highlights, technique). Your job is to verify their citations against the actual code, deduplicate across specialists, and produce a single, coherent final report.
|
|
@@ -95,6 +95,14 @@ New findings that match a prior comment tagged `addressed` (preliminary) are sti
|
|
|
95
95
|
|
|
96
96
|
When the VCS resolve flag (GitLab `resolved`, GitHub `isResolved`) disagrees with the code-state verdict (e.g., thread marked resolved in the UI but the bug persists), trust the code state and call out the disagreement in the appendix entry.
|
|
97
97
|
|
|
98
|
+
## Cross-reference against the sibling PR register
|
|
99
|
+
|
|
100
|
+
If your input includes a **sibling register** (built via `thatch-review-context` source #11 — related PRs detected as stack members or release-train siblings), apply it during classification, before finalizing any finding whose claim crosses PR boundaries.
|
|
101
|
+
|
|
102
|
+
- A finding claiming a referenced thing is **missing** ("comments reference X but nothing implements X", "flagged as unused or undefined") is REJECTED — or moved to the Cross-PR notes appendix as a stack note — when the register shows a sibling PR delivers it. Cite the sibling PR and its register entry as the reason.
|
|
103
|
+
- A finding that this change **consumes a contract a sibling does not actually provide** (shape mismatch, renamed symbol, different semantics at the sibling's head) is CONFIRMED, with the `Provenance` field citing the sibling PR.
|
|
104
|
+
- A problem discovered **in the sibling itself** is not a finding of this review by default. Record it in the Cross-PR notes appendix so it can be raised in the sibling's own review. Escalate it to a finding of THIS review only when the inconsistency affects this change's safety or correctness, or when flagging it now heads off a bug the author will hit in imminent follow-up work in the same project.
|
|
105
|
+
|
|
98
106
|
## Severity calibration
|
|
99
107
|
|
|
100
108
|
Assign final severity based on YOUR verification:
|
|
@@ -323,6 +331,18 @@ List every entry from the prior-comments register here. For each entry, produce
|
|
|
323
331
|
|
|
324
332
|
If no prior-comments register was provided (local-branch review or first round on the PR/MR), state `None — no prior review comments to cross-reference` and move on.
|
|
325
333
|
|
|
334
|
+
### Cross-PR notes (appendix — only when a sibling register was provided)
|
|
335
|
+
|
|
336
|
+
List every sibling in the register here. For each sibling, produce a one-block record:
|
|
337
|
+
1. **PR/MR number, title, state, base branch**, and for stacks its position in the chain
|
|
338
|
+
2. **What it implements** (one line from the register)
|
|
339
|
+
3. **Consistency verdicts**: `consistent` / `inconsistent` (with the evidence) / `unclear`, per targeted check that applied
|
|
340
|
+
4. **Notes for the sibling's own review**: problems discovered in the sibling that belong in its review, not this one
|
|
341
|
+
|
|
342
|
+
An `unexplored` entry renders item 1's fields and states `unexplored — not read` for items 2 and 3.
|
|
343
|
+
|
|
344
|
+
Omit this section entirely when no sibling register was provided (standalone change or local-branch review).
|
|
345
|
+
|
|
326
346
|
### Coverage gaps
|
|
327
347
|
|
|
328
348
|
Note which files or areas were NOT covered by any specialist.
|