clearotron 0.5.1 → 0.6.0-beta.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 (390) hide show
  1. package/.env.example +7 -7
  2. package/INSTALL.md +10 -10
  3. package/QUICKSTART.md +6 -6
  4. package/README.md +2 -2
  5. package/THIRD-PARTY-NOTICES.md +4 -4
  6. package/bin/README.md +2 -2
  7. package/bin/clearotron.mjs +1 -1
  8. package/bin/connect.mjs +1 -1
  9. package/bin/disconnect.mjs +1 -1
  10. package/bin/example.mjs +2 -2
  11. package/bin/grant.mjs +1 -1
  12. package/bin/onboard.mjs +78 -23
  13. package/bin/start.mjs +88 -33
  14. package/bin/update.mjs +13 -3
  15. package/build-info.json +2 -2
  16. package/docs/DELIVERY.md +1 -1
  17. package/docs/PORTAL.md +1 -1
  18. package/docs/RELEASES.md +1 -1
  19. package/docs/architecture/02-architecture.md +10 -2
  20. package/docs/architecture/03-run-lifecycle.md +6 -2
  21. package/docs/architecture/04-configuration-reference.md +3 -3
  22. package/docs/architecture/05-config-governance.md +5 -4
  23. package/docs/architecture/08-development-guide.md +4 -4
  24. package/docs/architecture/09-security-and-data.md +1 -1
  25. package/{driver/skills/clearance-search/SKILL.md → docs/architecture/retired-manuals/clearance-search-spine.md} +17 -30
  26. package/{driver/skills/clearance-search/templates/email/generic.md → docs/architecture/retired-manuals/email-generic.md} +1 -1
  27. package/{driver/skills/clearance-search → docs/architecture/retired-manuals}/template-formatting.md +3 -4
  28. package/docs/configuration.md +1 -1
  29. package/docs/decisions/0002-no-dark-functionality.md +5 -0
  30. package/driver/CHANGELOG.md +69 -0
  31. package/driver/README.md +11 -1
  32. package/driver/accepted-order.mjs +13 -5
  33. package/driver/attempt-rows.mjs +64 -0
  34. package/driver/attributed-span.mjs +1 -1
  35. package/driver/authority-trees.mjs +1 -1
  36. package/driver/band-shape.mjs +21 -3
  37. package/driver/best-draft.mjs +3 -3
  38. package/driver/blind-frame-record.mjs +2 -2
  39. package/driver/cancel.mjs +3 -2
  40. package/driver/carry-through.mjs +2 -2
  41. package/driver/citation-census.json +3 -3
  42. package/driver/clearance-variants-record.mjs +4 -10
  43. package/driver/common-law-coverage-status.mjs +3 -3
  44. package/driver/common-law-receipts.mjs +2 -2
  45. package/driver/commonlaw-carry-floor.json +3 -3
  46. package/driver/compare.mjs +1 -1
  47. package/driver/config-inventory.mjs +6 -79
  48. package/driver/consumption-ledger.mjs +2 -1
  49. package/driver/contract-arm2-baseline.json +2 -3
  50. package/driver/contract-dictation-registry.mjs +5 -0
  51. package/driver/contract-e3-backlog.mjs +45 -66
  52. package/driver/contract-e3-baseline.json +16 -16
  53. package/driver/contract-vocabulary.mjs +8 -6
  54. package/driver/corrections-feedforward.mjs +3 -1
  55. package/driver/coverage-form-io.mjs +7 -8
  56. package/driver/coverage-tool.mjs +1 -1
  57. package/driver/declination-tool.mjs +2 -2
  58. package/driver/degraded-parts.mjs +9 -9
  59. package/driver/demo-container.mjs +5 -4
  60. package/driver/demo-posture.mjs +17 -0
  61. package/driver/deploy-live-run-guard.mjs +19 -7
  62. package/driver/derived-state.mjs +2 -2
  63. package/driver/dev-portal.mjs +2 -1
  64. package/driver/dispatch-record.mjs +1 -1
  65. package/driver/disposition-tool.mjs +2 -1
  66. package/driver/doubt-closure-tool.mjs +2 -2
  67. package/driver/driver.config.mjs +35 -724
  68. package/driver/e2e-rounds.mjs +3 -4
  69. package/driver/engine/CONTRACT.md +3 -0
  70. package/driver/engine/README.md +2 -0
  71. package/driver/engine/anthropic-agent.mjs +13 -42
  72. package/driver/engine/auth.mjs +74 -0
  73. package/driver/engine/child-record.mjs +1 -1
  74. package/driver/engine/deny-authority-write.mjs +2 -2
  75. package/driver/engine/jx-turn.mjs +10 -2
  76. package/driver/engine/mcp/README.md +1 -1
  77. package/driver/engine/mcp/band-server.mjs +20 -13
  78. package/driver/engine/mcp/codex-config.mjs +1 -1
  79. package/driver/engine/mcp/declination-server.mjs +2 -3
  80. package/driver/engine/mcp/dispositions-server.mjs +3 -3
  81. package/driver/engine/mcp/gather-config.mjs +24 -19
  82. package/driver/engine/mcp/grid-provenance.mjs +1 -1
  83. package/driver/engine/mcp/held-answers.mjs +5 -5
  84. package/driver/engine/mcp/perplexity-server.mjs +16 -7
  85. package/driver/engine/mcp/recording-server.mjs +7 -6
  86. package/driver/engine/mcp/register-server.mjs +29 -0
  87. package/driver/engine/mcp/stdio-server.mjs +5 -5
  88. package/driver/engine/mcp/supplemental.mjs +9 -9
  89. package/driver/engine/openai-agent.mjs +5 -2
  90. package/driver/engine/registry.mjs +103 -0
  91. package/driver/engine/run-choices.mjs +162 -0
  92. package/driver/engine/stamps.mjs +35 -0
  93. package/driver/enqueue-schema.mjs +4 -4
  94. package/driver/envelope-settle.mjs +3 -2
  95. package/driver/feedback-issues.mjs +1 -1
  96. package/driver/feedback-mint.mjs +3 -2
  97. package/driver/feedback-store.mjs +3 -2
  98. package/driver/findings-model.mjs +1 -1
  99. package/driver/flag-snapshot.mjs +5 -4
  100. package/driver/floor-duty.mjs +3 -3
  101. package/driver/foreign-record-links.mjs +1 -1
  102. package/driver/frame-diff-record.mjs +2 -8
  103. package/driver/framework.mjs +1 -1
  104. package/driver/gate-metrics.mjs +10 -11
  105. package/driver/gateway.mjs +220 -839
  106. package/driver/goods-evidence.mjs +26 -14
  107. package/driver/jx-lanes.mjs +3 -3
  108. package/driver/jx-units.mjs +31 -37
  109. package/driver/jx.mjs +44 -59
  110. package/driver/knockout-assess-record.mjs +3 -3
  111. package/driver/knockout-caveats.mjs +21 -0
  112. package/driver/knockout-correction-record.mjs +58 -28
  113. package/driver/knockout-frame-record.mjs +2 -2
  114. package/driver/knockout-register-read.mjs +38 -21
  115. package/driver/knockout-register-record.mjs +5 -6
  116. package/driver/knockout-review-record.mjs +12 -11
  117. package/driver/ladder/model-gauge.mjs +88 -0
  118. package/driver/ladder/next-rung.mjs +296 -0
  119. package/driver/ladder/rescue.mjs +146 -0
  120. package/driver/ladder/stage-tools.mjs +57 -0
  121. package/driver/ladder/turn-failure.mjs +166 -0
  122. package/driver/log.mjs +2 -2
  123. package/driver/matter-frame-record.mjs +4 -4
  124. package/driver/methodology-witness.mjs +2 -2
  125. package/driver/named-band.mjs +60 -3
  126. package/driver/narrative-refutation-record.mjs +145 -42
  127. package/driver/one-build-per-run.mjs +62 -0
  128. package/driver/outbox-backoff.mjs +4 -4
  129. package/driver/owner-screen.mjs +0 -10
  130. package/driver/owner-use-check.mjs +2 -28
  131. package/driver/package.json +1 -1
  132. package/driver/partial-payload-baseline.json +1 -1
  133. package/driver/parts-not-completed.mjs +1 -1
  134. package/driver/pipeline-knockout.mjs +1015 -1001
  135. package/driver/pipeline.mjs +714 -9351
  136. package/driver/placement-decisions.mjs +2 -2
  137. package/driver/placement-form-io.mjs +7 -9
  138. package/driver/placement-union.mjs +0 -6
  139. package/driver/plan-stability.mjs +7 -10
  140. package/driver/portal-acks.mjs +3 -2
  141. package/driver/portal-confirmation.mjs +48 -0
  142. package/driver/portal-families.mjs +3 -2
  143. package/driver/portal-local-auth.mjs +1 -2
  144. package/driver/portal-routes/README.md +24 -0
  145. package/driver/portal-routes/admin.mjs +425 -0
  146. package/driver/portal-routes/compose.mjs +66 -0
  147. package/driver/portal-routes/config.mjs +118 -0
  148. package/driver/portal-routes/connect.mjs +283 -0
  149. package/driver/portal-routes/feedback.mjs +178 -0
  150. package/driver/portal-routes/me.mjs +165 -0
  151. package/driver/portal-routes/queue.mjs +64 -0
  152. package/driver/portal-routes/report.mjs +106 -0
  153. package/driver/portal-routes/run.mjs +508 -0
  154. package/driver/portal-routes/runs.mjs +127 -0
  155. package/driver/portal-routes/usage.mjs +82 -0
  156. package/driver/portal-runs.mjs +588 -0
  157. package/driver/portal-service.mjs +82 -2593
  158. package/driver/portal-static.mjs +3 -1
  159. package/driver/predelivery-lint.mjs +101 -9
  160. package/driver/production-pool-guard.mjs +1 -1
  161. package/driver/profiles.mjs +5 -4
  162. package/driver/progress.mjs +29 -24
  163. package/driver/publish/README.md +10 -5
  164. package/driver/publish/archive-tags.mjs +3 -2
  165. package/driver/publish/demo-marking.mjs +2 -2
  166. package/driver/publish/index.mjs +215 -140
  167. package/driver/publish/knockout.mjs +153 -107
  168. package/driver/publish/office-record-links.mjs +22 -0
  169. package/driver/publish/parse.mjs +20 -5
  170. package/driver/publish/pool-admin.mjs +9 -3
  171. package/driver/publish/render.mjs +11 -3
  172. package/driver/publish/report-dates.mjs +3 -4
  173. package/driver/publish/report-registry.mjs +7 -10
  174. package/driver/publish/seed-pool.mjs +3 -2
  175. package/driver/publish/shell.mjs +106 -0
  176. package/driver/publish/templates/report.css +9 -7
  177. package/driver/queue-order.mjs +4 -3
  178. package/driver/record-carry.mjs +0 -9
  179. package/driver/record-discard.mjs +1 -4
  180. package/driver/record-fold.mjs +3 -3
  181. package/driver/record-goods.mjs +79 -23
  182. package/driver/reference-score.mjs +2 -3
  183. package/driver/register-capabilities.mjs +0 -6
  184. package/driver/register-count.mjs +3 -2
  185. package/driver/register-digest-record.mjs +7 -7
  186. package/driver/register-fixture-marker.mjs +3 -3
  187. package/driver/register-plan.mjs +2 -2
  188. package/driver/register-records.mjs +2 -2
  189. package/driver/register-taint.mjs +3 -3
  190. package/driver/register-unit-record.mjs +48 -9
  191. package/driver/register-unreachable.mjs +4 -3
  192. package/driver/registry-fidelity.mjs +79 -34
  193. package/driver/repair-composers.mjs +14 -9
  194. package/driver/repair-digest.mjs +4 -6
  195. package/driver/repair-scope.mjs +3 -3
  196. package/driver/repair-targets.mjs +24 -9
  197. package/driver/repairs.mjs +44 -58
  198. package/driver/replay-archive.mjs +7 -7
  199. package/driver/report-card-record.mjs +3 -3
  200. package/driver/report-overview-record.mjs +4 -4
  201. package/driver/research-answers.mjs +38 -6
  202. package/driver/research-checks.mjs +4 -4
  203. package/driver/result-noun-fields.mjs +28 -11
  204. package/driver/review-addresses.mjs +163 -0
  205. package/driver/rule-shape.mjs +1 -1
  206. package/driver/run-delivered.mjs +340 -0
  207. package/driver/run-economics.mjs +8 -26
  208. package/driver/run-failed.mjs +545 -0
  209. package/driver/run-integrity.mjs +1 -1
  210. package/driver/run-outcome.mjs +314 -0
  211. package/driver/run-park.mjs +23 -0
  212. package/driver/run-quote.mjs +32 -0
  213. package/driver/run-record.mjs +352 -0
  214. package/driver/run-requirements.mjs +22 -0
  215. package/driver/run-shell.mjs +55 -0
  216. package/driver/runner.mjs +71 -33
  217. package/driver/saved-register-pages.mjs +4 -4
  218. package/driver/score-redaction.mjs +2 -2
  219. package/driver/search-policy.mjs +12 -13
  220. package/driver/settle-stamp.mjs +4 -3
  221. package/driver/skeptic-record.mjs +2 -2
  222. package/driver/skeptic-search.mjs +1 -1
  223. package/driver/skills/README.md +7 -7
  224. package/driver/skills/blind-frame/SKILL.md +1 -2
  225. package/driver/skills/case-law-citation/SKILL.md +9 -37
  226. package/driver/skills/case-law-citation/sources/courtlistener.md +1 -3
  227. package/driver/skills/case-law-citation/sources/eurlex.md +8 -11
  228. package/driver/skills/case-law-citation/sources/legaldatahunter.md +1 -1
  229. package/driver/skills/clearance-common-law/SKILL.md +45 -111
  230. package/driver/skills/clearance-common-law/perplexity-prompts.md +7 -79
  231. package/driver/skills/clearance-register/SKILL.md +15 -33
  232. package/driver/skills/clearance-register/digest.md +35 -96
  233. package/driver/skills/clearance-register/providers/clarivate.md +2 -2
  234. package/driver/skills/clearance-register/providers/corsearch.md +5 -5
  235. package/driver/skills/clearance-register/providers/euipo.md +1 -2
  236. package/driver/skills/clearance-register/providers/free-tier.md +0 -19
  237. package/driver/skills/clearance-register/providers/signa.md +6 -25
  238. package/driver/skills/clearance-register/providers/uspto-local.md +0 -24
  239. package/driver/skills/clearance-register/register-recipes.md +8 -15
  240. package/driver/skills/clearance-register/status-rules.md +6 -24
  241. package/driver/skills/clearance-register/unit.md +11 -20
  242. package/driver/skills/clearance-search/delivery-contract.md +24 -120
  243. package/driver/skills/clearance-search/field-doctrine-pharma.md +1 -5
  244. package/driver/skills/clearance-search/firm-wide-reasoning.md +24 -43
  245. package/driver/skills/clearance-search/phase2-execution.md +29 -77
  246. package/driver/skills/clearance-search/report-prose.md +3 -4
  247. package/driver/skills/clearance-search/risk-framework-demo.md +1 -1
  248. package/driver/skills/clearance-search/risk-framework-triage.manifest.json +3 -3
  249. package/driver/skills/clearance-search/risk-framework-triage.md +7 -9
  250. package/driver/skills/clearance-search/risk-framework.manifest.json +1 -1
  251. package/driver/skills/clearance-search/risk-framework.md +1 -1
  252. package/driver/skills/clearance-search/synthesis-rules.md +30 -107
  253. package/driver/skills/clearance-search/worked-examples.md +5 -5
  254. package/driver/skills/clearance-variants/SKILL.md +46 -45
  255. package/driver/skills/clearance-variants/transliteration-scripts.md +4 -4
  256. package/driver/skills/frame-diff/SKILL.md +1 -1
  257. package/driver/skills/knockout-assess/SKILL.md +6 -14
  258. package/driver/skills/knockout-frame/SKILL.md +1 -1
  259. package/driver/skills/matter-frame/SKILL.md +7 -12
  260. package/driver/skills/matter-frame/watchlist-reference.md +1 -4
  261. package/driver/skills/narrative-refutation/SKILL.md +20 -30
  262. package/driver/skills/placement-inquiry/SKILL.md +10 -20
  263. package/driver/skills-store-provenance.mjs +1 -1
  264. package/driver/stage-context.mjs +32 -35
  265. package/driver/stage-freshness.mjs +127 -11
  266. package/driver/stages-knockout.mjs +49 -22
  267. package/driver/stages.mjs +89 -288
  268. package/driver/status-snapshot.mjs +2 -1
  269. package/driver/steps/correction-cycle.mjs +311 -0
  270. package/driver/steps/corrections.mjs +644 -0
  271. package/driver/steps/delivery.mjs +1287 -0
  272. package/driver/steps/frame-comparison.mjs +927 -0
  273. package/driver/steps/intake.mjs +84 -0
  274. package/driver/steps/open-run.mjs +419 -0
  275. package/driver/steps/overview-and-cards.mjs +899 -0
  276. package/driver/steps/placement-and-digest.mjs +23 -0
  277. package/driver/steps/register-sweep.mjs +1563 -0
  278. package/driver/steps/skeptic-and-follow-up.mjs +836 -0
  279. package/driver/steps/synthesis.mjs +261 -0
  280. package/driver/steps/verdict-gate.mjs +968 -0
  281. package/driver/suite-census.json +456 -96
  282. package/driver/surface-exit-verdict.mjs +0 -8
  283. package/driver/synthesis-record.mjs +72 -6
  284. package/driver/terminal-clamp.mjs +10 -0
  285. package/driver/tokens.mjs +8 -62
  286. package/driver/tool-calls.mjs +2 -2
  287. package/driver/unexecuted-asserts.json +2 -2
  288. package/driver/unit-state-verdict.mjs +1 -1
  289. package/driver/usage-ledger.mjs +2 -1
  290. package/driver/verify-knockout.mjs +20 -35
  291. package/driver/verify.mjs +47 -36
  292. package/driver/web-grid.mjs +3 -4
  293. package/driver/whatif-memo-run.mjs +2 -2
  294. package/driver/whatif-queue.mjs +4 -3
  295. package/driver/withheld-families.mjs +14 -15
  296. package/driver/worker-heartbeat.mjs +3 -2
  297. package/driver/write-up-form.mjs +0 -3
  298. package/mcp-server/CHANGELOG.md +8 -0
  299. package/mcp-server/http-server.mjs +11 -12
  300. package/mcp-server/lib/brief.mjs +22 -4
  301. package/mcp-server/lib/events.mjs +2 -2
  302. package/mcp-server/lib/evidence.mjs +3 -2
  303. package/mcp-server/lib/findings.mjs +2 -1
  304. package/mcp-server/lib/knockout.mjs +9 -10
  305. package/mcp-server/lib/ops.mjs +9 -9
  306. package/mcp-server/lib/runs.mjs +9 -10
  307. package/mcp-server/lib/trace.mjs +1 -1
  308. package/mcp-server/lib/whatif.mjs +2 -3
  309. package/mcp-server/package.json +1 -1
  310. package/mcp-server/server.mjs +5 -5
  311. package/node_modules/buffers/package.json +1 -1
  312. package/package.json +2 -1
  313. package/portal-ui/dist/assets/{index-fPqAU0sx.js → index-CYaO2ygd.js} +26 -14
  314. package/portal-ui/dist/assets/{index-AtB9ZpDH.css → index-izLa9apq.css} +2 -2
  315. package/portal-ui/dist/index.html +4 -4
  316. package/portal-ui/package.json +3 -3
  317. package/providers/README.md +1 -1
  318. package/providers/_shared/answer-memory.mjs +4 -5
  319. package/providers/_shared/execute-plan.mjs +48 -1
  320. package/providers/_shared/records-from-search.mjs +46 -0
  321. package/providers/clarivate/README.md +2 -2
  322. package/providers/clarivate/src/adapter.js +147 -0
  323. package/providers/clarivate/src/core.js +1 -14
  324. package/{driver/engine/mcp/clarivate-server.mjs → providers/clarivate/src/mount.js} +5 -10
  325. package/providers/corsearch/README.md +3 -3
  326. package/providers/corsearch/src/adapter.js +80 -0
  327. package/providers/corsearch/src/core.js +14 -11
  328. package/{driver/engine/mcp/corsearch-server.mjs → providers/corsearch/src/mount.js} +5 -10
  329. package/providers/euipo/README.md +2 -2
  330. package/providers/euipo/src/adapter.js +85 -0
  331. package/providers/euipo/src/core.js +1 -1
  332. package/providers/euipo/src/euipo-client.js +1 -2
  333. package/{driver/engine/mcp/euipo-server.mjs → providers/euipo/src/mount.js} +5 -10
  334. package/providers/free-tier/README.md +2 -2
  335. package/providers/free-tier/src/adapter.js +127 -0
  336. package/{driver/engine/mcp/free-tier-server.mjs → providers/free-tier/src/mount.js} +5 -10
  337. package/providers/jx-subclass/coverage.mjs +1 -6
  338. package/providers/jx-subclass/score-truth.mjs +2 -1
  339. package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
  340. package/providers/oauth-mcp-bridge/package.json +1 -1
  341. package/providers/perplexity/src/core.js +2 -2
  342. package/providers/signa/README.md +2 -2
  343. package/providers/signa/src/adapter.js +157 -0
  344. package/providers/signa/src/capabilities.js +0 -3
  345. package/providers/signa/src/core.js +2 -2
  346. package/{driver/engine/mcp/signa-server.mjs → providers/signa/src/mount.js} +7 -12
  347. package/providers/signa/src/offices.generated.js +17 -15
  348. package/providers/uspto-local/README.md +1 -1
  349. package/providers/uspto-local/bin/verify-index.mjs +1 -1
  350. package/providers/uspto-local/src/adapter.js +75 -0
  351. package/{driver/engine/mcp/uspto-local-server.mjs → providers/uspto-local/src/mount.js} +5 -10
  352. package/scripts/band-shape-probe.mjs +2 -2
  353. package/scripts/citation-line-check.mjs +7 -7
  354. package/scripts/compare.mjs +1 -1
  355. package/scripts/dead-names.mjs +2 -2
  356. package/scripts/e2e-first-time.mjs +19 -7
  357. package/scripts/e2e.mjs +13 -13
  358. package/scripts/engine-probe.mjs +1 -1
  359. package/scripts/env-audit.mjs +7 -4
  360. package/scripts/env-classify.mjs +5 -1
  361. package/scripts/feedback-mint.mjs +1 -1
  362. package/scripts/freeze-example-run.mjs +7 -7
  363. package/scripts/mint-suite-census.mjs +2 -2
  364. package/scripts/nightly-notice.mjs +1 -1
  365. package/scripts/release-cut-decision.mjs +7 -2
  366. package/scripts/release-note-required.mjs +26 -9
  367. package/scripts/release-notes-lint.mjs +3 -2
  368. package/scripts/release-version-pr-checks.mjs +1 -1
  369. package/scripts/render-check.mjs +1 -1
  370. package/scripts/settings-render-check.mjs +23 -3
  371. package/scripts/test-run.mjs +5 -5
  372. package/scripts/travelling-predicates.mjs +1 -1
  373. package/scripts/undeclared-field-census.mjs +1 -1
  374. package/scripts/unexecuted-asserts.mjs +3 -3
  375. package/scripts/verify-publishable.mjs +1 -1
  376. package/shared/client-door.mjs +1 -1
  377. package/shared/connect-clients.mjs +1 -1
  378. package/shared/connector-signin-probe.mjs +1 -1
  379. package/shared/customer-store.mjs +3 -2
  380. package/shared/env-aliases.mjs +1 -1
  381. package/shared/invocation.mjs +14 -2
  382. package/shared/names-in-force.mjs +2 -0
  383. package/shared/register-selection.mjs +2 -2
  384. package/shared/store-in-repo.mjs +3 -3
  385. package/shared/summary-blocks.mjs +0 -3
  386. package/shared/trigger-lane.mjs +1 -1
  387. package/shared/vacuous-pass.mjs +2 -2
  388. package/shared/verb-shim.mjs +4 -2
  389. package/vendor/buffers/package.json +1 -1
  390. package/node_modules/exceljs/README.md +0 -3023
