@softure-ai/skills 0.15.0 → 0.17.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/WORKFLOW.md CHANGED
@@ -86,7 +86,10 @@ or languages.
86
86
  // "push": local --no-ff merge, then push <main> through the pre-push hook
87
87
  "remergeMain": "when-needed", // "when-needed" (default): merge <main> into the branch before the merge only when
88
88
  // wt-merge-check.py finds an overlapping file, a migration or a dependency change;
89
- // "always": before every merge
89
+ // "on-conflict": only when the merge would conflict (the forge reports the PR not
90
+ // mergeable, or a local trial merge conflicts); the merged result is then not tested
91
+ // before the merge, so an incompatible but non-conflicting change surfaces on <main>
92
+ // or in the release gate; "always": before every merge
90
93
  "relatedTests": null, // e.g. "npx vitest related --run {files}": the test gate after a merge of <main>, for the
91
94
  // files the branch changes; null = the full test gate
92
95
  "fullGatePaths": [], // extra globs that force the full gates after a merge of <main> (built in: lockfiles,
@@ -128,6 +131,10 @@ Parallel sessions push often, and every push can start the project's CI. The ski
128
131
  - a "finish" item does not start a run of its own under `cadence: "roadmap"`;
129
132
  - before a merge, `<main>` is merged into the branch only when needed (`autonomy.remergeMain`), and such a merge
130
133
  re-runs only what it can break (`autonomy.relatedTests`), so a merge without overlap costs no push and no hook.
134
+ In a busy repository nearly every merge sees a migration or a dependency change from the one before it, and
135
+ `"when-needed"` then re-merges almost every time; `"on-conflict"` merges a pull request on its green-at-READY
136
+ checks unless the merge would conflict. It trades a CI run per merge for testing the merged result only on
137
+ `<main>` and in the release gate.
131
138
 
132
139
  The project's side: when the git hooks already run the gates (`pre-commit`, `pre-push`), CI does not need to
133
140
  repeat them on every pushed branch. A pre-push hook needs a cheap path for a push whose changed files are all
@@ -201,7 +208,8 @@ Free-form. Orchestrators append signals here.
201
208
  ## Roadmap handoff (only on a change branch, written by softure-archive --handoff)
202
209
  - **Status:** done | done_code (waiting: <what>)
203
210
  - **Done:** <the `## Done` outcome, one line>
204
- - **Owner check:** <item text> (Manual N.M) (one line per check)
211
+ - **Owner check:** <item text> (Manual N.M) (one line per check; manual mode only)
212
+ - **Owner step:** <exact step> (<reason>) (one line per thing only the owner can do)
205
213
  - **Before the next release:** <step> (one line per step)
206
214
  ```
207
215
 
@@ -275,7 +283,8 @@ Why this order; which items may run in parallel and which files each one owns.
275
283
  - [ ] what must happen before the next release/deploy (env var, manual migration step, …) (**FC-1**)
276
284
 
277
285
  ## Owner decisions and checks
278
- - [ ] **FC-1**: what waits for the owner (Manual 2.4). <evidence path>
286
+ - [ ] **FC-1**: what waits for the owner (Manual 2.4). <evidence path> (manual mode)
287
+ - [ ] **FC-2**: owner step: <exact step> (<why only the owner>). <path> (autonomous mode: decisions and owner steps only)
279
288
 
280
289
  ## Done
281
290
  - **FC-0** `some-change`: one line; archived in `archive/2026-09-30-some-change/`
@@ -303,7 +312,9 @@ Parsing rules (scripts depend on them):
303
312
  - `in_progress (<stage>, since <YYYY-MM-DD>; <where>)`
304
313
  - `ready_to_merge (since <YYYY-MM-DD>; <where>)`
305
314
  - `done`
306
- - `done_code (<YYYY-MM-DD>; waiting: <what>)`: merged, waits for a release or an owner check.
315
+ - `done_code (<YYYY-MM-DD>; waiting: <what>)`: merged, waits for a release or an owner check
316
+ (manual mode). In autonomous mode it never waits for an owner check: `waiting: release` or
317
+ `waiting: owner step: <what>` (§8).
307
318
  - **Stages** (first token inside the parentheses of `in_progress`): `research`, `frame`, `plan`,
308
319
  `plan-review`, `implement N/M`, `impl-review`, `integration`, `archive`.
309
320
  - The item block mirrors the row status in `- **Status:** …` directly under `- **Change ID:**`.
@@ -400,7 +411,10 @@ Rules:
400
411
  - It is the last section of the file, with one `### Phase N:` per `## Phase N:`.
401
412
  - Only `softure-implement` ticks boxes.
402
413
  - **The resume point is the first `- [ ]` under an `#### Automated` heading.** Open Manual items never block resuming.
403
- They are carried to the roadmap's `## Owner decisions and checks` at archive time.
414
+ They are carried to the roadmap's `## Owner decisions and checks` at archive time (manual mode).
415
+ - **Autonomous mode:** every Manual item ends `(evidence: <how the run checks it>)` or `(owner only: <reason>)`. The run
416
+ verifies the evidence items itself and ticks them with it; only `owner only` items stay open, and they become tracked
417
+ `Owner step:` lines, never owner checks (AGENTS.md → Operating mode: autonomous).
404
418
  - Notation:
405
419
  - done: `- [x] N.M text — <sha>`;
406
420
  - a Manual item the agent verified itself: `- [x] N.M text — <sha> (verified by agent: <how>)`;
@@ -475,6 +489,7 @@ it for every skill). In `--auto`:
475
489
  | `softure-worktree` READY | stop, merge on the owner's signal | merge (queue slot from the coordinator, if any) |
476
490
  | `softure-worktree-manager` | owner confirms the batch and every merge | launches, merges, refills, reports by itself |
477
491
  | push / PR / issue close / release | only on the owner's word for that action | §8.4 rules |
492
+ | Manual criteria | open ones go to the owner as checks | the run verifies them (`(evidence: …)`); only `(owner only: <reason>)` items become tracked owner steps |
478
493
 
479
494
  ### 8.3 Manual mode
480
495
 
@@ -485,7 +500,8 @@ leaves the working tree without the owner's word, approvals never carry over to
485
500
 
486
501
  Defined in `rules/AGENTS.md` → `## Operating mode: autonomous`: the standing consent, the
487
502
  coordinator and its sessions, the start of a run, the merge queue, reports, issues as the work
488
- source, filing gaps in SOFTURE packages, releases, and the stop rules. `autonomy` in `workflow.json` (§2) tunes it per project. Project-specific standing
503
+ source, filing gaps in SOFTURE packages, releases, the stop rules, and the rule that no item is
504
+ left for the owner's manual verification (the run verifies, closes, archives and releases). `autonomy` in `workflow.json` (§2) tunes it per project. Project-specific standing
489
505
  orders (a repo that is read-only, an extra label, a test that must not run per push) belong in the
490
506
  project's own `AGENTS.md`, outside the managed block, not in a session's memory.
491
507
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/skills",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "SOFTURE agent skills: a spec-driven delivery workflow (shape → prd → roadmap → plan → implement → review) plus parallel worktree orchestration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,7 +22,8 @@
22
22
  },
23
23
  "scripts": {
24
24
  "postinstall": "node scripts/install.mjs --postinstall",
25
- "validate": "node scripts/validate.mjs"
25
+ "validate": "node scripts/validate.mjs",
26
+ "test": "python3 -m unittest discover -s tests"
26
27
  },
