your-cto-jev 0.16.0 → 0.18.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/README.md CHANGED
@@ -233,8 +233,8 @@ A task is one checklist line, and everything else is computed from it:
233
233
  - [ ] CUST-1 Customer list
234
234
  - [x] CUST-1.1 List API, filtered by role (after: PERM-2) (files: src/customers/api/)
235
235
  accept: npm test -- customers/api
236
- - [ ] CUST-1.2 List UI (after: CUST-1.1) (files: src/customers/ui/, e2e/customers.spec.ts)
237
- accept: npx playwright test e2e/customers.spec.ts
236
+ - [ ] CUST-1.2 List UI (after: CUST-1.1) (files: src/customers/ui/, e2e/customers/)
237
+ accept: npx playwright test e2e/customers/
238
238
  - [ ] CUST-1.3 List matches the brand (look) (after: CUST-1.2) (files: src/customers/ui/)
239
239
  accept: manual: list page against the brand sheet, at 375px and 1280px @ http://localhost:3000/customers
240
240
  ```
@@ -249,7 +249,7 @@ The trade: fewer stops, later discovery. A SPEC that drifted from what you meant
249
249
  Features · 2 · 1 active · 1 planned · sign-off pending: billing (concept draft)
250
250
 
251
251
  Ready · 3 (run together: CUST-1.2, PERM-3)
252
- CUST-1.2 P1 List UI files src/customers/ui/, e2e/customers.spec.ts accept: npx playwright test e2e/customers.spec.ts
252
+ CUST-1.2 P1 List UI files src/customers/ui/, e2e/customers/ accept: npx playwright test e2e/customers/
253
253
  PERM-3 Role cache files src/auth/cache/ accept: npm test -- auth
254
254
  CUST-2 Export files src/customers/ accept: npm test -- export (overlaps CUST-1.2: run after)
255
255
 
@@ -264,7 +264,7 @@ The skill gives the agent seven named jobs, so they cannot be confused with anot
264
264
  | `cto-jev init` | scans the repo, fills PRODUCT.md and ARCHITECTURE.md, asks you the rest a few questions at a time, walks you through the result until you say it is complete |
265
265
  | `cto-jev feature` | talks the CONCEPT through first (who it is for, business rules, what the user sees when it works, what is out of scope, the simpler option it rejected), writes CONCEPT, then writes the SPEC itself (data migration and rollback, what other features may call, how a production failure gets noticed, the acceptance scenarios), has a zero-context reviewer check that a newcomer could build from them without making design decisions, that nothing unneeded or already in the code gets built and that every acceptance scenario has a result a script can check and a CONCEPT rule behind it, walks you through the CONCEPT, hands it over with a [Review handoff](#sign-off) and stops for your sign-off |
266
266
  | `cto-jev tasks` | breaks a feature with a signed-off CONCEPT into parent/child tasks with files, dependencies and an acceptance command each |
267
- | `cto-jev work` | dispatches Ready tasks to sub-agents with the narrowest brief, runs each acceptance command itself before ticking, has a zero-context reviewer read the diff **before every commit**: P1 findings are fixed first, then the whole change reviewed again by `cto-reviewer` (at most three rounds in all; P1s left after that go to you), P2 findings become tasks that wait until the feature has nothing else Ready and then run as one cleanup wave with one review (what that review finds below P1 is written into REVIEW.md and listed for you, not filed as tasks, so findings never chain), a finding is contested only with evidence the reviewer could read, then it commits the wave to the review branch and starts the next one, without asking, until nothing is Ready; tasks that need you (credentials, money, anything irreversible, a drop) are parked, not waited on; ends with one report of what is done and everything for you to look at. Never releases |
267
+ | `cto-jev work` | dispatches Ready tasks to sub-agents with the narrowest brief, runs each acceptance command itself before ticking (only the wave's own tasks and the `e2e/<slug>/` tests of the features it touches; the whole suites run once per feature cleanup and at release; until a repo's e2e tests are split into `e2e/<slug>/`, each wave runs the whole e2e suite; `cto brief` flags tests left in the `e2e/` root and the final report asks whether to split them, `"e2e_folders": false` in `.cto.json` keeps them flat), never opens a question menu mid-run, has a zero-context reviewer read the diff **before every commit**: P1 findings are fixed first, then the whole change reviewed again by `cto-reviewer` (at most three rounds in all; P1s left after that go to you), P2 findings become tasks that wait until the feature has nothing else Ready and then run as one cleanup wave with one review (what that review finds below P1 is written into REVIEW.md and listed for you, not filed as tasks, so findings never chain), a finding is contested only with evidence the reviewer could read, then it commits the wave to the review branch and starts the next one, without asking, until nothing is Ready; tasks that need you (credentials, money, anything irreversible, a drop) are parked, not waited on; ends with one report of what is done and everything for you to look at. Never releases |
268
268
  | `cto-jev work all` | for a new project or a big batch: the same run on a `work-all` branch, every wave reviewed by a zero-context `cto-reviewer` before its commit, then hands over to `cto-jev release`, never merges. Never releases |
269
269
  | `cto-jev release` | reviews the whole unreleased diff against the SPECs (looking hardest at waves marked `self-review`), files P1/P2/P3 tasks under the same findings rules, requires every P1 ticked and `cto check --base <release branch>` green, then prepares the merge, PR or tag for you to perform |
270
270
  | `cto-jev docs` | runs `cto docs` and brings you the list; acts only on what you decide |
@@ -396,6 +396,7 @@ Defaults: `credential_leak` 0.5, `destructive_command` 0.7, `infinite_loop` 0.6,
396
396
  - **`test_command`**: what `cto brief` tells the agent to verify with, for example `"pnpm test"`. Detected from the project when empty.
397
397
  - **`protected_branches`**: for example `["main", "release"]`. Commits on them and pushes that delete or rewrite them are blocked locally, no key needed. Empty by default.
398
398
  - **`turn_limits`**: `{ "minutes": 20, "tool_calls": 150, "agents": 4 }` by default; a turn past any one of them gets one reminder to stop and report. `0` turns that limit off; a key you leave out keeps its default.
399
+ - **`e2e_folders`**: `true` by default. `false` means you chose to keep e2e tests flat in `e2e/`: `cto brief` stops asking to split them into `e2e/<slug>/`, and every wave runs the whole e2e suite.
399
400
  - **Thresholds**: Jev returns a probability from 0 to 1. `code_complexity` is the exception: it is a score from 0 (clean) to 4 (unmaintainable).
400
401
  - **Calibration**: on 32 hand-written diffs, every one scoring above 0.8 for `test_tampering` really weakened the tests, and no legitimate change scored above 0.37. The 0.8 default caught 13 of 16 weakening diffs; the misses were subtle ones such as a meaningless float tolerance or a skip hidden behind an env var. Lower it to 0.5 to catch 15 of 16, at a higher risk of blocking honest commits.
401
402
  - `done_unverified` (0.6) and `infinite_loop` (0.6) were calibrated the same way; the cases are in `calibration/`.
package/dist/brain.js CHANGED
@@ -33,6 +33,7 @@ export const DEFAULT_CONFIG = {
33
33
  },
34
34
  review_gate: true,
35
35
  turn_limits: { minutes: 20, tool_calls: 150, agents: 4 },
36
+ e2e_folders: true,
36
37
  };
37
38
  const emptyBrain = () => ({
38
39
  recent_errors: [],
@@ -79,6 +80,7 @@ export function loadConfig(root) {
79
80
  thresholds,
80
81
  review_gate: raw.review_gate !== false,
81
82
  turn_limits: turnLimits(raw.turn_limits),
83
+ e2e_folders: raw.e2e_folders !== false,
82
84
  };
83
85
  }
84
86
  /** Corrupt or missing state rebuilds as empty: the gate must never crash on its own bookkeeping. */
package/dist/brief.js CHANGED
@@ -119,9 +119,27 @@ export function flowIssues(root) {
119
119
  else
120
120
  for (const dir of orphans)
121
121
  out.push(`${dir} belongs to no feature`);
122
+ // A wave runs only e2e/<slug>/ of the features it touches; a test left in the e2e/ root is run by none of them.
123
+ // Whole-app checks go to e2e/platform/, so a split leaves only helpers here. Quiet when the user chose flat
124
+ // (e2e_folders false) or said yes and the split task (files: e2e/) is still open, so the question is not asked twice.
125
+ // shortcut: only a top-level e2e/ is looked at, not a playwright testDir elsewhere; read the config if a repo needs it.
126
+ const splitOpen = tasks.some((t) => !t.done && t.files.some((f) => /^e2e\/?$/.test(f.replace(/\\/g, '/'))));
127
+ const loose = splitOpen || !loadConfig(root).e2e_folders || !existsSync(join(root, 'e2e')) ? [] : readdirSync(join(root, 'e2e'), { withFileTypes: true })
128
+ .filter((d) => d.isFile() && /\.(spec|test|cy)\.[cm]?[jt]sx?$/.test(d.name)).map((d) => d.name).sort();
129
+ if (loose.length)
130
+ out.push(`e2e/: ${loose.length} test file${loose.length > 1 ? 's' : ''} not in a feature folder (${loose.slice(0, 3).join(', ')}${loose.length > 3 ? ', …' : ''}): ask in the run's final report menu, never mid-run, whether to split them into e2e/<feature slug>/`);
122
131
  for (const slug of features) {
123
132
  headings(`features/${slug}/SPEC.md`, ['Interface', 'Constraints', 'Internals']);
124
133
  headings(`features/${slug}/CONCEPT.md`, ['目的']);
134
+ // An open task accepted end to end or by eye has no scenario to test against without ## Acceptance, so its test gets invented.
135
+ const userFacing = tasks.some((t) => t.feature === slug && !t.done && /\be2e\b|playwright|cypress|^manual\b/i.test(t.accept ?? ''));
136
+ let spec = '';
137
+ try {
138
+ spec = readFileSync(join(root, FLOW_DIR, 'features', slug, 'SPEC.md'), 'utf8');
139
+ }
140
+ catch { /* reported as a missing file above */ }
141
+ if (userFacing && spec && !/^##\s*Acceptance\s*$/m.test(spec))
142
+ out.push(`features/${slug}/SPEC.md: open user-facing tasks but no ## Acceptance scenarios to test`);
125
143
  }
126
144
  for (const [file, names] of HEADINGS)
127
145
  headings(file, names);
package/dist/skill.js CHANGED
@@ -170,7 +170,7 @@ The user decides what gets built and signs it once, in CONCEPT.md. While docs ar
170
170
  - **SPEC.md is yours.** It is the technical document you derive from the signed CONCEPT. Nobody signs it and nothing protects it: change any section when the work shows it is wrong, and say so in the wave's REVIEW.md entry. Tests and reviews judge it, not the user. If a SPEC change would contradict the CONCEPT, that is a CONCEPT change and the user's to make: in the middle of a run, park the task (below) and leave the CONCEPT and its \`Status:\` line alone, since a draft CONCEPT blocks every later commit of the feature; outside a run it goes through \`cto-jev feature\` (draft, edit, \`Review:\`).
171
171
  - **What the CONCEPT does not decide, you decide.** Write the decision into the SPEC as \`Assumed: ...\` and carry on. Every \`Assumed:\` goes into your final report and the release report, where the user reads them in one go.
172
172
  - **Never ask "shall I start?".** Dispatch what is Ready; when a wave is committed, start the next one.
173
- - **Park, do not stop,** when a task needs the user: a decision that would contradict the signed CONCEPT, credentials, money, an outside account, anything irreversible, a drop, or a failure that survived a second approach. Parked means unticked and not dispatched again in this run; its dependants wait with it. Go on with the rest and list parked tasks in the final report.
173
+ - **Park, do not stop,** when a task needs the user: a decision that would contradict the signed CONCEPT, credentials, money, an outside account, anything irreversible, a drop, or a failure that survived a second approach. Parked means unticked and not dispatched again in this run; its dependants wait with it. Go on with the rest and list parked tasks in the final report. Never open the question menu (AskUserQuestion) or ask a question in the middle of \`cto-jev work\` or \`work all\`: the run stands still until the user answers, often for hours. A question that comes up mid-run, about a task or a source or a wording, parks that task, and it goes into the final report's menu.
174
174
 
175
175
  ## Sign-off
176
176
 
@@ -188,7 +188,7 @@ Data: which tables or stores change, whether old data migrates; "none" if nothin
188
188
  \`Review:\` is always this English word, on its own line, with repo-relative paths separated by commas (\`cto-jev init\` lists two: \`Review: docs/cto_jev/PRODUCT.md, docs/cto_jev/ARCHITECTURE.md\`). List only sign-off docs; a SPEC.md there is ignored.
189
189
 
190
190
  - In Claude Code the user agrees in the conversation and cto's hook sets \`Status: approved\` on the files in the \`Review:\` line. With other agents the user edits the line.
191
- - In Claude Code, whenever you stop for the user, put what waits on them in a menu as under "cto-jev decide": still write the handoff above, then ask the menu. A sign-off question answered Approve is signed by cto's hook at once.
191
+ - In Claude Code, whenever you stop for the user, put what waits on them in a menu as under "cto-jev decide": still write the handoff above, then ask the menu. You stop at a sign-off, a run's final report and the release, never mid-run. A sign-off question answered Approve is signed by cto's hook at once.
192
192
  - In Claude Code, end every handoff with one line: reply "ok" to sign all, or name the ones to sign ("imports ok"). Nothing else about signing.
193
193
  - In Claude Code, a reply that is only names from the \`Review:\` line plus a yes ("imports ok", "imports、catalog 好", "ok all") signs just those, and the rest stay on the \`Review:\` line for later; a feature is named by its slug, PRODUCT and ARCHITECTURE by their own names. Do not resend \`Review:\` for those.
194
194
  - Every message that asks the user to sign, reminders included, carries the \`Review:\` line again: cto signs only what the message right before the reply lists.
@@ -246,7 +246,7 @@ REVIEW.md: created empty with one line saying it is pending.
246
246
  **When:** the user says "cto-jev tasks", or CONCEPT.md is \`Status: approved\` and TASKS.md is empty or the request adds work.
247
247
 
248
248
  1. One parent per deliverable, children small enough for one sub-agent and one acceptance command.
249
- 2. Every child gets \`(files:)\` (the directories it changes, never bare \`src/\`), \`(after:)\` for anything that must be ticked first (across features too), and an acceptance line: a runnable command. A task the user sees is accepted by the end-to-end test of the SPEC's Acceptance scenarios it covers (named in the task line), e.g. \`npx playwright test e2e/customers.spec.ts\`; driving a browser by hand is how you write that test, never how you accept. If ARCHITECTURE.md \`## 驗證指令\` names no end-to-end command, do not ask: plan the harness as a \`(seq)\` task under \`features/platform/\` that the UI tasks wait on, write the choice into the SPEC as \`Assumed: ...\`, and say in your final report that ARCHITECTURE.md needs the new command (it is a signed doc: it changes only through sign-off). \`manual\` only for a \`(look)\` line: what taste must judge, not sizes or behaviour a script can measure. Write what to look at and where on the line itself, \`manual: <what to look at> @ <url, command or screenshot path>\`: cto shows the user that text, so they never have to open TASKS.md to learn what an id means.
249
+ 2. Every child gets \`(files:)\` (the directories it changes, never bare \`src/\`), \`(after:)\` for anything that must be ticked first (across features too), and an acceptance line: a runnable command. A task the user sees is accepted by the end-to-end test of the SPEC's Acceptance scenarios it covers (named in the task line), e.g. \`npx playwright test e2e/customers/\`. End-to-end tests live in \`e2e/<feature slug>/\`, one test per Acceptance scenario, its name quoting the scenario. Only Acceptance scenarios get an end-to-end test: business rules, edge cases and error branches are tested at the unit or database level, and layout checks (widths, target sizes, no horizontal scroll) go into one shared check per page, not one per task. Driving a browser by hand is how you write that test, never how you accept. If ARCHITECTURE.md \`## 驗證指令\` names no end-to-end command, do not ask: plan the harness as a \`(seq)\` task under \`features/platform/\` that the UI tasks wait on, write the choice into the SPEC as \`Assumed: ...\`, and say in your final report that ARCHITECTURE.md needs the new command (it is a signed doc: it changes only through sign-off). \`manual\` only for a \`(look)\` line: what taste must judge, not sizes or behaviour a script can measure. Write what to look at and where on the line itself, \`manual: <what to look at> @ <url, command or screenshot path>\`: cto shows the user that text, so they never have to open TASKS.md to learn what an id means.
250
250
  3. Shared files (route tables, shared types, migrations, a single test file, the CLI entry point) get their own sequential task; take them out of the other tasks' \`(files:)\`.
251
251
  4. Run \`cto index\` and read \`cto brief\`: Ready should list the first wave; nothing should be Blocked on a missing id.
252
252
 
@@ -256,8 +256,8 @@ REVIEW.md: created empty with one line saying it is pending.
256
256
  - [ ] CUST-1 Customer list
257
257
  - [ ] CUST-1.1 List API, filtered by role (after: PERM-2) (files: src/customers/api/)
258
258
  驗收: npm test -- customers/api
259
- - [ ] CUST-1.2 List UI: Acceptance "filter by role", "375px no horizontal scroll" (after: CUST-1.1) (files: src/customers/ui/, e2e/customers.spec.ts)
260
- 驗收: npx playwright test e2e/customers.spec.ts
259
+ - [ ] CUST-1.2 List UI: Acceptance "filter by role", "375px no horizontal scroll" (after: CUST-1.1) (files: src/customers/ui/, e2e/customers/)
260
+ 驗收: npx playwright test e2e/customers/
261
261
  - [ ] CUST-1.3 List matches the brand (look) (after: CUST-1.2) (files: src/customers/ui/)
262
262
  驗收: manual: list page colours and spacing against the brand sheet, at 375px and 1280px @ http://localhost:3000/customers
263
263
  \`\`\`
@@ -271,8 +271,8 @@ Two more tags, on any task:
271
271
  \`\`\`md
272
272
  - [ ] CUST-3 Add customer_tier column (P1) (seq) (files: db/migrations/)
273
273
  驗收: npm run migrate:test
274
- - [ ] CUST-4 Tier badge in the list (P3) (after: CUST-3) (files: src/customers/ui/, e2e/tier.spec.ts)
275
- 驗收: npx playwright test e2e/tier.spec.ts
274
+ - [ ] CUST-4 Tier badge in the list (P3) (after: CUST-3) (files: src/customers/ui/, e2e/customers/tier.spec.ts)
275
+ 驗收: npx playwright test e2e/customers/tier.spec.ts
276
276
  \`\`\`
277
277
 
278
278
  ## cto-jev work
@@ -286,7 +286,7 @@ Every wave, one after another, until nothing is Ready. Do not ask before a wave
286
286
  1. If the tree holds uncommitted code from ticked tasks (a wave left for a Claude Code session): a Claude Code session reviews it with \`cto-reviewer\` and commits it (steps 5 and 6) before dispatching anything new. Any other agent stops here, reports that the wave is still waiting for a Claude Code session, and dispatches nothing new. Otherwise \`cto brief\`. Dispatch only Ready tasks, skipping the ones you parked (see "Where you stop"); the "run together" set is safe to run at once. P1 tasks go first. Review-finding tasks below P1 wait while their feature has any other Ready task you would dispatch, then run as that feature's cleanup wave (see "Review findings"). A cleanup wave runs alone: no other feature's tasks and no non-finding tasks join it. Say in one line what this wave runs, then run it.
287
287
  2. One sub-agent per task. Give it only: the task line, the feature's SPEC.md, the \`## Interface\` of each feature it depends on, the list of files it may touch, and "do not edit anything else, write nothing outside this repo (no notes, no lesson logs), no git commands; report what you changed and what you found ambiguous". Each sub-agent writes its own new test file; nobody appends to a shared one. A task accepted by an end-to-end test also gets the Acceptance lines it covers: the test is written from them first and seen failing, then the code.
288
288
  3. When they return: \`git status\`; revert anything outside the union of their \`(files:)\`. Integrate the shared files yourself. Fix any existing test their change broke. A sub-agent's "the SPEC does not say" goes into the SPEC now, not into the code's comments.
289
- 4. Accept by running the task's acceptance command yourself; never trust the report. Tick only on a pass. A failing end-to-end test means the code is wrong. If you think the expectation is wrong instead, the CONCEPT decides: where it backs the scenario, the code is wrong after all; where it says otherwise, fix the SPEC's Acceptance first, then the test, and note it in the wave's REVIEW.md entry; where it is silent, do the same and add an \`Assumed: ...\` line. Never change a test to match the code without changing the Acceptance line it came from. \`manual\` does not wait for the user: build it, run what can be run, take screenshots at each width the Acceptance names, and tick it. cto reminds the user with the text on its acceptance line, and your final report lists every manual task of the run with that text and the screenshot paths. A task the user decided not to do: add \`(dropped: <reason>)\` to its line, tick it, and say "<id> dropped" in your final message. Dropping is the user's call: a task you think is no longer needed (what it checks is gone) is parked and listed in your report with that reason, never dropped by you; never drop a task to get past a block. A dropped task counts as closed, so the tasks that wait on it (\`(after:)\`) become Ready: drop or re-plan them first. Tick the parent when its last child is ticked.
289
+ 4. Accept by running the task's acceptance command yourself; never trust the report. Tick only on a pass. A wave runs only its own tasks' acceptance commands plus the end-to-end tests of the features it touches (\`e2e/<slug>/\`); when it changes a \`platform\` file or a shared file you integrated (step 3), run the whole end-to-end suite instead. The whole unit and end-to-end suites run once in a feature's cleanup wave and once in the release, never in every wave. Until a feature's end-to-end tests are in \`e2e/<slug>/\`, a wave that touches it runs the whole end-to-end suite. When \`cto brief\` lists test files in the \`e2e/\` root, do not move them on your own: put "split the end-to-end tests into feature folders?" in the run's final report menu, with how many files and how long the whole suite takes. If the user says yes, add a \`platform\` task for the split, tagged \`(seq)\`, whose \`(files:)\` hold \`e2e/\` (which keeps brief from asking again) plus each file that holds the test runner's file pattern (\`playwright.config.ts\`, \`package.json\`); it runs as a wave of its own, reviewed and committed alone. The split goes test by test, not file by file: a test goes into the folder of the feature whose task ids or Acceptance scenario it tests; a test that walks through several features goes to the feature whose SPEC holds its scenario; a check of the whole app (smoke, error page, layout of every page, the test harness) goes to \`e2e/platform/\`; shared helpers stay in the root. Update imports, the test runner's file pattern (a root-only glob such as \`e2e/*.test.ts\` finds nothing in subfolders) and open tasks' acceptance paths; the whole end-to-end suite must pass with as many tests as before. If the user says no, set \`"e2e_folders": false\` in \`.cto.json\`: brief stops listing them, and every wave keeps running the whole end-to-end suite. A failing end-to-end test means the code is wrong. If you think the expectation is wrong instead, the CONCEPT decides: where it backs the scenario, the code is wrong after all; where it says otherwise, fix the SPEC's Acceptance first, then the test, and note it in the wave's REVIEW.md entry; where it is silent, do the same and add an \`Assumed: ...\` line. Never change a test to match the code without changing the Acceptance line it came from. \`manual\` does not wait for the user: build it, run what can be run, take screenshots at each width the Acceptance names, and tick it. cto reminds the user with the text on its acceptance line, and your final report lists every manual task of the run with that text and the screenshot paths. A task the user decided not to do: add \`(dropped: <reason>)\` to its line, tick it, and say "<id> dropped" in your final message. Dropping is the user's call: a task you think is no longer needed (what it checks is gone) is parked and listed in your report with that reason, never dropped by you; never drop a task to get past a block. A dropped task counts as closed, so the tasks that wait on it (\`(after:)\`) become Ready: drop or re-plan them first. Tick the parent when its last child is ticked.
290
290
  5. **Review before you commit.** Before dispatching, run the project's formatter, if any, so the review sees the final tree. Then dispatch \`subagent_type: "cto-reviewer"\` with no model parameter (it runs on Opus), with none of your context: it reads the feature's CONCEPT.md and SPEC.md and the whole uncommitted change of the wave, and returns findings each marked P1 (wrong, unsafe, breaks a Constraint or the Interface, does something the CONCEPT does not say or contradicts, or an acceptance test that would still pass with its scenario broken) or P2 (should improve, can wait). You wrote both the code and its tests, so the reviewer answers one question per acceptance test: if the scenario were not met, would this test fail. Handle them as under "Review findings": fix every P1 now and re-run acceptance; write every P2 as a \`(P2)\` task in TASKS.md whose text starts with exactly \`Review finding (wave <ids>):\`, in English whatever language the rest of TASKS.md uses. A cleanup wave's review is the exception: its P2s become no task and go under \`Left for the user:\` instead (see "Review findings"). Append one entry to REVIEW.md: date, scope (the task ids of the wave), how many P1/P2, which task ids they became, what was contested or escalated. The dispatch prompt names the wave's task ids, every changed path and the verify command from \`cto brief\`; it never dictates the verdict and never drops a changed path. After fixing P1s, run the formatter again before every re-dispatch; then dispatch again on the whole change, never on the fix alone. Where Claude Code is wired and the review gate is on, only a Claude Code session can satisfy the gate, so other agents (with or without sub-agents) hand the wave over as below.
291
291
  6. \`cto check\`, then commit the wave to the review branch.
292
292
 
@@ -321,7 +321,7 @@ Every review (docs, wave, release) ends here. You wrote what was reviewed, so wa
321
321
  - Never change a severity yourself. A P1 that looks like a P2 is contested like any finding, with evidence, and the user decides.
322
322
  - An escalated finding, or a contest the user has not decided, does not stop a run: leave that finding unfixed, write it into the REVIEW.md entry, go on, and list it in your final report and the release report. In a docs review it goes into the handoff's "might be missing" instead, since that job stops for sign-off anyway. Before escalating, read the CONCEPT: what it decides is not the user's to decide again.
323
323
  - After fixing P1s, a new \`cto-reviewer\` (no model parameter, none of your context) re-reviews the whole current change, never the fix alone: the commit gate matches a review to the exact working tree, so a review of the fix alone does not cover what is committed. Run the formatter again before every re-dispatch. At most three rounds per review: the first plus up to two whole-change re-reviews. If P1s remain after round three, stop fixing: write each one into the REVIEW.md entry marked as escalated to the user (the commit gate accepts that), leave it unfixed, and hand it to the user. Anything below P1 becomes a task with its severity, except in a cleanup review (next rule) (in a docs review, where no tasks may exist yet: fixed in the docs or put in the handoff's "might be missing").
324
- - **Findings below P1 are batched, not chained.** A finding task is one whose text starts \`Review finding (\`, or, for one filed before that marker existed, whose text says it came from a review in any wording. Finding tasks wait while their feature has any other Ready task you would dispatch; parked tasks, finding tasks and tasks blocked on a finding task do not count. Then all of the feature's Ready finding tasks run as one cleanup wave: dispatched as usual (\`(seq)\` and overlapping \`(files:)\` still run one after another), each accepted, then one review over the whole cleanup and one commit. What that cleanup review finds below P1 does not become a task: write it into the cleanup's REVIEW.md entry under \`Left for the user:\` and list it in the final report and the release report. It becomes a task only when the user asks for it.
324
+ - **Findings below P1 are batched, not chained.** A finding task is one whose text starts \`Review finding (\`, or, for one filed before that marker existed, whose text says it came from a review in any wording. Finding tasks wait while their feature has any other Ready task you would dispatch; parked tasks, finding tasks and tasks blocked on a finding task do not count. Then all of the feature's Ready finding tasks run as one cleanup wave: dispatched as usual (\`(seq)\` and overlapping \`(files:)\` still run one after another), each accepted, then one review over the whole cleanup and one commit. A finding task's test is a unit or database test, unless the finding is an Acceptance scenario that is broken for the user; then it is that scenario's end-to-end test. What that cleanup review finds below P1 does not become a task: write it into the cleanup's REVIEW.md entry under \`Left for the user:\` and list it in the final report and the release report. It becomes a task only when the user asks for it.
325
325
  - Without sub-agents every review here, the re-review included, is your own: say \`self-review\` in its REVIEW.md entry. Where Claude Code is wired and the review gate is on, that self-review cannot pass the commit gate: keep its tasks ticked, leave the tree uncommitted, stop the run, and say in the final report that it is waiting for a cto-reviewer review in a Claude Code session.
326
326
 
327
327
  ## cto-jev release
@@ -343,7 +343,7 @@ Whatever the row, one rule holds: the branch that reaches users receives nothing
343
343
  1. Everything to be released is on the work branch and every P1 task is ticked. If not, run \`cto-jev work\` first; what it parks goes into this release's report. If a P1 is still open after that (parked), the release ends here: report it with the parked list, no merge.
344
344
  2. Dispatch \`subagent_type: "cto-reviewer"\` with no model parameter and none of your context over the whole unreleased diff (the review scope above) plus the SPECs of every feature it touches; point it at the waves marked \`self-review\` in REVIEW.md. Findings get P1, P2 or P3, handled as under "Review findings", written into TASKS.md.
345
345
  3. P1 findings are fixed (through \`cto-jev work\`, whose wave review counts as the re-review) before anything else; P2 and P3 stay as tasks for after the release. Tell the user both lists and let them decide which P2 should move up. With them, everything collected since the last release that only the user can judge, grouped by feature: every \`Assumed:\` line added, every \`manual\` task ticked (what to look at and where, from its acceptance line), every finding left unfixed for their decision. This is the one place the user reads them.
346
- 4. \`cto check --base <release branch>\` must pass. Then prepare the merge, PR or tag; the user performs it. Append one REVIEW.md entry per feature released: date, "release", counts, task ids, what was contested or escalated.
346
+ 4. The whole unit and end-to-end suites and \`cto check --base <release branch>\` must pass. Then prepare the merge, PR or tag; the user performs it. Append one REVIEW.md entry per feature released: date, "release", counts, task ids, what was contested or escalated.
347
347
 
348
348
  **Stop:** before the merge, with the P1/P2/P3 lists in front of the user.
349
349
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "your-cto-jev",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "A sharp-tongued CTO gatekeeper for AI coding agents: blocks leaked secrets in git commits and destructive shell commands in Claude Code, Cursor, Gemini CLI and Codex, using TypeSafe Jev.",
5
5
  "keywords": [
6
6
  "claude-code",