package/bin/start.mjs CHANGED
@@ -13,6 +13,7 @@
13
13
  // n+1 and the client door n+2 unless each is set explicitly
14
14
  // npx clearotron start --demo the demo posture: own data directory, nothing persisted
15
15
  // npx clearotron start --no-worker do not drain the queue here; run the worker yourself
16
+ // npx clearotron start --background run as services that survive closing the terminal; `clearotron stop` stops them
16
17
  // npx clearotron start --help
17
18
  //
18
19
  // It is NOT `npm run example`. Demo replays a frozen example report with no credentials, no model and no
@@ -351,6 +352,39 @@ export function clientDoorOwner({ probeCode = null, unitActive = null, unitPort
351
352
  return unitPort === port ? "ours" : "stranger";
352
353
  }
353
354
 
355
+ /**
356
+ * What `start` says about the grants file it wrote: the file first, then what was filed in it.
357
+ *
358
+ * THE FILE IS NAMED BEFORE "filed there". A file that already named this person, given an organisation for
359
+ * the first time, changed only the organisation; the line naming the file printed only when the file was
360
+ * created or a person was added, so "there" pointed at nothing (measured in testing, 2026-11-17).
361
+ */
362
+ export function grantsFileLines({ existed, changed, path, user, organisation, organisations = 0 }) {
363
+ const lines = [];
364
+ if (!existed) lines.push(` created ${path} — ${user}: Run, Manage, access to everything`);
365
+ else if (changed.includes("person"))
366
+ lines.push(` grants ${path} named nobody, so ${user} was added: Run, Manage, access to everything`);
367
+ else if (changed.includes("organisation")) lines.push(` grants ${path}`);
368
+ if (changed.includes("organisation")) lines.push(` organisation "${organisation}", filed there — rename it there too`);
369
+ else if (changed.includes("person") && !organisations)
370
+ lines.push(` no organisation named yet — \`${reachableCommand('start --organisation "<name>"')}\` files the first one`);
371
+ return lines;
372
+ }
373
+
374
+ /**
375
+ * `systemctl --user show <unit>`, its properties as an object. Its stderr is CAPTURED, never inherited:
376
+ * where the user bus cannot be reached, systemctl writes "Failed to connect to bus: No medium found", and
377
+ * an inherited stderr printed that line into start's own output with nothing around it. A read that fails
378
+ * still throws, so each caller keeps its own could-not-look answer.
379
+ */
380
+ export function systemctlShow(unit, props, run = execFileSync) {
381
+ const out = run("systemctl", ["--user", "show", unit, ...props.flatMap((p) => ["-p", p])],
382
+ { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
383
+ return Object.fromEntries(out.split("\n").filter(Boolean).map((l) => {
384
+ const i = l.indexOf("="); return [l.slice(0, i), l.slice(i + 1)];
385
+ }));
386
+ }
387
+
354
388
  /**
355
389
  * The two reads `clientDoorOwner` needs, against the live box.
356
390
  *
@@ -358,14 +392,10 @@ export function clientDoorOwner({ probeCode = null, unitActive = null, unitPort
358
392
  * daemon-reload below for why this file does not pass it yet. A read that throws answers `null`, which
359
393
  * `clientDoorOwner` turns into "unknown" and therefore into today's refusal.
360
394
  */
361
- function liveClientDoor(unitEnvFile = unitEnvPath(), run = execFileSync) {
395
+ export function liveClientDoor(unitEnvFile = unitEnvPath(), run = execFileSync) {
362
396
  let unitActive = null, unitPort = null;
363
397
  try {
364
- const out = run("systemctl", ["--user", "show", CLIENT_DOOR_UNIT, "-p", "ActiveState", "-p", "SubState"],
365
- { encoding: "utf8" });
366
- const f = Object.fromEntries(out.split("\n").filter(Boolean).map((l) => {
367
- const i = l.indexOf("="); return [l.slice(0, i), l.slice(i + 1)];
368
- }));
398
+ const f = systemctlShow(CLIENT_DOOR_UNIT, ["ActiveState", "SubState"], run);
369
399
  if (f.ActiveState !== undefined) unitActive = f.ActiveState === "active" && f.SubState === "running";
370
400
  } catch { /* null — a could-not-look, which refuses */ }
371
401
  try {
@@ -415,13 +445,13 @@ export function clientDoorDownLines({ host, port, exited }) {
415
445
  */
416
446
  export const DEMO_ROUTINE_LINES = [
417
447
  /^auth ON — /,
418
- /^key path: none configured /,
419
- /^roster: \d+ customer\(s\) from /,
448
+ /^key path: none \(TRADEMARK_MCP_KEY_SOCKET is not set\)/,
449
+ /^roster: \d+ customers? from /,
420
450
  /^This is `clearotron demo`: /,
421
451
  /^listening on http:\/\//,
422
452
  /^audit log: /,
423
453
  /^trigger lane: the engine door takes an access key, and this portal holds one\.$/,
424
- /^trigger lane: ops token sub=/,
454
+ /^trigger lane: the Start button may start and stop searches for /,
425
455
  /^settings surface ON — /,
426
456
  /^saved searches ON — /,
427
457
  /^brief reading OFF — this is the demo/,
@@ -991,14 +1021,44 @@ export function childEnv({ ports, paths, user, portalSecret, tokenSecret, opsTok
991
1021
  // the wrong direction. Re-exported so every existing reader keeps working.
992
1022
  export { mergeEnvFile } from "../shared/env-file-merge.mjs";
993
1023
 
1024
+ /**
1025
+ * The supervisor's writers, which stop at a terminal that has gone.
1026
+ *
1027
+ * CLOSING THE WINDOW TURNED THE TEARDOWN INTO A LOOP (measured on Linux, 2026-11-10). The hangup reached
1028
+ * the teardown, whose first act is a line on the screen. The write failed (EIO from a hung-up terminal,
1029
+ * EPIPE from a closed pipe), and with no listener on the stream the failure became an uncaught exception.
1030
+ * Its handler wrote the exception to the same dead terminal, which failed again, on the next tick, without
1031
+ * end. The services had already been told to stop, so they stopped, but the timers the teardown waits on
1032
+ * never ran: this process held a full core, ignored SIGTERM because it was already stopping, and left the
1033
+ * demo's folder and its running record behind.
1034
+ *
1035
+ * Each stream now has a listener, so a failed write is an event rather than an exception, and a stream
1036
+ * that has failed once is written to no more: there is nobody left to read it. Per stream, because
1037
+ * `start | head` closes stdout alone, and the refusals on stderr still have a reader.
1038
+ */
1039
+ export function terminalWriters({ stdout = process.stdout, stderr = process.stderr } = {}) {
1040
+ const gone = new Set();
1041
+ const writer = (stream) => {
1042
+ stream.on("error", () => { gone.add(stream); });
1043
+ return (text) => { if (!gone.has(stream)) stream.write(text); };
1044
+ };
1045
+ const toOut = writer(stdout);
1046
+ const toErr = stderr === stdout ? toOut : writer(stderr);
1047
+ return {
1048
+ say: (s = "") => toOut(`${s}\n`),
1049
+ err: (s) => toErr(`${s}\n`),
1050
+ toErr,
1051
+ gone: (stream = stdout) => gone.has(stream),
1052
+ };
1053
+ }
1054
+
994
1055
 
995
1056
  // ── everything below runs only as a command ──────────────────────────────────────────────────────────
996
1057
 
997
1058
  const isMain = isEntrypoint(import.meta.url);
998
1059
  if (isMain) {
999
1060
  const argv = process.argv.slice(2);
1000
- const say = (s = "") => process.stdout.write(`${s}\n`);
1001
- const err = (s) => process.stderr.write(`${s}\n`);
1061
+ const { say, err, toErr } = terminalWriters();
1002
1062
  // Flipped at the first state-changing act (the third criterion): a refusal AFTER
1003
1063
  // writes must say what survives and that re-running is safe — the reader's only question at that
1004
1064
  // moment, and one the screen never answered while the writes sat above the port probe.
@@ -1546,12 +1606,8 @@ if (isMain) {
1546
1606
  try { atomicWrite(paths.grants, `${JSON.stringify(seeded.grants, null, 2)}\n`); }
1547
1607
  catch (e) { fatal(`could not write the grants file at ${paths.grants} (${String(e?.message ?? e)}).`); }
1548
1608
  }
1549
- if (!existing) say(` created ${paths.grants} — ${user}: Run, Manage, access to everything`);
1550
- else if (seeded.changed.includes("person"))
1551
- say(` grants ${paths.grants} named nobody, so ${user} was added: Run, Manage, access to everything`);
1552
- if (seeded.changed.includes("organisation")) say(` organisation "${organisation}", filed there — rename it there too`);
1553
- else if (seeded.changed.includes("person") && !Object.keys(seeded.grants.tenants ?? {}).length)
1554
- say(` no organisation named yet — \`${reachableCommand('start --organisation "<name>"')}\` files the first one`);
1609
+ for (const line of grantsFileLines({ existed: Boolean(existing), changed: seeded.changed, path: paths.grants, user,
1610
+ organisation, organisations: Object.keys(seeded.grants.tenants ?? {}).length })) say(line);
1555
1611
  // REPORTED, NOT REPAIRED. A file that names other people is somebody's decision, and adding this
1556
1612
  // address to it would give access to everything to an address nobody enrolled.
1557
1613
  if (seeded.unadmitted)
@@ -1585,7 +1641,7 @@ if (isMain) {
1585
1641
  write: (f, text) => writeFileSync(f, text, { mode: 0o600 }),
1586
1642
  read: (f) => readFileSync(f, "utf8"),
1587
1643
  });
1588
- if (r.created) say(` created ${denylist} (the revocation list — a key revoked before it existed was not revoked at all)`);
1644
+ if (r.created) say(` created ${denylist} (the list of keys you have revoked)`);
1589
1645
  } catch (e) {
1590
1646
  // FATAL, and this is the one place that judgement belongs. A door that cannot consult its
1591
1647
  // revocation list is a door that cannot be revoked from, and starting it anyway is the failure
@@ -1805,16 +1861,16 @@ if (isMain) {
1805
1861
  // snapshot could not be written", naming a deployed server's archive path, followed by the portal
1806
1862
  // saying its configuration page cannot answer. Exactly the reader the paragraph above names.
1807
1863
  //
1808
- // ONLY IN DEMO MODE. On a real start an operator's own `CLEAROTRON_REPORTS_DIR` deliberately wins
1809
- // over the computed path (see the resolution site), and forcing `paths.pool` here would overrule
1810
- // them. `envs.worker` is the shared block — the install's paths in both spellings and nothing
1811
- // else — so engine and provider identity still resolve from the real environment and report,
1812
- // honestly, that a demo carries no credentials.
1864
+ // A REAL START HANDS IT THE SAME PATHS, for the same reason. On an install with no settings yet, the
1865
+ // snapshot read an environment that named no pool and printed the hosted-archive refusal on the first
1866
+ // screen, while every service this command started had been handed the install's pool. An operator's own
1867
+ // `CLEAROTRON_REPORTS_DIR` still wins: `startPaths` applies it before anything here reads `paths.pool`.
1868
+ // A reader that resolves no paths of its own (doctor, the services, the commands) still meets the refusal.
1869
+ // `envs.worker` is the shared block — the install's paths in both spellings and nothing else — so engine
1870
+ // and provider identity still resolve from the real environment and report, honestly, what is missing.
1813
1871
  try {
1814
1872
  const { writeFlagSnapshot } = await import("../driver/flag-snapshot.mjs");
1815
- const { path } = await writeFlagSnapshot(DEMO
1816
- ? { quiet: true, env: { ...process.env, ...envs.worker }, poolRoot: paths.pool }
1817
- : { quiet: true });
1873
+ const { path } = await writeFlagSnapshot({ quiet: true, env: { ...process.env, ...envs.worker }, poolRoot: paths.pool });
1818
1874
  say(` configuration snapshot: ${path}`);
1819
1875
  } catch (e) {
1820
1876
  err(` WARNING: the configuration snapshot could not be written (${String(e?.message ?? e)}).`);
@@ -2210,8 +2266,7 @@ if (isMain) {
2210
2266
  const type = unitTypeOf(u);
2211
2267
  let f = {};
2212
2268
  try {
2213
- const out = execFileSync("systemctl", ["--user", "show", u, "-p", "ActiveState", "-p", "SubState", "-p", "NRestarts", "-p", "UnitFileState"], { encoding: "utf8" });
2214
- f = Object.fromEntries(out.trim().split("\n").map((l) => l.split("=")));
2269
+ f = systemctlShow(u, ["ActiveState", "SubState", "NRestarts", "UnitFileState"]);
2215
2270
  } catch { /* unreadable state is reported below as not-running */ }
2216
2271
  const verdict = unitHealthVerdict({ type, activeState: f.ActiveState ?? null, subState: f.SubState ?? null,
2217
2272
  unitFileState: f.UnitFileState ?? null, nRestarts: f.NRestarts ?? 0 });
@@ -2268,10 +2323,10 @@ if (isMain) {
2268
2323
  // last lines put on the screen before the sentence that points at them, so nothing that explains a failure stays only in the file.
2269
2324
  const DEMO_STARTUP_LOG = DEMO ? join(paths.base, "startup.log") : null;
2270
2325
  const fileDemoLine = (line) => {
2271
- try { appendFileSync(DEMO_STARTUP_LOG, `${line}\n`); } catch { process.stderr.write(`${line}\n`); return; }
2272
- if (demoLineOnScreen(line)) process.stderr.write(`${line}\n`);
2326
+ try { appendFileSync(DEMO_STARTUP_LOG, `${line}\n`); } catch { err(line); return; }
2327
+ if (demoLineOnScreen(line)) err(line);
2273
2328
  };
2274
- const showFiledTail = (rec) => { if (DEMO) for (const line of rec.tail) process.stderr.write(`${line}\n`); };
2329
+ const showFiledTail = (rec) => { if (DEMO) for (const line of rec.tail) err(line); };
2275
2330
  const start = (name, script, env, { args = [], fatal = true, clientDoor = false } = {}) => {
2276
2331
  const child = spawn(process.execPath, [join(REPO, script), ...args], {
2277
2332
  cwd: REPO,
@@ -2310,7 +2365,7 @@ if (isMain) {
2310
2365
  const keep = (line) => { if (line.trim()) tail.push(line); while (tail.length > 12) tail.shift(); };
2311
2366
  child.stderr?.setEncoding("utf8");
2312
2367
  child.stderr?.on("data", (chunk) => {
2313
- if (!DEMO) process.stderr.write(chunk);
2368
+ if (!DEMO) toErr(chunk);
2314
2369
  const parts = (pending + String(chunk)).split("\n");
2315
2370
  pending = parts.pop() ?? "";
2316
2371
  for (const line of parts) { keep(line); if (DEMO) fileDemoLine(line); }
@@ -2587,7 +2642,7 @@ if (isMain) {
2587
2642
  // A door that exited printed why; one still up when the wait ran out printed nothing, and is not sent there.
2588
2643
  for (const line of clientDoorDownLines({ host: HOST, port: ports.client, exited: clientDoor?.child?.exitCode !== null })) say(line);
2589
2644
  }
2590
- say(` Engine door http://${HOST}:${ports.mcp}/mcp — the portal's Start button calls this. Staff.`);
2645
+ say(` Engine door http://${HOST}:${ports.mcp}/mcp — the portal's Start button calls this. For your staff, not clients.`);
2591
2646
  say("");
2592
2647
  // ── WHAT `status` AND `stop` READ ABOUT THIS START ───────────────────────────────────────────────
2593
2648
  //
package/bin/update.mjs CHANGED
@@ -321,12 +321,22 @@ export async function update(argv = process.argv.slice(2)) {
321
321
  //
322
322
  // No override flag, deliberately. A timer retries in an hour; a human waits or clears the queue. An
323
323
  // escape hatch on an unattended path is a hatch that gets taken by the unattended path.
324
- const holds = liveRunHolds({ queueDirs: config.queueDirs, lockDir: config.runLockDir });
325
- const held = [...holds.queued, ...holds.claimed, ...holds.slots];
324
+ //
325
+ // A PARKED RUN HOLDS IT TOO (owner, 2026-11-09: a search is not upgraded part-way, and a run is not resumed after an
326
+ // update). A park in a queue is read with the queue; a run folder parked on its own comes from the runner's own scan,
327
+ // so the update and the runner cannot disagree about what will resume. A scan that cannot load is a could-not-look and
328
+ // refuses like an unreadable queue.
329
+ let parkedRunDirs = [];
330
+ try { parkedRunDirs = (await import("../driver/runner.mjs")).parkedRunDirOrphans(); }
331
+ catch (e) { parkedRunDirs = null; console.error(`\n The scan for parked run folders could not run: ${String(e?.message ?? e).slice(0, 200)}`); }
332
+ const holds = liveRunHolds({ queueDirs: config.queueDirs, lockDir: config.runLockDir, parkedRunDirs: parkedRunDirs ?? [] });
333
+ if (parkedRunDirs === null) holds.unreadable.push({ path: "parked run folders", error: "the runner's scan did not load" });
334
+ const held = [...holds.queued, ...holds.claimed, ...holds.parked, ...holds.slots];
326
335
  if (held.length) {
327
- console.error(`\n REFUSED — ${held.length} run(s) queued, claimed or in flight.`);
336
+ console.error(`\n REFUSED — ${held.length} run(s) queued, claimed, parked or in flight.`);
328
337
  for (const q of holds.queued) console.error(` queued ${q.id}`);
329
338
  for (const c of holds.claimed) console.error(` claimed ${c.id} pid ${c.pid ?? "unknown"}`);
339
+ for (const p of holds.parked) console.error(` parked ${p.id}`);
330
340
  for (const sl of holds.slots) console.error(` slot ${sl.file} pid ${sl.pid}`);
331
341
  console.error(packaged
332
342
  ? "\n An update replaces the program's files under whatever is running. Nothing was touched."
package/build-info.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "ac5084412fb3f36dd0b9bd6b1df3ab302e166c25",
3
- "version": "0.5.1"
2
+ "commit": "be52291d9839d701544d3a9479888be91913e302",
3
+ "version": "0.6.0-beta.1"
4
4
  }
package/docs/DELIVERY.md CHANGED
@@ -213,7 +213,7 @@ surface for non-staff readers on this engine:
213
213
  (`customer/<key>/index.html`) links `report.html` (`publish/index.mjs`) with no split language.
214
214
  - **One preparation chokepoint.** What a non-staff reader receives is prepared by the portal's
215
215
  `readReport()` (`driver/portal-report.mjs`, `staff:false`), which removes the reader-visible
216
- deltas — `[internal]` review tails, the internal band/reviewer shorthand, the staff Ask-your-AI
216
+ deltas — `[internal]` review tails, the internal band/reviewer shorthand, the staff Ask AI
217
217
  connector — in one place, rather than at render time into a second document.
218
218
 
219
219
  **A surface for non-staff readers must read through `readReport()`, never open a report by path.** That is
package/docs/PORTAL.md CHANGED
@@ -55,7 +55,7 @@ burned it.
55
55
  signed-out API caller gets the same 401 the edge produces for a missing JWT.
56
56
  - `GET /portal/api/searches?account=` — registry levels + the company's saved recipes.
57
57
  - `POST /portal/api/run/plan` — the **confirmation gate**: validation, the registry-derived
58
- stage label (never a company's recipe label), mark count, turnaround hint, the standing caveat, and
58
+ stage label (never a company's recipe label), mark count, turnaround hint, and
59
59
  a 10-minute HMAC `confirmationToken` bound to the fields of the server-stamped job that fix scope,
60
60
  cost and identity (`jobHashOf`: marks, markName, classes, goods, product/recipeKey), the confirming
61
61
  identity, and a ONE-SHOT jti. Jurisdictions are deliberately OUTSIDE the hash, so the plan step can
package/docs/RELEASES.md CHANGED
@@ -56,5 +56,5 @@ Downgrading is an ordinary install of the older version. Your configuration and
56
56
  by either — they live outside the package — so moving between channels is not a migration.
57
57
 
58
58
  Every version's notes are on the [releases page](https://github.com/CordilleraSarl/clearotron/releases)
59
- and in `CHANGELOG.md`, grouped Before you upgrade / New / Fixed / For operators. A beta's notes are the same notes; the stable
59
+ and in [`CHANGELOG.md`](https://github.com/CordilleraSarl/clearotron/blob/main/CHANGELOG.md), grouped Before you upgrade / New / Fixed / For operators. A beta's notes are the same notes; the stable
60
60
  that follows aggregates all of them into one entry.
@@ -113,7 +113,7 @@ packet-sender; the driver does not change.
113
113
  ## The engine seam
114
114
 
115
115
  One stage execution = one `runStage()` call = one engine invocation. Everything provider-specific
116
- lives behind the seam (`engine/CONTRACT.md`; selection in `gateway.mjs` `selectEngine()`). Engine
116
+ lives behind the seam (`engine/CONTRACT.md`; selection in `engine/registry.mjs` `selectEngine()`). Engine
117
117
  choice is **process-wide**: `CLEAROTRON_AI` is read at every activation and governs every stage of
118
118
  every job in it. There is no per-stage, per-job or comms-specific override, so comparing the two
119
119
  engines means flipping the variable and running sequentially, or standing up a second instance.
@@ -266,12 +266,20 @@ All paths relative to [`driver/`](../../driver/). The load-bearing seven are mar
266
266
  | Module | Role |
267
267
  |---|---|
268
268
  | ● `runner.mjs` | Queue drain: claims, dedup, parks, orphan reclaim, admission budget, graceful stop. |
269
- | ● `pipeline.mjs` | The run: stage sequence, fan-in gates, clamps, delivery, recovery. The largest module in the tree; [03](03-run-lifecycle.md) is its map. |
269
+ | ● `pipeline.mjs` | The clearance run: the run slot, the preflight and the freezes, then its ordered steps (`steps/`), handed to `runShell`. The largest module in the tree; [03](03-run-lifecycle.md) is its map. |
270
270
  | ● `stages.mjs` | The clearance lane's per-stage declaration table (tier/model, thinking, timeout + stall, skill reads, output, validator) + stage messages. Not the only one: the knockout lane keeps `KO_STAGES` in its own table. |
271
271
  | ● `gateway.mjs` | `runStage()`: attempt ladder, warm patch, file-truth gating, fail taxonomy, engine selection, turn/ping lanes. |
272
272
  | ● `engine/` | The engine seam: `CONTRACT.md`, `anthropic-agent.mjs`, `openai-agent.mjs`, `common.mjs` (shared spawn/watchdog substrate), `mcp/` (engine-local gather servers). |
273
273
  | ● `verify.mjs` | Structural validators for every stage output + `parseVerdict` (the verdict gate's parser). |
274
274
  | ● `driver.config.mjs` | Env → config resolution: paths, caps, engine + register-provider selection, credential preflight. |
275
+ | `steps/` | The clearance's steps, one module each, in the order `pipeline.mjs` hands them to `runShell`: intake, register sweep, frame comparison, placement and digest, skeptic and follow-up, synthesis, correction cycle, verdict gate, overview and cards, delivery. `corrections.mjs` holds what the correction steps share. |
276
+ | `run-shell.mjs` | What every run does around its steps, the same for a clearance and a Knockout: it runs a product's steps in order, ends a failure through `run-failed.mjs` and a delivery through the product's ending. |
277
+ | `run-failed.mjs` | The failure path of both products: postpone, stop, park for recovery or end, and the notice it sends. |
278
+ | `run-delivered.mjs` | How a clearance ends delivered: the publish, the packet, the delivered state and the archive. |
279
+ | `run-outcome.mjs` | How a run that cannot finish is described: the failure a stage raises, the designed refusal, and the packet that tells the requester. |
280
+ | `run-park.mjs` | The one writer of `.postponed`, the marker a parked run resumes from. |
281
+ | `run-record.mjs` | The one door to a run's files: where they are, and how they are read and written. |
282
+ | `portal-service.mjs` · `portal-routes/` · `portal-runs.mjs` · `portal-confirmation.mjs` | The portal: the service, its routes grouped one module per area ([`portal-routes/README.md`](../../driver/portal-routes/README.md)), the runs a reader can see, and the token that confirms an order. |
275
283
  | `pipeline-knockout.mjs` · `stages-knockout.mjs` · `verify-knockout.mjs` | The knockout (triage) lane: its own run body, its own stage table (`KO_STAGES`) and its own validators. `pipeline()` dispatches into it on a knockout policy, so its stages can never leak into the clearance `STAGE_ORDER`. |
276
284
  | `phase0.mjs` | Pure run identity: slug, codename, dates, run/archive dirs. |
277
285
  | `enqueue-schema.mjs` | Job-file shape, `validateJob` classification (reject/clarify/run). |
@@ -168,8 +168,12 @@ off-gateway and never took a lane, so by the end it governed an empty set. Compu
168
168
 
169
169
  ## 3 — The stage sequence
170
170
 
171
- Everything below happens inside one `pipelineInner()` call (`pipeline.mjs`), inside one big
172
- try/catch whose catch is the recovery machinery (§5). Before any model spend: run slot, register
171
+ Everything below is the clearance's steps. `pipelineInner()` (`pipeline.mjs`) hands them, in order, to
172
+ `runShell` (`run-shell.mjs`): intake, register-sweep, frame-comparison, placement-and-digest,
173
+ skeptic-and-follow-up, synthesis, correction-cycle, verdict-gate, overview-and-cards and delivery, one
174
+ module each under `steps/`. A step that throws ends through `run-failed.mjs`, the recovery machinery
175
+ (§5). A delivered run ends through `run-delivered.mjs`. A Knockout hands its own steps to the same
176
+ `runShell` from `pipeline-knockout.mjs`. Before the first step and before any model spend: run slot, register
173
177
  credential preflight (fail-fast — a resume without the provider credential must not burn stages),
174
178
  profile freeze to `_driver/profile.json`, framework freeze, instructed-scope record, and status
175
179
  seeding. Frozen sidecars are never silently re-derived; a corrupt one crashes loudly by design.
@@ -243,7 +243,7 @@ deployment may override (verify live values per deployment).
243
243
  | `CLEAROTRON_STOP_GRACE_MS` | 60000 | Grace after first SIGTERM before exit(1). |
244
244
  | `CLEAROTRON_MAX_CLAIM_AGE_MS` | 172800000 (48 h; 0 disables) | Hard ceiling on a claim's age (from the `.pid` sidecar mtime) — beyond it, re-claim regardless of liveness. |
245
245
  | `CLEAROTRON_KNOCKOUT_VARIANT_CAP` | unset (⇒ the lane's own cap) | Ceiling on variants a knockout screens per name. Set only to bound an unusually wide batch; absent means the lane decides. |
246
- | `CLEAROTRON_SIGNA_ANSWER_MEMORY` | `off` | On the Signa register, whether a run reuses an answer it already holds instead of asking again. `off` asks every time. `watch` also asks every time, and records whether a held answer would have matched. `on` reuses held answers. |
246
+ | `CLEAROTRON_SIGNA_ANSWER_MEMORY` | `on` | On the Signa register, whether a run reuses an answer it already holds instead of asking again. `off` asks every time. `watch` also asks every time, and records whether a held answer would have matched. `on` reuses held answers. |
247
247
  | `CLEAROTRON_CLARIVATE_ANSWER_MEMORY` | `on` | On the Clarivate register, whether a run reuses a count, a search, an owner lookup or a record it already holds instead of asking again. `off` asks every time. |
248
248
 
249
249
  ### Retries, timeouts, watchdogs
@@ -348,8 +348,8 @@ cannot be read as one list.
348
348
  | `ANTHROPIC_DEFAULT_OPUS_MODEL` / `ANTHROPIC_DEFAULT_SONNET_MODEL` / `ANTHROPIC_DEFAULT_HAIKU_MODEL` / `ANTHROPIC_DEFAULT_FABLE_MODEL` | The model each tier's alias resolves to, read by the Claude program: on Foundry, the deployment names; anywhere, a way to hold a tier still. Set the fable one to your Fable deployment's name if you set `CLEAROTRON_SYNTHESIS_MODEL=fable`; setup does not ask for it. |
349
349
  | `OPENAI_API_KEY` | **Read only to be DELETED.** The `openai-agent` adapter strips it from the `codex exec` environment under subscription billing, so an unrelated key exported on the box cannot spoil a clean subscription bill. It is never the api-key credential for this product — that is `CODEX_API_KEY`. Listed because a reader who has one set needs to know it is removed. |
350
350
  | `CORSEARCH_SESSION_KEY` | Register provider auth (session cookie). **Preflighted at run start — a missing credential fails fast before any model spend.** |
351
- | `CLARIVATE_API_KEY` / `CLARIVATE_API_BASE` | Clarivate adapter — on the engine path: `clarivate-server.mjs` in `gather-config.mjs`'s stage-grant table, plus driver-side `recordFetch` / `countHits` / `listRecords` / `executePlan`. `CLARIVATE_API_BASE` overrides the core's `DEFAULT_BASE`. |
352
- | `SIGNA_API_KEY` / `SIGNA_BASE_URL` | Signa adapter — the recommended tier's credential pair, with the same four driver-side adapters and its own `signa-server.mjs`. `SIGNA_BASE_URL` is optional and falls back to the core's `DEFAULT_BASE`. See [`providers/README.md`](../../providers/README.md), which carries the one open gap on this path: the stage grant in `gather-config.mjs` hands Signa a far narrower register-tool set than the other providers, `register_enumerate` among the withheld, and gives no probed reason for it. |
351
+ | `CLARIVATE_API_KEY` / `CLARIVATE_API_BASE` | Clarivate adapter — on the engine path: `providers/clarivate/src/mount.js` in `gather-config.mjs`'s stage-grant table, plus driver-side `recordFetch` / `countHits` / `listRecords` / `executePlan`. `CLARIVATE_API_BASE` overrides the core's `DEFAULT_BASE`. |
352
+ | `SIGNA_API_KEY` / `SIGNA_BASE_URL` | Signa adapter — the recommended tier's credential pair, with the same four driver-side adapters and its own `providers/signa/src/mount.js`. `SIGNA_BASE_URL` is optional and falls back to the core's `DEFAULT_BASE`. See [`providers/README.md`](../../providers/README.md), which carries the one open gap on this path: the stage grant in `gather-config.mjs` hands Signa a far narrower register-tool set than the other providers, `register_enumerate` among the withheld, and gives no probed reason for it. |
353
353
  | `PERPLEXITY_API_KEY` | Marketplace grid research server. |
354
354
  | `EUIPO_CLIENT_ID` / `EUIPO_CLIENT_SECRET` / `EUIPO_ENVIRONMENT` | EUIPO OAuth2 client-credentials; environment defaults to **sandbox** — production requires an explicit set. |
355
355
  | `CLEAROTRON_MCP_URL` | Staff "Ask your AI" connector base, baked into the report at render — there is one report, and `portal-report.mjs` strips the block for non-staff readers at serve time. Fails closed → link omitted when unset. |
@@ -125,8 +125,8 @@ has taken it.
125
125
  (`pipeline.mjs` `RETIRED_ENV`, `jx-units.mjs`) and nothing reads it, so renaming a dead name looked like
126
126
  handing an operator a name that warns about nothing. A decision of 2026-09-04 reversed that: the
127
127
  whole namespace carries one prefix, dead names included, because a tree spelled two ways costs more
128
- than a retired row spelled consistently. The per-lane `CLEAROTRON_NATIVE_LANGUAGE_<code>` switch in the same row **is** live and is
129
- fail-OPEN: unset means ON (§5.5).
128
+ than a retired row spelled consistently. The per-lane `CLEAROTRON_NATIVE_LANGUAGE_<code>` switch in the same row was
129
+ retired on 2026-11-11 (§5.5).
130
130
 
131
131
  Variables outside the install surface were left alone by the August rename — `CLEAROTRON_ENGINE_MAX_BUFFER`
132
132
  and its siblings were never in that window. **That separate decision was taken on 2026-09-04**: the rename
@@ -233,8 +233,9 @@ environment reads what the ACTIVE provider can actually do.
233
233
 
234
234
  ### 5.5 Search-depth spine — T3 (defaults OFF; arm deliberately)
235
235
 
236
- Per-lane `CLEAROTRON_NATIVE_LANGUAGE_<XX>` — `zh`, `ja` and `ko` all work (`LANGUAGE_LANES` in
237
- `driver/jx-lanes.mjs`); default on, set `0` to kill one lane — plus `CLEAROTRON_JX_SERP_DEADLINE_MS`.
236
+ `CLEAROTRON_JX_SERP_DEADLINE_MS`. The per-lane `CLEAROTRON_NATIVE_LANGUAGE_<XX>` switch for `zh`, `ja` and `ko`
237
+ was **retired on 2026-11-11**: no deployment set it, and a lane in the run's frozen lane decision always
238
+ runs. A box that still sets it is warned that it does nothing (`pipeline.mjs` `RETIRED_ENV`).
238
239
  `CLEAROTRON_JX_SERP_GRID`, `CLEAROTRON_JX_NATIVEREAD` and `CLEAROTRON_JX_CONSUME` were **deleted by item 8**
239
240
  under ADR-0002: each was off here and on in production, so the shipped default described a
240
241
  configuration nobody ran. The slices now run on conditions a requester can already see.
@@ -118,7 +118,7 @@ The seam is real but has known single-vendor assumptions outside it. The full pa
118
118
  zero. `modelWire` is the same discipline for the model gauge: the served id the turn OBSERVED on the
119
119
  wire, or `null` — never the alias you asked for. The gateway derives `modelActual` / `modelBasis` /
120
120
  `modelMismatch` from it, so an adapter that never sets it stamps every row `unknown`.
121
- 3. Register it: add the adapter to the `ENGINES` map in `gateway.mjs` (or call `registerEngine()`),
121
+ 3. Register it: add the adapter to the `ENGINES` map in `engine/registry.mjs` (or call `registerEngine()`),
122
122
  and add its binary to `ENGINE_BINARIES` in `driver.config.mjs` so the setup wizard can offer it —
123
123
  the two lists are pinned against each other, because "the wizard offers an engine the driver does
124
124
  not ship" and "the driver ships an engine setup cannot reach" are both invisible otherwise. Then
@@ -138,10 +138,10 @@ The reasoning layer dictates what it needs; a thin adapter supplies it. Concrete
138
138
  normalization, record normalization into the provider-neutral fields the driver reads
139
139
  (`REC` accessors in `registry-fidelity.mjs` — application/registration numbers, dates,
140
140
  `statusClass`, proprietor, designations).
141
- 2. **Engine-local MCP server**: wrap the core like `engine/mcp/corsearch-server.mjs` (~130 lines); add
142
- it to `REGISTER_SERVERS` in `gather-config.mjs` (`registerEntry()` **throws loudly** for any provider
141
+ 2. **The tools**: wrap the core in `providers/<id>/src/mount.js`, like corsearch's (~130 lines); the one
142
+ register server mounts it by name. Add it to `REGISTER_SERVERS` in `gather-config.mjs` (`registerEntry()` **throws loudly** for any provider
143
143
  without a built server — a provider flip without the server breaks every register unit, loudly).
144
- 3. **Driver config**: a `PROVIDERS` entry in `driver.config.mjs` (label, credential env name,
144
+ 3. **Driver adapter**: `providers/<id>/src/adapter.js`, listed in `PROVIDERS` in `driver.config.mjs` (label, credential env name,
145
145
  `recordFetch` + `executePlan` adapters, public-record-URL capability) — the credential is
146
146
  preflighted at run start. Add the id to `KNOWN_REGISTER_PROVIDERS` too, or the error message that
147
147
  tells an operator what to set will omit it. Selection is `CLEAROTRON_DATABASE` in every
@@ -142,7 +142,7 @@ the company's name, the goods description, or any profile material.
142
142
  | `signa` | `api.signa.so` | `providers/signa/src/core.js` |
143
143
  | `euipo` | `euipo.europa.eu` and `api.euipo.europa.eu` in production; `auth-sandbox.euipo.europa.eu` and `api-sandbox.euipo.europa.eu` under `EUIPO_ENVIRONMENT=sandbox` — different hosts, different corpora | `providers/euipo/src/euipo-client.js` |
144
144
  | `uspto-local` | **Nothing.** Queries read a local SQLite FTS5 file at `USPTO_LOCAL_DB` | `providers/uspto-local/src/index-store.js` |
145
- | `free-tier` | The EUIPO hosts above, and nothing else — the composite pairs EUIPO with the local US index | `engine/mcp/free-tier-server.mjs` |
145
+ | `free-tier` | The EUIPO hosts above, and nothing else — the composite pairs EUIPO with the local US index | `providers/free-tier/src/mount.js` |
146
146
 
147
147
  `api.uspto.gov` is reached by the index build alone — `npm run sync:uspto`, which downloads the bulk
148
148
  corpus (`providers/uspto-local/src/sync.js`). No clearance run contacts it.
@@ -10,13 +10,12 @@ description: Orchestrator for preliminary trademark search requests with registe
10
10
  - [Register sources — the active vendor is the source of truth](#register-sources--the-active-vendor-is-the-source-of-truth)
11
11
  - [Model](#model)
12
12
  - [Upfront instructions (per-mark guidance from the reviewing lawyer)](#upfront-instructions-per-mark-guidance-from-the-reviewing-lawyer)
13
- - [Scope discipline — "stop if manageable"](#scope-discipline--stop-if-manageable)
14
13
  - [Process overview](#process-overview)
15
14
  - [HITL exception (shared across sub-skills)](#hitl-exception-shared-across-sub-skills)
16
15
  - [Failure fallbacks](#failure-fallbacks)
17
16
  - [Phase 0 — Workspace hygiene + matter-frame + template selection (run-start)](#phase-0--workspace-hygiene--matter-frame--template-selection-run-start)
18
17
  - [Phase 1 — Template](#phase-1--template)
19
- - [Phase 2 — Research and synthesis](#phase-2--research-and-synthesis) → detail in [phase2-execution.md](phase2-execution.md)
18
+ - [Phase 2 — Research and synthesis](#phase-2--research-and-synthesis) → detail in [phase2-execution.md](../../../driver/skills/clearance-search/phase2-execution.md)
20
19
  - [Phase 3 — Delivery](#phase-3--delivery)
21
20
  - [Delivery & handoff](#delivery--handoff)
22
21
  - [Reply rules](#reply-rules)
@@ -30,12 +29,12 @@ This file is the **driver's compute orchestration spec** — it lives in `driver
30
29
  This workflow is run by the **deterministic driver** (`driver/`): an intake path (the `enqueue` CLI or the ops-MCP `start_run` tool) enqueues a job and the driver invokes each stage as a standalone compute turn (the `anthropic-agent` engine — a headless `claude -p` process off the gateway; sequencing, fan-in, gating, retries all in code). The judgment content + companion files below are what the stages read; the driver passes each stage its run-dir paths + the job context (email message id, forwarder, instructions, mark names).
31
30
 
32
31
  Companion files (this skill):
33
- - [phase2-execution.md](phase2-execution.md) — Phase 2 methodology (variants → gather → Touchpoint 2 placement → digest → skeptic review → cross-pollination → synthesis → Touchpoint 3 narrative refutation → case-law grounding)
32
+ - [phase2-execution.md](../../../driver/skills/clearance-search/phase2-execution.md) — Phase 2 methodology (variants → gather → Touchpoint 2 placement → digest → skeptic review → cross-pollination → synthesis → Touchpoint 3 narrative refutation → case-law grounding)
34
33
  - [template-formatting.md](template-formatting.md) — HTML/CSS spec for the report
35
- - [risk-framework.md](risk-framework.md) — the house-default band ladder (Very High · High · Moderate · Manageable), each band stated as Legal position, Practical position and Potential consequences
36
- - [synthesis-rules.md](synthesis-rules.md) — how to combine common-law + register findings into a single risk assessment (carries the default-to-senior-lawyer-judgment posture)
37
- - [worked-examples.md](worked-examples.md) — the analytical depth target
38
- - [templates/email/](templates/email/) — a RECORD of the retired per-customer email bodies (`generic.md`), kept for history. Nothing selects one and no seat writes from one: `composeEmailHtml` composes the single cover note in code. Do not draft against it
34
+ - [risk-framework.md](../../../driver/skills/clearance-search/risk-framework.md) — the house-default band ladder (Very High · High · Moderate · Manageable), each band stated as Legal position, Practical position and Potential consequences
35
+ - [synthesis-rules.md](../../../driver/skills/clearance-search/synthesis-rules.md) — how to combine common-law + register findings into a single risk assessment (carries the default-to-senior-lawyer-judgment posture)
36
+ - [worked-examples.md](../../../driver/skills/clearance-search/worked-examples.md) — the analytical depth target
37
+ - [templates/email/](email-generic.md) — a RECORD of the retired per-customer email bodies (`generic.md`), kept for history. Nothing selects one and no seat writes from one: `composeEmailHtml` composes the single cover note in code. Do not draft against it
39
38
 
40
39
  Top-level reusable judgment skills (the three new "touchpoints" — see Phase 2 below):
41
40
  - `matter-frame` — runs **inline** at Phase 0: produces `matter-context.md` naming client + sector + customer base + materially-matters jurisdictions + off-field sectors + watchlist-owner seeds. Strategic foundation the rest of the workflow reasons against. Reusable by `knockout-searches` and future clearance-search.
@@ -101,18 +100,6 @@ Before Phase 1, scan the forwarded email body for **per-mark guidance** from the
101
100
 
102
101
  This hook exists because some judgment calls (mark-element distinctiveness, industry-specific enforcement patterns) require the reviewing lawyer's institutional knowledge and cannot be reliably inferred from the search itself.
103
102
 
104
- ## Scope discipline — "stop if manageable"
105
-
106
- When the request form lists multiple proposed names and includes language like *"preferred name — please stop review here if manageable"*, the skill MUST honour it:
107
-
108
- 1. Run the full Phase 2 workflow on the **preferred (first) name only**.
109
- 2. Synthesise its risk verdict.
110
- 3. **If the preferred name is rated Composite 1 or 2 (Manageable / Low Risk),** stop. Do not run the alternates. Deliver Phase 1 + the preferred name's Phase 2 + 3 output. Note in the narrative: "Per request form, review stopped at [preferred name] as risk was assessed manageable. Alternates not searched."
111
- 4. **If the preferred name is rated Composite 3+,** continue to the alternates so the reviewing lawyer has the full picture for selecting a fallback.
112
- 5. The reviewing lawyer is the final arbiter — if their upfront instructions say otherwise (e.g. "run all three regardless"), follow those instructions.
113
-
114
- This prevents producing noise findings on names that the client never intended to evaluate.
115
-
116
103
  ## Process overview
117
104
 
118
105
  Three phases, all complete before a single reply is sent to the forwarder.
@@ -120,16 +107,16 @@ Three phases, all complete before a single reply is sent to the forwarder.
120
107
  **Phase 1 — Template:**
121
108
  1. Extract all fields from the forwarded search request form
122
109
  2. Mark the email as read immediately (prevents duplicate processing if a heartbeat picks up the same unread email)
123
- 3. Derive the run slug and open the run-dir from those fields — Phase 1 authors NO client prose. The report is written in Phase 2 synthesis (per [delivery-contract.md](delivery-contract.md)) and the client email is composed in CODE at Phase 3 (`composeEmailHtml`)
110
+ 3. Derive the run slug and open the run-dir from those fields — Phase 1 authors NO client prose. The report is written in Phase 2 synthesis (per [delivery-contract.md](../../../driver/skills/clearance-search/delivery-contract.md)) and the client email is composed in CODE at Phase 3 (`composeEmailHtml`)
124
111
 
125
- **Phase 2 — Research and synthesis** (run by the deterministic driver; methodology in [phase2-execution.md](phase2-execution.md)):
112
+ **Phase 2 — Research and synthesis** (run by the deterministic driver; methodology in [phase2-execution.md](../../../driver/skills/clearance-search/phase2-execution.md)):
126
113
  1. **Variants** — `clearance-variants` produces the variant manifest (consumes `matter-context.md` from Phase 0)
127
114
  2. **Gather** — common-law + the applicable register units run as batched stages against the manifest
128
115
  3. **Touchpoint 2: placement-inquiry** — structured inquiry per candidate; produces `placement-recommendations.md` (each candidate placed headline / sheet-2 / watchlist / out-of-scope with reasoning)
129
116
  4. **Register digest** — combines the unit digests into `register-findings.md`; consumes `placement-recommendations.md`
130
117
  5. **Skeptic review** — a fresh-eyes coverage check; a unit with a gap its register can close is re-run
131
118
  6. **Cross-pollination** — Option D deterministic cross-checks (cap N=10) using both layers' findings
132
- 7. **Synthesis** — joint risk analysis using [risk-framework.md](risk-framework.md) and [synthesis-rules.md](synthesis-rules.md)
119
+ 7. **Synthesis** — joint risk analysis using [risk-framework.md](../../../driver/skills/clearance-search/risk-framework.md) and [synthesis-rules.md](../../../driver/skills/clearance-search/synthesis-rules.md)
133
120
  8. **Touchpoint 3: narrative-refutation** — refutes the narrative against the source files; produces `senior-eye-review.md` (verdict CLEAR / CONDITIONAL / BLOCKING)
134
121
  9. **Case-law grounding** — ground watchlist / enforcer findings in cited precedent
135
122
  10. **Cross-mark references** — once, after all marks complete (multi-mark requests only)
@@ -184,14 +171,14 @@ On every invocation, before Phase 1:
184
171
 
185
172
  1. **Generate the run codename** — a random `<adjective>-<noun>` (lowercase, single hyphen; pick freshly, never reuse a prior run's). This fixes your run-dir leaf `<date>-<codename>` for the entire run.
186
173
  2. **Create the run-dir by WRITING into it.** The `write` tool creates parent dirs automatically, so your first write (the matter-context.md in step 3, then `register-units/<axis>.md` files as Phase 2 needs them) creates `studio/clearance-search/<slug>/<date>/`. The unique codename already guarantees a clean, collision-free dir, so there is **nothing to inspect** — do not `read` or list a directory to check or create it; track every file by its known path.
187
- 3. **Run `matter-frame` inline** to produce `studio/clearance-search/<slug>/<date>/matter-context.md`. This is the strategic foundation — it names client + sector + customer base + materially-matters jurisdictions + off-field sectors + watchlist-owner seeds. Downstream (Phase 1 variants, Phase 2 register units, Touchpoint 2 placement, Touchpoint 3 refutation) all consume this artifact. Read [matter-frame/SKILL.md](../matter-frame/SKILL.md) and execute it inline; it makes no tool calls and stays in context.
174
+ 3. **Run `matter-frame` inline** to produce `studio/clearance-search/<slug>/<date>/matter-context.md`. This is the strategic foundation — it names client + sector + customer base + materially-matters jurisdictions + off-field sectors + watchlist-owner seeds. Downstream (Phase 1 variants, Phase 2 register units, Touchpoint 2 placement, Touchpoint 3 refutation) all consume this artifact. Read [matter-frame/SKILL.md](../../../driver/skills/matter-frame/SKILL.md) and execute it inline; it makes no tool calls and stays in context.
188
175
  4. **Per-customer delivery is driven by the RESOLVED CUSTOMER PROFILE, not the sender domain.** The intake
189
176
  AI resolves which customer this is for and stamps `profileKey` on the job (email-loop §B3.2a); the driver
190
177
  freezes that profile into `_driver/profile.json`, and the deterministic publish code reads its `delivery`
191
178
  descriptor — which today carries only the P&C header flag. `email` no longer selects a body: every
192
179
  customer gets the same cover note (`{ email: "summary" }`), and a stored `"table"` folds to it.
193
180
  There is no per-customer body left to select and no template to pick: one file remains
194
- ([templates/email/generic.md](templates/email/generic.md)) and it is a RECORD of the retired
181
+ ([templates/email/generic.md](email-generic.md)) and it is a RECORD of the retired
195
182
  per-customer body, not an instruction. What the profile still decides is the P&C flag, and it
196
183
  decides it through the bound profile, never `*@domain`.
197
184
  5. **Phase 3 archives this run** on successful delivery: the dated subdir is moved to `studio/clearance-search/archive/<YYYY-MM>/<slug>/<date>/`. A run that delivered but failed to archive is a workflow violation — Phase 3 (see [Phase 3](#phase-3--delivery--must-pattern)) handles the move.
@@ -200,7 +187,7 @@ On every invocation, before Phase 1:
200
187
 
201
188
  Extract the fields from the Trademark Search Request Form and derive the slug. **Phase 1 produces no client-facing prose** — it is field extraction and run-dir setup, and nothing else.
202
189
 
203
- The report body is authored in Phase 2 synthesis against [delivery-contract.md](delivery-contract.md); the email that carries it is composed in CODE at Phase 3 (`composeEmailHtml`), one cover note for every customer. A body drafted here reaches no reader — the notify seat is a courier that sends the driver's file verbatim. ([template-formatting.md](template-formatting.md) survives as the KNOCKOUT RENDERER'S formatting reference — see its header; it is not a drafting instruction to this seat.)
190
+ The report body is authored in Phase 2 synthesis against [delivery-contract.md](../../../driver/skills/clearance-search/delivery-contract.md); the email that carries it is composed in CODE at Phase 3 (`composeEmailHtml`), one cover note for every customer. A body drafted here reaches no reader — the notify seat is a courier that sends the driver's file verbatim. ([template-formatting.md](template-formatting.md) survives as the KNOCKOUT RENDERER'S formatting reference — see its header; it is not a drafting instruction to this seat.)
204
191
 
205
192
  **Slug derivation.** The slug for the run-dir is `tmp<n>-<kebab-mark-name>` — e.g. `tmp2201-project-novapulse`, `tmp8642-glowvault`. The TMP number from the request form's *Reference No.* field is the firm's unique identifier and guarantees uniqueness; the kebab mark name keeps the slug human-readable. Lowercase, ASCII letters / digits / hyphens only. Multi-mark requests: use one slug for the request (typically the first mark); if per-mark separation is needed inside the run, use a `marks/<mark-kebab>/` subdir within the dated dir.
206
193
 
@@ -209,7 +196,7 @@ The report body is authored in Phase 2 synthesis against [delivery-contract.md](
209
196
  ## Phase 2 — Research and synthesis
210
197
 
211
198
  Phase 2 is **sequenced by the deterministic driver** (`driver/`); the step-by-step
212
- **methodology** lives in [phase2-execution.md](phase2-execution.md). It covers:
199
+ **methodology** lives in [phase2-execution.md](../../../driver/skills/clearance-search/phase2-execution.md). It covers:
213
200
  - **Step 1** — variants (`clearance-variants` writes the variant manifest)
214
201
  - **Step 2** — gather (common-law + the applicable register units) → Touchpoint 2 placement-inquiry → register digest
215
202
  - **Step 2.6** — skeptic review (fresh-eyes audit before trust)
@@ -239,13 +226,13 @@ The driver runs the delivery stage on **every** completed run — the search is
239
226
 
240
227
  ### Deliverable 1: Narrative summary (email body)
241
228
 
242
- **No template is selected and no seat composes this.** `composeEmailHtml` builds the cover note in code from the structure below, one shape for every customer; the files under [templates/email/](templates/email/) are a record of the retired per-customer bodies, not a spec to draft against. The confidentiality marking is `confPosture` (`shared/brand.mjs`) — three-valued, stated there and nowhere else. What follows is the **content** the code renders, described so a reader can see what the mail carries.
229
+ **No template is selected and no seat composes this.** `composeEmailHtml` builds the cover note in code from the structure below, one shape for every customer; the files under [templates/email/](email-generic.md) are a record of the retired per-customer bodies, not a spec to draft against. The confidentiality marking is `confPosture` (`shared/brand.mjs`) — three-valued, stated there and nowhere else. What follows is the **content** the code renders, described so a reader can see what the mail carries.
243
230
 
244
231
  **Game-title developer attribution MUST come from `common-law-findings.md`'s `developer_of_record` / `publisher_of_record` fields** — never confabulate publishers (Bandai Namco, Tencent, etc.) by inferring from prior-frequent gaming companies. If the field is `not extracted` or empty, write "(developer unverified)" rather than guessing.
245
232
 
246
233
  **Methodology lives in the Excel Methodology tab, NOT in the email body.** Do not include paragraph-length descriptions of search approach, sub-skills invoked, variants generated, etc. in the client-facing email. That bloat is what the render-layer split fixes.
247
234
 
248
- **The email is a COVER NOTE; the HTML report is the single master document (wp50).** The house default for every customer: the email carries only the headline risk tier, the report link, and any surviving scope/verdict/handling flags plus reviewer's open questions — no findings body, no client-voice prose, no hand-holding preamble. Client-voice findings live in the **HTML report** (the one surface the client reads). The last exception — a customer's review-table overlay (`delivery.email:'table'`) — is DELETED as of 2026-07-28, along with the knob that asked for it: a second full findings surface in the mail was the seam that let per-conflict tiers diverge from the report, and on the knockout lane it shipped internal purple notes over the wire. A lawyer who needs a bespoke, forwardable client mail asks the assistant to draft one from the run's `report-data.json` — formatting is judgement, and it belongs where judgement lives, not in a profile enum. The operative delivery spec is [delivery-contract.md](delivery-contract.md) + the driver's `report-synthesis` stage. (The `client-summary` stage, which re-voiced the findings into a separate client-facing document, is RETIRED as of 2026-08-01 — the one report is the one surface.)
235
+ **The email is a COVER NOTE; the HTML report is the single master document (wp50).** The house default for every customer: the email carries only the headline risk tier, the report link, and any surviving scope/verdict/handling flags plus reviewer's open questions — no findings body, no client-voice prose, no hand-holding preamble. Client-voice findings live in the **HTML report** (the one surface the client reads). The last exception — a customer's review-table overlay (`delivery.email:'table'`) — is DELETED as of 2026-07-28, along with the knob that asked for it: a second full findings surface in the mail was the seam that let per-conflict tiers diverge from the report, and on the knockout lane it shipped internal purple notes over the wire. A lawyer who needs a bespoke, forwardable client mail asks the assistant to draft one from the run's `report-data.json` — formatting is judgement, and it belongs where judgement lives, not in a profile enum. The operative delivery spec is [delivery-contract.md](../../../driver/skills/clearance-search/delivery-contract.md) + the driver's `report-synthesis` stage. (The `client-summary` stage, which re-voiced the findings into a separate client-facing document, is RETIRED as of 2026-08-01 — the one report is the one surface.)
249
236
 
250
237
  Structure (content shared across templates):
251
238
 
@@ -258,7 +245,7 @@ Structure (content shared across templates):
258
245
  **1. Scope statement** (from variant manifest's scope_statement field)
259
246
  > "We conducted common law and marketplace searches and trademark register searches for [N] proposed marks in the context of [product description], focusing on Classes [X, Y, Z]. Our common-law search covered the [N] mandatory marketplaces dictated for this customer (e.g., for gaming: Steam, Epic Games Store, Google Play, Apple App Store, Microsoft Store, itch.io), plus general web, e-commerce, social media and domain registries — and, for any collaborated / non-gaming goods, a general search scoped to those goods (e.g. [pizza]). Our register search ran via [vendor] (with EUIPO for EU/EUTM confirmation) across [N] jurisdictions with funnel narrowing and live-status filtering. Cross-pollination between layers applied per our standard methodology (see audit trail)."
260
247
 
261
- **Coverage statement (mandatory, honest).** Right after the scope, state plainly what was and was not searched, from the `## Coverage ledger`: *"Searched to completion in [these jurisdictions / axes]; coverage was limited in [these]; not searched this run in [these] — risk in unsearched markets is **unassessed**, not clean."* A `deferred` / `coverage-limited` jurisdiction is **never** rendered as a clean negative; the reviewing lawyer must see exactly what they are signing off on. **A dropped variant / field / source is a coverage limitation too:** read the variant manifest's `### Scope ledger` section (the variants-stage coverage statement, spanning the variant / field / source layers) alongside the two findings-file ledgers, and surface any `dropped` row as a recall limitation in the same breath (e.g. *"transliteration sweeps were not run — conflicts under non-Latin scripts are unassessed"*; *"the developer ecosystem was not searched — collisions on that channel are unassessed"*) — a dropped variant axis, an off-fielded sector, or an unsearched channel is unsearched recall, never silent absence (see [synthesis-rules.md](synthesis-rules.md) → *Coverage honesty*).
248
+ **Coverage statement (mandatory, honest).** Right after the scope, state plainly what was and was not searched, from the `## Coverage ledger`: *"Searched to completion in [these jurisdictions / axes]; coverage was limited in [these]; not searched this run in [these] — risk in unsearched markets is **unassessed**, not clean."* A `deferred` / `coverage-limited` jurisdiction is **never** rendered as a clean negative; the reviewing lawyer must see exactly what they are signing off on. **A dropped variant / field / source is a coverage limitation too:** read the variant manifest's `### Scope ledger` section (the variants-stage coverage statement, spanning the variant / field / source layers) alongside the two findings-file ledgers, and surface any `dropped` row as a recall limitation in the same breath (e.g. *"transliteration sweeps were not run — conflicts under non-Latin scripts are unassessed"*; *"the developer ecosystem was not searched — collisions on that channel are unassessed"*) — a dropped variant axis, an off-fielded sector, or an unsearched channel is unsearched recall, never silent absence (see [synthesis-rules.md](../../../driver/skills/clearance-search/synthesis-rules.md) → *Coverage honesty*).
262
249
 
263
250
  **2. Per-mark findings** — for each mark, lead with the **proposed-mark assessment**, then the five finding categories:
264
251
 
@@ -292,7 +279,7 @@ The **Methodology** sheet carries: matter-context summary, search approach, plac
292
279
  **Detail-fetch coverage** (register search-depth floor — kept here, not in the Excel spec, because the Step 2.6 skeptic review depends on it) — rank the union of unique URIs returned across all register searches by signal strength, then detail-fetch as follows:
293
280
 
294
281
  1. **Identical-mark hits** — fetch all, no cap.
295
- 2. **Near-exact (dominant-token-substring) in-class-live hits — fetch all, no cap (Slice A).** The mirror, at the orchestrator floor, of the unit-side [exact-in-class-live floor](../clearance-register/unit.md#exact-in-class-live-floor-primary-sweep-unit-owns-it). The **near-exact band** — where the **dominant element** (from the variant manifest) appears as a *substring* of `mark_text` (case-insensitive, after the `normalize()` strip in [status-rules.md](../clearance-register/status-rules.md), see the Identical-match normalisation shape) in a **filed target class** with **live** status, but is not an identical match (e.g. NORDWAVE NOVAPULSE, NOVAPULSE.com on dominant element NOVAPULSE) — is **enumerate-and-fetch, no top-N, no score gate**. This is the F-1/F-3 hole: the near-exact band otherwise falls into the Top-K sample (item 5) and a dangerous in-class-live conflict gets paged past the cliff. Slice A is **exhaustive** — distinct from the sample-with-disclosure Slice B below.
282
+ 2. **Near-exact (dominant-token-substring) in-class-live hits — fetch all, no cap (Slice A).** The mirror, at the orchestrator floor, of the unit-side [exact-in-class-live floor](../../../driver/skills/clearance-register/unit.md#exact-in-class-live-floor-primary-sweep-unit-owns-it). The **near-exact band** — where the **dominant element** (from the variant manifest) appears as a *substring* of `mark_text` (case-insensitive, after the `normalize()` strip in [status-rules.md](../../../driver/skills/clearance-register/status-rules.md), see the Identical-match normalisation shape) in a **filed target class** with **live** status, but is not an identical match (e.g. NORDWAVE NOVAPULSE, NOVAPULSE.com on dominant element NOVAPULSE) — is **enumerate-and-fetch, no top-N, no score gate**. This is the F-1/F-3 hole: the near-exact band otherwise falls into the Top-K sample (item 5) and a dangerous in-class-live conflict gets paged past the cliff. Slice A is **exhaustive** — distinct from the sample-with-disclosure Slice B below.
296
283
  3. **Phonetic-equivalent fringe — floor, sample-with-disclosure (Slice B).** Run the provider phonetic capability on the dominant token for the matter languages (provider-agnostic: `<provider>_expand_phoneme` then `match_mode: phonetic`; Clarivate uses native `match_mode: phonetic`). It **is a floor** — it MUST run for the dominant token in the filed class — but phonetic sets are unbounded, so it is **sample-with-disclosure**: where it cannot be fully worked, the coverage unit is **`coverage-limited`** (reason: "phonetic fringe sampled, not enumerated"), never `confirmed-clean`. Keep Slice A (exhaustive) and Slice B (sampled) **structurally distinct** — they have different correctness properties.
297
284
  4. **Watchlist-owner hits** — fetch all.
298
285
  5. **Top-K by relevance** — sample from each match-mode (exact / phrase / default) and across regions to ensure representative coverage. If the worker stops detail-fetching before ~25 URIs across all match-modes, the worker MUST answer in its digest audit: did the result set genuinely run out, or is this the empirical execution-tier truncation pattern (~10 URIs, no explanation)? The 25 figure is a tripwire-with-question, not a target — the Step 2.6 skeptic reads the worker's answer and re-spawns escalated to Opus if the answer is missing or unconvincing.
@@ -7,7 +7,7 @@
7
7
  >
8
8
  > This file is kept as the record of the per-customer body that used to exist, so a reader tracing why
9
9
  > the delivery shape changed can see what it replaced. **The live spec for the cover note is
10
- > Deliverable 1 in [SKILL.md](../../SKILL.md); the confidentiality marking is `confPosture` in
10
+ > Deliverable 1 in [SKILL.md](clearance-search-spine.md); the confidentiality marking is `confPosture` in
11
11
  > `shared/brand.mjs` and nowhere else.**
12
12
 
13
13
  The default client-facing email format. Used when the forwarded request resolved to any client without a per-customer template (e.g. demo customers, internal test runs, new clients). Tight bullets, no customer-specific framing.