27
28
  "engines": {
28
29
  "node": ">=20"
package/rules/AGENTS.md CHANGED
@@ -99,6 +99,22 @@ irreversible action nobody asked for, a secret or access only the owner has, sco
99
99
  `change.md`, a measurement that refutes the item's premise, or an idea for a new product or package
100
100
  (tell the owner in the project chat to plan it together; file nothing).
101
101
 
102
+ **Verify, never leave checks for the owner.** Never leave items for the owner's manual verification:
103
+ they come back to the agent anyway. The run verifies them itself, closes them, archives and
104
+ releases. A plan criterion is *Manual* only when no agent-runnable evidence can settle it; otherwise
105
+ the plan names the evidence (a test, a script or local check, a screenshot or frame grab the agent
106
+ looks at, the pipeline run and health check, CI logs, a schema or `ffprobe` check), the run produces
107
+ it and records it on the Progress item (command and result, SHA, link). No item ends `waiting: owner
108
+ check`, and `## Owner decisions and checks` holds no checks the run could do. Only four things are
109
+ genuinely the owner's: a paid provider call that needs the owner's yes, a secret, account or
110
+ connector only the owner has, a release or production deploy (Releases), and a taste judgement the
111
+ owner reserved for themselves in `change.md` or the PRD. Each becomes a tracked item with the exact
112
+ step and its reason (an `Owner step:` handoff line that `wt-roadmap.py done` writes to the roadmap,
113
+ or an issue), never a free-floating checkbox list. After an owner-approved deploy the run performs
114
+ the checks it can reach (pipeline run, health endpoint, logs) and closes the item; only a check the
115
+ container truly cannot reach becomes a tracked item naming why. A report never lists manual checks as
116
+ the owner's to-do.
117
+
102
118
  **Know your role.** Work in parallel has one coordinator and its threads:
103
119
  - **Coordinator**: the session in the project's main chat (the channel the owner talks to), or
104
120
  `softure-worktree-manager` locally. It plans, briefs, starts threads, gives the go to merge, and is
@@ -171,6 +187,10 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
171
187
  - Nudges stalled threads (waiting on CI, stopped by a usage limit) on every report: every working
172
188
  thread silent for 45 minutes or more gets a nudge in that firing.
173
189
  - A new question about the roadmap goes to a new thread; the old one is closed.
190
+ - **Open owner checks are work, not a to-do for the owner.** When the roadmap still holds open check
191
+ entries (under `## Owner decisions and checks`, or rows `done_code (…; waiting: owner check …)`),
192
+ start a thread that verifies them, closes the entries and rows, archives and, when code changed
193
+ and the owner's release word exists, releases. Never list them in a report for the owner.
174
194
 
175
195
  **Thread duties:**
176
196
  - Run the whole chain for its change (`softure-worktree`), deciding by the rules above.
@@ -198,15 +218,21 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
198
218
  - **The roadmap state lives on the main branch, never on a change branch.** Branches do not edit
199
219
  `roadmap.md`: `wt-roadmap.py` writes every stage on the main branch (`open`, `stage`, `ready`), and
200
220
  the thread runs `wt-roadmap.py done <change-id>` right after its merge; it takes the `## Done`,
201
- owner-check and release lines from the archived `change.md` (`softure-archive --handoff`). Only
202
- `worktree.cloudState: "branch"` keeps the old flow, where the branch carries its own row.
221
+ owner-step and release lines from the archived `change.md` (`softure-archive --handoff`). In this
222
+ mode it refuses `Owner check:` lines and `waiting: owner check`: verify them, then re-run it with
223
+ `--verified "<evidence>"`. Only `worktree.cloudState: "branch"` keeps the old flow, where the
224
+ branch carries its own row.
203
225
  - **Merge the main branch in only when needed** (`autonomy.remergeMain: "when-needed"`, the default).
204
226
  After the go, run `softure-worktree/scripts/wt-merge-check.py`. `merge-as-is` (the forge reports the
205
227
  pull request mergeable, and since the branch last merged it the main branch brought no migration, no
206
228
  dependency change and no file the branch also changes): merge the pull request as it is; its checks
207
229
  were green at READY. `remerge`: merge the fresh main branch in, resolve conflicts yourself, run the
208
230
  `RUN` lines it prints, push. The main branch is the source of truth: what it has and the branch lacks
209
- is pulled in and wired. `"always"`: merge the main branch in before every merge.
231
+ is pulled in and wired. `"on-conflict"`: `merge-as-is` unless the merge would conflict (the forge
232
+ reports the pull request not mergeable: pass `--not-mergeable`; or the script's trial merge
233
+ conflicts); overlap, migrations and dependency changes alone do not force a merge of the main
234
+ branch, so the merged result is first tested on the main branch and in the release gate.
235
+ `"always"`: merge the main branch in before every merge.
210
236
  - **A merge of the main branch re-runs only what it can break:** every gate except the test gate, plus
211
237
  `autonomy.relatedTests` for the files the branch changes. The full suite runs again only when the
212
238
  incoming changes add a migration or touch dependencies, test setup or config (`wt-merge-check.py`
@@ -217,7 +243,8 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
217
243
  green checks, merge it on the forge; the forge deletes the head branch. `"push"`: `git merge --no-ff`
218
244
  locally, then push the main branch through the pre-push hook.
219
245
  - When one thread has had to chase the main branch several times, the coordinator tells the others
220
- to hold their merges until it lands.
246
+ to hold their merges until it lands. Under `remergeMain: "on-conflict"` the go never asks for
247
+ "Update branch" or a merge of the main branch: the thread merges on `wt-merge-check.py`'s verdict.
221
248
  - Hooks stay on: never `--no-verify`, never force-push, never disable or loosen a test to get green.
222
249
  Long hooks run in the background with the longest timeout; a hung one is killed by its PID and
223
250
  re-run.
@@ -50,7 +50,7 @@ re-running is always safe. Report what you found and what you completed.
50
50
  | change.md `status` is `impl_reviewed` | | `implemented` (no review) or earlier |
51
51
  | plan.md exists | | no: work done without the chain (interactively, or a change that turned out to need no code). Archive it anyway, see "Without a plan" |
52
52
  | plan.md Progress: no open `#### Automated` items | yes: name them | |
53
- | plan.md Progress: open `#### Manual` items | | yes: they become owner checks (step 4) |
53
+ | plan.md Progress: open `#### Manual` items | `--auto`: yes, for every open item without `(owner only: <reason>)`: the run verifies it first (`softure-implement`), it never becomes an owner check | manual mode: yes, they become owner checks (step 4); `--auto`: `(owner only: …)` items become owner steps (step 4) |
54
54
  | Progress without `#### Automated` / `#### Manual` headings (an older or hand-written plan) | open items count as Automated, unless the owner marks one as a human check (interactive only) | |
55
55
  | done rows carry ` — <sha>` (7+ hex, optionally followed by `(verified by agent: …)`), or are `~~dropped~~ — dropped: …` | | rows without one: name them. Legitimate for phases with no code; never add SHAs yourself, that is `softure-implement`'s job |
56
56
  | `reviews/impl-review.md` exists | | no review on file |
@@ -87,7 +87,8 @@ hard stops. Sample reports: [references/example-archive.md](references/example-a
87
87
  - `done` when everything is delivered and verified;
88
88
  - `done_code (<today>; waiting: <what>)` when the code is finished but something still
89
89
  waits. Examples: a release, an open Manual item, a deploy-only check. `--done-code`
90
- forces this, using the given text.
90
+ forces this, using the given text. In `--auto` the waiting text never says `owner check`:
91
+ it names the release (`waiting: release`) or the owner step (`waiting: owner step: <what>`).
91
92
  - Replace only the **last cell** of the row; leave the other cells alone.
92
93
  - Update `- **Status:** …` in the item block under `- **Change ID:**`.
93
94
  - Append to `## Done`:
@@ -102,7 +103,14 @@ hard stops. Sample reports: [references/example-archive.md](references/example-a
102
103
  stage the file, and say so in the report so its owner commits it with their work.
103
104
  4. **Owner checks.** For each open Manual item, add a line under `## Owner decisions and checks`:
104
105
  `- [ ] **<ID>**: <item text> (Manual N.M). archive/<created>-<id>/plan.md`. Do the same for
105
- deferred review findings that target the owner. Anything that must happen before the next
106
+ deferred review findings that target the owner. **`--auto`:** no owner checks. Things the run
107
+ could verify were verified before this step (precondition), and verified Manual items carry
108
+ their evidence. Only what genuinely needs the owner is written, as a tracked owner step with its
109
+ reason: `- [ ] **<ID>**: owner step: <exact step> (<reason>). archive/<created>-<id>/change.md`.
110
+ The reasons: a paid provider call that needs the owner's yes, a secret, account or connector
111
+ only the owner has, a release or production deploy, a taste judgement the owner reserved in
112
+ `change.md` or the PRD. A deferred finding that needs a product decision stays a decision
113
+ entry; one the run can check is checked. Anything that must happen before the next
106
114
  deploy (an environment variable, a manual migration step, a production check) goes under
107
115
  `## Before the next release` as `- [ ] <what> (**<ID>**)`. Unlinked change: these stay under
108
116
  `## Notes` of its change.md.
@@ -135,9 +143,15 @@ to every orchestrator and blocks closing the roadmap. When there is no `plan.md`
135
143
 
136
144
  `mode: "autonomous"` in `context/workflow.json` implies `--auto` for every run of this skill; `mode: "manual"` (or no key) never does (WORKFLOW §8).
137
145
 
138
- Proceed on soft warnings. Record each one in the archive commit body and in the roadmap owner
139
- checks. Pick `done_code` whenever any Manual item is open or the change affects deployment
140
- (migrations, env vars, infrastructure). Hard stops stay stops: report them all and end.
146
+ Proceed on soft warnings. Record each one in the archive commit body. Pick `done_code` whenever an
147
+ `(owner only: …)` item is open or the change affects deployment (migrations, env vars,
148
+ infrastructure). Hard stops stay stops: report them all and end.
149
+
150
+ Never leave an item for the owner's manual verification (AGENTS.md → Operating mode: autonomous).
151
+ An open Manual item without `(owner only: <reason>)` is a hard stop: verify it (run its evidence,
152
+ tick it through `softure-implement`), then archive. The item ends `done` or `done_code (waiting:
153
+ release)` / `done_code (waiting: owner step: <what>)`, never `waiting: owner check`, and
154
+ `## Owner decisions and checks` receives decisions and owner steps only.
141
155
 
142
156
  ## Inside a worktree
143
157
 
@@ -151,13 +165,16 @@ one section at the end of the archived `change.md` (WORKFLOW §4), in this exact
151
165
  - **Status:** done_code (waiting: <what waits>)
152
166
  - **Done:** <outcome, one line>
153
167
  - **Owner check:** <item text> (Manual N.M)
168
+ - **Owner step:** <exact step> (<why only the owner can do it>)
154
169
  - **Before the next release:** <what must happen before the next deploy>
155
170
  ```
156
171
 
157
172
  `Status` is `done` or `done_code (waiting: <what>)`, chosen as in step 3 (no date: the script
158
173
  stamps the merge day). One `Owner check` line per open Manual item or owner-targeted deferred
159
- finding, one `Before the next release` line per deploy prerequisite; leave out lines that have
160
- nothing to say. Right after the merge, `wt-roadmap.py done <change-id>` reads the section from
174
+ finding (manual mode only), one `Owner step` line per thing only the owner can do (`--auto`; also
175
+ fine in manual mode), one `Before the next release` line per deploy prerequisite; leave out lines
176
+ that have nothing to say. In `--auto` the handoff has **no** `Owner check` lines and its status
177
+ never reads `waiting: owner check`: `wt-roadmap.py done` refuses both in autonomous mode. Right after the merge, `wt-roadmap.py done <change-id>` reads the section from
161
178
  the main branch and writes the row, the item block, `## Done`, `## Owner decisions and checks`
162
179
  and `## Before the next release`. The report says `roadmap: handed off (wt-roadmap.py done after
163
180
  the merge)`.
@@ -172,12 +189,16 @@ row by row during the merge. Do not touch rows of other items.
172
189
  - [ ] `status: archived` and `archived_at` set, the stamp inside the commit; folder named by `created`.
173
190
  - [ ] Roadmap row last cell, item block status, `## Done` and `updated` all changed (or the skip is reported);
174
191
  with `--handoff`, `roadmap.md` untouched and `## Roadmap handoff` written instead.
175
- - [ ] Open Manual items listed for the owner; deploy prerequisites under `## Before the next release`.
192
+ - [ ] Open Manual items listed for the owner (manual mode), or none left but `(owner only: …)` ones,
193
+ written as owner steps (`--auto`); deploy prerequisites under `## Before the next release`.
176
194
  - [ ] No dangling links; one commit, conventional message, not pushed.
177
195
 
178
196
  ## Anti-patterns
179
197
 
180
- - Ticking Manual items to make archiving clean. They go to the owner list instead.
198
+ - Ticking Manual items to make archiving clean. They go to the owner list instead (manual mode),
199
+ or are verified for real (`--auto`).
200
+ - `--auto`: handing a check the run could perform to the owner (`Owner check:`, `waiting: owner
201
+ check`). Verify it, record the evidence, close the item.
181
202
  - Archiving with a red gate "to clean up later".
182
203
  - Rewriting history in the archived plan, or adding SHAs to it. It is a record and stays as it was executed.
183
204
  - Marking `done` when a release is still needed. That is `done_code`.
@@ -72,7 +72,9 @@ Read when needed:
72
72
  command output, a screenshot. Re-run the gates (`gates.*`) and every Automated criterion that
73
73
  names a command; do not trust earlier runs. A ticked box without evidence is **CRITICAL**.
74
74
  `(verified by agent: …)` must point at something that exists. Open Manual items are pending,
75
- not findings.
75
+ not findings, except in `--auto`: there an open Manual item without `(owner only: <reason>)` is
76
+ a WARNING (the run could verify it), decided `fix now` by running its evidence and ticking it
77
+ through `softure-implement`'s notation.
76
78
  3. **Check drift.** Everything the code does that the plan did not ask for, everything the plan
77
79
  asked for that the code does not do. Intentional drift must be explained in plan.md
78
80
  (`## Decisions (auto)` or a phase note). Unexplained drift is a finding. A flaw in the plan
@@ -174,7 +176,9 @@ Files: planned and changed N · unplanned N (…) · planned, not changed N (…
174
176
 
175
177
  - CRITICAL and WARNING findings that have a clear local fix: `fix now` (the recommended option).
176
178
  - Fixes that need a product decision: `defer` to the roadmap "Owner decisions and checks"
177
- list, with the finding ID.
179
+ list, with the finding ID. A check the run can perform is never deferred to the owner: verify it
180
+ and record the evidence (`fix now`).
181
+ - Open Manual items without `(owner only: <reason>)`: `fix now` by running their evidence (above).
178
182
  - SUGGESTIONs: `accept`, unless the fix is under about 10 lines and risk-free.
179
183
  - A finding that matches a pattern already seen in lessons.md, or that repeats across changes:
180
184
  also `record as lesson`.
@@ -111,7 +111,8 @@ mandatory; stop with an error.
111
111
  - Manual items: first try to verify them yourself where a machine can stand in for the eye:
112
112
  screenshots at the stated widths and themes, a recorded request/response, a DB read. Tick
113
113
  such an item with `(verified by agent: <how>)`. Anything that needs the owner's judgement
114
- stays `- [ ]`.
114
+ stays `- [ ]`. `--auto`: every `(evidence: …)` Manual item is verified by running that
115
+ evidence; only `(owner only: <reason>)` items stay open (see `## --auto`).
115
116
 
116
117
  7. **Manual gate** (interactive only). When manual items remain open, pause before committing
117
118
  and show the gate message (format and options in `references/phase-commit.md`): what passed
@@ -194,6 +195,14 @@ steps 7 to 9:
194
195
  (generated types, a lockfile, a snapshot) joins the touched-file set; any other unknown path is
195
196
  an escalation.
196
197
  - Use the proposed commit message as is.
198
+ - **Verify the Manual items yourself.** Run the evidence each Manual item names (test, script,
199
+ local render, screenshot or frame grab you look at, pipeline run and health check, CI logs,
200
+ `ffprobe` or schema check) and tick it with
201
+ ` — <sha> (verified by agent: <command> → <result>[, <link>])`. Never leave an `(evidence: …)`
202
+ item open for the owner: a check that fails is a defect to fix in the phase; evidence that cannot
203
+ be produced in this environment is an escalation naming why, not an owner check. Only
204
+ `(owner only: <reason>)` items stay `- [ ]`. A Manual item with neither annotation (an older
205
+ plan) is verified like an `(evidence: …)` one when a machine can settle it.
197
206
  - Escalate (stop with a report) when:
198
207
  - the approach is invalid (re-plan needed);
199
208
  - a gate stays red after a reasonable fix attempt and you cannot prove the failure pre-exists;
@@ -210,7 +219,8 @@ steps 7 to 9:
210
219
  - [ ] Every ticked item carries its phase SHA, and no Progress edit was amended into its own commit.
211
220
  - [ ] TDD phases show a red test before the implementation.
212
221
  - [ ] Drift is recorded. No silent design changes.
213
- - [ ] Open Manual items are listed for the owner, not ticked on the user's behalf.
222
+ - [ ] Open Manual items are listed for the owner, not ticked on the user's behalf; in `--auto`
223
+ only `(owner only: …)` items are left open, every other Manual item carries its evidence.
214
224
  - [ ] Nothing was pushed, tagged, released or deployed.
215
225
 
216
226
  ## Anti-patterns
@@ -228,4 +238,5 @@ steps 7 to 9:
228
238
  ## Handoff
229
239
 
230
240
  Next: `softure-impl-review <change-id>`. Open manual items go to the owner. In a roadmap, they
231
- are listed under "Owner decisions and checks" at archive time.
241
+ are listed under "Owner decisions and checks" at archive time. In `--auto` only
242
+ `(owner only: <reason>)` items remain, and they become `Owner step:` lines at archive time.
@@ -138,7 +138,7 @@ only when it was detected or the user asked for it:
138
138
  | `worktree.cloudState` | `"main"` (roadmap state on the main branch, branches never edit `roadmap.md`) | the user runs cloud sessions whose pre-push hook has no cheap path for `context/`-only pushes and wants the state on the branch (`"branch"`) |
139
139
  | `research.sources` | none | step 2 found docs, ADRs or a PRD (interactive: listed in the plan; `--auto`: only paths that exist) |
140
140
  | `install` | gitignore the skills, inject all rule sections | the user wants committed skills or fewer rule sections (the language section always ships; `allowNonEnglishCode: true` only on the owner's explicit word) |
141
- | `autonomy` | roadmap as the work source, merge via pull request, `<main>` merged into a branch only when needed (`remergeMain: "when-needed"`; add `relatedTests`, e.g. `npx vitest related --run {files}`, when the test runner has one), reports every 60 min around the clock (`reports.every`, `reports.hours: null`; routines fire at most hourly; the routine is also the run's heartbeat, so keep it 24/7) | `mode` is `autonomous` and the user names issues as the queue, merges by push, or another report cadence |
141
+ | `autonomy` | roadmap as the work source, merge via pull request, `<main>` merged into a branch only when needed (`remergeMain: "when-needed"`; `"on-conflict"` when the main branch takes a migration or a dependency change on nearly every merge and the owner accepts testing the merged result on main and in the release gate; add `relatedTests`, e.g. `npx vitest related --run {files}`, when the test runner has one), reports every 60 min around the clock (`reports.every`, `reports.hours: null`; routines fire at most hourly; the routine is also the run's heartbeat, so keep it 24/7) | `mode` is `autonomous` and the user names issues as the queue, merges by push, or another report cadence |
142
142
 
143
143
  Content of the README files, and a complete worked example (detection, plan, report) for a
144
144
  fictional repo: read `references/templates.md` **when writing the READMEs** and
@@ -143,7 +143,10 @@ alone.
143
143
  - **Tests:** the named cases, including empty, boundary and failure paths.
144
144
  - **Done when:** criteria phrased so that someone else could check them, as plain bullets
145
145
  (checkboxes live only in `## Progress`). Split them into *Automated* (a command, a test,
146
- a query) and *Manual* (only a human can judge it, such as visual quality or tone).
146
+ a query) and *Manual* (only a human can judge it, such as visual quality or tone). In
147
+ `--auto`, a criterion is *Manual* only when no agent-runnable evidence can settle it, and
148
+ every Manual criterion carries either `(evidence: <what the run produces and inspects>)` or
149
+ `(owner only: <reason>)`; see `## --auto` below.
147
150
  - The last automated criterion of every phase is "Gates green (typecheck, lint, test)", using
148
151
  the gates from `workflow.json`. Never write the commands themselves into the plan from
149
152
  memory: take them from `workflow.json`.
@@ -255,6 +258,15 @@ them, never an extra `##` heading.
255
258
  - Never stop to ask for an id: without one, stop and report.
256
259
  - Stop and escalate when the only viable approach contradicts change.md Constraints, requires a
257
260
  destructive data operation, or needs an owner-only decision.
261
+ - **No hidden owner checks.** The run verifies its own Manual criteria (AGENTS.md → Operating mode:
262
+ autonomous). Each Manual criterion names the evidence the run produces itself, as
263
+ `(evidence: <how>)`: a test, a script or local check (e.g. a free local render), a screenshot or
264
+ frame grab the agent inspects, the deploy pipeline's run and health check, CI logs, an
265
+ `ffprobe` or schema check. Only when no such evidence exists does it carry
266
+ `(owner only: <reason>)`, and the reason is one of: a paid provider call that needs the owner's
267
+ yes, a secret, account or connector only the owner has, a release or production deploy, or a
268
+ taste judgement the owner reserved in `change.md` or the PRD (name where). A Manual criterion with
269
+ neither is not a valid plan.
258
270
 
259
271
  ## Quality checklist
260
272
 
@@ -269,6 +281,7 @@ them, never an extra `##` heading.
269
281
  out of scope appears in a phase.
270
282
  - [ ] The Key decisions table names a source for every decision.
271
283
  - [ ] The plan contains no open questions.
284
+ - [ ] `--auto`: every Manual criterion carries `(evidence: …)` or `(owner only: <reason>)`.
272
285
  - [ ] Phase blocks have no checkboxes; `## Progress` matches the phases one-to-one and follows
273
286
  the reference format.
274
287
 
@@ -18,7 +18,7 @@ to report progress. It must stay machine-friendly.
18
18
  - [ ] 1.2 Gates green (typecheck, lint, test)
19
19
 
20
20
  #### Manual
21
- - [ ] 1.3 <criterion only a human can judge>
21
+ - [ ] 1.3 <criterion only a human can judge> (evidence: <what the run produces and inspects>)
22
22
 
23
23
  ### Phase 2: <exact title of "## Phase 2:">
24
24
 
@@ -34,6 +34,9 @@ to report progress. It must stay machine-friendly.
34
34
  3. Each phase has `#### Automated`, and `#### Manual` only when it has manual criteria. Automated
35
35
  comes first.
36
36
  4. Items are numbered `N.M`, continuously within a phase across both groups (1.1, 1.2, 1.3…).
37
+ In autonomous mode every Manual item ends with `(evidence: <how the run checks it>)` or, when no
38
+ agent-runnable evidence can settle it, `(owner only: <reason>)` (`softure-plan` → `--auto`).
39
+ Manual mode may use the same annotations; it does not require them.
37
40
  5. One item is one checkable criterion. Write it as a statement of the end state, not as an
38
41
  activity ("Unsubscribe link returns 303 to /unsubscribe", not "Implement unsubscribe link").
39
42
  6. The last automated item of every phase is `Gates green (typecheck, lint, test)`.
@@ -42,7 +45,9 @@ to report progress. It must stay machine-friendly.
42
45
  - after the phase commit, append ` — <short sha>` to every item ticked in that phase;
43
46
  - a manual item verified by the agent itself (screenshot, DB read) gets
44
47
  ` — <sha> (verified by agent: <how>)`;
45
- - a manual item that only the owner can check stays `- [ ]`.
48
+ - a manual item that only the owner can check stays `- [ ]`. In autonomous mode that is only an
49
+ `(owner only: <reason>)` item; an `(evidence: …)` item is verified by the run and ticked with
50
+ its evidence (command and result, SHA, link), like an Automated one.
46
51
  8. The resume point is the **first `- [ ]` in an Automated group**. Manual items still open do
47
52
  not block the next phase. They are listed for the owner at the end.
48
53
  9. Never delete or rename an item after implementation starts. When the plan changes
@@ -68,8 +73,12 @@ to report progress. It must stay machine-friendly.
68
73
  - **Resume point:** the first `- [ ]` under an `#### Automated` heading.
69
74
  - **Current phase:** the phase that holds the resume point, or the last phase when there is none.
70
75
  - **Completion:** ticked items divided by all items, dropped items counted as ticked.
71
- - **Open owner checks:** every `- [ ]` under `#### Manual`. They go to the roadmap's
76
+ - **Open owner checks** (manual mode): every `- [ ]` under `#### Manual`. They go to the roadmap's
72
77
  `## Owner decisions and checks` at archive time.
78
+ - **Autonomous mode:** an open `(evidence: …)` Manual item is unfinished work, not an owner check:
79
+ the run verifies it before archiving. Only open `(owner only: <reason>)` items survive, as
80
+ `Owner step:` lines in the roadmap handoff (tracked items with the exact step), never as owner
81
+ checks.
73
82
 
74
83
  Drift between change.md and Progress, worth reporting wherever it is noticed:
75
84
 
@@ -125,9 +125,10 @@ Read `mode` at A0 (`python3 <S>/wt_config.py mode`; WORKFLOW §8, the project's
125
125
  3. then Phase B by `autonomy.merge`:
126
126
  - `"pr"` (default): the pull request was opened at READY (`Closes #N` when
127
127
  the change solves an issue). After the go, run
128
- `python3 <S>/wt-merge-check.py`. `VERDICT merge-as-is` and the forge
129
- reports the pull request mergeable → merge it as it is (its checks were
130
- green at READY). `VERDICT remerge` (or `autonomy.remergeMain: "always"`)
128
+ `python3 <S>/wt-merge-check.py` (add `--not-mergeable` when the forge
129
+ reports the pull request not mergeable). `VERDICT merge-as-is` and the
130
+ forge reports the pull request mergeable → merge it as it is (its checks
131
+ were green at READY). `VERDICT remerge` (or `autonomy.remergeMain: "always"`)
131
132
  → merge `origin/<main>` into the branch (A5), run the `RUN` lines it
132
133
  printed, push, and enable the forge's auto-merge for the pull request
133
134
  (`gh pr merge <N> --auto --merge` or the forge tool) so it merges on
@@ -241,8 +242,11 @@ often no outbound access to production hosts or ssh. So:
241
242
  - Integration: exactly as locally — A3.8 — when the project's integration
242
243
  command can run from the container (a remote CI command needs only git and
243
244
  network). If it cannot, say so verbatim in READY.
244
- - Anything that needs production (a request to the live site, ssh) goes to
245
- **Pending owner checks**, with the exact command.
245
+ - Anything that needs production (a request to the live site, ssh): first try
246
+ what the container can reach (the deploy pipeline's run, a public health
247
+ endpoint, CI or platform logs) and record that evidence. Only a check the
248
+ container truly cannot reach becomes a tracked owner step (`Owner step:` in
249
+ the handoff) naming the exact command and why it cannot run here.
246
250
  - Browsers: use the preinstalled ones; never download browser binaries.
247
251
  - Long commands (the full test gate, a push whose hook runs it): start them in
248
252
  the background with the longest timeout the tool allows — the default limit
@@ -622,8 +626,11 @@ Two hard requirements before you leave this step:
622
626
  does.** A3.5 verifies most "manual" checks itself (browser automation, the
623
627
  database, HTTP, the product's own tools). A check you can drive belongs under
624
628
  `#### Automated` with the command that drives it. Reserve `#### Manual` for
625
- what genuinely needs the owner's eyes — visual taste, copy tone, a third-party
626
- console.
629
+ what genuinely needs the owner and no agent-runnable evidence can settle,
630
+ and annotate every Manual item: `(evidence: <what the run produces and
631
+ inspects>)` or `(owner only: <reason>)` (`softure-plan` → `--auto`). Taste is
632
+ `owner only` only when the owner reserved it in `change.md` or the PRD;
633
+ otherwise the run judges it against the brief and a screenshot it looks at.
627
634
 
628
635
  ##### Choose the implementation discipline here
629
636
 
@@ -711,9 +718,17 @@ verification back. Work through each `#### Manual` item and drive it:
711
718
  Tick the box **only on evidence you actually looked at**;
712
719
  `/softure-implement` is the sole writer of `## Progress`.
713
720
 
714
- What you genuinely cannot verify — visual taste, production DNS, a third-party
715
- dashboard, real email delivery — stays `- [ ]` and goes into a **Pending owner
716
- checks** list in the READY report. It does not block archiving.
721
+ - **Pipelines and logs** — the deploy pipeline's run, a health endpoint, CI
722
+ logs, `ffprobe` or a schema check on a produced file.
723
+
724
+ Never leave an item for the owner's manual verification: verify, close,
725
+ archive, release (AGENTS.md → Operating mode: autonomous). What the run
726
+ genuinely cannot do — a paid provider call that needs the owner's yes, a
727
+ secret, account or connector only the owner has, a release or production
728
+ deploy, a taste judgement the owner reserved — stays `- [ ]` with its
729
+ `(owner only: <reason>)` and becomes an `Owner step:` line in the handoff
730
+ (A4), a tracked item with the exact step. There is no "Pending owner checks"
731
+ list; the READY report names owner steps, if any.
717
732
 
718
733
  ##### When the plan and the code disagree
719
734
 
@@ -806,12 +821,18 @@ this at the start of the next change, do not write it.
806
821
 
807
822
  Code that needs a release, a new production secret or a production check ends
808
823
  as **`done_code (<date>; waiting: <what>)`** — on `<main>`, waiting for the
809
- owner's release. Put the owner's steps in the roadmap section
824
+ owner's release (`waiting: release`, never `waiting: owner check`). Put the owner's steps in the roadmap section
810
825
  `## Before the next release` (create it above `## Owner decisions and checks`
811
826
  if missing): a new secret (where it must be set, under which name), a new
812
827
  build-time value, a migration to watch, a one-off command, a production check
813
828
  (an exact `curl`). It is the owner's checklist before they publish.
814
829
 
830
+ **After the owner-approved deploy**, the run performs the post-deploy checks
831
+ it can reach itself — the pipeline run, the health endpoint, the logs — and
832
+ closes the item (`wt-roadmap.py done <change-id> --verified "<evidence>"`
833
+ moves a `done_code` row to `done`). Only a check the container truly cannot
834
+ reach becomes a tracked owner step that names why.
835
+
815
836
  While `release.owner` is true: never create a tag, never publish a release,
816
837
  never trigger a release workflow, never edit release/deploy workflows or add a
817
838
  production environment to any workflow without an explicit order from the
@@ -828,8 +849,9 @@ change folder first (they are yours). Then, on the branch:
828
849
  - **`roadmap.md` is not touched on the branch.** The archived `change.md`
829
850
  carries `## Roadmap handoff` instead: `Status: done`, or `done_code
830
851
  (waiting: <what waits for the release>)` when the change awaits a deploy
831
- (pure document changes stay `done`), the `## Done` outcome, the owner checks
832
- and the steps for `## Before the next release`. `wt-roadmap.py done
852
+ (pure document changes stay `done`), the `## Done` outcome, the owner steps
853
+ (no owner checks in autonomous mode) and the steps for `## Before the next
854
+ release`. `wt-roadmap.py done
833
855
  <change-id>` writes all of it on `<main>` right after the merge (Phase B).
834
856
  With `cloudState: "branch"` archive without `--handoff`: the branch's row and
835
857
  item block must read `done` / `done_code`, and the `## Done` line is there.
@@ -847,6 +869,10 @@ merge-as-is` → skip the merge; READY says `<main> not merged in
847
869
  (wt-merge-check: merge-as-is)` and the pull request is merged as it is after
848
870
  the go. `VERDICT remerge` → merge as below, then run the `RUN` lines it printed
849
871
  (the gates the merge can break: `GATES related` or `full`) before pushing.
872
+ `autonomy.remergeMain: "on-conflict"` → `remerge` only when the merge would
873
+ conflict (its trial merge, or `--not-mergeable` when the forge says so);
874
+ overlap, migrations and dependency changes are printed but do not force it, and
875
+ a go under this policy never asks for "Update branch".
850
876
  `autonomy.remergeMain: "always"` → always merge. The same check runs again
851
877
  after the go (*Operating mode*), because `<main>` keeps moving. Otherwise
852
878
  (manual mode, or `autonomy.merge: "push"`) the branch is always made current:
@@ -971,7 +997,7 @@ merge at the end.
971
997
  With `--no-tests`, the owner has also waived that later run; say so.
972
998
  Then record the roadmap state on `<main>`: `python3 <S>/wt-roadmap.py done
973
999
  <change-id>` (a documents-only commit of the row, the item block, `## Done`,
974
- the owner checks and the release steps from the archived change's
1000
+ the owner steps and the release steps from the archived change's
975
1001
  `## Roadmap handoff`; with `cloudState: "branch"` the merge already brought
976
1002
  them).
977
1003
  5. **Cleanup — only your own:**
@@ -2,7 +2,7 @@
2
2
  """Decide whether a change branch must merge the main branch in again before its merge, and which gates
3
3
  that merge has to re-run.
4
4
 
5
- wt-merge-check.py [--base <ref>] [--no-fetch]
5
+ wt-merge-check.py [--base <ref>] [--no-fetch] [--not-mergeable]
6
6
 
7
7
  Run in the change branch's checkout (worktree or cloud session), after the go and before merging the
8
8
  pull request. Compares what `<main>` brought since the branch last merged it (merge-base..origin/<main>)
@@ -10,12 +10,23 @@ with what the branch changes (merge-base..HEAD) and prints:
10
10
 
11
11
  VERDICT merge-as-is | remerge
12
12
  GATES none | related | full
13
- <one line per finding: incoming, overlap, migrations, dependencies, test setup/config>
13
+ <one line per finding: incoming, conflict, overlap, migrations, dependencies, test setup/config>
14
14
  RUN <command> (only with `remerge`: the gates to run on the merged tree, in order)
15
15
 
16
- `merge-as-is` — `<main>` has not moved, or (with `autonomy.remergeMain: "when-needed"`, the default) it
17
- brought no migration, no dependency change and no file the branch also changes. Merge the pull request
18
- as it is, provided the forge reports it mergeable and its checks were green at READY. No push, no hook.
16
+ `conflict` is a local trial merge (`git merge-tree --write-tree`, nothing is written to the branch or the
17
+ working tree): `none`, `yes` with the conflicting files, or `unknown` when this git cannot run it (2.38+
18
+ needed). Pass `--not-mergeable` when the forge reports the pull request not mergeable; it counts as a
19
+ conflict under every policy.
20
+
21
+ `merge-as-is` — `<main>` has not moved, or `autonomy.remergeMain` finds no reason to merge it in:
22
+ - `"when-needed"` (the default): `<main>` brought no migration, no dependency change and no file the
23
+ branch also changes (a conflict always comes with such a file);
24
+ - `"on-conflict"`: the merge does not conflict. Overlap, migrations and dependency changes are still
25
+ printed (and still decide GATES when a remerge does happen), but they do not force a remerge. The
26
+ merged result is then not tested before the merge: a change that is incompatible without conflicting
27
+ surfaces on `<main>` or in the release gate instead of on the branch.
28
+ Merge the pull request as it is, provided the forge reports it mergeable and its checks were green at
29
+ READY. No push, no hook.
19
30
 
20
31
  `remerge` — merge `origin/<main>` into the branch, resolve, run the RUN lines, push. GATES says what the
21
32
  merge can break:
@@ -40,6 +51,7 @@ sys.dont_write_bytecode = True # no __pycache__ inside the consumer's .claude/s
40
51
  sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
41
52
  from wt_config import load_config # noqa: E402
42
53
 
54
+ POLICIES = ("when-needed", "on-conflict", "always")
43
55
  DEPENDENCY_FILES = {
44
56
  "package.json", "package-lock.json", "npm-shrinkwrap.json", "pnpm-lock.yaml", "pnpm-workspace.yaml",
45
57
  "yarn.lock", "bun.lock", "bun.lockb", ".npmrc", ".nvmrc", ".node-version",
@@ -75,10 +87,27 @@ def listing(files: list[str], limit: int = 8) -> str:
75
87
  return ", ".join(files[:limit]) + more
76
88
 
77
89
 
90
+ def trial_merge(merge_base: str, head: str, base_sha: str) -> tuple[str, list[str]]:
91
+ """Merge `base_sha` into `head` in memory. Returns ("none" | "yes" | "unknown", conflicting files)."""
92
+ result = subprocess.run(
93
+ ["git", "merge-tree", "--write-tree", "--name-only", "--no-messages",
94
+ f"--merge-base={merge_base}", head, base_sha],
95
+ capture_output=True, text=True,
96
+ )
97
+ if result.returncode == 0:
98
+ return "none", []
99
+ if result.returncode == 1:
100
+ lines = [line for line in result.stdout.splitlines()[1:] if line]
101
+ return "yes", sorted(set(lines))
102
+ return "unknown", []
103
+
104
+
78
105
  def main() -> None:
79
106
  parser = argparse.ArgumentParser(add_help=True, description=__doc__.split("\n\n")[0])
80
107
  parser.add_argument("--base", help="ref of the main branch to compare with (default: origin/<main>)")
81
108
  parser.add_argument("--no-fetch", action="store_true")
109
+ parser.add_argument("--not-mergeable", action="store_true",
110
+ help="the forge reports the pull request not mergeable (a conflict with the main branch)")
82
111
  opts = parser.parse_args()
83
112
 
84
113
  config = load_config()
@@ -101,8 +130,18 @@ def main() -> None:
101
130
  setup = [f for f in incoming if matches(f, FULL_GATE_PATTERNS + list(autonomy.get("fullGatePaths") or []))]
102
131
 
103
132
  policy = autonomy.get("remergeMain") or "when-needed"
133
+ if policy not in POLICIES:
134
+ sys.exit(f"autonomy.remergeMain={policy!r} is not one of: {', '.join(POLICIES)}")
104
135
  moved = merge_base != base_sha
105
- needed = moved and (policy == "always" or bool(overlap or migrations or dependencies))
136
+ conflict, conflicting = trial_merge(merge_base, head, base_sha) if moved else ("none", [])
137
+ conflicts = opts.not_mergeable or conflict != "none" # unknown counts as a conflict: never guess clean
138
+ if policy == "always":
139
+ needed = moved or opts.not_mergeable
140
+ elif policy == "on-conflict":
141
+ needed = conflicts
142
+ else:
143
+ # a textual conflict always shows up as an overlapping file
144
+ needed = opts.not_mergeable or (moved and bool(overlap or migrations or dependencies))
106
145
  related_cmd = autonomy.get("relatedTests")
107
146
  full = bool(migrations or dependencies or setup) or not related_cmd
108
147
 
@@ -113,6 +152,14 @@ def main() -> None:
113
152
  else:
114
153
  count = int(git("rev-list", "--count", f"{merge_base}..{base_sha}").strip())
115
154
  print(f"incoming: {len(incoming)} files in {count} commits since {merge_base[:8]} ({base} {base_sha[:8]})")
155
+ if conflict == "yes":
156
+ print(f"conflict: yes — {listing(conflicting)}")
157
+ elif conflict == "unknown":
158
+ print("conflict: unknown — `git merge-tree --write-tree` failed (git 2.38+ needed); treated as a conflict")
159
+ else:
160
+ print("conflict: none")
161
+ if opts.not_mergeable:
162
+ print("forge: the pull request is not mergeable (--not-mergeable)")
116
163
  print(f"overlap: {listing(overlap)}")
117
164
  print(f"migrations: {listing(migrations)}")
118
165
  print(f"dependencies: {listing(dependencies)}")
@@ -4,8 +4,8 @@
4
4
  wt-roadmap.py open <change-id> [--note "…"] [--dry-run]
5
5
  wt-roadmap.py stage <change-id> "<stage>" [--dry-run]
6
6
  wt-roadmap.py ready <change-id> [--dry-run]
7
- wt-roadmap.py done <change-id> [--dry-run]
8
- wt-roadmap.py done_code <change-id> --waiting "<what>" [--dry-run]
7
+ wt-roadmap.py done <change-id> [--verified "<evidence>"] [--dry-run]
8
+ wt-roadmap.py done_code <change-id> --waiting "<what>" [--verified "<evidence>"] [--dry-run]
9
9
  (cloud sessions additionally: [--cloud] [--branch <branch>] — see below)
10
10
 
11
11
  `open` — status -> **in_progress** (research, since <today>; worktree `../<repo>-<id>`, branch `<id>`[; note])
@@ -18,7 +18,19 @@
18
18
  section that `softure-archive --handoff` wrote into the archived change.md
19
19
  (`context/archive/<created>-<id>/change.md` on the main branch). `done` follows the
20
20
  handoff's status; `done_code --waiting "…"` forces `done_code` with that text. Lines
21
- already present are not added twice, so a re-run is safe.
21
+ already present are not added twice, so a re-run is safe. `Owner step:` lines (what only the
22
+ owner can do, with the reason) go to `## Owner decisions and checks` as tracked items.
23
+
24
+ Autonomous mode (`mode: "autonomous"` in context/workflow.json): the run verifies its own checks, so
25
+ `done` refuses a handoff that still carries `Owner check:` lines or a `waiting: owner check …`
26
+ status, and `done_code --waiting` refuses an owner-check text. Verify the checks, then re-run with
27
+ `--verified "<evidence>"`: the owner checks are dropped, the owner-check part of the waiting text is
28
+ removed (nothing left -> `done`), and the evidence is appended to the `## Done` line.
29
+ `--verified` also closes an item that is already `done_code` (e.g. after the owner-approved deploy,
30
+ once the run checked the pipeline, health endpoint and logs): `done --verified "…"` sets `done`,
31
+ `done_code --waiting "…" --verified "…"` sets the new waiting text, the `## Done` line gets the
32
+ evidence, and this item's open `(Manual N.M)` entries under `## Owner decisions and checks` are
33
+ ticked with it.
22
34
 
23
35
  Branches never edit roadmap.md (unless `worktree.cloudState` is "branch"): the roadmap state lives
24
36
  on the main branch, written only by this script, so merging the main branch into a change branch
@@ -74,6 +86,7 @@ READY_RE = re.compile(r"(\*{0,2})in_progress(\*{0,2}) \([^,;)]*, since [0-9-]+;
74
86
  HANDOFF_RE = re.compile(r"^- \*\*(?P<key>[^*]+):\*\* ?(?P<value>.*)$")
75
87
  ARCHIVED_RE = re.compile(r"^Archived [0-9-]+: (?P<outcome>.+?)\.?$")
76
88
  DONE_CODE_RE = re.compile(r"^done_code \((?:[0-9-]+; )?waiting: (?P<waiting>.+)\)$")
89
+ OWNER_CHECK_RE = re.compile(r"owner[ -]check", re.IGNORECASE)
77
90
 
78
91
 
79
92
  def git(repo: str, *args: str, env: dict[str, str] | None = None) -> str:
@@ -110,7 +123,8 @@ def item_id(line: str, change_id: str) -> str:
110
123
  def read_handoff(repo: str, rev: str, change_id: str) -> dict:
111
124
  """Read the archived change folder of `change_id` at `rev` and its `## Roadmap handoff` section.
112
125
 
113
- Returns {"archive", "status", "waiting", "outcome", "owner": [...], "release": [...]}. Without a
126
+ Returns {"archive", "status", "waiting", "outcome", "owner": [...], "steps": [...], "release": [...]}.
127
+ Without a
114
128
  handoff section (an archive written before it existed) the outcome falls back to the
115
129
  `Archived <date>: <outcome>.` line under `## Notes`, the status to `done`.
116
130
  """
@@ -122,7 +136,7 @@ def read_handoff(repo: str, rev: str, change_id: str) -> dict:
122
136
  f"(run `done` only after the change's merge, which carries its archive commit)")
123
137
  text = git(repo, "show", f"{rev}:{hits[0]}/change.md")
124
138
  handoff = {"archive": hits[0][len("context/"):] + "/", "status": "done", "waiting": None,
125
- "outcome": None, "owner": [], "release": [], "found": False}
139
+ "outcome": None, "owner": [], "steps": [], "release": [], "verified": None, "found": False}
126
140
  section = None
127
141
  for line in text.splitlines():
128
142
  if line.startswith("## "):
@@ -147,6 +161,8 @@ def read_handoff(repo: str, rev: str, change_id: str) -> dict:
147
161
  handoff["outcome"] = value
148
162
  elif key == "owner check":
149
163
  handoff["owner"].append(value)
164
+ elif key == "owner step":
165
+ handoff["steps"].append(value)
150
166
  elif key == "before the next release":
151
167
  handoff["release"].append(value)
152
168
  return handoff
@@ -178,6 +194,62 @@ def append_to_section(lines: list[str], heading: str, entry: str, before: tuple[
178
194
  lines.insert(end, f"{entry}\n")
179
195
 
180
196
 
197
+ def strip_owner_checks(waiting: str | None) -> str | None:
198
+ """Remove the owner-check parts of a `waiting:` text ("release; owner check 2.4" -> "release")."""
199
+ if not waiting:
200
+ return None
201
+ parts = [part.strip() for part in re.split(r"[;,]", waiting)]
202
+ kept = [part for part in parts if part and not OWNER_CHECK_RE.search(part)]
203
+ return "; ".join(kept) or None
204
+
205
+
206
+ def apply_autonomy(handoff: dict, mode: str, arg: str | None, autonomous: bool,
207
+ verified: str | None) -> tuple[dict, str, str | None]:
208
+ """In autonomous mode no item waits for an owner check: refuse them, or drop them once verified.
209
+
210
+ Returns the (possibly adjusted) handoff, mode and `--waiting` text. Manual mode passes through.
211
+ """
212
+ if not autonomous:
213
+ if verified:
214
+ handoff = {**handoff, "verified": verified}
215
+ return handoff, mode, arg
216
+ pending = list(handoff["owner"])
217
+ if handoff["status"] == "done_code" and OWNER_CHECK_RE.search(handoff["waiting"] or ""):
218
+ pending.append(f"status: waiting: {handoff['waiting']}")
219
+ if mode == "done_code" and OWNER_CHECK_RE.search(arg or ""):
220
+ pending.append(f"--waiting: {arg}")
221
+ if not pending:
222
+ if verified:
223
+ handoff = {**handoff, "verified": verified}
224
+ return handoff, mode, arg
225
+ if not verified:
226
+ listed = "\n".join(f" - {item}" for item in pending)
227
+ sys.exit("autonomous mode: no item waits for an owner check, and this handoff still has:\n"
228
+ f"{listed}\nVerify each one yourself (test, script, screenshot, pipeline run, health check, logs), "
229
+ "then re-run with --verified \"<evidence>\". What only the owner can do (a paid call, a secret, "
230
+ "a release, a reserved taste call) is an `Owner step:` line with its reason, not an owner check.")
231
+ waiting = strip_owner_checks(handoff["waiting"])
232
+ handoff = {**handoff, "owner": [], "verified": verified, "waiting": waiting,
233
+ "status": "done_code" if waiting else "done"}
234
+ if mode == "done_code":
235
+ arg = strip_owner_checks(arg)
236
+ if not arg:
237
+ mode, arg = ("done_code", waiting) if waiting else ("done", None)
238
+ return handoff, mode, arg
239
+
240
+
241
+ def tick_verified_checks(lines: list[str], rid: str, evidence: str) -> None:
242
+ """Close this item's open owner-check entries (`(Manual N.M)`) once the run has verified them."""
243
+ section = None
244
+ for k, line in enumerate(lines):
245
+ if line.startswith("## "):
246
+ section = line[3:].strip()
247
+ continue
248
+ if (section == "Owner decisions and checks" and line.startswith(f"- [ ] **{rid}**: ")
249
+ and "(Manual " in line and "owner step:" not in line):
250
+ lines[k] = f"- [x] {line[6:].rstrip()} — verified: {evidence}\n"
251
+
252
+
181
253
  def done_status(handoff: dict, mode: str, arg: str | None, today: str) -> str:
182
254
  if mode == "done_code" or handoff["status"] == "done_code":
183
255
  return f"done_code ({today}; waiting: {arg or handoff['waiting']})"
@@ -214,7 +286,10 @@ def edit(text: str, mode: str, change_id: str, arg: str | None, repo_name: str,
214
286
  status = done_status(handoff, mode, arg, today)
215
287
  current = row_status(lines[i]).strip()
216
288
  if current.startswith(("done", "**done")):
217
- status = current.replace("**", "") # a re-run keeps the recorded date and text
289
+ if not handoff.get("verified"):
290
+ status = current.replace("**", "") # a re-run keeps the recorded date and text
291
+ elif mode == "done":
292
+ status = "done" # verified after the merge (e.g. post-deploy checks): the item is closed
218
293
  lines[i] = set_row_status(lines[i], status)
219
294
  body_status = f"- **Status:** {status}\n"
220
295
  elif mode == "stage":
@@ -252,6 +327,18 @@ def edit(text: str, mode: str, change_id: str, arg: str | None, repo_name: str,
252
327
  for check in handoff["owner"]:
253
328
  append_to_section(lines, "Owner decisions and checks",
254
329
  f"- [ ] **{rid}**: {check}. {handoff['archive']}plan.md", ("Done", "Decisions (auto)"))
330
+ for step in handoff.get("steps", []):
331
+ append_to_section(lines, "Owner decisions and checks",
332
+ f"- [ ] **{rid}**: owner step: {step}. {handoff['archive']}change.md",
333
+ ("Done", "Decisions (auto)"))
334
+ if handoff.get("verified"):
335
+ outcome = f"{outcome}; verified: {handoff['verified']}"
336
+ tick_verified_checks(lines, rid, handoff["verified"])
337
+ prefix = f"- **{rid}** `{change_id}`: "
338
+ done_line = f"{prefix}{outcome}; archived in `{handoff['archive']}`"
339
+ hit = next((k for k, line in enumerate(lines) if line.startswith(prefix)), None)
340
+ if hit is not None:
341
+ lines[hit] = f"{done_line}\n"
255
342
  for step in handoff["release"]:
256
343
  append_to_section(lines, "Before the next release", f"- [ ] {step} (**{rid}**)",
257
344
  ("Owner decisions and checks", "Done", "Decisions (auto)"))
@@ -274,14 +361,17 @@ def commit_message(text: str, mode: str, change_id: str, arg: str | None, where:
274
361
  return f"docs(roadmap): {rid} {label}\n\n{COAUTHOR}"
275
362
 
276
363
 
277
- def load_handoff(repo: str, rev: str, mode: str, change_id: str) -> dict | None:
364
+ def load_handoff(repo: str, rev: str, mode: str, change_id: str, arg: str | None = None,
365
+ verified: str | None = None) -> tuple[dict | None, str, str | None]:
366
+ """Read the handoff (for `done` / `done_code`) and apply the autonomous-mode rule to it."""
278
367
  if mode not in ("done", "done_code"):
279
- return None
368
+ return None, mode, arg
280
369
  handoff = read_handoff(repo, rev, change_id)
281
370
  if not handoff["found"]:
282
371
  print(f"note: {handoff['archive']}change.md has no `## Roadmap handoff` — status `done` unless forced, "
283
372
  f"no owner-check or release lines", file=sys.stderr)
284
- return handoff
373
+ autonomous = load_config(repo).get("mode") == "autonomous"
374
+ return apply_autonomy(handoff, mode, arg, autonomous, verified)
285
375
 
286
376
 
287
377
  def push_roadmap_commit(repo: str, sha: str, main: str, env: dict[str, str]) -> subprocess.CompletedProcess:
@@ -308,7 +398,8 @@ def push_roadmap_commit(repo: str, sha: str, main: str, env: dict[str, str]) ->
308
398
  subprocess.run(["git", "-C", repo, "branch", "-D", branch], capture_output=True)
309
399
 
310
400
 
311
- def run_cloud(mode: str, change_id: str, arg: str | None, branch: str | None, dry: bool) -> None:
401
+ def run_cloud(mode: str, change_id: str, arg: str | None, branch: str | None, dry: bool,
402
+ verified: str | None = None) -> None:
312
403
  """Commit one roadmap edit directly on `origin/<main>` and push it — no working tree involved."""
313
404
  repo = git(".", "rev-parse", "--show-toplevel").strip()
314
405
  repo_name = os.path.basename(repo)
@@ -321,15 +412,15 @@ def run_cloud(mode: str, change_id: str, arg: str | None, branch: str | None, dr
321
412
  git(repo, "fetch", "-q", "origin", main)
322
413
  base = git(repo, "rev-parse", f"origin/{main}").strip()
323
414
  old = git(repo, "show", f"{base}:{ROADMAP}")
324
- handoff = load_handoff(repo, base, mode, change_id)
325
- new = edit(old, mode, change_id, arg, repo_name, cloud_branch=branch if mode == "open" else None,
415
+ handoff, run_mode, run_arg = load_handoff(repo, base, mode, change_id, arg, verified)
416
+ new = edit(old, run_mode, change_id, run_arg, repo_name, cloud_branch=branch if mode == "open" else None,
326
417
  handoff=handoff)
327
418
  if dry:
328
419
  sys.stdout.writelines(difflib.unified_diff(old.splitlines(True), new.splitlines(True), f"origin/{main}", "commit"))
329
420
  return
330
421
  if unchanged(old, new, f"origin/{main}"):
331
422
  return
332
- msg = commit_message(old, mode, change_id, arg, f"cloud session, branch {branch}", new)
423
+ msg = commit_message(old, run_mode, change_id, run_arg, f"cloud session, branch {branch}", new)
333
424
  session = os.environ.get("CLAUDE_CODE_REMOTE_SESSION_ID", "")
334
425
  if session.startswith("cse_"):
335
426
  msg += f"\nClaude-Session: https://claude.ai/code/session_{session[4:]}"
@@ -355,7 +446,8 @@ def run_cloud(mode: str, change_id: str, arg: str | None, branch: str | None, dr
355
446
  sys.exit(f"push to origin/{main} failed after 6 attempts: {push.stderr.strip()[:300] if push else ''}")
356
447
 
357
448
 
358
- def run_cloud_branch(mode: str, change_id: str, arg: str | None, branch: str | None, dry: bool) -> None:
449
+ def run_cloud_branch(mode: str, change_id: str, arg: str | None, branch: str | None, dry: bool,
450
+ verified: str | None = None) -> None:
359
451
  """Commit one roadmap edit on the session's own branch (the checkout); push nothing."""
360
452
  repo = git(".", "rev-parse", "--show-toplevel").strip()
361
453
  repo_name = os.path.basename(repo)
@@ -367,7 +459,7 @@ def run_cloud_branch(mode: str, change_id: str, arg: str | None, branch: str | N
367
459
  work_path = os.path.join(repo, ROADMAP)
368
460
  with open(work_path, encoding="utf-8") as fh:
369
461
  old = fh.read()
370
- handoff = load_handoff(repo, "HEAD", mode, change_id)
462
+ handoff, mode, arg = load_handoff(repo, "HEAD", mode, change_id, arg, verified)
371
463
  new = edit(old, mode, change_id, arg, repo_name, cloud_branch=branch if mode == "open" else None,
372
464
  handoff=handoff)
373
465
  if dry:
@@ -386,7 +478,7 @@ def run_cloud_branch(mode: str, change_id: str, arg: str | None, branch: str | N
386
478
  print(f"{sha} {msg.splitlines()[0]} -> {current} (not pushed; the branch carries the state)")
387
479
 
388
480
 
389
- def run_local(mode: str, change_id: str, arg: str | None, dry: bool) -> None:
481
+ def run_local(mode: str, change_id: str, arg: str | None, dry: bool, verified: str | None = None) -> None:
390
482
  main_wt = main_root()
391
483
  repo_name = os.path.basename(main_wt)
392
484
  main = main_branch(main_wt)
@@ -397,7 +489,8 @@ def run_local(mode: str, change_id: str, arg: str | None, dry: bool) -> None:
397
489
  work_path = os.path.join(main_wt, ROADMAP)
398
490
  if dry:
399
491
  head_text = git(main_wt, "show", f"HEAD:{ROADMAP}")
400
- new_head = edit(head_text, mode, change_id, arg, repo_name, handoff=load_handoff(main_wt, "HEAD", mode, change_id))
492
+ handoff, mode, arg = load_handoff(main_wt, "HEAD", mode, change_id, arg, verified)
493
+ new_head = edit(head_text, mode, change_id, arg, repo_name, handoff=handoff)
401
494
  sys.stdout.writelines(difflib.unified_diff(head_text.splitlines(True), new_head.splitlines(True), "HEAD", "commit"))
402
495
  return
403
496
 
@@ -415,14 +508,14 @@ def run_local(mode: str, change_id: str, arg: str | None, dry: bool) -> None:
415
508
 
416
509
  head_sha = git(main_wt, "rev-parse", "HEAD").strip()
417
510
  head_text = git(main_wt, "show", f"{head_sha}:{ROADMAP}")
418
- handoff = load_handoff(main_wt, head_sha, mode, change_id)
419
- new_head = edit(head_text, mode, change_id, arg, repo_name, handoff=handoff)
511
+ handoff, run_mode, run_arg = load_handoff(main_wt, head_sha, mode, change_id, arg, verified)
512
+ new_head = edit(head_text, run_mode, change_id, run_arg, repo_name, handoff=handoff)
420
513
  if unchanged(head_text, new_head, main):
421
514
  return
422
- msg = commit_message(head_text, mode, change_id, arg, "separate worktree", new_head)
515
+ msg = commit_message(head_text, run_mode, change_id, run_arg, "separate worktree", new_head)
423
516
  with open(work_path, encoding="utf-8") as fh:
424
517
  work_text = fh.read()
425
- new_work = new_head if work_text == head_text else edit(work_text, mode, change_id, arg, repo_name,
518
+ new_work = new_head if work_text == head_text else edit(work_text, run_mode, change_id, run_arg, repo_name,
426
519
  handoff=handoff)
427
520
 
428
521
  with tempfile.NamedTemporaryFile("w", delete=False, encoding="utf-8") as tmp:
@@ -455,7 +548,11 @@ def main() -> None:
455
548
  dry = "--dry-run" in argv
456
549
  cloud = "--cloud" in argv or os.environ.get("CLAUDE_CODE_REMOTE") == "true"
457
550
  args = [a for a in argv if a not in ("--dry-run", "--cloud")]
458
- note = branch = waiting = None
551
+ note = branch = waiting = verified = None
552
+ if "--verified" in args:
553
+ k = args.index("--verified")
554
+ verified = args[k + 1]
555
+ del args[k:k + 2]
459
556
  if "--waiting" in args:
460
557
  k = args.index("--waiting")
461
558
  waiting = args[k + 1]
@@ -479,11 +576,11 @@ def main() -> None:
479
576
  mode, change_id = args[0], args[1]
480
577
  arg = {"open": note, "stage": args[2] if mode == "stage" else None, "done_code": waiting}.get(mode)
481
578
  if cloud and (load_config().get("worktree") or {}).get("cloudState") == "branch":
482
- run_cloud_branch(mode, change_id, arg, branch, dry)
579
+ run_cloud_branch(mode, change_id, arg, branch, dry, verified)
483
580
  elif cloud:
484
- run_cloud(mode, change_id, arg, branch, dry)
581
+ run_cloud(mode, change_id, arg, branch, dry, verified)
485
582
  else:
486
- run_local(mode, change_id, arg, dry)
583
+ run_local(mode, change_id, arg, dry, verified)
487
584
 
488
585
 
489
586
  if __name__ == "__main__":
@@ -9,7 +9,8 @@
9
9
  Always reads the config of the MAIN worktree (first entry of `git worktree list`), so every
10
10
  worktree and every script sees the same values. `mainBranch` falls back to origin's HEAD, then
11
11
  "main"; `worktree.maxParallel` to 4; `language` to "en"; `mode` to "manual";
12
- `autonomy.reports.every` to 60; `autonomy.remergeMain` to "when-needed".
12
+ `autonomy.reports.every` to 60; `autonomy.remergeMain` to "when-needed" ("on-conflict" and "always"
13
+ are the other values).
13
14
 
14
15
  Importable: `from wt_config import load_config, main_root, main_branch`.
15
16
  """
@@ -519,6 +519,14 @@ points of this skill:
519
519
  | a pre-release step: migration to watch, production secret, build-time variable, scheduled job, one-off command, production check | **`## Before the next release`** (the owner's checklist before publishing; create it above `## Owner decisions and checks` if missing) | numbered step with the exact command/file |
520
520
  | anything else for the owner: visual/tone check, open question, product decision, suggestion, deferred finding | **`## Owner decisions and checks`** | `- [ ] **<ID>**: <what to decide/check> (<Manual N.M / finding>). <evidence path>` |
521
521
 
522
+ **Autonomous mode:** a Manual item the worker left open without `(owner only:
523
+ <reason>)`, or a READY report that hands checks to the owner, is not
524
+ merge-ready: send it back (`SendMessage`) to verify them and record the
525
+ evidence. Only genuine owner steps (a paid call that needs the owner's yes, a
526
+ secret or account only the owner has, a release or production deploy, a taste
527
+ call the owner reserved) reach `## Owner decisions and checks`, each with its
528
+ exact step and reason; checks the run could perform never do.
529
+
522
530
  One signal, one place: if a check gates the deploy, it goes to the release
523
531
  section and the decisions section only points at it. Don't duplicate what
524
532
  the worker already wrote there, nor what `wt-roadmap.py done` took from the
@@ -568,7 +576,12 @@ then, with nothing in flight → `TaskStop` the monitor, `CronDelete` the status
568
576
  job (M4), and report: what merged (SHAs), what waits for the release
569
577
  (`## Before the next release`), the result of the full integration suite on
570
578
  `<main>` (below), every open entry in `## Owner decisions and checks` (the
571
- owner answers these before the release and before the roadmap is archived),
579
+ owner answers these before the release and before the roadmap is archived; in
580
+ autonomous mode these are decisions and owner steps only: an open check entry
581
+ or a `waiting: owner check` row is work, so queue a worker that verifies it,
582
+ closes it with `wt-roadmap.py done <change-id> --verified "<evidence>"`,
583
+ archives and releases where the owner's release word exists, instead of
584
+ listing it),
572
585
  what is left and why (`blocked`, `owner`, `proposed`, a collision), and
573
586
  whether `<main>` was pushed.
574
587