cohorte 3.0.0-dev.8 → 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 (251) hide show
  1. package/CHANGELOG.md +1637 -0
  2. package/README.md +322 -62
  3. package/bin/cli.js +213 -0
  4. package/bin/report.js +141 -0
  5. package/core/agents/cohorte-profile-reader.md +40 -0
  6. package/core/agents/cohorte-release.md +61 -0
  7. package/core/agents/cohorte-review.md +200 -0
  8. package/core/agents/implementer.template.md +154 -0
  9. package/core/commands/cohorte-align-ds.md +33 -0
  10. package/core/commands/cohorte-audit.md +74 -0
  11. package/core/commands/cohorte-brainstorm.md +73 -0
  12. package/core/commands/cohorte-build.md +248 -0
  13. package/core/commands/cohorte-doctor.md +135 -0
  14. package/core/commands/cohorte-fix.md +80 -0
  15. package/core/commands/cohorte-fleet.md +111 -0
  16. package/core/commands/cohorte-init-pipeline.md +30 -0
  17. package/core/commands/cohorte-intake.md +92 -0
  18. package/core/commands/cohorte-patch.md +118 -0
  19. package/core/commands/cohorte-refactor.md +122 -0
  20. package/core/commands/cohorte-retro.md +85 -0
  21. package/core/commands/cohorte-revert.md +104 -0
  22. package/core/commands/cohorte-review.md +239 -0
  23. package/core/commands/cohorte-ship.md +167 -0
  24. package/core/commands/cohorte-spec.md +114 -0
  25. package/core/commands/cohorte-update-pipeline.md +119 -0
  26. package/core/commands/cohorte-verify.md +106 -0
  27. package/core/hooks/gate.py +3236 -0
  28. package/core/templates/agent-handoff.md +34 -0
  29. package/core/templates/brainstorm-return.md +42 -0
  30. package/core/templates/decisions.template.md +42 -0
  31. package/core/templates/design-brief.md +37 -0
  32. package/core/templates/patch.template.md +95 -0
  33. package/core/templates/pr-body.md +25 -0
  34. package/core/templates/review-feedback.md +46 -0
  35. package/core/templates/spec.template.md +109 -0
  36. package/core/templates/steps/init-pipeline/01-detect-stack.md +53 -0
  37. package/core/templates/steps/init-pipeline/02-interview-gaps.md +78 -0
  38. package/core/templates/steps/init-pipeline/03-draft-profile.md +10 -0
  39. package/core/templates/steps/init-pipeline/04-write-render.md +95 -0
  40. package/core/templates/steps/init-pipeline/05-report.md +11 -0
  41. package/core/templates/steps/review-pr/01-pr-mode.md +54 -0
  42. package/core/workflows/audit.js +311 -0
  43. package/core/workflows/loop.js +692 -0
  44. package/core/workflows/refactor.js +398 -0
  45. package/core/workflows/review.js +505 -0
  46. package/install.ps1 +72 -0
  47. package/install.sh +69 -0
  48. package/lib/doctor.js +506 -0
  49. package/lib/install.js +386 -0
  50. package/lib/project.js +359 -0
  51. package/lib/render.js +121 -0
  52. package/lib/versions.js +145 -0
  53. package/lib/yaml.js +183 -0
  54. package/package.json +36 -17
  55. package/profile/PIPELINE.template.md +288 -0
  56. package/profile/SCHEMA.md +30 -0
  57. package/profile/cohorte.config.template.yaml +43 -0
  58. package/profile/schema/dead-agents.md +29 -0
  59. package/profile/schema/decisions.md +23 -0
  60. package/profile/schema/deferred.md +22 -0
  61. package/profile/schema/feature-diff.md +20 -0
  62. package/profile/schema/kanban.md +95 -0
  63. package/profile/schema/metrics.md +23 -0
  64. package/profile/schema/output-discipline.md +21 -0
  65. package/profile/schema/preflight.md +81 -0
  66. package/profile/schema/profile-block.md +103 -0
  67. package/profile/schema/project-kinds.md +89 -0
  68. package/profile/schema/readiness.md +17 -0
  69. package/profile/schema/reconcile.md +64 -0
  70. package/profile/schema/release-notes.md +29 -0
  71. package/profile/schema/rendering.md +48 -0
  72. package/profile/schema/retrieval.md +58 -0
  73. package/profile/schema/spec-status.md +79 -0
  74. package/profile/schema/specialization.md +41 -0
  75. package/profile/schema/verify.md +115 -0
  76. package/profile/schema/workflows.md +78 -0
  77. package/scripts/feature-diff.sh +118 -0
  78. package/scripts/kanban-move.sh +349 -0
  79. package/scripts/metrics/collect.mjs +542 -0
  80. package/scripts/metrics/prices.json +42 -0
  81. package/scripts/new-feature.sh.template +122 -0
  82. package/scripts/preflight.sh +114 -0
  83. package/scripts/remove-feature.sh.template +56 -0
  84. package/scripts/verify-run.sh +509 -0
  85. package/assets/manifest.json +0 -203
  86. package/assets/migrations/config/README.md +0 -12
  87. package/assets/migrations/state/0001_init.sql +0 -154
  88. package/assets/prompts/README.md +0 -11
  89. package/assets/prompts/agents/brainstormer.md +0 -3
  90. package/assets/prompts/agents/fixer.md +0 -7
  91. package/assets/prompts/agents/implementer.md +0 -12
  92. package/assets/prompts/agents/reviewer.md +0 -8
  93. package/assets/prompts/agents/security-reviewer.md +0 -7
  94. package/assets/prompts/agents/spec-author.md +0 -3
  95. package/assets/prompts/phases/build.md +0 -5
  96. package/assets/prompts/phases/review.md +0 -5
  97. package/assets/prompts/phases/test.md +0 -5
  98. package/assets/prompts/system.md +0 -11
  99. package/assets/schemas/agent-output.schema.json +0 -225
  100. package/assets/schemas/auth-status.schema.json +0 -87
  101. package/assets/schemas/command-result.schema.json +0 -192
  102. package/assets/schemas/commands.schema.json +0 -959
  103. package/assets/schemas/config.schema.json +0 -2281
  104. package/assets/schemas/doctor-report.schema.json +0 -104
  105. package/assets/schemas/events.schema.json +0 -8514
  106. package/assets/schemas/fake-script.schema.json +0 -549
  107. package/assets/schemas/inspect.schema.json +0 -3133
  108. package/assets/schemas/manifest.schema.json +0 -79
  109. package/assets/schemas/ownership.schema.json +0 -52
  110. package/assets/schemas/policy-verdict.schema.json +0 -282
  111. package/assets/schemas/project-model.schema.json +0 -783
  112. package/assets/schemas/project-status.schema.json +0 -217
  113. package/assets/schemas/reconcile-plan.schema.json +0 -154
  114. package/assets/schemas/run-diff.schema.json +0 -177
  115. package/assets/schemas/run-snapshot-manifest.schema.json +0 -2104
  116. package/assets/schemas/run-state.schema.json +0 -1755
  117. package/assets/schemas/runtime-capabilities.schema.json +0 -1545
  118. package/assets/schemas/sandbox-capabilities.schema.json +0 -116
  119. package/assets/schemas/skill.schema.json +0 -87
  120. package/assets/schemas/spec.schema.json +0 -202
  121. package/assets/schemas/tool-catalogue.schema.json +0 -655
  122. package/assets/schemas/trust-record.schema.json +0 -38
  123. package/assets/skills/README.md +0 -9
  124. package/assets/skills/inspect-surface.md +0 -4
  125. package/dist/agent-host.mjs +0 -2187
  126. package/dist/agent-host.mjs.map +0 -1
  127. package/dist/bundle-manifest.json +0 -128
  128. package/dist/chunks/__host-DgGPyco9.mjs +0 -18
  129. package/dist/chunks/__host-DgGPyco9.mjs.map +0 -1
  130. package/dist/chunks/align-ds-r_X_1aQ_.mjs +0 -93
  131. package/dist/chunks/align-ds-r_X_1aQ_.mjs.map +0 -1
  132. package/dist/chunks/approve-Cv135UqI.mjs +0 -19
  133. package/dist/chunks/approve-Cv135UqI.mjs.map +0 -1
  134. package/dist/chunks/audit-B4ZWQ_DI.mjs +0 -179
  135. package/dist/chunks/audit-B4ZWQ_DI.mjs.map +0 -1
  136. package/dist/chunks/auth-BT5oVp76.mjs +0 -132
  137. package/dist/chunks/auth-BT5oVp76.mjs.map +0 -1
  138. package/dist/chunks/auth-Dnlksuo5.mjs +0 -141
  139. package/dist/chunks/auth-Dnlksuo5.mjs.map +0 -1
  140. package/dist/chunks/brainstorm-SJwOIEif.mjs +0 -123
  141. package/dist/chunks/brainstorm-SJwOIEif.mjs.map +0 -1
  142. package/dist/chunks/build-C_-mbZfD.mjs +0 -19
  143. package/dist/chunks/build-C_-mbZfD.mjs.map +0 -1
  144. package/dist/chunks/cancel-KV_cpsqS.mjs +0 -15
  145. package/dist/chunks/cancel-KV_cpsqS.mjs.map +0 -1
  146. package/dist/chunks/canonical-C8UxeEmB.mjs +0 -57
  147. package/dist/chunks/canonical-C8UxeEmB.mjs.map +0 -1
  148. package/dist/chunks/catalogue-IaCJdfB8.mjs +0 -1549
  149. package/dist/chunks/catalogue-IaCJdfB8.mjs.map +0 -1
  150. package/dist/chunks/compose-DRKjQcn0.mjs +0 -7333
  151. package/dist/chunks/compose-DRKjQcn0.mjs.map +0 -1
  152. package/dist/chunks/config-Cqu5XQoP.mjs +0 -96
  153. package/dist/chunks/config-Cqu5XQoP.mjs.map +0 -1
  154. package/dist/chunks/contract-DjssDPpS.mjs +0 -335
  155. package/dist/chunks/contract-DjssDPpS.mjs.map +0 -1
  156. package/dist/chunks/contract-bQ9FJl4N.mjs +0 -123
  157. package/dist/chunks/contract-bQ9FJl4N.mjs.map +0 -1
  158. package/dist/chunks/deny-ClTxSvHJ.mjs +0 -15
  159. package/dist/chunks/deny-ClTxSvHJ.mjs.map +0 -1
  160. package/dist/chunks/diff-Qw0II0sj.mjs +0 -101
  161. package/dist/chunks/diff-Qw0II0sj.mjs.map +0 -1
  162. package/dist/chunks/discover-BZPolSZG.mjs +0 -21
  163. package/dist/chunks/discover-BZPolSZG.mjs.map +0 -1
  164. package/dist/chunks/doctor-DcDFPvQM.mjs +0 -222
  165. package/dist/chunks/doctor-DcDFPvQM.mjs.map +0 -1
  166. package/dist/chunks/fix-C9roGiQz.mjs +0 -82
  167. package/dist/chunks/fix-C9roGiQz.mjs.map +0 -1
  168. package/dist/chunks/fleet-yWHQY2ya.mjs +0 -297
  169. package/dist/chunks/fleet-yWHQY2ya.mjs.map +0 -1
  170. package/dist/chunks/gc-BBXlBF5w.mjs +0 -161
  171. package/dist/chunks/gc-BBXlBF5w.mjs.map +0 -1
  172. package/dist/chunks/init--FxxkrcT.mjs +0 -63
  173. package/dist/chunks/init--FxxkrcT.mjs.map +0 -1
  174. package/dist/chunks/inspect-Buby4cQD.mjs +0 -22
  175. package/dist/chunks/inspect-Buby4cQD.mjs.map +0 -1
  176. package/dist/chunks/intake-C1pesxCJ.mjs +0 -12
  177. package/dist/chunks/intake-C1pesxCJ.mjs.map +0 -1
  178. package/dist/chunks/logs-Giq5sUau.mjs +0 -25
  179. package/dist/chunks/logs-Giq5sUau.mjs.map +0 -1
  180. package/dist/chunks/loop-BWsUpyus.mjs +0 -212
  181. package/dist/chunks/loop-BWsUpyus.mjs.map +0 -1
  182. package/dist/chunks/migrate-DuYCAbE3.mjs +0 -33
  183. package/dist/chunks/migrate-DuYCAbE3.mjs.map +0 -1
  184. package/dist/chunks/models-Btp6X2YZ.mjs +0 -24
  185. package/dist/chunks/models-Btp6X2YZ.mjs.map +0 -1
  186. package/dist/chunks/obsidian-BHLkXx_H.mjs +0 -235
  187. package/dist/chunks/obsidian-BHLkXx_H.mjs.map +0 -1
  188. package/dist/chunks/patch-sAgVqjpx.mjs +0 -50
  189. package/dist/chunks/patch-sAgVqjpx.mjs.map +0 -1
  190. package/dist/chunks/pause-BASBfKLO.mjs +0 -16
  191. package/dist/chunks/pause-BASBfKLO.mjs.map +0 -1
  192. package/dist/chunks/policy-Du7WVBFX.mjs +0 -139
  193. package/dist/chunks/policy-Du7WVBFX.mjs.map +0 -1
  194. package/dist/chunks/providers-Dx78imKj.mjs +0 -19
  195. package/dist/chunks/providers-Dx78imKj.mjs.map +0 -1
  196. package/dist/chunks/reconcile-BHn66X3C.mjs +0 -50
  197. package/dist/chunks/reconcile-BHn66X3C.mjs.map +0 -1
  198. package/dist/chunks/refactor-DV3RfGjk.mjs +0 -153
  199. package/dist/chunks/refactor-DV3RfGjk.mjs.map +0 -1
  200. package/dist/chunks/render-DyZr5Lgi.mjs +0 -53
  201. package/dist/chunks/render-DyZr5Lgi.mjs.map +0 -1
  202. package/dist/chunks/resume-GJQRb2Eb.mjs +0 -15
  203. package/dist/chunks/resume-GJQRb2Eb.mjs.map +0 -1
  204. package/dist/chunks/retro-Dr-2RTNN.mjs +0 -78
  205. package/dist/chunks/retro-Dr-2RTNN.mjs.map +0 -1
  206. package/dist/chunks/retry-CLrUem1H.mjs +0 -15
  207. package/dist/chunks/retry-CLrUem1H.mjs.map +0 -1
  208. package/dist/chunks/review-ZsBqp3vZ.mjs +0 -35
  209. package/dist/chunks/review-ZsBqp3vZ.mjs.map +0 -1
  210. package/dist/chunks/run-BGabwbDL.mjs +0 -109
  211. package/dist/chunks/run-BGabwbDL.mjs.map +0 -1
  212. package/dist/chunks/run-tool-C3rAv4XF.mjs +0 -26
  213. package/dist/chunks/run-tool-C3rAv4XF.mjs.map +0 -1
  214. package/dist/chunks/scan-C5uDr7Yq.mjs +0 -167
  215. package/dist/chunks/scan-C5uDr7Yq.mjs.map +0 -1
  216. package/dist/chunks/schema-Bq9qtgsd.mjs +0 -583
  217. package/dist/chunks/schema-Bq9qtgsd.mjs.map +0 -1
  218. package/dist/chunks/send-BdnJ85Nz.mjs +0 -19
  219. package/dist/chunks/send-BdnJ85Nz.mjs.map +0 -1
  220. package/dist/chunks/ship-BizfUe62.mjs +0 -140
  221. package/dist/chunks/ship-BizfUe62.mjs.map +0 -1
  222. package/dist/chunks/shutdown-BM92Iyv2.mjs +0 -15
  223. package/dist/chunks/shutdown-BM92Iyv2.mjs.map +0 -1
  224. package/dist/chunks/skip-DZG5kpcH.mjs +0 -18
  225. package/dist/chunks/skip-DZG5kpcH.mjs.map +0 -1
  226. package/dist/chunks/spec-C2h3U64g.mjs +0 -65
  227. package/dist/chunks/spec-C2h3U64g.mjs.map +0 -1
  228. package/dist/chunks/spec-path-tptqR7W8.mjs +0 -10
  229. package/dist/chunks/spec-path-tptqR7W8.mjs.map +0 -1
  230. package/dist/chunks/src-Bfr1yzsn.mjs +0 -1689
  231. package/dist/chunks/src-Bfr1yzsn.mjs.map +0 -1
  232. package/dist/chunks/src-CPW2_Ons.mjs +0 -5487
  233. package/dist/chunks/src-CPW2_Ons.mjs.map +0 -1
  234. package/dist/chunks/src-Cu3TxNob.mjs +0 -783
  235. package/dist/chunks/src-Cu3TxNob.mjs.map +0 -1
  236. package/dist/chunks/src-DNsLSxgm.mjs +0 -928
  237. package/dist/chunks/src-DNsLSxgm.mjs.map +0 -1
  238. package/dist/chunks/src-DbS9gkJy.mjs +0 -117
  239. package/dist/chunks/src-DbS9gkJy.mjs.map +0 -1
  240. package/dist/chunks/src-yi5whv3n.mjs +0 -2118
  241. package/dist/chunks/src-yi5whv3n.mjs.map +0 -1
  242. package/dist/chunks/status-SMjiOMYy.mjs +0 -29
  243. package/dist/chunks/status-SMjiOMYy.mjs.map +0 -1
  244. package/dist/chunks/tail-BuhT-2PH.mjs +0 -25
  245. package/dist/chunks/tail-BuhT-2PH.mjs.map +0 -1
  246. package/dist/chunks/update-BXIppsbi.mjs +0 -16
  247. package/dist/chunks/update-BXIppsbi.mjs.map +0 -1
  248. package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs +0 -56
  249. package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs.map +0 -1
  250. package/dist/cli.mjs +0 -186
  251. package/dist/cli.mjs.map +0 -1
