pi-gauntlet 7.38.1 → 7.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +8 -4
- package/extensions/phase-tracker.test.ts +3 -1
- package/extensions/phase-tracker.ts +2 -1
- package/package.json +2 -2
- package/skills/brainstorming/SKILL.md +15 -8
- package/skills/brainstorming/gatherer.md +3 -3
- package/skills/brainstorming/reference/amendment-surface.md +4 -0
- package/skills/brainstorming/reference/menu-layout.md +20 -0
- package/skills/brainstorming/reference/pr-subject.md +13 -1
- package/skills/brainstorming/reference/spec-finalization.md +12 -8
- package/skills/brainstorming/reference/spec-pr.md +62 -0
- package/skills/brainstorming/reference/ticket-acceptance.md +3 -1
- package/skills/chase-bug/SKILL.md +6 -0
- package/skills/check-delivery/SKILL.md +6 -0
- package/skills/finishing-a-development-branch/SKILL.md +17 -17
- package/skills/finishing-a-development-branch/reference/disposition-protocol.md +2 -1
- package/skills/finishing-a-development-branch/reference/spec-pr.md +39 -0
- package/skills/gatekeep-pr/reference/batch.md +2 -0
- package/skills/gatekeep-pr/reference/cleanup.md +4 -0
- package/skills/gatekeep-pr/reference/menus.md +21 -0
- package/skills/gatekeep-pr/reference/post-selection-loop.md +2 -0
- package/skills/gatekeep-pr/reference/sync.md +6 -0
- package/skills/gauntlet-handoff/SKILL.md +8 -4
- package/skills/gauntlet-performance/SKILL.md +4 -2
- package/skills/gauntlet-resume/SKILL.md +16 -13
- package/skills/gauntlet-resume/reference/brief-contract.md +2 -0
- package/skills/gauntlet-resume/reference/reconstruction.md +10 -2
- package/skills/loop-implementation/SKILL.md +2 -0
- package/skills/shape-ticket/SKILL.md +4 -0
- package/skills/shape-ticket/reference/repo-audit.md +5 -1
- package/skills/subagent-driven-development/stop-note.md +4 -0
- package/skills/using-git-worktrees/SKILL.md +5 -1
- package/skills/verification-before-completion/reference/conformance-check.md +1 -1
- package/skills/writing-plans/SKILL.md +1 -1
|
@@ -7,6 +7,8 @@ description: Use only when explicitly asked to prove delivery of a named merged
|
|
|
7
7
|
|
|
8
8
|
## Quick reference
|
|
9
9
|
|
|
10
|
+
Start the message with `gauntlet: stuck` followed on that line by the concrete stop reason for every STOP branch below. Start the message with `gauntlet: done already-recorded` for an already-terminal ticket with the delivery already recorded; preserve the no-write rule.
|
|
11
|
+
|
|
10
12
|
| Situation | What happens |
|
|
11
13
|
|---|---|
|
|
12
14
|
| Ref unreadable, or repo mismatch with no repo group naming this repo | STOP - abort, no write |
|
|
@@ -251,6 +253,10 @@ code evidence - a legitimate outcome, not a failure.
|
|
|
251
253
|
|
|
252
254
|
## Confirmation gate and the batched write
|
|
253
255
|
|
|
256
|
+
Start the message with `gauntlet: gate=check-delivery/confirmation-gate` before evidence and the exact payload on both the success approval and failure findings-comment ask. Keep this line outside every tracker payload: `Delivered: <sha>` remains the first line of the evidence comment.
|
|
257
|
+
|
|
258
|
+
Start the message with `gauntlet: done delivered` when the batched write landed. Start the message with `gauntlet: done already-recorded` for idempotent delivery. Start the message with `gauntlet: done manual` when the write halves are emitted for manual execution. Start the message with `gauntlet: stuck` followed on that line by the concrete reason once the findings-comment gate is answered or no comment is offered; use this for any partial write failure too. A declined success write ends with `gauntlet: stuck write declined`.
|
|
259
|
+
|
|
254
260
|
Any `unexplained gap` or failed stage -> **failure path**: no status
|
|
255
261
|
advance, no delivery comment, no marker. The findings may be offered as a
|
|
256
262
|
**findings comment** (no `Delivered:` line, so it never trips idempotency) -
|
|
@@ -22,7 +22,7 @@ PRIMARY=$(dirname "$(git -C "$WORKTREE" rev-parse --path-format=absolute --git-c
|
|
|
22
22
|
FEATURE=$(git -C "$WORKTREE" branch --show-current)
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The process cwd never changes; every command targets `$WORKTREE` or `$PRIMARY` explicitly.
|
|
25
|
+
The process cwd never changes; every command targets `$WORKTREE` or `$PRIMARY` explicitly. Resolve the selected run spec now per the Input rules in [header-linked PR finishing](reference/spec-pr.md) and read its header before announcing: an exact `**Engine:** deferred` before the first `##` stops here with `spec approved for handoff only - run brainstorming #N` (no phase change, verification, strip, seal, or push); `**PR:**` without a Rework record takes that reference's live identity checks before Step 1 and its Step 4 menu and push recipe instead of the ordinary create rows.
|
|
26
26
|
|
|
27
27
|
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
|
|
28
28
|
|
|
@@ -32,8 +32,8 @@ Then call `phase_tracker({ action: "start", phase: "ship" })`.
|
|
|
32
32
|
|
|
33
33
|
### Step 1: Verify Tests
|
|
34
34
|
**Hard verification gate.** Tests/format/lint must pass before presenting any options — including Discard. The user's stated intent to throw the branch away does not change whether the diff is in a verifiable state; verifying first surfaces accidental damage to unrelated code before the branch is gone forever. The skip rule below is the only exception.
|
|
35
|
-
|
|
36
|
-
Recognize a ledger by line 1 exactly `# Ledger - loop engine`. For a ledger, use its `verification:` command throughout finish, including the minors round. For a PR subject with a task plan, use the union of every plan task's `Tests:` commands plus the executable lint/format commands in the header's `**Verification:**` line; treat `none - PR subject, scoped` as no header commands, not an empty task union. Capture this set and accepted-complete task evidence before stripping the plan. Apply the hard gate and skip rule below to this set. For every other subject with a task plan, run the plan header's `**Verification:**` set in the worktree: `(cd "$WORKTREE" && <command>)`. With no plan in this session, run the verification command(s) of the affected services from the gauntlet overrides file or `AGENTS.md` (look for "verification", "CI", or "test" sections).
|
|
35
|
+
Reuse the selected run spec read in Input. Detect a rework PR subject by its `## Rework record`; use Input's header-linked route for `**PR:**`, never discover by an open PR on `$FEATURE`. For the rework route only, read every top-level `PR:`/`Pre-rework head:` pair, home first, retaining each full SHA; missing pre-head -> stop naming the spec path. Set `PRE_REWORK_HEAD` to home's SHA. Read only combined capitalized `Base:`, `Keeps:`, `Changes:`, `Dropped claims:`, `Scoped tests:` fields; ignore lowercase provenance under `### PR #<N>`. For N=1, read `Threads:` directly after `Pre-rework head:` and retain the provenance subsection without changing finish output. Confirm only home with `gh pr view <N> --json number,url,headRefName,baseRefName,state` (use the record's repository): non-`OPEN` -> stop: `PR #N is <state>; the rework cannot be pushed to it.`; headRefName != `$FEATURE` -> stop naming both branches. Retain baseRefName for Step 3.
|
|
36
|
+
Recognize a ledger by line 1 exactly `# Ledger - loop engine`. For a ledger, use its `verification:` command throughout finish, including the minors round. For a rework PR subject with a task plan, use the union of every plan task's `Tests:` commands plus the executable lint/format commands in the header's `**Verification:**` line; treat `none - PR subject, scoped` as no header commands, not an empty task union. Capture this set and accepted-complete task evidence before stripping the plan. Apply the hard gate and skip rule below to this set. For every other subject with a task plan, run the plan header's `**Verification:**` set in the worktree: `(cd "$WORKTREE" && <command>)`. With no plan in this session, run the verification command(s) of the affected services from the gauntlet overrides file or `AGENTS.md` (look for "verification", "CI", or "test" sections).
|
|
37
37
|
**Skip rule.** Skip the run only when this set passed on a known clean commit in the verify phase of this session and no edit or write landed outside `<telemetry.dir>` since. Check the current tree: `git -C "$WORKTREE" diff --quiet <commit the run passed on> -- . ':!<telemetry.dir>'` must exit 0, and `git -C "$WORKTREE" status --porcelain --untracked-files=all -- . ':!<telemetry.dir>'` must exit 0 with empty output (`<telemetry.dir>` defaults to `.pi/gauntlet/telemetry`). These checks cover committed, staged, unstaged, and untracked changes outside telemetry. Otherwise run it once; a missing verified commit, a failed check, or uncertainty means run.
|
|
38
38
|
**Scoping caveat — pre-existing findings.** Some services carry lint findings unrelated to the diff. If verification fails on lines you didn't touch:
|
|
39
39
|
Confirm with `git -C "$WORKTREE" diff <base>...HEAD --name-only` that the offending file isn't in your diff. Surface the pre-existing finding to the user as a separate issue - do **not** auto-fix it in this completion ("surface, don't auto-fix"). Proceed only after the user acknowledges.
|
|
@@ -48,11 +48,11 @@ Cannot proceed until tests pass.
|
|
|
48
48
|
Stop. Don't proceed to Step 2. **If tests pass:** Continue to Step 2. No documentation prompt here: Documentation impact is decided at spec time (`/skill:brainstorming` section 6, gated by `brainstorming/reference/documentation-impact.md`) and has already shipped in the diff by the time you reach finishing.
|
|
49
49
|
### Step 2: Detect Environment
|
|
50
50
|
|
|
51
|
-
For a PR subject, use the Step 4 PR menu. For other subjects: detached HEAD (`git -C "$WORKTREE" symbolic-ref -q HEAD` prints nothing) -> reduced 4-option menu (no merge), no cleanup. Otherwise the standard 5 options.
|
|
51
|
+
For a header-linked PR, use the reference's five-row menu; for a rework PR subject, use the Step 4 PR menu. For other subjects: detached HEAD (`git -C "$WORKTREE" symbolic-ref -q HEAD` prints nothing) -> reduced 4-option menu (no merge), no cleanup. Otherwise the standard 5 options.
|
|
52
52
|
|
|
53
53
|
### Step 3: Determine Base Branch
|
|
54
54
|
|
|
55
|
-
For
|
|
55
|
+
For either PR route, set `<base-branch>` to the confirmed `baseRefName` and skip the common-base probe below.
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
58
|
# Try common base branches
|
|
@@ -85,11 +85,10 @@ When the sentinel carries a `happy-path:` line, print it directly under `Closure
|
|
|
85
85
|
|
|
86
86
|
**Pre-menu amendment funnel (GAPS only).** Before rendering the carried-open menu, `read` and run [`amendment-surface.md` § Conformance entry](../brainstorming/reference/amendment-surface.md) over the inventory once: gaps with `recommended: accept`, verdict `DRIFTED` or `PARTIAL`, not `UNAUTHORIZED`, whose `origin` is not an acceptance criterion are drafted as `accept-into-spec` items (the edit built from `origin` + `evidence`) and sent to the reviewer in one call; cleared items apply and land as one batch commit, the spec is re-audited, the inventory regenerated. Only concerns the re-audit actually closed drop out; sibling concerns in the same gap keep their rows and dispositions. Survivors and every other gap render as ordinary rows below - one menu, never two.
|
|
87
87
|
|
|
88
|
-
**Carried-open (`status: GAPS (N open)`).** Read `reference/disposition-protocol.md` and follow it for the carried-open render grammar, the response grammar, and the 9-step execute order. Render the human decision menu in the shape below; print the `Conformance: N decisions needed before shipping.` header below the item list, followed by the sentinel's informational lines (`happy-path:`, `Deferred/deviates per spec:`, `whole-diff minors:`) when present, in that order, above the reply instruction - a `failed - attributed to G<n>,...` value names the rows whose evidence is the transcript, a `rescope` recommendation on such a row means the failure lies in code the change never owned - drive the dispositions per that reference, then print the summary render and continue to Step 4. If that reference file cannot be read, stop and surface a blocking error — do **not** improvise the grammar from memory.
|
|
89
|
-
|
|
90
|
-
Representative carried-open render (multi-concern gap split to `e2e`; single-concern gap `cache`; `UNAUTHORIZED` gap `auth`):
|
|
88
|
+
**Carried-open (`status: GAPS (N open)`).** Read `reference/disposition-protocol.md` and follow it for the carried-open render grammar, the response grammar, and the 9-step execute order. Render the human decision menu in the shape below; print the `Conformance: N decisions needed before shipping.` header below the item list, followed by the sentinel's informational lines (`happy-path:`, `Deferred/deviates per spec:`, `whole-diff minors:`) when present, in that order, above the reply instruction - a `failed - attributed to G<n>,...` value names the rows whose evidence is the transcript, a `rescope` recommendation on such a row means the failure lies in code the change never owned - drive the dispositions per that reference, then print the summary render and continue to Step 4. If that reference file cannot be read, stop and surface a blocking error — do **not** improvise the grammar from memory. Read and apply [menu-layout](../brainstorming/reference/menu-layout.md). Start the message with `gauntlet: gate=finishing-a-development-branch/carried-open` alone on the first output line, without `recommended=`; put item 1 on the next line, before summaries. Representative carried-open render (multi-concern gap split to `e2e`; single-concern gap `cache`; `UNAUTHORIZED` gap `auth`):
|
|
91
89
|
|
|
92
90
|
```
|
|
91
|
+
gauntlet: gate=finishing-a-development-branch/carried-open
|
|
93
92
|
1. Source-image E2E validation - not run; blocked (HYDRA1.png, HTTP 401), so the branch ships without its end-to-end evidence.
|
|
94
93
|
The spec requires this validation, but HYDRA1.png is unavailable; decide whether it stays in scope for this branch.
|
|
95
94
|
what: The spec's Verification section gains a line deferring the source-image E2E run until the image is available.
|
|
@@ -157,9 +156,7 @@ Three tiers, increasing cost — name the tier when a revert is requested:
|
|
|
157
156
|
A **heavy** revert is not a menu toggle — say so explicitly to the user before proceeding, and do not present it as equivalent-effort to the light tier. The council audit that lets the human identify revert candidates lives in the `brainstorming` spec commit message body (not a committed spec section).
|
|
158
157
|
|
|
159
158
|
### Step 4: Present Options
|
|
160
|
-
|
|
161
|
-
**Amendment digest (both variants).** Before the options, read `git -C "$WORKTREE" log <base-branch>..HEAD --extended-regexp --grep '^(amend:|loop: cut row [0-9]+|loop: amend)'` and take the `auto-apply` and `granted` records from those commit bodies. Render, then the options:
|
|
162
|
-
|
|
159
|
+
Start the message with `gauntlet: gate=finishing-a-development-branch/step-4` alone on the first output line, followed by a newline before any closure summary or amendment digest. Emit exactly one marker and no `recommended=`; preserve the full subject-specific menu, including on return from `fix minors`. Read and apply [menu-layout](../brainstorming/reference/menu-layout.md). **Amendment digest (both variants).** Before the options, read `git -C "$WORKTREE" log <base-branch>..HEAD --extended-regexp --grep '^(amend:|loop: cut row [0-9]+|loop: amend)'` and take the `auto-apply` and `granted` records from those commit bodies. Render, then the options:
|
|
163
160
|
```
|
|
164
161
|
Amendments auto-applied (N):
|
|
165
162
|
- <title> - <what changed>
|
|
@@ -167,7 +164,7 @@ Amendments auto-applied (N):
|
|
|
167
164
|
|
|
168
165
|
Omit the block when N = 0.
|
|
169
166
|
|
|
170
|
-
**PR subject - preflight and six-row menu.** Fetch origin with `git -C "$WORKTREE" fetch origin`; stop on failure. Run these proofs in order, against this worktree's HEAD:
|
|
167
|
+
**Rework PR subject - preflight and six-row menu.** Fetch origin with `git -C "$WORKTREE" fetch origin`; stop on failure. Run these proofs in order, against this worktree's HEAD:
|
|
171
168
|
| Proof | Exit 0 | Exit 1 |
|
|
172
169
|
|---|---|---|
|
|
173
170
|
| `git merge-base --is-ancestor <PRE_REWORK_HEAD> HEAD` | Continue | Stop: `PR branch history was rewritten: <PRE_REWORK_HEAD7> is not an ancestor of HEAD; the rework must be re-merged, not rebased.` |
|
|
@@ -175,6 +172,7 @@ Omit the block when N = 0.
|
|
|
175
172
|
Run the first proof for every recorded original head, home first; the first exit 1 stops with the table's exact message naming that PR's SHA. Run the second proof only for home. Run each proof with `git -C "$WORKTREE"`. Treat every exit other than 0 or 1 as a command error and stop with its output. For a withheld push only, separately prove `git -C "$WORKTREE" merge-base --is-ancestor <PRE_REWORK_HEAD> origin/<headRefName>`: exit 0 appends `(origin moved past the rework's base <PRE_REWORK_HEAD7>)`; exit 1 adds nothing; other exits stop as command errors. Divergence alone proves no origin advance.
|
|
176
173
|
Read and apply [menu-layout](../brainstorming/reference/menu-layout.md) for rendering and numeric replies. Present:
|
|
177
174
|
```
|
|
175
|
+
gauntlet: gate=finishing-a-development-branch/step-4
|
|
178
176
|
Implementation complete. What would you like to do?
|
|
179
177
|
|
|
180
178
|
1. Push to the PR branch (PR #N, <headRefName>; appends the rework block to its description)
|
|
@@ -192,6 +190,7 @@ Withhold row 1 by omitting it and placing `Withheld: push - <reason>` under the
|
|
|
192
190
|
Read and apply [menu-layout](../brainstorming/reference/menu-layout.md) before presenting these options and before acting on a numeric reply.
|
|
193
191
|
|
|
194
192
|
```
|
|
193
|
+
gauntlet: gate=finishing-a-development-branch/step-4
|
|
195
194
|
Implementation complete. What would you like to do?
|
|
196
195
|
|
|
197
196
|
1. Push and create a Pull Request
|
|
@@ -208,6 +207,7 @@ Which option?
|
|
|
208
207
|
Read and apply [menu-layout](../brainstorming/reference/menu-layout.md) before presenting these options and before acting on a numeric reply.
|
|
209
208
|
|
|
210
209
|
```
|
|
210
|
+
gauntlet: gate=finishing-a-development-branch/step-4
|
|
211
211
|
Implementation complete. You're on a detached HEAD (externally managed workspace).
|
|
212
212
|
|
|
213
213
|
1. Push as new branch and create a Pull Request
|
|
@@ -252,7 +252,7 @@ node <bin>/gauntlet-telemetry-seal.mjs --worktree "$WORKTREE" --option <pr|squas
|
|
|
252
252
|
|
|
253
253
|
The seal prints one line per record (`sealed <path>`, `already sealed <path>`) or one bare outcome (`no telemetry run`, `telemetry disabled`) and exits 0; print its stdout verbatim in the ship completion message. Any nonzero exit stops the flow before the first landing command, quoting the bin's line: exit 2 (`no record at <path>`, `unparseable record <path>: <reason>`) means this gauntlet run's recorder never armed or its record is corrupt; exit 1 is a usage, environment, or git/jj failure (`seal failed <path>: <reason>` restored the pre-seal bytes). The user decides; never land without the seal.
|
|
254
254
|
#### PR-subject row 1: Push to the PR branch
|
|
255
|
-
Capture the scoped verification set and accepted-complete task/thread evidence before the strip. Refetch threads per recorded PR using the paginated single-`$n` query (one invocation per PR) owned by [pr-head](../using-git-worktrees/reference/pr-head.md); retain PR attribution and use the query's location rendering. For home, use the table below and omit threads now resolved on GitHub. For members, copy recorded dispositions and mark newly resolved or newly opened states from the refresh; never use home's first-parent history as member-fix proof.
|
|
255
|
+
For the close-absorbed-PR question, start the message with `gauntlet: gate=finishing-a-development-branch/pr-subject-row-1`. Read and apply [menu-layout](../brainstorming/reference/menu-layout.md). Do not report `done pushed` while this gate awaits an answer. Capture the scoped verification set and accepted-complete task/thread evidence before the strip. Refetch threads per recorded PR using the paginated single-`$n` query (one invocation per PR) owned by [pr-head](../using-git-worktrees/reference/pr-head.md); retain PR attribution and use the query's location rendering. For home, use the table below and omit threads now resolved on GitHub. For members, copy recorded dispositions and mark newly resolved or newly opened states from the refresh; never use home's first-parent history as member-fix proof.
|
|
256
256
|
| Refetched thread / evidence | Resolution |
|
|
257
257
|
|---|---|
|
|
258
258
|
| Recorded `fix`, matching task title carries id, task accepted by spec and code review and `complete`, exactly one naming commit | `fixed in <sha7>` |
|
|
@@ -290,6 +290,7 @@ Instantiate `Absorbs:` from every non-home pair in record order; omit it for N=1
|
|
|
290
290
|
Only after a successful push and successful home body edit, refresh each member with `gh pr view <N> -R <owner/repo> --json state,headRefOid`. Fetch each refreshed head that is not yet local (`git -C "$WORKTREE" fetch origin <current headRefOid>`; for a fork member use its head repository URL) before the ancestry test. Skip and name a member whose head fetch fails: `#14 skipped: head <sha7> not fetchable`. Require state `OPEN` and `git -C "$WORKTREE" merge-base --is-ancestor <current headRefOid> <pushed home head>` exit 0. Exclude and name ineligible members: `#14 skipped: head moved to <sha7>, not in home` or `#14 skipped: state CLOSED`. Treat unexpected Git exits and failed refreshes as errors, withhold closure and report the reason; merge nothing implicitly.
|
|
291
291
|
Ask nothing when none qualify or N=1. Otherwise render one gated question before marking ship complete. Instantiate each actual eligible target and its exact comment using its recorded pre-rework SHA7 and home's number/URL; the two-member rendering is:
|
|
292
292
|
```text
|
|
293
|
+
gauntlet: gate=finishing-a-development-branch/pr-subject-row-1
|
|
293
294
|
Close the absorbed PRs with these comments?
|
|
294
295
|
#13: "Reworked into #12 (<home url>) by the gauntlet; this PR's commits are merged there and remain reachable as <#13 pre-rework sha7>."
|
|
295
296
|
#14: "Reworked into #12 (<home url>) by the gauntlet; this PR's commits are merged there and remain reachable as <#14 pre-rework sha7>."
|
|
@@ -361,9 +362,9 @@ Report: "Keeping branch <name>. Worktree preserved at <path>." The telemetry rec
|
|
|
361
362
|
**Don't cleanup worktree.**
|
|
362
363
|
|
|
363
364
|
#### Option 5: Discard
|
|
364
|
-
|
|
365
|
-
**Confirm first:**
|
|
365
|
+
Read and apply [menu-layout](../brainstorming/reference/menu-layout.md). Start the message with `gauntlet: question` alone on the first output line, followed by a newline before the typed-confirmation text. **Confirm first:**
|
|
366
366
|
```
|
|
367
|
+
gauntlet: question
|
|
367
368
|
This will permanently delete:
|
|
368
369
|
- Branch <name>
|
|
369
370
|
- All commits: <commit-list>
|
|
@@ -457,8 +458,7 @@ A host-owned worktree (Step 6: no `home:` match, or the legacy "Otherwise") keep
|
|
|
457
458
|
- **Fix:** Never `git rm` under the telemetry dir. Until the seal the record is untracked and git-excluded, so a plan strip cannot reach it; after the seal it is a committed deliverable.
|
|
458
459
|
|
|
459
460
|
## Completion
|
|
460
|
-
Once the chosen option (Options 1-4 or PR-subject row 1 - not Discard) is executed successfully, mark the ship phase complete:
|
|
461
|
-
|
|
461
|
+
Start the final outcome message with exactly one terminal line before summaries. Start the message with `gauntlet: done pr-created` after successful normal or draft PR creation. Start the message with `gauntlet: done merged` after successful squash-merge and post-merge verification. Start the message with `gauntlet: done kept` after Keep. Start the message with `gauntlet: done discarded` only after typed discard authorization and successful discard. Start the message with `gauntlet: done pushed` after successful PR-subject push and body edit, only after the close-member gate is answered or no members qualify. Start the message with `gauntlet: stuck` followed on that line by a short concrete reason for an executed operation that fails, before error evidence or a return menu. Do not combine a terminal marker with a gate marker in one message; a subsequent menu starts a new gate message. Pending choices, implementation stalls and conformance escalation are not terminal outcomes. Read and apply [menu-layout](../brainstorming/reference/menu-layout.md). Preserve strip, seal, cleanup and ship-state rules below; terminal reporting does not complete ship after Discard or failure. Once the chosen option (Options 1-4 or PR-subject row 1 - not Discard) is executed successfully, mark the ship phase complete:
|
|
462
462
|
```
|
|
463
463
|
phase_tracker({ action: "complete", phase: "ship" })
|
|
464
464
|
```
|
|
@@ -4,9 +4,10 @@ Consumed by `finishing-a-development-branch` Step 3.5 on the **GAPS branch only*
|
|
|
4
4
|
|
|
5
5
|
**Carried-open render (numbered brief).** Read the `## Closure / conformance` block. The menu text is written after the recommendation is decided, never while deciding it. Negative example: `recommended: custom? Hmm. Dispositions: fix-now ... Actually, the amended spec makes G2 ...`.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Read and apply [menu-layout](../../brainstorming/reference/menu-layout.md). Start the message with `gauntlet: gate=finishing-a-development-branch/carried-open` alone on the first output line, without `recommended=`. Put item 1's plain-words problem sentence on the next line, before summaries or metadata. Render one numbered item per decision unit (a gap by default; a `Gn/Cn` concern only where the reference split it):
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
+
gauntlet: gate=finishing-a-development-branch/carried-open
|
|
10
11
|
<n>. <plain title> - <what is unresolved and what it costs, one sentence>.
|
|
11
12
|
<why this is a human call, one sentence>.
|
|
12
13
|
A) <option> - <one-line consequence>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Finish a header-linked spec PR
|
|
2
|
+
|
|
3
|
+
## Input
|
|
4
|
+
|
|
5
|
+
Resolve the selected run spec once: use the carried spec path or the active plan/ledger's path-only `**Spec:**` header; with neither, enumerate candidates under resolved `flowGuards.specDirs`, read them, and ask on ambiguity. Carry this path through finish; perform no second discovery. Read its header before announcing or starting ship. An exact `**Engine:** deferred` before the first `##` stops with `spec approved for handoff only - run brainstorming #N`; perform no phase change, verification, strip, seal, or push. A `## Rework record` wins over `**PR:**` (record wins when both exist): follow the ordinary rework path. For a header-only `**PR:** <owner/repo#N>`, use the header's repository for every gh call and run this check before Step 1 verification:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh pr view <N> -R <owner/repo> --json number,url,state,isDraft,headRefName,baseRefName
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Stop on query failure. Require OPEN, otherwise print `PR #N is <state>; the branch cannot be pushed to it.` Require headRefName == `$FEATURE`, otherwise stop naming both branches. Retain the live baseRefName for Step 3 (skip common-base probing), sealing, and squash. Run full ordinary verification for a header-only PR, not rework-scoped verification. Keep ordinary closure/conformance gates.
|
|
12
|
+
|
|
13
|
+
## Menu and preflight
|
|
14
|
+
|
|
15
|
+
At Step 4, the header-linked route bypasses both menus below the amendment digest in SKILL.md and uses this preflight, five-row menu, and rows 1/2 push recipe; retain the shared amendment digest and informational lines. At Step 4 fetch `git -C "$WORKTREE" fetch origin` and prove `git -C "$WORKTREE" merge-base --is-ancestor origin/<headRefName> HEAD`. Stop on fetch failure or proof exits other than 0/1. Exit 1 omits rows 1/2 and prints `Withheld: push - origin/<headRefName> is at <sha7>, local HEAD at <sha7>; a non-force push cannot land`; retain numbers 3-5. A hidden 1/2 gets the clarifying question naming rendered rows. Recompute this proof on every menu return.
|
|
16
|
+
|
|
17
|
+
Render exactly these five rows (plus ordinary nonblocking informational lines):
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Implementation complete. What would you like to do?
|
|
21
|
+
|
|
22
|
+
1. Push to PR #N and mark it ready for review
|
|
23
|
+
2. Push to PR #N, keep it a draft
|
|
24
|
+
3. Squash-merge to <base-branch> (no PR, no surviving branch; orphans PR #N - close it by hand)
|
|
25
|
+
4. Keep the branch as-is (I'll handle it later; nothing is pushed)
|
|
26
|
+
5. Discard this work (removes the worktree and local branch; the PR branch on origin is untouched)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For observed isDraft false replace row 2 with `2. Push to PR #N (already ready for review)`. Never convert ready to draft. Map rows 3-5 to ordinary Options 3-5, retaining typed discard confirmation and Step 6 ownership/cleanup. Option 3 squash seal uses `--option squash --base origin/<baseRefName>` and the selected spec.
|
|
30
|
+
|
|
31
|
+
## Push rows 1/2
|
|
32
|
+
|
|
33
|
+
Run the ordinary strip-and-seal block first, with `--option pr --base origin/<baseRefName>` and the selected spec. Preserve every seal failure stop. Then push non-force:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git -C "$WORKTREE" push --no-follow-tags origin HEAD:refs/heads/<headRefName>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Only after successful push on row 1 run `gh pr ready <N> -R <owner/repo>`. Row 2 pushes only. Report a rejected push once, skip ready, and return to the menu without force or automatic retry. On ready failure report the completed push and that the PR remains a draft for manual action or a later retry; preserve checkout. Preserve the PR body without a Rework block. Complete ship after successful delivery; keep the worktree for both push rows.
|
|
@@ -14,6 +14,8 @@ Gather each PR with `gh pr view --json number,author,headRefOid,headRefName,base
|
|
|
14
14
|
|
|
15
15
|
## Provision serially
|
|
16
16
|
|
|
17
|
+
Start the message with `gauntlet: question` when asking unresolved create tokens or the set-wide other-author confirmation. Apply [menu-layout](../../brainstorming/reference/menu-layout.md), preserving the one yes for the set. Keep private `REPORT`, `CONFLICTING`, `FAILED`, and `STOPPED` child results unchanged; mark only the parent user-facing turn.
|
|
18
|
+
|
|
17
19
|
Fetch origin once with `git fetch origin`; for each fork PR, run `git fetch origin pull/<N>/head:pr-<N>` only when no worktree holds a local `pr-<N>` branch, and otherwise leave the reuse row's `git fetch origin pull/<N>/head` + `git merge --ff-only FETCH_HEAD` to that PR's provisioning step. Apply assessment's gitignore-first rule before built-in creation when the resolved home is inside the primary; sibling homes need no edit. Provision in roster order, one at a time. No concurrent primary fetch or worktree add is allowed, regardless of cohort concurrency.
|
|
18
20
|
|
|
19
21
|
Reuse assessment's provisioning table unchanged: reuse an expected branch at any path, fast-forward only, stop on dirt, divergence, local-only commits, or foreign operations; never repurpose a foreign branch at the default path. Resolve keyed home/create/destroy with `<name>` = `pr-<N>`, shell-quote tokens, check the created path in `git worktree list --porcelain`, and verify `HEAD == headRefOid`. A non-zero create marks that PR failed; never fall back to worktree add. Ask unresolved create tokens in the parent once per token, never execute unresolved placeholders. Isolate `failed - provisioning - <reason>` with no child; continue siblings. A provisioning retry re-provisions only after the obstacle clears.
|
|
@@ -20,6 +20,10 @@ Consequence clause for the menu row (`decision-menu.md`): `remove <worktree.path
|
|
|
20
20
|
|
|
21
21
|
## Non-final stop
|
|
22
22
|
|
|
23
|
+
Follow the [shared layout](../../brainstorming/reference/menu-layout.md).
|
|
24
|
+
|
|
25
|
+
Start the message with `gauntlet: stuck` followed on that line by the reason: use the obstacle's `stuck - ` text as the reason, or `stopped at <template id>` for initial, assess-terminal, and contract-exception. On a failed reset/assertion use the actual error instead. Put cleanup results below that one first line.
|
|
26
|
+
|
|
23
27
|
Enter here for `stop` on the initial, assess-terminal, obstacle, or contract-exception menu. On a `rebased locally` head, run `git -C <worktree.path> reset --hard <pre_head>` first; assert `HEAD == <pre_head>` and a clean tree. Stop on a failed assertion.
|
|
24
28
|
|
|
25
29
|
Reuse step 1's primary and keyed ownership computation: resolve `home:` and the `<name>` pattern against `$PRIMARY`, and pass both the pattern and `worktree.path` through `realpath`. Keep the primary even when clean; print `worktree: kept - primary at <path>`.
|
|
@@ -17,6 +17,8 @@ Read with `decision-menu.md` at step 6. Select the template from this state map;
|
|
|
17
17
|
|
|
18
18
|
Render every menu in full from its template: the verdict line, every available row, and the hint line. Never narrate or summarize a menu; do not substitute "the initial template applied; the human picked 2" for its rendering. Quote a numeric pick only after the rendered menu.
|
|
19
19
|
|
|
20
|
+
Append ` recommended=<n>` to each gate line using the actual rendered number of its tagged recommended row. Emit one first line per turn; when combining batch summary and child menus, emit only the parent `gatekeep-pr/batch-summary` line. Keep runtime guard text, including any quoted escalation instruction, inside the obstacle body, never as a second standalone marker.
|
|
21
|
+
|
|
20
22
|
Render flat numbers through [menu-layout](../../brainstorming/reference/menu-layout.md); preserve its bare-numeric mapping. Put exactly one `[recommended]` on an available row and `stop` last. Put `show evidence` in every hint line, never in a row. Include every omission reason from `decision-menu.md`. A menu rendered under `deliver` before an exit condition, other than the contract-exception template, is a red flag; so is a menu not rendered from these templates, two recommendations, stop not last, or no evidence hint.
|
|
21
23
|
|
|
22
24
|
Render terminal cleanup consequences through `cleanup.md`; use `skipped - needs a landed change` for merge-SHA-dependent overrides in the row text and result block.
|
|
@@ -28,6 +30,7 @@ Use `viewer.is_author` (`viewer.login == pr.author.login`) and `author_is_bot` f
|
|
|
28
30
|
Offer `assess`, eligible `deliver`, eligible `deliver with nits`, then `stop`. Recommend deliver for the human's own PR, assess for someone else's; when delivery is omitted on an own PR, recommend assess. Omit deliver with nits with zero nits, and both delivery rows with cap zero, missing helpers, or non-pushable/unreadable head; name each reason, including `Not offered: deliver (needs push to <head_url>:<head_ref>)`. For someone else's/bot PR change the sync consequence to "merge main into the branch". Map `deliver with nits` to stored `deliver-nits`.
|
|
29
31
|
|
|
30
32
|
```text
|
|
33
|
+
gauntlet: gate=gatekeep-pr/initial recommended=2
|
|
31
34
|
Verdict: not ready - 2 blockers, 1 nit
|
|
32
35
|
|
|
33
36
|
Pick one:
|
|
@@ -41,40 +44,58 @@ Course holds until the final menu; `show evidence` prints the full record.
|
|
|
41
44
|
|
|
42
45
|
## final
|
|
43
46
|
|
|
47
|
+
Start the message with `gauntlet: gate=gatekeep-pr/final`.
|
|
48
|
+
|
|
44
49
|
Offer available `merge`, `approve`, `fix nits` when nits remain and the course excluded them, `reply` when drafted replies exist, then `stop`. Recommend merge for own PR; recommend approve for someone else's when available, else merge; with neither available recommend stop. Omit merge on a draft with `Not offered: merge (draft)` or below WRITE with `Not offered: merge (needs WRITE on <owner>/<repo>)`. Omit approve on drafts and own PRs. Authorize exactly one delivery iteration for fix nits, leaving course unchanged (`post-selection-loop.md` `### Next action`). Hint: `Type a number; show evidence prints the full record.` Print one compact `Evidence:` line above the `Delivers:` line naming the source (`CI (source: ci)` or the local run), the head SHA, each run and its checks with their conclusions, the binding-pending count, and `merge_state_status`; put the same record in the `show evidence` hint's parenthetical.
|
|
45
50
|
|
|
46
51
|
## assess terminal
|
|
47
52
|
|
|
53
|
+
Start the message with `gauntlet: gate=gatekeep-pr/assess-terminal`.
|
|
54
|
+
|
|
48
55
|
Offer available `deliver` (switch course), `approve` only on someone else's non-draft PR with zero blockers, `reply` for drafted thread replies, then `stop` `[recommended]`. Hint: `Type a number; show evidence prints the full record.`
|
|
49
56
|
|
|
50
57
|
## obstacle
|
|
51
58
|
|
|
59
|
+
Start the message with `gauntlet: gate=gatekeep-pr/obstacle`.
|
|
60
|
+
|
|
52
61
|
For undispositionable BLOCKED with no local repair, use this template even with course unset: keep stop last and `[recommended]`, with no wait row, no sync promise, and no approve row. Describe eligible deliver only as retrying after the failed prerequisite changes; promise no automatic sync. Reserve the course-unset initial assess/deliver/stop template for a pending-only report when its sole withhold is a not-yet-resolved binding CI check; source blockers still use initial under the state map.
|
|
53
62
|
|
|
54
63
|
Print the concrete obstacle and retained failed prerequisites. Keep the `Delivers:` line in the obstacle report. Offer eligible `deliver`, `approve workflow run` only for the held-run permission case, `assess` (switch course), then `stop` `[recommended]`. Feed the `Evidence:` line from the verifier record's resolved source, never from the raw check or run rollup - render a `source: pending` record as `Evidence: pending (<binding check> binding; head <sha>)`, and when `course` is unset render the deliver row as `deliver - set course to deliver; <one clause naming what retries>, no round charged` instead of `resume the retained course`. Render ordinary obstacle continuation as `deliver - resume the retained course; <one clause naming what retries>, no round charged`. For every non-timeout deliver selection, add exactly `2 x maxFixRounds` to both caps and persist before work, preserving usage. Append `add <n> to each cap` (`+2 x maxFixRounds`, with cumulative usage/caps) to the row even below both caps. On timeout describe exactly one additional watch window instead, with neither cap extended. An unchanged prerequisite re-exits even after extension. Print exactly one `Evidence:` line before the verdict, naming the resolved evidence source and assessed head per `report.md` (for example `Evidence: CI (run 7001, test_unit and build_image green on 9c1e4f2)`). Include `check <name> flaky | real | ci-broken` in the hint for failing checks; flaky followed by a numeric deliver selection can resume. Hint: `Type a number; show evidence prints the full record (<source summary>)`. Replace `<source summary>` with the same source summary used in `Evidence:`, including the CI run, check outcomes, and assessed head when CI is the source.
|
|
55
64
|
|
|
56
65
|
## contract exception
|
|
57
66
|
|
|
67
|
+
Start the message with `gauntlet: gate=gatekeep-pr/contract-exception`.
|
|
68
|
+
|
|
58
69
|
Print the concrete proposed contract change before the rows. Offer `accept contract change`, `preserve contract` `[recommended]`, then `stop`. Render preserve's consequence as "reject the proposal, keep <named requirement>, and resume authorized implementation repair within it". Route through `post-selection-loop.md` `### Contract decision`; show evidence settles nothing. Hint: `Type a number; show evidence prints the full record.`
|
|
59
70
|
|
|
60
71
|
## own merge
|
|
61
72
|
|
|
73
|
+
Start the message with `gauntlet: gate=gatekeep-pr/own-merge`.
|
|
74
|
+
|
|
62
75
|
After this run's merge returns `MERGED`, offer `cleanup` `[recommended]` until attempted, `post coverage to ticket` when issue and scope rows exist, `post coverage to PR`, then `stop`. Suppress each successful post for the rest of the run; a failed post keeps its row and prints the error. A post re-renders this template, never tears down or ends the run, and runs no compare-and-swap. After cleanup removes its row recommend the first available post, else stop. Hint: `Type a number; show evidence prints the full record.`
|
|
63
76
|
|
|
64
77
|
## merge queued
|
|
65
78
|
|
|
79
|
+
Start the message with `gauntlet: gate=gatekeep-pr/merge-queued`.
|
|
80
|
+
|
|
66
81
|
After this run's merge returns a state other than `MERGED`, offer `wait` - re-run `gh pr view <N> --json state,mergeCommit` `[recommended]`, then `stop`. Render `The merge is queued, so coverage posts wait. (<state>)`. A MERGED read records pr.state and pr.merge_commit and renders own merge; OPEN or another state keeps this template. Run no CI watch. Hint: `Type a number; show evidence prints the full record.`
|
|
67
82
|
|
|
68
83
|
## approved
|
|
69
84
|
|
|
85
|
+
Start the message with `gauntlet: gate=gatekeep-pr/approved`.
|
|
86
|
+
|
|
70
87
|
When `approved_head` equals the assessed head, offer `cleanup` `[recommended]` until attempted, then `stop`; recommend stop after cleanup. Hint: `Type a number; show evidence prints the full record.`
|
|
71
88
|
|
|
72
89
|
## closed PR
|
|
73
90
|
|
|
91
|
+
Start the message with `gauntlet: gate=gatekeep-pr/closed-pr`.
|
|
92
|
+
|
|
74
93
|
When state is not OPEN at step 1 or mid-course, offer `cleanup` `[recommended]` until attempted, then `stop`; recommend stop after cleanup. Keep this distinct from this run's own merge. Hint: `Type a number; show evidence prints the full record.`
|
|
75
94
|
|
|
76
95
|
## batch summary
|
|
77
96
|
|
|
97
|
+
Start the message with `gauntlet: gate=gatekeep-pr/batch-summary`.
|
|
98
|
+
|
|
78
99
|
For a recovered `CONFLICTING` child, offer only safe `retry` and `stop`, with `show evidence` hint-only. Render `retry - re-dispatch this PR's assessment with the same record` `[recommended]` only after `batch.md`'s clean-recovery and no-rebase checks pass; otherwise omit retry with its recorded reason and recommend stop. Keep stop last; offer no update branch or merge base rows. Hint: `Type a number; show evidence prints the full record.`
|
|
79
100
|
|
|
80
101
|
Let the `batch.md` parent render its current summary rows and each child's template from this file. Keep terminal posts and queued-merge wait parent-owned, including after worktree removal; suppress successful posts and retain failed posts. Preserve the parent's row consequences and admission/queue semantics. Put stop last and exactly one recommendation. Hint: `Type a number; show evidence prints the full record.`
|
|
@@ -187,6 +187,8 @@ Before posting or committing any external payload - review bodies, replies, comm
|
|
|
187
187
|
|
|
188
188
|
### Teardown
|
|
189
189
|
|
|
190
|
+
Start the message with `gauntlet: done approved` for stop on approved. Start the message with `gauntlet: done merged` for stop on own-merge. Start the message with `gauntlet: done closed-pr` for stop on closed-pr. Start the message with `gauntlet: done final` for stop on final. Start the message with `gauntlet: done merge-queued` for stop on merge-queued. Put the checkout path and local branch below the terminal line. A report Verdict above a menu is not a terminal. Start the message with `gauntlet: stuck` followed by the actual error on any hard assertion failure, including a delegated fix-wave restore/assert failure, and end with the actual error; do not render a continuation menu.
|
|
191
|
+
|
|
190
192
|
Delegate non-final stop (initial, assess terminal, obstacle, contract exception) to `cleanup.md` `## Non-final stop`. Keep terminal cleanup behind its own pick; terminal stop leaves the checkout as found and reports its path and local branch. Render cleanup only on terminal templates; never run cleanup steps 2-4 for a non-final stop.
|
|
191
193
|
|
|
192
194
|
Delete the run record, temporary description body files, every helper output and its log_path on every handled terminal exit. Drop unapplied drafts. Never discover authority in a new session.
|
|
@@ -8,6 +8,8 @@ Read from SKILL.md step 2b, only when `--rebase` was passed. Input: the step-1 d
|
|
|
8
8
|
|
|
9
9
|
## Preconditions
|
|
10
10
|
|
|
11
|
+
Start the message with `gauntlet: gate=gatekeep-pr/sync-preconditions` for the stop-only menu below. Render numbered `stop` with `show evidence` hint-only through [menu-layout](../../brainstorming/reference/menu-layout.md).
|
|
12
|
+
|
|
11
13
|
Check in order after step 2. A terminal stop - here, at `## Baseline`, or at `## Push` - closes the `sync` stage `failed`, prints the reason, offers `stop` and `show evidence` only, and runs no step 3; on such a stop `show evidence` prints the digest's head-dependent fields and the `sync` record.
|
|
12
14
|
|
|
13
15
|
1. The harness has a helper facility (SKILL.md `## Harness notes`); none -> terminal stop before any write: `sync: stopped - no helper facility for conflict resolution and review`.
|
|
@@ -26,6 +28,8 @@ Refresh `headRefOid` with `gh pr view <N> --json headRefOid` and set `<pre_head>
|
|
|
26
28
|
|
|
27
29
|
## Other-author confirmation
|
|
28
30
|
|
|
31
|
+
Start the message with `gauntlet: question` before the fixed block and yes/no ask. Apply [menu-layout](../../brainstorming/reference/menu-layout.md), preserving the typed yes/no contract.
|
|
32
|
+
|
|
29
33
|
When `pr.author.login` differs from `gh api user --jq .login`, or that login is `unreadable`, print this fixed block verbatim, one line per point, before any rewrite:
|
|
30
34
|
|
|
31
35
|
```text
|
|
@@ -67,6 +71,8 @@ On a `rebased locally` head the forge re-read returns `<pre_head>` as `headRefOi
|
|
|
67
71
|
|
|
68
72
|
## Failure path
|
|
69
73
|
|
|
74
|
+
Start the message with `gauntlet: stuck` followed on that line by the actual error on a restore/assert mismatch, and end the run. Keep ordinary recovered failures on their existing continuation path.
|
|
75
|
+
|
|
70
76
|
Triggers: an unresolved stop, `open` for any reason other than a failing scoped test in a file outside the list, residue, a non-zero `rebase` or `--continue` without unmerged paths, a reviewer Critical or Moderate finding, a push rejected by server policy. Restore `<pre_head>`: `git rebase --abort` while the rebase is in progress, `git reset --hard <pre_head>` after it completed; assert `HEAD == <pre_head>` and a clean `git status --porcelain` - a mismatch is a hard stop with the error, never a silent continue. Record `sync: failed - <reason>` with reason one of `unresolved stop in <commit7>`, `implementer returned open`, `residue outside conflicted files`, `rebase failed: <first line>`, `reviewer: <top finding>`, `push rejected: <first server line>`. Close the `sync` stage `skipped` and continue to step 3 on the unsynced head; step 5 records what remains and renders the initial or terminal template from `menus.md`.
|
|
71
77
|
|
|
72
78
|
## Sync record
|
|
@@ -17,7 +17,7 @@ ending at `## Skills loaded`). Only this package knows what `phase_tracker` and
|
|
|
17
17
|
the layout fixed by `reference/brief-contract.md` (`## Producers`). Runs in the main
|
|
18
18
|
loop: tracker state is extension state no subagent can read.
|
|
19
19
|
|
|
20
|
-
**Announce at start:** "I'm using the gauntlet-handoff skill to write a resumable handoff brief."
|
|
20
|
+
**Announce at start (after the marker on marked messages):** "I'm using the gauntlet-handoff skill to write a resumable handoff brief."
|
|
21
21
|
|
|
22
22
|
## Boundaries
|
|
23
23
|
|
|
@@ -31,8 +31,10 @@ loop: tracker state is extension state no subagent can read.
|
|
|
31
31
|
|
|
32
32
|
## Sequence
|
|
33
33
|
|
|
34
|
+
Apply the first-line grammar in [menu-layout](../brainstorming/reference/menu-layout.md).
|
|
35
|
+
|
|
34
36
|
1. **Resolve the target.**
|
|
35
|
-
- `--out` and `--key` both given -> STOP: they are exclusive in cohort's grammar.
|
|
37
|
+
- `--out` and `--key` both given -> STOP: they are exclusive in cohort's grammar. Start the message with `gauntlet: stuck` followed by the exclusivity reason on that line.
|
|
36
38
|
- `--out <path>` -> resolve to an absolute path against the session cwd
|
|
37
39
|
(`node -p "require('path').resolve(process.argv[1])" -- "<path>"`); that is the
|
|
38
40
|
form passed to cohort.
|
|
@@ -52,7 +54,7 @@ loop: tracker state is extension state no subagent can read.
|
|
|
52
54
|
```
|
|
53
55
|
|
|
54
56
|
`BRANCH` empty (detached HEAD) or equal to `DEFAULT` -> STOP asking for `--key` or
|
|
55
|
-
`--out` (a default-branch key would collide across flows).
|
|
57
|
+
`--out` (a default-branch key would collide across flows). Start the message with exactly `gauntlet: question` on its own line, with no suffix.
|
|
56
58
|
- A derived key has every `/` replaced by `-` (`hotfix/x` -> `hotfix-x`) so the file
|
|
57
59
|
lands flat in the default directory. A human-given `--key` is passed verbatim.
|
|
58
60
|
- With `--key`, cohort writes `<tmpdir>/pi-handoff/<key>.md`, `<tmpdir>` from
|
|
@@ -87,7 +89,9 @@ loop: tracker state is extension state no subagent can read.
|
|
|
87
89
|
`cat >> "<brief path>" <<'EOF' ... EOF` whose body is that block.
|
|
88
90
|
- Re-read the file tail and confirm it ends with the gate-history line from the
|
|
89
91
|
contract and nothing after.
|
|
90
|
-
7. **Report.**
|
|
92
|
+
7. **Report.**
|
|
93
|
+
|
|
94
|
+
Start the message with `gauntlet: done brief-written`. Print the path and `/skill:gauntlet-resume <path>`. When a section was
|
|
91
95
|
appended and the brief's `worktree:` field is `no`, resume's entry check 2 needs an
|
|
92
96
|
override: print `/skill:gauntlet-resume <path> <override>` where `<override>` is the
|
|
93
97
|
run worktree from step 1 when one was found, else the session checkout root,
|
|
@@ -22,15 +22,17 @@ The CLI parses and aggregates; you reason. Never open a telemetry YAML record yo
|
|
|
22
22
|
|
|
23
23
|
## Reply - exactly this, in this order
|
|
24
24
|
|
|
25
|
+
Start the message with `gauntlet: gate=gauntlet-performance/reply-exactly-this-in-this-order`. Follow the [shared marker and reply mapping rules](../brainstorming/reference/menu-layout.md); append `recommended=<row number>` only when a rendered row carries `[recommended]`.
|
|
26
|
+
|
|
25
27
|
1. **Recommendation** (2-4 sentences). One claim, led by the run that exemplifies it: quote its `spec` slug, `run_id`, and the 1-3 numbers that carry the claim. When `grants` is the evidence, call it the fix-round proxy. If no version group has `shipped >= 2`, the recommendation is "sample too small" with the `n`/`shipped` counts per version.
|
|
26
28
|
2. **Cornerstones**: 3-5 bullets of aggregate facts from `by version` - corpus size, truncated count, the p50s and model tallies that moved between versions.
|
|
27
29
|
3. **Council assessment**: Render this block independently of the version sample gate, even when item 1 says "sample too small". If the digest prints `no council data in selected records`, render only `council: no data`. If the most recent roster has fewer than 5 runs, render only `council: <roster> - not enough runs to assess (N of 5)`. Otherwise render one line per `flag:` of the most recent roster as the roster-change recommendations; when an older roster exists, add one line comparing the two rosters' `uniq_appl_nonminor/run` and rejected share as groups. Compare rosters as groups, never a member across rosters.
|
|
28
30
|
4. **Menu**, numbered, at most 3 items, rendered exactly as:
|
|
29
|
-
- `1. render report` - ask for a target path;
|
|
31
|
+
- `1. render report` - ask for a target path; Start the message with `gauntlet: question` for this ask. Write markdown there: the digest verbatim, then the recommendation and cornerstones above. If the file exists, ask before overwriting. Start the message with `gauntlet: question` for this overwrite ask. Write nothing unless this item is chosen.
|
|
30
32
|
- `2. open recommendation as ticket` - hand the claim and its numbers to `/skill:shape-ticket`; never create a ticket directly.
|
|
31
33
|
- `3. drill into <slug>` - re-run the CLI with `--json` and show that run's fields.
|
|
32
34
|
|
|
33
|
-
Nothing else: no preamble, no restated digest, no file written before item 1 is chosen.
|
|
35
|
+
Nothing else beyond the marker and prescribed body: no preamble, no restated digest, no file written before item 1 is chosen.
|
|
34
36
|
|
|
35
37
|
## Project overrides
|
|
36
38
|
|
|
@@ -17,7 +17,7 @@ worktree whose spec/plan artifacts are reconstructed into tracker state
|
|
|
17
17
|
(`reference/reconstruction.md`), a spec seed (`reference/seed.md`). Every check runs
|
|
18
18
|
before any tracker mutation; every stop names the offending path, field, or line.
|
|
19
19
|
|
|
20
|
-
**Announce at start:** "I'm using the gauntlet-resume skill to continue an interrupted flow."
|
|
20
|
+
**Announce at start (after the marker on marked messages):** "I'm using the gauntlet-resume skill to continue an interrupted flow."
|
|
21
21
|
|
|
22
22
|
## Boundaries
|
|
23
23
|
|
|
@@ -41,6 +41,9 @@ precedence).
|
|
|
41
41
|
|
|
42
42
|
Read and apply [menu-layout](../brainstorming/reference/menu-layout.md) before presenting these options and before acting on a numeric reply.
|
|
43
43
|
|
|
44
|
+
For the discovery menu, start the message with the marker specified below. Start the message with `gauntlet: gate=gauntlet-resume/discovery`.
|
|
45
|
+
For no briefs and every stop route in the table, end without mutation. Start the message with `gauntlet: stuck` followed by the existing reason on that line.
|
|
46
|
+
|
|
44
47
|
| Input | Route |
|
|
45
48
|
|---|---|
|
|
46
49
|
| no tokens, no pasted text | discovery: `<tmpdir>` via `node -p "require('os').tmpdir()"`; candidates are the regular files directly under `<tmpdir>/pi-handoff/` ending `.md` (non-recursive) whose line 1 starts `# Handoff:`; sorted by mtime, newest first; displayed one per line as `<n>. <title line> - <worktree: field value> - <mtime ISO-8601>` with `worktree: unavailable` when the field is absent; the human picks `<n>` (a single candidate is still confirmed); none -> STOP "no handoff briefs found under <tmpdir>/pi-handoff" |
|
|
@@ -66,6 +69,8 @@ foreign-repo brief stops there.
|
|
|
66
69
|
|
|
67
70
|
## Entry checks
|
|
68
71
|
|
|
72
|
+
For an entry-check stop, start with the terminal marker and retain the offending path, field, or line. Start the message with `gauntlet: stuck` followed by the reason on that line.
|
|
73
|
+
|
|
69
74
|
In order. All before any tracker mutation; entry check 1 is read-only. A spec
|
|
70
75
|
seed runs check 1 here, then `reference/seed.md`, which runs check 3 itself;
|
|
71
76
|
checks 2, 4, 5 do not apply; check 6 runs on the seed's pinned spec path.
|
|
@@ -97,27 +102,23 @@ checks 2, 4, 5 do not apply; check 6 runs on the seed's pinned spec path.
|
|
|
97
102
|
`skills/*/SKILL.md` in this package; `Read` each match's complete file into the
|
|
98
103
|
transcript; list non-matches as skipped. Loaded bodies are context only - no skill's
|
|
99
104
|
entry actions run until Dispatch names one.
|
|
100
|
-
6. **Grant field.**
|
|
101
|
-
`
|
|
102
|
-
(process-state briefs), the spec reconstruction resolves and the human approves
|
|
103
|
-
(Spec without plan) or confirms (Spec with ledger or Spec with plan) (`reference/reconstruction.md`), or
|
|
104
|
-
the pinned `<full-path>/<rel>` of a spec tracked on `main` (`reference/seed.md`) -
|
|
105
|
-
and before that route's first tracker call; the path is carried, never re-resolved.
|
|
106
|
-
Read the spec's header block (between the H1 and the first `##`) through the
|
|
107
|
-
predicate in
|
|
105
|
+
6. **Grant field.** Run deferred-header admission whenever a route resolves an existing spec, including brainstorm-stage process-state restore and reconstruction's unapproved-draft handoff, before any tracker mutation or brainstorming invocation. Carry the resolved `<spec path>` without re-resolving it: use `reference/brief-contract.md` "Process-state restore", `reference/reconstruction.md`, or the seed's pinned `<full-path>/<rel>` (`reference/seed.md`).
|
|
106
|
+
Read the spec's header block (between the H1 and the first `##`). An exact `**Engine:** deferred` stops with `spec approved for handoff only - run brainstorming #N`; make no phase_tracker or plan_tracker mutation. After deferred-header admission, apply the grant predicate only for an approved spec in
|
|
108
107
|
[Standing grants](../brainstorming/reference/amendment-surface.md#standing-grants): no
|
|
109
108
|
`**Amend-grant:**` line -> no grant (legacy spec);
|
|
110
109
|
exactly one line whose trimmed value is `none` -> no grant;
|
|
111
110
|
exactly one line whose trimmed value is any other non-empty single-line text ->
|
|
112
111
|
grant active, the sentence is that value;
|
|
113
112
|
two or more lines, one line with an empty value, or a value continued onto the next physical line ->
|
|
114
|
-
malformed, stop, print the offending line(s), no tracker call.
|
|
113
|
+
malformed, stop, print the offending line(s), no tracker call. Skip only grant decoding for routes that resolve no
|
|
115
114
|
approved spec (hotfix, `worktree: no`, a brief whose active phase is brainstorm,
|
|
116
|
-
reconstruction's unapproved-draft brainstorming handoff)
|
|
117
|
-
|
|
115
|
+
reconstruction's unapproved-draft brainstorming handoff); print no grant line.
|
|
116
|
+
Resume reports the line; it never writes it.
|
|
118
117
|
|
|
119
118
|
## Dispatch
|
|
120
119
|
|
|
120
|
+
For the `worktree: no` brainstorming offer, keep the explicit-selection wait. Start the message with exactly `gauntlet: question` on its own line, with no suffix.
|
|
121
|
+
|
|
121
122
|
| Input | Route |
|
|
122
123
|
|---|---|
|
|
123
124
|
| brief with `## Process state` | process-state restore - `reference/brief-contract.md` "Process-state restore" |
|
|
@@ -135,8 +136,10 @@ re-derive the record.
|
|
|
135
136
|
|
|
136
137
|
## Post-restore continuation
|
|
137
138
|
|
|
139
|
+
A successful restore is an automatic handoff, not a terminal report; let the resumed skill own the next ask and its marker. Keep the brief fields unchanged and infer no approval. After citation repair of a plan that was dirty or untracked before repair, state explicitly that the repair stays in the working copy and lands with the next task commit; run no `git add` or repair commit, per `reference/brief-contract.md` "Citation repair".
|
|
140
|
+
|
|
138
141
|
After a successful restore, print the closing line from `reference/brief-contract.md`
|
|
139
|
-
(gate history not restored; the task to re-validate), then on its own line exactly one of `Standing grant active: <sentence>` or `No standing grant.` from check 6 (nothing when
|
|
142
|
+
(gate history not restored; the task to re-validate), then on its own line exactly one of `Standing grant active: <sentence>` or `No standing grant.` from check 6 (nothing when grant decoding was skipped), then continue in the stage's
|
|
140
143
|
owning skill **without** its reset-bearing entry:
|
|
141
144
|
|
|
142
145
|
| Active after restore | Continue in | Entry point |
|
|
@@ -154,6 +154,8 @@ a plan added after base pairs with it by basename. Zero specs -> stop; more than
|
|
|
154
154
|
human picks. The consumer carries this path to its entry check 6 and its post-restore
|
|
155
155
|
announcement without re-resolving it.
|
|
156
156
|
|
|
157
|
+
Honor SKILL.md entry check 6's deferred stop before any process-state arming call below; carry the resolved spec path without re-discovery. For brainstorm-stage briefs, resolve any existing spec through these candidate rules and run entry check 6's deferred-header admission before `start brainstorm`; with zero specs, restore brainstorm without a spec. Keep grant decoding exempt for this stage. A handoff after option 6's push succeeded but PR creation failed still has brainstorm in_progress; its deferred header stops restoration, not the ordinary gate.
|
|
158
|
+
|
|
157
159
|
| Active | Calls, in order |
|
|
158
160
|
|---|---|
|
|
159
161
|
| brainstorm | `start brainstorm`; `substep` if the brief shows one |
|
|
@@ -65,11 +65,15 @@ plan commit; treat every task as `pending`.
|
|
|
65
65
|
|
|
66
66
|
## Spec without plan
|
|
67
67
|
|
|
68
|
+
Run SKILL.md entry check 6's deferred-header admission on the resolved spec before the approval/handoff question below; apply it to both routes, including the unapproved-draft brainstorming handoff. Keep grant decoding exempt for the unapproved route.
|
|
69
|
+
|
|
70
|
+
Start the message with exactly `gauntlet: question` on its own line, with no suffix. Apply [menu-layout](../../brainstorming/reference/menu-layout.md).
|
|
71
|
+
|
|
68
72
|
Ask exactly one question: is this spec approved, or do you select `/skill:brainstorming`
|
|
69
73
|
with this unapproved spec as the draft? Show the spec path (and the brief's
|
|
70
74
|
`## Intent`/`## Decisions` when present).
|
|
71
75
|
|
|
72
|
-
- Approved: run SKILL.md entry check 6 on `<spec path>` first (a malformed `**Amend-grant:**` line stops here, no tracker call). Read the spec's `**Engine:**` line and take the matching route:
|
|
76
|
+
- Approved: honor SKILL.md entry check 6's deferred stop before any arming; run SKILL.md entry check 6 on `<spec path>` first (a malformed `**Amend-grant:**` line stops here, no tracker call). Read the spec's `**Engine:**` line and take the matching route:
|
|
73
77
|
- `loop`: call `start brainstorm`, then `skip brainstorm` with reason `resume: <spec path>` to arm the flow before `plan_check`. Carry absolute worktree/spec paths and the resolved plan directory into `/skill:loop-implementation` Entry steps 1-5: resolve settings at step 1 and verification at step 2, retain the driver's `skip plan` at step 3, create the ledger at step 4, then check/commit it and start implement at step 5. Never enter the writing-plans body or initialize a task tracker.
|
|
74
78
|
- `waves` or absent: `start brainstorm`; `skip brainstorm resume: <spec path>`; `start plan`; continue in writing-plans, skipping its `start plan` call.
|
|
75
79
|
- Selected unapproved-draft brainstorming handoff: invoke [`/skill:brainstorming`](../../brainstorming/SKILL.md) with
|
|
@@ -79,18 +83,22 @@ with this unapproved spec as the draft? Show the spec path (and the brief's
|
|
|
79
83
|
|
|
80
84
|
## Spec with ledger
|
|
81
85
|
|
|
86
|
+
Start the message with exactly `gauntlet: question` on its own line, with no suffix. Apply [menu-layout](../../brainstorming/reference/menu-layout.md).
|
|
87
|
+
|
|
82
88
|
Show the spec and ledger paths, current rows, iterations, last decision, and `git -C <worktree> status --porcelain`. Ask the human to confirm the approved spec and continuation; carry brief Intent/Decisions when present. Keep entry and same-repository checks.
|
|
83
89
|
|
|
84
90
|
After confirmation:
|
|
85
91
|
|
|
86
92
|
1. Read ledger line 1: require `# Ledger - loop engine`. Resolve its path-only `**Spec:**` header to an absolute spec path under the worktree's configured spec directories, not by basename. Run SKILL.md entry checks 1-6 in order, including check 6, **Grant field**, on that spec, before any tracker mutation.
|
|
87
93
|
2. Call `phase_tracker({ action: "start", phase: "brainstorm" })`, then `phase_tracker({ action: "skip", phase: "brainstorm", reason: "resume: <spec path>" })`, then `phase_tracker({ action: "start", phase: "plan" })`.
|
|
88
|
-
3. Call `plan_check({ planPath: <absolute ledger path> })`. On FAIL, stop with findings, retaining plan in_progress; never enter `## Plan repair` or writing-plans. On PASS, call `phase_tracker({ action: "skip", phase: "plan", reason: "resume: <spec> (loop engine)" })`, then `phase_tracker({ action: "start", phase: "implement" })`. Use the resolved absolute spec path as `<spec>` in the reason. Never call `plan_tracker init`.
|
|
94
|
+
3. Call `plan_check({ planPath: <absolute ledger path> })`. On FAIL, stop with findings, retaining plan in_progress. Start the message with `gauntlet: stuck` followed by the findings reason on that line; never enter `## Plan repair` or writing-plans. On PASS, call `phase_tracker({ action: "skip", phase: "plan", reason: "resume: <spec> (loop engine)" })`, then `phase_tracker({ action: "start", phase: "implement" })`. Use the resolved absolute spec path as `<spec>` in the reason. Never call `plan_tracker init`.
|
|
89
95
|
4. **Shared cap boundary (every ledger restore, before phase continuation).** Read `/skill:loop-implementation`. Skip Entry step 1 entirely; settings resolution and its unavailable-tool stop apply only to fresh seeding. Restore base, verification, iterations, `cap:`, row attempts, funding and retry allowances from the ledger/spec and branch without overwriting it. Render `cap: <n>`, rows, iterations, attempts, funding, retry allowances and all decisions; distinguish the latest operational `row <n> ...` decision from the last physical history line. A dirty tree takes the driver's discard-authorization stop without offering a cap grant. On a clean ledger missing `cap:`, stop with `ledger has no cap: line - seeded under the old loopEngine contract`, even when every row is closed. Use the driver's legacy `cap +N` grant (durable iterations + N), never settings. After the grant continue the original phase: implement at `Before each dispatch`; verify/ship at `After the loop` step 1, never reseed.
|
|
90
96
|
5. Continue at loop step 5, the delivered driver's `Before each dispatch`, with durable iterations and retry data. Never reset counters or reseed a validated seed.
|
|
91
97
|
|
|
92
98
|
## Spec with plan
|
|
93
99
|
|
|
100
|
+
Start the message with exactly `gauntlet: question` on its own line, with no suffix. Apply [menu-layout](../../brainstorming/reference/menu-layout.md).
|
|
101
|
+
|
|
94
102
|
Show, and ask the human to confirm or edit both in one reply:
|
|
95
103
|
|
|
96
104
|
1. Per task, in plan order: the commits after the plan commit that touch any path in
|
|
@@ -93,6 +93,8 @@ Run the ledger's `verification:` command exactly once foreground in the worktree
|
|
|
93
93
|
|
|
94
94
|
## Human stop
|
|
95
95
|
|
|
96
|
+
Read and apply [menu-layout](../brainstorming/reference/menu-layout.md). Start the message with `gauntlet: question` at every human stop, including the discard/reset authorization ask for a dirty or commit-boundary return. Put it alone on the first output line, followed by a newline before the stop text, without a driver-state preamble, wrapper or code fence. These decisions are neither done nor stuck outcomes.
|
|
97
|
+
|
|
96
98
|
Leave implement active. Use one screen of plain words: `Stopped on row <n> (<row text>)` for row failures, or the concrete boundary/cap/verification header above. `Problem:` quotes the evidence cell verbatim, identifying the actual spec/code contradiction, failing assertion/output or missing capability, and quotes the last decision line. Include funding budget only when funded. At every stop print `Preserve every row's attempts and the total iteration cap.` Omit round history, model escalation and reasoning traces.
|
|
97
99
|
|
|
98
100
|
Offer these concrete actions. Offer `cap +N` only at a clean cap or legacy missing-cap stop; dirty-tree and commit-boundary stops keep discard authorization and never offer `cap +N`. When both the row allowance and total cap are exhausted, list independent funding and cap offers despite rule 2 priority. Take separate replies: funding follows the spec's `**Amend-grant:**` contract, cap follows the row below; define no combined syntax.
|
|
@@ -67,6 +67,8 @@ Read and apply `reference/repo-audit.md` now in both modes (resolve against this
|
|
|
67
67
|
|
|
68
68
|
### 3 - Interactive questioning
|
|
69
69
|
|
|
70
|
+
Start the message with `gauntlet: question` before the current clarification. Apply [menu-layout](../brainstorming/reference/menu-layout.md), preserving one free-text question at a time.
|
|
71
|
+
|
|
70
72
|
One question at a time, only when intent is unclear or no AC is derivable; in repair, wait for all audits and ask in ref order. Never fabricate Context, Problem, or ACs to avoid asking.
|
|
71
73
|
|
|
72
74
|
### 4 - Draft
|
|
@@ -146,6 +148,8 @@ Complete the current ticket's write before presenting the next ticket. Immediate
|
|
|
146
148
|
|
|
147
149
|
## AC integrity gate
|
|
148
150
|
|
|
151
|
+
Start the message with `gauntlet: question` for the recoverable hard-stop draft and targeted recovery question, singleton runs included. Apply [menu-layout](../brainstorming/reference/menu-layout.md); keep approval unavailable. While awaiting values, emit no terminal batch line. Once the human ends recovery without values, count that ticket as `stopped` in the ended batch under [Complete the batch and present gates](reference/repo-audit.md#complete-the-batch-and-present-gates).
|
|
152
|
+
|
|
149
153
|
Runs twice: during gather (recovery via targeted questions) and on the assembled draft.
|
|
150
154
|
|
|
151
155
|
**Normalize first.** For additive overlap enrichment, preserve legacy rows verbatim and normalize only added/changed criteria under the gathered reference. For conformance-only repair with no audit or uniqueness AC change, parse checked, numbered, and prose criteria for validity without serializing them as `- [ ]`; preserve their raw bytes under step 6 while retaining every integrity outcome and hard stop. In other ordinary drafts and create-anyway, every criterion - numbered list, prose sentence, Given/When/Then, already-checked box - is extracted and rendered as a `- [ ]` item before gating. Those drafts emit ACs as `- [ ]` items, including repairs other than the conformance-only exception. No criterion evades the gate by syntax.
|