clearotron 0.6.0 → 0.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/INSTALL.md +7 -4
  2. package/QUICKSTART.md +1 -0
  3. package/README.md +5 -2
  4. package/THIRD-PARTY-NOTICES.md +1 -1
  5. package/bin/clearotron.mjs +4 -2
  6. package/bin/onboard.mjs +158 -29
  7. package/build-info.json +2 -2
  8. package/docs/CLIENT-MCP.md +3 -1
  9. package/docs/DELIVERY.md +6 -3
  10. package/docs/architecture/02-architecture.md +1 -1
  11. package/docs/branding.md +4 -4
  12. package/docs/report-data/clearance-1.schema.json +320 -0
  13. package/docs/report-data/knockout-1.schema.json +268 -0
  14. package/driver/CHANGELOG.md +39 -0
  15. package/driver/connotation-search.mjs +1 -1
  16. package/driver/contract-e3-backlog.mjs +1 -1
  17. package/driver/coverage-ledger.mjs +18 -2
  18. package/driver/deferral-row.mjs +1 -1
  19. package/driver/degraded-parts.mjs +1 -0
  20. package/driver/driver.config.mjs +4 -3
  21. package/driver/effective-scope.mjs +3 -1
  22. package/driver/engagement-receipt.mjs +3 -3
  23. package/driver/engine/anthropic-agent.mjs +15 -1
  24. package/driver/engine/common.mjs +7 -0
  25. package/driver/engine/mcp/band-server.mjs +7 -16
  26. package/driver/engine/mcp/codex-config.mjs +3 -0
  27. package/driver/engine/mcp/recording-server.mjs +45 -34
  28. package/driver/engine/openai-agent.mjs +74 -7
  29. package/driver/gateway.mjs +67 -10
  30. package/driver/jx.mjs +13 -5
  31. package/driver/manuals-seen.mjs +146 -0
  32. package/driver/mark-logos.mjs +144 -0
  33. package/driver/methodology-witness.mjs +2 -1
  34. package/driver/owner-use-check.mjs +3 -3
  35. package/driver/package.json +1 -1
  36. package/driver/pipeline-knockout.mjs +4 -0
  37. package/driver/pipeline.mjs +92 -7
  38. package/driver/portal-local-auth.mjs +6 -2
  39. package/driver/portal-report.mjs +43 -12
  40. package/driver/portal-routes/me.mjs +4 -1
  41. package/driver/portal-runs.mjs +6 -9
  42. package/driver/profiles.mjs +4 -4
  43. package/driver/publish/README.md +9 -7
  44. package/driver/publish/email-conditions.mjs +2 -2
  45. package/driver/publish/evidence-words.mjs +21 -0
  46. package/driver/publish/index.mjs +104 -90
  47. package/driver/publish/knockout.mjs +75 -49
  48. package/driver/publish/office-record-links.mjs +11 -9
  49. package/driver/publish/page-shell.mjs +98 -0
  50. package/driver/publish/publish-inputs.mjs +4 -0
  51. package/driver/publish/regions.mjs +24 -3
  52. package/driver/publish/register-record.mjs +150 -0
  53. package/driver/publish/render-knockout.mjs +195 -642
  54. package/driver/publish/render.mjs +270 -363
  55. package/driver/publish/report-data.mjs +225 -12
  56. package/driver/publish/strings.mjs +662 -0
  57. package/driver/publish/templates/knockout.css +200 -0
  58. package/driver/publish/templates/report.css +72 -52
  59. package/driver/publish/xlsx.mjs +148 -125
  60. package/driver/record-goods.mjs +42 -0
  61. package/driver/reference-score.mjs +4 -1
  62. package/driver/register-reach.mjs +39 -0
  63. package/driver/registry-fidelity.mjs +3 -8
  64. package/driver/repair-composers.mjs +6 -2
  65. package/driver/repair-targets.mjs +4 -1
  66. package/driver/run-delivered.mjs +6 -1
  67. package/driver/runner.mjs +73 -29
  68. package/driver/scope-facts.mjs +27 -6
  69. package/driver/search-policy.mjs +9 -4
  70. package/driver/stages.mjs +3 -3
  71. package/driver/steps/overview-and-cards.mjs +50 -14
  72. package/driver/steps/verdict-gate.mjs +33 -13
  73. package/driver/suite-census.json +368 -68
  74. package/driver/terminal-clamp.mjs +6 -1
  75. package/mcp-server/CHANGELOG.md +4 -0
  76. package/mcp-server/lib/audit-view.mjs +5 -2
  77. package/mcp-server/lib/brief.mjs +2 -1
  78. package/mcp-server/lib/evidence.mjs +31 -4
  79. package/mcp-server/lib/knockout.mjs +1 -1
  80. package/mcp-server/lib/scrub.mjs +1 -1
  81. package/mcp-server/package.json +1 -1
  82. package/mcp-server/server.mjs +5 -3
  83. package/package.json +4 -1
  84. package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-CtkllKJ2.js} +225 -77
  85. package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
  86. package/portal-ui/dist/index.html +2 -2
  87. package/portal-ui/package.json +3 -3
  88. package/providers/_shared/ledger.mjs +30 -2
  89. package/providers/_shared/record-uri.mjs +15 -0
  90. package/providers/clarivate/src/adapter.js +11 -0
  91. package/providers/clarivate/src/core.js +17 -1
  92. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  93. package/providers/oauth-mcp-bridge/package.json +1 -1
  94. package/scripts/README.md +147 -3
  95. package/scripts/e2e-first-time.mjs +3 -3
  96. package/scripts/freeze-example-run.mjs +3 -3
  97. package/scripts/mint-search-level-tags.mjs +61 -0
  98. package/scripts/mint-source-pin-census.mjs +89 -0
  99. package/scripts/release-note-required.mjs +65 -6
  100. package/scripts/test-durations-reporter.mjs +25 -0
  101. package/scripts/test-full.mjs +72 -18
  102. package/scripts/test-run.mjs +18 -1
  103. package/shared/brand.mjs +85 -5
  104. package/shared/inline-markdown.mjs +53 -0
  105. package/shared/portal-tokens.mjs +2 -1
  106. package/shared/register-selection.mjs +8 -3
  107. package/shared/search-level-tags.json +25 -0
  108. package/shared/tools/derive-band-pairs.mjs +10 -0
  109. package/driver/own-rights.mjs +0 -83
  110. package/driver/use-check.mjs +0 -85
@@ -8,18 +8,18 @@
8
8
  // <meta charset>. It rendered as a grey spreadsheet beside a clearance report, and its curly quotes and
9
9
  // middots turned to mojibake wherever a reader's browser guessed latin-1.
10
10
  //
11
- // This module is a SIBLING of render.mjs, not an extension of it. It imports nothing from that file.
12
- // render.mjs is hash-frozen (test/render-frozen.test.mjs), single-mark shaped, and built around a parsed
13
- // report.md; a knockout is batch-shaped (`marks[]`, one row per name, no report.md at all). Grafting one
14
- // into the other would be a large freeze break in exchange for no reuse.
11
+ // This module is a SIBLING of render.mjs, not an extension of it. render.mjs is single-mark shaped and
12
+ // built around a parsed report.md; a knockout is batch-shaped (`marks[]`, one row per name, no report.md at
13
+ // all). It takes two pieces from that file, the demo banner and the served-models line, so the two reports
14
+ // say those in one wording.
15
15
  //
16
- // Visual consistency does not come from sharing the renderer. It comes from sharing the DESIGN SYSTEM,
17
- // and that already lives in modules nothing has frozen: shared/brand.mjs owns the tokens, the dark
18
- // blocks, the theme init and the lockup; templates/report.css owns the layout vocabulary. This file
19
- // emits the same class names — .rep-stickyhead, .topbar, .wrap, .hero/.conf/.mark/.sub, .sec/.num/.note,
20
- // .panel, footer — so the two reports track each other for free when either is restyled. The price is
21
- // ~60 lines of duplicated document shell, and it is the right price: the alternative is exporting the
22
- // shell out of the frozen file, which is a bigger break than the duplication saves.
16
+ // Visual consistency does not come from sharing the renderer. It comes from sharing the DESIGN SYSTEM:
17
+ // shared/brand.mjs owns the tokens, the dark blocks, the theme init and the lockup; templates/report.css owns
18
+ // the layout vocabulary; page-shell.mjs owns the document both pages sit in. This file emits the same class
19
+ // names — .rep-stickyhead, .topbar, .wrap, .hero/.conf/.mark/.sub, .sec/.num/.note, .panel, footer — so the
20
+ // two reports track each other for free when either is restyled. The shell used to be ~60 lines duplicated
21
+ // here, because exporting it out of the hash-frozen clearance renderer cost more than the copy; the freeze
22
+ // is gone and the shell is shared.
23
23
  //
24
24
  // ONE report. There is no client variant and no internal variant, and that is
25
25
  // still the rule — it is what removes the whole class of "the wrong link got sent".
@@ -39,24 +39,24 @@ import { readFileSync } from 'node:fs';
39
39
  import { join, dirname } from 'node:path';
40
40
  import { fileURLToPath } from 'node:url';
41
41
  import {
42
- REPORT_ROOT, REPORT_ROOT_DARK_EXPLICIT, THEME_INIT_EXPLICIT, themeButton,
43
- THEME_BTN_CSS, CHROME_CSS, FAVICON_LINK, logoLockup, BRAND, confPosture, sectionStrip,
42
+ themeButton, THEME_BTN_CSS, CHROME_CSS, logoLockup, confPosture, sectionStrip,
44
43
  } from '../../shared/brand.mjs';
45
- import { REPORT_FONT_STYLE } from '../../shared/brand-fonts.mjs'; // the typefaces travel inside the report; it fetches nothing to draw its text
44
+ import { pageShell } from './page-shell.mjs'; // the document shell, shared with the clearance template
45
+ import { inlineMarkdown } from '../../shared/inline-markdown.mjs'; // the inline-markdown dialect, shared with the clearance template
46
46
  import { SUMMARY_BLOCK_LINE, parseSummaryBlocks } from '../../shared/summary-blocks.mjs';
47
47
 
48
48
  // THIS BOARD'S FOUR ENTRIES, in its order. Its third reads "Also considered" and resolves at the filings
49
49
  // section, which is what that section is; the rule that filters them against the finished document lives
50
50
  // in shared/brand.mjs, beside the clearance report's own five.
51
51
  const STRIP = Object.freeze([
52
- ['summary', 'Summary'], ['findings', 'Findings'], ['filings', 'Also considered'], ['next', 'Next steps'],
52
+ ['summary', K.strip.summary], ['findings', K.strip.findings], ['filings', K.strip.filings], ['next', K.strip.next],
53
53
  ]);
54
54
  import { COUNT_BASIS, COUNT_PREDICATES, countsForMark, countLine, variantFormsLine, disclosedFloor, moreThan, countNote } from '../register-count.mjs';
55
55
  import { recordBasisOf, readByJudgment, noneCarriedForward, NONE_CARRIED_FORWARD, recordsForMark, recordsLine } from '../register-records.mjs';
56
- import { officeLinkSentences } from './office-record-links.mjs';
56
+ import { officeLinkSentences, officeRecordLink } from './office-record-links.mjs';
57
57
  import { knockoutFindingViews, splitKnockoutNotes, KNOCKOUT_CARD_ORDER } from '../findings-model.mjs';
58
58
  import { inputsLine } from '../framework-method.mjs';
59
- import { demoBannerHtml, servedModelsLine } from './render.mjs'; // — the SAME banner the clearance template renders, not a second wording
59
+ import { demoBannerHtml, servedModelsLine, coverageGrid } from './render.mjs'; // — the SAME banner the clearance template renders, not a second wording
60
60
  import { EXPORT_TOGGLE, exportPopover, EXPORT_MENU_JS } from './report-topbar.mjs'; // — the export menu's shell and behaviour, shared with the clearance template // — the SAME banner the clearance template renders, not a second wording
61
61
  // — the two facts the register card is allowed to read off a raw record, and NEITHER is minted
62
62
  // here. `makeClassifyStatus` and `isAllClass` are the screening lane's own, already shipped, already
@@ -64,9 +64,9 @@ import { EXPORT_TOGGLE, exportPopover, EXPORT_MENU_JS } from './report-topbar.mj
64
64
  // which is the thing providers/_shared/screen.mjs exists to prevent.
65
65
  import { makeClassifyStatus, isAllClass } from '../../providers/_shared/screen.mjs';
66
66
  import { saysSomethingNew } from '../../shared/says-something-new.mjs';
67
- import { isNextStepHeading } from '../knockout-next-step.mjs';
68
67
  import OFFERED from '../../shared/offered-territories.json' with { type: 'json' }; // the order form's own territory names
69
68
  import { normalizeTerritory } from '../../providers/_shared/territory-codes.mjs'; // a territory as written → its code
69
+ import { KNOCKOUT_PAGE as K } from './strings.mjs';
70
70
 
71
71
  const HERE = dirname(fileURLToPath(import.meta.url));
72
72
 
