rcf-lite 0.0.1 → 0.7.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 (342) hide show
  1. package/CHANGELOG.md +288 -0
  2. package/LICENSE +202 -0
  3. package/README.md +92 -4
  4. package/bin/rcf-verify.js +122 -0
  5. package/bin/rcf.js +174 -0
  6. package/bin/view-supervisor-child.mjs +14 -0
  7. package/fixtures/canary-manifest.json +103 -0
  8. package/guidance/README.md +25 -0
  9. package/guidance/build-cycle-playbook.md +492 -0
  10. package/guidance/build-cycle.md +40 -0
  11. package/guidance/document-model.md +45 -0
  12. package/guidance/elicitation-playbook.md +442 -0
  13. package/guidance/harness-template.md +246 -0
  14. package/guidance/managed/README.md +63 -0
  15. package/guidance/managed/agent-instructions-block.hash +1 -0
  16. package/guidance/managed/agent-instructions-block.md +220 -0
  17. package/guidance/managed/legacy-fragment-hashes.json +22 -0
  18. package/guidance/manifest.json +21 -0
  19. package/guidance/overview.md +48 -0
  20. package/guidance/persona-programme.md +44 -0
  21. package/package.json +69 -8
  22. package/rcf/adrs/adr-001.json +25 -0
  23. package/rcf/adrs/adr-002.json +25 -0
  24. package/rcf/adrs/adr-003.json +25 -0
  25. package/rcf/adrs/adr-004.json +20 -0
  26. package/rcf/adrs/adr-005.json +20 -0
  27. package/rcf/adrs/adr-006.json +25 -0
  28. package/rcf/adrs/adr-007.json +25 -0
  29. package/rcf/adrs/adr-008.json +25 -0
  30. package/rcf/adrs/adr-009.json +25 -0
  31. package/rcf/build-sequence.json +11 -0
  32. package/rcf/code-nodes/cn-001.json +14 -0
  33. package/rcf/code-nodes/cn-002.json +14 -0
  34. package/rcf/code-nodes/cn-003.json +15 -0
  35. package/rcf/code-nodes/cn-004.json +17 -0
  36. package/rcf/code-nodes/cn-005.json +19 -0
  37. package/rcf/code-nodes/cn-006.json +17 -0
  38. package/rcf/code-nodes/cn-007.json +16 -0
  39. package/rcf/code-nodes/cn-008.json +19 -0
  40. package/rcf/code-nodes/cn-009.json +16 -0
  41. package/rcf/code-nodes/cn-010.json +18 -0
  42. package/rcf/code-nodes/cn-011.json +18 -0
  43. package/rcf/code-nodes/cn-012.json +18 -0
  44. package/rcf/code-nodes/cn-013.json +19 -0
  45. package/rcf/code-nodes/cn-014.json +16 -0
  46. package/rcf/code-nodes/cn-015.json +16 -0
  47. package/rcf/code-nodes/cn-016.json +16 -0
  48. package/rcf/code-nodes/cn-017.json +16 -0
  49. package/rcf/code-nodes/cn-018.json +15 -0
  50. package/rcf/code-nodes/cn-019.json +16 -0
  51. package/rcf/code-nodes/cn-020.json +16 -0
  52. package/rcf/code-nodes/cn-021.json +16 -0
  53. package/rcf/code-nodes/cn-022.json +16 -0
  54. package/rcf/code-nodes/cn-023.json +16 -0
  55. package/rcf/code-nodes/cn-024.json +16 -0
  56. package/rcf/code-nodes/cn-025.json +16 -0
  57. package/rcf/code-nodes/cn-026.json +16 -0
  58. package/rcf/code-nodes/cn-027.json +16 -0
  59. package/rcf/code-nodes/cn-028.json +16 -0
  60. package/rcf/code-nodes/cn-029.json +19 -0
  61. package/rcf/code-nodes/cn-030.json +14 -0
  62. package/rcf/code-nodes/cn-031.json +14 -0
  63. package/rcf/code-nodes/cn-032.json +14 -0
  64. package/rcf/code-nodes/cn-033.json +14 -0
  65. package/rcf/code-nodes/cn-034.json +14 -0
  66. package/rcf/code-nodes/cn-035.json +14 -0
  67. package/rcf/code-nodes/cn-036.json +14 -0
  68. package/rcf/code-nodes/cn-037.json +14 -0
  69. package/rcf/code-nodes/cn-038.json +14 -0
  70. package/rcf/code-nodes/cn-039.json +14 -0
  71. package/rcf/code-nodes/cn-040.json +14 -0
  72. package/rcf/code-nodes/cn-041.json +14 -0
  73. package/rcf/code-nodes/cn-042.json +14 -0
  74. package/rcf/code-nodes/cn-043.json +14 -0
  75. package/rcf/code-nodes/cn-044.json +14 -0
  76. package/rcf/code-nodes/cn-045.json +14 -0
  77. package/rcf/code-nodes/cn-046.json +14 -0
  78. package/rcf/code-nodes/cn-047.json +14 -0
  79. package/rcf/code-nodes/cn-048.json +14 -0
  80. package/rcf/code-nodes/cn-049.json +14 -0
  81. package/rcf/code-nodes/cn-050.json +14 -0
  82. package/rcf/code-nodes/cn-051.json +14 -0
  83. package/rcf/code-nodes/cn-052.json +14 -0
  84. package/rcf/code-nodes/cn-053.json +14 -0
  85. package/rcf/code-nodes/cn-054.json +14 -0
  86. package/rcf/code-nodes/cn-055.json +14 -0
  87. package/rcf/code-nodes/cn-056.json +14 -0
  88. package/rcf/code-nodes/cn-057.json +14 -0
  89. package/rcf/fbs/fbs-001.json +49 -0
  90. package/rcf/fbs/fbs-002.json +42 -0
  91. package/rcf/fbs/fbs-003.json +37 -0
  92. package/rcf/fbs/fbs-004.json +39 -0
  93. package/rcf/fbs/fbs-005.json +38 -0
  94. package/rcf/fbs/fbs-006.json +48 -0
  95. package/rcf/fbs/fbs-007.json +39 -0
  96. package/rcf/fbs/fbs-008.json +40 -0
  97. package/rcf/fbs/fbs-009.json +36 -0
  98. package/rcf/fbs/fbs-010.json +41 -0
  99. package/rcf/fbs/fbs-011.json +36 -0
  100. package/rcf/fbs/fbs-012.json +46 -0
  101. package/rcf/fbs/fbs-013.json +42 -0
  102. package/rcf/fbs/fbs-014.json +49 -0
  103. package/rcf/fbs/fbs-015.json +32 -0
  104. package/rcf/manifest.json +17 -0
  105. package/rcf/prd.json +47 -0
  106. package/rcf/requirements/req-001.json +19 -0
  107. package/rcf/requirements/req-002.json +19 -0
  108. package/rcf/requirements/req-003.json +19 -0
  109. package/rcf/requirements/req-004.json +19 -0
  110. package/rcf/requirements/req-005.json +19 -0
  111. package/rcf/requirements/req-006.json +19 -0
  112. package/rcf/requirements/req-007.json +19 -0
  113. package/rcf/requirements/req-008.json +19 -0
  114. package/rcf/requirements/req-009.json +19 -0
  115. package/rcf/tacs/tac-001.json +45 -0
  116. package/rcf/tacs/tac-002.json +109 -0
  117. package/rcf/tacs/tac-003.json +40 -0
  118. package/rcf/tacs/tac-004.json +51 -0
  119. package/rcf/tacs/tac-005.json +52 -0
  120. package/rcf/tacs/tac-006.json +104 -0
  121. package/rcf/tacs/tac-007.json +38 -0
  122. package/rcf/tacs/tac-008.json +51 -0
  123. package/rcf/tad.json +51 -0
  124. package/rcf/test-suites/PENDING.md +23 -0
  125. package/rcf/test-suites/ts-001.json +38 -0
  126. package/rcf/test-suites/ts-002.json +38 -0
  127. package/rcf/test-suites/ts-003.json +43 -0
  128. package/rcf/test-suites/ts-004.json +44 -0
  129. package/rcf/test-suites/ts-005.json +30 -0
  130. package/rcf/test-suites/ts-006.json +36 -0
  131. package/rcf/test-suites/ts-007.json +43 -0
  132. package/rcf/test-suites/ts-008.json +37 -0
  133. package/rcf/test-suites/ts-009.json +38 -0
  134. package/rcf/test-suites/ts-010.json +38 -0
  135. package/rcf/test-suites/ts-011.json +44 -0
  136. package/rcf/test-suites/ts-012.json +36 -0
  137. package/rcf/test-suites/ts-013.json +38 -0
  138. package/rcf/test-suites/ts-014.json +38 -0
  139. package/rcf/test-suites/ts-015.json +38 -0
  140. package/rcf/test-suites/ts-016.json +37 -0
  141. package/rcf/test-suites/ts-017.json +38 -0
  142. package/rcf/test-suites/ts-018.json +38 -0
  143. package/rcf/test-suites/ts-019.json +37 -0
  144. package/rcf/test-suites/ts-020.json +46 -0
  145. package/rcf/test-suites/ts-021.json +46 -0
  146. package/rcf/test-suites/ts-022.json +46 -0
  147. package/rcf/test-suites/ts-023.json +46 -0
  148. package/rcf/test-suites/ts-024.json +46 -0
  149. package/rcf/test-suites/ts-025.json +52 -0
  150. package/rcf/user-stories/us-101.json +40 -0
  151. package/rcf/user-stories/us-102.json +40 -0
  152. package/rcf/user-stories/us-201.json +40 -0
  153. package/rcf/user-stories/us-202.json +40 -0
  154. package/rcf/user-stories/us-203.json +32 -0
  155. package/rcf/user-stories/us-301.json +40 -0
  156. package/rcf/user-stories/us-302.json +40 -0
  157. package/rcf/user-stories/us-303.json +40 -0
  158. package/rcf/user-stories/us-304.json +40 -0
  159. package/rcf/user-stories/us-401.json +40 -0
  160. package/rcf/user-stories/us-402.json +40 -0
  161. package/rcf/user-stories/us-403.json +40 -0
  162. package/rcf/user-stories/us-501.json +40 -0
  163. package/rcf/user-stories/us-502.json +40 -0
  164. package/rcf/user-stories/us-503.json +40 -0
  165. package/rcf/user-stories/us-601.json +40 -0
  166. package/rcf/user-stories/us-602.json +40 -0
  167. package/rcf/user-stories/us-701.json +40 -0
  168. package/rcf/user-stories/us-702.json +40 -0
  169. package/rcf/user-stories/us-801.json +49 -0
  170. package/rcf/user-stories/us-802.json +49 -0
  171. package/rcf/user-stories/us-803.json +49 -0
  172. package/rcf/user-stories/us-804.json +49 -0
  173. package/rcf/user-stories/us-805.json +49 -0
  174. package/rcf/user-stories/us-901.json +40 -0
  175. package/src/.gitkeep +0 -0
  176. package/src/browser-verify/auth-smoke.js +109 -0
  177. package/src/browser-verify/index.js +29 -0
  178. package/src/browser-verify/invariants.js +336 -0
  179. package/src/browser-verify/manifest-writer.js +189 -0
  180. package/src/browser-verify/runner.js +171 -0
  181. package/src/build/bundle.js +198 -0
  182. package/src/build/formatters/json.js +18 -0
  183. package/src/build/formatters/markdown.js +406 -0
  184. package/src/build/index.js +14 -0
  185. package/src/build/mark.js +177 -0
  186. package/src/build/queue.js +285 -0
  187. package/src/cli/browser-verify.js +231 -0
  188. package/src/cli/build.js +584 -0
  189. package/src/cli/coverage.js +219 -0
  190. package/src/cli/create.js +355 -0
  191. package/src/cli/delete.js +127 -0
  192. package/src/cli/design.js +353 -0
  193. package/src/cli/doctor.js +548 -0
  194. package/src/cli/fbs.js +171 -0
  195. package/src/cli/finalise.js +377 -0
  196. package/src/cli/guidance.js +206 -0
  197. package/src/cli/help.js +156 -0
  198. package/src/cli/impact.js +119 -0
  199. package/src/cli/init.js +282 -0
  200. package/src/cli/intake.js +153 -0
  201. package/src/cli/link.js +128 -0
  202. package/src/cli/mcp.js +160 -0
  203. package/src/cli/preflight.js +220 -0
  204. package/src/cli/read.js +162 -0
  205. package/src/cli/req-baseline.js +269 -0
  206. package/src/cli/req-classify.js +135 -0
  207. package/src/cli/review.js +295 -0
  208. package/src/cli/test-suite.js +216 -0
  209. package/src/cli/trace.js +172 -0
  210. package/src/cli/ui-baseline.js +292 -0
  211. package/src/cli/ui-classify.js +108 -0
  212. package/src/cli/update.js +197 -0
  213. package/src/cli/validate.js +168 -0
  214. package/src/cli/view.js +452 -0
  215. package/src/core/baseline-catalog/data/auth.json +42 -0
  216. package/src/core/baseline-catalog/data/http-api.json +42 -0
  217. package/src/core/baseline-catalog/data/notifications.json +33 -0
  218. package/src/core/baseline-catalog/data/persistence.json +33 -0
  219. package/src/core/baseline-catalog/data/web-ui.json +60 -0
  220. package/src/core/baseline-catalog/index.js +121 -0
  221. package/src/core/errors/index.js +167 -0
  222. package/src/core/fixtures/register-canary/canary-prompt-01.json +18 -0
  223. package/src/core/fixtures/register-canary/canary-prompt-02.json +21 -0
  224. package/src/core/fixtures/register-canary/canary-prompt-03.json +17 -0
  225. package/src/core/isolation/index.js +60 -0
  226. package/src/core/mcp/framing.js +103 -0
  227. package/src/core/mcp/index.js +8 -0
  228. package/src/core/mcp/server.js +228 -0
  229. package/src/core/patterns/register-canary.js +209 -0
  230. package/src/core/patterns/req-shapes.js +158 -0
  231. package/src/core/patterns/services.js +358 -0
  232. package/src/core/patterns/ui-shapes.js +166 -0
  233. package/src/core/store/cn-resolve.js +134 -0
  234. package/src/core/store/derive-deps.js +93 -0
  235. package/src/core/store/ids.js +78 -0
  236. package/src/core/store/index.js +20 -0
  237. package/src/core/store/init.js +255 -0
  238. package/src/core/store/loader.js +211 -0
  239. package/src/core/store/tp-resolve.js +176 -0
  240. package/src/core/store/validator.js +191 -0
  241. package/src/core/store/walker.js +898 -0
  242. package/src/core/store/writer.js +1849 -0
  243. package/src/design/index.js +11 -0
  244. package/src/design/writer.js +271 -0
  245. package/src/finalise/detect.js +129 -0
  246. package/src/finalise/index.js +17 -0
  247. package/src/finalise/ingest.js +119 -0
  248. package/src/finalise/install.js +119 -0
  249. package/src/finalise/ship-without-verified.js +131 -0
  250. package/src/finalise/spawn.js +84 -0
  251. package/src/intake/fidelity.js +105 -0
  252. package/src/intake/index.js +6 -0
  253. package/src/intake/manifest-writer.js +100 -0
  254. package/src/intake/orchestrator.js +138 -0
  255. package/src/intake/validate.js +80 -0
  256. package/src/mcp/map-errors.js +131 -0
  257. package/src/mcp/prompts.js +49 -0
  258. package/src/mcp/resources.js +244 -0
  259. package/src/mcp/tools.js +1204 -0
  260. package/src/preflight/design-shapes.js +185 -0
  261. package/src/preflight/index.js +90 -0
  262. package/src/preflight/manifest-writer.js +264 -0
  263. package/src/preflight/scanner.js +206 -0
  264. package/src/preflight/secrets.js +134 -0
  265. package/src/preflight/session.js +246 -0
  266. package/src/query/attestation.js +285 -0
  267. package/src/query/coverage.js +308 -0
  268. package/src/query/formatters/json.js +21 -0
  269. package/src/query/formatters/mermaid.js +209 -0
  270. package/src/query/formatters/table.js +203 -0
  271. package/src/query/impact.js +173 -0
  272. package/src/query/index.js +9 -0
  273. package/src/query/trace.js +345 -0
  274. package/src/register-canary/fixture-loader.js +87 -0
  275. package/src/register-canary/index.js +10 -0
  276. package/src/register-canary/record-writer.js +132 -0
  277. package/src/register-canary/runner.js +156 -0
  278. package/src/req-baseline/gate.js +86 -0
  279. package/src/req-baseline/index.js +27 -0
  280. package/src/req-baseline/open-candidates.js +143 -0
  281. package/src/req-baseline/opt-out.js +195 -0
  282. package/src/req-baseline/sweep.js +230 -0
  283. package/src/req-detection/classifier.js +181 -0
  284. package/src/req-detection/index.js +9 -0
  285. package/src/req-detection/persist.js +55 -0
  286. package/src/review/index.js +325 -0
  287. package/src/review/mutation.js +117 -0
  288. package/src/review/ui-baseline-drift.js +138 -0
  289. package/src/server/index.js +178 -0
  290. package/src/server/routes.js +110 -0
  291. package/src/server/sse.js +118 -0
  292. package/src/setup/agent-setup.js +362 -0
  293. package/src/setup/identity-seed.js +104 -0
  294. package/src/setup/knowledge-seed.js +123 -0
  295. package/src/setup/managed-block.js +193 -0
  296. package/src/setup/managed-gitignore.js +166 -0
  297. package/src/setup/managed-markers.js +49 -0
  298. package/src/ui-baseline/defaults.js +119 -0
  299. package/src/ui-baseline/index.js +25 -0
  300. package/src/ui-baseline/manifest-writer.js +282 -0
  301. package/src/ui-baseline/session.js +178 -0
  302. package/src/ui-detection/classifier.js +192 -0
  303. package/src/verify/chain/index.js +190 -0
  304. package/src/verify/cli/cleanup.js +61 -0
  305. package/src/verify/cli/help.js +56 -0
  306. package/src/verify/cli/mcp.js +98 -0
  307. package/src/verify/cli/provision.js +71 -0
  308. package/src/verify/cli/report.js +71 -0
  309. package/src/verify/cli/run.js +155 -0
  310. package/src/verify/engine/brief.js +87 -0
  311. package/src/verify/engine/index.js +177 -0
  312. package/src/verify/engine/launcher.js +307 -0
  313. package/src/verify/mcp/tools.js +107 -0
  314. package/src/verify/profile/index.js +146 -0
  315. package/src/verify/provision/index.js +256 -0
  316. package/src/verify/report/index.js +139 -0
  317. package/src/verify/report/renderer.js +118 -0
  318. package/src/verify/verdict/index.js +246 -0
  319. package/src/view/doc-renderers/adr.js +44 -0
  320. package/src/view/doc-renderers/build-sequence.js +40 -0
  321. package/src/view/doc-renderers/fbs.js +128 -0
  322. package/src/view/doc-renderers/helpers.js +159 -0
  323. package/src/view/doc-renderers/index.js +12 -0
  324. package/src/view/doc-renderers/prd.js +45 -0
  325. package/src/view/doc-renderers/req.js +43 -0
  326. package/src/view/doc-renderers/tac.js +38 -0
  327. package/src/view/doc-renderers/tad.js +74 -0
  328. package/src/view/doc-renderers/test-suite.js +45 -0
  329. package/src/view/doc-renderers/user-story.js +63 -0
  330. package/src/view/html-page.js +462 -0
  331. package/src/view/index.js +63 -0
  332. package/src/view/live-client.js +338 -0
  333. package/src/view/mermaid-diagram.js +178 -0
  334. package/src/view/style.css +735 -0
  335. package/src/view/tree-model.js +152 -0
  336. package/src/view/vendored/mermaid.min.js +2607 -0
  337. package/src/view-supervisor/index.js +26 -0
  338. package/src/view-supervisor/logs.js +32 -0
  339. package/src/view-supervisor/manifest-writer.js +178 -0
  340. package/src/view-supervisor/persist-until.js +85 -0
  341. package/src/view-supervisor/supervisor.js +276 -0
  342. package/src/watch/index.js +152 -0
