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.
- package/CHANGELOG.md +105 -0
- package/README.md +16 -10
- package/bin/cli.js +2 -1
- package/core/agents/cohorte-profile-reader.md +21 -31
- package/core/agents/cohorte-release.md +6 -3
- package/core/agents/cohorte-review.md +31 -5
- package/core/agents/implementer.template.md +13 -5
- package/core/commands/cohorte-audit.md +10 -3
- package/core/commands/cohorte-brainstorm.md +2 -2
- package/core/commands/cohorte-build.md +17 -10
- package/core/commands/cohorte-doctor.md +11 -9
- package/core/commands/cohorte-fix.md +2 -2
- package/core/commands/cohorte-fleet.md +1 -1
- package/core/commands/cohorte-init-pipeline.md +2 -2
- package/core/commands/cohorte-intake.md +3 -3
- package/core/commands/cohorte-patch.md +1 -1
- package/core/commands/cohorte-refactor.md +73 -8
- package/core/commands/cohorte-retro.md +2 -2
- package/core/commands/cohorte-revert.md +104 -0
- package/core/commands/cohorte-review.md +29 -14
- package/core/commands/cohorte-ship.md +17 -5
- package/core/commands/cohorte-spec.md +11 -2
- package/core/commands/cohorte-update-pipeline.md +12 -8
- package/core/commands/cohorte-verify.md +106 -0
- package/core/hooks/gate.py +326 -21
- package/core/templates/patch.template.md +11 -2
- package/core/templates/spec.template.md +23 -2
- package/core/templates/steps/init-pipeline/01-detect-stack.md +14 -5
- package/core/templates/steps/init-pipeline/02-interview-gaps.md +26 -3
- package/core/templates/steps/init-pipeline/03-draft-profile.md +2 -1
- package/core/templates/steps/init-pipeline/04-write-render.md +16 -12
- package/core/templates/steps/init-pipeline/05-report.md +1 -1
- package/core/workflows/audit.js +9 -4
- package/core/workflows/loop.js +15 -10
- package/core/workflows/refactor.js +116 -9
- package/core/workflows/review.js +24 -10
- package/lib/doctor.js +37 -3
- package/lib/install.js +11 -2
- package/lib/project.js +45 -8
- package/lib/render.js +3 -3
- package/lib/yaml.js +10 -1
- package/package.json +2 -2
- package/profile/PIPELINE.template.md +39 -1
- package/profile/SCHEMA.md +27 -746
- package/profile/cohorte.config.template.yaml +1 -1
- package/profile/schema/dead-agents.md +29 -0
- package/profile/schema/decisions.md +23 -0
- package/profile/schema/deferred.md +22 -0
- package/profile/schema/feature-diff.md +20 -0
- package/profile/schema/kanban.md +95 -0
- package/profile/schema/metrics.md +23 -0
- package/profile/schema/output-discipline.md +21 -0
- package/profile/schema/preflight.md +81 -0
- package/profile/schema/profile-block.md +103 -0
- package/profile/schema/project-kinds.md +89 -0
- package/profile/schema/readiness.md +17 -0
- package/profile/schema/reconcile.md +64 -0
- package/profile/schema/release-notes.md +29 -0
- package/profile/schema/rendering.md +48 -0
- package/profile/schema/retrieval.md +58 -0
- package/profile/schema/spec-status.md +79 -0
- package/profile/schema/specialization.md +41 -0
- package/profile/schema/verify.md +115 -0
- package/profile/schema/workflows.md +78 -0
- package/scripts/kanban-move.sh +45 -3
- package/scripts/verify-run.sh +509 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,111 @@ short, user-facing, most recent first. One `## <version> — <YYYY-MM-DD>` secti
|
|
|
7
7
|
> They are history and are deliberately not rewritten — every command gained a `cohorte-` prefix
|
|
8
8
|
> in 2.0.0.
|
|
9
9
|
|
|
10
|
+
## 3.1.0 — 2026-11-16
|
|
11
|
+
|
|
12
|
+
- **The schema is split: one file per topic, each command loads only what it cites.**
|
|
13
|
+
`SCHEMA.md` (≈750 lines, ≈15k tokens) was read whole by any prompt that named one of its
|
|
14
|
+
sections. Its content now lives, unchanged, in `<core>/pipeline/schema/<topic>.md`
|
|
15
|
+
(`profile-block`, `spec-status`, `kanban`, `dead-agents`, `reconcile`, `workflows`, …), and
|
|
16
|
+
every command, agent, template and workflow cites the exact file. `SCHEMA.md` stays as a short
|
|
17
|
+
index. `validate-core` fails on a citation that resolves nowhere and on any bare `SCHEMA.md §…`.
|
|
18
|
+
- **`.claude/profile.json` — the profile's machine block, parsed once.** `cohorte sync` (and so
|
|
19
|
+
`/cohorte-init-pipeline` and `/cohorte-update-pipeline`) now writes the `yaml pipeline-profile`
|
|
20
|
+
block of `PIPELINE.md` to `.claude/profile.json`. **Commit it**; every sync regenerates it, and the
|
|
21
|
+
commands that edit the machine block (`/cohorte-build` adding a surface, the update's top-up) re-run
|
|
22
|
+
sync afterwards. No `PIPELINE.md`, or no parseable block ⇒ nothing is written and sync says so.
|
|
23
|
+
The implementers, `cohorte-review` and `cohorte-release` read it instead of the whole profile
|
|
24
|
+
(falling back to the fenced block when it is absent), and the workflows' `cohorte-profile-reader`
|
|
25
|
+
phase 0 is now a single Read of it. `cohorte doctor` gains a `profile-json` row: missing, stale or
|
|
26
|
+
hand-edited (compared byte for byte with a fresh parse) or uncommitted ⇒ warn, fix `cohorte sync`.
|
|
27
|
+
The installer ships `lib/yaml.js` next to `lib/project.js` so sync and doctor share one parser.
|
|
28
|
+
- **A refactor now has a way to a PR.** `/cohorte-refactor` (and the refactor workflow) ends a green
|
|
29
|
+
round by freezing it as one spec, `specs/refactor-<domains>-<date>.md` — `kind: refactor`, the
|
|
30
|
+
cleared backlog items as scope, "public behaviour preserved" + "all tests green" as DoD, no
|
|
31
|
+
contract — cuts the feature branch when you are on the default one, and routes to
|
|
32
|
+
`/cohorte-review <id>` → `/cohorte-ship <id>`. The reviewer checks behaviour preservation,
|
|
33
|
+
conventions and over-engineering instead of contract conformance. Ticked backlog lines carry
|
|
34
|
+
`· refactor:<id>`, and `/cohorte-audit` keeps them until that spec merges, so the work is not queued
|
|
35
|
+
twice. Red gates ⇒ no spec.
|
|
36
|
+
- **Refactor workflow: a retry round no longer turns an ungated domain green.** A domain with no gate
|
|
37
|
+
commands is unverified; round 1 said so, but the retry round's verifier answer replaced it.
|
|
38
|
+
- **`project.kind` — presets for non-web projects.** `web` · `api` · `cli` · `library` · `mobile` ·
|
|
39
|
+
`data` · `other`, detected by `/cohorte-init-pipeline` (bin entries, published exports,
|
|
40
|
+
react-native/expo, dbt/Airflow, server-only…) and confirmed there. It selects the spec's DoD
|
|
41
|
+
defaults (library: semver impact, no break without a major; cli: `--help`, exit codes,
|
|
42
|
+
stdout/stderr; data: idempotency, backfill, schema evolution; mobile: platform matrix, offline,
|
|
43
|
+
permissions), which review checks apply (mobile-first only for web/mobile, RBAC not for
|
|
44
|
+
cli/library/data, API compatibility for api/library), and whether the design step runs. Tables in
|
|
45
|
+
`profile/schema/project-kinds.md`; the reviewer reads only its kind's section. **Absent ⇒ `web`** —
|
|
46
|
+
existing profiles behave exactly as before (`/cohorte-update-pipeline` tops it up as `web`).
|
|
47
|
+
- **Surface ownership is enforced, not just reviewed.** The gate hook reads `.claude/profile.json`.
|
|
48
|
+
When a call comes from a subagent (its payload carries `agent_id`) whose `agent_type` is a
|
|
49
|
+
surface's `agent`, a `Write`/`Edit`/`MultiEdit`/`NotebookEdit` outside that surface's `path` is
|
|
50
|
+
**denied**, and the reason names the surface that owns the file. Two new optional lists widen
|
|
51
|
+
what it may write: per-surface `owns_also: []` and global `ownership.shared_writable: []` (for
|
|
52
|
+
lockfiles, say). The contract (`contract.path`, `contract.index`) is read-only to every surface
|
|
53
|
+
agent. The agent's Bash writes get the same check, **best effort**: redirections,
|
|
54
|
+
`cp`/`mv`/`rm`, `tee` and `sed -i` are checked, while files a tool or script writes on its own are not.
|
|
55
|
+
The lead, the fixed `cohorte-*` agents and unknown agent types are never restricted. Without
|
|
56
|
+
`profile.json`, or with `ownership.enforce: false`, nothing changes. Targets in a linked
|
|
57
|
+
worktree resolve against that worktree, and paths outside the project (`/dev/null`, `$TMPDIR`)
|
|
58
|
+
are not judged. It is **on by default** from the first `cohorte sync` after upgrading (that sync
|
|
59
|
+
also registers the hook for `NotebookEdit`). Verified on Claude Code 2.1.325: a subagent's
|
|
60
|
+
`Write` reaches the hook with its `agent_id` and `agent_type`. Not verified yet for implementers
|
|
61
|
+
dispatched by the *workflows* — if they lack those fields, their writes are judged as the lead's.
|
|
62
|
+
Before upgrading, check what each surface writes outside its tree (root `tests/`, a generated
|
|
63
|
+
client, the root lockfile): `/cohorte-update-pipeline` proposes them as `owns_also` /
|
|
64
|
+
`ownership.shared_writable`, and `ownership.enforce: false` turns the check off.
|
|
65
|
+
- **Dependency and secret scans in the review preflight: `commands.security: []`.** The commands
|
|
66
|
+
run after typecheck, lint and tests, in the same `preflight.sh` call and report, behind a
|
|
67
|
+
`: cohorte-security-scans` marker. A red scan aborts the review before any agent is spawned,
|
|
68
|
+
like a red test. On a green run the reviewer's security pass reads the scan output below the
|
|
69
|
+
threshold. An advisory on a dependency the diff adds or bumps becomes a non-blocking `quality`
|
|
70
|
+
finding. One on an untouched dependency is ignored. `/cohorte-init-pipeline` detects the scanners and proposes
|
|
71
|
+
them: `npm`/`pnpm`/`yarn` audit (production deps, high+), `pip-audit`, `govulncheck`,
|
|
72
|
+
`cargo audit`, and `gitleaks` or `trufflehog` on the added lines of the feature's
|
|
73
|
+
`feature-diff.sh --patch`, never the history. The workflow now single-quotes any check that
|
|
74
|
+
contains `$`, so the calling shell no longer expands a check's own variables. The release
|
|
75
|
+
agent's `.env` check is unchanged.
|
|
76
|
+
|
|
77
|
+
- **`/cohorte-verify <id>` — the pipeline finally runs the app.** Between the `SHIP` verdict and
|
|
78
|
+
`/cohorte-ship`: migrations applied (and rolled back down-then-up) on the dev database, the dev
|
|
79
|
+
server started and probed, `smoke` / `e2e` run, screenshots taken when a local Playwright CLI
|
|
80
|
+
exists — all through the new shipped `verify-run.sh`, which owns the process group, the timeouts,
|
|
81
|
+
the shared-DB refusal and the gate consult, and stops the server on every exit path. It writes
|
|
82
|
+
`specs/reports/<id>.verify.json` and ticks only DoD lines tagged `· runtime: <check>` whose check
|
|
83
|
+
passed. New profile fields: `commands.dev_ready`, `commands.smoke`, `commands.e2e`,
|
|
84
|
+
`commands.migrate_down`, and a `verify:` block (`enabled`, `db`, timeouts, `screenshots`,
|
|
85
|
+
per-surface hints). See `profile/schema/verify.md`.
|
|
86
|
+
- **`/cohorte-ship` gains a runtime gate:** a `FAIL` verify blocks; no run, a `SKIPPED` one or one
|
|
87
|
+
older than the reviewed code asks "not verified at runtime — ship anyway?". A profile with no
|
|
88
|
+
runtime commands is not asked — and `commands.dev` alone does not count (it needs a
|
|
89
|
+
`commands.dev_ready` probe), so upgrading changes nothing until you fill those fields (neither
|
|
90
|
+
`/cohorte-init-pipeline` nor the reconcile asks for them yet). New specs' DoD carries
|
|
91
|
+
`· runtime` lines; `/cohorte-spec` drops the ones the project cannot check.
|
|
92
|
+
- **Migrations need a way back.** Specs gain `migrations:` in the front-matter and a `## Rollback`
|
|
93
|
+
section (revert · data · migration down); `/cohorte-spec` fills it when §4 touches the database,
|
|
94
|
+
and `/cohorte-ship` refuses a `migrations: true` spec whose Rollback is still the template stub
|
|
95
|
+
(`verify-run.sh rollback-check`). A rollback command your `gate.deny` blocks is never run — move it
|
|
96
|
+
to `gate.ask` to let the pipeline check it.
|
|
97
|
+
- **`/cohorte-revert <id>`** turns a merged feature into a revert branch + PR: the merge or squash
|
|
98
|
+
commit found via `gh`, the down migration run on a dev database while its files still exist, the
|
|
99
|
+
spec kept as history, `## Rollback` in the PR body. Never pushes to the default branch.
|
|
100
|
+
|
|
101
|
+
- **Kanban moves no longer get lost in parallel.** Worktrees moving cards on one board at the same
|
|
102
|
+
time could overwrite each other (2 of 8 concurrent moves vanished in a test); each move now takes a
|
|
103
|
+
lock on the board — `flock` where it exists (Linux), released by the kernel even if the writer
|
|
104
|
+
dies; elsewhere an atomic directory holding the writer's PID, broken only once that process is
|
|
105
|
+
gone (that fallback is exercised by the macOS CI job; Linux always uses flock). Exit 4 if a live
|
|
106
|
+
move keeps the board locked for ~30 s. Nothing is written next to the board.
|
|
107
|
+
- **The gate judges what `verify-run.sh` is asked to run**, and now also guards `NotebookEdit`.
|
|
108
|
+
- **An end-to-end test of the deterministic pipeline runs in CI** (install → sync → feature diff
|
|
109
|
+
with a new file → preflight → gate → kanban → uninstall), so a change on either side of a
|
|
110
|
+
prompt/script hand-off fails in CI rather than in a session.
|
|
111
|
+
- **Upgrading:** run `/cohorte-update-pipeline` in each project. It asks the three new questions
|
|
112
|
+
(security scans, runtime verification, project kind), writes `.claude/profile.json` — commit it —
|
|
113
|
+
and from then on the ownership check is active.
|
|
114
|
+
|
|
10
115
|
## 3.0.0 — 2026-11-16
|
|
11
116
|
|
|
12
117
|
**One install mode, Claude Code only.** The machine gets the commands and the generic core;
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ that degradation. Each one is a failure you have already had:
|
|
|
42
42
|
| --- | --- |
|
|
43
43
|
| *"It forgot what we decided."* | The spec is **frozen to disk** and re-read by every stateless agent. Nothing is remembered, so nothing is forgotten — and `/clear` between stages is always safe. |
|
|
44
44
|
| *"The API and the UI don't fit."* | The **contract is authored before any implementer is dispatched**. Surfaces import it read-only and never talk to each other — which is what makes building them in parallel safe. |
|
|
45
|
-
| *"It edited a file I didn't want it to."* | **One owner per tree**:
|
|
45
|
+
| *"It edited a file I didn't want it to."* | **One owner per tree, enforced**: the gate denies a surface agent's Write/Edit outside its own tree (and its writes to the contract); its Bash writes are checked best effort, and the review flags anything that slipped through. |
|
|
46
46
|
| *"It ran something it shouldn't have."* | The **gate** is a real blocking hook committed in the repo, branch-aware, parsing commands (not grepping them) to deny force-pushes, pushes to the default branch and the project's destructive commands — subagents included. It fails closed. It is a strong guard against agent mistakes, not a sandbox: keep GitHub branch protection as the hard boundary for the remote. |
|
|
47
47
|
| *"The review said it was fine."* | Review is a **separate read-only agent** that sees the spec and the diff, never the conversation that produced them. A dead reviewer's zero findings can't read as ship. |
|
|
48
48
|
| *"Four agents just told me it doesn't compile."* | A **deterministic preflight** runs typecheck/lint/tests first. Red ⇒ **zero agents spawned**. |
|
|
@@ -60,7 +60,7 @@ hook: **your app code never imports anything from Cohorte.**
|
|
|
60
60
|
| What | Holds | Lives in |
|
|
61
61
|
| --- | --- | --- |
|
|
62
62
|
| **The machine install** (`cohorte install`, once) | the 16 `/cohorte-*` commands, the `cohorte-review` / `cohorte-release` / `cohorte-profile-reader` agents, the workflow scripts, the generic core (templates, schema, scripts, the gate's source) — zero project facts | `~/.claude/commands/cohorte-*.md`, `~/.claude/agents/cohorte-*.md`, `~/.claude/workflows/cohorte-*.js`, `~/.claude/cohorte/` |
|
|
63
|
-
| **The project** (generated by `/cohorte-init-pipeline`, **committed**) | the profile (stack, surfaces, commands, conventions, gates), one implementer agent per surface, the gate hook and its registration, the version pointer, the specs | `PIPELINE.md`, `.claude/agents/<surface>.md`, `.claude/gate-config.json`, `.claude/hooks/cohorte-gate.py` + `.claude/settings.json`, `.claude/pipeline.json`, `specs/` |
|
|
63
|
+
| **The project** (generated by `/cohorte-init-pipeline`, **committed**) | the profile (stack, surfaces, commands, conventions, gates), one implementer agent per surface, the gate hook and its registration, the version pointer, the specs | `PIPELINE.md`, `.claude/agents/<surface>.md`, `.claude/gate-config.json`, `.claude/hooks/cohorte-gate.py` + `.claude/settings.json`, `.claude/pipeline.json`, `.claude/profile.json`, `specs/` |
|
|
64
64
|
| **You** | kanban board links + shared Obsidian vault path | `~/.claude/cohorte.config.yaml` |
|
|
65
65
|
|
|
66
66
|
Everything project-specific travels with `git clone` — **including the gate**: a teammate who clones
|
|
@@ -129,7 +129,9 @@ design system), **interviews** you for the gaps, and **generates**:
|
|
|
129
129
|
- `.claude/gate-config.json` + the `.claude/settings.json` permissions — plus an `allow` list of the
|
|
130
130
|
project's read-only commands so agents don't stall on permission prompts
|
|
131
131
|
- the **gate**, via `cohorte sync`: `.claude/hooks/cohorte-gate.py` registered in `.claude/settings.json`,
|
|
132
|
-
the `.claude/pipeline.json` pointer,
|
|
132
|
+
the `.claude/pipeline.json` pointer, `.claude/profile.json` (the profile's machine block parsed to
|
|
133
|
+
JSON, which agents read instead of the whole `PIPELINE.md`) and the `.gitignore` entries for the
|
|
134
|
+
local-only artifacts
|
|
133
135
|
- a **code-retrieval provider** wired as a committed project-scope MCP server —
|
|
134
136
|
[Serena](https://github.com/oraios/serena) by default (`graphify` or `none` via `retrieval.provider`)
|
|
135
137
|
- `scripts/new-feature.sh` + `remove-feature.sh` — parallel worktree isolation (if you enable it)
|
|
@@ -227,9 +229,11 @@ suite locally.
|
|
|
227
229
|
| `/cohorte-review <id>` | Read-only review agents (one per touched surface, parallel) audit the diff vs the spec; out-of-scope findings go to the refactor backlog. `--pr <num>` reviews an **incoming** GitHub PR in a throwaway worktree and offers to post the report as a comment. |
|
|
228
230
|
| `/cohorte-fix <id>` | Apply a review report: remediation into the spec, re-dispatch only the surfaces with findings. |
|
|
229
231
|
| `/cohorte-fleet plan\|status\|sync` | Fly several features in parallel: overlap matrix + merge order, one worktree per feature, live status, post-merge rebase sweep. Coordination only — never headless execution. |
|
|
232
|
+
| `/cohorte-verify <id>` | Start the app, run smoke/e2e (and migrations down-then-up on a dev DB), tick the runtime DoD items with evidence. Ship blocks on a FAIL. |
|
|
230
233
|
| `/cohorte-ship <id>` | Release agent commits, pushes, opens the PR; watches CI; proposes worktree teardown. |
|
|
234
|
+
| `/cohorte-revert <id>` | Revert a shipped feature through a PR (never pushed to the default branch), running its `## Rollback` down migration on a dev DB. |
|
|
231
235
|
| `/cohorte-audit [path]` | Prioritized refactor backlog for existing code. |
|
|
232
|
-
| `/cohorte-refactor <domain>` | Apply the backlog for one surface, TDD-first.
|
|
236
|
+
| `/cohorte-refactor <domain>` | Apply the backlog for one surface, TDD-first, then freeze the round as a `kind: refactor` spec that goes review → ship. |
|
|
233
237
|
| `/cohorte-retro [last n]` | Mine the accumulated review findings for patterns; ratified ones become §Conventions rules and the surface agents are re-rendered — the next build never produces the finding. |
|
|
234
238
|
| `/cohorte-align-ds` | Align the code UI kit to the design system (no-op if none configured). |
|
|
235
239
|
| `/cohorte-update-pipeline` | Refresh the machine install, re-wire this repo (`cohorte sync`) and reconcile its generated files. |
|
|
@@ -309,11 +313,11 @@ The essentials:
|
|
|
309
313
|
anything: whatever would have been a mid-run question lands in the result at the end. The
|
|
310
314
|
destructive-command gate still fires inside workflow subagents; in unattended runs its confirms
|
|
311
315
|
become denies.
|
|
312
|
-
- Phase 0 of every script is the `cohorte-profile-reader` agent (haiku) —
|
|
313
|
-
the script the profile as JSON, since workflow scripts have no filesystem access. Mechanical
|
|
316
|
+
- Phase 0 of every script is the `cohorte-profile-reader` agent (haiku) — one Read of
|
|
317
|
+
`.claude/profile.json` (`PIPELINE.md` as the fallback) hands the script the profile as JSON, since workflow scripts have no filesystem access. Mechanical
|
|
314
318
|
phases run on haiku; judgment phases use the same pinned agents as the commands.
|
|
315
319
|
|
|
316
|
-
Details: `profile/
|
|
320
|
+
Details: `profile/schema/workflows.md`.
|
|
317
321
|
|
|
318
322
|
## Privacy
|
|
319
323
|
|
|
@@ -331,7 +335,8 @@ or offer it as a network service, you must publish your modifications under the
|
|
|
331
335
|
|
|
332
336
|
## Profile reference
|
|
333
337
|
|
|
334
|
-
See `profile/
|
|
338
|
+
See `profile/schema/profile-block.md` for every field in `PIPELINE.md` and how the pipeline uses it. The
|
|
339
|
+
rest of the pipeline's rulebook sits next to it, one file per topic, indexed by `profile/SCHEMA.md`.
|
|
335
340
|
|
|
336
341
|
## Layout of this repo
|
|
337
342
|
|
|
@@ -340,7 +345,7 @@ package.json # npm package (cohorte) — semver source of truth; `npm
|
|
|
340
345
|
bin/cli.js # the CLI: install / update / sync / uninstall / doctor / specs / metrics / version
|
|
341
346
|
bin/report.js # the four renderings of `specs` / `doctor` (human, porcelain, json, panel)
|
|
342
347
|
lib/install.js # the machine install: manifest, ownership rules, 2.x migration, uninstall
|
|
343
|
-
lib/project.js # `cohorte sync`: wires one repo (
|
|
348
|
+
lib/project.js # `cohorte sync`: wires one repo (copied into the core with its one sibling, yaml.js)
|
|
344
349
|
lib/render.js # renders core/commands + core/agents for Claude Code (one preamble of path tokens)
|
|
345
350
|
lib/doctor.js # the JS port of /cohorte-doctor, + versions.js / yaml.js. No dependencies.
|
|
346
351
|
install.sh, install.ps1 # thin wrappers around bin/cli.js for installs without a global npm
|
|
@@ -352,7 +357,8 @@ core/
|
|
|
352
357
|
workflows/ # Workflow-runtime scripts: review / audit / refactor (opt-in variants) + loop (workflow-only)
|
|
353
358
|
profile/
|
|
354
359
|
PIPELINE.template.md # the profile skeleton /cohorte-init-pipeline fills
|
|
355
|
-
SCHEMA.md #
|
|
360
|
+
SCHEMA.md # index of schema/ — one line per topic file
|
|
361
|
+
schema/ # the rulebook, one file per topic (profile-block, spec-status, kanban, …)
|
|
356
362
|
cohorte.config.template.yaml # seeds ~/.claude/cohorte.config.yaml (kanban)
|
|
357
363
|
scripts/ # shipped preflight/kanban scripts, worktree-isolation templates, metrics, the test suites
|
|
358
364
|
```
|
package/bin/cli.js
CHANGED
|
@@ -185,10 +185,11 @@ Already-wired projects: run /cohorte-update-pipeline inside each to pick up th
|
|
|
185
185
|
const r = sync(project);
|
|
186
186
|
console.log(`cohorte sync — ${r.root} (core ${r.version})`);
|
|
187
187
|
if (r.changes.length) printList(r.changes); else console.log(' · already in sync');
|
|
188
|
+
if (r.notes && r.notes.length) printList(r.notes, '!');
|
|
188
189
|
if (!fs.existsSync(path.join(globalDir, 'cohorte', 'pipeline', 'VERSION'))) {
|
|
189
190
|
console.log(' ! cohorte is not installed on this machine — run `cohorte install` for the commands.');
|
|
190
191
|
}
|
|
191
|
-
if (r.changes.length) console.log(
|
|
192
|
+
if (r.changes.length) console.log(` Commit ${require('../lib/project.js').COMMIT_LIST}.`);
|
|
192
193
|
} else if (mode === 'uninstall') {
|
|
193
194
|
if (projectScope) {
|
|
194
195
|
const { unsync } = require('../lib/project.js');
|
|
@@ -1,50 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cohorte-profile-reader
|
|
3
|
-
description:
|
|
3
|
+
description: Returns this project's profile (the `yaml pipeline-profile` block of PIPELINE.md) as JSON — read straight from `.claude/profile.json`, which `cohorte sync` already parsed. Phase 0 of every cohorte workflow — workflow scripts have no filesystem or shell access, so this agent is how a script learns the profile (surfaces, commands, flags). Mechanical, read-only, no judgment.
|
|
4
4
|
tools: Read, Grep, Glob
|
|
5
5
|
model: haiku
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are the **profile-reader**. One job, purely mechanical:
|
|
9
|
-
|
|
10
|
-
return and parameterizes every later phase from it — so fidelity beats brevity, and prose beats
|
|
11
|
-
nothing only when something is wrong.
|
|
8
|
+
You are the **profile-reader**. One job, purely mechanical: hand a workflow script (which cannot
|
|
9
|
+
read files) this project's profile as JSON. Fidelity beats brevity.
|
|
12
10
|
|
|
13
11
|
## How
|
|
14
12
|
|
|
15
|
-
1. Read
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
1. **Read `.claude/profile.json`** at the repo root — one Read. It is the profile block already
|
|
14
|
+
parsed to JSON by `<sync>`. Present and a JSON object ⇒ return it **exactly as it is**: every key,
|
|
15
|
+
every value, nothing added, dropped or "fixed". Done — do not open `PIPELINE.md`.
|
|
16
|
+
2. **Only if that file is absent or not a JSON object** — fall back: read `PIPELINE.md`'s fenced
|
|
17
|
+
` ```yaml pipeline-profile ` block (the whole block, nothing after it) and convert it faithfully:
|
|
18
|
+
comments dropped, `true`/`false` booleans, numbers as numbers, `""` stays an empty string,
|
|
19
|
+
unfilled `<…>` placeholders pass through as literal strings.
|
|
20
|
+
3. Return **only** the JSON object — no fences, no commentary. Your final message is parsed by a script.
|
|
23
21
|
|
|
24
22
|
## Returning through a structured-output tool
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Do **not** serialize the profile to a string and nest it under a wrapper field. These are wrong:
|
|
31
|
-
|
|
32
|
-
```json
|
|
33
|
-
{"output": "{\"surfaces\": [ … ]}"} ← the profile as text under a wrapper
|
|
34
|
-
{"profile": {"surfaces": [ … ]}} ← the profile nested one level down
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
This is right:
|
|
24
|
+
The profile's own keys go at the **top level** of that tool's input — `surfaces`, `commands`,
|
|
25
|
+
`vcs`, `contract`, … as real JSON values. Never the profile serialized to a string or nested under
|
|
26
|
+
a wrapper:
|
|
38
27
|
|
|
39
28
|
```json
|
|
40
|
-
{"surfaces": [ … ]
|
|
29
|
+
{"output": "{\"surfaces\": [ … ]}"} ← wrong: the profile as text under a wrapper
|
|
30
|
+
{"profile": {"surfaces": [ … ]}} ← wrong: nested one level down
|
|
31
|
+
{"surfaces": [ … ], "commands": { … }, "vcs": { … }} ← right
|
|
41
32
|
```
|
|
42
33
|
|
|
43
|
-
A wrapped return
|
|
44
|
-
nothing, and reports success anyway.
|
|
34
|
+
A wrapped return makes the script read `surfaces` as absent, build nothing, and report success.
|
|
45
35
|
|
|
46
36
|
## Failure shape
|
|
47
37
|
|
|
48
|
-
If `PIPELINE.md` is missing
|
|
49
|
-
|
|
50
|
-
partial profile, never prose.
|
|
38
|
+
If `.claude/profile.json` is absent **and** `PIPELINE.md` is missing or its `yaml pipeline-profile`
|
|
39
|
+
fence is absent or unparseable, return exactly `{"error": "<one line: what is missing or broken>"}` —
|
|
40
|
+
never a partial profile, never prose.
|
|
@@ -9,8 +9,10 @@ You are the **release** agent. You run only after the human has a `SHIP` verdict
|
|
|
9
9
|
git/host ritual — drafting a good conventional commit + PR body from the spec and diff, then
|
|
10
10
|
committing, pushing, and opening the PR. You do **not** write features.
|
|
11
11
|
|
|
12
|
-
> **First action, always:** read
|
|
13
|
-
>
|
|
12
|
+
> **First action, always:** read `<state>/profile.json` (the profile's machine block, already parsed;
|
|
13
|
+
> absent ⇒ `PIPELINE.md` §`pipeline-profile`) → `vcs` (host, remote, default_branch,
|
|
14
|
+
> feature_branch_prefix), `release_notes` and `name`. Those drive the branch, PR base, and remote URL.
|
|
15
|
+
> Wherever this file says `PIPELINE.md` §`<field>`, it means that machine block.
|
|
14
16
|
|
|
15
17
|
## You must NEVER
|
|
16
18
|
|
|
@@ -41,7 +43,8 @@ committing, pushing, and opening the PR. You do **not** write features.
|
|
|
41
43
|
2. Stage the feature changes and write **conventional commit(s)**: `feat(<scope>): …` / `fix(<scope>): …`,
|
|
42
44
|
body summarizing what shipped, referencing `feature_id`. Scope from the domain. A spec whose
|
|
43
45
|
front-matter carries `kind: patch` is a bug fix — `fix(<scope>): …`, and the body states the
|
|
44
|
-
symptom it stops, not the code it changed.
|
|
46
|
+
symptom it stops, not the code it changed. A `kind: refactor` spec is `refactor(<scope>): …`, and
|
|
47
|
+
the body names the backlog items it cleared. End the commit body with:
|
|
45
48
|
`Co-Authored-By: Claude <noreply@anthropic.com>`
|
|
46
49
|
3. `git push -u origin <branch>` (plain push, no force).
|
|
47
50
|
4. Open the PR against `vcs.default_branch`:
|
|
@@ -10,10 +10,12 @@ You are **read-only by construction** — no Write, Edit, or Bash.
|
|
|
10
10
|
You never fix anything; you only report. Your output drives the human's fix loop, so it must
|
|
11
11
|
be precise and self-contained.
|
|
12
12
|
|
|
13
|
-
> **First action, always:** read
|
|
14
|
-
> `
|
|
15
|
-
>
|
|
16
|
-
>
|
|
13
|
+
> **First action, always:** read `<state>/profile.json` — the profile's machine block, already
|
|
14
|
+
> parsed (`surfaces`, `contract`, `rbac`, `design` flags); absent ⇒ read them from `PIPELINE.md`'s
|
|
15
|
+
> fenced `yaml pipeline-profile` block. Then in `PIPELINE.md` §Conventions read ONLY the `### Shared` stanza and the
|
|
16
|
+
> `### Surface: <your scope>` stanza for the surface you're reviewing (skip the others), plus §Testing
|
|
17
|
+
> — find their line numbers with one Grep for `^##` in `PIPELINE.md`, then Read only those ranges
|
|
18
|
+
> (offset/limit), never the whole file. These are your rulebook.
|
|
17
19
|
|
|
18
20
|
## Your inputs (supplied at dispatch — you have no memory)
|
|
19
21
|
|
|
@@ -49,9 +51,27 @@ be precise and self-contained.
|
|
|
49
51
|
first-class finding on a patch**: a correct, tidy improvement the spec did not ask for still
|
|
50
52
|
widens the blast radius of a change that is shipping fast, so report it rather than waving it
|
|
51
53
|
through. Genuinely-good-but-out-of-scope work is a **deferred** finding, exactly as elsewhere.
|
|
54
|
+
**On a `kind: refactor` spec** (written by `/cohorte-refactor` from cleared backlog items) there is
|
|
55
|
+
no contract: the spec is §6's backlog items + §9's DoD. Check instead that (a) **public behaviour is
|
|
56
|
+
preserved** — no exported signature, route, response shape, CLI flag, event or persisted format
|
|
57
|
+
changed unless an item marks it a bug, and no existing test was loosened or rewritten to fit the new
|
|
58
|
+
code (either is CRITICAL `spec-violation`); (b) each §6 item actually landed at its `file:line`
|
|
59
|
+
(claimed but not done ⇒ CRITICAL); (c) the diff stays inside §6 — scope creep is a finding, as on a
|
|
60
|
+
patch. Weigh §8 harder here: a refactor that *adds* a layer, an interface or a dependency is the
|
|
61
|
+
classic failure (same 5-finding cap and MEDIUM ceiling).
|
|
52
62
|
2. **Correctness.** Logic bugs, unhandled errors, validation gaps, auth holes, data exposure.
|
|
53
63
|
3. **Security.** Authz on every entry point, input validation, no secret/PII leakage, no injection.
|
|
54
|
-
(A security vulnerability blocks — §Severity & verdict.)
|
|
64
|
+
(A security vulnerability blocks — §Severity & verdict.) **If your dispatch names a preflight
|
|
65
|
+
report**, read its security section: Grep the report for the line `$ : cohorte-security-scans`
|
|
66
|
+
and Read from there to the end, never the whole report. Those scans already passed, because a
|
|
67
|
+
red scan aborts the review before you are spawned. What remains is output **below the
|
|
68
|
+
threshold the project chose**, and that choice is the human's, so none of it is a `security`
|
|
69
|
+
finding (a `security` finding means BLOCK). Report an advisory only when its dependency is
|
|
70
|
+
added or bumped by a manifest or lockfile hunk **in your own staged diff**. Report it as one
|
|
71
|
+
`quality` finding at HIGH or MEDIUM: `file:line` is that manifest line, and the fix names the
|
|
72
|
+
patched version. Ignore advisories on dependencies the diff doesn't touch. They are not this
|
|
73
|
+
feature's and not deferred either, because the scanner reports them again every round. Never
|
|
74
|
+
re-run a scanner.
|
|
55
75
|
4. **Conventions (`PIPELINE.md` §Conventions).** Enforce the per-surface rules the profile lists.
|
|
56
76
|
5. **RBAC** — _only if `rbac.enabled`_: no cross-role/cross-tenant exposure; least privilege on every route.
|
|
57
77
|
6. **Mobile-first / responsive** — _only if a surface has `uses_design: true`_: base styles small-screen,
|
|
@@ -73,6 +93,12 @@ be precise and self-contained.
|
|
|
73
93
|
coverage is not bloat, and "simpler" is never a reason to drop a spec'd behaviour. Deduplication
|
|
74
94
|
that would cross a surface boundary is out of bounds too — that's an architecture call, not a review one.
|
|
75
95
|
|
|
96
|
+
**Kind-specific checks — `project.kind` (profile; absent ⇒ `web`).** `web` ⇒ checks 5–6 as written,
|
|
97
|
+
nothing to read. Any other kind ⇒ Grep `^## ` in `<core>/pipeline/schema/project-kinds.md` and Read
|
|
98
|
+
ONLY your kind's section: its **Review** line says which of 5–6 still apply (each still behind its own
|
|
99
|
+
flag) and adds the kind's own checks (API / public-API compatibility, CLI discipline, idempotency…),
|
|
100
|
+
reported in the same finding shape. Never apply another kind's checks.
|
|
101
|
+
|
|
76
102
|
## Language checks (apply only those matching the surfaces under review)
|
|
77
103
|
|
|
78
104
|
Concrete, high-signal traps to grep for per language. A surface's language comes from its
|
|
@@ -9,8 +9,11 @@ You are the **<SURFACE_AGENT>** engineer for one feature of **<PROJECT_NAME>**.
|
|
|
9
9
|
statelessly, from the spec you are given. You cannot talk to the other surface agents — your only
|
|
10
10
|
shared surface is the frozen contract and the spec.
|
|
11
11
|
|
|
12
|
-
> **First action, always:** read
|
|
13
|
-
>
|
|
12
|
+
> **First action, always:** read `<state>/profile.json` — the profile's machine block (surfaces,
|
|
13
|
+
> contract, commands, gate), already parsed to JSON by `<sync>`; it is a fraction of `PIPELINE.md`.
|
|
14
|
+
> Only if it is absent, read `PIPELINE.md`'s fenced `yaml pipeline-profile` block instead (that block
|
|
15
|
+
> ONLY). Whenever this file says "in `PIPELINE.md`" about a field, it means that machine block. Do
|
|
16
|
+
> **not** read the prose sections
|
|
14
17
|
> (§Conventions/§Testing): your slice of them is baked into this file below (§Your conventions),
|
|
15
18
|
> rendered from the profile — re-reading the prose every dispatch is exactly the cost the bake
|
|
16
19
|
> removes. If the baked slice visibly contradicts `PIPELINE.md`, say so in your handoff: the profile
|
|
@@ -18,9 +21,14 @@ shared surface is the frozen contract and the spec.
|
|
|
18
21
|
|
|
19
22
|
## You own
|
|
20
23
|
|
|
21
|
-
`<SURFACE_PATH>/**` only. Everything under it
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
`<SURFACE_PATH>/**` only. Everything under it, and nothing outside it, except the paths the profile
|
|
25
|
+
lists in your surface's `owns_also` and in `ownership.shared_writable`. The gate hook enforces this
|
|
26
|
+
(unless `ownership.enforce` is `false`). A Write/Edit outside those paths is **denied**, and so is
|
|
27
|
+
any write to the contract (`contract.path`). Your Bash writes get the same check on a best-effort
|
|
28
|
+
basis: redirections, `cp`/`mv`/`rm` and `sed -i` are checked, but files a tool or script writes on
|
|
29
|
+
its own are not. Don't look for a way around a denial. If you need a change outside your tree,
|
|
30
|
+
put it in your handoff and the lead routes it. The reviewer still flags any file of yours that
|
|
31
|
+
lands outside your tree. Redirect logs outside the repo (`$TMPDIR`) or inside your own tree.
|
|
24
32
|
|
|
25
33
|
## Your conventions (baked from `PIPELINE.md` at render time)
|
|
26
34
|
|
|
@@ -8,10 +8,10 @@ You are the **lead**. Audit **$ARGUMENTS** (default: whole repo) to drive it to
|
|
|
8
8
|
analyze only — no fixes (those go through `/cohorte-refactor`).
|
|
9
9
|
|
|
10
10
|
> Read `PIPELINE.md` §`commands` (the mechanical gates), `surfaces`, and §Conventions — plus
|
|
11
|
-
> `specs/_decisions.md` §Live if it exists (
|
|
11
|
+
> `specs/_decisions.md` §Live if it exists (`<core>/pipeline/schema/decisions.md`): those standing decisions are part
|
|
12
12
|
> of the rulebook you audit against, and code that contradicts one is a finding like any other.
|
|
13
13
|
>
|
|
14
|
-
> **Workflow variant** (opt-in —
|
|
14
|
+
> **Workflow variant** (opt-in — `<core>/pipeline/schema/workflows.md`): on Claude Code ≥ 2.1.154 with workflows
|
|
15
15
|
> enabled, the human can ask to "run the audit workflow" (`<core>/workflows/audit.js` — one auditor
|
|
16
16
|
> per domain, concurrent). This conversational path stays the default and the fallback.
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ analyze only — no fixes (those go through `/cohorte-refactor`).
|
|
|
20
20
|
Run the profile's checks **scoped to `$ARGUMENTS`** when a path/domain is given (lint/format/typecheck
|
|
21
21
|
on that path, tests via that surface's `test_cmd`); repo-wide only for the default whole-repo audit.
|
|
22
22
|
Use the quiet variants (`commands.lint_quiet`/`test_quiet`, else the `2>&1 | tail -40` fallback —
|
|
23
|
-
|
|
23
|
+
`<core>/pipeline/schema/output-discipline.md`) and redirect every command's output into
|
|
24
24
|
`specs/reports/audit-gates.txt` in ONE call — truncate it first (`: > specs/reports/audit-gates.txt`,
|
|
25
25
|
so a previous run's output is never read as this one's), then per command
|
|
26
26
|
`printf '\n$ %s\n' "<cmd>" >> specs/reports/audit-gates.txt; <cmd> >> specs/reports/audit-gates.txt 2>&1`
|
|
@@ -63,5 +63,12 @@ and re-emit every **open** (`- [ ]`) match of that domain verbatim, tag included
|
|
|
63
63
|
put there by `/cohorte-review` §3.5 — a real finding a feature deliberately did not own — and an audit that
|
|
64
64
|
blindly overwrites a section is the one way they silently disappear. Already-ticked (`- [x]`) ones in a
|
|
65
65
|
rewritten section are done: drop them.
|
|
66
|
+
|
|
67
|
+
**Keep the in-flight refactor ticks** too: `/cohorte-refactor` §4 links what it cleared as
|
|
68
|
+
`- [x] … · refactor:<id>`, and until `specs/<id>.md` is `merged` that line is the backlog's only
|
|
69
|
+
pointer to where the work went (it is in review, or on an unmerged PR). So re-emit each such line
|
|
70
|
+
verbatim while its spec's `status` (one `grep '^status:'` per id) is not `merged`/`abandoned`, and
|
|
71
|
+
drop any new finding with the same `file` + problem (the fix is pending there, not missing). Spec
|
|
72
|
+
merged, abandoned or absent ⇒ drop the line like any ticked one — whatever survived is re-found.
|
|
66
73
|
Print a short summary (counts per domain + top items). Tell the human: refactor a domain with
|
|
67
74
|
`/cohorte-refactor <domain>`.
|
|
@@ -11,13 +11,13 @@ at Finish, when a board is configured.
|
|
|
11
11
|
> Read `PIPELINE.md` §Personas (the panel) and §`rbac` first. If `rbac.enabled`, the panel must
|
|
12
12
|
> pressure-test the idea so it serves **every** role, not just admins.
|
|
13
13
|
>
|
|
14
|
-
> Also read `specs/_decisions.md` §Live if it exists (
|
|
14
|
+
> Also read `specs/_decisions.md` §Live if it exists (`<core>/pipeline/schema/decisions.md`) — one line per standing
|
|
15
15
|
> decision. The panel argues about the idea, not about settled ground: a persona that proposes
|
|
16
16
|
> something a live line already decided must be told so by another persona, and an idea that genuinely
|
|
17
17
|
> needs to overturn one must say which line, out loud, so the human decides it here rather than
|
|
18
18
|
> discovering the contradiction at `/cohorte-spec`.
|
|
19
19
|
>
|
|
20
|
-
> **Kanban** (
|
|
20
|
+
> **Kanban** (`<core>/pipeline/schema/kanban.md`): every card move below is one call —
|
|
21
21
|
> `<core>/pipeline/scripts/kanban-move.sh auto <feature_id> <stage> [--title "<human title>"]`, with
|
|
22
22
|
> `auto` resolves the
|
|
23
23
|
> board from `<config>` itself and exits 0 with a `kanban: <reason>` line when
|
|
@@ -17,7 +17,7 @@ builds itself. Say which mode you ran in your last line.
|
|
|
17
17
|
> dispatch + their agent names), `contract` (mechanism + path), and the `design` flag. _Skip the
|
|
18
18
|
> re-read if it's already in your context this session and unmodified since._
|
|
19
19
|
>
|
|
20
|
-
> **Kanban** (
|
|
20
|
+
> **Kanban** (`<core>/pipeline/schema/kanban.md`): once §1 confirms the frozen spec, run
|
|
21
21
|
> `<core>/pipeline/scripts/kanban-move.sh auto $ARGUMENTS building`. `auto` resolves the board from the config itself and
|
|
22
22
|
> exits 0 with a `kanban: <reason>` line when there is none — so **never decide "no board is
|
|
23
23
|
> configured" without running it**. That inference, not a missing board, is what used to freeze
|
|
@@ -27,7 +27,7 @@ builds itself. Say which mode you ran in your last line.
|
|
|
27
27
|
|
|
28
28
|
- Check the spec front-matter FIRST — `grep '^status:' specs/$ARGUMENTS.md` (or Read with a ~15-line
|
|
29
29
|
limit) — before any full read. Buildable statuses are `frozen`, `in-review` and `in-progress`
|
|
30
|
-
(
|
|
30
|
+
(`<core>/pipeline/schema/spec-status.md`). `blocked` means a loop round gave up here: say so with the `reason` from
|
|
31
31
|
`specs/reports/$ARGUMENTS.loop.json` (a reason with no `outcome` is a resumable stop — re-running the
|
|
32
32
|
loop workflow resumes it), and route by the spec's `## Remediation` — open items ⇒ `/cohorte-fix`
|
|
33
33
|
(or `--readiness-only`, to hand them back to the loop), none ⇒ continue this build. `shipped` / `merged` / `abandoned` ⇒ done, say so and stop. Anything
|
|
@@ -40,6 +40,8 @@ builds itself. Say which mode you ran in your last line.
|
|
|
40
40
|
on `<default_branch>` run `git switch <prefix>$ARGUMENTS 2>/dev/null || git switch -c <prefix>$ARGUMENTS`
|
|
41
41
|
(uncommitted work carries over). `<prefix>` = `vcs.patch_branch_prefix` (else `fix/`) for
|
|
42
42
|
`kind: patch`, `vcs.feature_branch_prefix` otherwise. On some *other* branch ⇒ say which and ask.
|
|
43
|
+
- **`kind: refactor` ⇒ stop.** `/cohorte-refactor` already built it; it has no contract to author
|
|
44
|
+
and no implementer to dispatch. Say so and route to `/cohorte-review $ARGUMENTS`.
|
|
43
45
|
- **`kind: patch` in the front-matter ⇒ this is a bug fix** frozen by `/cohorte-patch`, and it is
|
|
44
46
|
built by this command like any other spec, with two differences called out where they apply: §1.6
|
|
45
47
|
judges it against its regression test instead of a contract, and §2 authors no contract unless §5
|
|
@@ -71,19 +73,21 @@ Map every area the spec touches (§5 contract + each surface's tasks + touched p
|
|
|
71
73
|
has no owner. Auto-detect it and propose a new surface for it.
|
|
72
74
|
- **Bottleneck area → specialize.** If one existing surface carries a large, cleanly-separable chunk of
|
|
73
75
|
this feature (e.g. a whole new feature-module) that would dominate build time, propose splitting that
|
|
74
|
-
chunk into its own specialized surface. Use the heuristic in
|
|
76
|
+
chunk into its own specialized surface. Use the heuristic in `<core>/pipeline/schema/specialization.md` — only when the
|
|
75
77
|
boundary is clean; skip when tangled or tiny.
|
|
76
78
|
|
|
77
79
|
For each surface to add: infer its `key`, `path`, `label`, `agent`, `tools`, `model`, `*_cmd`s, and
|
|
78
80
|
`uses_design` (mirror a sibling surface), show the human a one-line proposal, and on go-ahead **render it now** per
|
|
79
|
-
|
|
81
|
+
`<core>/pipeline/schema/rendering.md` — write the `surfaces[]` entry + §Conventions/§Testing
|
|
80
82
|
stanza into `PIPELINE.md`, render `<agents>/<agent>.md` from the implementer template, applying the
|
|
81
|
-
shared-code rule (shared trees get a single-owner surface; cross-slice shapes go through the contract)
|
|
83
|
+
shared-code rule (shared trees get a single-owner surface; cross-slice shapes go through the contract),
|
|
84
|
+
then run `<sync>` — implementers read `<state>/profile.json`, and until it is regenerated it lacks
|
|
85
|
+
the new surface.
|
|
82
86
|
This is the automatic path: you don't send the human back to `/cohorte-init-pipeline`. If nothing new is needed,
|
|
83
87
|
say so and continue. Dispatch (§3) then covers the reconciled surface list.
|
|
84
88
|
|
|
85
89
|
**Adding or splitting a surface is an architectural decision** — append ONE line for it to
|
|
86
|
-
`specs/_decisions.md` §Live (
|
|
90
|
+
`specs/_decisions.md` §Live (`<core>/pipeline/schema/decisions.md`; create from `<core>/templates/decisions.template.md`
|
|
87
91
|
if absent), area `surfaces`, e.g.
|
|
88
92
|
`- <date> · surfaces · <key> owns <path>, single owner of <what> — because <the boundary reason> · $ARGUMENTS`.
|
|
89
93
|
One `>>` in the Bash call you're already making. Nothing added ⇒ nothing to append.
|
|
@@ -200,7 +204,7 @@ tree. For each surface in `surfaces`:
|
|
|
200
204
|
|
|
201
205
|
A surface's work can die: a rate limit mid-run, a transport error after retries, context exhausted.
|
|
202
206
|
When it does, it returns **nothing** — and nothing is byte-identical to "a clean surface with nothing
|
|
203
|
-
to report". Silence is not a green light; treat it as the failure it is (
|
|
207
|
+
to report". Silence is not a green light; treat it as the failure it is (`<core>/pipeline/schema/dead-agents.md`).
|
|
204
208
|
|
|
205
209
|
- **Roll call.** Every surface handled in §3 must come back with a handoff in the format its
|
|
206
210
|
agent instructions define. Missing, empty, or truncated mid-sentence ⇒ that surface is **dead**.
|
|
@@ -232,10 +236,13 @@ anything went wrong. In the same call write the machine-readable batch result to
|
|
|
232
236
|
`specs/reports/$ARGUMENTS.build.json` (overwrite) — the channel an automated driver reads, since it
|
|
233
237
|
never sees your chat:
|
|
234
238
|
`{"id":"$ARGUMENTS","phase":"build","ts":"<ISO>","surfaces":{"<key>":"ok|error|dead",…},"dead":["<key>",…]}`
|
|
235
|
-
— this is the evidence
|
|
236
|
-
Then tell the human:
|
|
239
|
+
— this is the evidence `<core>/pipeline/schema/specialization.md` asks for before splitting a surface.
|
|
240
|
+
Then tell the human: run `/cohorte-review $ARGUMENTS`, and after its SHIP `/cohorte-verify $ARGUMENTS`
|
|
241
|
+
(when the profile has runtime commands — it runs the app and its migrations; until then exercise it
|
|
242
|
+
by hand if it's worth it) —
|
|
237
243
|
unless a surface is dead, in which case say so first and let them decide whether to re-run `/cohorte-build`
|
|
238
244
|
(a dead surface has no findings, so `/cohorte-fix` has nothing to re-dispatch).
|
|
239
|
-
Do not run the app or migrations yourself here — building is not running
|
|
245
|
+
Do not run the app or migrations yourself here — building is not running; that is `/cohorte-verify`'s
|
|
246
|
+
job, through its script.
|
|
240
247
|
**Recommend a `/clear` now** — the spec, contract and diff are all on
|
|
241
248
|
disk, and the lead's history is re-sent at input price on every turn it survives.
|