@@ -106,11 +106,9 @@ const officeRecordCell = (r, fallback) => {
106
106
  // Minimal inline markdown, escaped FIRST. The old renderer ran esc() and nothing else, so a batch
107
107
  // summary reading `BRIMSTONE rates **High (Classes 9, 28, 41)**.` rendered its asterisks verbatim —
108
108
  // the model writes markdown because every other surface it feeds renders markdown.
109
+ // The dialect is the one the clearance reads too (shared/inline-markdown.mjs), links included.
109
110
  export function inlineMd(s) {
110
- return esc(String(s ?? ''))
111
- .replace(/\*\*([^*]+)\*\*/g, '<b>$1</b>')
112
- .replace(/(^|[^*])\*([^*]+)\*/g, '$1<i>$2</i>')
113
- .replace(/`([^`]+)`/g, '<span class="mono">$1</span>');
111
+ return inlineMarkdown(esc(String(s ?? '')));
114
112
  }
115
113
  // BLOCKS, NOT ONLY PARAGRAPHS.
116
114
  //
@@ -151,7 +149,7 @@ function bandStop(framework, band) {
151
149
  return STOP_VAR[STOP_BY_TONE[tone] ?? 2];
152
150
  }
153
151
 
154
- const DEGRADED_NOTE = 'Automated research for this name was unavailable — manual verification is recommended before relying on this rating.';
152
+ export const DEGRADED_NOTE = K.degradedNote;
155
153
 
156
154
  // THE QUALIFIER, IN WORDS. It rendered as a bare grey token under the band chip — `low`, no
157
155
  // label, no border, nothing on the page saying what it qualified. A reader met one word of a private
@@ -165,225 +163,23 @@ const DEGRADED_NOTE = 'Automated research for this name was unavailable — manu
165
163
  // An unrecognised word keeps its own text and gains the frame. The validator closes the set for a run
166
164
  // published TODAY, and an archived run re-renders as what it was — dropping a word this build does not
167
165
  // know would be a renderer editing a delivered rating.
168
- const QUALIFIER_WORDS = Object.freeze({ low: 'at the low end of this band' });
166
+ const QUALIFIER_WORDS = K.qualifier;
169
167
  function qualifierHtml(q) {
170
168
  const word = String(q ?? '').trim();
171
169
  if (!word) return '';
172
- const said = QUALIFIER_WORDS[word.toLowerCase()] ?? `${word} within this band`;
170
+ const said = QUALIFIER_WORDS[word.toLowerCase()] ?? K.qualifierOther(word);
173
171
  return `<span class="ko-qual">${esc(said)}</span>`;
174
172
  }
175
173
 
176
- // The layout this report adds on top of report.css. Additive and `ko-`prefixed: report.css is shared with
177
- // the frozen clearance renderer, and a selector that is inert there cannot regress it.
178
- const KO_CSS = `
179
- /* THE BOARD'S SECTION STRIP AND ITS SECTION FURNITURE, lifted from the approved knockout board rather
180
- than written here. Four entries; the third reads "Also considered" and resolves at the filings
181
- section. Marked not to print, because the board marks it so: a strip that follows the reader down
182
- the page is a control, and paper has nothing for it to follow.
183
- NO BACKTICK BELOW, and none in this comment — one closes the template literal this sits inside, and
184
- it has cost this file two silent breakages already.
185
- The number span is drawn and then hidden, which is the board's own doing: it emits the span on every
186
- section and sets it to none further down its own stylesheet. Carried so the delivered document holds
187
- the same elements as the approved one; no pixel moves. */
188
- /* THE BREADCRUMB IS A ROW OF THE HEADER, not a bar under it (owner, 2026-09-18).
189
- It used to be a SIBLING of .rep-stickyhead, pinned on its own at top:var(--tb-h,52px) — and
190
- --tb-h is set nowhere in this product, so the fallback was a guess at a bar that measures ~46px:
191
- content showed through the slit between the two, and z-index:20 put the strip UNDER the header's
192
- 100 whenever the guess was wrong. The strip is now emitted inside .rep-stickyhead, so the header
193
- and the breadcrumb are one sticky surface that pins and unpins together and can never gap or
194
- overlap, whatever the bar measures or how it wraps.
195
- No background and no bottom hairline of its own: the wrapper carries the blurred surface and the
196
- single edge, and the border-top here is the divider between the two rows. It is on .strip rather
197
- than on any wrapper because sectionStrip() emits NOTHING when fewer than two of its sections are
198
- live — a wrapper would leave a stray line on those reports.
199
- The gutter matches the topbar's, so the first entry lines up under the back button. */
200
- .strip{display:flex;gap:4px;align-items:center;padding:4px max(26px,calc((100% - 1120px)/2)) 6px;
201
- border-top:1px solid var(--line);font:600 12px/1 'Plus Jakarta Sans','Helvetica Neue',Arial,sans-serif;
202
- letter-spacing:.04em;overflow-x:auto;scrollbar-width:none}
203
- .strip::-webkit-scrollbar{display:none}
204
- .strip a{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;color:#6b5d50;text-decoration:none;white-space:nowrap}
205
- .strip a i{width:8px;height:8px;border-radius:50%;border:1.5px solid currentColor;box-sizing:border-box}
206
- .strip a.done{color:#4c7a4c}
207
- .strip a.done i{background:#4c7a4c;border-color:#4c7a4c}
208
- .strip a.now{color:#250902;background:rgba(0,0,0,.06)}
209
- .strip a.now i{border-color:#860F09;border-width:3px}
210
- .sec .num{display:none}
211
- .sec .note{display:inline;margin-left:10px;font-size:12px;color:var(--faint)}
212
- .ko-glance{padding:6px 0 2px}
213
- /* — framework attribution, captioning the rows. Same gutter and hairline as.ko-row so it reads
214
- as the table's head, not a floating note. */
215
- .ko-legend{padding:11px 24px 12px;border-bottom:1px solid var(--line);font-size:11.5px;color:var(--faint)}
216
- .ko-row{display:grid;grid-template-columns:minmax(140px,.34fr) 1fr;gap:18px;align-items:start;
217
- padding:15px 24px;border-bottom:1px solid var(--line)}
218
- .ko-row:last-child{border-bottom:0}
219
- .ko-name{font-weight:800;font-size:17px;letter-spacing:-.01em;margin:0 0 7px;word-break:break-word}
220
- .ko-band{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
221
- color:#fff;padding:4px 11px;border-radius:30px}
222
- .ko-qual{display:block;margin-top:5px;font-size:11.5px;color:var(--faint)}
223
- .ko-classes{font-size:12px;color:var(--faint);margin:6px 0 0}
224
- .ko-bul{margin:0;padding-left:18px;font-size:14px;color:var(--slate);line-height:1.6}
225
- /* / — the summary's own sub-headers and bullets. The summary is the report's entry point and
226
- the owner's complaint was that it read as one block; these are what make it scannable. Sized BELOW
227
- .ko-name so a sub-header inside the summary never competes with a mark's own name. */
228
- .ko-sumh{font-weight:800;font-size:13.5px;letter-spacing:.01em;margin:15px 0 6px;color:var(--slate)}
229
- .ko-sumh:first-child{margin-top:0}
230
- .ko-sumbul{margin:0 0 8px}
231
- .ko-bul li{margin:0 0 5px}
232
- .ko-bul li:last-child{margin-bottom:0}
233
- /* — one conflict, one block: the reference a reader carries to the workbook, the name, its band,
234
- the conclusion sentence, the ground under it, and the evidence it opens to. */
235
- /* ko-find is a LOCATOR now, not a look: the block wears .card as well and report.css draws it. The
236
- dashed rule and the top margin this used to carry would fight the card's own border and radius. */
237
- .ko-find.card{margin:14px 0 0}
238
- .ko-find.card:first-child{margin-top:0}
239
- .ko-findband{display:inline-block;font-size:9.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
240
- color:#fff;padding:2px 8px;border-radius:30px;margin-left:7px;vertical-align:1px}
241
- .ko-findmeta{margin:0 0 5px;font-size:12px;color:var(--faint)}
242
- .ko-findnet{margin:0 0 5px;font-size:14px;color:var(--slate);line-height:1.6}
243
- .ko-findbasis{margin:0 0 5px;font-size:13.5px;color:var(--slate);line-height:1.6}
244
- .ko-findev{margin:0;font-size:12.5px;line-height:1.6;word-break:break-word}
245
- .ko-count{font-family:var(--mono);font-size:13px;color:var(--ink);margin:0}
246
- .ko-degraded{font-size:13px;color:var(--med-tx,#82550A);margin:8px 0 0;font-style:italic}
247
- /* The reviewer-notes legend. NOT .ko-legend — that name is taken by the framework attribution row
248
- above, and reusing it would restyle the caption. It names the purple convention report.css already
249
- draws for .internal, so the colour is stated once and never re-specified. */
250
- /* The notes sit inside a mark's column, so the shared .internal block's bullets keep the column's
251
- own list indent and do not fight the paragraph above them. */
252
- .ko-row .internal .ko-bul{margin:0 0 4px}
253
- .ko-row .internal .ko-bul:last-child{margin-bottom:0}
254
- .ko-counts table{width:100%;border-collapse:collapse;font-size:14px}
255
- .ko-counts th{text-align:left;font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);
256
- font-weight:700;padding:14px 24px 8px;border-bottom:1px solid var(--line)}
257
- .ko-counts td{padding:13px 24px;border-bottom:1px solid var(--line);vertical-align:top}
258
- .ko-counts tr:last-child td{border-bottom:0}
259
- .ko-counts td.num{font-family:var(--mono);font-size:15px;font-weight:600;color:var(--ink)}
260
- .ko-counts td.na{font-family:var(--mono);font-size:12.5px;color:var(--faint)}
261
- .ko-counts tr.ko-forms td{font-size:12px;color:var(--faint);line-height:1.55;padding:0 24px 13px;
262
- font-family:var(--mono);word-break:break-word}
263
- .ko-tier{font-size:13.5px;color:var(--slate);line-height:1.65;margin:0;padding:18px 24px}
264
- /* — the read, as structure. The chip and classes are the head; basis leads; factors are a tight
265
- list; the two qualifying blocks are visually distinct so a scan separates "why this band" from
266
- "what would move it"; the register line is code-owned and always last. */
267
- .ko-basisline{margin:0 0 8px;font-size:14.5px;color:var(--ink);line-height:1.5;font-weight:600}
268
- .ko-lbl{display:block;font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
269
- color:var(--faint);margin:0 0 4px}
270
- .ko-counter{margin:10px 0 0;padding:9px 0 0;border-top:1px dashed var(--line)}
271
- .ko-mitig{margin:10px 0 0;padding:9px 12px;border-left:2px solid var(--line);background:var(--sunken,transparent)}
272
- .ko-mitig p{margin:0;font-size:13.5px;color:var(--slate);line-height:1.6}
273
- .ko-full{margin:10px 0 0;font-size:13px;color:var(--slate)}
274
- .ko-full summary{cursor:pointer;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);font-weight:700}
275
- .ko-full ul{margin-top:7px}
276
- /* NOTHING IS DISCARDED — including on paper. A collapsed <details> prints collapsed, so a report
277
- saved to PDF would drop the narrative this block exists to preserve. The beforeprint handler below
278
- opens them; this hides the now-pointless toggle in print. */
279
- @media print{.ko-full summary{display:none}}
280
- /* THE LABELS THE READER ACTUALLY READS. ko-lbl above is 9.5px uppercase grey — the owner's
281
- "what holds what?" was asked of a label in that style, so a new word in the same style is the
282
- same defect with different letters. These are body size and body colour, and they carry the
283
- band's own word ("Why High"), which is what makes them answerable without a legend. */
284
- .ko-lbl2{display:block;font-size:14px;font-weight:700;color:var(--ink);margin:0 0 5px;letter-spacing:0}
285
- /* The card's fold. ko-full rides with it so openAll() and the beforeprint handler reach it —
286
- what folds on screen still prints, which is the rule this template already states for the
287
- narrative fold. ko-why carries only the spacing a card needs inside its own body. */
288
- .ko-why{margin:6px 0 5px}
289
- .ko-why summary{font-size:12px;text-transform:none;letter-spacing:0;color:var(--rose,var(--faint));font-weight:600}
290
- /* "About this request" — what was asked, and any flag on the asking. It sits in the hero because a
291
- mis-scoped request makes every number below it answer the wrong question. */
292
- .ko-req{margin:14px 0 0;padding:13px 16px;border:1px solid var(--line);border-radius:3px}
293
- .ko-req .ko-lbl2{margin-bottom:6px}
294
- .ko-req p{margin:0 0 6px;font-size:13.5px;color:var(--slate);line-height:1.6}
295
- .ko-req p:last-child{margin-bottom:0}
296
- .ko-reqflag{border-left:3px solid var(--rose,var(--line));padding-left:11px;margin-top:9px}
297
- /* THE PURPLE NOTES COME OFF THE EXPORT, exactly as the clearance page removes its internal notes
298
- ("Internal (review-only) notes are removed on export"). The knockout's export is window.print()
299
- via exportPDF(), so print is the whole export path and this rule is the whole strip. Without it
300
- a knockout PDF forwarded to a client carries the reviewing lawyer's notes. */
301
- @media print{.internal{display:none !important}}
302
- .ko-reg{margin:11px 0 0;padding:8px 0 0;border-top:1px solid var(--line);
303
- font-family:var(--mono);font-size:12px;color:var(--faint);line-height:1.5}
304
- .ko-filings{padding:14px 0 2px;border-bottom:1px solid var(--line)}
305
- .ko-filings:last-of-type{border-bottom:0}
306
- .ko-filings .ko-name{padding:0 24px}
307
- .ko-filings td{font-size:13px}
308
- .ko-basis{font-size:12.5px;color:var(--slate);line-height:1.6;margin:0;padding:15px 24px 17px;border-top:1px solid var(--line)}
309
- .ko-scope{font-size:13.5px;color:var(--slate);line-height:1.65;margin:0;padding:18px 24px}
310
- .ko-scope b{color:var(--ink)}
311
- /* A wide counts table must scroll inside its own panel, never push the page sideways. */
312
- /* AND IT SHOWS THAT IT SCROLLS. A panel that continues off its right edge and says nothing leaves a
313
- reader who never drags it believing they have seen the whole table; the columns past the edge are
314
- reachable and invisible at the same time. Ruled 2026-09-17: a scrollbar, always visible, and no text.
315
- The -webkit-appearance:none is the part that does the work — without it the platform draws an OVERLAY
316
- scrollbar that appears only once a scroll is already under way, which is the state this rule ends.
317
- scrollbar-width and scrollbar-color are the same instruction for the engines that take the standard
318
- properties. (NO BACKTICK IN THIS COMMENT: it sits inside the stylesheet's own template literal, and
319
- one closes it. That is written above the export menu block too, and I still did it — so it is here
320
- as well, beside the second rule anyone adds.) The colours are tokens, not fixed values, for the reason the ladder below this block
321
- records: a fixed colour here reads on one ground and goes invisible on the other. */
322
- .ko-scroll{overflow-x:auto}
323
- .ko-scroll::-webkit-scrollbar{height:9px;-webkit-appearance:none}
324
- .ko-scroll::-webkit-scrollbar-track{background:transparent}
325
- .ko-scroll::-webkit-scrollbar-thumb{background:var(--faint);border-radius:5px}
326
- /* THE TWO INSTRUCTIONS CANNOT SIT TOGETHER, and this was measured rather than reasoned. Setting the
327
- standard scrollbar-width alongside the pseudo-elements makes the engine take the standard path and
328
- ignore them, and on this one the standard path draws an overlay bar with no layout height at all.
329
- Driven three ways on a delivered report at 390px, reading the height the bar takes out of the panel:
330
- both together 0px, the pseudo-elements alone 9px, the standard properties alone 0px. So the standard
331
- ones go behind a support query that the engines carrying the pseudo-elements never enter, which
332
- leaves each engine exactly one instruction. */
333
- @supports not selector(::-webkit-scrollbar){
334
- .ko-scroll{scrollbar-width:thin;scrollbar-color:var(--faint) transparent}}
335
- /* A finding's bullets carry bare source URLs, and a URL offers a line no place to break. On a phone
336
- that unbreakable run becomes the minimum width of the grid item, so the single column floors at
337
- 443px inside a 360px viewport and the whole page scrolls sideways -- 135px of it, measured
338
- 2026-09-17. Only the value "anywhere" lowers that minimum: "break-word" breaks the line but
339
- leaves the minimum where it was, which is why the blocks beside this one that already set
340
- word-break were never the cause. Phone widths only: nothing at or above 700px changes.
341
- NO BACKTICK IN THIS COMMENT -- it sits inside the stylesheet's own template literal. */
342
- @media(max-width:700px){.ko-row{grid-template-columns:1fr;gap:10px}
343
- .ko-bul{overflow-wrap:anywhere}}
344
-
345
- /* The band ladder, the territories fold and the run's own caveats (the 2026-09-16 report redesign). Ported from
346
- the design's stylesheet with its fixed colours replaced by this page's tokens, so the ladder reads
347
- in both themes: the tick row was #a89a8a on white and the fold's summary and prose a brown pair,
348
- all three of which go invisible on the dark ground this report also renders on. */
349
- /* THE BAND PILL HANGS ABOVE THE BAR, so the space above the bar is what keeps it off the heading.
350
- NO BACKTICK IN THIS COMMENT — it sits inside the stylesheet's own template literal.
351
- .kmarker sits at top:-30px and the pill is ~23px tall (5+5 padding on a 13px line), so it starts
352
- 30px above the bar and ends 7px above it. At the LEFTMOST band the pill is also drawn flush left
353
- (translateX(-12px) at left:0%) — directly under the left-aligned "Overall risk" — so that is the
354
- rung where the two touch, and the house ladder's leftmost rung is Low.
355
- THE ROOM IS ONE MARGIN, NOT TWO, and that is what made the arithmetic wrong twice. This margin and
356
- .gauge .label's 18px bottom margin are ADJACENT SIBLINGS, so they collapse to the larger of the two
357
- rather than adding: 10px here gave 18px of room against a pill that needs 30, and the first attempt
358
- at 24 still left 6. Measured in a browser at every rung (scripts/report-header-render-check.mjs),
359
- not reasoned: 44 gives 14px of daylight under the heading at every band. */
360
- .kscale{position:relative;margin:44px 8px 34px}
361
- .kbar{position:relative;height:8px;border-radius:4px}
362
- .kmarker{position:absolute;top:-30px;text-align:center}
363
- .kpill{display:inline-block;padding:5px 12px;border-radius:999px;color:#fff;
364
- font:700 13px/1 'Plus Jakarta Sans','Helvetica Neue',Arial,sans-serif;white-space:nowrap}
365
- .kneedle{width:3px;height:14px;margin:4px auto 0;border-radius:2px}
366
- .kticks{position:relative;height:16px;margin-top:8px}
367
- .kticks span{position:absolute;transform:translateX(-50%);color:var(--faint);white-space:nowrap;
368
- font:700 10.5px/1 'Plus Jakarta Sans','Helvetica Neue',Arial,sans-serif;letter-spacing:.1em;text-transform:uppercase}
369
- .kticks span.on{font-weight:800}
370
- .terr{margin-top:4px}
371
- .terr summary{cursor:pointer;color:var(--rose,var(--faint));font-size:12px;font-weight:600;list-style:none}
372
- .terr summary::-webkit-details-marker{display:none}
373
- .terr p{margin:4px 0 0;font-size:12px;line-height:1.6;color:var(--slate)}
374
- .ko-caveats{padding:16px 24px;margin:14px 0 8px}
375
- .ko-caveats p{margin:0 0 7px;font-size:12px;line-height:1.6;color:var(--faint)}
376
- .ko-caveats p:last-child{margin-bottom:0}
377
- `;
378
-
379
- const REPORT_BASE = REPORT_ROOT + '\n' + readFileSync(join(HERE, 'templates', 'report.css'), 'utf8');
380
- // Print renders light whatever the toggle says — re-assert the light tokens under [data-theme=dark].
381
- const PRINT_LIGHT = '\n@media print{' + REPORT_ROOT.replace(':root{', ':root[data-theme="dark"]{color-scheme:light;') + '}';
174
+ // The layout this report adds on top of report.css, kept in templates/knockout.css. Additive and `ko-`prefixed:
175
+ // report.css is shared with the clearance renderer, and a selector that is inert there cannot regress it.
176
+ const KO_CSS = '\n' + readFileSync(join(HERE, 'templates', 'knockout.css'), 'utf8'); // the file's text, after the line break the sheet always began with
177
+
382
178
 
383
179
  /** The batch's display title: the mark itself when a screen covered one name, else the count. */
384
180
  function batchTitle(marks) {
385
181
  if (marks.length === 1) return marks[0].name ?? '';
386
- return `${marks.length} names`;
182
+ return K.names(marks.length);
387
183
  }
388
184
 
389
185
  // Spine mapping (spec 2026-07-30 §3, charter ruling 1: renames ruled OK): the per-name verdict rows
@@ -395,9 +191,9 @@ function batchTitle(marks) {
395
191
  // group, in the order the merged gate left them, highest first. The same chip and the same line either way, so no
396
192
  // words are added. A mark with no groups, which is every archived run, keeps its markup byte for byte.
397
193
  function bandColumn(m, framework) {
398
- const chip = (band, qualifier, classes) => `<span class="ko-band" style="background:var(${bandStop(framework, band)})">${esc(band ?? '—')}</span>
194
+ const chip = (band, qualifier, classes) => `<span class="ko-band" style="background:var(${bandStop(framework, band)});color:var(${bandStop(framework, band)}-on)">${esc(band ?? '—')}</span>
399
195
  ${qualifierHtml(qualifier)}
400
- ${classes?.length ? `<p class="ko-classes">Classes ${esc(classes.join(', '))}</p>` : ''}`;
196
+ ${classes?.length ? `<p class="ko-classes">${esc(K.classes(classes.join(', ')))}</p>` : ''}`;
401
197
  if (!Array.isArray(m.classGroups) || !m.classGroups.length) return chip(m.rating, m.ratingQualifier, m.classesSearched);
402
198
  return m.classGroups.map((g) => chip(g.band, g.ratingQualifier, g.classes)).join('\n ');
403
199
  }
@@ -465,15 +261,7 @@ function glanceSection(marks, framework, registerCounts) {
465
261
  // TWO FORMS PER REGISTER, because English needs both: "Counted in the United States" takes the article
466
262
  // and "United States application" refuses it. One map with one form produced "the United States
467
263
  // application (pending)" on a card, which is why they are separate fields rather than a regex over one.
468
- const REGISTER_NAMES = Object.freeze({
469
- EM: { bare: 'European Union', phrase: 'the European Union' },
470
- EU: { bare: 'European Union', phrase: 'the European Union' },
471
- WO: { bare: 'international', phrase: 'the WIPO register' },
472
- US: { bare: 'United States', phrase: 'the United States' },
473
- GB: { bare: 'United Kingdom', phrase: 'the United Kingdom' },
474
- UK: { bare: 'United Kingdom', phrase: 'the United Kingdom' },
475
- CH: { bare: 'Swiss', phrase: 'Switzerland' },
476
- });
264
+ const REGISTER_NAMES = K.registerNames;
477
265
 
478
266
  /**
479
267
  * A register code as a reader's words, or '' when this build cannot name it. NEVER returns a code.
@@ -516,7 +304,7 @@ const orderCode = (t) => {
516
304
  function listWords(items) {
517
305
  const xs = (items ?? []).filter(Boolean);
518
306
  if (xs.length <= 1) return xs[0] ?? '';
519
- return `${xs.slice(0, -1).join(', ')} and ${xs[xs.length - 1]}`;
307
+ return K.listEnd(xs.slice(0, -1).join(', '), xs[xs.length - 1]);
520
308
  }
521
309
 
522
310
  /**
@@ -531,20 +319,20 @@ function listWords(items) {
531
319
  */
532
320
  const TERRITORY_NAME_CAP = 6;
533
321
  function territoriesLine(registerCounts) {
534
- const provider = registerCounts?.providerLabel ?? registerCounts?.provider ?? 'the register';
322
+ const provider = registerCounts?.providerLabel ?? registerCounts?.provider ?? K.counted.theRegister;
535
323
  const regions = (registerCounts?.scope?.regions ?? []).filter(Boolean);
536
324
  const worldwide = registerCounts?.scope?.worldwide === true || regions.length === 0;
537
325
  if (worldwide) {
538
326
  const n = regions.length;
539
327
  return n
540
- ? `Counted worldwide, ${n} registers, on ${provider}.`
541
- : `Counted worldwide on ${provider}.`;
328
+ ? K.counted.worldwideOn(n, provider)
329
+ : K.counted.worldwide(provider);
542
330
  }
543
331
  const named = regions.map(territoryName).filter(Boolean);
544
332
  if (named.length && named.length <= TERRITORY_NAME_CAP) {
545
- return `Counted in ${listWords(named)}, on ${provider}.`;
333
+ return K.counted.named(listWords(named), provider);
546
334
  }
547
- return `Counted on ${regions.length} registers, listed on the workbook's Register Counts sheet, on ${provider}.`;
335
+ return K.counted.listed(regions.length, provider);
548
336
  }
549
337
 
550
338
  // The reader line that used to sit under the counts table ("a count is not a conflict…") is off the page:
@@ -566,9 +354,9 @@ function countsSection(marks, registerCounts, positions = '') {
566
354
  ? ((countsForMark(registerCounts, single)?.counts?.close?.forms ?? []).map((f) => String(f?.form ?? '').trim()).filter(Boolean))
567
355
  : [];
568
356
  const headLabel = (pk) => {
569
- if (pk === 'identical') return single ? `Exactly ${single}` : 'Exactly the name';
570
- if (pk === 'containing') return single ? `Contains ${single}` : 'Contains the name';
571
- return forms.length ? `Near-spellings (${forms.join(', ')})` : 'Near-spellings';
357
+ if (pk === 'identical') return single ? K.counts.exactly(single) : K.counts.exactlyTheName;
358
+ if (pk === 'containing') return single ? K.counts.contains(single) : K.counts.containsTheName;
359
+ return forms.length ? K.counts.nearSpellingsOf(forms.join(', ')) : K.counts.nearSpellings;
572
360
  };
573
361
  const head = COUNT_PREDICATES.map((p) => `<th>${esc(headLabel(p.key))}</th>`).join('');
574
362
  const rows = marks.map((m) => {
@@ -582,17 +370,17 @@ function countsSection(marks, registerCounts, positions = '') {
582
370
  // column did not exist when it was counted, and "no count recorded" would read as a defect in a
583
371
  // report that has none. The hover says which.
584
372
  const why = countNote(c) ?? (c
585
- ? 'no count recorded'
586
- : 'not counted on this run — it predates this column, and an archived report re-renders as what it was');
373
+ ? K.counts.noCountRecorded
374
+ : K.counts.notCountedThisRun);
587
375
  if (Number.isFinite(c?.total)) return `<td class="num">${esc(String(c.total))}</td>`;
588
376
  // The register answered with its own floor: that is a figure, and it is printed as one.
589
377
  if (disclosedFloor(c) !== null) return `<td class="num">${esc(moreThan(disclosedFloor(c)))}</td>`;
590
- return `<td class="na" title="${escAttr(why)}">not available</td>`;
378
+ return `<td class="na" title="${escAttr(why)}">${K.counts.notAvailable}</td>`;
591
379
  }).join('');
592
380
  const scoped = e?.classScope !== 'all-classes' && (e?.classes?.length > 0);
593
381
  const scope = scoped
594
- ? `classes ${e.classes.join(', ')}`
595
- : 'all classes — this run named none, so nothing narrowed the count';
382
+ ? K.counts.inClasses(e.classes.join(', '))
383
+ : K.counts.allClasses;
596
384
  // The forms the close column was counted over. A number whose forms are not on the page cannot be
597
385
  // checked by the reader it was written for, which makes it a claim rather than a measurement.
598
386
  const forms = variantFormsLine(e);
@@ -604,7 +392,7 @@ function countsSection(marks, registerCounts, positions = '') {
604
392
  // 331 says it belongs; what it stops doing is printing twice on a page whose headers now say the same
605
393
  // thing in three words each.
606
394
  return `<div class="panel">
607
- <div class="ko-counts ko-scroll"><table><thead><tr><th>Name</th>${head}</tr></thead><tbody>${rows}</tbody></table></div>
395
+ <div class="ko-counts ko-scroll"><table><thead><tr><th>${K.counts.name}</th>${head}</tr></thead><tbody>${rows}</tbody></table></div>
608
396
  <p class="ko-basis">${esc(territoriesLine(registerCounts))}${
609
397
  positions ? `<br>${esc(positions)}` : ''}</p>
610
398
  </div>`;
@@ -738,7 +526,7 @@ function filingsSection(marks, registerRecords) {
738
526
  const line = recordsLine(e);
739
527
  if (!e || !(e.records ?? []).length) {
740
528
  return `<div class="ko-row"><div><p class="ko-name">${esc(m.name)}</p></div>
741
- <div><p class="ko-bul">${esc(line ?? 'No filings listing was recorded for this name.')}</p></div></div>`;
529
+ <div><p class="ko-bul">${esc(line ?? K.filings.noListing)}</p></div></div>`;
742
530
  }
743
531
  // RANKED, AND DELIBERATELY NOT FILTERED. This table is the evidence behind a
744
532
  // COUNT: dropping a cancelled or out-of-class row would leave a reader unable to reconcile the table
@@ -747,7 +535,7 @@ function filingsSection(marks, registerRecords) {
747
535
  const ranked = rankByMateriality(e.records, e, m);
748
536
  const shown = ranked.slice(0, APPENDIX_ROWS);
749
537
  const rows = shown.map((r) => `<tr>
750
- <td>${esc(r.mark ?? '—')}${r.matchedBasis === 'close' ? `<br><span class="ko-classes">found as ${esc(r.matchedForm)}</span>` : ''}</td>
538
+ <td>${esc(r.mark ?? '—')}${r.matchedBasis === 'close' ? `<br><span class="ko-classes">${esc(K.filings.foundAs(r.matchedForm))}</span>` : ''}</td>
751
539
  <td>${esc(r.owner ?? '—')}</td>
752
540
  <td>${esc(r.status ?? '—')}</td>
753
541
  <td>${esc((r.classes ?? []).join(', ') || '—')}</td>
@@ -758,14 +546,11 @@ function filingsSection(marks, registerRecords) {
758
546
  // cap: it invites the reader to take the sample for the top of the provider's list. Say the count
759
547
  // that exists, say what decided the order, and say where the rest is.
760
548
  const more = e.records.length > shown.length
761
- ? ` Showing ${shown.length} of ${e.records.length}, most material first — the filings this`
762
- + ` assessment weighed before the rest, then live filings before dead,`
763
- + ` in the searched classes before outside them, the name itself before ${readByJudgment(registerRecords) ? 'other searches' : 'its close variations'}.`
764
- + ` The full list is in the audit workbook's Register Filings sheet.`
765
- : ' The same rows are in the audit workbook\'s Register Filings sheet, most material first.';
549
+ ? K.filings.showing(shown.length, e.records.length, readByJudgment(registerRecords) ? K.filings.otherSearches : K.filings.closeVariations)
550
+ : K.filings.sameRows;
766
551
  return `<div class="ko-filings">
767
552
  <p class="ko-name">${esc(m.name)}</p>
768
- <div class="ko-counts ko-scroll"><table><thead><tr><th>Trademark</th><th>Owner</th><th>Status</th><th>Classes</th><th>Territory</th><th>Record</th></tr></thead><tbody>${rows}</tbody></table></div>
553
+ <div class="ko-counts ko-scroll"><table><thead><tr><th>${K.filings.head.trademark}</th><th>${K.filings.head.owner}</th><th>${K.filings.head.status}</th><th>${K.filings.head.classes}</th><th>${K.filings.head.territory}</th><th>${K.filings.head.record}</th></tr></thead><tbody>${rows}</tbody></table></div>
769
554
  <p class="ko-basis">${esc(line ?? '')}${esc(more)}</p>
770
555
  </div>`;
771
556
  }).join('');
@@ -795,8 +580,8 @@ function officeLinkNote(registerRecords) {
795
580
  function tierAbsenceLine(registerCounts, probeRan) {
796
581
  if (registerCounts?.marks?.length) return null;
797
582
  return probeRan
798
- ? 'Register hit-counts are part of this search, and none could be taken on this run — the per-name reason is recorded in the audit workbook. This is a gap in this run, not a limit of the product.'
799
- : 'Register hit-counts (identical · containing · close variations) are not included in this product tier, so no register was counted for this report. They are part of the Knockout search this offering sells today.';
583
+ ? K.tierAbsence.probeRan
584
+ : K.tierAbsence.notInTier;
800
585
  }
801
586
 
802
587
  // ONE conflict, rendered from the typed record. The reference comes first because it is what a
@@ -837,7 +622,7 @@ function whyBandFold(inner) {
837
622
  }
838
623
 
839
624
  /** The card fold's own word. Stated once so the renderer and its tests read the same string. */
840
- const WHY_BAND_LABEL = 'Why this band';
625
+ const WHY_BAND_LABEL = K.riskAssessment; // the clearance's word for the reasoning (owner, 2026-11-18)
841
626
 
842
627
  /**
843
628
  * The band chip's text. A framework that states a method shows its inputs beside the band, in its own
@@ -850,9 +635,35 @@ function bandChipText(band, method, inputs) {
850
635
  return line ? `${esc(band)} · ${esc(line)}` : esc(band);
851
636
  }
852
637
 
853
- function findingBlock(v, framework, markIndex, method = null) {
638
+ // A CARD CITES A FILING THE WAY THE FILINGS TABLE DOES. A conflict card's evidence held the register vendor's record
639
+ // path (/mark/em/…), which opens nothing and no register accepts, while the filings table on the same page printed the
640
+ // same filing by office and number, linked where the office has a page. An entry naming a filing the run holds now
641
+ // prints that table cell. An entry naming one it does not hold is read only where the run's register puts the office's
642
+ // own number in the path: the EUIPO's application number and the USPTO's serial. Clarivate and Signa put their own
643
+ // record id there and Corsearch its own id with a class suffix, and a vendor id printed as the office's number would be
644
+ // a citation no office can find, so those print as before. A web address stays a link.
645
+ const OWN_NUMBER_OFFICE = Object.freeze({ euipo: 'eu', 'uspto-local': 'us' });
646
+ export function filingsByHandle(registerRecords) {
647
+ const byHandle = new Map();
648
+ for (const r of (registerRecords?.marks ?? []).flatMap((m) => m?.records ?? [])) {
649
+ if (r && typeof r === 'object' && r.recordId) byHandle.set(String(r.recordId).trim().toLowerCase(), r);
650
+ }
651
+ return byHandle;
652
+ }
653
+ function evidenceCell(u, { filings = null, provider = null } = {}) {
654
+ if (isHttpUrl(u)) return linkOrText(u);
655
+ const handle = String(u ?? '').trim();
656
+ const r = filings?.get(handle.toLowerCase());
657
+ if (r) return officeRecordCell(r, r.url ? linkOrText(r.url) : esc(r.recordId ?? handle));
658
+ const office = OWN_NUMBER_OFFICE[provider];
659
+ const own = office ? new RegExp(`^/mark/${office}/([A-Za-z0-9]+)$`, 'i').exec(handle) : null;
660
+ const link = own ? officeRecordLink({ office, applicationNumber: own[1] }) : null;
661
+ return link?.label ? officeRecordCell({ officeLink: link }, esc(handle)) : esc(handle);
662
+ }
663
+
664
+ function findingBlock(v, framework, markIndex, method = null, cite = {}) {
854
665
  const meta = [v.type, v.owner].filter(Boolean).map((s) => esc(s)).join(' · ');
855
- const ev = v.evidence.map((u) => linkOrText(u)).join(' · ');
666
+ const ev = v.evidence.map((u) => evidenceCell(u, cite)).join(' · ');
856
667
  // THE CLEARANCE REPORT'S CARD, AND THE KNOCKOUT'S LOCATOR — both classes, deliberately. report.css
857
668
  // is already inlined here and already defines .card, .top, .rail, .cardhead,
858
669
  // .fnum and .who; this uses them rather than a parallel set, so a client who has read one report
@@ -877,17 +688,17 @@ function findingBlock(v, framework, markIndex, method = null) {
877
688
  <div class="rail" style="background:var(${stop})"></div>
878
689
  <div class="body">
879
690
  <div class="cardhead">
880
- <span class="fnum">${esc(v.ref)}</span><span class="who">${esc(v.name ?? 'Unnamed finding')}</span>${
881
- v.band ? `<span class="ko-findband" style="background:var(${stop})">${bandChipText(v.band, method, v.inputs)}</span>` : ''}${sourceChips(v)}
882
- <button class="ask-fi no-print">\u2726 Ask AI about this finding</button>
691
+ <span class="fnum">${esc(v.ref)}</span><h3 class="who">${esc(v.name ?? K.finding.unnamed)}</h3>${
692
+ v.band ? `<span class="ko-findband" style="background:var(${stop});color:var(${stop}-on)">${bandChipText(v.band, method, v.inputs)}</span>` : ''}${sourceChips(v)}
693
+ <button class="ask-fi no-print">${K.finding.askAi}</button>
883
694
  </div>
884
695
  ${meta ? `<p class="ko-findmeta">${meta}</p>` : ''}
885
696
  ${v.lead ? `<p class="ko-findnet">${inlineMd(v.lead)}</p>` : ''}
886
697
  ${/* The 2026-09-16 report redesign — head, meta and the one-line read stay visible; the rest folds, as on
887
698
  a clearance card, so a screen of many names reads as a screen. */''}
888
- ${(v.detail || ev) ? `<details class="drill"><summary>Full detail</summary><div class="drillbody">${
699
+ ${(v.detail || ev) ? `<details class="drill"><summary>${K.finding.fullDetail}</summary><div class="drillbody">${
889
700
  whyBandFold(v.detail ? `<p class="ko-findbasis">${inlineMd(v.detail)}</p>` : '')}${
890
- ev ? `<p class="ko-findev">Evidence: ${ev}</p>` : ''}</div></details>` : ''}
701
+ ev ? `<p class="ko-findev">${K.finding.sources}${ev}</p>` : ''}</div></details>` : ''}
891
702
  </div>
892
703
  </div>
893
704
  </div>`;
@@ -1164,7 +975,7 @@ function readBandFor(mark, recordId) {
1164
975
  return String(row?.band ?? '').trim() || null;
1165
976
  }
1166
977
 
1167
- function registerCardViews(mark, framework, registerRecords) {
978
+ export function registerCardViews(mark, framework, registerRecords) {
1168
979
  if (!registerRecords || registerRecords.unavailable) return { cards: [], entry: null, promoted: 0 };
1169
980
  const entry = recordsForMark(registerRecords, mark?.name);
1170
981
  if (!entry) return { cards: [], entry: null, promoted: 0 };
@@ -1227,7 +1038,7 @@ function registerCardViews(mark, framework, registerRecords) {
1227
1038
  function sourceChips(v) {
1228
1039
  const register = Array.isArray(v?.weighedFilings) && v.weighedFilings.length > 0;
1229
1040
  const commonLaw = (Array.isArray(v?.evidence) && v.evidence.length > 0) || !register;
1230
- return `${commonLaw ? '<span class="src cl">Common law</span>' : ''}${register ? '<span class="src reg">Register</span>' : ''}`;
1041
+ return `${commonLaw ? `<span class="src cl">${K.chips.commonLaw}</span>` : ''}${register ? `<span class="src reg">${K.chips.register}</span>` : ''}`;
1231
1042
  }
1232
1043
 
1233
1044
  // ── THE REVIEWER'S NOTES, ON THE REPORT ─────────────────────────────────────────────────
@@ -1265,7 +1076,7 @@ export const ownerCheckText = (o) => !o ? null : o.kind === 'unavailable' ? USE_
1265
1076
  : o.kind === 'linked' ? o.url : USE_CHECK_LINK_UNAVAILABLE;
1266
1077
 
1267
1078
  /** The owner lookup covering a filing, joined by recordId. `null` when this run owed that filing none. */
1268
- function ownerCheckFor(ownerChecks, recordId) {
1079
+ export function ownerCheckFor(ownerChecks, recordId) {
1269
1080
  const id = String(recordId ?? '').trim();
1270
1081
  if (!id) return null;
1271
1082
  return (Array.isArray(ownerChecks) ? ownerChecks : [])
@@ -1315,7 +1126,7 @@ function aboutRequestBlock(scope, requestNotes, depthNote = '', productContext =
1315
1126
  // is not listed here; it is disclosed where deferrals are. A territory the form's list cannot name, or an
1316
1127
  // office this install could not reach, falls back to the count rather than printing a code or claiming
1317
1128
  // a territory nothing was counted in.
1318
- const on = provider ? `, on ${provider}` : '';
1129
+ const on = provider ? K.about.on(provider) : '';
1319
1130
  const sc = registerCounts?.scope ?? {};
1320
1131
  const deferred = new Set((sc.deferredJurisdictions ?? []).map(orderCode));
1321
1132
  const ordered = [...new Set((sc.jurisdictions ?? [])
@@ -1324,8 +1135,8 @@ function aboutRequestBlock(scope, requestNotes, depthNote = '', productContext =
1324
1135
  && ordered.length > 0 && ordered.every(Boolean);
1325
1136
  const counted = namesTheOrder ? `${listWords(ordered)}${on}.`
1326
1137
  : regions.length
1327
- ? `${regions.length} ${regions.length === 1 ? 'register' : 'registers'}${on}.`
1328
- : (registerCounts ? `Counted worldwide${on}` : '');
1138
+ ? `${K.about.registers(regions.length)}${on}.`
1139
+ : (registerCounts ? `${K.about.countedWorldwide}${on}` : '');
1329
1140
  if (!asked && !where && !classLine && !stage && !context && !counted) return '';
1330
1141
  // ONE PANEL, THE SAME ON BOTH REPORTS (the 2026-09-16 report redesign). The rows carry what was asked for; the
1331
1142
  // counts row says what was counted and hides the territory list behind a fold rather than running a
@@ -1333,13 +1144,13 @@ function aboutRequestBlock(scope, requestNotes, depthNote = '', productContext =
1333
1144
  const row = (k, v, extra = '') => v ? `<div class="row"><span class="k">${esc(k)}</span><span class="v">${esc(v)}${extra}</span></div>` : '';
1334
1145
  return `<div class="panel about">
1335
1146
  <div class="label">About this request</div>
1336
- ${row('Type of search', stage)}
1337
- ${row('Instructed use', asked)}
1338
- ${row('Classes', classLine)}
1339
- ${row('Where searched', where)}
1340
- ${row('Context', context)}
1341
- ${row('Registers counted', counted)}
1342
- ${row('Searched on', searched)}
1147
+ ${row(K.about.typeOfSearch, stage)}
1148
+ ${row(K.about.instructedUse, asked)}
1149
+ ${row(K.about.classes, classLine)}
1150
+ ${row(K.about.whereSearched, where)}
1151
+ ${row(K.about.context, context)}
1152
+ ${row(K.about.registersCounted, counted)}
1153
+ ${row(K.about.searchedOn, searched)}
1343
1154
  ${/* item 18 — a note for the reviewing lawyer does not reach the delivered page */''}
1344
1155
  </div>`;
1345
1156
  }
@@ -1388,8 +1199,8 @@ function registerFindingBlock(v, markIndex, reads = null, framework = null, owne
1388
1199
  <div class="rail" style="background:var(${stop ?? '--faint'})"></div>
1389
1200
  <div class="body">
1390
1201
  <div class="cardhead">
1391
- <span class="fnum">${esc(v.ref)}</span><span class="who">${esc(r.mark ?? 'Unnamed filing')}</span>${
1392
- band ? `<span class="ko-findband" style="background:var(${stop})">${bandChipText(band, method, row?.inputs)}</span>` : ''}<span class="src reg">Register</span>
1202
+ <span class="fnum">${esc(v.ref)}</span><h3 class="who">${esc(r.mark ?? 'Unnamed filing')}</h3>${
1203
+ band ? `<span class="ko-findband" style="background:var(${stop});color:var(${stop}-on)">${bandChipText(band, method, row?.inputs)}</span>` : ''}<span class="src reg">Register</span>
1393
1204
  <button class="ask-fi no-print">\u2726 Ask AI about this finding</button>
1394
1205
  </div>
1395
1206
  <p class="ko-findmeta">${meta}</p>
@@ -1417,29 +1228,26 @@ function firstRef(marks, framework) {
1417
1228
  return '';
1418
1229
  }
1419
1230
 
1420
- // — THE REGISTER SENTENCE IS THE RENDERER'S, and it is the whole reason the two clauses below exist.
1231
+ // — THE REGISTER SENTENCE IS THE RENDERER'S, and it is the whole reason the clause below exists.
1421
1232
  //
1422
1233
  // A live run printed "the register overlay has not been run" in model prose directly under a table of
1423
1234
  // register counts the same run had taken. The model was not lying: it cannot see the count lane, it is
1424
1235
  // deliberately never shown the figures (register-count.mjs rule 1), and it filled the gap with the only
1425
1236
  // thing it had. The fix is not a better prompt — it is that nobody who cannot see the machinery gets to
1426
- // describe it. The validator forbids the model from saying anything about register coverage; these
1427
- // clauses say it, from the artifacts.
1428
- //
1429
- // They read the SIDECARS, never the prose: the counts entry for this mark, and whether the product bought
1430
- // the probe at all. Four states, four sentences, and none of them is a judgment.
1237
+ // describe it. The validator forbids the model from saying anything about register coverage; this
1238
+ // clause says it, from the artifacts.
1431
1239
  //
1432
- // — AND IT NOW STATES THE POSITION, NOT ONLY THE COVERAGE. Coverage alone ("hit-counts were taken
1433
- // for this name") answers a question nobody asked; the question a reader holds is whether anything
1434
- // STANDS on the register for this name. That sentence is appended by registerPositionClause below and
1435
- // it is present in every state, including the state where the answer is "nothing does" — an absence is
1436
- // a finding and must be said out loud, never left as a silence over a table of numbers.
1240
+ // — IT STATES THE POSITION, NOT ONLY THE COVERAGE. Coverage alone ("hit-counts were taken for this
1241
+ // name") answers a question nobody asked; the question a reader holds is whether anything STANDS on the
1242
+ // register for this name. registerPositionClause says that in every state, including the state where the
1243
+ // answer is "nothing does": an absence is a finding and must be said out loud, never left as a silence
1244
+ // over a table of numbers.
1437
1245
  //
1438
- // THE FUNCTION THAT COMPOSED THE PAIR IS GONE, and removing it was the point rather than tidiness. It
1439
- // was called from nowhere in the tree, and its call to `registerPositionClause` was the one that did NOT
1440
- // pass the unreadable-sidecar flag — so anybody reviving it would have revived exactly the defect that
1441
- // flag closes, silently, with nothing at the call site to say so. The live composition is inline in
1442
- // `renderKnockoutHtml`, which passes it. Found independently twice before being removed once.
1246
+ // THE COVERAGE CLAUSE AND THE FUNCTION THAT COMPOSED THE PAIR ARE GONE. Neither was called from anywhere
1247
+ // in the tree. The composer's call to `registerPositionClause` was the one that did NOT pass the
1248
+ // unreadable-sidecar flag, so anybody reviving it would have revived exactly the defect that flag closes,
1249
+ // silently, with nothing at the call site to say so. The live composition is inline in
1250
+ // `renderKnockoutHtml`, which passes it; whether counts were taken at all is said once, by tierAbsenceLine.
1443
1251
 
1444
1252
  /**
1445
1253
  * Where the name STANDS on the register that was searched. Six states, and they are six because
@@ -1466,31 +1274,29 @@ function firstRef(marks, framework) {
1466
1274
  // The one sentence for a listing whose answer this run cannot state, whether the lister refused or the
1467
1275
  // sidecar itself would not parse. Held once so the two callers below cannot drift: they are the same fact
1468
1276
  // to a reader, and two copies of a sentence are two sentences waiting to differ.
1469
- const FILINGS_NOT_LISTED = 'The filings behind the counts could not be listed on this run, so nothing here says whether one stands.';
1277
+ const FILINGS_NOT_LISTED = K.read.filingsNotListed;
1470
1278
 
1471
- function registerPositionClause(mark, registerCounts, registerRecords, cards = [], where = 'above', recordsUnreadable = false) {
1279
+ function registerPositionClause(mark, registerCounts, registerRecords, cards = [], where = K.read.above, recordsUnreadable = false) {
1472
1280
  if (!registerRecords) {
1473
1281
  // AN UNREADABLE SIDECAR IS NOT AN ABSENT ONE. Absent means the listing was never taken, and the page
1474
1282
  // says so. Unreadable means it WAS taken and this run cannot say what it found. The second sentence
1475
1283
  // was already written, for the lister's own refusal, and was simply unreachable from a republish:
1476
1284
  // a file that would not parse arrived as null, and null reads here as absent.
1477
1285
  if (recordsUnreadable) return FILINGS_NOT_LISTED;
1478
- return registerCounts ? 'The filings behind those counts were not listed on this run.' : '';
1286
+ return registerCounts ? K.read.countsNotListed : '';
1479
1287
  }
1480
1288
  if (registerRecords.unavailable) {
1481
1289
  return FILINGS_NOT_LISTED;
1482
1290
  }
1483
1291
  const entry = recordsForMark(registerRecords, mark?.name);
1484
- const provider = registerRecords.providerLabel ?? registerRecords.provider ?? 'the register';
1485
- if (!entry) return 'No filings listing was recorded for this name.';
1292
+ const provider = registerRecords.providerLabel ?? registerRecords.provider ?? K.read.theRegister;
1293
+ if (!entry) return K.read.noListing;
1486
1294
  if (cards.length) {
1487
1295
  const classes = [...new Set(cards.flatMap((c) => (c.record.classes ?? []).map(Number).filter(Number.isFinite)))]
1488
1296
  .sort((a, b) => a - b);
1489
- const classWhere = classes.length ? ` in class${classes.length === 1 ? '' : 'es'} ${classes.join(', ')}` : '';
1490
- const one = cards.length === 1;
1297
+ const classWhere = classes.length ? K.read.inClasses(classes.length, classes.join(', ')) : '';
1491
1298
  const refs = cards.map((c) => c.ref).join(', ');
1492
- return `${one ? 'A filing' : `${cards.length} filings`} of this name or ${readByJudgment(registerRecords) ? 'a name near it' : 'a close variation of it'} `
1493
- + `stand${one ? 's' : ''} on ${provider}${classWhere} — ${refs} ${where}.`;
1299
+ return K.read.filingsStand(cards.length, readByJudgment(registerRecords) ? K.read.nameNear : K.read.closeVariation, provider, classWhere, refs, where);
1494
1300
  }
1495
1301
  const records = entry.records ?? [];
1496
1302
  if (!records.length) {
@@ -1503,33 +1309,11 @@ function registerPositionClause(mark, registerCounts, registerRecords, cards = [
1503
1309
  const terms = entry.terms ?? [];
1504
1310
  const ranAndAnswered = terms.length > 0 && terms.every((t) => t.ok && !t.setAside);
1505
1311
  return ranAndAnswered
1506
- ? `No filing of this name or a close variation of it stands on ${provider}, in the classes counted.`
1312
+ ? K.read.noneStands(provider)
1507
1313
  : noneCarriedForward(entry) ? NONE_CARRIED_FORWARD
1508
- : 'The filings listing for this name did not complete, so nothing here says whether one stands.';
1509
- }
1510
- return `${records.length} filing${records.length === 1 ? ' is' : 's are'} listed for this name below; `
1511
- + `none is carried up as a conflict — each is either shown dead on the register or outside the classes counted.`;
1512
- }
1513
-
1514
- function coverageClause(mark, registerCounts, probeRan) {
1515
- const entry = registerCounts ? countsForMark(registerCounts, mark.name) : null;
1516
- if (!entry?.counts) {
1517
- return probeRan
1518
- ? 'Register: hit-counts are part of this search and none could be taken for this name — the reason is in the audit workbook.'
1519
- : 'Register: not included in this product tier — no register was counted for this name.';
1314
+ : K.read.listingIncomplete;
1520
1315
  }
1521
- // A floor the register disclosed is a figure it gave, so a name counted only that way was counted.
1522
- const anyFigure = COUNT_PREDICATES.some((p) => Number.isFinite(entry.counts[p.key]?.total) || disclosedFloor(entry.counts[p.key]) !== null);
1523
- if (!anyFigure) return 'Register: no count could be taken for this name — the reason is in the audit workbook.';
1524
- // COVERAGE, NOT THE FIGURES. asks the renderer to own the register-tier caveat, and the numbers
1525
- // are already on this page twice — in the glance line at the top and in the counts table above this
1526
- // section. A third rendering of "3 identical, 41 containing" at the foot of every card is noise, and
1527
- // noise is what a reader stops reading. What the card owes is the fact the model cannot supply: that
1528
- // the lane ran for THIS name, and where its output is.
1529
- const scope = entry.classScope === 'all-classes' || !(entry.classes ?? []).length
1530
- ? 'across all classes'
1531
- : `in class${entry.classes.length === 1 ? '' : 'es'} ${entry.classes.join(', ')}`;
1532
- return `Register: hit-counts were taken for this name ${scope} — the figures are in the counts table above.`;
1316
+ return K.read.listedBelow(records.length);
1533
1317
  }
1534
1318
 
1535
1319
  // — the per-mark read, rendered as STRUCTURE because it was emitted as structure.
@@ -1566,9 +1350,9 @@ function coverageClause(mark, registerCounts, probeRan) {
1566
1350
  // It read "Why not <the rung above>", which asked the reader to hold a ladder they had not been given
1567
1351
  // and, at the top rung, had no band to name and asked a different question instead. The engine's
1568
1352
  // bullets are unchanged; only the label is, and it no longer varies with the band.
1569
- const COUNTER_LABEL = 'Remaining uncertainties';
1353
+ const COUNTER_LABEL = K.read.remainingUncertainties;
1570
1354
 
1571
- const ASSESSMENT_FOLD_LABEL = 'Read the full assessment';
1355
+ const ASSESSMENT_FOLD_LABEL = K.read.readFullAssessment;
1572
1356
 
1573
1357
  /** The scope block's own words, as one string, so the caveat filter reads exactly what the page prints. */
1574
1358
  const SCOPE_BLOCK_TEXT = 'What this is. A fast screen for obvious blockers to using each name, from '
@@ -1594,75 +1378,47 @@ function koScale(framework, band) {
1594
1378
  const n = ladder.length;
1595
1379
  const idx = Math.max(0, ladder.findIndex((b) => b.toLowerCase() === String(band ?? '').trim().toLowerCase()));
1596
1380
  const pct = (k) => (n > 1 ? (k / (n - 1)) * 100 : 50);
1597
- const TONE = ['var(--clear)', 'var(--low)', 'var(--med)', 'var(--high)', 'var(--severe)'];
1598
- const tone = (k) => TONE[Math.round((k / Math.max(1, n - 1)) * (TONE.length - 1))];
1381
+ const STOPS = ['--clear', '--low', '--med', '--high', '--severe'];
1382
+ const stopAt = (k) => STOPS[Math.round((k / Math.max(1, n - 1)) * (STOPS.length - 1))];
1383
+ const tone = (k) => `var(${stopAt(k)})`;
1599
1384
  const shift = (k) => (k === 0 ? '0' : k === n - 1 ? '-100%' : '-50%');
1600
1385
  return `<div class="kscale"><div class="kbar" style="background:linear-gradient(90deg,${
1601
1386
  ladder.map((b, k) => `${tone(k)} ${pct(k)}%`).join(',')})"><div class="kmarker" style="left:${pct(idx)}%;transform:translateX(${
1602
- idx === 0 ? '-12px' : idx === n - 1 ? 'calc(-100% + 12px)' : '-50%'})"><div class="kpill" style="background:${tone(idx)}">${
1387
+ idx === 0 ? '-12px' : idx === n - 1 ? 'calc(-100% + 12px)' : '-50%'})"><div class="kpill" style="background:${tone(idx)};color:var(${stopAt(idx)}-on)">${
1603
1388
  esc(ladder[idx] || band || '')}</div><div class="kneedle" style="background:${tone(idx)}"></div></div></div><div class="kticks">${
1604
1389
  ladder.map((b, k) => `<span class="${k === idx ? 'on' : ''}" style="left:${pct(k)}%;transform:translateX(${shift(k)})${
1605
1390
  k === idx ? `;color:${tone(k)}` : ''}">${esc(b)}</span>`).join('')}</div></div>`;
1606
1391
  }
1607
1392
 
1608
- // WHAT HAPPENS NEXT, AS ITS OWN SECTION (the 2026-09-16 report redesign). The engine writes this paragraph part-way
1609
- // down each mark's long assessment, under a heading of its own, where it rendered only inside a fold
1610
- // that opens at the bottom of the screen. It is the one paragraph a reader acts on, so it closes the
1611
- // page under its own heading.
1612
- //
1613
- // It MOVES, it is not copied: `splitOutcome` returns the assessment without it, and the fold renders
1614
- // that remainder, so the words appear once.
1615
- //
1616
- // A RECORD WRITTEN SINCE 2026-09-19 NEVER REACHES THIS WITH ONE: the pipeline removes a next-step section
1617
- // before it writes the record (`knockout-next-step.mjs`), and the heading test below is that module's, so
1618
- // the two cannot come to disagree about what a next step is. What still draws the section is a record
1619
- // written before then, re-rendered.
1620
- //
1621
- // THE HEADING IS THE MODEL'S OWN, so this hoists only the LAST block of the assessment. The assessing
1622
- // skill fixes no heading vocabulary — it asks for sub-headers "where the content divides", and the
1623
- // wording is written fresh each run. Matching a list of phrases anywhere in the document would let a
1624
- // mark whose read happens to argue under "Recommendation" in the MIDDLE have that middle lifted to the
1625
- // bottom, handing the client the engine's argument in an order the engine did not write, with nothing
1626
- // going red. A trailing block is the one position where a move cannot reorder what is left. So the
1627
- // phrase list only decides whether the last block is the outcome; anything earlier stays where it was
1628
- // written, and the page renders the assessment whole.
1629
- export function splitOutcome(assessment) {
1630
- const whole = String(assessment ?? '').trim();
1631
- const lines = whole.split('\n');
1632
- const heads = lines.map((l, i) => [l.trim(), i]).filter(([l]) => /^#{1,6}\s/.test(l));
1633
- const last = heads[heads.length - 1];
1634
- if (!last || !isNextStepHeading(last[0])) return { body: whole, outcome: '' };
1635
- const outcome = lines.slice(last[1] + 1).join('\n').trim();
1636
- if (!outcome) return { body: whole, outcome: '' };
1637
- return { body: lines.slice(0, last[1]).join('\n').trim(), outcome };
1638
- }
1639
- function markOutcomes(marks) {
1640
- return (marks ?? [])
1641
- .map((m) => ({ name: String(m?.name ?? '').trim(), text: splitOutcome(m?.assessment).outcome }))
1642
- .filter((o) => o.text);
1643
- }
1393
+ // NO "WHAT HAPPENS NEXT" (design's rule, approved by the owner 2026-11-18). The section hoisted a next-step block out of
1394
+ // each name's assessment and drew it under its own heading. Since 2026-09-19 the pipeline takes that block off before it
1395
+ // writes the record (`knockout-next-step.mjs`), so no record written since carries one, and a Knockout leads to the
1396
+ // lawyer's choice of which names go on to a clearance, which each name's rating already states. The section and its
1397
+ // hoist are gone: an assessment renders whole, as written. A page delivered earlier keeps what it was delivered with;
1398
+ // the cross-build refusal guards it.
1644
1399
 
1645
- function readBlock(m, framework) {
1400
+ function readBlock(m, framework, { opening = '' } = {}) {
1646
1401
  const factors = (m.factors ?? []).filter((s) => typeof s === 'string' && s.trim());
1647
1402
  const counter = (m.counterFactors ?? []).filter((s) => typeof s === 'string' && s.trim());
1648
1403
  const structured = Boolean(m.basis || factors.length || counter.length || m.mitigation);
1649
1404
  const bullets = (m.bullets ?? []).map((b) => `<li>${inlineMd(b)}</li>`).join('');
1650
1405
  if (!structured) return bullets ? `<ul class="ko-bul">${bullets}</ul>` : '';
1651
- const assessment = splitOutcome(m.assessment).body;
1406
+ const assessment = String(m.assessment ?? '').trim();
1652
1407
  const band = String(m.rating ?? '').trim();
1653
1408
  const card = [
1654
- `<div class="label">Overall risk</div>`,
1409
+ framework?.title
1410
+ ? `<div class="gauge-head"><div class="label">${K.readCard.overallRisk}</div><div class="gauge-fw">${esc(framework.title)}</div></div>`
1411
+ : `<div class="label">${K.readCard.overallRisk}</div>`,
1655
1412
  koScale(framework, band),
1656
1413
  m.basis ? `<p class="ko-basisline">${inlineMd(m.basis)}</p>` : '',
1657
- factors.length ? `<div class="gwhy">${band ? `<div class="label">Why ${esc(band)}</div>` : ''}<ul class="ko-bul">${
1414
+ factors.length ? `<div class="gwhy">${band ? `<div class="label">${esc(K.readCard.why(band))}</div>` : ''}<ul class="ko-bul">${
1658
1415
  factors.map((f) => `<li>${inlineMd(f)}</li>`).join('')}</ul></div>` : '',
1659
- framework?.title ? `<div class="gframe">Rated on the ${esc(framework.title)}</div>` : '',
1660
1416
  ].filter(Boolean).join('');
1661
1417
  return [
1662
1418
  card ? `<div class="panel gauge ko-gauge">${card}</div>` : '',
1663
1419
  counter.length ? `<div class="ko-counter"><span class="ko-lbl2">${esc(COUNTER_LABEL)}</span><ul class="ko-bul">${
1664
1420
  counter.map((f) => `<li>${inlineMd(f)}</li>`).join('')}</ul></div>` : '',
1665
- m.mitigation ? `<div class="ko-mitig"><span class="ko-lbl2">What would change this</span><p>${inlineMd(m.mitigation)}</p></div>` : '',
1421
+ m.mitigation ? `<div class="ko-mitig"><span class="ko-lbl2">${K.readCard.whatWouldChange}</span><p>${inlineMd(m.mitigation)}</p></div>` : '',
1666
1422
  // ── THE ASSESSMENT REPLACES THE "FULL NARRATIVE" FOLD ────────────────────────────────────────────
1667
1423
  //
1668
1424
  // The model writes both. `bullets` (five) say in other words what `factors` (four) already say
@@ -1677,15 +1433,20 @@ function readBlock(m, framework) {
1677
1433
  //
1678
1434
  // CLAUSE F. An archived run carries bullets and no assessment: it keeps the fold it was delivered
1679
1435
  // with, under its own old label. The fallback is the old block, never an empty new one.
1680
- assessment
1436
+ // A PER-NAME PAGE OF A MULTI-NAME BATCH OPENS WITH THIS VERY ASSESSMENT (the publisher sets it as the page's
1437
+ // opening), so the fold would print it a second time: 10 to 26% of each such page repeated. There the fold is
1438
+ // not drawn (owner, 2026-11-18). A single-name page opens with the batch paragraph, which is other text, and keeps it.
1439
+ assessment && String(opening ?? '').trim() === String(m.assessment ?? '').trim() ? ''
1440
+ : assessment
1681
1441
  ? `<details class="ko-full"><summary>${esc(ASSESSMENT_FOLD_LABEL)}</summary><div class="ko-assess">${mdParagraphs(assessment)}</div></details>`
1682
- : (bullets ? `<details class="ko-full"><summary>Full narrative</summary><ul class="ko-bul">${bullets}</ul></details>` : ''),
1442
+ : (bullets ? `<details class="ko-full"><summary>${K.readCard.fullNarrative}</summary><ul class="ko-bul">${bullets}</ul></details>` : ''),
1683
1443
  ].filter(Boolean).join('');
1684
1444
  }
1685
1445
 
1686
- function analysisSection(marks, framework, { registerCounts = null, probeRan = false, registerRecords = null, ownerChecks = [], frameworkMethod = null, cardOrder = null } = {}) {
1446
+ function analysisSection(marks, framework, { registerCounts = null, probeRan = false, registerRecords = null, ownerChecks = [], frameworkMethod = null, cardOrder = null, opening = '' } = {}) {
1447
+ const cite = { filings: filingsByHandle(registerRecords), provider: registerRecords?.provider ?? null };
1687
1448
  const cards = marks.map((m, markIndex) => {
1688
- const bullets = readBlock(m, framework);
1449
+ const bullets = readBlock(m, framework, { opening });
1689
1450
  // — the promoted register filings, in the SAME list as the common-law conflicts. A name's filing evidence
1690
1451
  // leads and its web use follows, the order a lawyer's report takes: first the findings that weigh a filing,
1691
1452
  // then the filing cards, then the findings resting on use alone. Each keeps its own order, so the
@@ -1708,7 +1469,7 @@ function analysisSection(marks, framework, { registerCounts = null, probeRan = f
1708
1469
  // nothing anywhere saying so. findings-model.mjs's view reads both shapes and drops nothing.
1709
1470
  const views = knockoutFindingViews(m, { manifest: framework });
1710
1471
  const weighsAFiling = (v) => Array.isArray(v?.weighedFilings) && v.weighedFilings.length > 0;
1711
- const findsOf = (list) => list.map((v) => findingBlock(v, framework, markIndex, frameworkMethod)).join('');
1472
+ const findsOf = (list) => list.map((v) => findingBlock(v, framework, markIndex, frameworkMethod, cite)).join('');
1712
1473
  // — THE REGISTER CARDS ARE INSIDE `body`, and that is the fall-through guard. A mark whose only
1713
1474
  // conflict is a filing on the register used to reach the sentence below and be published as clean.
1714
1475
  // The guard is deliberately TIGHT: a listed filing that is dead or out of the counted classes does
@@ -1726,15 +1487,16 @@ function analysisSection(marks, framework, { registerCounts = null, probeRan = f
1726
1487
  // mark says "no adverse signals recorded" — a mark with nothing against it — so anything added to it
1727
1488
  // silently retires that sentence. Named ONCE: the read above carries it where it drew a card, and
1728
1489
  // the test for that reads the markup this same function just produced.
1729
- const frameworkLine = !body.includes('class="gframe"') && framework?.title && String(m.rating ?? '').trim()
1730
- ? `<div class="gframe">Rated on the ${esc(framework.title)}</div>` : '';
1490
+ // The rating line reads as the clearance's does, "Overall risk" and the framework's name (owner, 2026-11-18).
1491
+ const frameworkLine = !body.includes('class="gauge-fw"') && framework?.title && String(m.rating ?? '').trim()
1492
+ ? `<div class="ko-fwline"><div class="label">${K.readCard.overallRisk}</div><div class="gauge-fw">${esc(framework.title)}</div></div>` : '';
1731
1493
  return `<div class="ko-row">
1732
1494
  <div>
1733
1495
  <p class="ko-name">${esc(m.name)}</p>
1734
1496
  ${bandColumn(m, framework)}
1735
1497
  </div>
1736
1498
  <div>
1737
- ${body || '<p class="ko-bul">No adverse signals recorded for this name on this screen.</p>'}
1499
+ ${body || `<p class="ko-bul">${K.readCard.noAdverseSignals}</p>`}
1738
1500
  ${frameworkLine}
1739
1501
  ${m.degraded ? `<p class="ko-degraded">${esc(DEGRADED_NOTE)}</p>` : ''}
1740
1502
  ${reviewerNotesBlock(m)}
@@ -1807,7 +1569,7 @@ function depthStrip(note) {
1807
1569
  // section above them was removed, and the first restoration drew them as bare paragraphs — dropping this
1808
1570
  // sentence, which is the whole of what the ruling asked for. One paragraph, the lead-in first, the
1809
1571
  // caveats verbatim after it; only where it sits on the page has changed.
1810
- const CAVEAT_LEAD = 'This screen also carries the following limits:';
1572
+ const CAVEAT_LEAD = K.caveatLead;
1811
1573
 
1812
1574
 
1813
1575
  /**
@@ -1835,10 +1597,12 @@ export function renderKnockoutHtml(findings, framework, {
1835
1597
  // is its own value rather than a marker on `registerRecords`, because three sites PRINT
1836
1598
  // `registerRecords.unavailable` and anything invented for it would become client-facing wording.
1837
1599
  registerRecordsUnreadable = false,
1600
+ // The searches this run did not complete, as Left open rows ({area, state, note}); empty draws no section.
1601
+ leftOpen = [],
1838
1602
  // The driver's own record of the owner lookups it ran. Defaults to [] so an
1839
1603
  // archived run that predates the lane renders exactly as it was delivered.
1840
1604
  ownerChecks = [],
1841
- identity = null, matter = null, homeHref = null, chromeHref = null, depthNote = null,
1605
+ identity = null, matter = null, homeHref = null, chromeHref = null, depthNote = null, auditHref = null,
1842
1606
  // — the run's FROZEN policy, so the scope section states what this run was
1843
1607
  // instructed to do rather than what its artifacts happen to show. Defaults to null, and an archived
1844
1608
  // run that carries none keeps the artifact-derived sentence it was delivered with.
@@ -1913,7 +1677,7 @@ export function renderKnockoutHtml(findings, framework, {
1913
1677
  // promoted, and the clause would name refs no card carries.
1914
1678
  const cardsByMark = new Map(marks.map((m) => [m?.name, registerCardViews(m, framework, registerRecords).cards]));
1915
1679
  const positions = marks.map((m) => {
1916
- const clause = registerPositionClause(m, registerCounts, registerRecords, cardsByMark.get(m?.name) ?? [], 'below', registerRecordsUnreadable);
1680
+ const clause = registerPositionClause(m, registerCounts, registerRecords, cardsByMark.get(m?.name) ?? [], K.read.below, registerRecordsUnreadable);
1917
1681
  if (!clause) return '';
1918
1682
  return marks.length > 1 && m?.name ? `${m.name}: ${clause}` : clause;
1919
1683
  }).filter(Boolean).join(' ');
@@ -1933,13 +1697,13 @@ export function renderKnockoutHtml(findings, framework, {
1933
1697
  // a disclosure, which is the one failure that would matter on a client-facing page. A similarity score
1934
1698
  // could; that is why there isn't one.
1935
1699
  const newCaveats = caveats.filter((c) => saysSomethingNew(c, SCOPE_BLOCK_TEXT));
1936
- const analysis = analysisSection(marks, framework, { registerCounts, probeRan, registerRecords, ownerChecks, frameworkMethod, cardOrder: findings?.cardOrder });
1700
+ const analysis = analysisSection(marks, framework, { registerCounts, probeRan, registerRecords, ownerChecks, frameworkMethod, cardOrder: findings?.cardOrder, opening: findings?.batch?.executiveSummary });
1937
1701
  // The request-level notes, gathered across every mark on the document and rendered ONCE at the top.
1938
1702
  // They are about the asking, not about a name, so a batch repeating them per mark would be the same
1939
1703
  // sentence three times. reviewerNotesBlock renders the rest, under that mark's own cards.
1940
1704
  const requestNotes = marks.flatMap((m) => splitKnockoutNotes(m).request);
1941
1705
  const aboutRequest = aboutRequestBlock(instructedScope, requestNotes, depthNote, productContext, searched, registerCounts);
1942
- const provider = hasCounts ? (registerCounts.providerLabel ?? registerCounts.provider ?? 'the register') : null;
1706
+ const provider = hasCounts ? (registerCounts.providerLabel ?? registerCounts.provider ?? K.counted.theRegister) : null;
1943
1707
  // The filings appendix renders only when the run produced a listing artifact — never on its absence,
1944
1708
  // and never as an empty table. A knockout with no sidecar publishes exactly the counts-only document.
1945
1709
  // — THE DRILL-THROUGH CLAIM IS NARROWED TO WHAT IT IS TRUE OF. The workbook line below said "the
@@ -1955,11 +1719,18 @@ export function renderKnockoutHtml(findings, framework, {
1955
1719
  n + registerCardsOnPage(registerCardViews(m, framework, registerRecords).cards, m, framework).length, 0);
1956
1720
  const hasRecords = Boolean(registerRecords && (registerRecords.marks?.length || registerRecords.unavailable));
1957
1721
  const filings = hasRecords ? filingsSection(marks, registerRecords) : '';
1958
- const onFieldSec = `<div class="sec" id="findings"><span class="num"></span><h2>Conflicts</h2></div>
1722
+ const onFieldSec = `<div class="sec" id="findings"><span class="num"></span><h2>${K.sections.conflicts}</h2></div>
1959
1723
  ${counts}
1960
1724
  ${analysis}`;
1725
+ // WHAT THIS KNOCKOUT LEFT OPEN (design's rule, approved by the owner 2026-11-18). A name whose register search failed read
1726
+ // as a clean name, where a clearance in the same place says so. The rows are the run's own record of searches that did
1727
+ // not complete, built by the publisher (knockout.mjs, knockoutLeftOpen), in the clearance's grid and state words; none
1728
+ // is model prose. A Knockout with nothing left open draws nothing, byte for byte. No scope narration returns.
1729
+ const leftOpenSec = Array.isArray(leftOpen) && leftOpen.length
1730
+ ? `\n\n <div class="sec" id="open"><span class="num"></span><h2>${K.sections.leftOpen}</h2></div>\n <div class="panel"><div class="openrows">${coverageGrid(leftOpen, { verdict: false })}</div></div>`
1731
+ : '';
1961
1732
  const filingsSec = filings
1962
- ? `<div class="sec" id="filings"><span class="num"></span><h2>Also considered</h2><span class="note">the filings behind the counts</span></div>
1733
+ ? `<div class="sec" id="filings"><span class="num"></span><h2>${K.sections.alsoConsidered}</h2><span class="note">${K.sections.alsoConsideredNote}</span></div>
1963
1734
  ${filings}`
1964
1735
  : '';
1965
1736
 
@@ -1968,19 +1739,15 @@ ${filings}`
1968
1739
  // falls back to its intrinsic 500px and overflows the body box by ~440px, which the height bridge then
1969
1740
  // posts as the frame height. That is invisible to a string test and obvious to a browser: the page
1970
1741
  // renders correctly and sits in a frame with 450px of dead space under it. Caught by render-check.
1971
- const cssInline = REPORT_BASE + '\n' + CHROME_CSS + '\n' + THEME_BTN_CSS + '\n' + KO_CSS;
1972
- const chromeLinkTag = chromeHref ? `<link rel="stylesheet" href="${escAttr(chromeHref)}">` : '';
1973
-
1974
- const doc = `<!DOCTYPE html>
1975
- <html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">
1976
- <title>${productName ? `${esc(productName)} — ` : ''}${esc(title)} · ${esc(BRAND.name)}</title>
1977
- ${REPORT_FONT_STYLE}${FAVICON_LINK}${THEME_INIT_EXPLICIT}
1978
- <style>${cssInline}${REPORT_ROOT_DARK_EXPLICIT}${PRINT_LIGHT}</style>${chromeLinkTag}</head><body class="has-glow">
1979
- <div class="rep-stickyhead no-print">
1742
+ const doc = pageShell({
1743
+ title: `${productName ? `${esc(productName)} — ` : ''}${esc(title)}`,
1744
+ css: CHROME_CSS + '\n' + THEME_BTN_CSS + '\n' + KO_CSS,
1745
+ chromeHref,
1746
+ body: `<div class="rep-stickyhead no-print" data-report-chrome>
1980
1747
  <div class="topbar no-print">
1981
- ${homeHref ? `<a class="homebtn tb-back no-print" href="${escAttr(homeHref)}" title="All reports"><span aria-hidden="true">←</span> <span class="tb-back-lbl">All reports</span></a>` : ''}
1748
+ ${homeHref ? `<a class="homebtn tb-back no-print" href="${escAttr(homeHref)}" title="${K.topbar.allReports}"><span aria-hidden="true">←</span> <span class="tb-back-lbl">${K.topbar.allReports}</span></a>` : ''}
1982
1749
  ${logoLockup({ mark: 20, tag: '' })}<span class="sp"></span>
1983
- <span class="tb-risk" style="background:var(${overallStop})">${esc(overall ?? '—')}</span>
1750
+ <span class="tb-risk" style="background:var(${overallStop});color:var(${overallStop}-on)">${esc(overall ?? '—')}</span>
1984
1751
  ${/* THE IDENTITY LINE NAMES THE MARK AND THE SEARCH, NOT THE RUN. It printed `matter || runId`,
1985
1752
  and the caller passes the runId AS the matter, so what a client read was the engine's own run
1986
1753
  identifier — on a real run a temporary-directory name carrying a capture suffix. It is ours, it
@@ -1990,9 +1757,9 @@ ${REPORT_FONT_STYLE}${FAVICON_LINK}${THEME_INIT_EXPLICIT}
1990
1757
  neither the line does not render. A run whose registry identity is missing is exactly the case
1991
1758
  that used to print the raw name, so falling back would keep the defect for the runs that have
1992
1759
  it. */''}
1993
- ${title || productName ? `<span class="mono tb-matter" style="font-size:11px;color:var(--faint)">${
1760
+ ${title || productName ? `<span class="mono tb-matter" style="font-size:11px;color:var(--slate)">${
1994
1761
  [title, productName].filter(Boolean).map(esc).join(' / ')}</span>` : ''}
1995
- ${issuedDate ? `<span class="mono tb-issued"><span aria-hidden="true">🗓 </span>Issued on ${esc(issuedDate)}</span>` : ''}
1762
+ ${issuedDate ? `<span class="mono tb-issued"><span aria-hidden="true">🗓 </span>${esc(K.topbar.issuedOn(issuedDate))}</span>` : ''}
1996
1763
  ${/* THE EXPORT CONTROL, which this template had never emitted. The approved header carries it and the
1997
1764
  clearance report has it; the knockout offered a reader who opens the file no route to a PDF at
1998
1765
  all, while its own stylesheet still described the utility buttons as "used by the topbar Export
@@ -2011,18 +1778,21 @@ ${REPORT_FONT_STYLE}${FAVICON_LINK}${THEME_INIT_EXPLICIT}
2011
1778
  own change with its own byte-comparison against a real archived run. Filed as a follow-up. The
2012
1779
  class names are the shared vocabulary this file already emits, so report.css styles both. */''}
2013
1780
  <div class="tb-menu">
2014
- <button type="button" class="tbbtn tb-ask no-print">\u2726 <span class="tb-lbl">Ask AI</span></button>
1781
+ <button type="button" class="tbbtn tb-ask no-print">\u2726 <span class="tb-lbl">${K.topbar.askAi}</span></button>
2015
1782
  ${EXPORT_TOGGLE}
2016
1783
  ${exportPopover(`
2017
- <button class="util primary" onclick="exportPDF()">\u2b07 Export PDF</button>
1784
+ <button class="util primary" onclick="exportPDF()">\u2b07 ${K.topbar.exportPdf}</button>
1785
+ ${/* THE CLEARANCE'S OWN WORKBOOK CONTROL (owner, 2026-11-18). The page cites "the audit workbook" and gave no way to
1786
+ open it; the control links the portal's audit route the publisher hands in, and is absent when there is none. */''}${
1787
+ isHttpUrl(auditHref) ? `<a class="util" href="${escAttr(auditHref)}" download>\u2b07 ${K.topbar.downloadAudit}</a>` : ''}
2018
1788
  <div class="tb-sep"></div>
2019
- <div class="tb-row"><button class="util" onclick="openAll(true)">Expand all</button><button class="util" onclick="openAll(false)">Collapse all</button></div>
1789
+ <div class="tb-row"><button class="util" onclick="openAll(true)">${K.topbar.expandAll}</button><button class="util" onclick="openAll(false)">${K.topbar.collapseAll}</button></div>
2020
1790
  `)}
2021
1791
  </div>
2022
1792
  </div>
2023
1793
  <!--SECTION-STRIP-->
2024
1794
  </div>
2025
- <div class="fab-stack">${themeButton()}</div>
1795
+ <div class="fab-stack" data-report-chrome>${themeButton()}</div>
2026
1796
  <script>
2027
1797
  /* THE DOCUMENT'S OWN CONTROLS, and they are GLOBAL on purpose.
2028
1798
  The portal frames this document and drives it by postMessage. The bridge injected at serve time looks
@@ -2045,6 +1815,7 @@ window.addEventListener('beforeprint',o);})();
2045
1815
  the clearance template carries, for the same markup; they move together when the top bar is shared. */
2046
1816
  ${EXPORT_MENU_JS}</script>
2047
1817
  <div class="wrap">
1818
+ <main>
2048
1819
  <header class="hero" id="summary">
2049
1820
  ${demoBannerHtml(demoData === true)}
2050
1821
  ${confLineHtml(delivery, productName)}
@@ -2055,16 +1826,8 @@ ${EXPORT_MENU_JS}</script>
2055
1826
 
2056
1827
  ${glance}
2057
1828
  ${onFieldSec}
2058
- ${filingsSec}
1829
+ ${filingsSec}${leftOpenSec}
2059
1830
 
2060
- ${(() => {
2061
- const outs = markOutcomes(marks);
2062
- if (!outs.length) return '';
2063
- const label = outs.length > 1;
2064
- const body = outs.map((o) => (label && o.name ? `<h3>${esc(o.name)}</h3>` : '') + mdParagraphs(o.text)).join('');
2065
- return `<div class="sec" id="next"><span class="num"></span><h2>What happens next</h2></div>
2066
- <div class="panel actions"><div class="actgrp act-you">${body}</div></div>`;
2067
- })()}
2068
1831
 
2069
1832
  ${/* The 2026-09-16 report redesign — the scope section and its fold are off the page: what a screen is and
2070
1833
  what it did not search is the narration the owner ruled out. */''}
@@ -2081,6 +1844,7 @@ ${EXPORT_MENU_JS}</script>
2081
1844
  is kept. Both of the demo run's survive. */''}
2082
1845
  ${newCaveats.length ? `<div class="panel ko-caveats"><p class="ko-scope">${CAVEAT_LEAD}<br>${
2083
1846
  newCaveats.map((c) => inlineMd(c)).join('<br>')}</p></div>` : ''}
1847
+ </main>
2084
1848
 
2085
1849
  <footer>
2086
1850
  ${/* THE FOOTER NAMES THE SAME THREE THINGS THE HEADER DOES. It read "<product>. / Matter
@@ -2097,218 +1861,7 @@ ${EXPORT_MENU_JS}</script>
2097
1861
  title || productName || issuedDate ? '.' : ''}</span>
2098
1862
  ${logoLockup({ mark: 16 })}
2099
1863
  </footer>
2100
- </div>
2101
- </body></html>`;
1864
+ </div>`,
1865
+ });
2102
1866
  return doc.replace('<!--SECTION-STRIP-->', sectionStrip(doc, STRIP));
2103
1867
  }
2104
-
2105
- /**
2106
- * report-data.json — the run, as data.
2107
- *
2108
- * Two readers, one file. The assistant drafts a client-facing email from it (which is why the retired
2109
- * per-customer email template does not need to come back as config: formatting is judgement, and this is
2110
- * the input judgement works from). And it is the shape the portal's unbuilt native-render path has been
2111
- * looking for since before it had a writer — same filename, so building that path later is a read, not a
2112
- * migration.
2113
- *
2114
- * It carries what the REPORT says, plus the level identity, and nothing internal: the audit workbook is
2115
- * where the working notes live, and a data file that quietly re-admitted them would reopen exactly the
2116
- * leak this series closed.
2117
- */
2118
- export function knockoutReportData(findings, framework, { runId, codename, overall, issued, identity, registerCounts, registerRecords = null, ownerChecks = [], url, auditFile, customerKey, matter, servedModels = null }) {
2119
- const marks = findings?.marks ?? [];
2120
- return {
2121
- schema: 'report-data/1',
2122
- runId,
2123
- codename: codename || null,
2124
- matter: matter || runId,
2125
- customerKey: customerKey || 'generic',
2126
- issued: issued || null,
2127
- url: url || null,
2128
- auditFile: auditFile || null,
2129
- // The models that served the run, in first-use order, as tokens.mjs servedModels names them for a
2130
- // client: a deployment's own name never, its tier instead. null when nothing was read.
2131
- servedModels: Array.isArray(servedModels) ? servedModels : null,
2132
- level: {
2133
- searchLevel: identity?.level ?? null,
2134
- stageLabel: identity?.stageLabel ?? null,
2135
- identity: identity?.identity ?? null,
2136
- // `banner` is NOT projected. It is stageLabel joined to identity, so on a retired row it carries a
2137
- // depth rung — and report-data.json is a CLIENT surface (the portal's native render and the MCP
2138
- // brief read it). The two fields it is made of are both here already; a consumer that wants the
2139
- // internal face takes `stageLabel`, and nothing gets a pre-joined string that leaks one.
2140
- },
2141
- framework: framework ? { key: framework.framework_key, title: framework.title, bands: framework.bands.map((b) => ({ label: b.label, tone: b.tone })) } : null,
2142
- overall: overall ?? null,
2143
- summary: findings?.batch?.executiveSummary ?? null,
2144
- productContext: findings?.batch?.productContext ?? null,
2145
- caveats: findings?.batch?.standardCaveats ?? [],
2146
- marks: marks.map((m) => {
2147
- const counted = registerCounts ? countsForMark(registerCounts, m.name) : null;
2148
- return {
2149
- name: m.name,
2150
- band: m.rating ?? null,
2151
- qualifier: m.ratingQualifier ?? null,
2152
- // WHAT THIS NAME IS FOR. Per MARK, not per batch — a character name and a
2153
- // franchise title can sit at different bands on identical evidence, and the manner-of-use
2154
- // calibration in the firm-wide reasoning turns on exactly this. It reached the plan and the
2155
- // rater and stopped there: this projection is an explicit whitelist, so a field nobody adds is
2156
- // a field the assistant drafting client mail never sees, however faithfully the rater carried
2157
- // it. Null on an archived run that predates the frame carrying it.
2158
- contextFraming: m.contextFraming ?? null,
2159
- classesSearched: m.classesSearched ?? [],
2160
- classesDriving: m.classesDriving ?? [],
2161
- ...(Array.isArray(m.classGroups) && m.classGroups.length ? { classGroups: m.classGroups } : {}),
2162
- degraded: Boolean(m.degraded),
2163
- points: m.bullets ?? [],
2164
- // ── THE ASSESSMENT THE RUN ALREADY WROTE ──────────────────────────────────────────────────
2165
- //
2166
- // Seven keys the assess stage writes into knockout-findings.json reached this file as nothing.
2167
- // They were not withheld by a rule — no code decided against them; this projection is an explicit
2168
- // whitelist and nobody had added them, so an assistant drafting from this file could not see the
2169
- // reasoning behind a rating it was drafting about.
2170
- //
2171
- // `assessment` is the sharpest case: publish substitutes it into `batch.executiveSummary` ONLY on
2172
- // a multi-mark batch, so on a single-mark run — the common knockout — the mark's own opening read
2173
- // was written, validated, and then dropped by both surfaces at once.
2174
- //
2175
- // `purpleNotes` is the reviewer's notes, and it is here by the owner's ruling of 2026-09-07: one
2176
- // report, read by the person who ran Clearotron, because keeping material off it "just adds
2177
- // confusion for where data is lost". They are LABELLED on the page rather than merged into the
2178
- // client-voiced body — see reviewerNotesBlock — so a reader can tell whose voice they are in.
2179
- assessment: (() => { const t = String(m.assessment ?? '').trim(); return t || null; })(),
2180
- counterFactors: m.counterFactors ?? [],
2181
- mitigation: (() => { const t = String(m.mitigation ?? '').trim(); return t || null; })(),
2182
- // `null`, not `false`, when the rater said nothing: a crowded field is a mitigant the reasoning
2183
- // turns on, and an unstated one must not read as a stated "no".
2184
- crowdedField: typeof m.crowdedField === 'boolean' ? m.crowdedField : null,
2185
- reviewerNotes: m.purpleNotes ?? [],
2186
- // The proof-of-search rows — the same defensibility record list_searches answers from.
2187
- negatives: (m.negatives ?? []).map((n) => ({
2188
- term: n?.term ?? null, source: n?.source ?? null, note: n?.note ?? null,
2189
- })),
2190
- // The rater's read of a filing it weighed, keyed by the record id the card prints, so a consumer
2191
- // can join a read to its filing without matching on prose.
2192
- registerReads: (m.registerReads ?? []).map((x) => ({
2193
- recordId: x?.recordId ?? null,
2194
- read: x?.read ?? null,
2195
- band: String(x?.band ?? '').trim() || null,
2196
- // the framework's own inputs, where it states a method — absent otherwise, so every other run's data is unchanged
2197
- ...(x?.inputs ? { inputs: x.inputs } : {}),
2198
- })),
2199
- // — the typed finding, ranked, with the reference the report prints. The old key was
2200
- // `evidence[]` and it was `(m.findings ?? []).filter((f) => f?.url)`: a typed finding has no
2201
- // `url`, so this file — the one the assistant drafts client mail from — silently carried zero
2202
- // conflicts for a mark that had several. `shape` says which record each row came from, so a
2203
- // reader can tell a typed run from an archived prose one without guessing at the blanks.
2204
- findings: [
2205
- ...knockoutFindingViews(m, { manifest: framework }).map((v) => ({
2206
- ref: v.ref, ordinal: v.ordinal, name: v.name, owner: v.owner, band: v.band, type: v.type,
2207
- net: v.lead, basis: v.detail, evidence: v.evidence, shape: v.shape,
2208
- ...(v.inputs ? { inputs: v.inputs } : {}),
2209
- })),
2210
- // — the promoted register filings, in the SAME array, from the SAME projection the page
2211
- // renders from (registerCardViews). Two reasons it cannot live under its own key:
2212
- //
2213
- // 1. THE FLAG. portal-service.mjs resolves per-finding feedback as
2214
- // `data.marks[markIndex].findings.find(f => f.ordinal === ordinal)`, against the
2215
- // `data-ko-ord` the card carries. A card in the DOM with no row here resolves NOTHING and
2216
- // logs `resolved:false` — the reader's correction is captured against no facts, silently.
2217
- // 2. THE BRIEF. mcp-server/lib/brief.mjs walks this array to write "Each name screened".
2218
- // A promoted filing the brief omitted would be the report and the brief disagreeing about
2219
- // what the run found.
2220
- //
2221
- // `shape: 'register'` is the load-bearing field: a consumer can tell a weighed conflict from a
2222
- // pointed-at filing without parsing prose.
2223
- //
2224
- // `band` AND `basis` NOW CARRY THE RATER'S READ WHEN IT SENT ONE. Before
2225
- // this, both were constants — `band: null` and the not-weighed sentence — on every filing of
2226
- // every run, including runs where the seat had written a full read of that exact filing and the
2227
- // HTML card was already printing it. The page and this file disagreed, and this file is the one
2228
- // the MCP brief answers from, so the surface a reader asks "what did you make of that
2229
- // registration?" was the surface that had dropped the answer.
2230
- //
2231
- // The unmatched case is unchanged and must stay that way: no row for this recordId ⇒ `band:
2232
- // null` and the not-weighed line, which describes the card and claims nothing.
2233
- ...registerCardViews(m, framework, registerRecords).cards.map((v) => {
2234
- const row = (Array.isArray(m?.registerReads) ? m.registerReads : [])
2235
- .find((x) => String(x?.recordId ?? '').trim() && String(x?.recordId ?? '').trim() === String(v.record?.recordId ?? '').trim());
2236
- const read = String(row?.read ?? '').trim() || null;
2237
- const band = String(row?.band ?? '').trim() || null;
2238
- // The driver's own record of where this filing's proprietor was looked up, joined by
2239
- // recordId. `null` where the run owed no check — the same three states the
2240
- // card has, so a consumer can tell "searched and found nothing" from "never searched".
2241
- const oc = ownerCheckFor(ownerChecks, v.record?.recordId);
2242
- return {
2243
- ref: v.ref, ordinal: v.ordinal, name: v.record.mark, owner: v.record.owner, band,
2244
- ...(band && row?.inputs ? { inputs: row.inputs } : {}),
2245
- type: 'Register filing',
2246
- net: read ? v.statement : `${v.statement} It was ${NOT_WEIGHED}.`,
2247
- basis: read ?? NOT_WEIGHED,
2248
- useCheckSource: ownerCheckText(ownerCheckOutcome(oc)),
2249
- evidence: v.evidence, shape: 'register',
2250
- };
2251
- }),
2252
- ],
2253
- registerCounts: counted?.counts
2254
- ? {
2255
- classScope: counted.classScope ?? null,
2256
- classes: counted.classes ?? [],
2257
- ...Object.fromEntries(COUNT_PREDICATES.map((p) => [p.key, Number.isFinite(counted.counts[p.key]?.total) ? counted.counts[p.key].total : null])),
2258
- // The figure stays null for a floor — a floor is never a count to be summed — and the floor
2259
- // rides beside it, so a reader of this file has the register's own figure and not only a null.
2260
- ...(COUNT_PREDICATES.some((p) => disclosedFloor(counted.counts[p.key]) !== null)
2261
- ? { floors: Object.fromEntries(COUNT_PREDICATES.filter((p) => disclosedFloor(counted.counts[p.key]) !== null)
2262
- .map((p) => [p.key, disclosedFloor(counted.counts[p.key])])) }
2263
- : {}),
2264
- // The close column is an aggregate, so the forms under it ride with it — a consumer that
2265
- // got the number and not the forms could restate the figure but never explain it, and this
2266
- // file is what the assistant drafts client mail from.
2267
- closeVariationForms: (counted.counts.close?.forms ?? []).map((f) => f.form),
2268
- closeVariationsLine: variantFormsLine(counted),
2269
- line: countLine(counted),
2270
- }
2271
- : null,
2272
- // part 5 — the filings behind the narrow counts, as data. The assistant drafts client mail
2273
- // from this file, so it gets the SAME three states the report gets: rows, an answered nothing,
2274
- // or a stated reason. `records: []` with no line beside it would be read as "no filings".
2275
- registerFilings: (() => {
2276
- const listed = registerRecords ? recordsForMark(registerRecords, m.name) : null;
2277
- if (registerRecords?.unavailable) return { available: false, line: registerRecords.unavailable, records: [] };
2278
- if (!listed) return null;
2279
- return {
2280
- available: true,
2281
- line: recordsLine(listed),
2282
- fetched: listed.fetched ?? (listed.records ?? []).length,
2283
- capped: Boolean(listed.capped),
2284
- // THE CAP THE RUN RECORDED, beside the flag that says it bit. `capped: true` on its own cannot
2285
- // tell a listing truncated at fifty from one a cap of zero stopped before it began: the first
2286
- // is a register outcome and the second is a configuration, and a consumer reading the flag
2287
- // alone reports them the same way. The run has always written `cap` per mark; nothing read it.
2288
- //
2289
- // NULL IS NOT ZERO and the two are kept apart all the way out, the way the portal's allowance
2290
- // contract keeps them. Null is a sidecar that recorded no cap at all, which is every run
2291
- // archived before the field existed; zero is a cap that was set to zero. Folding them together
2292
- // would put an archived run and a misconfigured one on the same line.
2293
- cap: Number.isFinite(listed.cap) ? listed.cap : null,
2294
- records: (listed.records ?? []).map((r) => ({
2295
- mark: r.mark, owner: r.owner, status: r.status, classes: r.classes ?? [],
2296
- territory: r.territory, matchedForm: r.matchedForm, matchedBasis: r.matchedBasis,
2297
- recordId: r.recordId, url: r.url,
2298
- // The office's page for the filing, or its office and number and why it is not a link: the
2299
- // report's own cell, as data. Only where the run's register has no record pages of its own.
2300
- ...(r.officeLink ? { officeRecord: { label: r.officeLink.label, href: r.officeLink.href, reason: r.officeLink.reason } } : {}),
2301
- })),
2302
- // Which searches did NOT answer, by name. A consumer that lists only `records` would report
2303
- // a partial listing as a complete one. A form the cap stopped keeps its sentence; a failed
2304
- // search's own text stays in the run's filings record, never in this file.
2305
- unanswered: (listed.terms ?? []).filter((t) => !t.ok).map((t) => ({ form: t.term, basis: t.basis, reason: t.notAsked ? t.reason ?? null : null })),
2306
- };
2307
- })(),
2308
- };
2309
- }),
2310
- registerCountBasis: registerCounts ? COUNT_BASIS : null,
2311
- registerFilingsBasis: registerRecords && !registerRecords.unavailable ? recordBasisOf(registerRecords) : null,
2312
- registerProvider: registerCounts ? (registerCounts.providerLabel ?? registerCounts.provider ?? null) : null,
2313
- };
2314
- }