@@ -0,0 +1,246 @@
1
+ # Drop-in harness template
2
+
3
+ ## What this is
4
+
5
+ The block that wires an agent into the RCF loop. **The golden path is `rcf init`**: it writes this fragment into your project's agent-instructions files automatically - **both `CLAUDE.md` and `AGENTS.md` on a fresh project** (vendor-neutral by default), or an existing instructions file refreshed in place - inside `<!-- rcf:managed:begin -->` / `<!-- rcf:managed:end -->` markers so re-running init or `rcf doctor --fix` refreshes it in place. Paste it by hand only if you skipped the bootstrap (`rcf init --no-agent-setup`) or your harness reads instructions from somewhere non-standard. The fragment is complete as shipped and names no specific harness.
6
+
7
+ The `<!-- rcf:managed:begin -->` / `<!-- rcf:managed:end -->` marker convention was introduced in 0.6.0 (previously `<!-- rcf:begin -->` / `<!-- rcf:end -->`). If you are looking at an older repo whose file still carries the legacy pair, `rcf doctor --fix` migrates it in place; the MCP setup-funnel gate accepts either generation, so a legacy-inited repo is not spammed with setup notices while it waits to be migrated.
8
+
9
+ These are operating rules for the agent, not suggestions. They exist because the failure modes are known: agents fabricate documents single-shot instead of asking, silently drop the tech or test layer, declare scaffold TODOs "done", stop after one build item instead of driving the queue, patch a reported bug in code without fixing the spec that let it through, commit a technology stack the owner's hosting cannot run before anyone asked where the app would run, push an undecided owner into standing up accounts and billing for a thing nobody has committed to building, ship with nothing the owner can actually run without a deploy, claim a result is "verified" against a runtime the check never touched, and open the session by reciting rule numbers and document ids at a non-technical owner who needed three sentences and one question. The fragment forecloses each.
10
+
11
+ ## The fragment
12
+
13
+ ```markdown
14
+ ## RCF
15
+
16
+ This project uses RCF. The tree under `rcf/` is the requirements spine and
17
+ the `rcf` CLI plus the `rcf_*` MCP tools are the referee. The rules below
18
+ are hard rules, not suggestions. Work is defined by FBS spec bundles, not
19
+ by improvised task lists.
20
+
21
+ This block is managed by `rcf doctor`. Anything you write inside the
22
+ `rcf:managed:begin` / `rcf:managed:end` markers is rewritten when the
23
+ package upgrades. Add your own project rules outside the markers.
24
+
25
+ How to talk to your operator. The rules and ids in this file are your
26
+ working vocabulary, not the conversation's. The operator may be
27
+ non-technical; the method must be invisible in what they read.
28
+ - Plain language. Method terms (FBS, docs-review gate, elicitation
29
+ playbook) and document ids (PRD-001, REQ-002) belong in files,
30
+ commands and validation output. In conversation say "the build plan",
31
+ "the requirements", "a quick review of the docs". An id appears only
32
+ when pointing the operator at a specific file, or after the operator
33
+ uses it first.
34
+ - Never cite a rule. The rules below shape what you do, silently.
35
+ "Per RULE 1" means nothing to the operator and reads as bureaucracy.
36
+ - Concise and decision-led. Routine turns are one to three sentences:
37
+ what happened, what is next, and at most ONE question - the single
38
+ thing you need, stated first, never buried under sections. No
39
+ multi-section essays for routine turns.
40
+ - Self-serve before asking. Anything a command or file read can answer
41
+ (git state, remotes, whether a file exists), check it yourself; do
42
+ not ask the operator to look it up for you.
43
+ - Never re-ask a granted permission. Track what the operator has
44
+ authorised and act on it. Asking again reads as not listening.
45
+ - Tone: it is in hand. The operator steers; you drive. Confident
46
+ without hedging, and plainly honest when something is genuinely
47
+ blocked or ambiguous.
48
+
49
+ Before / after - the same first status after project setup:
50
+
51
+ Too much: four sections walking the operator through PRD-001,
52
+ TAD-001, BS-001, REQ-001 and US-101, quoting RULE 1 and RULE 5,
53
+ explaining the docs-review gate, asking whether a git remote exists,
54
+ re-asking for push permission already granted, with the one real
55
+ question (the product's name) at the bottom.
56
+
57
+ Right: "Brief read - good shape. I'm committing the scaffold and
58
+ pushing now; the remote's already wired. Next is a short round of
59
+ questions to pin down what we're building - your brief already
60
+ answers most of it. One thing first: keep 'Field Notes' as the
61
+ working name, or settle the real name now?"
62
+
63
+ ### RULE 1: Elicit first; never fabricate.
64
+
65
+ Before authoring or rewriting any RCF document, run the elicitation
66
+ playbook (`rcf guidance elicitation-playbook` on the CLI or the
67
+ `rcf_elicit_requirements` MCP prompt). Ask the stakeholder its questions
68
+ and wait for answers. Document content comes from stakeholder answers. If
69
+ a fact was not given to you, do not invent it. Ask. A chain written in
70
+ one shot without stakeholder input is a method violation, not a
71
+ deliverable.
72
+
73
+ ### RULE 2: The full chain is the deliverable.
74
+
75
+ All layers: PRD, REQ, US, AC, TS, TC, plus the tech side (TAD, TAC, ADR).
76
+ Do not drop a layer silently. Init-scaffold TODO placeholders are not a
77
+ finished state. Every scaffolded doc is either authored with the
78
+ stakeholder or its removal is explicitly agreed with them. If a layer
79
+ seems inapplicable, say so and get the stakeholder's agreement before
80
+ leaving it out.
81
+
82
+ ### RULE 3: The test layer is mandatory.
83
+
84
+ Author TS and TC documents and run `rcf coverage --strict`. Do not
85
+ declare the work done while coverage fails, unless the stakeholder has
86
+ explicitly accepted the gap.
87
+
88
+ ### RULE 4: A reported bug is a spec gap first.
89
+
90
+ When a bug is reported, do not jump to the code. First find the AC that
91
+ should have required the correct behaviour and the test that should have
92
+ caught it. Add or strengthen that AC (and its TS and TC) so the chain
93
+ catches this class of bug, then fix the code against the corrected spec.
94
+
95
+ ### RULE 5: Deploy target before stack; never commit a stack blind.
96
+
97
+ A technology stack must not be committed before the deploy target is
98
+ established, and the stack is constrained to what that target can host.
99
+ Choosing a stack the owner's hosting cannot run is a method violation,
100
+ not a technical preference. This is an ordering rule: it forbids a stack
101
+ ahead of the target. It does not require the owner to have a target, or
102
+ to want one.
103
+
104
+ Raise the question when a stack decision is actually due. If the owner
105
+ names a target, constrain the stack to it. If the owner does not know
106
+ and wants to settle it, run the hosting-choice walkthrough in the
107
+ elicitation playbook and isolate the sign-up, billing, token and
108
+ CLI-auth steps as the human account-holder's to do. Do not perform or
109
+ pretend them.
110
+
111
+ If the owner defers, is still exploring, or is not deploying, that is an
112
+ answer, not a blocker. Do not press for a provider and do not stand an
113
+ account up. Record the deferral as the ADR, hold back the live half of
114
+ what was deferred, and build to RULE 6's local preview. A deferred
115
+ capability's acceptance criteria are deferred with it, visibly, or
116
+ scoped to a stub the owner explicitly agreed to.
117
+
118
+ Capture the deploy target, or its deferral, and any stack constraint it
119
+ implies as an ADR on the project's own tree.
120
+
121
+ ### RULE 6: Every build lands a local preview.
122
+
123
+ A build is not done until it leaves a working, documented local preview
124
+ as its default outcome: a dev server, seeded data where the app needs
125
+ it, ideally started with one documented command. This holds whether or
126
+ not a host was named and whether or not a deploy happened. Remote
127
+ deployment is an addition on top of local preview, never a replacement
128
+ for it.
129
+
130
+ ### RULE 7: Verification claims name their runtime.
131
+
132
+ Every "verified" or "tested" claim, in the Test and Finalise stages and
133
+ in the PR body's verification section, names the runtime it was checked
134
+ against (for example, "verified against wrangler dev on localhost, not
135
+ the deployed Worker runtime"). A claim with no named runtime is
136
+ incomplete.
137
+
138
+ Never state or imply verification on a deployed runtime that was not
139
+ exercised. A green test suite is evidence about the runtime it ran on
140
+ and nothing more. A ship verdict comes only from the deployed runtime
141
+ or a declared runtime-parity claim.
142
+
143
+ ### RULE 8: Never skip the method for speed.
144
+
145
+ If a bug fix, polish item, or "small thing" would move faster by
146
+ bypassing RCF, that is the moment the method matters most. Do not offer
147
+ the operator a "skip the spec and just push a fix branch" option. If the
148
+ work is genuinely too small to warrant a full chain touch, say so and
149
+ propose the minimum spec update that keeps the chain honest. The
150
+ operator can choose to accept a shortcut. Offering one first is the
151
+ defect.
152
+
153
+ ### RULE 9: Write what you learn.
154
+
155
+ `rcf/knowledge/` is this project's memory. Every session, if you
156
+ learned something the next session should not have to relearn, write it
157
+ there. `notes/` for internal facts (decisions, gotchas, runtime facts,
158
+ "the CI matrix uses Node 22 not 24"). `docs/` for user-facing prose the
159
+ project surfaces. One topic per file. Grep the tree before asking the
160
+ stakeholder something you might already know. See
161
+ `rcf/knowledge/README.md` for the convention.
162
+
163
+ ### RULE 10: Read the operator profile.
164
+
165
+ If `rcf/.identity/profile.md` exists, read it at session start. It
166
+ describes the operator: name, role, working style, project-scoped
167
+ preferences. It is per-clone (gitignored by default), so it may hold
168
+ things the operator does not want in the shared repo. The absence of
169
+ the file is not an error; a fresh clone from another developer has no
170
+ profile of yours yet.
171
+
172
+ ### Session start
173
+
174
+ Run `rcf validate`. A broken tree is fixed or reported before anything
175
+ else. Run `rcf build` for queue state: what is done, in progress,
176
+ blocked. Run `rcf doctor` if the last upgrade of the package changed
177
+ these rules. The block you are reading may be out of date; `rcf doctor
178
+ --fix` rewrites it.
179
+
180
+ ### Build loop
181
+
182
+ Docs-review gate: when the tree has just been elicited, offer the
183
+ stakeholder a review of it before the first build. Do not roll from
184
+ elicitation straight into building without the offer.
185
+
186
+ Run `rcf build --next` to get the spec bundle for the next actionable
187
+ item, then execute the five-stage runbook it prints: Define, Build,
188
+ Review, Test, Finalise. Every stage ends in a commit. Drive the whole
189
+ queue, not one item. After each item's Finalise, loop `rcf build --next`
190
+ until it reports the queue complete. If your harness can spawn
191
+ sub-agents, run each FBS in its own worker so the driving context stays
192
+ clean across the queue: one write worker at a time.
193
+
194
+ Record lifecycle transitions with the exact mark commands the bundle
195
+ prints. Never mark backwards. Run `rcf validate` after any tree edit,
196
+ and `rcf trace <id>` or `rcf impact <id>` before touching anything with
197
+ dependents. PR bodies are evidence-first: lead with what was verified
198
+ and how, traced to AC and FBS ids, not a diff walk.
199
+
200
+ Run the fresh-context self-review every few FBS builds and once at the
201
+ end: a reviewer that drives the running app against its ACs, not one
202
+ that reads the code. Method: `rcf guidance build-cycle-playbook`,
203
+ section 16. It is the cheap in-loop check between builds, and it is not
204
+ the independent verification gate. `rcf finalise` runs that, and only
205
+ that writes `verified`.
206
+
207
+ If context gets unreliable on a large build, do not stall. Write a
208
+ next-session handover doc (queue state, the in-progress item, the next
209
+ actionable id), add a line to this file (outside the managed markers)
210
+ pointing the next session at it, then stop. A fresh session must resume
211
+ without re-elicitation.
212
+
213
+ ### Write discipline
214
+
215
+ Prefer the `rcf` verbs (`create`, `update`, `delete`, `link`) for tree
216
+ edits. After any hand edit to a file under `rcf/`, run `rcf validate`
217
+ before proceeding.
218
+
219
+ ### Escalation
220
+
221
+ If the bundle is ambiguous or contradicts the tree, stop and ask; do
222
+ not interpret. Never mark a stage done without its referee output.
223
+
224
+ ### MCP-wired harnesses
225
+
226
+ The same contract holds over the server's `rcf_*` tools and prompts.
227
+ Method depth, either wiring: the `rcf_execute_build_cycle` prompt, or
228
+ on the CLI `rcf guidance build-cycle-playbook`, for the build loop,
229
+ queue orchestration, PR authoring and bug triage. The
230
+ `rcf_elicit_requirements` prompt, or `rcf guidance elicitation-playbook`,
231
+ for elicitation, AC coverage depth and conversation integrity. Run `rcf
232
+ guidance` with no arguments to list every method document the installed
233
+ package ships.
234
+ ```
235
+
236
+ ## Customisation points
237
+
238
+ Two, and only two, are intended tuning: the optional PR-convention line at the end of the fragment, and your commit cadence if the driving workflow batches differently. Everything else is the method; editing it means running a different method. The RULE blocks in particular are load-bearing - they exist to stop observed failure modes.
239
+
240
+ ## Known limitation - the fragment has to be present
241
+
242
+ These rules only govern a session that loads this fragment. A project that was never initialised with `rcf init`, or whose fragment was stripped from `CLAUDE.md` / `AGENTS.md`, gets neither the deploy-target elicitation surface nor the runtime-provenance rules, and nothing here will flag its absence. Re-running `rcf init` restores the fragment; a session that cannot find it under the `<!-- rcf:managed:begin -->` / `<!-- rcf:managed:end -->` markers should say so rather than proceed as if the method were in force.
243
+
244
+ ## Check it took
245
+
246
+ Four checks. Ask the agent to state the loop; the answer should name the five stages and the mark commands. Ask what it does before authoring documents; the answer should name the elicitation playbook and stakeholder questions, not drafting. Watch its first `rcf build --next` cycle: the bundle's runbook should be followed stage by stage, with a commit at each stage end. And read its first message to the operator: it should be a few plain sentences ending in one clear question, with no rule numbers and no document-id inventory.
@@ -0,0 +1,63 @@
1
+ # Managed canonical assets
2
+
3
+ This directory holds the canonical texts that `rcf init` seeds and
4
+ `rcf doctor` maintains across upgrades. Each asset ships with the
5
+ package, so a consumer project always renders against the version it
6
+ installed. If you are reading this because you want to see what init or
7
+ doctor writes into an installed project, see the files below.
8
+
9
+ ## What lives here
10
+
11
+ - `agent-instructions-block.md`: the managed block that `rcf init`
12
+ writes into `CLAUDE.md` and `AGENTS.md` inside
13
+ `<!-- rcf:managed:begin -->` / `<!-- rcf:managed:end -->` markers, and
14
+ that `rcf doctor` maintains. This is user-facing product copy: read
15
+ it as if landing on a stranger's repo, because that is the reader
16
+ who sees it first. British English, no em-dashes, banned-tells
17
+ baseline honoured.
18
+ - `agent-instructions-block.hash`: SHA-256 of the block text above,
19
+ generated at package build time by `scripts/gen-managed-artefacts.mjs`
20
+ and shipped in the tarball. `rcf doctor` reads this to decide whether
21
+ an installed project's block is stale.
22
+ - `README.md`: this file. Explains the contract.
23
+
24
+ ## The managed-block contract
25
+
26
+ - **Inside the markers** (managed): rewritten wholesale on every
27
+ `rcf init` and `rcf doctor --fix`. Operator hand-edits to this region
28
+ are discarded on --fix. The canonical text ships with the package
29
+ and can change between minor versions.
30
+ - **Outside the markers** (operator): never touched by tooling. Any
31
+ operator prose, sections, imports or file additions are preserved
32
+ byte-for-byte. If the managed block is at the end of a file and the
33
+ operator adds a section beneath it, that section stays.
34
+ - **Drift detection is warn-only.** `rcf doctor` never writes; it
35
+ reports and exits 0 clean, 3 dirty. `rcf doctor --fix` is the only
36
+ path that repairs.
37
+ - **Never auto-repair.** No hook, no post-install script, no `rcf init`
38
+ or `rcf validate` sub-call invokes `--fix` implicitly. Init writes
39
+ the block on a fresh scaffold; doctor maintains an existing project.
40
+ Both are operator-typed.
41
+
42
+ ## Reading the canonical text from a consumer project
43
+
44
+ The block is exposed through the existing `rcf guidance` verb:
45
+
46
+ ```
47
+ rcf guidance managed/agent-instructions-block
48
+ ```
49
+
50
+ The `.hash` file is deliberately not addressable through guidance; it
51
+ is metadata the doctor reads, not prose an operator reads.
52
+
53
+ ## Contributing to the canonical text
54
+
55
+ Edits to `agent-instructions-block.md` land through the normal RCF
56
+ change flow (a spec that names the wording change, a rule that stays
57
+ British English and honours the banned-tells baseline). The
58
+ `scripts/gen-managed-artefacts.mjs` script regenerates
59
+ `agent-instructions-block.hash` and the mirrored fragment inside
60
+ `guidance/harness-template.md`; run it via the package build (the
61
+ `prepublishOnly` hook wires it into a release). Test AC-1.14 asserts
62
+ the harness-template fragment byte-matches this block after
63
+ regeneration.
@@ -0,0 +1 @@
1
+ 24d596ffef22c1f55fdad901ce424e443caade9cd44e8d659f17f14f1ef1ac47
@@ -0,0 +1,220 @@
1
+ ## RCF
2
+
3
+ This project uses RCF. The tree under `rcf/` is the requirements spine and
4
+ the `rcf` CLI plus the `rcf_*` MCP tools are the referee. The rules below
5
+ are hard rules, not suggestions. Work is defined by FBS spec bundles, not
6
+ by improvised task lists.
7
+
8
+ This block is managed by `rcf doctor`. Anything you write inside the
9
+ `rcf:managed:begin` / `rcf:managed:end` markers is rewritten when the
10
+ package upgrades. Add your own project rules outside the markers.
11
+
12
+ How to talk to your operator. The rules and ids in this file are your
13
+ working vocabulary, not the conversation's. The operator may be
14
+ non-technical; the method must be invisible in what they read.
15
+ - Plain language. Method terms (FBS, docs-review gate, elicitation
16
+ playbook) and document ids (PRD-001, REQ-002) belong in files,
17
+ commands and validation output. In conversation say "the build plan",
18
+ "the requirements", "a quick review of the docs". An id appears only
19
+ when pointing the operator at a specific file, or after the operator
20
+ uses it first.
21
+ - Never cite a rule. The rules below shape what you do, silently.
22
+ "Per RULE 1" means nothing to the operator and reads as bureaucracy.
23
+ - Concise and decision-led. Routine turns are one to three sentences:
24
+ what happened, what is next, and at most ONE question - the single
25
+ thing you need, stated first, never buried under sections. No
26
+ multi-section essays for routine turns.
27
+ - Self-serve before asking. Anything a command or file read can answer
28
+ (git state, remotes, whether a file exists), check it yourself; do
29
+ not ask the operator to look it up for you.
30
+ - Never re-ask a granted permission. Track what the operator has
31
+ authorised and act on it. Asking again reads as not listening.
32
+ - Tone: it is in hand. The operator steers; you drive. Confident
33
+ without hedging, and plainly honest when something is genuinely
34
+ blocked or ambiguous.
35
+
36
+ Before / after - the same first status after project setup:
37
+
38
+ Too much: four sections walking the operator through PRD-001,
39
+ TAD-001, BS-001, REQ-001 and US-101, quoting RULE 1 and RULE 5,
40
+ explaining the docs-review gate, asking whether a git remote exists,
41
+ re-asking for push permission already granted, with the one real
42
+ question (the product's name) at the bottom.
43
+
44
+ Right: "Brief read - good shape. I'm committing the scaffold and
45
+ pushing now; the remote's already wired. Next is a short round of
46
+ questions to pin down what we're building - your brief already
47
+ answers most of it. One thing first: keep 'Field Notes' as the
48
+ working name, or settle the real name now?"
49
+
50
+ ### RULE 1: Elicit first; never fabricate.
51
+
52
+ Before authoring or rewriting any RCF document, run the elicitation
53
+ playbook (`rcf guidance elicitation-playbook` on the CLI or the
54
+ `rcf_elicit_requirements` MCP prompt). Ask the stakeholder its questions
55
+ and wait for answers. Document content comes from stakeholder answers. If
56
+ a fact was not given to you, do not invent it. Ask. A chain written in
57
+ one shot without stakeholder input is a method violation, not a
58
+ deliverable.
59
+
60
+ ### RULE 2: The full chain is the deliverable.
61
+
62
+ All layers: PRD, REQ, US, AC, TS, TC, plus the tech side (TAD, TAC, ADR).
63
+ Do not drop a layer silently. Init-scaffold TODO placeholders are not a
64
+ finished state. Every scaffolded doc is either authored with the
65
+ stakeholder or its removal is explicitly agreed with them. If a layer
66
+ seems inapplicable, say so and get the stakeholder's agreement before
67
+ leaving it out.
68
+
69
+ ### RULE 3: The test layer is mandatory.
70
+
71
+ Author TS and TC documents and run `rcf coverage --strict`. Do not
72
+ declare the work done while coverage fails, unless the stakeholder has
73
+ explicitly accepted the gap.
74
+
75
+ ### RULE 4: A reported bug is a spec gap first.
76
+
77
+ When a bug is reported, do not jump to the code. First find the AC that
78
+ should have required the correct behaviour and the test that should have
79
+ caught it. Add or strengthen that AC (and its TS and TC) so the chain
80
+ catches this class of bug, then fix the code against the corrected spec.
81
+
82
+ ### RULE 5: Deploy target before stack; never commit a stack blind.
83
+
84
+ A technology stack must not be committed before the deploy target is
85
+ established, and the stack is constrained to what that target can host.
86
+ Choosing a stack the owner's hosting cannot run is a method violation,
87
+ not a technical preference. This is an ordering rule: it forbids a stack
88
+ ahead of the target. It does not require the owner to have a target, or
89
+ to want one.
90
+
91
+ Raise the question when a stack decision is actually due. If the owner
92
+ names a target, constrain the stack to it. If the owner does not know
93
+ and wants to settle it, run the hosting-choice walkthrough in the
94
+ elicitation playbook and isolate the sign-up, billing, token and
95
+ CLI-auth steps as the human account-holder's to do. Do not perform or
96
+ pretend them.
97
+
98
+ If the owner defers, is still exploring, or is not deploying, that is an
99
+ answer, not a blocker. Do not press for a provider and do not stand an
100
+ account up. Record the deferral as the ADR, hold back the live half of
101
+ what was deferred, and build to RULE 6's local preview. A deferred
102
+ capability's acceptance criteria are deferred with it, visibly, or
103
+ scoped to a stub the owner explicitly agreed to.
104
+
105
+ Capture the deploy target, or its deferral, and any stack constraint it
106
+ implies as an ADR on the project's own tree.
107
+
108
+ ### RULE 6: Every build lands a local preview.
109
+
110
+ A build is not done until it leaves a working, documented local preview
111
+ as its default outcome: a dev server, seeded data where the app needs
112
+ it, ideally started with one documented command. This holds whether or
113
+ not a host was named and whether or not a deploy happened. Remote
114
+ deployment is an addition on top of local preview, never a replacement
115
+ for it.
116
+
117
+ ### RULE 7: Verification claims name their runtime.
118
+
119
+ Every "verified" or "tested" claim, in the Test and Finalise stages and
120
+ in the PR body's verification section, names the runtime it was checked
121
+ against (for example, "verified against wrangler dev on localhost, not
122
+ the deployed Worker runtime"). A claim with no named runtime is
123
+ incomplete.
124
+
125
+ Never state or imply verification on a deployed runtime that was not
126
+ exercised. A green test suite is evidence about the runtime it ran on
127
+ and nothing more. A ship verdict comes only from the deployed runtime
128
+ or a declared runtime-parity claim.
129
+
130
+ ### RULE 8: Never skip the method for speed.
131
+
132
+ If a bug fix, polish item, or "small thing" would move faster by
133
+ bypassing RCF, that is the moment the method matters most. Do not offer
134
+ the operator a "skip the spec and just push a fix branch" option. If the
135
+ work is genuinely too small to warrant a full chain touch, say so and
136
+ propose the minimum spec update that keeps the chain honest. The
137
+ operator can choose to accept a shortcut. Offering one first is the
138
+ defect.
139
+
140
+ ### RULE 9: Write what you learn.
141
+
142
+ `rcf/knowledge/` is this project's memory. Every session, if you
143
+ learned something the next session should not have to relearn, write it
144
+ there. `notes/` for internal facts (decisions, gotchas, runtime facts,
145
+ "the CI matrix uses Node 22 not 24"). `docs/` for user-facing prose the
146
+ project surfaces. One topic per file. Grep the tree before asking the
147
+ stakeholder something you might already know. See
148
+ `rcf/knowledge/README.md` for the convention.
149
+
150
+ ### RULE 10: Read the operator profile.
151
+
152
+ If `rcf/.identity/profile.md` exists, read it at session start. It
153
+ describes the operator: name, role, working style, project-scoped
154
+ preferences. It is per-clone (gitignored by default), so it may hold
155
+ things the operator does not want in the shared repo. The absence of
156
+ the file is not an error; a fresh clone from another developer has no
157
+ profile of yours yet.
158
+
159
+ ### Session start
160
+
161
+ Run `rcf validate`. A broken tree is fixed or reported before anything
162
+ else. Run `rcf build` for queue state: what is done, in progress,
163
+ blocked. Run `rcf doctor` if the last upgrade of the package changed
164
+ these rules. The block you are reading may be out of date; `rcf doctor
165
+ --fix` rewrites it.
166
+
167
+ ### Build loop
168
+
169
+ Docs-review gate: when the tree has just been elicited, offer the
170
+ stakeholder a review of it before the first build. Do not roll from
171
+ elicitation straight into building without the offer.
172
+
173
+ Run `rcf build --next` to get the spec bundle for the next actionable
174
+ item, then execute the five-stage runbook it prints: Define, Build,
175
+ Review, Test, Finalise. Every stage ends in a commit. Drive the whole
176
+ queue, not one item. After each item's Finalise, loop `rcf build --next`
177
+ until it reports the queue complete. If your harness can spawn
178
+ sub-agents, run each FBS in its own worker so the driving context stays
179
+ clean across the queue: one write worker at a time.
180
+
181
+ Record lifecycle transitions with the exact mark commands the bundle
182
+ prints. Never mark backwards. Run `rcf validate` after any tree edit,
183
+ and `rcf trace <id>` or `rcf impact <id>` before touching anything with
184
+ dependents. PR bodies are evidence-first: lead with what was verified
185
+ and how, traced to AC and FBS ids, not a diff walk.
186
+
187
+ Run the fresh-context self-review every few FBS builds and once at the
188
+ end: a reviewer that drives the running app against its ACs, not one
189
+ that reads the code. Method: `rcf guidance build-cycle-playbook`,
190
+ section 16. It is the cheap in-loop check between builds, and it is not
191
+ the independent verification gate. `rcf finalise` runs that, and only
192
+ that writes `verified`.
193
+
194
+ If context gets unreliable on a large build, do not stall. Write a
195
+ next-session handover doc (queue state, the in-progress item, the next
196
+ actionable id), add a line to this file (outside the managed markers)
197
+ pointing the next session at it, then stop. A fresh session must resume
198
+ without re-elicitation.
199
+
200
+ ### Write discipline
201
+
202
+ Prefer the `rcf` verbs (`create`, `update`, `delete`, `link`) for tree
203
+ edits. After any hand edit to a file under `rcf/`, run `rcf validate`
204
+ before proceeding.
205
+
206
+ ### Escalation
207
+
208
+ If the bundle is ambiguous or contradicts the tree, stop and ask; do
209
+ not interpret. Never mark a stage done without its referee output.
210
+
211
+ ### MCP-wired harnesses
212
+
213
+ The same contract holds over the server's `rcf_*` tools and prompts.
214
+ Method depth, either wiring: the `rcf_execute_build_cycle` prompt, or
215
+ on the CLI `rcf guidance build-cycle-playbook`, for the build loop,
216
+ queue orchestration, PR authoring and bug triage. The
217
+ `rcf_elicit_requirements` prompt, or `rcf guidance elicitation-playbook`,
218
+ for elicitation, AC coverage depth and conversation integrity. Run `rcf
219
+ guidance` with no arguments to list every method document the installed
220
+ package ships.
@@ -0,0 +1,22 @@
1
+ {
2
+ "version": 1,
3
+ "description": "SHA-256 whitelist of the trimmed inner content between legacy `<!-- rcf:begin -->` / `<!-- rcf:end -->` markers, as written into CLAUDE.md/AGENTS.md by every pre-0.6.0 release. Doctor's `detectLegacyHandEdits` (packages/build/src/cli/doctor.js) hashes the extracted legacy inner content (trimmed) and treats any hash NOT in this whitelist as hand-edited. Fail-safe by default: unknown content requires the operator to pass `--force` in non-interactive mode. Spec §7.3 (packages/build/../specs/2026-07-30_init-hygiene-0.6.0-spec.md).",
4
+ "provenance": "Hashes derived deterministically from the repo's own git history. Each entry cites the release tag(s) whose `packages/build/guidance/harness-template.md` produced it. The pre-0.6.0 `agent-setup.js:loadHarnessFragment()` extracted `m[1].trim()` from the first ```markdown fence, then `writeAgentInstructions` wrote the block as `${MARKER_BEGIN}\\n${fragment}\\n${MARKER_END}`. Extraction via `fileText.slice(beginAt + MARKER_BEGIN.length, endAt)` returns `\\n${fragment}\\n`; `.trim()` recovers `fragment` verbatim. `sha256(fragment, utf8)` matches this whitelist. Regenerate with `node scripts/derive-legacy-fragment-hashes.mjs` if additional pre-0.6.0 revisions ever need coverage.",
5
+ "hashes": [
6
+ {
7
+ "hash": "3bc3c657f9b41b60bb3e0102e24c2f5e59baad96828e6647f02fbbbbea528f85",
8
+ "sources": ["build-v0.4.0"],
9
+ "fragmentLength": 5960
10
+ },
11
+ {
12
+ "hash": "607a8ce652e5a490726f7f5b4d56c4be0ec5682d18ba278c4642c31d0dc42ecd",
13
+ "sources": ["build-v0.5.0", "build-v0.5.1"],
14
+ "fragmentLength": 7044
15
+ },
16
+ {
17
+ "hash": "7e6402c683dadea9d77da8a5535bcedc49671f84531d1181c1c8a519ecf00929",
18
+ "sources": ["build-v0.5.2"],
19
+ "fragmentLength": 9147
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "docs": [
3
+ {"slug": "overview", "file": "overview.md", "title": "RCF overview"},
4
+ {"slug": "document-model", "file": "document-model.md", "title": "RCF document model"},
5
+ {"slug": "build-cycle", "file": "build-cycle.md", "title": "The RCF 5-stage build cycle"},
6
+ {"slug": "harness-template", "file": "harness-template.md", "title": "Drop-in harness template"},
7
+ {"slug": "managed/agent-instructions-block", "file": "managed/agent-instructions-block.md", "title": "The rcf doctor managed CLAUDE.md/AGENTS.md block (0.6.0 canonical text)"},
8
+ {"slug": "persona-programme", "file": "persona-programme.md", "title": "Persona programme: tail-interview template"}
9
+ ],
10
+ "prompts": [
11
+ {"name": "rcf_execute_build_cycle", "file": "build-cycle-playbook.md", "description": "How to execute the RCF 5-stage build cycle well: per-stage guidance, referee commands, failure modes, escalation rules. Fetch once per session, then drive rcf build --next."},
12
+ {"name": "rcf_elicit_requirements", "file": "elicitation-playbook.md", "description": "How to draw a valid RCF tree out of a conversation: question frames for PRD / REQ / US / AC, the testable-AC quality bar, TAC / ADR capture, FBS queue construction, and when to stop."}
13
+ ],
14
+ "platformInvariants": [
15
+ {
16
+ "id": "never-skip-rcf",
17
+ "title": "Never-skip-RCF",
18
+ "text": "**Never-skip-RCF.** The bug-fix loop uses the same five-stage cycle as the initial build (Define, Build, Review, Test, Finalise); there is no fast-path, and there is no operator ruling that opens one. Do not offer a shortcut. Do not phrase the choice as \"would you rather I skip the RCF wrapping\" or any wording that presents bypassing the chain as a legitimate option. The offer itself is the defect. The operator's refusal is not a sign the invariant held; it is a sign the invariant was tested and the guidance surface leaked. Fix the guidance surface."
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,48 @@
1
+ # RCF overview
2
+
3
+ The Requirements Confidence Framework (RCF) is a document model and a build method. It keeps every piece of shipped work connected, through explicit documents on disk, to the requirement that asked for it and the test that verifies it. The `rcf` CLI referees that structure mechanically; the agent and the human operating the loop supply the judgement.
4
+
5
+ ## The confidence gap
6
+
7
+ AI-driven development produces working code faster than a human can check it against intent. The result is a gap: the code runs, the tests pass, and nobody can say with confidence which stated requirement each change serves or whether every requirement is actually verified. RCF closes that gap structurally. Requirements, stories, acceptance criteria and tests are documents with typed references, so "does this code serve a requirement?" becomes a query, not an act of faith.
8
+
9
+ ## The document hierarchy
10
+
11
+ ```
12
+ PRD -> REQ -> US / AC -> TAC / ADR -> BS / FBS -> TS / TC
13
+ ```
14
+
15
+ - **PRD** - the product intent: the problem, who has it, what changes when it is solved.
16
+ - **REQ** - one testable capability the product must have.
17
+ - **US / AC** - a user story under a requirement, carrying acceptance criteria: observable, testable statements of done.
18
+ - **TAC / ADR** - the architecture as components (TAC) and decisions (ADR), referenced by the work that depends on them.
19
+ - **BS / FBS** - the build sequence and its functional build specifications: the ordered queue of work items, each scoped to a set of acceptance criteria.
20
+ - **TS / TC** - test suites and test cases, each pointing at the acceptance criteria they verify.
21
+
22
+ The full per-type detail is in `rcf://docs/document-model`.
23
+
24
+ ## The three traceability questions
25
+
26
+ Every RCF query is one of three questions:
27
+
28
+ 1. **Is it covered?** Does every acceptance criterion have a test case whose pointer resolves to a real test? (`rcf coverage`)
29
+ 2. **What does it trace to?** Which requirement asked for this; which stories, criteria and tests hang off it? (`rcf trace`)
30
+ 3. **What breaks if it changes?** Which documents and tests are invalidated by a change to this one? (`rcf impact`)
31
+
32
+ ## The build cycle in five lines
33
+
34
+ 1. **Define** - confirm the plan against every in-scope acceptance criterion in the spec bundle.
35
+ 2. **Build** - implement to those criteria and nothing beyond them.
36
+ 3. **Review** - validate the tree, then re-read the diff against every in-scope criterion.
37
+ 4. **Test** - write tests until strict coverage holds over the in-scope criteria.
38
+ 5. **Finalise** - CI green, merge, then record the lifecycle transition.
39
+
40
+ Every stage ends in a commit. The normative statement is `rcf://docs/build-cycle`; the deep guidance is the `rcf_execute_build_cycle` prompt.
41
+
42
+ ## Mechanical, not semantic
43
+
44
+ The tool referees structure, never adequacy. `rcf validate` proves every document matches its schema and every reference resolves; `rcf coverage` proves every acceptance criterion has a test case whose `testPointer` resolves to a real, named test in the tree - a test-case row with a dead or missing pointer is reported as `covered-unresolved`, never as coverage. Neither proves that the acceptance criteria capture the requirement's intent, or that a test asserts the right behaviour: a renamed test is caught, a gutted test that kept its name is not. That judgement belongs to the agent and the human operating the loop. The tool's contribution is to make the structural half of confidence mechanical, so judgement is spent only where judgement is needed.
45
+
46
+ ---
47
+
48
+ Canonical reference: https://stravica.ai/rcf-methodology/overview