cohorte 3.0.0 → 3.1.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +16 -10
  3. package/bin/cli.js +2 -1
  4. package/core/agents/cohorte-profile-reader.md +21 -31
  5. package/core/agents/cohorte-release.md +6 -3
  6. package/core/agents/cohorte-review.md +31 -5
  7. package/core/agents/implementer.template.md +13 -5
  8. package/core/commands/cohorte-audit.md +10 -3
  9. package/core/commands/cohorte-brainstorm.md +2 -2
  10. package/core/commands/cohorte-build.md +17 -10
  11. package/core/commands/cohorte-doctor.md +11 -9
  12. package/core/commands/cohorte-fix.md +2 -2
  13. package/core/commands/cohorte-fleet.md +1 -1
  14. package/core/commands/cohorte-init-pipeline.md +2 -2
  15. package/core/commands/cohorte-intake.md +3 -3
  16. package/core/commands/cohorte-patch.md +1 -1
  17. package/core/commands/cohorte-refactor.md +73 -8
  18. package/core/commands/cohorte-retro.md +2 -2
  19. package/core/commands/cohorte-revert.md +104 -0
  20. package/core/commands/cohorte-review.md +29 -14
  21. package/core/commands/cohorte-ship.md +17 -5
  22. package/core/commands/cohorte-spec.md +11 -2
  23. package/core/commands/cohorte-update-pipeline.md +12 -8
  24. package/core/commands/cohorte-verify.md +106 -0
  25. package/core/hooks/gate.py +326 -21
  26. package/core/templates/patch.template.md +11 -2
  27. package/core/templates/spec.template.md +23 -2
  28. package/core/templates/steps/init-pipeline/01-detect-stack.md +14 -5
  29. package/core/templates/steps/init-pipeline/02-interview-gaps.md +26 -3
  30. package/core/templates/steps/init-pipeline/03-draft-profile.md +2 -1
  31. package/core/templates/steps/init-pipeline/04-write-render.md +16 -12
  32. package/core/templates/steps/init-pipeline/05-report.md +1 -1
  33. package/core/workflows/audit.js +9 -4
  34. package/core/workflows/loop.js +15 -10
  35. package/core/workflows/refactor.js +116 -9
  36. package/core/workflows/review.js +24 -10
  37. package/lib/doctor.js +37 -3
  38. package/lib/install.js +11 -2
  39. package/lib/project.js +45 -8
  40. package/lib/render.js +3 -3
  41. package/lib/yaml.js +10 -1
  42. package/package.json +2 -2
  43. package/profile/PIPELINE.template.md +39 -1
  44. package/profile/SCHEMA.md +27 -746
  45. package/profile/cohorte.config.template.yaml +1 -1
  46. package/profile/schema/dead-agents.md +29 -0
  47. package/profile/schema/decisions.md +23 -0
  48. package/profile/schema/deferred.md +22 -0
  49. package/profile/schema/feature-diff.md +20 -0
  50. package/profile/schema/kanban.md +95 -0
  51. package/profile/schema/metrics.md +23 -0
  52. package/profile/schema/output-discipline.md +21 -0
  53. package/profile/schema/preflight.md +81 -0
  54. package/profile/schema/profile-block.md +103 -0
  55. package/profile/schema/project-kinds.md +89 -0
  56. package/profile/schema/readiness.md +17 -0
  57. package/profile/schema/reconcile.md +64 -0
  58. package/profile/schema/release-notes.md +29 -0
  59. package/profile/schema/rendering.md +48 -0
  60. package/profile/schema/retrieval.md +58 -0
  61. package/profile/schema/spec-status.md +79 -0
  62. package/profile/schema/specialization.md +41 -0
  63. package/profile/schema/verify.md +115 -0
  64. package/profile/schema/workflows.md +78 -0
  65. package/scripts/kanban-move.sh +45 -3
  66. package/scripts/verify-run.sh +509 -0
@@ -20,7 +20,7 @@ obsidian:
20
20
  # Mirrors /cohorte-brainstorm…/cohorte-ship onto an Obsidian Kanban board — one board per project. The
21
21
  # board path points at your PERSONAL vault, so it is machine-specific and lives here (never
22
22
  # committed in a repo's PIPELINE.md). /cohorte-init-pipeline + /cohorte-update-pipeline write `boards` for you.
23
- # See SCHEMA.md §Kanban.
23
+ # See ~/.claude/cohorte/pipeline/schema/kanban.md.
24
24
  kanban:
25
25
  enabled: false # cfg:kanban_enabled — master switch for the kanban mirror
26
26
  # Default column mapping: pipeline stage → the EXACT board column heading. Shared by every
