clearotron 0.7.0-beta.2 → 0.7.0-beta.4

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 (137) hide show
  1. package/INSTALL.md +5 -5
  2. package/QUICKSTART.md +4 -4
  3. package/README.md +2 -2
  4. package/bin/README.md +3 -4
  5. package/bin/clearotron.mjs +1 -1
  6. package/bin/onboard.mjs +28 -40
  7. package/bin/status.mjs +11 -0
  8. package/build-info.json +2 -2
  9. package/docs/DELIVERY.md +30 -6
  10. package/docs/architecture/04-configuration-reference.md +1 -0
  11. package/driver/CHANGELOG.md +34 -0
  12. package/driver/compose-read.mjs +4 -3
  13. package/driver/contract-arm2-baseline.json +1 -2
  14. package/driver/contract-dictation-registry.mjs +7 -48
  15. package/driver/contract-e3-backlog.mjs +55 -52
  16. package/driver/contract-e3-baseline.json +22 -7
  17. package/driver/contract-vocabulary.mjs +4 -2
  18. package/driver/coverage-form.mjs +4 -0
  19. package/driver/coverage-rows-run.mjs +68 -4
  20. package/driver/engine/anthropic-agent.mjs +10 -13
  21. package/driver/engine/common.mjs +34 -22
  22. package/driver/engine/health.mjs +251 -0
  23. package/driver/engine/jx-turn.mjs +2 -1
  24. package/driver/engine/mcp/codex-config.mjs +16 -1
  25. package/driver/engine/mcp/crowd-note.mjs +1 -1
  26. package/driver/engine/mcp/gather-config.mjs +34 -9
  27. package/driver/engine/mcp/perplexity-server.mjs +33 -23
  28. package/driver/engine/mcp/recording-server.mjs +67 -58
  29. package/driver/engine/mcp/unit-note-server.mjs +2 -0
  30. package/driver/engine/openai-agent.mjs +9 -24
  31. package/driver/engine/probe.mjs +24 -7
  32. package/driver/findings-model.mjs +54 -0
  33. package/driver/jx-units.mjs +139 -30
  34. package/driver/knockout-assess-record.mjs +2 -2
  35. package/driver/knockout-correction-check.mjs +119 -0
  36. package/driver/knockout-correction-record.mjs +1 -1
  37. package/driver/knockout-frame-record.mjs +24 -10
  38. package/driver/knockout-review-record.mjs +35 -430
  39. package/driver/ladder/dispatch.mjs +4 -2
  40. package/driver/ladder/form-repair.mjs +5 -5
  41. package/driver/ladder/form-sync.mjs +4 -6
  42. package/driver/ladder/next-rung.mjs +10 -0
  43. package/driver/ladder/repair-messages.mjs +37 -65
  44. package/driver/ladder/stage.mjs +3 -3
  45. package/driver/ladder/turn-signals.mjs +4 -14
  46. package/driver/manual-paragraphs.mjs +22 -2
  47. package/driver/mark-logos.mjs +25 -9
  48. package/driver/package.json +1 -1
  49. package/driver/pipeline-knockout.mjs +2 -2
  50. package/driver/predelivery-lint.mjs +39 -7
  51. package/driver/product-fault.mjs +53 -0
  52. package/driver/publish/knockout.mjs +2 -1
  53. package/driver/publish/register-record-html.mjs +7 -9
  54. package/driver/publish/register-record.mjs +0 -1
  55. package/driver/publish/render.mjs +16 -10
  56. package/driver/publish/strings.mjs +0 -1
  57. package/driver/publish/templates/knockout.css +1 -1
  58. package/driver/publish/templates/report.css +2 -4
  59. package/driver/recording-agreement.mjs +6 -4
  60. package/driver/register-band-run.mjs +2 -2
  61. package/driver/register-digest-record.mjs +31 -9
  62. package/driver/register-unit-record.mjs +10 -1
  63. package/driver/repair-composers.mjs +12 -11
  64. package/driver/repair-contract.mjs +6 -6
  65. package/driver/repair-targets.mjs +7 -6
  66. package/driver/run-outcome.mjs +8 -0
  67. package/driver/runner.mjs +42 -3
  68. package/driver/skills/README.md +5 -4
  69. package/driver/skills/blind-frame/SKILL.md +1 -1
  70. package/driver/skills/case-law-citation/SKILL.md +1 -1
  71. package/driver/skills/clearance-common-law/SKILL.md +6 -423
  72. package/driver/skills/clearance-common-law/grid.md +272 -0
  73. package/driver/skills/clearance-common-law/meaning.md +142 -0
  74. package/driver/skills/clearance-common-law/perplexity-prompts.md +4 -2
  75. package/driver/skills/clearance-register/SKILL.md +7 -174
  76. package/driver/skills/clearance-register/digest.md +89 -25
  77. package/driver/skills/clearance-register/providers/clarivate-questions.md +154 -0
  78. package/driver/skills/clearance-register/providers/clarivate.md +5 -149
  79. package/driver/skills/clearance-register/providers/signa-questions.md +120 -0
  80. package/driver/skills/clearance-register/providers/signa.md +3 -114
  81. package/driver/skills/clearance-register/providers/uspto-local.md +3 -3
  82. package/driver/skills/clearance-register/register-recipes.md +10 -10
  83. package/driver/skills/clearance-register/status-rules.md +2 -2
  84. package/driver/skills/clearance-register/unit.md +96 -54
  85. package/driver/skills/clearance-search/delivery-contract.md +11 -49
  86. package/driver/skills/clearance-search/firm-wide-reasoning.md +10 -13
  87. package/driver/skills/clearance-search/look-at-what-you-have.md +7 -0
  88. package/driver/skills/clearance-search/phase2-execution.md +12 -117
  89. package/driver/skills/clearance-search/report-card-rules.md +2 -2
  90. package/driver/skills/clearance-search/report-prose.md +30 -23
  91. package/driver/skills/clearance-search/synthesis-rules.md +27 -69
  92. package/driver/skills/clearance-search/worked-examples.md +11 -16
  93. package/driver/skills/clearance-variants/SKILL.md +7 -7
  94. package/driver/skills/clearance-variants/transliteration-scripts.md +2 -2
  95. package/driver/skills/frame-diff/SKILL.md +1 -1
  96. package/driver/skills/knockout-assess/SKILL.md +54 -41
  97. package/driver/skills/knockout-frame/SKILL.md +13 -12
  98. package/driver/skills/knockout-register-read/SKILL.md +2 -10
  99. package/driver/skills/matter-frame/SKILL.md +2 -2
  100. package/driver/skills/narrative-refutation/SKILL.md +7 -6
  101. package/driver/skills/placement-inquiry/SKILL.md +3 -3
  102. package/driver/skills/skeptic/SKILL.md +111 -0
  103. package/driver/skills/whatif-memo/SKILL.md +5 -2
  104. package/driver/stage-declarations.mjs +6 -0
  105. package/driver/stages-knockout.mjs +36 -38
  106. package/driver/stages.mjs +69 -64
  107. package/driver/steps/delivery.mjs +6 -4
  108. package/driver/steps/open-run.mjs +2 -0
  109. package/driver/steps/overview-and-cards.mjs +2 -2
  110. package/driver/steps/register-sweep.mjs +20 -1
  111. package/driver/steps/synthesis.mjs +28 -11
  112. package/driver/suite-census.json +217 -61
  113. package/driver/synthesis-record.mjs +24 -2
  114. package/driver/verify-knockout.mjs +23 -3
  115. package/driver/whatif-memo-run.mjs +39 -10
  116. package/driver/whatif-queue.mjs +53 -7
  117. package/mcp-server/CHANGELOG.md +8 -0
  118. package/mcp-server/lib/ops.mjs +19 -10
  119. package/mcp-server/lib/whatif.mjs +7 -6
  120. package/mcp-server/package.json +1 -1
  121. package/mcp-server/server.mjs +55 -19
  122. package/package.json +1 -1
  123. package/portal-ui/package.json +1 -1
  124. package/providers/clarivate/src/adapter.js +3 -0
  125. package/providers/jx/src/nativeread.js +5 -3
  126. package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
  127. package/providers/oauth-mcp-bridge/package.json +1 -1
  128. package/providers/perplexity/src/core.js +7 -2
  129. package/providers/signa/src/adapter.js +3 -0
  130. package/scripts/e2e-first-time.mjs +2 -2
  131. package/shared/brand.mjs +0 -2
  132. package/shared/connector-signin-probe.mjs +1 -1
  133. package/shared/names-in-force.mjs +1 -0
  134. package/skills/clearotron-account/SKILL.md +21 -11
  135. package/skills/clearotron-client/SKILL.md +15 -15
  136. package/skills/clearotron-ops/COURIER.md +5 -1
  137. package/skills/clearotron-ops/SKILL.md +21 -14
