@isaacriehm/cairn-core 0.2.0 → 0.3.1

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 (337) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/claude/runner.d.ts +1 -1
  3. package/dist/claude/runner.js +62 -1
  4. package/dist/claude/runner.js.map +1 -1
  5. package/dist/claude/types.d.ts +14 -7
  6. package/dist/claude/types.js +5 -7
  7. package/dist/claude/types.js.map +1 -1
  8. package/dist/context/index.d.ts +4 -4
  9. package/dist/context/index.js +3 -4
  10. package/dist/context/index.js.map +1 -1
  11. package/dist/context/spec-delta.js +2 -3
  12. package/dist/context/spec-delta.js.map +1 -1
  13. package/dist/context/task-summary.d.ts +18 -0
  14. package/dist/context/task-summary.js +89 -0
  15. package/dist/context/task-summary.js.map +1 -0
  16. package/dist/decision-capture/id.d.ts +21 -4
  17. package/dist/decision-capture/id.js +56 -5
  18. package/dist/decision-capture/id.js.map +1 -1
  19. package/dist/decision-capture/index.d.ts +7 -22
  20. package/dist/decision-capture/index.js +7 -17
  21. package/dist/decision-capture/index.js.map +1 -1
  22. package/dist/doctor/index.d.ts +1 -1
  23. package/dist/doctor/index.js +1 -1
  24. package/dist/events/index.d.ts +1 -1
  25. package/dist/events/index.js +1 -1
  26. package/dist/events/writer.d.ts +1 -1
  27. package/dist/events/writer.js +1 -1
  28. package/dist/gc/canary.d.ts +13 -23
  29. package/dist/gc/canary.js +36 -92
  30. package/dist/gc/canary.js.map +1 -1
  31. package/dist/gc/citation-integrity.d.ts +6 -6
  32. package/dist/gc/citation-integrity.js +64 -20
  33. package/dist/gc/citation-integrity.js.map +1 -1
  34. package/dist/gc/frontmatter.js +1 -1
  35. package/dist/gc/generator-drift.js +1 -1
  36. package/dist/gc/generator-drift.js.map +1 -1
  37. package/dist/gc/index.d.ts +2 -2
  38. package/dist/gc/index.js +1 -1
  39. package/dist/gc/index.js.map +1 -1
  40. package/dist/gc/quality-update.js +1 -1
  41. package/dist/gc/quality-update.js.map +1 -1
  42. package/dist/gc/types.d.ts +1 -30
  43. package/dist/ground/index.d.ts +2 -2
  44. package/dist/ground/index.js +1 -1
  45. package/dist/ground/index.js.map +1 -1
  46. package/dist/ground/ledgers.d.ts +0 -4
  47. package/dist/ground/ledgers.js +10 -8
  48. package/dist/ground/ledgers.js.map +1 -1
  49. package/dist/ground/manifest.js +0 -2
  50. package/dist/ground/manifest.js.map +1 -1
  51. package/dist/ground/quality-grades.js +3 -1
  52. package/dist/ground/quality-grades.js.map +1 -1
  53. package/dist/ground/schemas.d.ts +2 -7
  54. package/dist/ground/schemas.js +7 -2
  55. package/dist/ground/schemas.js.map +1 -1
  56. package/dist/ground/scope-index.d.ts +59 -12
  57. package/dist/ground/scope-index.js +212 -43
  58. package/dist/ground/scope-index.js.map +1 -1
  59. package/dist/hooks/bypass-detection.js +4 -2
  60. package/dist/hooks/bypass-detection.js.map +1 -1
  61. package/dist/hooks/post-tool-use/citation-scanner.d.ts +7 -5
  62. package/dist/hooks/post-tool-use/citation-scanner.js +15 -9
  63. package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -1
  64. package/dist/hooks/post-tool-use/copy-scanner.js +1 -1
  65. package/dist/hooks/post-tool-use/copy-scanner.js.map +1 -1
  66. package/dist/hooks/post-tool-use/ledger-cache.d.ts +8 -0
  67. package/dist/hooks/post-tool-use/ledger-cache.js +53 -0
  68. package/dist/hooks/post-tool-use/ledger-cache.js.map +1 -1
  69. package/dist/hooks/post-tool-use/legend-builder.d.ts +3 -3
  70. package/dist/hooks/post-tool-use/legend-builder.js +30 -8
  71. package/dist/hooks/post-tool-use/legend-builder.js.map +1 -1
  72. package/dist/hooks/post-tool-use/read-enricher.d.ts +1 -1
  73. package/dist/hooks/post-tool-use/read-enricher.js +68 -21
  74. package/dist/hooks/post-tool-use/read-enricher.js.map +1 -1
  75. package/dist/hooks/post-tool-use/write-guardian.js +148 -18
  76. package/dist/hooks/post-tool-use/write-guardian.js.map +1 -1
  77. package/dist/hooks/runners/index.d.ts +1 -0
  78. package/dist/hooks/runners/index.js +1 -0
  79. package/dist/hooks/runners/index.js.map +1 -1
  80. package/dist/hooks/runners/payload.d.ts +1 -1
  81. package/dist/hooks/runners/payload.js +27 -12
  82. package/dist/hooks/runners/payload.js.map +1 -1
  83. package/dist/hooks/runners/session-start.js +212 -66
  84. package/dist/hooks/runners/session-start.js.map +1 -1
  85. package/dist/hooks/runners/stop.d.ts +9 -12
  86. package/dist/hooks/runners/stop.js +67 -36
  87. package/dist/hooks/runners/stop.js.map +1 -1
  88. package/dist/hooks/runners/user-prompt-submit.d.ts +15 -0
  89. package/dist/hooks/runners/user-prompt-submit.js +149 -0
  90. package/dist/hooks/runners/user-prompt-submit.js.map +1 -0
  91. package/dist/hooks/user-prompt-submit.d.ts +7 -0
  92. package/dist/hooks/user-prompt-submit.js +12 -0
  93. package/dist/hooks/user-prompt-submit.js.map +1 -0
  94. package/dist/index.d.ts +1 -6
  95. package/dist/index.js +1 -5
  96. package/dist/index.js.map +1 -1
  97. package/dist/init/baseline-audit.d.ts +5 -1
  98. package/dist/init/baseline-audit.js +25 -2
  99. package/dist/init/baseline-audit.js.map +1 -1
  100. package/dist/init/glob-inference.d.ts +16 -0
  101. package/dist/init/glob-inference.js +108 -0
  102. package/dist/init/glob-inference.js.map +1 -0
  103. package/dist/init/index.d.ts +2 -0
  104. package/dist/init/index.js +1 -0
  105. package/dist/init/index.js.map +1 -1
  106. package/dist/init/ingest-docs.d.ts +1 -1
  107. package/dist/init/ingest-docs.js +19 -6
  108. package/dist/init/ingest-docs.js.map +1 -1
  109. package/dist/init/init.js +12 -7
  110. package/dist/init/init.js.map +1 -1
  111. package/dist/init/mapper-merge.d.ts +8 -2
  112. package/dist/init/mapper-merge.js +50 -32
  113. package/dist/init/mapper-merge.js.map +1 -1
  114. package/dist/init/mapper-parallel.d.ts +2 -3
  115. package/dist/init/mapper-parallel.js +9 -38
  116. package/dist/init/mapper-parallel.js.map +1 -1
  117. package/dist/init/mapper-prompts.js +1 -1
  118. package/dist/init/mapper-prompts.js.map +1 -1
  119. package/dist/init/mapper.d.ts +6 -127
  120. package/dist/init/mapper.js +30 -7
  121. package/dist/init/mapper.js.map +1 -1
  122. package/dist/init/module-slicer.d.ts +1 -1
  123. package/dist/init/module-slicer.js +1 -1
  124. package/dist/init/multi-dev/install.d.ts +5 -11
  125. package/dist/init/multi-dev/install.js +4 -6
  126. package/dist/init/multi-dev/install.js.map +1 -1
  127. package/dist/init/overlay.d.ts +2 -2
  128. package/dist/init/overlay.js +1 -1
  129. package/dist/init/overlay.js.map +1 -1
  130. package/dist/init/phases/10-strip.js +1 -2
  131. package/dist/init/phases/10-strip.js.map +1 -1
  132. package/dist/init/phases/12-multidev.d.ts +1 -6
  133. package/dist/init/phases/12-multidev.js +1 -6
  134. package/dist/init/phases/12-multidev.js.map +1 -1
  135. package/dist/init/phases/3b-seed.d.ts +1 -10
  136. package/dist/init/phases/3b-seed.js +1 -10
  137. package/dist/init/phases/3b-seed.js.map +1 -1
  138. package/dist/init/phases/4-pilot.js +53 -15
  139. package/dist/init/phases/4-pilot.js.map +1 -1
  140. package/dist/init/phases/5-brand.js +10 -10
  141. package/dist/init/phases/5-brand.js.map +1 -1
  142. package/dist/init/prompts.d.ts +6 -8
  143. package/dist/init/prompts.js +3 -6
  144. package/dist/init/prompts.js.map +1 -1
  145. package/dist/init/rules-merge/ingest.js +1 -1
  146. package/dist/init/source-comments/classify.d.ts +1 -41
  147. package/dist/init/source-comments/classify.js +68 -37
  148. package/dist/init/source-comments/classify.js.map +1 -1
  149. package/dist/init/source-comments/index.d.ts +2 -2
  150. package/dist/init/source-comments/index.js +2 -2
  151. package/dist/init/source-comments/index.js.map +1 -1
  152. package/dist/init/source-comments/ingest.d.ts +38 -2
  153. package/dist/init/source-comments/ingest.js +237 -4
  154. package/dist/init/source-comments/ingest.js.map +1 -1
  155. package/dist/init/source-comments/strip-replace.d.ts +10 -19
  156. package/dist/init/source-comments/strip-replace.js +26 -2
  157. package/dist/init/source-comments/strip-replace.js.map +1 -1
  158. package/dist/init/source-comments/walker.d.ts +9 -2
  159. package/dist/init/source-comments/walker.js +38 -19
  160. package/dist/init/source-comments/walker.js.map +1 -1
  161. package/dist/init/submodules.d.ts +3 -2
  162. package/dist/init/types.d.ts +3 -5
  163. package/dist/init/types.js +3 -5
  164. package/dist/init/types.js.map +1 -1
  165. package/dist/init/visual.d.ts +4 -9
  166. package/dist/init/visual.js +1 -16
  167. package/dist/init/visual.js.map +1 -1
  168. package/dist/logger.d.ts +0 -1
  169. package/dist/logger.js +0 -1
  170. package/dist/logger.js.map +1 -1
  171. package/dist/mcp/context.d.ts +2 -3
  172. package/dist/mcp/context.js.map +1 -1
  173. package/dist/mcp/errors.d.ts +1 -1
  174. package/dist/mcp/errors.js.map +1 -1
  175. package/dist/mcp/history/prompt.d.ts +2 -1
  176. package/dist/mcp/history/walker.js +1 -1
  177. package/dist/mcp/history/walker.js.map +1 -1
  178. package/dist/mcp/path-allowlist.d.ts +0 -6
  179. package/dist/mcp/path-allowlist.js +0 -10
  180. package/dist/mcp/path-allowlist.js.map +1 -1
  181. package/dist/mcp/schemas.d.ts +15 -72
  182. package/dist/mcp/schemas.js +21 -70
  183. package/dist/mcp/schemas.js.map +1 -1
  184. package/dist/mcp/serve.d.ts +1 -1
  185. package/dist/mcp/serve.js +2 -5
  186. package/dist/mcp/serve.js.map +1 -1
  187. package/dist/mcp/server.js +10 -4
  188. package/dist/mcp/server.js.map +1 -1
  189. package/dist/mcp/telemetry.d.ts +8 -1
  190. package/dist/mcp/telemetry.js +16 -0
  191. package/dist/mcp/telemetry.js.map +1 -1
  192. package/dist/mcp/tools/decision-get.js +37 -29
  193. package/dist/mcp/tools/decision-get.js.map +1 -1
  194. package/dist/mcp/tools/decisions-in-scope.js +22 -3
  195. package/dist/mcp/tools/decisions-in-scope.js.map +1 -1
  196. package/dist/mcp/tools/index.js +2 -2
  197. package/dist/mcp/tools/index.js.map +1 -1
  198. package/dist/mcp/tools/invariant-get.js +1 -1
  199. package/dist/mcp/tools/invariant-get.js.map +1 -1
  200. package/dist/mcp/tools/invariants-in-scope.js +26 -7
  201. package/dist/mcp/tools/invariants-in-scope.js.map +1 -1
  202. package/dist/mcp/tools/query-history.js +3 -3
  203. package/dist/mcp/tools/query-history.js.map +1 -1
  204. package/dist/mcp/tools/resolve-attention.d.ts +3 -3
  205. package/dist/mcp/tools/resolve-attention.js +40 -28
  206. package/dist/mcp/tools/resolve-attention.js.map +1 -1
  207. package/dist/mcp/tools/search.js +3 -4
  208. package/dist/mcp/tools/search.js.map +1 -1
  209. package/dist/mcp/tools/task-create.d.ts +15 -0
  210. package/dist/mcp/tools/task-create.js +96 -0
  211. package/dist/mcp/tools/task-create.js.map +1 -0
  212. package/dist/mcp/tools/timeline.js +3 -7
  213. package/dist/mcp/tools/timeline.js.map +1 -1
  214. package/dist/profiles/types.d.ts +1 -1
  215. package/dist/profiles/types.js +1 -1
  216. package/dist/session/id.d.ts +1 -3
  217. package/dist/session/id.js +1 -1
  218. package/dist/session/id.js.map +1 -1
  219. package/dist/session-start/build.d.ts +12 -14
  220. package/dist/session-start/build.js +68 -38
  221. package/dist/session-start/build.js.map +1 -1
  222. package/dist/session-start/index.d.ts +2 -2
  223. package/dist/session-start/index.js +2 -2
  224. package/dist/session-start/index.js.map +1 -1
  225. package/dist/session-start/templates.d.ts +20 -4
  226. package/dist/session-start/templates.js +45 -35
  227. package/dist/session-start/templates.js.map +1 -1
  228. package/dist/status-line/format.d.ts +19 -11
  229. package/dist/status-line/format.js +44 -36
  230. package/dist/status-line/format.js.map +1 -1
  231. package/dist/status-line/index.d.ts +3 -1
  232. package/dist/status-line/index.js +1 -1
  233. package/dist/status-line/index.js.map +1 -1
  234. package/dist/status-line/reader.d.ts +9 -6
  235. package/dist/status-line/reader.js +50 -15
  236. package/dist/status-line/reader.js.map +1 -1
  237. package/dist/status-line/writer.d.ts +5 -0
  238. package/dist/status-line/writer.js +9 -0
  239. package/dist/status-line/writer.js.map +1 -1
  240. package/dist/trace/index.d.ts +44 -0
  241. package/dist/trace/index.js +51 -0
  242. package/dist/trace/index.js.map +1 -0
  243. package/package.json +2 -3
  244. package/templates/.archive/README.md +3 -3
  245. package/templates/.cairn/config/sensors.yaml +16 -19
  246. package/templates/.cairn/config/stub-patterns.yaml +4 -4
  247. package/templates/.cairn/config/trust-policy.yaml +3 -35
  248. package/templates/.cairn/config/workflow.md +13 -194
  249. package/templates/.cairn/git-hooks/commit-msg +1 -1
  250. package/templates/.cairn/ground/canonical-map/topics.yaml +3 -26
  251. package/templates/.cairn/ground/capabilities/snippets.yaml +0 -1
  252. package/templates/.cairn/ground/manifest.yaml +5 -8
  253. package/templates/.cairn/ground/product/personas.yaml +0 -1
  254. package/templates/.github/workflows/cairn-check.yml +3 -5
  255. package/dist/context/checkpoint.d.ts +0 -11
  256. package/dist/context/checkpoint.js +0 -30
  257. package/dist/context/checkpoint.js.map +0 -1
  258. package/dist/decision-capture/capture.d.ts +0 -57
  259. package/dist/decision-capture/capture.js +0 -186
  260. package/dist/decision-capture/capture.js.map +0 -1
  261. package/dist/decision-capture/extractor.d.ts +0 -20
  262. package/dist/decision-capture/extractor.js +0 -103
  263. package/dist/decision-capture/extractor.js.map +0 -1
  264. package/dist/decision-capture/prompt.d.ts +0 -15
  265. package/dist/decision-capture/prompt.js +0 -68
  266. package/dist/decision-capture/prompt.js.map +0 -1
  267. package/dist/decision-capture/refinement-prompt.d.ts +0 -25
  268. package/dist/decision-capture/refinement-prompt.js +0 -146
  269. package/dist/decision-capture/refinement-prompt.js.map +0 -1
  270. package/dist/decision-capture/refinement-schema.d.ts +0 -52
  271. package/dist/decision-capture/refinement-schema.js +0 -61
  272. package/dist/decision-capture/refinement-schema.js.map +0 -1
  273. package/dist/decision-capture/refinement.d.ts +0 -60
  274. package/dist/decision-capture/refinement.js +0 -439
  275. package/dist/decision-capture/refinement.js.map +0 -1
  276. package/dist/decision-capture/schema.d.ts +0 -70
  277. package/dist/decision-capture/schema.js +0 -71
  278. package/dist/decision-capture/schema.js.map +0 -1
  279. package/dist/decision-capture/types.d.ts +0 -201
  280. package/dist/decision-capture/types.js +0 -20
  281. package/dist/decision-capture/types.js.map +0 -1
  282. package/dist/decision-capture/writer.d.ts +0 -90
  283. package/dist/decision-capture/writer.js +0 -267
  284. package/dist/decision-capture/writer.js.map +0 -1
  285. package/dist/frontend-types.d.ts +0 -243
  286. package/dist/frontend-types.js +0 -15
  287. package/dist/frontend-types.js.map +0 -1
  288. package/dist/hooks/index.d.ts +0 -14
  289. package/dist/hooks/index.js +0 -14
  290. package/dist/hooks/index.js.map +0 -1
  291. package/dist/inbox.d.ts +0 -17
  292. package/dist/inbox.js +0 -30
  293. package/dist/inbox.js.map +0 -1
  294. package/dist/mcp/tools/append-run-note.d.ts +0 -18
  295. package/dist/mcp/tools/append-run-note.js +0 -54
  296. package/dist/mcp/tools/append-run-note.js.map +0 -1
  297. package/dist/mcp/tools/append.d.ts +0 -8
  298. package/dist/mcp/tools/append.js +0 -37
  299. package/dist/mcp/tools/append.js.map +0 -1
  300. package/dist/mcp/tools/ask-operator.d.ts +0 -34
  301. package/dist/mcp/tools/ask-operator.js +0 -97
  302. package/dist/mcp/tools/ask-operator.js.map +0 -1
  303. package/dist/mcp/tools/drop-task.d.ts +0 -12
  304. package/dist/mcp/tools/drop-task.js +0 -68
  305. package/dist/mcp/tools/drop-task.js.map +0 -1
  306. package/dist/mcp/tools/record-run-event.d.ts +0 -10
  307. package/dist/mcp/tools/record-run-event.js +0 -32
  308. package/dist/mcp/tools/record-run-event.js.map +0 -1
  309. package/dist/prompt.d.ts +0 -19
  310. package/dist/prompt.js +0 -50
  311. package/dist/prompt.js.map +0 -1
  312. package/dist/tier0/classify.d.ts +0 -10
  313. package/dist/tier0/classify.js +0 -110
  314. package/dist/tier0/classify.js.map +0 -1
  315. package/dist/tier0/index.d.ts +0 -2
  316. package/dist/tier0/index.js +0 -2
  317. package/dist/tier0/index.js.map +0 -1
  318. package/dist/tier0/types.d.ts +0 -24
  319. package/dist/tier0/types.js +0 -9
  320. package/dist/tier0/types.js.map +0 -1
  321. package/dist/tightener/index.d.ts +0 -4
  322. package/dist/tightener/index.js +0 -4
  323. package/dist/tightener/index.js.map +0 -1
  324. package/dist/tightener/prompt.d.ts +0 -3
  325. package/dist/tightener/prompt.js +0 -67
  326. package/dist/tightener/prompt.js.map +0 -1
  327. package/dist/tightener/schema.d.ts +0 -68
  328. package/dist/tightener/schema.js +0 -44
  329. package/dist/tightener/schema.js.map +0 -1
  330. package/dist/tightener/tighten.d.ts +0 -2
  331. package/dist/tightener/tighten.js +0 -66
  332. package/dist/tightener/tighten.js.map +0 -1
  333. package/dist/tightener/types.d.ts +0 -74
  334. package/dist/tightener/types.js +0 -6
  335. package/dist/tightener/types.js.map +0 -1
  336. package/templates/.claude/settings.json +0 -57
  337. package/templates/.mcp.json +0 -8
