pi-gauntlet 5.1.0 → 5.2.1

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.
@@ -112,7 +112,14 @@ Reviewers certify fix concurrency with a `Parallel-safe:` line (see the reviewer
112
112
 
113
113
  **Precondition:** a clean committed HEAD containing the code under review. When the reviewed change is an unintegrated patch (a wave-mode per-patch spec review), each fix task branches from the wave's base HEAD and carries the prior patch verbatim in its task text — the consuming loop's existing re-dispatch protocol. When the tree is dirty (e.g. post-integration, before the wave commit), the fan-out is unavailable: fix sequentially in place.
114
114
 
115
- **Degradation:** missing, malformed, or ID-less `Parallel-safe:` line, or no `disjoint` group with ≥ 2 IDs → fully sequential fixes. Degradation is silent — it costs parallelism, never correctness.
115
+ Grammar (identical across producers, modulo id prefix — `F` for code/spec reviewers, `G` for conformance-reviewer):
116
+
117
+ ```text
118
+ <group> = <comma-separated id list> " disjoint"
119
+ | <id> " conflicts " <id> " (" <reason> ")"
120
+ ```
121
+
122
+ **Structural probe:** when the report carries >= 2 actionable finding IDs (Critical/Moderate findings for code-reviewer; PARTIAL/MISSING/scope-creep findings for spec-reviewer; non-DELIVERED gaps for conformance-reviewer), validate the certificate before the fan-out decision: the review must contain **exactly one** line matching `^Parallel-safe: ` whose remainder parses as `<group>[; <group>]*` (grammar above). Zero matching lines, an unparseable remainder, or **any second** `Parallel-safe:` line (identical or not) = malformed -> re-ask the reviewer **once**, quoting the expected grammar, before any disposition or fan-out decision. Still malformed after the re-ask -> fully sequential fixes with an explicit one-line degradation notice in the orchestrator's visible output — never silent. A probe-passing line with no >= 2-ID `disjoint` group is **valid**: sequential fixes, no re-ask, no notice (the certificate says "serial", not a malformation). Fewer than 2 actionable IDs -> skip the probe (nothing to fan out). Reviewer errors (no report at all) are out of scope here — report-shape validation, not report-existence; existing dispatch-failure handling applies.
116
123
 
117
124
  **After the fix wave:** integrate patches serially per "Review and Integrate" above (mis-partition is self-healing: integrate the successes, re-run the conflicting finding sequentially on integrated HEAD); run the consuming loop's scoped test gate on the integrated tree; then one re-review of the integrated fix delta, per the consuming loop's own rules. The fan-out counts as one fix round against the consuming loop's budget — it grants no extra rounds.
118
125
 
@@ -21,8 +21,10 @@ this skill alters re-gates.
21
21
 
22
22
  ## 1. Setup
23
23
 
24
- Mandatory: `linearis` on PATH and authenticated (`linearis auth status`). Token
25
- resolution order: `--api-token`, `LINEAR_API_TOKEN`, `~/.linearis/token`.
24
+ Preferred: `linearis` on PATH and authenticated (`linearis auth status`). Token
25
+ resolution order: `--api-token`, `LINEAR_API_TOKEN`, `~/.linearis/token`. This is a
26
+ preference, not a precondition - a missing or unauthenticated CLI degrades Linear
27
+ functionality and is reported, never blocks the run.
26
28
 
27
29
  > **No `linearis` installed?** If `command -v linearis` fails, fall back to a
28
30
  > **Linear MCP server** when the harness has one configured - its tools cover the
@@ -32,7 +34,20 @@ resolution order: `--api-token`, `LINEAR_API_TOKEN`, `~/.linearis/token`.
32
34
  > examples below are then guidance for the equivalent MCP call, not literal
33
35
  > shell. pi-gauntlet ships no MCP setup; MCP is opportunistic.
34
36
 
35
- No `linearis` and no MCP: report inability, never fabricate.
37
+ No `linearis` and no MCP: report inability, never fabricate. MCP is the fallback for a
38
+ **missing binary only** (`command -v linearis` fails); an installed-but-unauthenticated
39
+ `linearis` re-auths rather than rerouting to MCP.
40
+
41
+ **Session sweep.** When `linearis` is present and authenticated, run
42
+ `linearis issues usage` once per session, before the first issue operation, and treat
43
+ its output as ground truth for the **issue-domain rows** of the section 3 table (Read,
44
+ Search, List, Create, Update, Discuss, Reply, Edit). Non-issue domains such as labels,
45
+ teams, users, cycles, projects, attachments, files are outside this call's coverage and
46
+ fall to the section 8 backstop, same as any row the sweep didn't run or couldn't reach.
47
+ If the call errors, returns nothing, or the MCP path is in use, note once that the
48
+ issue-domain rows are unverified this session and continue. The sweep lives inside this
49
+ branch only - strictly after the override check above - so
50
+ `tracker: github | none | <unknown>` still means zero probing.
36
51
 
37
52
  Optional: each `## Issue tracker` override key below, with its degradation.
38
53
 
@@ -87,43 +102,50 @@ treated as absent.
87
102
  | Create | `linearis issues create "<title>" --team <default team> [--parent-ticket <id>] --status <status>` | Title is positional (no `--title`); `--team` required; `--parent-ticket` for sub-issues; state an explicit `--status` rather than relying on the default. |
88
103
  | Update | `linearis issues update <id> --status <status> --assignee <who> --labels <labels> --due-date <date> [relation flags]` | See gotcha (e) for relation flags. |
89
104
  | Discuss | `linearis issues discuss <id> --body "<text>"` | Starts a new top-level comment thread. |
90
- | Reply | `linearis issues reply <id> --body "<text>"` | Root comments only - see gotcha (b). |
91
- | Edit | `linearis issues comment-edit <id> --body "<text>"` / `linearis issues edit-reply <id> --body "<text>"` | Full rewrite, no history - see gotcha (a). |
105
+ | Reply | `linearis issues reply <thread> --body "<text>"` | `<thread>` is a root discussion thread ID, not an issue ID - see gotcha (b). |
106
+ | Edit | `linearis issues edit <comment> --body "<text>"` / `linearis issues edit-reply <reply> --body "<text>"` | Full rewrite, no history - see gotcha (a). |
92
107
  | Labels, teams, users, cycles | `linearis labels list`, `linearis teams list`, `linearis users list`, `linearis cycles list` | Use to resolve names to IDs; see id-cache convention. |
93
- | Attachments | `linearis attachments create <id> --url <url>` | Link-only, no inline render - see gotcha (d). |
94
- | Upload | `linearis files upload <path>` | Returns an `assetUrl` for inline embedding - see gotcha (d). |
108
+ | Attachments | `linearis attachments create [<issue>] --url <url>` | Positional is optional (`--issue <issue>` alias); link-only, no inline render - see gotcha (d). |
109
+ | Upload | `linearis files upload <file>` | Returns an `assetUrl` for inline embedding - see gotcha (d). |
95
110
 
96
111
  Workspace values above (`<default team>`, `<who>`, etc.) are placeholders bound to
97
112
  the override keys in section 2 - never a real urlKey, team prefix, or email.
98
113
 
114
+ Snapshot verified against `linearis 2026.7.0` (2026-09-01). The installed CLI's
115
+ `usage`/`--help` is ground truth; when they disagree, follow the CLI and tell the user
116
+ this table is stale.
117
+
99
118
  ## 4. Gotchas
100
119
 
101
120
  a. **Comment edit is a rewrite, no visible history.** To amend rather than replace,
102
121
  fetch the old body and pass `OLD + "\n\n" + ADDITION`; surface the overwrite diff
103
122
  to the user before pushing.
104
123
 
105
- b. **`reply` targets must be root comments** (`parentId: null`). A non-root target
106
- fails with a misleading validation error. To respond in-thread, resolve the
107
- thread's root via `discussions`/`--with-comment-threads` and `reply` to that
108
- root, or start a new `discuss` thread instead. `edit-reply` is NOT a reply
109
- fallback - it rewrites an existing reply. Use it only for an explicitly
110
- requested edit of the caller's own reply, behind the rewrite-confirmation rule
111
- in (a).
124
+ b. **`reply` targets must be root discussion threads.** `--help`: "`<thread>` must be a
125
+ root discussion thread ID." A non-root target fails with a misleading validation
126
+ error. To respond in-thread, resolve the thread's root via
127
+ `discussions`/`--with-comment-threads` and `reply` to that root, or start a new
128
+ `discuss` thread instead. `edit-reply` is NOT a reply fallback - it rewrites an
129
+ existing reply. Use it only for an explicitly requested edit of the caller's own
130
+ reply, behind the rewrite-confirmation rule in (a).
112
131
 
113
132
  c. **`@ABC-123` never resolves via the CLI/API.** Use the full issue URL
114
133
  `https://linear.app/<workspace urlKey>/issue/<id>`, which unfurls to a native
115
134
  badge and records a relation. A literal `@ID` in a body stays literal text.
116
135
 
117
- d. **Images go inline, links don't render.** `linearis files upload <path>` ->
136
+ d. **Images go inline, links don't render.** `linearis files upload <file>` ->
118
137
  `![alt](<assetUrl>)` in the body embeds the image. `attachments create` only
119
138
  links a URL and renders no image. Asset URLs returned by a `read` are
120
139
  short-lived signed JWTs - re-upload for a fresh one, never re-paste an old one.
121
140
 
122
- e. **Relation flags are single-value.** `--blocks`, `--blocked-by`, `--relates-to`,
123
- `--duplicate-of` on `create`/`update` keep only the last value if repeated in one
124
- call. For multiple relations in one call, use
125
- `linearis issues relations add <id>` with its comma-separated flags; otherwise
126
- issue separate `update` calls.
141
+ e. **Two different relation flag sets.** On `create`/`update`: `--blocks`,
142
+ `--blocked-by`, `--relates-to`, `--duplicate-of`, `--similar-to`, plus
143
+ `--remove-relation` on `update`. These are single-value - repeating one in a single
144
+ call keeps only the last value (observed behavior, not stated by `--help`). On
145
+ `linearis issues relations add <issue>` the set is smaller and comma-separated:
146
+ `--blocks`, `--related`, `--duplicate`, `--similar` - there is **no** `--blocked-by`,
147
+ so express that direction by inverting the relation or using `update`. For multiple
148
+ relations in one call use `relations add`; otherwise issue separate `update` calls.
127
149
 
128
150
  f. **`create`'s title is positional.** There is no `--title` flag.
129
151
 
@@ -173,9 +195,16 @@ Safety rules, in addition to the write gate above:
173
195
  | Missing `--team` error on create | `--team` is required | Supply `--team <default team>`. |
174
196
  | Search returns nothing unexpected | Search is case-sensitive | Retry with matching case. |
175
197
  | Cannot edit a comment | Comment belongs to another user | Reply instead of editing. |
176
- | Reply validation error | Target is not a root comment | See gotcha (b). |
198
+ | Reply validation error | Target is not a root discussion thread | See gotcha (b). |
177
199
  | `@ID` shows as literal text | `@ABC-123` mentions don't resolve | Use the full issue URL (gotcha c). |
178
200
  | Read is slow | Big ticket with many comments/attachments | Drop `--with-*` flags not needed. |
201
+ | Parser-shape failure on a documented invocation: unknown command/option, unexpected argument | Section 3's snapshot may have drifted from the installed CLI | Re-read that subcommand's `--help`; report the row stale **only if** help actually contradicts it, then follow help |
202
+
203
+ The last row's trigger is deliberately narrow. Data, auth, status-name, and root-thread
204
+ validation errors have their own rows above and are **not** drift - routing them to "the
205
+ skill is stale" would misdiagnose ordinary failures. This row is the reactive path for
206
+ when the section 1 session sweep didn't run, couldn't run, or doesn't cover the failing
207
+ subcommand (any row outside the `issues` domain).
179
208
 
180
209
  ## 9. Discovery pointers
181
210
 
@@ -57,7 +57,7 @@ subagent({ agent: "code-reviewer", task: "... filled template ..." })
57
57
  - Note Minor issues for later
58
58
  - Push back if reviewer is wrong (with reasoning)
59
59
 
60
- **Fix rounds.** Critical and Moderate findings trigger a fix round; when dispatched from an orchestrating skill, fixes go to `implementer` subagents (per the orchestrator's no-self-coding rule), fanned out per `dispatching-parallel-agents` "Fix fan-out" when the review's `Parallel-safe:` line certifies a `disjoint` group of ≥ 2 findings. After integration and the project's test command, re-dispatch the reviewer once on the integrated delta. If Critical or Moderate findings remain, run one more fix round and one more re-review; still failing → escalate to the user. Minor findings never trigger the fan-out.
60
+ **Fix rounds.** Critical and Moderate findings trigger a fix round; when dispatched from an orchestrating skill, fixes go to `implementer` subagents (per the orchestrator's no-self-coding rule), fanned out per `dispatching-parallel-agents` "Fix fan-out" when the review's `Parallel-safe:` line certifies a `disjoint` group of ≥ 2 findings. Before fanning out, validate the review's `Parallel-safe:` line with the structural probe in `dispatching-parallel-agents` § Fix fan-out (exactly-one-line grammar check, one re-ask, then explicit sequential fallback). After integration and the project's test command, re-dispatch the reviewer once on the integrated delta. If Critical or Moderate findings remain, run one more fix round and one more re-review; still failing → escalate to the user. Minor findings never trigger the fan-out.
61
61
 
62
62
  ## Example
63
63
 
@@ -243,7 +243,7 @@ For the fan-out + worktree + patch-integration + conflict mechanics, see `dispat
243
243
  - Skipping the `Implementer Status` parse — treating every response as DONE
244
244
  - Starting on main without explicit user consent
245
245
  - Dispatching `code-reviewer` before every one of the wave's spec-review verdicts has landed (including fusing SR+CR into one parallel call)
246
- - Dispatching fixes sequentially on a clean HEAD despite a ≥ 2-ID `disjoint` group in the review's `Parallel-safe:` line
246
+ - Dispatching fixes sequentially on a clean HEAD despite a certified (probe-passing, per dispatching-parallel-agents § Fix fan-out) ≥ 2-ID `disjoint` group in the review's `Parallel-safe:` line
247
247
  - Dispatching `code-reviewer` per task inside a wave (CR binds to the integrated wave diff)
248
248
  - Dispatching an implementer or code-reviewer without a `SCOPED_TEST_COMMANDS` value (commands or `none`)
249
249
  - About to run the full verification entrypoint during the implement phase — task and wave gates run scoped, plan-declared commands only; the full set belongs to verify
@@ -290,19 +290,16 @@ If a decision is genuinely open, put it in an explicit **Open Questions** sectio
290
290
 
291
291
  ## Self-Review (Before Handoff)
292
292
 
293
- After drafting the plan and before announcing it complete, run these checks yourself. This is a checklist you run yourself — not a subagent dispatch.
293
+ After drafting the plan and before announcing it complete, run the deterministic checker, then the judgment checks yourself — not a subagent dispatch.
294
294
 
295
- - **Table closure (three legs).** Every `## Spec coverage` row's owner is a task-ID list, a spec-authorized `waived: <reason>`, or a mechanical-task row; every `### Task N` heading appears in >=1 row; every requirement row's anchor is contained in the anchor set of each listed owner task's `**Spec:**` line. Zero orphans, zero waived in-scope normative rows, zero row-vs-owner anchor mismatches. Each Documentation impact entry maps to a plan task (or explicit "none").
295
+ - **Deterministic checker.** Run `plan_check({ planPath })` on the saved plan. Assess and fix every finding yourself (no human involvement), then re-run until it passes — a pass writes the execution stamp that implement-start verifies mechanically. If the same finding survives 3 fix rounds, convert it to an explicit Open Question and stop (the pre-existing Open-Questions halt, resolved by the human in-session — not a new gate). The checker covers table closure, quote integrity, anchor resolution, path existence, placeholder scan, wave file-disjointness, solo-line presence, and header-only entrypoint.
296
296
  - **Code-vs-anchor sanity.** For each non-waived requirement row, re-read the anchored spec lines and confirm the owner tasks' bodies do what they say - mechanism present, not just the quoted literal. Fix the task, don't annotate.
297
- - **Quote integrity (spec -> task).** For every non-waived requirement row, extract each backtick-quoted literal inside the row's anchored spec lines (strip the backticks; skip `<placeholder>` template spans) and `grep -F` it against the owning task's body — zero misses. Planner-authored backticks elsewhere in tasks are never scanned; the input set is spec-side literals only.
298
- - **Anchor resolution.** For every task-level anchor (a `**Spec:**` line carrying `§`; the plan header's path line is exempt), the quoted heading text matches an ATX heading in the spec file and `L<start>-L<end>` is in-bounds, non-empty, and lies within that heading's section — zero unresolved anchors. Verify with `grep -n '^#'` plus a scoped `sed -n`. Ignore `#`-lines inside fenced code blocks when locating headings and section boundaries - a fenced markdown example is not a heading.
299
- - **Paths exist.** Every `Modify:` path in `Files:` blocks passes `test -f` after stripping any trailing `:line[-line]` suffix; a `Modify:` glob must expand to >=1 match; `Create:` and `Test:` paths are exempt unless the `Test:` path is also listed under `Modify:`. Zero missing.
300
- - **Placeholder scan.** Grep the doc for `TODO`, `TBD`, `xxx`, `[fill in]`, `<example>`, `etc.`, "probably", "something like". Resolve or convert each into an explicit Open Question.
301
297
  - **Type / API consistency.** Function signatures and field names that appear in multiple tasks must match exactly. The plan is its own contract — internal contradictions surface as bugs during execution.
302
- - **Wave disjointness.** For every multi-task wave, confirm the tasks' `Files:` sets are pairwise disjoint **and** that no two tasks contend on a shared mutable runtime resource (DB/schema, port, fixture, external service, shared temp path). Either kind of overlap = mis-grouped wave; split or re-order before handoff.
303
- - **Solo-wave justification.** Every single-task wave carries a `Solo:` line naming its specific blocker. A solo wave without one is mis-grouped or under-justified — merge it or justify it before handoff.
304
298
  - **Scoped-test coverage.** Every code-touching wave declares at least one scoped test command; only doc-only waves may have none.
305
- - **Header-only entrypoint.** The full verification entrypoint appears only in the plan header's `**Verification:**` line. Grep the task body for the header's command string — expect zero hits.
299
+ - **Runtime-resource disjointness.** For every multi-task wave, confirm no two tasks contend on a shared mutable runtime resource (DB/schema, port, fixture, external service, shared temp path) — `Files:` overlap is checked mechanically, resource contention is not. Contention = mis-grouped wave; split or re-order before handoff.
300
+ - **Solo-reason validity.** Every single-task wave's `Solo:` line (presence is checked mechanically) must name its specific blocker — the blocking task/wave, the contended resource, or `lone remaining task`. Category-only justifications are under-justified; merge or justify before handoff.
301
+ - **Waiver authorization.** Every `waived: <reason>` owner in `## Spec coverage` is authorized by the spec itself marking the item out of scope. A waiver on an in-scope normative requirement is a Self-Review failure — there is no human plan-review gate to catch it downstream.
302
+ - **Documentation-impact mapping.** Each Documentation impact entry maps to a plan task (or explicit "none").
306
303
 
307
304
  Fix what this review finds before handoff.
308
305