@@ -59,12 +59,10 @@ export const TOOL_WRITTEN_ARTIFACTS = new Map([
59
59
  refusals: (runDir) => frameRefusalsFor(runDir) }],
60
60
  ["knockout-frame.md", { tool: "record_knockout_frame", what: "the batch scope note",
61
61
  refusals: (runDir) => frameRefusalsFor(runDir) }],
62
- // The knockout lane's reviewing pass. ONE EXACT BASENAME, and it sits under `_driver/` rather than the
63
- // run root because the artifact is the pass's account of what it rewrote, not a surface a client is
64
- // shown — the lookup keys on the basename either way. The row is what makes a repair on this stage a
65
- // CALL: the seat's grant carries no Write, so a ladder handing it the write form would order a
66
- // hand-write it cannot perform, on a stage whose failure is deliberately quiet.
67
- ["knockout-review.json", { tool: "record_knockout_review", what: "your rewrites of the lines a reader sees first",
62
+ // The knockout lane's reviewing pass. ONE EXACT BASENAME, at the run root: the pass's answer and the material defects it found,
63
+ // not a surface a client is shown. The row is what makes a repair on this stage a CALL: the seat's grant carries no Write, so a
64
+ // ladder handing it the write form would order a hand-write it cannot perform.
65
+ ["knockout-review.json", { tool: "record_knockout_review", what: "your answer and the material defects you found",
68
66
  refusals: (runDir) => knockoutReviewRefusalsFor(runDir) }], ["knockout-register.json", { tool: "record_knockout_register_read", what: "what you carried forward, set aside and did not ask", refusals: (runDir) => knockoutRegisterRefusalsFor(runDir) }],
69
67
  [BLIND_FRAME_MODEL_FILE, { tool: "record_blind_frame", what: "the threat model" }],
70
68
  [SKEPTIC_FLAGS_FILE, { tool: "record_skeptic", what: "your flags and escalation decisions" }],
@@ -10,6 +10,7 @@
10
10
 
11
11
  import { runLog, note } from "../log.mjs";
12
12
  import { everyToolCallRefused } from "../engine/tool-refusal.mjs";
13
+ import { productFaultOf } from "../product-fault.mjs";
13
14
 
14
15
  // #5b — stop a WARM attempt after ONE try when it ran to the HARD WALL. The warm patch is the one rung that resumes
15
16
  // a session: it is passed the session that just produced a content failure. If that resumed turn was SIGKILLed at
@@ -194,6 +195,15 @@ export function nextRung({ fail, warm, attempt, maxRetries, attemptFails, usage,
194
195
  fail: String(fail).slice(0, 200) });
195
196
  } catch { /* telemetry best-effort — never fail a turn over a journal line */ }
196
197
  }
198
+ // A PRODUCT FAULT ENDS THE LADDER. The call failed for a reason in the product, and the step was told not to repeat
199
+ // it (product-fault.mjs), so a re-ask would ask for the call it was told not to make, and a fresh attempt would
200
+ // make it again at full cost. The stage ends failed with the fault named, and the run delivers the gap.
201
+ const fault = productFaultOf({ fail, runDir, label: name });
202
+ if (fault) {
203
+ note(`[${name}] attempt ${attempt} ended on a product fault (${fault.cause}${fault.tool ? ` on ${fault.tool}` : ""}) — breaking the ladder: the call is not repeated, and the gap is delivered`);
204
+ recordAttemptPrevented("ladder-break:product-fault", "product-fault");
205
+ return out("break");
206
+ }
197
207
  // Exactly one row per prevented attempt: the warm produced-nothing case satisfies the cut AND then
198
208
  // falls into the break below, and two rows for one decision would double every count taken off them.
199
209
  const cutFired = identicalContent && producedNothing && warm && attempt < maxRetries + 1;
@@ -8,7 +8,7 @@
8
8
  // Moved out of gateway.mjs unchanged, so that the ladder's phases import these instead of having them handed in.
9
9
  import { CONNOTATION_FORM_TOKEN_RE, CONNOTATION_NO_RESEMBLANCE_MARK, CONNOTATION_UNMATCHED_MARK } from "../connotation-search.mjs";
10
10
  import { REGISTER_AXES } from "../coverage-ledger.mjs";
11
- import { DISPOSITIONS, POSITION_REQUIRED_DISPOSITIONS } from "../findings-model.mjs";
11
+ import { DISPOSITIONS, FINDINGS_SCHEMA_VERSION, POSITION_REQUIRED_DISPOSITIONS } from "../findings-model.mjs";
12
12
  import { undispatchableFiringDirectives } from "../frame-diff-model.mjs";
13
13
  import { CLEARANCE_FINDINGS_TOKEN_RE, gridLedgerNameFor, repairSiblingName, toolWrittenArtifact } from "./form-sync.mjs";
14
14
  import { rel } from "./turn-signals.mjs";