@@ -0,0 +1,29 @@
1
+ ## Dead agents — silence is not a green light
2
+
3
+ A subagent can die mid-run: a rate limit, a transport error that outlived its retries, its own context
4
+ exhausted on a big surface. When it does it returns **nothing** — and nothing is byte-identical to
5
+ "finished, nothing to report". Every phase that fans out therefore does a **roll call** before it
6
+ integrates anything, because the default reading of silence is the most dangerous one available:
7
+
8
+ | phase | what a dead agent looks like | what the phase must do |
9
+ | --- | --- | --- |
10
+ | `/cohorte-build` | a surface with no handoff | retry it **once** alone (byte-identical prompt), then mark it `dead`, verify the tree with that surface's own quiet commands, never call the batch ok |
11
+ | `/cohorte-review` | a reviewer with no report ⇒ **zero findings** | retry once, then list the surface in `unreviewed` and refuse to score `SHIP` |
12
+ | `/cohorte-fix` | a re-dispatched agent with no handoff | retry once, then leave **every** one of its items `- [ ]` — a dead agent never ticks a box |
13
+ | workflows | `agent()` resolves to `null` | already enforced (`review.js` `unreviewedSurfaces`) — the doctrine started here |
14
+
15
+ Non-negotiables, in every phase:
16
+
17
+ - **Retry once, alone, byte-identical.** Most deaths are transient, and the other surfaces' work is
18
+ already on disk — so recovery costs one agent, never a rebuild. Never retry an agent that answered.
19
+ - **Never speak for a dead agent.** You did not see its work: report what the *tree* says (quiet
20
+ commands, redirected to a file, grepped), not what a handoff would have said.
21
+ - **Never let it reach a driver as clean.** `/cohorte-build` writes `dead[]` into
22
+ `specs/reports/<id>.build.json`, `/cohorte-review` writes `unreviewed[]` into the verdict; a driver
23
+ must abort on either *before* it reads `blocking`, since a dead reviewer makes
24
+ `blocking == 0` a statement about code nobody read.
25
+ - **`unreviewed` is separate from `blocking` on purpose.** Faking a count in `blocking` to force a
26
+ driver's hand would corrupt the one field the whole contract rests on; a driver reads them as two
27
+ different facts — "what was found" and "what was covered".
28
+ - **Write the metrics line anyway** (`"<key>":"dead"`). An incomplete batch is exactly the batch worth
29
+ recording; holding the append back "until it's complete" deletes the evidence that anything failed.
@@ -0,0 +1,23 @@
1
+ ## Decisions — the transverse decision journal
2
+
3
+ `PIPELINE.md` is a **stack profile** (surfaces, commands, conventions); it says nothing about what this
4
+ project has *decided*. Without somewhere for those, every `/cohorte-spec` re-discovers or contradicts them.
5
+ `specs/_decisions.md` (from `core/templates/decisions.template.md`) is that place, deliberately small:
6
+
7
+ - **Append-only, one line per decision, ≤ ~160 chars:**
8
+ `- <YYYY-MM-DD> · <area> · <decision> — because <reason> · <origin>`, where `<origin>` is the
9
+ `feature_id` that decided it — or the originating command (`retro`) when no single feature owns
10
+ it. Reversal never edits a line:
11
+ append a superseding one (`· supersedes <date> <area>`) and move the old one to `## Superseded`. When
12
+ `## Live` passes ~100 lines, sweep the superseded ones down.
13
+ - **Written by** `/cohorte-spec` at freeze (the decisions that outlive the feature — typically 0–3 lines, and
14
+ zero is a normal outcome), `/cohorte-build` §1.5 when it adds or splits a surface, and
15
+ `/cohorte-retro` §4 when the human ratifies a convention rule (one line per adopted rule).
16
+ - **Read by the deciding stages only** — `/cohorte-brainstorm` (so the panel argues about the idea, not about
17
+ settled ground), `/cohorte-spec` (so a new spec does not silently un-decide something), `/cohorte-audit` (standing
18
+ decisions are part of the rulebook it audits against).
19
+ - **Never read by implementers or reviewers.** They work from the frozen contract, which already tells
20
+ them what to do; shipping them the rationale would cost `surfaces × dispatches` tokens per feature
21
+ for a fact they cannot act on. This is what keeps the journal cheap enough to be worth having.
22
+ - The `_` prefix is load-bearing: `/cohorte-doctor`, the `cohorte specs` scanner and the kanban backfill all skip
23
+ `specs/_*.md`, so the journal is never mistaken for a spec (no phantom card, no bogus stage).
@@ -0,0 +1,22 @@
1
+ ## Deferred findings — real, but not this feature's problem
2
+
3
+ `/cohorte-review` ends on "zero blocking findings", so everything non-blocking used to be discarded with the
4
+ report. A **deferred** finding is one the reviewer judges true and **out of this feature's scope**
5
+ (pre-existing code the staged diff never touched, adjacent debt the spec never claims to fix). The
6
+ review agent returns them in their own `## Deferred` section — never in `findings` — each carrying its
7
+ own out-of-scope reason.
8
+
9
+ - They count in **no** severity row, enter **no** verdict, and are **never** cross-checked: a deferred
10
+ item cannot cost a fix loop an iteration, and refuting one would spend an agent arguing about
11
+ something that cannot change the outcome.
12
+ - **Not deferrable, ever:** anything the diff touched or introduced, any spec violation, any security
13
+ issue on a path this feature adds, calls or modifies.
14
+ - `/cohorte-review` §3.5 routes them, **on every verdict**, into `specs/refactor-backlog.md` under the
15
+ `## <domain>` heading of the owning surface, tagged `deferred:<feature_id>` — the same grouping
16
+ `/cohorte-audit` writes, so `/cohorte-refactor <domain>` picks them up with no extra plumbing. Never into the spec's
17
+ `## Remediation`, which is what `/cohorte-fix` re-dispatches.
18
+ - `/cohorte-audit` (both paths) **rewrites only the sections of the domains it audited**, carrying their
19
+ open `deferred:` items over, and leaves every other domain's section untouched — overwriting the
20
+ file with one run's items is the one way they silently vanish.
21
+ - The verdict JSON carries `deferred: <n>` (informational, outside `blocking`), so a driver can name
22
+ them in its closing line without reading a report.
@@ -0,0 +1,20 @@
1
+ ## Feature diff — what "the feature changed" means
2
+
3
+ Every diff the pipeline reads — the review's changed-path list and per-surface hunks, an
4
+ implementer's self-diff, the freshness digest `/cohorte-review` stamps and `/cohorte-ship` re-checks —
5
+ comes from ONE shipped script, `<core>/pipeline/scripts/feature-diff.sh`, never a bare `git diff`:
6
+
7
+ ```
8
+ feature-diff.sh --default <default_branch> (--numstat|--name-only|--patch|--digest|--base-only) [-- <pathspec>…]
9
+ feature-diff.sh --base <sha> (same modes)
10
+ ```
11
+
12
+ - **Untracked files are in.** Feature work stays uncommitted until `/cohorte-ship`, and `git diff <ref>`
13
+ never shows an untracked file — new modules escaped review, and an adds-only feature reviewed as an
14
+ empty diff that scored SHIP. The script diffs a **throwaway index** (seeded from the real one,
15
+ `git add -A` on the copy); the human's index and what they staged are never touched.
16
+ - **The base is the merge-base**, not the default branch's tip (which blames the feature for every
17
+ file `main` gained since). Local `<branch>` and `origin/<branch>` are both tried; the newer
18
+ merge-base wins (fleet worktrees branch off the remote ref).
19
+ - **`.claude/` and `specs/` are always excluded** (the pipeline's own writes), gitignored files never
20
+ enter. Exit 3 = the base cannot be resolved: the caller stops — it never falls back to `git diff`.
@@ -0,0 +1,95 @@
1
+ ## Kanban — mirroring the pipeline onto an Obsidian board
2
+
3
+ An **optional, user-scoped** mirror of the dev flow: each pipeline stage moves a card across an
4
+ [Obsidian Kanban](https://github.com/mgmeyers/obsidian-kanban) board, one board per project. Config
5
+ lives in the consolidated global config `<config>` §`kanban` (NOT in
6
+ `PIPELINE.md` — the board path points at the user's personal vault, so it is machine-specific and must
7
+ not be committed). Everything below **no-ops silently** when the config is absent, `kanban.enabled` is
8
+ false, no board is configured for the current project, or the board file is missing — the pipeline never
9
+ blocks on the board.
10
+
11
+ **Config & board resolution.** `kanban.boards` is keyed by the project's `PIPELINE.md` `name`. To resolve
12
+ the current project's board: read `name` from `PIPELINE.md`, look up `kanban.boards[name]`. Found ⇒ the
13
+ board file is `<obsidian.vault_path>/<boards[name].board>`, its columns are `boards[name].columns` if
14
+ present else `kanban.columns`. Not found ⇒ kanban off for this project.
15
+
16
+ **Card format.** A card is a Kanban list item under a `## <column>` heading:
17
+ `- [ ] <human title> #<feature_id>`. The `#<feature_id>` tag is the join key between a card and its
18
+ `specs/<feature_id>.md`; it is how every stage finds *its* card (Grep the board for `#<id>`). Free-text
19
+ notes a human writes as sub-bullets under an Ideas card are seed context for `/cohorte-brainstorm`. Never touch
20
+ the trailing `%% kanban:settings … %%` block or the `kanban-plugin: board` front-matter.
21
+
22
+ Once shipped, `/cohorte-ship` appends the **PR number** to the card — `- [ ] <title> #<feature_id> — PR #<num>`.
23
+ The bare `#<num>` is what a board reader renders as a clickable link to the GitHub PR, so `/cohorte-ship` always
24
+ writes it when a PR was actually created.
25
+
26
+ **Move a card (the core op).** One call — the script does resolution AND the move outside the
27
+ agent's context (find, dedupe, sub-notes carried along, settings block preserved):
28
+
29
+ ```
30
+ <core>/pipeline/scripts/kanban-move.sh auto <id> <stage> [--pr <num>] [--title <title>]
31
+ ```
32
+
33
+ It creates
34
+ the card in the target column when none exists, keeps the first and drops duplicates, and appends
35
+ ` — PR #<num>` with `--pr`.
36
+
37
+ **`auto` is not a convenience, it is the contract.** It reads `name` from `PIPELINE.md`, then
38
+ `kanban.enabled` / `obsidian.vault_path` / `boards[name]` from `<config>`
39
+ (override with `COHORTE_CONFIG`, or skip the profile with `--project <name>`), and it maps the
40
+ **stage key** (`ideas` · `brainstorm` · `spec` · `ready` · `building` · `review` · `fix` · `ship` ·
41
+ `shipped`) to that board's heading through `boards[name].columns` → `kanban.columns` → the built-in
42
+ default. An explicit `<board.md>` path and a literal heading both still work, for one-off and
43
+ non-pipeline moves.
44
+
45
+ **Never conclude "no board is configured" without running it.** The command that resolves nothing
46
+ prints `kanban: <reason>` — naming the missing link (no config file, `enabled: false`, no entry for
47
+ this project, vault unset, board file gone) — and exits **0**. A configured board that cannot be
48
+ moved is loud instead: exit 2 on usage, exit 3 on an unknown column — or on an explicit
49
+ `<board.md>` path that does not exist (under `auto`, a configured board file that is gone is one of
50
+ the `kanban: board file not found` no-ops above, exit 0). Both readings are printed, so a caller
51
+ reports which one it got. This exists because inference was the
52
+ actual failure mode: with only "no-op silently if no board" to go on, a fresh phase session (every
53
+ phase runs after a `/clear`) decided there was no board without ever opening the config, and cards
54
+ stopped moving mid-pipeline while every command still reported success.
55
+
56
+ **Fallback when the script is absent** (older core): do it by hand, but never read the whole board
57
+ into context — it grows with every feature ever tracked: `grep -n` for `#<id>` and the `## ` headings
58
+ to locate lines, then use offset-limited Reads + targeted Edits around the matches. Either way: one
59
+ card per `#<id>`, whole line moved tag-preserved, card created in the target column if missing.
60
+
61
+ **Tag before you move.** The join key is the `#<id>` tag, and an **Ideas** card a human typed by hand
62
+ does not have one. Moving it first finds nothing, creates a second card, and strands the original in
63
+ Ideas — so `/cohorte-brainstorm` appends the tag to the picked line before its first move.
64
+
65
+ **Stage → column**, used both by each pipeline command (to move its card live) and by backfill:
66
+
67
+ | Pipeline moment | Column |
68
+ | --------------------------------------- | --------------- |
69
+ | human drops a raw idea (manual) | `ideas` |
70
+ | `/cohorte-brainstorm` picks it up | `brainstorm` |
71
+ | `/cohorte-spec` opens (draft) | `spec` |
72
+ | `/cohorte-spec` freezes (`status: frozen`) | `ready` |
73
+ | `/cohorte-patch` triages / freezes | `spec` → `ready` (card titled `[patch] <title>`, tag `#patch-<slug>`) |
74
+ | `/cohorte-refactor` freezes its round spec | `ready` (card titled `[refactor] <domains>`, tag `#refactor-<domains>-<date>`) |
75
+ | `/cohorte-build` | `building` |
76
+ | `/cohorte-review` | `review` |
77
+ | `/cohorte-fix` | `fix` |
78
+ | loop workflow, per phase (`in-progress`) | `building` → `review` → `fix`, as each phase starts |
79
+ | a round gave up (`blocked`) | `fix` |
80
+ | `/cohorte-ship` starts | `ship` |
81
+ | PR opened (`status: shipped`) | `shipped` (+ `PR #<num>` on the card) |
82
+
83
+ **Backfill / sync from specs (reconcile).** `specs/*.md` is the source of truth. For each spec, read its
84
+ `feature_id` (front-matter or filename) and `status`, map `status`→column — `frozen`→`ready`,
85
+ `in-progress`→`building` (the phase is unknown from the status alone; the next live move corrects it),
86
+ `in-review`→`review`, `blocked`→`fix`, `shipped`/`merged`/`abandoned`→`shipped`, anything else / a spec with no
87
+ status→`spec` — then **full
88
+ sync**: card absent ⇒ add it in that column; card present ⇒ **move it** to that column so the board
89
+ always reflects the specs (this repositions cards the human may have moved by hand). Report cards
90
+ added vs. moved vs. already-correct.
91
+
92
+ **Create a board.** When linking a project with no board file yet: write
93
+ `<obsidian.vault_path>/<folder>/Tasks.md` with the `kanban-plugin: board` front-matter, one `## <heading>`
94
+ per configured column in pipeline order, and the closing `%% kanban:settings %%` block
95
+ (`{"kanban-plugin":"board","list-collapse":[false,…]}` with one `false` per column).
@@ -0,0 +1,23 @@
1
+ ## Measuring cost — what's slow vs what's expensive
2
+
3
+ `pipeline-metrics.jsonl` records **wall-clock seconds** per phase batch (§Specialization, `<core>/pipeline/schema/specialization.md`) — it tells you
4
+ what's SLOW. Tokens are recorded only where they can be read honestly: the **workflow paths**
5
+ (`loop.js`, `review.js`) stamp an approximate `tokens` field per batch from the runtime's own
6
+ counter (`budget.spent()` deltas), and the loop's return carries a per-round breakdown in its
7
+ `history`. The **conversational** commands still record none — a lead cannot reliably read a
8
+ subagent's token count, and a guessed number is worse than a missing one. `cohorte metrics` sums
9
+ whatever is stamped (a token-less line aggregates as 0, rendered as absent, never as "free").
10
+ For exact spend, use Claude Code's own accounting:
11
+
12
+ - **`/cost`** (built-in, zero setup) — reports per-**subagent** and per-**slash-command** share of your usage
13
+ over the last 24 h / 7 d (e.g. _"Top subagents: frontend 7 %, backend 4 % · Top skills: /cohorte-build 1 %,
14
+ /cohorte-review 1 %"_). That IS the per-phase ledger — approximate (share-of-total, machine-local, not exact
15
+ tokens). Read it to see which surface/command actually dominates the bill before you tune a `model` tier.
16
+
17
+ **Lead context discipline — the silent bill.** The lead session's conversation history is re-sent as
18
+ input on EVERY turn; a session that spans spec→build→review→fix without clearing re-pays the
19
+ accumulated spec walk-through, handoffs, and reports on each turn. The pipeline is built so this is
20
+ never necessary: every phase handoff (spec, contract, diff, staged reports) lives on disk, so `/clear`
21
+ at each phase boundary is always safe — each command's closing line recommends it. Corollaries the
22
+ commands enforce: never paste a diff into a dispatch (agents compute their own, scoped); never echo a
23
+ staged report or design brief into chat; redirect bulky command output to a file and grep it.
@@ -0,0 +1,21 @@
1
+ ## Output discipline — quiet commands
2
+
3
+ A test runner's default output is written for a human watching a terminal: one line per test, banners,
4
+ timing tables. An agent pays input price for every one of those lines, on every turn they survive in its
5
+ context. The profile therefore stores **two forms of each noisy command**:
6
+
7
+ - `test_cmd` / `lint_cmd` — the full form, for a human running it by hand.
8
+ - `test_quiet_cmd` / `lint_quiet_cmd` (per surface) and `commands.test_quiet` / `commands.lint_quiet`
9
+ (repo-wide) — the **bridled** form agents actually execute: dot/failures-only reporter
10
+ (`--reporter=dot`, `--quiet`, `-q`, `--silent`, framework equivalent) so a green run costs lines,
11
+ not pages, and a red run prints only the failures.
12
+
13
+ Rules for every consumer (implementers, preflight, `/cohorte-audit` gates, workflow agents):
14
+
15
+ 1. Run the quiet variant when set.
16
+ 2. Quiet variant empty/absent (older profile) ⇒ run `<full cmd> 2>&1 | tail -40` — never the bare
17
+ command into your context.
18
+ 3. Need the full log? Redirect it to a file and grep it; never print it.
19
+
20
+ `/cohorte-init-pipeline` **asks** for these variants (detected defaults offered first) instead of silently
21
+ storing a bare `pnpm test` as the thing agents execute; `/cohorte-update-pipeline` tops up older profiles.
@@ -0,0 +1,81 @@
1
+ ## Preflight — the deterministic phase gate
2
+
3
+ `/cohorte-review` starts by running `pipeline/scripts/preflight.sh` — a plain shell script (no
4
+ agent) that executes the profile's mechanical checks in order (typecheck → lint → tests, quiet
5
+ variants, then any `commands.security` scans — below) with all output redirected to `specs/reports/<id>.preflight.txt`:
6
+
7
+ - **Any check red** ⇒ the script prints the last 40 lines raw and exits 1. The command **aborts
8
+ there: zero agents are spawned.** A reviewer dispatched onto code that doesn't compile burns its
9
+ whole run rediscovering what `tsc` already printed for free — the failure goes straight to the
10
+ human (or `/cohorte-fix`) instead.
11
+ - **All green** ⇒ the script stamps `<state>/preflight.ok` (`<epoch> <HEAD sha> <tree digest>` —
12
+ local and **gitignored**; a versioned stamp describes the tree *before* its own commit and rides
13
+ into every clone and worktree, which breaks the gate both ways).
14
+
15
+ `hooks/gate.py` enforces the stamp as a **phase gate** (the `preflight` block of `gate-config.json`,
16
+ generated from `gate.preflight`): an `Agent` (formerly `Task`) dispatch of a listed `subagent_type` (default
17
+ `cohorte-review`) with a missing/stale stamp — older than `max_age_minutes`, or the digest no longer
18
+ matches the working tree (`.claude` and `specs` excluded, so the pipeline's own writes and a
19
+ commit of already-verified code do not invalidate it) — gets an
20
+ "ask", so a lead can't accidentally skip the gate but a human can consciously override it. The gate
21
+ hook fires for **every** agent in the session, including subagents spawned by the Workflow runtime
22
+ (they run in `acceptEdits` whatever the session mode — Write/Edit auto-approved — but Bash and Agent
23
+ still pass through hooks). In `bypassPermissions` (headless runs) every gate "ask" is escalated to a
24
+ hard deny, because nobody is there to answer a prompt.
25
+
26
+ ### Security scans — `commands.security`
27
+
28
+ `commands.security: []` is a list of shell commands, empty by default. The preflight runs them
29
+ **after** typecheck → lint → tests, in the same script call, into the same report. They are just
30
+ more arguments to `preflight.sh`. The caller passes a no-op marker, `: cohorte-security-scans`,
31
+ ahead of them. The marker shows up in the report as the line `$ : cohorte-security-scans`, which
32
+ opens the **security section**.
33
+
34
+ - **A scan is a gate like any other check.** A non-zero exit means a dependency advisory at the
35
+ command's threshold or a secret in the feature's diff. It turns the preflight red, the review
36
+ aborts, and no agent is spawned. So pick thresholds that the default branch passes today.
37
+ Otherwise every review is blocked by debt the feature didn't add.
38
+ - **Green scans still leave output behind**, such as advisories below the threshold. The
39
+ `cohorte-review` agent's security pass reads the security section, found by grepping for the
40
+ marker. The threshold is the project's choice, so nothing below it blocks. An advisory on a
41
+ dependency that the reviewer's own staged diff adds or bumps becomes one non-blocking
42
+ `quality` finding. Advisories on untouched dependencies are ignored: they are neither findings
43
+ nor backlog items.
44
+ - **Quoting.** Pass each command as one argument. Single-quote any command that contains `$`,
45
+ a backtick or `\` (a `'` inside becomes `'\''`). Inside double quotes the calling shell would
46
+ expand the command's own variables before `preflight.sh` ever ran it.
47
+ - **A command path must be static.** A command name computed at run time (`"$CORE/x.sh"`,
48
+ `"${CLAUDE_CONFIG_DIR:-…}/…"`) gets **ask** from the gate hook, and ask becomes deny in
49
+ headless runs. Write `~/.claude/cohorte/…`. If `CLAUDE_CONFIG_DIR` is set, write its literal
50
+ value instead.
51
+ - **Secret scans target the feature only, never history.** Feature work is uncommitted until
52
+ `/cohorte-ship`, so `gitleaks git`, `trufflehog git --since-commit …` and any other log-based
53
+ scan see none of it, and a whole-history scan reports every old leak on every review. Scan the
54
+ `feature-diff.sh --patch` output (`<core>/pipeline/schema/feature-diff.md`): untracked files are
55
+ included, the base is the merge-base, and `.claude/` and `specs/` are excluded. Keep only the
56
+ added lines (`grep '^+'`), so that a feature *removing* a secret does not fail. Write the patch
57
+ only under `specs/reports/`: it is gitignored and excluded from both the stamp digest and the
58
+ feature diff, so it changes neither. The recipe deletes it on a pass. On a hit it keeps
59
+ `security-scan.patch` and `.patch.added`, because the scanner read only the added lines and its
60
+ line numbers point into `.added`. Use the patch to find the file. Never pipe `feature-diff.sh`
61
+ straight into the scanner. In `sh`, a pipeline's status is its last command's, so an exit 3
62
+ (no base) would hand the scanner an empty input that passes.
63
+
64
+ **Detected defaults** `/cohorte-init-pipeline` proposes, one per detected manifest or tool.
65
+ Never add one silently. `<default_branch>` is filled in at init.
66
+
67
+ | Detected | Command | Threshold / scope |
68
+ | --- | --- | --- |
69
+ | `package-lock.json` | `npm audit --omit=dev --audit-level=high` | production deps, high+ |
70
+ | `pnpm-lock.yaml` | `pnpm audit --prod --audit-level high` | production deps, high+ |
71
+ | `yarn.lock` (Yarn ≥ 2) | `yarn npm audit --all --recursive --environment production --severity high` | all workspaces, transitive, production, high+ |
72
+ | `yarn.lock` (Yarn 1) | `yarn audit --groups dependencies --level high` | the exit code is a severity bitmask, so check it on the project before relying on it |
73
+ | `requirements*.txt` / `pyproject.toml` | `pip-audit -r requirements.txt` (or `pip-audit` in the project env) | no severity filter, so any known vuln is red |
74
+ | `go.mod` | `govulncheck ./...` | only vulnerabilities the code actually reaches |
75
+ | `Cargo.lock` | `cargo audit` | needs `cargo install cargo-audit` |
76
+ | `gitleaks` on PATH | `P=specs/reports/security-scan.patch; ~/.claude/cohorte/pipeline/scripts/feature-diff.sh --default <default_branch> --patch > "$P" \|\| exit 2; grep '^+' "$P" > "$P.added"; gitleaks stdin --redact --no-banner < "$P.added" && rm -f "$P" "$P.added"` | the feature diff only, secrets redacted from the report |
77
+ | `trufflehog` on PATH | the same line with `trufflehog stdin --fail --no-update --results=verified,unknown < "$P.added"` in place of `gitleaks …` | `--fail` exits 183 on a result. Without `--fail` it always exits 0 |
78
+
79
+ Offer at most one secret scanner. A scanner that isn't installed is not proposed. Say how to
80
+ install it, and let the human decide. The release agent's own check (no `.env` or credential
81
+ file staged at ship) still applies; these scans don't replace it.
@@ -0,0 +1,103 @@
1
+ # PIPELINE.md profile — field reference
2
+
3
+ `/cohorte-init-pipeline` fills the `yaml pipeline-profile` block in `PIPELINE.md` (from
4
+ `PIPELINE.template.md`) plus the prose sections. This documents every field and how the
5
+ generic pipeline uses it, so a stateless agent can read/regenerate the profile correctly.
6
+
7
+ ## `yaml pipeline-profile` block
8
+
9
+ | Field | Type | Used by | Meaning |
10
+ | ------------------------------------ | ------------ | --------------------------------- | ------------------------------------------------------------- |
11
+ | `name` | string | all | Project name, used in agent prose + commit scopes. |
12
+ | `one_liner` | string | brainstorm/spec | One-sentence product description. |
13
+ | `ui_language` | string | implementer, review | Language of ALL user-facing copy. |
14
+ | `package_manager` | enum | all | `pnpm`/`npm`/`yarn`/`bun`/`pip`/`cargo`/`go`. |
15
+ | `vcs.host` | enum | release | `github`→use `gh`; else emit compare URL. |
16
+ | `vcs.remote` | string | release | `owner/repo` for the PR/compare URL. |
17
+ | `vcs.default_branch` | string | build, review, release | Base branch for diffs + PRs. |
18
+ | `vcs.feature_branch_prefix` | string | ship, isolation script | `feature/` → branch `feature/<id>`. |
19
+ | `vcs.patch_branch_prefix` | string | ship | Same, for a `kind: patch` spec: `fix/` → branch `fix/patch-<slug>`. Optional — a profile that predates it falls back to `fix/`. |
20
+ | `project.kind` | enum | init, spec, review | What the repo delivers: `web`/`api`/`cli`/`library`/`mobile`/`data`/`other`. Selects the spec's DoD defaults, the review's kind-specific checks and whether the design step applies (`<core>/pipeline/schema/project-kinds.md`). Optional — absent ⇒ `web` (top-up default). |
21
+ | `repo.layout` | enum | build, audit | `monorepo` (many surfaces) or `single`. |
22
+ | `repo.workspace_tool` | enum | audit | `turborepo`/`nx`/`none`. |
23
+ | `retrieval.provider` | enum | init, update-pipeline, implementer | `serena` (default) / `graphify` / `none` — see §Code retrieval (`<core>/pipeline/schema/retrieval.md`). |
24
+ | **`surfaces[]`** | list | **build, review, refactor, init** | One per independently-built area. Grows via reconcile (`<core>/pipeline/schema/rendering.md`). |
25
+ | `surfaces[].key` | string | build | Short id + review scope. |
26
+ | `surfaces[].path` | string | implementer | The ONLY tree that surface's agent may touch. |
27
+ | `surfaces[].owns_also` | list | hooks/gate.py | Optional. Extra root-relative paths (file, directory, or glob where `*` matches `/`) this surface's agent may also write, e.g. `[db/migrations]`. Default `[]`. |
28
+ | `surfaces[].label` | string | build, init (`<SURFACE_LABEL>`) | Human label + framework, e.g. `frontend (React)`. |
29
+ | `surfaces[].agent` | string | build (`subagent_type`) | Rendered agent file name. |
30
+ | `surfaces[].tools` | list | init | Frontmatter `tools:` for the rendered agent. |
31
+ | `surfaces[].model` | enum | init (`<SURFACE_MODEL>`) | Frontmatter `model:` tier — `sonnet`/`haiku`/`inherit`. Default `sonnet` (implementers mostly apply a frozen contract — far cheaper than the Opus lead the dispatcher runs on, and Sonnet handles it well); `haiku` for purely mechanical surfaces (scaffolding); `inherit` only for surfaces with real design decisions worth the lead's model. |
32
+ | `surfaces[].*_cmd` | string | implementer | test/lint/format/typecheck/build commands. |
33
+ | `surfaces[].test_quiet_cmd` `.lint_quiet_cmd` | string | implementer, preflight, workflows | Bridled variants agents actually run (dot reporter / `--quiet` / failures-only). `""` ⇒ `<cmd> 2>&1 \| tail -40`. See §Output discipline (`<core>/pipeline/schema/output-discipline.md`). |
34
+ | `surfaces[].uses_design` | bool | build, frontend | Whether this surface consumes designs. |
35
+ | `contract.enabled` | bool | build | `false` ⇒ skip contract authoring (§2 of /cohorte-build). |
36
+ | `contract.mechanism` | enum | build, lead | `shared-types-zod`/`openapi`/`protobuf`/`json-schema`/`none`. |
37
+ | `contract.path` `.ext` `.index` | string | build | Where `<feature_id>` contract is authored + barrel. |
38
+ | `contract.authored_by` | const `lead` | build | Implementers import it read-only, never edit. |
39
+ | `ownership.enforce` | bool | hooks/gate.py | Default `true`: the gate denies a surface agent's Write/Edit outside its `path` + `owns_also` + `ownership.shared_writable` and any write to `contract.path`/`.index`. For Bash it is best effort. The lead and non-surface agents are never restricted. `false` turns it off. Read from `.claude/profile.json`, so it is inert until `cohorte sync` writes that file. Inert also when that file is unreadable. |
40
+ | `ownership.shared_writable` | list | hooks/gate.py | Root-relative paths every surface agent may write, typically lockfiles (`pnpm-lock.yaml`). Same forms as `owns_also`. Default `[]`. |
41
+ | `release_notes.enabled` | bool | ship | `false` ⇒ skip note authoring (§2b of /cohorte-ship). See §Release notes (`<core>/pipeline/schema/release-notes.md`). |
42
+ | `release_notes.tool` | enum | ship | `changesets`/`none` — what consumes the file. |
43
+ | `release_notes.dir` `.filename` | string | ship | Where the per-feature note is authored, e.g. `.changeset/<feature_id>.md`. |
44
+ | `release_notes.anchor_package` | string | ship | Sole key in the note's front-matter; a lockstep/`fixed` group propagates the bump. |
45
+ | `release_notes.language` | string | ship | Language of the note's prose — usually `ui_language`. |
46
+ | `release_notes.forbid_levels` | list | ship | Bump levels project policy refuses, e.g. `[major]` while `0.x`. |
47
+ | `release_notes.empty_cmd` | string | ship | Escape hatch when no version should move; `""` if none. |
48
+ | `release_notes.ci_job` | string | ship | CI job that fails on a missing note — lets §5 name the red check. |
49
+ | `release_notes.guidance` | string | ship | Project policy the lead follows when picking the bump + writing the prose. |
50
+ | `commands.*` | string | all | Repo-wide install/dev/lint/format/typecheck/test + migrate. |
51
+ | `commands.test_quiet` `.lint_quiet` | string | review, audit, workflows | Repo-wide bridled variants — what the `/cohorte-review` pre-flight runs. Same fallback as the per-surface ones. |
52
+ | `commands.security` | list | review, workflows (preflight) | Dependency audits and a feature-diff secret scan, run by the `/cohorte-review` pre-flight after typecheck/lint/tests. A red scan aborts the review, and the reviewer reads the green output. Default `[]`. A single string is read as a one-item list. Recipes and rules (static paths, feature diff only): `<core>/pipeline/schema/preflight.md` §Security scans. |
53
+ | `commands.migrate_down` | string | verify, revert | Undo the last migration on the **dev** DB. `/cohorte-verify` checks down-then-up with it; `/cohorte-revert` runs it (`commands.rollback` is read as an alias when this is absent). `""` ⇒ rollback not verified; a command in `gate.deny` is never run. |
54
+ | `commands.dev_ready` | string | verify | Says `commands.dev` is up: an http(s) URL answering 2xx/3xx, or a shell probe exiting 0. `dev` without it doesn't count as runtime-verifiable. |
55
+ | `commands.smoke` `.e2e` | string | verify | Quick checks / the end-to-end suite (e.g. Playwright), run against the started app. All runtime commands `""` ⇒ verify skipped silently. See `<core>/pipeline/schema/verify.md`. |
56
+ | `verify.enabled` | bool | verify, ship | `false` ⇒ `/cohorte-verify` is a no-op and `/cohorte-ship` never asks about it. Default `true`. |
57
+ | `verify.db` | enum | verify, revert | `local` (default — the dev DB is yours) / `shared` (others use it ⇒ migrations refused unless `isolation.db_per_worktree`, in a feature worktree). |
58
+ | `verify.ready_timeout_seconds` `.check_timeout_seconds` | number | verify | Ready-probe window (default 90) and per-check limit (default 600). |
59
+ | `verify.screenshots` | enum | verify | `auto` (default — when `node_modules/.bin/playwright` resolves; never `npx`-installs) / `off`. |
60
+ | `verify.surfaces.<key>` | map | verify | Optional per-surface hints: `base_url`, `paths[]` (screenshotted), `smoke` (an extra check `smoke:<key>`). Only touched surfaces are used. |
61
+ | `rbac.enabled` | bool | brainstorm, review | Toggle RBAC personas + authz audit. |
62
+ | `rbac.hierarchy` | list | review | Highest→lowest role list. |
63
+ | `design.enabled` | bool | build, frontend, align-ds | `false` ⇒ design steps are no-ops. |
64
+ | `design.provider` | enum | frontend, align-ds | `claude-design`/`figma`/`none`. |
65
+ | `design.design_system_project` | id | align-ds, frontend | UI-kit source of truth. |
66
+ | `design.design_project` | id | build, frontend | Legacy fallback for bare-filename `design_files` only; default `none`. New specs use full `…/design/p/<projectId>?file=<file>` links that carry their own project + page (nothing to go stale on a DS rebuild). |
67
+ | `design.snapshot_dir` | path | align-ds | Committed DS snapshot for diffing. |
68
+ | `design.ui_kit_path` `.tokens_path` | path | align-ds, frontend | Where the kit + tokens live in code. |
69
+ | `isolation.enabled` | bool | new-feature script | `false` ⇒ build in main checkout. |
70
+ | `isolation.db_per_worktree` | bool | new-feature script | Create `<name>_<id>` DB per worktree. |
71
+ | `isolation.db_name_pattern` | string | new-feature script | `<name>_<id>`. |
72
+ | `isolation.port_base` | map | new-feature script | `api`/`web` base ports; +slot per worktree. |
73
+ | `isolation.compose_file` `.registry` | path | new-feature script | Docker stack + slot registry. |
74
+ | `gate.deny[]` | list | hooks/gate.py, settings | Command substrings hard-denied, on any branch. |
75
+ | `gate.ask[]` | list | hooks/gate.py, settings | Command substrings that require confirm, on any branch. |
76
+ | `gate.ask_on_default_branch[]` | list | hooks/gate.py | Confirm ONLY on `default_branch`; free on feature branches. |
77
+ | `gate.default_branch` | string | hooks/gate.py | Protected branch (default `main`); gate resolves via git. |
78
+ | `gate.preflight.enabled` | bool | hooks/gate.py, review | Phase gate: review dispatches need a fresh preflight stamp. See §Preflight (`<core>/pipeline/schema/preflight.md`). |
79
+ | `gate.preflight.agents[]` | list | hooks/gate.py | `subagent_type`s the stamp gates (default `[cohorte-review]`; `review` still accepted). |
80
+ | `gate.preflight.max_age_minutes` | number | hooks/gate.py | Stamp freshness window (default 30). |
81
+
82
+ ## Prose sections
83
+
84
+ - **Conventions** — per-surface rules the implementer follows and review audits.
85
+ - **Testing** — the TDD contract per surface (what a test must cover, DB isolation).
86
+ - **Design brief note** — feeds `/cohorte-spec` §8 and the Claude Design step.
87
+ - **Personas** — the `/cohorte-brainstorm` panel; include one per RBAC role when `rbac.enabled`.
88
+
89
+ ## How the pieces reference this file
90
+
91
+ - **Agents** (`implementer`, `review`, `release`) are told at dispatch: _read `PIPELINE.md`
92
+ §Commands / §Conventions / §Surfaces first._ They have `Read`, so they load it live.
93
+ - **Commands** (`/cohorte-build`, `/cohorte-review`, …) parse the `yaml pipeline-profile` block to know how
94
+ many surfaces to dispatch, the contract mechanism, the commands, and the capability flags.
95
+ - **`<state>/profile.json`** is this block parsed to JSON by `<sync>` (committed, regenerated by
96
+ every sync — so every command that edits the block runs `<sync>` after it). Agents that need only
97
+ the machine block — the implementers, `cohorte-review`, `cohorte-release`, the workflows'
98
+ `cohorte-profile-reader` — read it instead of `PIPELINE.md`, falling back to the fenced block when
99
+ it is absent. `cohorte doctor` warns when it no longer matches `PIPELINE.md`.
100
+ - **Hook** (`gate.py`) reads `gate.deny`/`gate.ask`/`gate.ask_on_default_branch`/`gate.default_branch`
101
+ from a generated `<state>/gate-config.json`. The last two make git + docker free on feature branches
102
+ but confirm-gated on the default branch (branch resolved at run time via `git rev-parse`).
103
+ - **Scripts** (`new-feature.sh`) read the `isolation` block (rendered in at init).
@@ -0,0 +1,89 @@
1
+ ## Project kinds — `project.kind` presets
2
+
3
+ `project.kind` (`web` · `api` · `cli` · `library` · `mobile` · `data` · `other`) tells the pipeline
4
+ what the repo **delivers**, so the spec's DoD, the review's checks and the design step fit it. It is
5
+ detected by `/cohorte-init-pipeline` (01) and confirmed there (02). **Absent ⇒ `web`** — the
6
+ behaviour every profile had before the field existed. The spec **`kind`** (`feature` · `patch` ·
7
+ `refactor`, front-matter) is a different axis: what one change *is*, not what the repo is.
8
+
9
+ **Read only your section.** `/cohorte-spec` (§9 defaults) and the review agent (checks) Grep `^## `
10
+ here and Read the one `## <kind>` range. On `web` the review agent does not open this file at all.
11
+
12
+ ### Detection (init 01) — first match wins, top to bottom
13
+
14
+ | signal | kind |
15
+ | --- | --- |
16
+ | `react-native`, `expo`, `*.xcodeproj` / `Package.swift` app target, Android `build.gradle` app, `flutter` | `mobile` |
17
+ | a browser UI framework (`react-dom`, next, vue, nuxt, svelte, angular…) in any app surface — even beside a `bin` or a server | `web` |
18
+ | `dbt_project.yml`, Airflow/Dagster/Prefect DAGs, a notebooks-first tree, warehouse SQL as the product | `data` |
19
+ | a `bin` entry (`package.json` `bin`, `[project.scripts]`, `cmd/*`, `[[bin]]`) and no UI deps | `cli` |
20
+ | a published package (`exports`/`main` + no `private: true`, a PyPI/crates manifest) with no app entry | `library` |
21
+ | a server framework (express, fastify, nestjs, adonis, django, fastapi, rails, net/http) and no UI | `api` |
22
+ | none of the above | `other` |
23
+
24
+ A mixed monorepo resolves to the **first row it matches** (an app with a UI is `web` even when it also
25
+ ships a CLI; web + mobile apps ⇒ `mobile`, whose checks include web's). Mobile comes first because
26
+ every react-native app also depends on `react`. The kind also decides two init defaults: where the design row below says **no**, init
27
+ sets `design.enabled: false` and every `uses_design: false`, and skips the design question; where
28
+ RBAC is **no**, it defaults `rbac.enabled: false`. The build gate, `/cohorte-align-ds` and spec §8
29
+ already key off those flags — nothing else reads the kind for design.
30
+
31
+ | kind | design step | RBAC / mobile-first checks (review 5–6) |
32
+ | --- | --- | --- |
33
+ | `web` | yes | RBAC if `rbac.enabled`; mobile-first if `uses_design` |
34
+ | `mobile` | yes | RBAC if `rbac.enabled`; screen-size + platform layout if `uses_design` |
35
+ | `api` | no | RBAC if `rbac.enabled`; no mobile-first |
36
+ | `cli` · `library` · `data` · `other` | no | neither |
37
+
38
+ ## web
39
+
40
+ - **DoD:** the spec template's five lines as they are — nothing to add.
41
+ - **Review:** checks 5–6 exactly as the agent states them. No extra checks.
42
+
43
+ ## api
44
+
45
+ - **DoD** (add): `- [ ] No breaking change to an existing endpoint (removed field, narrowed type, new required input, changed status) — or the version bump / deprecation is stated`
46
+ · `- [ ] Error responses follow the existing envelope and status conventions`.
47
+ Drop the mobile-first line.
48
+ - **Review:** skip 6. Add **API compatibility** — a diff that removes or renames a response field,
49
+ tightens a request type, adds a required parameter or changes a status code on an existing route is
50
+ a CRITICAL `spec-violation` unless the spec states the break.
51
+
52
+ ## cli
53
+
54
+ - **DoD** (add): `- [ ] --help text covers every new flag/subcommand` · `- [ ] Exit codes documented and tested (0 success, non-zero per failure class)`
55
+ · `- [ ] Results on stdout, diagnostics on stderr — nothing else on stdout`. Drop the mobile-first line.
56
+ - **Review:** skip 5–6. Add **CLI discipline** — a new flag missing from `--help`, an error path that
57
+ exits 0, or log/progress output on stdout is a HIGH `quality` finding; a renamed or removed flag is a
58
+ CRITICAL break unless the spec states it.
59
+
60
+ ## library
61
+
62
+ - **DoD** (add): `- [ ] Every new public export documented (doc comment or README)` · `- [ ] Semver impact stated (patch / minor / major)`
63
+ · `- [ ] No breaking change to the public API without a major bump`. Drop the mobile-first line and
64
+ the `ui_language` line.
65
+ - **Review:** skip 5–6. Add **public-API compatibility** — a removed/renamed export, a narrowed
66
+ parameter type or a changed return shape is a CRITICAL `spec-violation` unless the spec states a
67
+ major bump; an undocumented new export is MEDIUM.
68
+
69
+ ## mobile
70
+
71
+ - **DoD** (add): `- [ ] Platform matrix stated and covered (iOS / Android, min OS versions)` · `- [ ] Offline / flaky-network behaviour defined`
72
+ · `- [ ] New permissions declared and requested at point of use`. Replace the mobile-first line with
73
+ `- [ ] Layout holds on the smallest supported screen`.
74
+ - **Review:** 5 as stated; 6 reads as small-screen/safe-area layout rather than `sm:/md:` breakpoints.
75
+ Add — a permission used without its manifest/Info.plist entry, or a network call with no offline or
76
+ error state, is a HIGH `quality` finding.
77
+
78
+ ## data
79
+
80
+ - **DoD** (add): `- [ ] Idempotent — a re-run produces the same result, no duplicates` · `- [ ] Backfill path stated (or "not needed" and why)`
81
+ · `- [ ] Schema evolution is additive; downstream consumers named`. Drop the mobile-first line.
82
+ - **Review:** skip 5–6. Add — a non-idempotent write (plain `INSERT` with no merge key, append without
83
+ dedupe), a dropped/renamed column with downstream readers, or a model with no test/assertion is a
84
+ HIGH `quality` finding (CRITICAL when it loses data).
85
+
86
+ ## other
87
+
88
+ - **DoD:** the template's lines minus mobile-first; add what the spec's §1 makes verifiable.
89
+ - **Review:** skip 5–6. No extra checks.
@@ -0,0 +1,17 @@
1
+ ## Readiness — the gate between a frozen spec and N implementers
2
+
3
+ `/cohorte-build` §1.6 scores the frozen spec on **implementability** before authoring the contract and before
4
+ dispatching anything, and writes `specs/reports/<id>.readiness.json`
5
+ (`verdict`: `READY` · `RESERVATIONS` · `NOT-READY`, plus `gaps[]`). It costs **zero extra agents** — the
6
+ lead already holds the spec, the profile and the reconciled surface list — which is the whole economics
7
+ of the step: a spec that cannot be built does not get cheaper by being built on N surfaces in parallel.
8
+
9
+ - Five checks: contract completeness · surface coverage · dependencies exist · residual ambiguity ·
10
+ the design gate. Each maps to `NOT-READY` (a surface would have to invent the answer) or
11
+ `RESERVATIONS` (a surface can proceed on a stated assumption).
12
+ - **`NOT-READY` aborts the build with no agent spawned** and sends the human to `/cohorte-spec`.
13
+ A driver reads the same file and must stop rather than retry — it is the one outcome more passes
14
+ cannot fix.
15
+ - **`RESERVATIONS` never blocks.** Each gap is inlined verbatim into the dispatch of the surface it
16
+ affects, as an assumption the implementer must apply *and* flag in its handoff. A gate that stalled a
17
+ sound build on a missing error case would cost more human round-trips than it saves.