@@ -1,9 +0,0 @@
1
- /**
2
- * Tier-0 classifier contract. Per docs/PLUGIN_ARCHITECTURE.md §14: Haiku
3
- * (escalating to Sonnet for complex prompts) via the Claude binary
4
- * subprocess. Falls back to a deterministic regex matcher if the Claude
5
- * binary is unavailable so smoke tests + scripted callers stay green.
6
- * Production flows assume the Claude binary is present.
7
- */
8
- export {};
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tier0/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -1,4 +0,0 @@
1
- export { tightenSpec } from "./tighten.js";
2
- export { TIGHTENER_OUTPUT_SCHEMA } from "./schema.js";
3
- export { TIGHTENER_SYSTEM_PROMPT, buildTightenerUserPrompt, } from "./prompt.js";
4
- export type { Ambiguity, TightenerInput, TightenerOutput, TightenerResult, } from "./types.js";
@@ -1,4 +0,0 @@
1
- export { tightenSpec } from "./tighten.js";
2
- export { TIGHTENER_OUTPUT_SCHEMA } from "./schema.js";
3
- export { TIGHTENER_SYSTEM_PROMPT, buildTightenerUserPrompt, } from "./prompt.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tightener/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { TightenerInput } from "./types.js";
2
- export declare const TIGHTENER_SYSTEM_PROMPT: string;
3
- export declare function buildTightenerUserPrompt(input: TightenerInput): string;
@@ -1,67 +0,0 @@
1
- export const TIGHTENER_SYSTEM_PROMPT = [
2
- "You are the SPEC TIGHTENER for a developer cairn.",
3
- "",
4
- "Your job: read a task spec and decide if an implementer can act on it without asking questions. You DO NOT write code, run tools, or modify files. You analyze the spec and return one structured JSON object.",
5
- "",
6
- "Examine the spec for:",
7
- "- AMBIGUITIES — wording that an honest implementer could read two ways. Each ambiguity gets a stable id (Q1, Q2, ...), a focused question, and 2-4 concrete A/B/C/D candidate resolutions (per the cairn UX rule: squares-into-square-holes, no free-text-only options).",
8
- "- CONFLICTS — direct contradictions with decisions or invariants in scope.",
9
- "- MISSING ACCEPTANCE — observable behaviors the spec implies but does not state, that an implementer would need to assert.",
10
- "- SCOPE CONCERNS — paths/modules the spec might touch that look out of bounds.",
11
- "- EXISTING STUB OVERLAP — TODOs / placeholder functions the spec would resolve, called out explicitly so the implementer doesn't add a parallel implementation.",
12
- "",
13
- "Score the spec 0-10 on `spec_quality_score`:",
14
- " 0-3 = vague, multiple interpretations, missing acceptance",
15
- " 4-6 = workable but several decisions deferred",
16
- " 7-8 = clear, minor wording-level ambiguities at most",
17
- " 9-10 = unambiguous, complete acceptance, ready to dispatch",
18
- "",
19
- "Set `ready_to_execute = true` ONLY when score >= 7 AND `ambiguities` is empty AND no conflicts. Otherwise false.",
20
- "",
21
- "Always populate `tightened_spec_proposal` with your best rewrite of the spec, taking the most defensible default for each ambiguity. This is the fallback if the operator clicks `[approve as drafted]` without resolving questions individually (per cairn Codex audit Finding #7 — collapse 3+ ambiguities into one tightened-proposal-with-edit-button).",
22
- "",
23
- "Return ONLY the JSON object. No prose, no preamble.",
24
- ].join("\n");
25
- export function buildTightenerUserPrompt(input) {
26
- const parts = [];
27
- parts.push("# Task spec to tighten");
28
- parts.push("");
29
- parts.push(`## Title`);
30
- parts.push(input.title);
31
- parts.push("");
32
- parts.push(`## Body`);
33
- parts.push(input.body);
34
- if (input.decisions_in_scope && input.decisions_in_scope.length > 0) {
35
- parts.push("");
36
- parts.push("## Decisions in scope");
37
- for (const d of input.decisions_in_scope) {
38
- parts.push(`- **${d.id}** — ${d.title}: ${d.summary}`);
39
- }
40
- }
41
- if (input.invariants_in_scope && input.invariants_in_scope.length > 0) {
42
- parts.push("");
43
- parts.push("## Invariants in scope");
44
- for (const v of input.invariants_in_scope) {
45
- parts.push(`- **${v.id}** — ${v.title}`);
46
- }
47
- }
48
- if (input.ground_extracts && input.ground_extracts.length > 0) {
49
- parts.push("");
50
- parts.push("## Ground extracts");
51
- for (const g of input.ground_extracts) {
52
- parts.push(`### ${g.key}`);
53
- parts.push(g.snippet);
54
- }
55
- }
56
- if (input.existing_stubs && input.existing_stubs.length > 0) {
57
- parts.push("");
58
- parts.push("## Existing stubs / TODOs the spec may step on");
59
- for (const stub of input.existing_stubs) {
60
- parts.push(`- ${stub}`);
61
- }
62
- }
63
- parts.push("");
64
- parts.push("Now return the JSON object per the schema.");
65
- return parts.join("\n");
66
- }
67
- //# sourceMappingURL=prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/tightener/prompt.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,mDAAmD;IACnD,EAAE;IACF,gNAAgN;IAChN,EAAE;IAC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-schema` for the tightener output.
3
- * Mirrors `TightenerOutput` exactly. Keep in sync.
4
- */
5
- export declare const TIGHTENER_OUTPUT_SCHEMA: {
6
- readonly type: "object";
7
- readonly additionalProperties: false;
8
- readonly properties: {
9
- readonly ambiguities: {
10
- readonly type: "array";
11
- readonly items: {
12
- readonly type: "object";
13
- readonly additionalProperties: false;
14
- readonly properties: {
15
- readonly id: {
16
- readonly type: "string";
17
- };
18
- readonly question: {
19
- readonly type: "string";
20
- };
21
- readonly candidate_resolutions: {
22
- readonly type: "array";
23
- readonly items: {
24
- readonly type: "string";
25
- };
26
- };
27
- };
28
- readonly required: readonly ["id", "question", "candidate_resolutions"];
29
- };
30
- };
31
- readonly conflicts: {
32
- readonly type: "array";
33
- readonly items: {
34
- readonly type: "string";
35
- };
36
- };
37
- readonly missing_acceptance: {
38
- readonly type: "array";
39
- readonly items: {
40
- readonly type: "string";
41
- };
42
- };
43
- readonly scope_concerns: {
44
- readonly type: "array";
45
- readonly items: {
46
- readonly type: "string";
47
- };
48
- };
49
- readonly existing_stub_overlap: {
50
- readonly type: "array";
51
- readonly items: {
52
- readonly type: "string";
53
- };
54
- };
55
- readonly spec_quality_score: {
56
- readonly type: "integer";
57
- readonly minimum: 0;
58
- readonly maximum: 10;
59
- };
60
- readonly ready_to_execute: {
61
- readonly type: "boolean";
62
- };
63
- readonly tightened_spec_proposal: {
64
- readonly type: "string";
65
- };
66
- };
67
- readonly required: readonly ["ambiguities", "conflicts", "missing_acceptance", "scope_concerns", "existing_stub_overlap", "spec_quality_score", "ready_to_execute", "tightened_spec_proposal"];
68
- };
@@ -1,44 +0,0 @@
1
- /**
2
- * JSON Schema enforced by `claude --json-schema` for the tightener output.
3
- * Mirrors `TightenerOutput` exactly. Keep in sync.
4
- */
5
- export const TIGHTENER_OUTPUT_SCHEMA = {
6
- type: "object",
7
- additionalProperties: false,
8
- properties: {
9
- ambiguities: {
10
- type: "array",
11
- items: {
12
- type: "object",
13
- additionalProperties: false,
14
- properties: {
15
- id: { type: "string" },
16
- question: { type: "string" },
17
- candidate_resolutions: {
18
- type: "array",
19
- items: { type: "string" },
20
- },
21
- },
22
- required: ["id", "question", "candidate_resolutions"],
23
- },
24
- },
25
- conflicts: { type: "array", items: { type: "string" } },
26
- missing_acceptance: { type: "array", items: { type: "string" } },
27
- scope_concerns: { type: "array", items: { type: "string" } },
28
- existing_stub_overlap: { type: "array", items: { type: "string" } },
29
- spec_quality_score: { type: "integer", minimum: 0, maximum: 10 },
30
- ready_to_execute: { type: "boolean" },
31
- tightened_spec_proposal: { type: "string" },
32
- },
33
- required: [
34
- "ambiguities",
35
- "conflicts",
36
- "missing_acceptance",
37
- "scope_concerns",
38
- "existing_stub_overlap",
39
- "spec_quality_score",
40
- "ready_to_execute",
41
- "tightened_spec_proposal",
42
- ],
43
- };
44
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/tightener/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACtB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC5B,qBAAqB,EAAE;wBACrB,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC1B;iBACF;gBACD,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,uBAAuB,CAAC;aACtD;SACF;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACvD,kBAAkB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAChE,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAC5D,qBAAqB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACnE,kBAAkB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QAChE,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACrC,uBAAuB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5C;IACD,QAAQ,EAAE;QACR,aAAa;QACb,WAAW;QACX,oBAAoB;QACpB,gBAAgB;QAChB,uBAAuB;QACvB,oBAAoB;QACpB,kBAAkB;QAClB,yBAAyB;KAC1B;CACO,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { TightenerInput, TightenerResult } from "./types.js";
2
- export declare function tightenSpec(input: TightenerInput): Promise<TightenerResult>;
@@ -1,66 +0,0 @@
1
- import { runClaude } from "../claude/index.js";
2
- import { logger } from "../logger.js";
3
- import { buildTightenerUserPrompt, TIGHTENER_SYSTEM_PROMPT } from "./prompt.js";
4
- import { TIGHTENER_OUTPUT_SCHEMA } from "./schema.js";
5
- const log = logger("tightener");
6
- /** Word-count cutoff at which we auto-escalate from Haiku → Sonnet. */
7
- const ESCALATE_WORDS = 500;
8
- /** Default `spec_quality_floor` per templates/.cairn/config/workflow.md. */
9
- const DEFAULT_QUALITY_FLOOR = 7;
10
- function chooseTier(input) {
11
- if (input.force_tier !== undefined)
12
- return input.force_tier;
13
- const wordCount = `${input.title} ${input.body}`.split(/\s+/).filter(Boolean).length;
14
- return wordCount > ESCALATE_WORDS ? "sonnet" : "haiku";
15
- }
16
- function isOutput(value) {
17
- if (typeof value !== "object" || value === null)
18
- return false;
19
- const v = value;
20
- return (Array.isArray(v["ambiguities"]) &&
21
- Array.isArray(v["conflicts"]) &&
22
- Array.isArray(v["missing_acceptance"]) &&
23
- Array.isArray(v["scope_concerns"]) &&
24
- Array.isArray(v["existing_stub_overlap"]) &&
25
- typeof v["spec_quality_score"] === "number" &&
26
- typeof v["ready_to_execute"] === "boolean" &&
27
- typeof v["tightened_spec_proposal"] === "string");
28
- }
29
- export async function tightenSpec(input) {
30
- const tier = chooseTier(input);
31
- const userPrompt = buildTightenerUserPrompt(input);
32
- log.info({ tier, body_len: input.body.length, ship_anyway: input.ship_anyway === true }, "tightener dispatch");
33
- const result = await runClaude({
34
- tier,
35
- prompt: userPrompt,
36
- system: TIGHTENER_SYSTEM_PROMPT,
37
- jsonSchema: TIGHTENER_OUTPUT_SCHEMA,
38
- timeoutMs: 300_000,
39
- });
40
- if (!isOutput(result.parsed)) {
41
- throw new Error(`tightener returned malformed output (no parsed). preview: ${result.text.slice(0, 200)}`);
42
- }
43
- const output = result.parsed;
44
- const ready = input.ship_anyway === true ||
45
- (output.ready_to_execute === true && output.spec_quality_score >= DEFAULT_QUALITY_FLOOR);
46
- return {
47
- output,
48
- tier,
49
- ready,
50
- quality_floor: DEFAULT_QUALITY_FLOOR,
51
- duration_ms: result.durationMs,
52
- ...(result.usage !== undefined
53
- ? {
54
- usage: {
55
- ...(result.usage.input_tokens !== undefined
56
- ? { input_tokens: result.usage.input_tokens }
57
- : {}),
58
- ...(result.usage.output_tokens !== undefined
59
- ? { output_tokens: result.usage.output_tokens }
60
- : {}),
61
- },
62
- }
63
- : {}),
64
- };
65
- }
66
- //# sourceMappingURL=tighten.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tighten.js","sourceRoot":"","sources":["../../src/tightener/tighten.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EA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C,KAAK,CAAC,YAAY,KAAK,SAAS;wBACzC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE;wBAC7C,CAAC,CAAC,EAAE,CAAC;oBACP,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS;wBAC1C,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE;wBAC/C,CAAC,CAAC,EAAE,CAAC;iBACR;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Spec tightener (Layer F) per `docs/PRIMER.md` §10. Single Tier-1 (Haiku)
3
- * call before any code is written.
4
- */
5
- export interface Ambiguity {
6
- /** Stable id within this tightener call (e.g. "Q1"). */
7
- id: string;
8
- question: string;
9
- /** Concrete A/B/C/D candidate resolutions; empty when caller must free-text. */
10
- candidate_resolutions: string[];
11
- }
12
- export interface TightenerOutput {
13
- ambiguities: Ambiguity[];
14
- conflicts: string[];
15
- missing_acceptance: string[];
16
- scope_concerns: string[];
17
- existing_stub_overlap: string[];
18
- /** 0-10 integer; >= 7 AND ready_to_execute → safe to dispatch. */
19
- spec_quality_score: number;
20
- ready_to_execute: boolean;
21
- /**
22
- * The model's proposed tightened version of the spec body. Must always
23
- * be set so callers have a fallback when ambiguities exist (the proposal
24
- * uses the most defensible default per L44).
25
- */
26
- tightened_spec_proposal: string;
27
- }
28
- export interface TightenerInput {
29
- title: string;
30
- body: string;
31
- /** Recent decisions in scope (id + summary). Loaded from MCP by caller. */
32
- decisions_in_scope?: {
33
- id: string;
34
- title: string;
35
- summary: string;
36
- }[];
37
- /** Invariants in scope (id + title). Loaded from MCP by caller. */
38
- invariants_in_scope?: {
39
- id: string;
40
- title: string;
41
- }[];
42
- /** Ground extracts in scope (key + content snippet). */
43
- ground_extracts?: {
44
- key: string;
45
- snippet: string;
46
- }[];
47
- /** Existing stubs/TODOs the agent may step on. */
48
- existing_stubs?: string[];
49
- /** Operator override per L24: ship even when score below threshold. */
50
- ship_anyway?: boolean;
51
- /**
52
- * Force a specific tier instead of the body-length heuristic. Useful for
53
- * smoke tests and for operators who know they want Sonnet on a touchy
54
- * spec without rewriting it to trip the auto-escalate threshold.
55
- */
56
- force_tier?: "haiku" | "sonnet";
57
- }
58
- export interface TightenerResult {
59
- /** Raw tightener output as returned by the model. */
60
- output: TightenerOutput;
61
- /** Tier actually used (auto-escalated if body length tripped the threshold). */
62
- tier: "haiku" | "sonnet";
63
- /** True when the gate passes: score >= floor AND ready_to_execute, OR ship_anyway. */
64
- ready: boolean;
65
- /** Quality floor used to compute `ready`. Default 7 per workflow.md `spec_quality_floor`. */
66
- quality_floor: number;
67
- /** Wall-clock duration of the model call. */
68
- duration_ms: number;
69
- /** Token usage if reported by the CLI. */
70
- usage?: {
71
- input_tokens?: number;
72
- output_tokens?: number;
73
- };
74
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Spec tightener (Layer F) per `docs/PRIMER.md` §10. Single Tier-1 (Haiku)
3
- * call before any code is written.
4
- */
5
- export {};
6
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tightener/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,57 +0,0 @@
1
- {
2
- "statusLine": {
3
- "type": "command",
4
- "command": "cairn status-line"
5
- },
6
- "hooks": {
7
- "SessionStart": [
8
- {
9
- "hooks": [
10
- {
11
- "type": "command",
12
- "command": "cairn hook session-start"
13
- }
14
- ]
15
- }
16
- ],
17
- "SessionEnd": [
18
- {
19
- "hooks": [
20
- {
21
- "type": "command",
22
- "command": "cairn hook session-end"
23
- }
24
- ]
25
- }
26
- ],
27
- "PostToolUse": [
28
- {
29
- "matcher": "Read",
30
- "hooks": [
31
- {
32
- "type": "command",
33
- "command": "cairn hook read-enrich"
34
- }
35
- ]
36
- },
37
- {
38
- "matcher": "Write",
39
- "hooks": [
40
- {
41
- "type": "command",
42
- "command": "cairn hook write-guard"
43
- }
44
- ]
45
- },
46
- {
47
- "matcher": "Edit",
48
- "hooks": [
49
- {
50
- "type": "command",
51
- "command": "cairn hook write-guard"
52
- }
53
- ]
54
- }
55
- ]
56
- }
57
- }
@@ -1,8 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "cairn": {
4
- "command": "cairn",
5
- "args": ["mcp", "serve"]
6
- }
7
- }
8
- }