@@ -56,7 +56,7 @@ export function correctiveMessage(baseMessage, attempt, lastFail, expectFile, {
56
56
  (toolWritten
57
57
  ? `call \`${toolWritten.tool}\` with ${toolWritten.what} as soon as the values are ready — the driver ` +
58
58
  `writes the file from that call, and nothing you write by hand is read — `
59
- : `CALL THE WRITE TOOL for the required file(s) as soon as their content is ready, `) +
59
+ : `write the required file(s) as soon as their content is ready, `) +
60
60
  `keep your text reply to a 2-3 line summary, and never restate file contents or your reasoning in the reply. `
61
61
  : "";
62
62
  if (!/^(invalid_file|missing_file)/.test(inner))
@@ -65,7 +65,7 @@ export function correctiveMessage(baseMessage, attempt, lastFail, expectFile, {
65
65
  `\n\nCORRECTION: ${budget}${requiredFileClause(inner, { names, toolWritten })}`;
66
66
  return baseMessage +
67
67
  `\n\nCORRECTION: your previous attempt failed file validation (${inner}). ${budget}Re-do the task and make sure ` +
68
- `${correctionHint(inner, { gridLedgerName: gridLedgerNameFor(expectFile), supplementalLane, undispatchable: frameDiffUndispatchable(expectFile, inner), heldRecord: heldSynthesisRecord(files), adds })}. ` +
68
+ `${correctionHint(inner, { gridLedgerName: gridLedgerNameFor(expectFile), supplementalLane, undispatchable: frameDiffUndispatchable(expectFile, inner), toolWritten: toolWritten?.tool ?? null, heldRecord: heldSynthesisRecord(files), adds })}. ` +
69
69
  requiredFileClause(inner, { names, toolWritten });
70
70
  }
71
71
 
@@ -111,8 +111,9 @@ export function frameDiffUndispatchable(expectFile, lastFail = "framediff_direct
111
111
 
112
112
  // THE WRITER'S RETRY, WHEN THE DRIVER HOLDS ITS RECORD. A save the tool accepted can still fail the stage's own check
113
113
  // of the written files, and the driver then holds the record that save left: the retry sends only the change, in the
114
- // patch the follow-ups above it ask for. A record nobody saved yet, or one whose version is being replaced, still
115
- // takes the complete save.
114
+ // patch the follow-ups above it ask for. A record nobody saved yet, or one held at another schema version, which must be
115
+ // re-versioned, still takes the complete save. The version is read off the held record, never off the failure's text: a
116
+ // row's own check names the schema in its explanation, and that says nothing about the version the record is held at.
116
117
  // The patch a held record takes, in the tool's own words; the retry for most findings checks leaves the narrative as it is.
117
118
  // On the correction answering a review's flags, and on its retries, the rows are described in the words ruled for that
118
119
  // correction (2026-11-02): it may add the finding for an excluded position its flags name (synthesis-record.mjs).
@@ -122,7 +123,6 @@ export const CORRECTION_ROWS = "the complete finding objects you changed or adde
122
123
  export const patchRows = (adds = false) => (adds ? CORRECTION_ROWS : REPLACED_ROWS);
123
124
  const heldRecordPatch = (adds = false) => `ONE \`record_synthesis\` PATCH call, sending only the change: \`findings_patch\` carrying ${patchRows(adds)}, and \`findings\` carrying any register you corrected, complete, and never a \`findings[]\` list`;
124
125
  const heldRecordRetry = (adds = false) => `Fix exactly that in ${heldRecordPatch(adds)}; leave the narrative prose unchanged`;
125
- const VERSION_FAILURE_RE = /finding_legacy_scale_forbidden|schema_version/;
126
126
  // A USE CHECK'S CORRECTION corrects what depends on the finding too, so it never says to leave the narrative as it is
127
127
  // (design, 2026-10-28). A held record takes the patch, in the tool's own words, with the narrative sections it changes;
128
128
  // a record not yet accepted is completed by its first call, which the line after every hint names. The caller prints a
@@ -132,12 +132,17 @@ const useCheckCorrection = (heldRecord, adds = false) => heldRecord
132
132
  ? `${RESEARCH_CORRECTION} Send it in ${heldRecordPatch(adds)}. In \`narrative\`, send only the sections you changed — the rest are held`
133
133
  : RESEARCH_CORRECTION.replace(/\.$/, "");
134
134
  /**
135
- * Does the driver hold an accepted synthesis record for the run these files belong to? Read from either of the files
136
- * the writer's call renders: the stage's own expected file is the narrative, and a caller may name the findings.
135
+ * Does the driver hold an accepted synthesis record for the run these files belong to, at the schema version this driver
136
+ * dictates, so that a retry patches it? Read from either of the files the writer's call renders: the stage's own
137
+ * expected file is the narrative, and a caller may name the findings. A record held at another version is re-sent whole.
137
138
  */
138
139
  export const heldSynthesisRecord = (files) => {
139
140
  const f = (Array.isArray(files) ? files : [files]).find((x) => typeof x === "string" && [NARRATIVE_FILE, FINDINGS_FILE].includes(basename(x)));
140
- return Boolean(f) && existsSync(synthesisCallPaths(dirname(f)).accepted);
141
+ if (!f) return false;
142
+ const at = synthesisCallPaths(dirname(f)).accepted;
143
+ if (!existsSync(at)) return false;
144
+ try { return JSON.parse(readFileSync(at, "utf8"))?.params?.findings?.schema_version === FINDINGS_SCHEMA_VERSION; }
145
+ catch { return false; }
141
146
  };
142
147
 
143
148
  // ── A FAILURE'S CODES: THE TOKENS ITS REASON CARRIES ─────────────────────────────────────────────
@@ -235,7 +240,7 @@ export const REPAIR_HINTS = [
235
240
  extra = /own inputs under "inputs"/.test(lastFail)
236
241
  ? ` SPECIFIC FIX: delete composite/level/dispute_type and record the framework's own inputs under ` +
237
242
  `"inputs", then give the band the framework's table yields for them.`
238
- : ` SPECIFIC FIX: schema_version 4 carries NO composite/level/dispute_type — delete those keys. ` +
243
+ : ` SPECIFIC FIX: a finding carries NO composite/level/dispute_type — delete those keys. ` +
239
244
  `The rating is "band": the band WORD your reasoning under the framework you read yields (EXACTLY one of ` +
240
245
  `its band words, as written in the framework). Your reasoning trail stays in the narrative prose.`;
241
246
  } else if (/finding_(inputs_[a-z]+|band_off_table|borderline_off_table):/.test(lastFail)) {
@@ -253,8 +258,8 @@ export const REPAIR_HINTS = [
253
258
  `findings are NOT rated and carry NO band. The top level carries "rated_under_framework" = the ` +
254
259
  `framework key you were told to rate under, verbatim.`;
255
260
  }
256
- return `findings.json is a JSON OBJECT { schema_version, rated_under_framework, findings[], coverage[], context_notes[] } ` +
257
- `(schema_version 5 additionally allows top-level ask_answers[] = [{ask, answer}], structured mark_assessment fields, ` +
261
+ return `The findings record is a JSON OBJECT { schema_version, rated_under_framework, findings[], coverage[], context_notes[] } ` +
262
+ `(it also allows top-level ask_answers[] = [{ask, answer}], structured mark_assessment fields, ` +
258
263
  // review — coverage_judgment.rows USED TO BE LISTED HERE as a key the model may emit, and
259
264
  // this is the message the seat reads at the moment it is REPAIRING findings.json: the one turn
260
265
  // where it is most likely to re-add a field the driver took. The dictation deletes the invitation
@@ -267,7 +272,7 @@ export const REPAIR_HINTS = [
267
272
  `you type there is replaced wholesale. ` +
268
273
  // — the contract the driver now dictates. Stated here because this hint is what the model
269
274
  // reads when a findings_/finding_ token fails: a hint naming the old contract teaches the wrong one.
270
- `On schema_version 6 EVERY finding that reaches a reader carries BOTH "legal_position" and "practical_position" — ` +
275
+ `EVERY finding that reaches a reader carries BOTH "legal_position" and "practical_position" — ` +
271
276
  // ── — THE SET IS DERIVED, NOT RETYPED ───────────────────────────────────────────────────
272
277
  //
273
278
  // This sentence hand-listed all five dispositions, which made it a SECOND AUTHOR of a closed set
@@ -290,14 +295,14 @@ export const REPAIR_HINTS = [
290
295
  `"off_field_ground" = "different-field" (the goods do not meet — its own goods_proximity meter must then read ` +
291
296
  `"low") or "no-material-risk" (a clear win, carrying no field claim). A mark argued apart on sound, rhythm, ` +
292
297
  `orthography or connotation is "distinguished", never off-field. ` +
293
- `On schema_version 4+ each finding carries "band" (the framework-in-force's band WORD; rated dispositions only — ` +
298
+ `Each finding carries "band" (the framework-in-force's band WORD; rated dispositions only — ` +
294
299
  `composite/level/dispute_type are RETIRED and forbidden), owner.registrations[] (ONE entry per ` +
295
300
  `registration — never overwrite or transpose another's facts; a finding with no fetched record → []), the four ` +
296
301
  `meters as {token, basis} (basis = verified-from-record | inferred-from-signal), quadrant {x,y} in [0,1], a ` +
297
302
  `typed source, a disposition, and a unique 1-based ordinal. The failed check was: ${tok}.${extra} ` +
298
303
  (USE_CHECK_TOKEN_RE.test(lastFail) ? useCheckCorrection(heldRecord, adds)
299
- : heldRecord && !VERSION_FAILURE_RE.test(lastFail) ? heldRecordRetry(adds)
300
- : `Fix exactly that, re-save the COMPLETE findings.json, and leave the narrative prose unchanged`);
304
+ : heldRecord ? heldRecordRetry(adds)
305
+ : `Fix exactly that in one complete \`record_synthesis\` call, and leave the narrative prose unchanged`);
301
306
  } },
302
307
  { code: "coverage_status_offenum", codes: ["coverage_status_offenum"], hint(lastFail) {
303
308
  // D1 — the off-enum PROSE Status cell (distinct from coverage_status_invalid, which is the JSON
@@ -312,7 +317,7 @@ export const REPAIR_HINTS = [
312
317
  `applicable or not searched is an honest \`deferred\` with the reason stated. Leave every other row ` +
313
318
  `and section unchanged`;
314
319
  } },
315
- { code: "coverage_ledger_shape", codes: ["coverage_ledger_unparseable", "coverage_ledger_empty", "coverage_axis_invalid", "coverage_axis_missing", "coverage_status_invalid", "coverage_key_unknown", "coverage_mirror_missing"], hint(lastFail, { resaveClause }) {
320
+ { code: "coverage_ledger_shape", codes: ["coverage_ledger_unparseable", "coverage_ledger_empty", "coverage_axis_invalid", "coverage_axis_missing", "coverage_status_invalid", "coverage_key_unknown", "coverage_mirror_missing"], hint(lastFail, { resaveClause, toolWritten }) {
316
321
  // Map #3 — `mirror_missing` is LEGACY and never fires anymore (the JSON is code-derived from the prose,
317
322
  // so the prose↔JSON cross-check was retired); the alternation keeps it only to give a sane hint to any
318
323
  // in-flight pre-Map-#3 run that might surface it. The structure tokens (unparseable/empty/axis_*/status_*/
@@ -337,7 +342,9 @@ export const REPAIR_HINTS = [
337
342
  `table only — never invent an axis to carry it, and never drop a real axis to make room. scope = the ` +
338
343
  `verbatim right side; status = EXACTLY one bare token of confirmed-clean / coverage-limited / deferred ` +
339
344
  `(a qualifier like "(count-only, saturated)" moves into reason). The failed check was: ${tok}. ` +
340
- resaveClause;
345
+ // THE LEDGER'S ROWS RIDE THEIR OWN TOOL. Where the findings are written from the digest's record call, the
346
+ // coverage rows still come from `record_coverage`, so the correction names that tool and not the digest's.
347
+ (toolWritten ? resaveVia(COVERAGE_TOOL) : resaveClause);
341
348
  } },
342
349
  { code: "use_check_missing", codes: ["use_check_missing"], hint(lastFail) {
343
350
  return "every finding the failed check names by number, a finding at a material band whose owner's use is recorded as " +
@@ -551,7 +558,7 @@ export const REPAIR_HINTS = [
551
558
  { code: "receipts_short", codes: ["receipts_short"], hint(lastFail) {
552
559
  const shorts = (lastFail.match(/receipts_short:([^\s]+)/) || [])[1] || "";
553
560
  return `the Negative-results matrix accounts for EVERY (variant × platform) grid cell — these variants are ` +
554
- `short (variant:rows/expected): ${shorts}. Re-transcribe their cells from the grid call's stdout JSON ` +
561
+ `short (variant:rows/expected): ${shorts}. Add their rows from the cells in the grid tool's ledger ` +
555
562
  `(every cell needs a receipt row: "No results" / "No similar listings (N candidates reviewed)" / ` +
556
563
  `"Similar listing(s) found — see Findings" / "not executed — coverage-limited"); re-run the grid call ` +
557
564
  `only if those cells are genuinely absent from its output`;
@@ -712,26 +719,6 @@ export const REPAIR_HINTS = [
712
719
  `Answer from the gather stages' actual results (the owning stage was instructed to run each check); an ` +
713
720
  `un-run check gets the honest "NOT executed this run — <reason>" answer plus an open coverage[] row — never silence`;
714
721
  } },
715
- { code: "tool_timeout", withDetail: ["tool_timeout"], hint(lastFail) {
716
- // — THE SAME ABSENT BAND, AND THE OPPOSITE INSTRUCTION.
717
- //
718
- // `named_band_missing`'s hint below tells the model it never made its call. When the call WAS made
719
- // and was killed in flight, that sentence is false, and it is worse than merely useless: it accuses
720
- // a model that did exactly what it was told, and it invites the one repair the doctrine forbids —
721
- // writing the band by hand to make the complaint go away. R5 on 2026-08-12 took that hint four
722
- // times against a deterministic 300s cap.
723
- //
724
- // So the hint says what is actually true: the call is right, the call is what to repeat, and if it
725
- // dies again the honest audit note IS the answer. Nothing here asks for a shorter or cheaper call —
726
- // no model gets a time budget, and the cap that killed it is the bridge's, fixed in this issue's
727
- // other half.
728
- return `your dictated register tool call was MADE and never RETURNED — it was still running when ` +
729
- `the bridge killed it, so the band was never written. This is NOT a missing-structure defect and ` +
730
- `NOT something you did wrong. Call register_execute_plan ONCE more with the exact ` +
731
- `{"plan_path", "axis", "output_path"} from your stage instructions. If it is killed again, do ` +
732
- `NOT author band blocks by hand and do NOT narrate coverage you did not get — the driver's own call ` +
733
- `log records that the call never returned`;
734
- } },
735
722
  { code: "named_band_missing", codes: ["named_band_missing"], hint(lastFail) {
736
723
  // 2026-07-14 (copper-keystone): the unit's .md narrated success but the band file was NEVER WRITTEN —
737
724
  // the model skipped its one register_execute_plan call and fabricated the narrative. Unlike the
@@ -1008,16 +995,21 @@ export const REPAIR_HINTS = [
1008
995
  } },
1009
996
  ];
1010
997
 
998
+ /** The repair act on a step whose result a record tool carries: the values go through that tool, and the driver writes. */
999
+ const resaveVia = (tool) => `Fix exactly that. Send the corrected values through \`${tool}\`. The driver writes the result`;
1000
+ const COVERAGE_TOOL = "record_coverage";
1001
+
1011
1002
  const REPAIR_HINT_DEFAULT = "the required output file is actually written and contains every required section IN FULL";
1012
1003
 
1013
1004
  export function correctionHint(lastFail, { gridLedgerName = "common-law-grid.json", supplementalLane = false, undispatchable = [], toolWritten = null, heldRecord = false, adds = false } = {}) {
1014
- // The repair act, for the hints that name one. Kept to a single sentence and a single decision so a
1005
+ // The repair act, for the hints that name one. Kept to a single decision so a
1015
1006
  // new hint has one thing to append rather than a branch to reproduce.
1016
1007
  const resaveClause = toolWritten
1017
- ? `Fix exactly that and send the corrected values — the driver re-derives this file and the prose table together from your \`${toolWritten}\` call, so there is nothing here for you to save`
1008
+ ? resaveVia(toolWritten)
1018
1009
  : `Fix exactly that, re-save the COMPLETE JSON file, and leave the prose table unchanged`;
1019
1010
  const row = hintSelection(lastFail)?.row;
1020
- return row ? row.hint(lastFail, { resaveClause, gridLedgerName, supplementalLane, undispatchable, toolWritten, heldRecord, adds }) : REPAIR_HINT_DEFAULT;
1011
+ if (row) return row.hint(lastFail, { resaveClause, gridLedgerName, supplementalLane, undispatchable, toolWritten, heldRecord, adds });
1012
+ return toolWritten ? `your \`${toolWritten}\` call carries every value this step requires, in full` : REPAIR_HINT_DEFAULT;
1021
1013
  }
1022
1014
 
1023
1015
  /**
@@ -1080,16 +1072,6 @@ export function warmPatchMessage(lastFail, expectFile, { supplementalLane = fals
1080
1072
  return `You are RESUMING your own session for this stage — your prior work and inputs are already in your context. Do NOT redo your digest prose (${names} already passed validation) and do NOT author band blocks by hand.\n` +
1081
1073
  `The named band ${band} was NEVER WRITTEN — the stage cannot pass without it. Call register_execute_plan ONCE with the exact {"plan_path", "axis", "output_path"} from your original stage instructions (output_path = ${band}); the TOOL executes the dictated entries and writes the band itself, qid-stamped. Then stop — do not edit the band afterwards.`;
1082
1074
  }
1083
- // — THE SAME RESUME, WITHOUT THE ACCUSATION. The branch above tells the model the band was never
1084
- // written, which on a killed call reads as "you did not do it" to a model that did. Worse, a model
1085
- // told it failed to produce an artifact has one obvious way to comply, and it is the forbidden one.
1086
- // Warm for the same reason that one is: the session completed cleanly and the repair is one call.
1087
- if (/\btool_timeout:/.test(lastFail ?? "") && files.length) {
1088
- const band = join(dirname(files[0]), basename(files[0]).replace(/\.md$/i, "-band.json"));
1089
- return `You are RESUMING your own session for this stage — your prior work and inputs are already in your context. Do NOT redo your digest prose (${names} already passed validation).\n` +
1090
- `Your register tool call WAS MADE and never returned — it was still running when the bridge killed it, so ${band} was never written. Nothing about your turn was wrong. Call register_execute_plan ONCE more with the exact {"plan_path", "axis", "output_path"} from your original stage instructions (output_path = ${band}), then stop.\n` +
1091
- `If it is killed again: do NOT author band blocks by hand and do NOT narrate coverage you did not obtain. The driver's own call log records that the call never returned.`;
1092
- }
1093
1075
  // Sibling-JSON defects (WS-A coverage mirror / common-law grid): the FINDINGS file already passed
1094
1076
  // its prose checks — telling the model to rewrite it "in full" on a patch turn risks degrading
1095
1077
  // valid prose (and a prose-structural failure is NOT quarantine-rescuable). Name the SIBLING file
@@ -1175,18 +1157,8 @@ export function warmPatchMessage(lastFail, expectFile, { supplementalLane = fals
1175
1157
  const outIsToolWritten = files.length ? toolWrittenArtifact(files[0]) : null;
1176
1158
  if (sibling && files.length && !sibIsToolWritten && !outIsToolWritten) {
1177
1159
  const sib = join(dirname(files[0]), sibling);
1178
- // THE OUT FILE IS NAMED ONLY TO SAY "LEAVE IT ALONE", AND ON A CONVERTED STAGE THAT IS THE WRONG WAY
1179
- // TO SAY IT. This message carries TWO artifacts — the stage's out, told to stand,
1180
- // and the sibling, told to be re-saved — so a reader looking for "does any message name a
1181
- // tool-written artifact beside a write order" cannot pair them, and the guard flags the pair.
1182
- // Its conservatism is right: pairing an order with a target by proximity would be guessing, and the
1183
- // defect it exists to catch looks exactly like this from outside. So the converted case says the file
1184
- // is the driver's WITHOUT naming a path — which is also more accurate than telling a seat not to
1185
- // rewrite something it holds no writer for.
1186
- const outIsToolWritten = toolWrittenArtifact(files[0]);
1187
- const standsClause = outIsToolWritten
1188
- ? `Do NOT redo the work from scratch. This stage's own output is the driver's — it is rendered from your \`${outIsToolWritten.tool}\` call and you hold no tool that writes it, so there is nothing there for you to rewrite or protect.`
1189
- : `Do NOT redo the work from scratch, and do NOT rewrite ${names || "the findings file"} (it already passed validation).`;
1160
+ // The stage's own output is not the driver's here (the guard above), so the session is told to leave it as it stands.
1161
+ const standsClause = `Do NOT redo the work from scratch, and do NOT rewrite ${names || "the findings file"} (it already passed validation).`;
1190
1162
  return `You are RESUMING your own session for this stage — your prior work and inputs are already in your context. ${standsClause}\n` +
1191
1163
  `Your saved ${sibling} failed validation (${lastFail}). Fix exactly this: ensure ${correctionHint(lastFail, { gridLedgerName: gridLedgerNameFor(files), supplementalLane, undispatchable: frameDiffUndispatchable(files, lastFail), heldRecord: heldSynthesisRecord(files), adds })}.\n` +
1192
1164
  `Re-save the COMPLETE corrected JSON at ${sib}. Do not stop until it exists and is valid.`;
@@ -1242,7 +1214,7 @@ export function warmPatchMessage(lastFail, expectFile, { supplementalLane = fals
1242
1214
  // anything.
1243
1215
  : `What you sent did not pass (${lastFail}). Fix exactly this: ensure ${correctionHint(lastFail, { supplementalLane, undispatchable: frameDiffUndispatchable(files, lastFail), toolWritten: toolWritten.tool, heldRecord: heldSynthesisRecord(files), adds })}.\n`) +
1244
1216
  `Call \`${toolWritten.tool}\` with the values from the work already in your context — never by writing or editing any file. ` +
1245
- `Do not stop until the tool accepts the call.`;
1217
+ `Do not stop until the tool accepts the call or reports a product fault.`;
1246
1218
  }
1247
1219
  // Write-mode branch (E2E R2 2026-07-30/31): the FAILURE TOKEN is the validator's own existence verdict,
1248
1220
  // measured at the moment that matters — branch on it rather than re-deriving with an existsSync here
@@ -6,12 +6,12 @@
6
6
  // every attempt. It refuses a dispatch with no message or no session key, and a billing mode it cannot honour.
7
7
 
8
8
  import { config } from "../driver.config.mjs";
9
- import { withSendUntil } from "../engine/mcp/gather-config.mjs";
9
+ import { withSendUntil, declaredStageOfLabel } from "../engine/mcp/gather-config.mjs";
10
10
  import { sendReserveMs } from "../../providers/_shared/send-until.mjs"; // each turn's plan calls stop sending ahead of its deadline
11
11
  import { resolveAuthMode } from "../engine/auth.mjs";
12
12
  import { REGISTER_ENUMERATE_TOOL } from "../stages.mjs";
13
13
  import { stageTools } from "./stage-tools.mjs";
14
- import { STAGE_DECLARATIONS, declaredStageOf, replyIsOutput } from "../stage-declarations.mjs";
14
+ import { STAGE_DECLARATIONS, declaredStageOf, replyIsOutput, turnOutputOf } from "../stage-declarations.mjs";
15
15
 
16
16
  export function stageOf(name, opts, stageHome, engine) {
17
17
  const {
@@ -74,5 +74,5 @@ export function stageOf(name, opts, stageHome, engine) {
74
74
  const turnConfig = (sec) => withSendUntil(gatherMcpConfig, Date.now() + sec * 1000 - sendReserveMs(sec));
75
75
  return { name, engine, stageHome, agent, message, refreshMessage, model, thinking, sessionKey, timeoutSec, stallSec, files, validate,
76
76
  maxRetries, runDir, followup, bandSize, derivedLimit, adds, supplementalLane, auth, gatherAllowedTools, gatherSeatWrites: seatWrites,
77
- declaration: declared, engineSkillsDir, engineSkillsGrantRoots, engineResolveSkill, turnConfig };
77
+ declaration: declared, turnOutput: turnOutputOf(declared ?? STAGE_DECLARATIONS[declaredStageOfLabel(name)] ?? null), engineSkillsDir, engineSkillsGrantRoots, engineResolveSkill, turnConfig };
78
78
  }
@@ -237,21 +237,11 @@ export function rel(p) {
237
237
  const m = /[\\/](clearance-search|prelim-search)[\\/]/.exec(p); // either spelling of the studio segment, behind either separator
238
238
  return m ? p.slice(m.index + 1) : p;
239
239
  }
240
- const WARM_ELIGIBLE_RE = new RegExp(`^(missing_file|invalid_file:.*?:(use_check_missing|own_rights_missing|coverage_ledger_unparseable|coverage_ledger_empty|coverage_axis_invalid|coverage_axis_missing|coverage_status_(invalid|offenum)|coverage_key_unknown|coverage_(no_status|form_damaged|form_axis_invalid|form_engine_vocabulary)|grid_join_missing|grid_ledger_unparseable|platforms_missing|${CONNOTATION_FORM_TOKEN_SRC}|findings?_[a-z_]+|blindframe_[a-z_]+|framediff_[a-z_]+|named_band_(state_invalid|block_invalid|unparseable|missing)|tool_timeout:[a-z_]+:[a-z0-9-]+|plan_audit_missing|intake_ask_unanswered))`);
240
+ const WARM_ELIGIBLE_RE = new RegExp(`^(missing_file|invalid_file:.*?:(use_check_missing|own_rights_missing|coverage_ledger_unparseable|coverage_ledger_empty|coverage_axis_invalid|coverage_axis_missing|coverage_status_(invalid|offenum)|coverage_key_unknown|coverage_(no_status|form_damaged|form_axis_invalid|form_engine_vocabulary)|grid_join_missing|grid_ledger_unparseable|platforms_missing|${CONNOTATION_FORM_TOKEN_SRC}|findings?_[a-z_]+|blindframe_[a-z_]+|framediff_[a-z_]+|named_band_(state_invalid|block_invalid|unparseable|missing)|plan_audit_missing|intake_ask_unanswered))`);
241
241
 
242
- // — `tool_timeout` IS ON THAT LIST TO KEEP ROUTING WHERE IT ALREADY IS, not to add a lane.
243
- //
244
- // This failure reaches the ladder today as `named_band_missing`, which is warm-eligible. Renaming the
245
- // token without adding it here would quietly move the class from warm to COLD — a full stage re-run
246
- // instead of a resume, on every timeout, as a side effect of an attribution fix. A rename must not
247
- // change what a failure costs.
248
- //
249
- // The issue notes that the argument applies: "the retry ladder cannot help a deterministic tool
250
- // timeout — this failure class is an argument for the same disclosed-deferral treatment when the ladder
251
- // is provably futile." That is a real question and it is NOT settled here. Two reasons to leave it:
252
- // this issue's OTHER half raised the bridge cap, so a retry is no longer provably futile — R5's four
253
- // attempts all died at a 300s cap that no longer applies; and turning a failure class into a disclosed
254
- // deferral is a doctrine change, which is the to make and not an attribution fix's.
242
+ // — `tool_timeout` IS NOT ON THAT LIST. A register call that was sent and never returned is a product fault (ruled
243
+ // 2026-11-24): the ladder ends on it (ladder/next-rung.mjs) rather than resuming the unit to make the call again, and
244
+ // the run delivers that unit's slices open, as having timed out (steps/register-sweep.mjs).
255
245
 
256
246
  // — a rejected draft may be CARRIED across a recovery park only when its repair is a PATCH, not a
257
247
  // re-search. That is exactly the judgement WARM_ELIGIBLE_RE already encodes: the tokens meaning "the
@@ -13,13 +13,33 @@
13
13
  export const FAMILY_COMPLETENESS = `FAMILY COMPLETENESS (MANDATORY): the variants[] array must state the mark's WHOLE search family, never a single row — at MINIMUM one "core" variant (the mark / a spacing-punctuation form of it), one "phonetic" variant and one "visual" variant; and when the mark, the dominant element or any elements[] value is non-Latin, at least one "transliteration" variant as well (the transliteration-numeric register axis compiles ONLY from transliteration/numeric rows — with none stated, that axis runs empty, silently). A manifest missing any of these fails the stage. State the family completely and let the searches say what is out there — completeness here is structural, it is NOT a ranking, and it never pre-judges which neighbour matters.`;
14
14
  export const COMMON_LAW_PARITY = `COMMON-LAW PARITY: a common-law / marketplace finding gets THE SAME rating machinery as a register finding — the framework's band by the same method, the same meters, the same legal_position / practical_position split, the same disposition logic (and manageable where it applies). The renderer keeps common-law in its own section (a different LEGAL BASIS — unregistered rights), but the section split is presentation: never leave a common-law conflict unrated, half-metered, or rated on a softer scale because its source is marketplace/web rather than a register.`;
15
15
  export const RESPONSE_BAND_COHERENCE = `RESPONSE-BAND COHERENCE — if a finding's recommended path is consent / coexistence / settlement before filing, state in ONE line which band's Practical position those words describe under the framework in force — or why the response addresses only prosecution mechanics / nuisance posture (the lowest band's own practical words). Carve-outs: a documented EXISTING coexistence agreement is a FACT about the conflict, not a response (it does not trigger this line); a consent sought to clear a routine citation can be a legitimate lowest-band "registration obstacle". The line reconciles — it never moves a band by itself.`;
16
- export const REGISTRATION_NUMBERS = `REGISTRATION NUMBERS (CHANGE 5a): do NOT state a registration / application / serial number in a \`full_detail\` entry — the per-record structured render owns the numbers, and the driver renders the ONE place a number appears (the Source line it composes from this record). Name the OWNER + MARK in prose instead. The acceptance boundary refuses an entry carrying one, so this is a rule you find out about in the turn rather than at delivery.`;
17
- export const ENFORCER_INFERRED = `ENFORCER (CHANGE 5b): if THIS record's enforcer meter basis is "inferred-from-signal" (the litigiousness is reasoned from a proxy — owner size, a good law firm, a portfolio shape — not a filed action on record), present it AS an inference ("on the available signals the owner appears likely to object…"), NEVER as established fact ("the owner is litigious"). Only an enforcer whose basis is "verified-from-record" (a filing / C&D / litigation on record) is stated as fact. Same discipline for any other "inferred-from-signal" claim — it reads as the inference it is.`;
16
+ export const REGISTRATION_NUMBERS = `REGISTRATION NUMBERS: do NOT state a registration / application / serial number in a \`full_detail\` entry — the per-record structured render owns the numbers, and the driver renders the ONE place a number appears (the Source line it composes from this record). Name the OWNER + MARK in prose instead. The acceptance boundary refuses an entry carrying one, so this is a rule you find out about in the turn rather than at delivery.`;
17
+ export const ENFORCER_INFERRED = `ENFORCER: if THIS record's enforcer meter basis is "inferred-from-signal" (the litigiousness is reasoned from a proxy — owner size, a good law firm, a portfolio shape — not a filed action on record), present it AS an inference ("on the available signals the owner appears likely to object…"), NEVER as established fact ("the owner is litigious"). Only an enforcer whose basis is "verified-from-record" (a filing / C&D / litigation on record) is stated as fact. Same discipline for any other "inferred-from-signal" claim — it reads as the inference it is.`;
18
18
  export const LEGAL_TERMS_OF_ART = `LEGAL TERMS OF ART (client-facing lines): a lay client must not misread a term of art. Never "prosecute" / "prosecution (through a citation / the application)" — it reads as "sue them": say "respond to the examiner's objection" / "continue the application process". Never bare "citation" for an examiner's reference — say "the examiner raising the prior mark". Never "office action" — say "the examiner's objection". A formal proceeding (an opposition, a cancellation) is named by its name, with one plain clause on what it means for the client. And CONFIDENCE MATCHES THE RECORD: "through ANY citation" / "will succeed" is sayable only when the record supports it — against a capable owner the honest form is "a citation is likely answerable because <the record's reason>".`;
19
19
 
20
+ // THE PROSE RULES, one line each: binding on every line a reader sees, carried word for word by report-prose.md (design,
21
+ // 2026-11-24) and kept by the three writing stages' text as their fallback, so each writer meets them once.
22
+ export const PROSE_RULES = Object.freeze([
23
+ "THE PROSE RULES — binding on every line a reader sees (the report, its cards, the cover note):",
24
+ "- TWO LEVELS. Default-visible text, anything a reader meets before opening a fold, is in plain words a client reads, with no visible sentence over 25 words. The detail behind the folds stays in legal language, each term glossed at first use. Every surface carries the same caution: never hedge MORE on one surface than on another, and never flatten a surface to bald assertion. The hedge is calibration (\"appears to be\", \"cannot be excluded\"), NEVER a substitute for a fact the run holds — where the run has the record, state the record.",
25
+ "- WORD BUDGETS (targets, not a checker): about 20-25 words a sentence behind a fold, about 80 words a paragraph. Where a hard cap is set (at most 3 sentences for the caption, at most 2 for a finding's conclusion), that cap is a ceiling and never the target — three 60-word sentences obey the cap and defeat it. One idea a sentence; three or more parallel items become a real list, never an inline \"(a)…(b)…(c)\" run.",
26
+ "- EACH FACT ONCE, AT ITS RANK. A finding is stated in its own row. The summary names the decisive one and no other. A later section that needs an earlier finding CROSS-REFERENCES IT BY ORDINAL (\"the three US class-32 rights — findings 1, 4 and 7\") and stops. Telling the same mark, owner or conflict again in a second and third section is the largest single defect in the delivered product: the report's structure already holds each fact once, and your prose must use that structure instead of restating into it.",
27
+ "- NO PRESCRIPTIONS (RULED). Prose states the POSITION, never the remedy. NEVER \"we recommend / we advise / we suggest\", \"you should\", \"the practical path is\", \"the realistic path is\", \"consider …ing\", \"it would be prudent to\", or any imperative aimed at the reader. State what IS — the risk, the evidence, the weakest point, the deadline, the process fact — and let the typed actions register carry what a human must do.",
28
+ "- NO DISCLAIMERS (RULED). No boilerplate caveat about the document (none per card, none in the caption, none in the email), no \"further investigation may be warranted\" tail, no warning about the report's own completeness. A material limit on the answer (what was or was not searched, evidence that is missing, a qualification the framework requires) is a FACT, stated ONCE where it belongs, in consequence terms: \"Chinese-script registers were not searched, so a Chinese filing could surface later.\"",
29
+ "- THE READER OWNS EVERY NOUN. Every noun on a reader's surface is a word they already hold, from their business, their market, or the law said plainly. Where this run has no reader-facing word for a thing, DESCRIBE the thing: the description is the finished sentence, never a stand-in for the term you meant. \"The full variant band enumerated to zero\" and \"annexed on mark distance, not cleared on goods\" name machinery the reader has never met and leave a smart reader nothing to picture; \"we searched every spelling of the name and found no live rights\" and \"the right was set aside because the marks look different, not because their goods were checked\" carry the same facts in words they own. The bar is ONE PASS — a smart reader who is not a lawyer takes the meaning the first time — and this engine already clears it: \"Every other right on the record turned out narrower than its class number suggested once the specification was read.\" JUDGE THE SENTENCE, NEVER THE WORD: a mark, an owner or a product genuinely called AXIS, SLICE or BAND is written exactly as it is named. No word is forbidden here; naming the engine's own thing on the reader's surface is.",
30
+ "- SAY THE LEVEL, NOT ITS NEIGHBOURS. State risk as the level it IS (\"a manageable risk\", \"a high risk\") — never as a relation to another level (\"sits below that level\", \"does not quite reach the level above\", \"one step down from high\").",
31
+ "- THIRD-PARTY RIGHTS ARE NAMED AS RIGHTS. Write \"<MARK>-formative rights\", \"rights that contain <MARK>\", \"other owners of marks containing <MARK>\". NEVER \"<MARK>-branded\" or \"<MARK> branded goods\": that reads as the client's own brand and mis-attributes the right to the wrong party.",
32
+ "- NEVER ASSERT A FACT ABOUT THE CLIENT. Write only what the run's own material establishes. \"Consent or coexistence is not in hand\" claims something about the client's own file that no search reached — the honest form is record-scoped: \"no coexistence agreement appears on the record searched\". The same holds for the client's use, portfolio, budget, timing and intentions.",
33
+ "- SEARCHED-AND-EMPTY IS NOT COULD-NOT-SEARCH. Say which one it is, every time, in the words the run earned: \"searched — none found\" for a source this run actually queried, \"not searched this run\" or \"could not be searched — <the reason>\" for one it did not reach. The two readings must never both appear about the same source in one report.",
34
+ "- ABSENCE OF A PRIVATE ACT PROVES NOTHING. Cease-and-desist letters, settlements, licences and consents are private — no search reaches them, so their absence is never evidence and is never implied to be one. \"No enforcement history surfaced\" may not be written, or positioned, as \"the owner does not enforce\".",
35
+ "- NAME THE LEGAL TEST IN PLAIN WORDS. \"applying the well-accepted framework for confusion — the marks as wholes against the goods and services\" reads correctly to a lawyer and to a client. Never recite a court's factor template as though it structured the analysis, and never cite a decision this run did not fetch.",
36
+ "- NO FILLER. Delete any phrase carrying no fact: run-shaped noise (\"session-wide notice coverage\", \"coverage across the session\"), throat-clearing (\"it is worth noting that\", \"importantly\", \"as noted above\"), and any sentence whose deletion loses nothing.",
37
+ ]);
38
+
20
39
  /** The paragraphs, by the manual that carries them, in the order their stage states them. */
21
40
  export const MANUAL_PARAGRAPHS = Object.freeze({
22
41
  "skills/clearance-variants/SKILL.md": [FAMILY_COMPLETENESS],
23
42
  "skills/clearance-search/synthesis-finding-rules.md": [COMMON_LAW_PARITY, RESPONSE_BAND_COHERENCE],
24
43
  "skills/clearance-search/report-card-rules.md": [REGISTRATION_NUMBERS, ENFORCER_INFERRED, LEGAL_TERMS_OF_ART],
44
+ "skills/clearance-search/report-prose.md": PROSE_RULES,
25
45
  });
@@ -10,10 +10,12 @@
10
10
  // reads, and the images under `_driver/logos/`.
11
11
  //
12
12
  // WHICH REGISTRATIONS. The ones the report shows and no others: a clearance's findings, withdrawn ones left out, and
13
- // the registrations each cites; a Knockout's listed filings. Measured on a 55-finding global preliminary of 2026-11-03:
14
- // 28 of the 3,497 records it held, so 28 image requests (that count approved 2026-11-18).
13
+ // the registrations each card draws, which are at most eight (publish/render.mjs, `shownRegistrations`); a Knockout's
14
+ // listed filings. Measured on a 55-finding global preliminary of 2026-11-03: 28 of the 3,497 records it held, so 28 image
15
+ // requests (that count approved 2026-11-18). Every registration a finding cited was asked about, though, and on two
16
+ // delivered reports of 2026-11-25, 9 of 40 and 6 of 58 image requests were for registrations past a card's eighth.
15
17
  //
16
- // WHAT A ROW SAYS, and only `failed` reads as "Logo not retrieved" on the page:
18
+ // WHAT A ROW SAYS, and only `fetched` draws on the page:
17
19
  // fetched the image is saved; `file` is relative to the run folder, `contentType` PNG, JPEG, GIF or WebP
18
20
  // failed a request was made and did not land, or brought back something that is not one of those images
19
21
  // no-logo the record says a word mark, or that no image exists
@@ -74,13 +76,17 @@ export function imageTypeOf(bytes) {
74
76
  * few (publish/render-knockout.mjs, `shownFilings`), and on a demo re-run 8 of a Knockout's 9 image requests were for
75
77
  * filings no page listed (2026-11-20). `shown(entry, mark)` is that rule and `knockoutMarks` the run's rated names; given
76
78
  * them, only those filings are asked about, and a run whose names could not be read asks about none.
79
+ *
80
+ * A CLEARANCE'S ARE THE REGISTRATIONS EACH CARD DRAWS, by the same token: `cardShows(finding)` is the card's rule; without
81
+ * it, every registration a finding cites.
77
82
  */
78
- export function citedRefs({ findings = null, registerRecords = null, knockoutMarks = null, shown = null } = {}) {
83
+ export function citedRefs({ findings = null, registerRecords = null, knockoutMarks = null, shown = null, cardShows = null } = {}) {
79
84
  const out = [];
80
85
  const add = (ref) => { const k = normalizeRecordUri(ref); if (k && !out.includes(k)) out.push(k); };
81
86
  for (const f of Array.isArray(findings) ? findings : []) {
82
87
  if (f?.disposition === "withdrawn") continue;
83
- for (const r of Array.isArray(f?.owner?.registrations) ? f.owner.registrations : []) add(r?.uri);
88
+ const regs = typeof cardShows === "function" ? cardShows(f) : f?.owner?.registrations;
89
+ for (const r of Array.isArray(regs) ? regs : []) add(r?.uri);
84
90
  }
85
91
  if (typeof shown === "function") {
86
92
  for (const m of Array.isArray(knockoutMarks) ? knockoutMarks : [])
@@ -194,7 +200,16 @@ export async function markLogos(runDir, { findingsPath = null, registerRecordsPa
194
200
  // unless the caller names another file: left to each caller, a pass run by hand that forgot them asked about nothing.
195
201
  const shown = registerRecordsPath ? (await import("./publish/render-knockout.mjs")).shownFilings : null;
196
202
  const namesPath = knockoutFindingsPath ?? (registerRecordsPath ? (await import("./stages-knockout.mjs")).koPaths(runDir).findings : null);
197
- const refs = citedRefs({ findings, registerRecords, knockoutMarks: read(namesPath)?.marks ?? null, shown });
203
+ // A clearance card's own rule for which registrations it draws, over the records the run saved, as the page reads them.
204
+ // A registration past the card's eighth is left out; one the run holds no record of stays, and asks nothing, as before.
205
+ const held = registerRecordsPath ? null : readRecordArtifacts(runDir);
206
+ const shownOnCard = held ? (await import("./publish/render.mjs")).shownRegistrations : null;
207
+ const cardShows = held ? (f) => {
208
+ const has = (uri) => held.has(uri);
209
+ const drawn = new Set(shownOnCard(f, has));
210
+ return (f?.owner?.registrations ?? []).filter((r) => drawn.has(r) || !(r?.uri && has(String(r.uri).toLowerCase())));
211
+ } : null;
212
+ const refs = citedRefs({ findings, registerRecords, knockoutMarks: read(namesPath)?.marks ?? null, shown, cardShows });
198
213
  const at = driverDir(runDir, LOGOS_FILE);
199
214
  const prior = read(at)?.rows ?? [];
200
215
  const register = provider?.id ?? null;
@@ -224,9 +239,10 @@ const SHOWN_TYPES = new Set(["image/png", "image/jpeg", "image/gif", "image/webp
224
239
 
225
240
  /**
226
241
  * The logos a report shows, by registration: `fetched` rows carry the image as a data address, so the delivered
227
- * report fetches nothing and never names the register's image address; `failed` rows carry no image and read "Logo
228
- * not retrieved"; every other row is left out, since it draws nothing. A row's file must sit inside the run's logo
229
- * folder and open as the image type it was saved as, or it is left out. Never throws. IMPURE: it reads the run.
242
+ * report fetches nothing and never names the register's image address; `failed` rows carry no image and draw nothing,
243
+ * but stay in the map so the report document records the failed fetch; every other row is left out. A row's file
244
+ * must sit inside the run's logo folder and open as the image type it was saved as, or it is left out. Never throws.
245
+ * IMPURE: it reads the run.
230
246
  */
231
247
  export function logosForReport(runDir) {
232
248
  const out = new Map();
@@ -2,7 +2,7 @@
2
2
  "name": "clearotron-driver",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "0.7.0-beta.2",
5
+ "version": "0.7.0-beta.4",
6
6
  "license": "AGPL-3.0-only",
7
7
  "description": "Deterministic driver for the trademark clearance workflow: orchestration in code (fan-out, fan-in barrier, gating, retries); the model does judgment leaves only, through a reasoning CLI spawned per stage.",
8
8
  "engines": {
@@ -36,7 +36,7 @@ import { endTheDeliveredRun, runShell } from "./run-shell.mjs"; // — the run
36
36
  import { logTurnaroundReconciliation } from "./run-quote.mjs";
37
37
  import { RunCancelled, assertNotCancelledBeforePublish, isCancelled, readCancel, stopsWithTheRun } from "./cancel.mjs"; // stop-by-user: never the failure lane below
38
38
  import { attachFramework } from "./run-attachments.mjs"; // the one framework freeze, both products'
39
- import { KO_STAGES, KO_STEPS, KO_STEP_REGISTER_COUNT, koSteps, koPaths, kebab, knockoutGridSpec, KNOCKOUT_WEB, KNOCKOUT_MINUTES_BAR, knockoutBarVerdict, koChunks, groupRecordsDoc, filingsOnce, expandFilingsOnce, sameRecord, calibrationExcerptOf } from "./stages-knockout.mjs";
39
+ import { KO_STAGES, KO_STEPS, KO_STEP_REGISTER_COUNT, koSteps, koPaths, kebab, knockoutGridSpec, KNOCKOUT_WEB, KNOCKOUT_MINUTES_BAR, knockoutBarVerdict, koChunks, groupRecordsDoc, filingsOnce, expandFilingsOnce, sameRecord, calibrationExcerptOf, readerProviderDoc } from "./stages-knockout.mjs";
40
40
  import { workedExamplesFor } from "./framework.mjs"; // which worked examples the rating's calibration comes from
41
41
  import { familiesDefect } from "./knockout-frame-record.mjs";
42
42
  import { registerTable, writeRegisterTable } from "./ko-register-tables.mjs";
@@ -676,7 +676,7 @@ async function readTheRegister({ ctx, job, K, run, agent, markRows, plan, counts
676
676
  try {
677
677
  await koStage("knockout-register-read", ctx, { chunkNo: c, msgCtx: {
678
678
  readingLines: readingTableLines({ marks: fam, counts, classes: job.classes ?? null, framedMarks: plan.marks, runDir: run.runDir }),
679
- providerDoc: adapterForRegister(ctx.register)?.skillDoc ?? null, inScope, familySize: fam.length,
679
+ providerDoc: readerProviderDoc(adapterForRegister(ctx.register)), inScope, familySize: fam.length,
680
680
  ...knockoutReaderFiles(run.runDir, plan, scopeDoc, fam[0].name, { family: fam.map((m) => m.name), tag: c }),
681
681
  } });
682
682
  } catch (e) { readerFailures.push({ c, e }); }