package/lib/yaml.js ADDED
@@ -0,0 +1,183 @@
1
+ 'use strict';
2
+ // Minimal block-YAML parser — just enough for the `yaml pipeline-profile` block in PIPELINE.md.
3
+ // Deliberately dependency-free (keeps the published package zero-dep). Handles:
4
+ // key: value · nested maps (indent) · block sequences (- item / - key: val) ·
5
+ // flow arrays [a, b] · flow maps { a: 1 } · quoted scalars (with \" \\ \n escapes) ·
6
+ // #-comments · bool/int/float coercion · indentless sequences (`key:` then `- a` at the same
7
+ // indent) · `|` / `>` block scalars.
8
+ // A `key: value` pair needs a colon followed by a space (or the end of the line), as in YAML:
9
+ // `- db:wipe` and `- http://x` are scalars, not one-key maps.
10
+ // NOT a general YAML implementation — anchors, tags, multi-document etc. are out of scope.
11
+
12
+ function stripComment(line) {
13
+ let q = null;
14
+ for (let i = 0; i < line.length; i++) {
15
+ const c = line[i];
16
+ if (q) { if (c === q) q = null; continue; }
17
+ if (c === '"' || c === "'") { q = c; continue; }
18
+ // A '#' starts a comment only at line start or after whitespace (YAML rule).
19
+ if (c === '#' && (i === 0 || /\s/.test(line[i - 1]))) return line.slice(0, i);
20
+ }
21
+ return line;
22
+ }
23
+
24
+ function splitTopLevel(s) {
25
+ const out = [];
26
+ let depth = 0, q = null, cur = '';
27
+ for (let i = 0; i < s.length; i++) {
28
+ const c = s[i];
29
+ if (q) { cur += c; if (c === q) q = null; continue; }
30
+ if (c === '"' || c === "'") { q = c; cur += c; continue; }
31
+ if (c === '[' || c === '{') { depth++; cur += c; continue; }
32
+ if (c === ']' || c === '}') { depth--; cur += c; continue; }
33
+ if (c === ',' && depth === 0) { out.push(cur); cur = ''; continue; }
34
+ cur += c;
35
+ }
36
+ if (cur.trim() !== '') out.push(cur);
37
+ return out;
38
+ }
39
+
40
+ function scalar(raw) {
41
+ const v = raw.trim();
42
+ if (v === '') return null;
43
+ if (v[0] === '[') {
44
+ const inner = v.slice(1, v.lastIndexOf(']'));
45
+ return inner.trim() === '' ? [] : splitTopLevel(inner).map(scalar);
46
+ }
47
+ if (v[0] === '{') {
48
+ const inner = v.slice(1, v.lastIndexOf('}'));
49
+ const obj = {};
50
+ if (inner.trim() !== '') {
51
+ for (const pair of splitTopLevel(inner)) {
52
+ const idx = pair.indexOf(':');
53
+ if (idx === -1) continue;
54
+ obj[pair.slice(0, idx).trim()] = scalar(pair.slice(idx + 1));
55
+ }
56
+ }
57
+ return obj;
58
+ }
59
+ if (v.length >= 2 && v[0] === '"' && v[v.length - 1] === '"') {
60
+ return v.slice(1, -1).replace(/\\(["\\nt])/g, (_, c) => (c === 'n' ? '\n' : c === 't' ? '\t' : c));
61
+ }
62
+ if (v.length >= 2 && v[0] === "'" && v[v.length - 1] === "'") return v.slice(1, -1).replace(/''/g, "'");
63
+ if (v === 'true') return true;
64
+ if (v === 'false') return false;
65
+ if (v === 'null' || v === '~') return null;
66
+ if (/^-?\d+$/.test(v)) return parseInt(v, 10);
67
+ if (/^-?\d+\.\d+$/.test(v)) return parseFloat(v);
68
+ return v;
69
+ }
70
+
71
+ // Split "key: rest" on the first colon that is followed by a space or ends the line,
72
+ // outside quotes. A colon inside a value (a URL, `db:wipe`, a chained shell command) does
73
+ // not split. Callers never feed this a flow scalar (`[a, b]` / `{a: 1}`).
74
+ function keyValue(text) {
75
+ let q = null;
76
+ for (let i = 0; i < text.length; i++) {
77
+ const c = text[i];
78
+ if (q) { if (c === q) q = null; continue; }
79
+ if (c === '"' || c === "'") { if (i === 0) q = c; continue; }
80
+ if (c === ':' && (i + 1 === text.length || text[i + 1] === ' ')) {
81
+ const key = text.slice(0, i).trim().replace(/^(["'])(.*)\1$/, '$2');
82
+ return key ? { key, rest: text.slice(i + 1).trim() } : null;
83
+ }
84
+ }
85
+ return null;
86
+ }
87
+
88
+ const DASH = /^-(?:(\s+)(.*))?$/;
89
+
90
+ function parse(text) {
91
+ const lines = [];
92
+ for (const raw of text.split(/\r?\n/)) {
93
+ const stripped = stripComment(raw).replace(/\s+$/, '');
94
+ if (stripped.trim() === '') { lines.push({ blank: true, indent: Infinity, text: '', raw }); continue; }
95
+ lines.push({ indent: stripped.match(/^ */)[0].length, text: stripped.trim(), raw });
96
+ }
97
+ let pos = 0;
98
+ const skipBlank = () => { while (pos < lines.length && lines[pos].blank) pos++; };
99
+
100
+ // `|` keeps newlines, `>` folds them into spaces. Lines are taken RAW (comments are text).
101
+ function blockScalar(indent, style) {
102
+ const out = [];
103
+ let base = null;
104
+ while (pos < lines.length && (lines[pos].blank || lines[pos].indent > indent)) {
105
+ const raw = lines[pos].raw.replace(/\s+$/, '');
106
+ if (lines[pos].blank) out.push('');
107
+ else {
108
+ if (base === null) base = raw.match(/^ */)[0].length;
109
+ out.push(raw.slice(Math.min(base, raw.match(/^ */)[0].length)));
110
+ }
111
+ pos++;
112
+ }
113
+ while (out.length && out[out.length - 1] === '') out.pop();
114
+ return style.startsWith('|') ? out.join('\n') : out.join(' ').replace(/ {2,}/g, ' ').trim();
115
+ }
116
+
117
+ function block(indent) {
118
+ skipBlank();
119
+ const isSeq = DASH.test(lines[pos].text);
120
+ const result = isSeq ? [] : {};
121
+ while (pos < lines.length) {
122
+ skipBlank();
123
+ if (pos >= lines.length || lines[pos].indent < indent) break;
124
+ if (lines[pos].indent > indent) { pos++; continue; } // defensive: skip stray deeper line
125
+ const line = lines[pos];
126
+ const dash = line.text.match(DASH);
127
+ // A sequence ends at the first same-indent line that is not an item (an indentless
128
+ // sequence is followed by the next key of its parent map), and vice versa.
129
+ if (isSeq !== !!dash) break;
130
+
131
+ if (dash) {
132
+ const remainder = (dash[2] || '').trim();
133
+ const itemIndent = indent + 1 + (dash[1] ? dash[1].length : 1);
134
+ const kv = remainder && remainder[0] !== '[' && remainder[0] !== '{' ? keyValue(remainder) : null;
135
+ if (!remainder) {
136
+ pos++;
137
+ skipBlank();
138
+ result.push(pos < lines.length && lines[pos].indent > indent ? block(lines[pos].indent) : null);
139
+ } else if (kv && /^[\w.-]+$/.test(kv.key)) {
140
+ // A dash item that is `key: …` opens a nested map; realign so its keys share one indent.
141
+ lines[pos] = { ...line, indent: itemIndent, text: remainder };
142
+ result.push(block(itemIndent));
143
+ } else {
144
+ result.push(scalar(remainder));
145
+ pos++;
146
+ }
147
+ continue;
148
+ }
149
+
150
+ const kv = keyValue(line.text);
151
+ if (!kv) { pos++; continue; }
152
+ pos++;
153
+ if (/^[|>][-+]?$/.test(kv.rest)) { result[kv.key] = blockScalar(indent, kv.rest); continue; }
154
+ if (kv.rest !== '') { result[kv.key] = scalar(kv.rest); continue; }
155
+ skipBlank();
156
+ if (pos < lines.length && lines[pos].indent > indent) result[kv.key] = block(lines[pos].indent);
157
+ else if (pos < lines.length && lines[pos].indent === indent && DASH.test(lines[pos].text)) result[kv.key] = block(indent);
158
+ else result[kv.key] = null;
159
+ }
160
+ return result;
161
+ }
162
+
163
+ skipBlank();
164
+ return pos < lines.length ? block(lines[pos].indent) : {};
165
+ }
166
+
167
+ // Extract + parse the ```yaml pipeline-profile fenced block from a PIPELINE.md string.
168
+ function parseProfileBlock(md) {
169
+ const m = md.match(/```yaml pipeline-profile\r?\n([\s\S]*?)\r?\n```/);
170
+ if (!m) return null;
171
+ return parse(m[1]);
172
+ }
173
+
174
+ // The exact bytes `cohorte sync` writes to `.claude/profile.json` for a PIPELINE.md string, or null
175
+ // when there is no block / it parses to nothing. One serializer, shared by sync (the writer) and
176
+ // doctor (the freshness check), so the two can never disagree about what "fresh" means.
177
+ function profileJsonText(md) {
178
+ const profile = typeof md === 'string' ? parseProfileBlock(md) : null;
179
+ if (!profile || typeof profile !== 'object' || Array.isArray(profile) || !Object.keys(profile).length) return null;
180
+ return JSON.stringify(profile, null, 2) + '\n';
181
+ }
182
+
183
+ module.exports = { parse, parseProfileBlock, profileJsonText };
package/package.json CHANGED
@@ -1,29 +1,48 @@
1
1
  {
2
2
  "name": "cohorte",
3
- "version": "3.0.0-dev.8",
4
- "license": "AGPL-3.0-only",
5
- "type": "module",
3
+ "version": "3.1.0",
4
+ "description": "Multi-agent development pipeline for Claude Code — install it once, run /cohorte-init-pipeline in a repo, and it adapts to that project's stack.",
6
5
  "bin": {
7
- "cohorte": "dist/cli.mjs"
6
+ "cohorte": "bin/cli.js"
8
7
  },
9
8
  "files": [
10
- "dist",
11
- "assets"
9
+ "bin",
10
+ "lib",
11
+ "core",
12
+ "profile",
13
+ "scripts",
14
+ "!scripts/new-feature.sh",
15
+ "!scripts/remove-feature.sh",
16
+ "!scripts/demo",
17
+ "!scripts/test-*.mjs",
18
+ "!scripts/validate-core.mjs",
19
+ "!core/hooks/__pycache__",
20
+ "!**/*.pyc",
21
+ "install.sh",
22
+ "install.ps1",
23
+ "CHANGELOG.md"
12
24
  ],
13
- "engines": {
14
- "node": "^24.16.0 || >=26.1.0"
25
+ "scripts": {
26
+ "test": "node scripts/validate-core.mjs && node scripts/test-install.mjs && node scripts/test-gate.mjs && node scripts/test-lib.mjs && node scripts/test-workflows.mjs && node scripts/test-kanban.mjs && node scripts/test-metrics.mjs && node scripts/test-e2e.mjs && node scripts/test-verify.mjs"
15
27
  },
16
- "dependencies": {
17
- "commander": "15.0.0",
18
- "yaml": "2.9.1",
19
- "picomatch": "4.0.7",
20
- "typebox": "1.3.7",
21
- "@earendil-works/pi-coding-agent": "0.85.1",
22
- "@earendil-works/pi-ai": "0.85.1",
23
- "@earendil-works/pi-agent-core": "0.85.1"
28
+ "engines": {
29
+ "node": ">=20"
24
30
  },
25
31
  "repository": {
26
32
  "type": "git",
27
33
  "url": "git+https://github.com/TheBidouilleAgency/cohorte.git"
28
- }
34
+ },
35
+ "homepage": "https://github.com/TheBidouilleAgency/cohorte#readme",
36
+ "author": "Enzo Viry",
37
+ "license": "AGPL-3.0-only",
38
+ "keywords": [
39
+ "claude",
40
+ "claude-code",
41
+ "agents",
42
+ "subagents",
43
+ "pipeline",
44
+ "multi-agent",
45
+ "tdd",
46
+ "code-review"
47
+ ]
29
48
  }
@@ -0,0 +1,288 @@
1
+ # PIPELINE.md — <PROJECT_NAME> profile
2
+
3
+ > **Generated by `/cohorte-init-pipeline`.** This is the project profile: the single place the
4
+ > portable multi-agent pipeline reads for everything stack-specific. The pipeline core
5
+ > in the pipeline core is generic and references THIS file by section — keep project facts
6
+ > here, never hardcoded into agent prompts. Kept current by `/cohorte-update-pipeline` (reconcile:
7
+ > new fields are topped up, your values never overwritten). Rendered agent files are
8
+ > regenerated from this profile on every reconcile — customize agents through §Conventions
9
+ > here, never by editing the agent files. Free-form notes belong in `CLAUDE.md`.
10
+ >
11
+ > **Machine block first, prose after.** The fenced `yaml pipeline-profile` block below is
12
+ > the deterministic contract (flags, surfaces, commands) — commands parse it and branch on
13
+ > it. The prose sections carry conventions agents read.
14
+
15
+ ```yaml pipeline-profile
16
+ # ── identity ────────────────────────────────────────────────────────────────
17
+ name: <PROJECT_NAME>
18
+ one_liner: <one sentence: what this product is>
19
+ ui_language: <English | French | …> # language of ALL user-facing copy
20
+ package_manager: <pnpm | npm | yarn | bun | pip | cargo | go>
21
+
22
+ # ── project kind (what the repo delivers) ───────────────────────────────────
23
+ # Selects the spec DoD defaults, the review's kind-specific checks and whether
24
+ # the design step applies — see <core>/pipeline/schema/project-kinds.md.
25
+ project:
26
+ kind: <web | api | cli | library | mobile | data | other> # absent ⇒ web
27
+
28
+ # ── vcs ─────────────────────────────────────────────────────────────────────
29
+ vcs:
30
+ host: <github | gitlab | none>
31
+ remote: <owner/repo> # e.g. acme/webapp
32
+ default_branch: <main>
33
+ feature_branch_prefix: feature/ # branch = <prefix><feature_id>
34
+ patch_branch_prefix: fix/ # same, for /cohorte-patch specs (kind: patch)
35
+
36
+ # ── repo shape ──────────────────────────────────────────────────────────────
37
+ repo:
38
+ layout: <monorepo | single>
39
+ workspace_tool: <turborepo | nx | none>
40
+
41
+ # ── code retrieval (semantic navigation — cuts agent read time) ─────────────
42
+ # Agents prefer symbol/graph MCP queries over grep-and-read when a provider is
43
+ # wired. serena = live LSP symbol navigation (default, no index to maintain);
44
+ # graphify = persistent tree-sitter knowledge graph over code + docs (needs an
45
+ # index step + rescans); none = agents fall back to Grep/Glob/Read.
46
+ # Registered by /cohorte-init-pipeline in the project's .mcp.json.
47
+ retrieval:
48
+ provider: serena # serena | graphify | none
49
+
50
+ # ── surfaces ────────────────────────────────────────────────────────────────
51
+ # One entry per independently-implemented code area. /cohorte-build dispatches ONE
52
+ # implementer agent per surface, in parallel. Each surface is rendered by
53
+ # /cohorte-init-pipeline into its own agent file (agent field) with the tools listed.
54
+ # This list GROWS automatically: /cohorte-build §1.5 adds a surface (and renders its
55
+ # agent) when a spec touches a tree no surface owns, or splits a bottleneck
56
+ # surface into specialized sub-surfaces. Keep one owner per tree; shared code
57
+ # (routing/state/DS) is its own single-owner surface. See `<core>/pipeline/schema/specialization.md`.
58
+ surfaces:
59
+ - key: backend # short id, used as agent name + scope
60
+ path: apps/api # the ONLY tree this surface's agent may touch
61
+ label: backend (AdonisJS)
62
+ agent: backend # rendered to .claude/agents/backend.md (committed)
63
+ tools: [Read, Write, Edit, Bash, Grep, Glob, mcp__serena] # mcp__<provider> mirrors retrieval.provider
64
+ model: sonnet # frontmatter model tier: sonnet | haiku | inherit
65
+ # sonnet = default (applies the frozen contract — cheap
66
+ # vs the Opus lead); haiku = purely mechanical scaffolding;
67
+ # inherit = only for surfaces with real design decisions
68
+ test_cmd: pnpm --filter api test
69
+ # Bridled variants — what agents actually RUN (dot reporter / failures-only /
70
+ # --quiet), so a green run costs lines, not pages. "" ⇒ callers fall back to
71
+ # `<cmd> 2>&1 | tail -40`. /cohorte-init-pipeline asks for these; never store a bare
72
+ # `pnpm test` as the thing agents execute.
73
+ test_quiet_cmd: pnpm --filter api test --reporter=dot
74
+ lint_cmd: pnpm --filter api lint
75
+ lint_quiet_cmd: pnpm --filter api lint --quiet
76
+ format_cmd: pnpm --filter api format
77
+ typecheck_cmd: pnpm --filter api exec tsc --noEmit
78
+ build_cmd: ""
79
+ uses_design: false
80
+ - key: frontend
81
+ path: apps/web
82
+ label: frontend (React/TanStack)
83
+ agent: frontend
84
+ tools: [Read, Write, Edit, Bash, Grep, Glob, DesignSync, mcp__serena]
85
+ model: sonnet # default even for design surfaces — designs + contract are
86
+ # frozen inputs the agent applies; `inherit` (bills at the
87
+ # lead's tier, often Opus) ONLY if this surface must make
88
+ # novel design decisions
89
+ test_cmd: pnpm --filter web test
90
+ test_quiet_cmd: pnpm --filter web test --reporter=dot
91
+ lint_cmd: pnpm --filter web lint
92
+ lint_quiet_cmd: pnpm --filter web lint --quiet
93
+ format_cmd: pnpm --filter web format
94
+ typecheck_cmd: pnpm check-types
95
+ build_cmd: pnpm --filter web build
96
+ uses_design: true
97
+
98
+ # ── contract (the only cross-surface sync channel) ──────────────────────────
99
+ contract:
100
+ enabled: <true | false> # false ⇒ no shared contract; skip §2 of /cohorte-build
101
+ mechanism: <shared-types-zod | openapi | protobuf | json-schema | none>
102
+ path: packages/shared-types/src # where <feature_id>.<ext> is authored
103
+ ext: ts
104
+ index: packages/shared-types/src/index.ts # barrel to export from, or "" if none
105
+ authored_by: lead # NEVER the implementer agents
106
+
107
+ # ── surface ownership (enforced by the gate hook) ──────────────────────────
108
+ # A surface agent may write only under its surfaces[].path (+ an optional per-surface
109
+ # `owns_also: [db/migrations]`, + shared_writable below); contract.path is read-only to it.
110
+ # Write/Edit outside ⇒ denied; Bash writes ⇒ best effort. The lead is never restricted.
111
+ ownership:
112
+ enforce: true # false ⇒ back to convention + review only
113
+ shared_writable: [] # e.g. [pnpm-lock.yaml] — files every surface may touch
114
+
115
+ # ── release notes (optional) ────────────────────────────────────────────────
116
+ # A per-feature release note the project's versioning tool consumes. When
117
+ # enabled, /cohorte-ship authors it BEFORE dispatching the release agent, so it
118
+ # ships inside the release commit. Repos whose CI fails a PR that lacks one
119
+ # (Changesets' `changeset` job) MUST set this — otherwise every ship goes red.
120
+ release_notes:
121
+ enabled: <true | false> # false ⇒ /cohorte-ship §2b is a no-op
122
+ tool: <changesets | none> # what consumes the file
123
+ dir: .changeset # where the note is authored
124
+ filename: "<feature_id>.md" # one file per feature
125
+ anchor_package: shared-types # sole key in the front-matter; a lockstep/fixed group propagates the bump
126
+ language: <ui_language | English> # language of the note's prose
127
+ forbid_levels: [] # bumps project policy refuses, e.g. [major] while 0.x
128
+ empty_cmd: "pnpm changeset --empty" # when no version should move; "" if the tool has no such escape hatch
129
+ ci_job: changeset # CI job that fails when the note is missing (name it so /cohorte-ship §5 recognizes the red)
130
+ guidance: | # rules the lead follows when writing the note (project policy)
131
+ major = the deploy needs an operator action; minor = a user-visible capability;
132
+ patch = fix/perf/refactor with no change of use. No client names, no internal
133
+ paths, no exploitable attack vector.
134
+
135
+ # ── repo-wide commands (root unless noted) ──────────────────────────────────
136
+ commands:
137
+ install: pnpm install
138
+ dev: pnpm dev
139
+ lint: pnpm lint
140
+ lint_quiet: pnpm lint --quiet # bridled variant (see surfaces[].*_quiet_cmd)
141
+ format: pnpm format
142
+ typecheck: pnpm check-types
143
+ test: pnpm test
144
+ test_quiet: pnpm test --reporter=dot # bridled variant — what the /cohorte-review preflight runs
145
+ security: [] # dependency audit / feature-diff secret scan commands, run after tests (schema/preflight.md)
146
+ # migration commands — omit / leave "" if the project has no DB migrations
147
+ migrate: "cd apps/api && node ace migration:run"
148
+ make_migration: "cd apps/api && node ace make:migration"
149
+ # undo the last migration on the DEV db — /cohorte-verify checks down-then-up, /cohorte-revert
150
+ # runs it. A command in gate.deny is never run (e.g. migration:rollback below): move it to
151
+ # gate.ask to let the pipeline verify rollbacks. "" ⇒ rollback is not verified.
152
+ migrate_down: ""
153
+ # runtime verification (/cohorte-verify, <core>/pipeline/schema/verify.md) — `dev` counts only
154
+ # with a `dev_ready` probe; all "" ⇒ verify is skipped silently
155
+ dev_ready: "" # URL answering 2xx/3xx once `dev` is up, or a shell probe exiting 0 — e.g. "http://localhost:3333/health"
156
+ smoke: "" # quick checks against the running app, e.g. "curl -sf http://localhost:3333/health"
157
+ e2e: "" # e.g. "pnpm exec playwright test --reporter=line"
158
+
159
+ # ── runtime verification (optional — /cohorte-verify) ───────────────────────
160
+ # Runs the app between /cohorte-review and /cohorte-ship, through
161
+ # pipeline/scripts/verify-run.sh. See `<core>/pipeline/schema/verify.md`.
162
+ verify:
163
+ enabled: true # false ⇒ /cohorte-verify is a no-op and /cohorte-ship never asks
164
+ db: local # local = the dev DB is yours to migrate and roll back;
165
+ # shared = others use it ⇒ migrations refused unless
166
+ # isolation.db_per_worktree and run in a feature worktree
167
+ ready_timeout_seconds: 90
168
+ check_timeout_seconds: 600
169
+ screenshots: auto # auto = with a local Playwright CLI (node_modules/.bin/playwright) · off
170
+ surfaces: {} # per-surface hints, keyed by surfaces[].key, e.g.
171
+ # frontend: { base_url: "http://localhost:5173", paths: [/, /settings], smoke: "" }
172
+
173
+ # ── rbac (optional) ─────────────────────────────────────────────────────────
174
+ rbac:
175
+ enabled: <true | false>
176
+ hierarchy: [super-admin, admin, editor, member] # highest → lowest, or []
177
+ note: "the platform must serve EVERY role, not just admins"
178
+
179
+ # ── design system (optional) ────────────────────────────────────────────────
180
+ design:
181
+ enabled: <true | false> # false ⇒ /cohorte-align-ds + design gates are no-ops
182
+ provider: <claude-design | figma | none>
183
+ design_system_project: <uuid-or-id> # the UI-kit source of truth
184
+ design_project: none # legacy fallback for bare-filename design_files only; keep `none` — new specs use full links that carry their own project, so nothing here goes stale on a DS rebuild
185
+ snapshot_dir: apps/web/design-reference # committed DS snapshot for /cohorte-align-ds diff
186
+ direction: design-to-code # NEVER push code→design for a curated DS
187
+ ui_kit_path: apps/web/src/components/ui
188
+ tokens_path: apps/web/src/index.css
189
+
190
+ # ── isolation / parallelism (optional) ──────────────────────────────────────
191
+ isolation:
192
+ enabled: <true | false> # false ⇒ features run in the main checkout
193
+ unit: git-worktree
194
+ db_per_worktree: <true | false>
195
+ db_name_pattern: "<name>_<id>" # e.g. myapp_<id>
196
+ port_base: { api: 3333, web: 5173 } # each worktree gets base+slot
197
+ compose_file: docker-compose.yml
198
+ registry: .worktrees/slots.tsv
199
+
200
+ # ── gate (drives the pipeline gate hook + permissions) ─────────────────────
201
+ # Confirm-first or hard-deny on dangerous Bash, inspecting the FULL command
202
+ # string (so chained `cd x && …` forms are caught).
203
+ gate:
204
+ # Three tiers. `deny` = always hard-blocked. `ask` = always confirm (branch-independent risk).
205
+ # `ask_on_default_branch` = confirm ONLY when the checked-out branch is `default_branch`; on
206
+ # feature branches these run freely. gate.py resolves the branch at run time (git rev-parse);
207
+ # unknown branch (no repo / detached) ⇒ gated, to stay safe. Keep git + docker here so agents
208
+ # move fast on feature branches but main stays protected.
209
+ default_branch: main # the protected branch (mirror vcs.default_branch)
210
+ deny: # never allowed, on any branch
211
+ - "node ace migration:fresh"
212
+ - "node ace migration:reset"
213
+ - "node ace migration:rollback"
214
+ - "node ace db:wipe"
215
+ ask: # always confirm, on any branch
216
+ - "node ace migration:run"
217
+ - "node ace db:"
218
+ - "psql"
219
+ ask_on_default_branch: # free on feature branches, confirm on default_branch
220
+ - "git commit"
221
+ - "git push"
222
+ - "git merge"
223
+ - "git rebase"
224
+ - "git reset"
225
+ - "docker compose"
226
+ # Phase gate: review dispatches require a fresh `preflight.ok` stamp,
227
+ # written by pipeline/scripts/preflight.sh when typecheck+lint+tests are green —
228
+ # gate.py "ask"s the dispatch when the stamp is missing, stale, or the code changed since.
229
+ # The stamp is local: keep `preflight.ok` gitignored, never committed.
230
+ preflight:
231
+ enabled: true
232
+ agents: [cohorte-review] # subagent_types the stamp gates
233
+ max_age_minutes: 30
234
+
235
+ ```
236
+
237
+ > **Note.** The **kanban** board link is **user-scoped** — NOT configured here. Its facts live in the
238
+ > consolidated user config (`~/.claude/cohorte.config.yaml`), read at runtime (the kanban board is keyed by this
239
+ > profile's `name`). This project profile only governs the dev pipeline (`/cohorte-brainstorm…/cohorte-ship`).
240
+
241
+ ---
242
+
243
+ ## Conventions
244
+
245
+ > Read by the implementer + review agents. Keep these terse and rule-shaped; the machine
246
+ > block above holds the paths/commands they enforce against.
247
+
248
+ ### Shared
249
+
250
+ - User-facing copy (API messages, UI text) in **<ui_language>**.
251
+ - <e.g. Zod v4 syntax `z.email()`/`z.uuid()`; ESM `.js` import extensions — project-specific>
252
+
253
+ ### Surface: `backend` (`apps/api`)
254
+
255
+ - <one-action controllers · validator on every write · standardized response envelope · base model / UUID PK · `#`-alias imports · additive-only migrations · …>
256
+
257
+ ### Surface: `frontend` (`apps/web`)
258
+
259
+ - <file-based routes with loaders/guards · domain `lib/api` modules over the shared client · design-system primitives, `cn()`+CVA · **mobile-first, fully responsive** · consume contract types, never redefine · …>
260
+
261
+ ### Testing — strict TDD (red → green → refactor)
262
+
263
+ - <backend test runner + what a contract test must cover (status, validation, auth, payload) · DB isolation per test>
264
+ - <frontend test runner + what to cover (hooks, api modules, component behavior); note layout is not unit-testable>
265
+
266
+ ---
267
+
268
+ ## Design brief note (feeds `/cohorte-spec` §8 and Claude Design)
269
+
270
+ - <design system name + primitives to use · mobile-first · copy language · brand/theming constraints>
271
+ - A feature lists its design pages in the spec front-matter `design_files` as **full links** of the form
272
+ `https://claude.ai/design/p/<projectId>?file=<file>` — each carries its own project (`/p/<projectId>`)
273
+ and page (`?file=`), so an agent extracts both and reads it via `DesignSync get_file(<projectId>,
274
+ <file>)`. Paste the link at `/cohorte-build`'s design gate. No stored project id ⇒ a design-system rebuild
275
+ (new project) just means pasting the new links. (Bare file names are legacy, resolved in `design_project`.)
276
+
277
+ ---
278
+
279
+ ## Personas for `/cohorte-brainstorm` (optional — the panel)
280
+
281
+ <Panel members with a job AND a personality who challenge the idea from their angle and
282
+ disagree with each other. Include a role-coverage guard if `rbac.enabled`. Example:>
283
+
284
+ - **PM** (pragmatic, scope-cutting) — real value? what do we drop?
285
+ - **Skeptical senior engineer** (blunt) — feasibility, edge cases, tech debt.
286
+ - **UX/product designer** — mobile-first flows, accessibility, empty/error states.
287
+ - **Security & RBAC** (paranoid) — permission leaks, cross-tenant exposure, least privilege.
288
+ - <one persona per RBAC role so the feature serves every role, not just admins>
@@ -0,0 +1,30 @@
1
+ # Pipeline schema — index
2
+
3
+ The pipeline's rulebook, one file per topic under `<core>/pipeline/schema/` (source:
4
+ `profile/schema/`). **Read only the file a step cites — never all of them.** Each prompt names the
5
+ exact file it needs (`<core>/pipeline/schema/<file>.md`); this index is for finding one by topic.
6
+
7
+ | File | Governs | Read it when |
8
+ | --- | --- | --- |
9
+ | `profile-block.md` | every field of the `yaml pipeline-profile` block, the prose sections, who reads what | writing, topping up or validating `PIPELINE.md` |
10
+ | `retrieval.md` | `retrieval.provider` (serena / graphify / none): wiring + the health check | wiring or checking the code-retrieval MCP server |
11
+ | `specialization.md` | when to split one surface into several agents; `pipeline-metrics.jsonl` | proposing a new surface or a split |
12
+ | `metrics.md` | what's slow vs what's expensive; `/cost`; lead context discipline | tuning cost or reading the metrics |
13
+ | `output-discipline.md` | the quiet `*_quiet_cmd` variants and the `tail -40` fallback | running tests/lint as an agent; filling the quiet commands |
14
+ | `spec-status.md` | the spec `status` state machine and `kind: patch` | reading or writing a spec's `status` / `kind` |
15
+ | `dead-agents.md` | roll call: a silent agent is never a clean result | integrating any parallel fan-out |
16
+ | `readiness.md` | the `readiness.json` gate between a frozen spec and N implementers | `/cohorte-build` §1.6, or a driver reading it |
17
+ | `deferred.md` | out-of-scope review findings → `specs/refactor-backlog.md` | routing review findings; rewriting the backlog |
18
+ | `decisions.md` | the `specs/_decisions.md` journal: who writes it, who reads it | freezing a spec, adding a surface, ratifying a rule |
19
+ | `feature-diff.md` | `feature-diff.sh` — the only way the pipeline diffs | reading or digesting what a feature changed |
20
+ | `preflight.md` | `preflight.sh` and the `preflight.ok` phase gate | starting a review; the gate's preflight block |
21
+ | `rendering.md` | adding/rendering/removing a surface agent (shared procedure) | init, `/cohorte-build` §1.5, reconcile, retro re-render |
22
+ | `release-notes.md` | the per-feature release note (`release_notes.*`) | `/cohorte-ship` §2b |
23
+ | `reconcile.md` | bringing a repo's generated files up to the current core | `/cohorte-update-pipeline` |
24
+ | `workflows.md` | the opt-in Workflow scripts (review / audit / refactor / loop) | running, checking or editing a workflow |
25
+ | `project-kinds.md` | `project.kind` presets: detection, per-kind DoD lines, review checks, design step | init 01–02; `/cohorte-spec` §9 defaults; the review agent's kind-specific checks |
26
+ | `verify.md` | `/cohorte-verify` (runtime checks, `verify-run.sh`, `verify.json`), migrations + `## Rollback`, `/cohorte-revert` | running the app before ship; a spec with `migrations: true`; reverting a merged feature |
27
+ | `kanban.md` | the Obsidian board mirror: config, card format, `kanban-move.sh` | moving a card; linking or backfilling a board |
28
+
29
+ The parsed machine block itself lives in `<state>/profile.json` (written by `<sync>`, committed): an
30
+ agent that needs only the `yaml pipeline-profile` block reads that file, not `PIPELINE.md`.
@@ -0,0 +1,43 @@
1
+ # ~/.claude/cohorte.config.yaml — GLOBAL, user-scoped config for the Cohorte
2
+ # pipeline capabilities. One machine, every project. NOT tied to any project's PIPELINE.md.
3
+ #
4
+ # Seeded once by the installer (cohorte install) and never clobbered on update. Wired
5
+ # interactively by /cohorte-init-pipeline (new project) and /cohorte-update-pipeline (existing project) —
6
+ # you should never need to hand-edit it.
7
+ #
8
+ # The `# cfg:<key>` markers below are anchors the installer's interactive prompts write to;
9
+ # leave them in place.
10
+
11
+ enabled: true # cfg:enabled — master switch; false disables every capability below
12
+
13
+ # ── obsidian ──────────────────────────────────────────────────────────────────
14
+ # Local vault used by the kanban mirror — defined here ONCE so no capability ever duplicates
15
+ # the path. Absolute path to the folder you open in Obsidian.
16
+ obsidian:
17
+ vault_path: "" # cfg:vault_path
18
+
19
+ # ── kanban (dev pipeline mirror) ─────────────────────────────────────────────
20
+ # Mirrors /cohorte-brainstorm…/cohorte-ship onto an Obsidian Kanban board — one board per project. The
21
+ # board path points at your PERSONAL vault, so it is machine-specific and lives here (never
22
+ # committed in a repo's PIPELINE.md). /cohorte-init-pipeline + /cohorte-update-pipeline write `boards` for you.
23
+ # See ~/.claude/cohorte/pipeline/schema/kanban.md.
24
+ kanban:
25
+ enabled: false # cfg:kanban_enabled — master switch for the kanban mirror
26
+ # Default column mapping: pipeline stage → the EXACT board column heading. Shared by every
27
+ # board; a board may override its own `columns` inside boards[] below.
28
+ columns:
29
+ ideas: "Ideas"
30
+ brainstorm: "Brainstorm"
31
+ spec: "Spec"
32
+ ready: "Ready to build"
33
+ building: "Building"
34
+ review: "Review"
35
+ fix: "Fix"
36
+ ship: "Ship"
37
+ shipped: "Shipped"
38
+ # One entry per project, keyed by the project's PIPELINE.md `name` (e.g. SAMO). `board` is a
39
+ # path RELATIVE to obsidian.vault_path. Written by /cohorte-init-pipeline + /cohorte-update-pipeline.
40
+ boards: {}
41
+ # SAMO:
42
+ # board: "Samo/Tasks.md"
43
+ # # columns: { ideas: "Idées", ... } # optional per-board override of the defaults above
@@ -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.