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
@@ -30,7 +30,7 @@ import { declaredRecordOrigins } from '../record-origins.mjs';
30
30
  import { NEUTRAL_DELIVERY, loadProfiles } from '../profiles.mjs';
31
31
  import { resolveDemoData, demoBannerMd } from './demo-marking.mjs'; // — one demo question, every product; 2134 — every SURFACE
32
32
  import { engineCommit } from '../engine-build.mjs';
33
- import { WARM_ROOT, WARM_ROOT_DARK, WARM_ROOT_DARK_EXPLICIT, THEME_INIT, THEME_INIT_EXPLICIT, FAVICON_LINK, BRAND } from '../../shared/brand.mjs'; import { TEXT_FONT_STYLE } from '../../shared/brand-fonts.mjs'; // the text face, carried in the page rather than fetched
33
+ import { WARM_ROOT, WARM_ROOT_DARK, WARM_ROOT_DARK_EXPLICIT, THEME_INIT, THEME_INIT_EXPLICIT, FAVICON_LINK, BRAND, EMAIL_TIER, EMAIL_COLOURS as EC, BAND_BY_TONE } from '../../shared/brand.mjs'; import { TEXT_FONT_STYLE } from '../../shared/brand-fonts.mjs'; // the text face, carried in the page rather than fetched
34
34
  import { NAV_CSS, siteNav, siteFab } from '../../shared/site-nav.mjs';
35
35
  import { anonAssets, anonClient, anonMark } from '../../shared/anon-overlay.mjs';
36
36
 
@@ -82,7 +82,7 @@ export function evaluateClientGate({ coverage = [], lintFailingIds = [], escalat
82
82
  // surfaces render from (the corrective pass left findings.json stale after a followup demand):
83
83
  // the client cards may carry facts the review already corrected or killed.
84
84
  if (Array.isArray(findingsStale) && findingsStale.length)
85
- push("findings-stale", `the reviewer's corrections did not reach the client-facing findings (${findingsStale.slice(0, 3).join(", ")}${findingsStale.length > 3 ? ", …" : ""}) — re-run the correction before this goes out`);
85
+ push("findings-stale", W.heldBecause.findingsStale(`${findingsStale.slice(0, 3).join(", ")}${findingsStale.length > 3 ? ", …" : ""}`));
86
86
  // (1) doc-35 close-the-loop: a core search layer in state "not-searched" NO LONGER closes the client
87
87
  // export. An in-scope channel a search layer CAN reach is a CLOSE target (run it) or a clean forward
88
88
  // action — never a ⛔ CLOSE-BEFORE-FILING banner. The gate now closes ONLY when the data cannot be
@@ -91,16 +91,16 @@ export function evaluateClientGate({ coverage = [], lintFailingIds = [], escalat
91
91
  // Plain English — these reasons are read by a lawyer, not the people who built the pipeline. The internal
92
92
  // axis ids stay in the run log / audit; the surfaced reason says what happened in words a reader understands.
93
93
  if (Array.isArray(escalationFailed) && escalationFailed.length)
94
- push("escalation-failed", `the main search didn't finish — it needs to be re-run before this can be relied on`);
94
+ push("escalation-failed", W.heldBecause.escalationFailed);
95
95
  // (3) internally-inconsistent registration facts survive in the delivered report (A2). record-coverage
96
96
  // (an unverified/unfetched URL, E1) is flag-only — it cannot change the answer, it just isn't confirmed.
97
97
  const ids = (lintFailingIds || []).map(String);
98
- if (ids.includes('registry-record-match')) push('lint:registry-record-match', 'a registration detail in the report does not match its official record');
99
- if (ids.includes('registry-arithmetic')) push('lint:registry-arithmetic', 'the registration counts in the report do not add up');
98
+ if (ids.includes('registry-record-match')) push('lint:registry-record-match', W.heldBecause.recordMismatch);
99
+ if (ids.includes('registry-arithmetic')) push('lint:registry-arithmetic', W.heldBecause.countsDoNotAddUp);
100
100
  // (3b) A1 — a finding the reviewer WITHDREW still appears on a delivered surface after the
101
101
  // redo attempts (ids are per-ordinal: correction-consistency:<ord> / :client:<ord>): the reader
102
102
  // would see a conflict the review already killed.
103
- if (ids.some((id) => id.startsWith('correction-consistency:'))) push('lint:correction-consistency', 'a conflict the reviewer withdrew still appears in the deliverable — the correction did not stick');
103
+ if (ids.some((id) => id.startsWith('correction-consistency:'))) push('lint:correction-consistency', W.heldBecause.withdrawnStillShown);
104
104
  // (3c) ION/copper-foundry (2026-07-22): the deliverable states a search tool was blocked/permission-denied.
105
105
  // That is not a disclosed gap — it is a false explanation for one, and it excused count-only sampling over
106
106
  // high-volume owner queries. It CANNOT be flag-only: a lawyer reading "the tool was blocked" reads
@@ -116,13 +116,13 @@ export function evaluateClientGate({ coverage = [], lintFailingIds = [], escalat
116
116
  // by-design exclusion, and either way the coverage has to be re-established.
117
117
  const isPermissionProse = (id) => id === 'permission-prose' || id.startsWith('permission-prose:');
118
118
  if (ids.some((id) => isPermissionProse(id) && !id.startsWith('permission-prose:narrative')))
119
- push('lint:permission-prose', 'the deliverable explains missing coverage by saying a search tool was blocked or lacked permission — on this configuration that is normally a by-design exclusion rather than an outage, so both the explanation and the coverage it excuses must be re-established before this can be relied on');
119
+ push('lint:permission-prose', W.heldBecause.permissionProse);
120
120
  // (4) the machine findings could not be parsed — the data-driven surfaces are unverifiable.
121
- if (findingsError) push('findings-unreadable', `the results could not be read back to build the report`);
121
+ if (findingsError) push('findings-unreadable', W.heldBecause.findingsUnreadable);
122
122
  // (5) A3 — a malformed finding was quarantined (dropped from the rendered set): the client export must never
123
123
  // ship silently missing a finding, so it closes for review (the internal report shows the exclusion + the audit records it).
124
124
  if (Array.isArray(quarantined) && quarantined.length)
125
- push('finding-quarantined', `a result could not be read and had to be set aside, so the report would be missing it`);
125
+ push('finding-quarantined', W.heldBecause.findingQuarantined);
126
126
  // (6) — A PUBLISH INPUT WAS NOT THERE AT ALL. Distinct from (4): findingsError means the file was
127
127
  // present and could not be read back, this means it was never there, and until this arm existed the
128
128
  // second case set no signal whatsoever — an absent findings.json produced findings=[]/coverage=[] and
@@ -135,7 +135,7 @@ export function evaluateClientGate({ coverage = [], lintFailingIds = [], escalat
135
135
  // the recording above it is what actually does the work today.
136
136
  const closing = requiredAbsent(inputsAbsent);
137
137
  if (closing.length)
138
- push('publish-input-absent', `a required input to this report was not there (${closing.join(', ')}) — the report was built without it, which is not the same as a search that found nothing`);
138
+ push('publish-input-absent', W.heldBecause.inputAbsent(closing.join(', ')));
139
139
  return { released: reasons.length === 0, reasons, reasonCodes, inputsAbsent: [...(Array.isArray(inputsAbsent) ? inputsAbsent : [])], notClosing: nonClosingAbsences(inputsAbsent) }; // `notClosing` EXPLAINS a recorded absence that did not hold the release (publish-inputs.mjs nonClosingAbsences) — it decides nothing
140
140
  }
141
141
 
@@ -203,7 +203,7 @@ const INDEX_CSS = `
203
203
  th{background:var(--crimson-deep);color:#f0e8d8;font-size:11px;letter-spacing:.08em;text-transform:uppercase}
204
204
  tr:last-child td{border-bottom:none}
205
205
  .b{display:inline-block;color:#fff;font-weight:700;font-size:12px;padding:2px 9px;border-radius:999px}
206
- .b-mh,.b-l3{background:var(--h-amber)}.b-l4{background:var(--crimson)}.b-l2{background:var(--h-green)}.b-l1{background:var(--h-grey)}
206
+ .b-clear{background:var(--clear);color:var(--clear-on)}.b-low,.b-l2{background:var(--low);color:var(--low-on)}.b-med,.b-mh,.b-l3{background:var(--med);color:var(--med-on)}.b-high,.b-l4{background:var(--high);color:var(--high-on)}.b-severe{background:var(--severe);color:var(--severe-on)}.b-l1{background:var(--h-grey)}
207
207
  .stmt{display:block;margin-top:3px;font-size:11.5px;color:var(--muted,#6b5d50);max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
208
208
  .hold{display:inline-block;background:var(--crimson);color:#fff;font-weight:700;font-size:11px;padding:1px 7px;border-radius:999px;margin-left:6px} .disc{display:inline-block;border:1px solid var(--line);color:var(--muted);font-size:11px;padding:1px 7px;border-radius:999px;margin-left:6px}
209
209
  .hpill{display:inline-block;color:#fff;font-weight:700;font-size:11.5px;padding:3px 11px;border-radius:999px;white-space:nowrap}
@@ -251,7 +251,7 @@ function indexRows(runs, { reportFile, linkPrefix = '', showAudit = true, client
251
251
  <td>${matterCell}</td>
252
252
  <td>${anonMark(r.title, { key: ck, run: r.runId })}</td>
253
253
  <td>${anonClient(r.client, ck)}</td>
254
- <td><span class="b b-${attrValue(r.badge)}">${esc(r.overall)}</span>${qcFailed ? ' <span class="hold" title="machine QC checks failed — see the audit workbook">⚠ QC</span>' : ''}${!client && !qcFailed && r.clientGate?.inputsAbsent?.length ? ` <span class="disc" title="${escAttr(`published without ${r.clientGate.inputsAbsent.join(', ')} — each declared optional, so the release stands; the report was built without it`)}">◦ built without an input</span>` : ''}${
254
+ <td><span class="b b-${attrValue(bandClassOf(r))}">${esc(r.overall)}</span>${qcFailed ? ' <span class="hold" title="machine QC checks failed — see the audit workbook">⚠ QC</span>' : ''}${!client && !qcFailed && r.clientGate?.inputsAbsent?.length ? ` <span class="disc" title="${escAttr(`published without ${r.clientGate.inputsAbsent.join(', ')} — each declared optional, so the release stands; the report was built without it`)}">◦ built without an input</span>` : ''}${
255
255
  // The report's own conclusion beside the band pill (ruled 2026-09-22: the report is the master),
256
256
  // never a second summary. A meta.json written before the caption was kept shows the pill alone:
257
257
  // its stored statement could say "on hold", which was never true. The pill carries the rating,
@@ -285,9 +285,9 @@ function clientFilterBar(clients) {
285
285
  // per-customer indexes — customer/generic already holds >20 runs). Ships `hidden`: no-JS pages degrade to
286
286
  // the flat, fully-visible table with no dead buttons.
287
287
  const PAGER_BAR = `<div class="pager" id="pager" hidden>
288
- <button type="button" id="pgPrev">&#8249; Prev</button>
288
+ <button type="button" id="pgPrev">&#8249; ${IX.previous}</button>
289
289
  <span class="pcount" id="pcount"></span>
290
- <button type="button" id="pgNext">Next &#8250;</button>
290
+ <button type="button" id="pgNext">${IX.next} &#8250;</button>
291
291
  </div>`;
292
292
 
293
293
  // Report search — a text box that filters rows by their content (matter, project, verdict, date), composing
@@ -295,9 +295,9 @@ const PAGER_BAR = `<div class="pager" id="pager" hidden>
295
295
  // PAGER_SCRIPT reveals it only when the table is large enough to warrant searching (>8 rows). Emitted on every
296
296
  // index (staff + per-customer), so it scales the client-facing matter history to many reports.
297
297
  const SEARCH_BAR = `<div class="filterbar" id="repSearchBar" hidden>
298
- <label class="flbl" for="repSearch">Search</label>
299
- <input id="repSearch" type="search" placeholder="Filter by matter, project or verdict…" autocomplete="off" aria-label="Filter reports">
300
- <span class="nomatch" id="repNoMatch" hidden>No matching reports</span>
298
+ <label class="flbl" for="repSearch">${IX.search}</label>
299
+ <input id="repSearch" type="search" placeholder="${IX.searchPlaceholder}" autocomplete="off" aria-label="${IX.searchLabel}">
300
+ <span class="nomatch" id="repNoMatch" hidden>${IX.noMatch}</span>
301
301
  </div>`;
302
302
 
303
303
  // One apply() = filter-then-page. Rows are queried LAZILY on every pass (the parse-time cache was the
@@ -333,9 +333,9 @@ if(!bar)return;
333
333
  bar.hidden=!paged&&!active;
334
334
  prev.hidden=next.hidden=!paged;
335
335
  prev.disabled=page<=1;next.disabled=page>=P;
336
- var t=paged?(a+1)+"\\u2013"+b+" of "+M:String(M);
337
- if(active)t+=" shown";
338
- if(active&&fold)t+=" \\u00b7 "+fold+" retired";
336
+ var t=paged?(a+1)+"\\u2013"+b+${JSON.stringify(IX.of)}+M:String(M);
337
+ if(active)t+=${JSON.stringify(IX.shown)};
338
+ if(active&&fold)t+=" \\u00b7 "+fold+${JSON.stringify(IX.retired)};
339
339
  cnt.textContent=(active||paged)?t:"";
340
340
  }
341
341
  if(sbar&&document.querySelectorAll("tr[data-client]").length>8)sbar.hidden=false;
@@ -361,7 +361,7 @@ ${TEXT_FONT_STYLE}${FAVICON_LINK}${client ? THEME_INIT_EXPLICIT : THEME_INIT}
361
361
  ${SEARCH_BAR}
362
362
  ${filter}
363
363
  <table>
364
- <tr><th>Matter</th><th>Project</th><th>Client</th><th>Overall</th><th>Run</th>${auditCol ? '<th>Audit</th>' : ''}</tr>
364
+ <tr><th>${IX.columns.matter}</th><th>${IX.columns.project}</th><th>${IX.columns.client}</th><th>${IX.columns.overall}</th><th>${IX.columns.run}</th>${auditCol ? `<th>${IX.columns.audit}</th>` : ''}</tr>
365
365
  ${rows}
366
366
  </table>
367
367
  ${PAGER_BAR}
@@ -484,8 +484,8 @@ export function regenIndex(poolDir) {
484
484
  // on the audit workbook now and decide nothing about who may read. The precedent is the knockout
485
485
  // lane's own collapse note: two renderings of one run is how the wrong link gets sent.
486
486
  writeFileSync(cidx, indexPage({
487
- heading: `Trademark clearance — ${displayOf.get(key) || key}`,
488
- sub: `${crs.length} report(s) for this account · access-controlled · noindex.`,
487
+ heading: IX.heading(displayOf.get(key) || key),
488
+ sub: IX.subheading(crs.length),
489
489
  rows: indexRows(crs, { reportFile: 'report.html', linkPrefix: '../../', showAudit: false, client: true }),
490
490
  auditCol: false,
491
491
  theme: 'client', // explicit-light: toggle only, NO @media auto-dark on a customer page
@@ -860,13 +860,7 @@ export async function readClearanceDocument({ runId, reportMd, auditMd, findings
860
860
  // which publishes without one: the throw left publishReport at `published → null` and the runner
861
861
  // exited 1. Reading from the report's own directory is also the right answer for a republish.
862
862
  const recallStore = readStore(runDir ?? dirname(reportMd), '_driver/register-recall.json');
863
- const undispatchedProbes = (recallReceiptForOwnCompany(recallStore.value)?.overflow ?? []) // never another company's remembered conflict
864
- .filter((o) => o && (o.term || o.qid))
865
- .map((o) => ({
866
- area: String(o.term ?? o.qid),
867
- state: 'not-searched',
868
- note: `over the cap, never dispatched (${String(o.qid ?? 'no probe id recorded')})`,
869
- }));
863
+ const undispatchedProbes = undispatchedProbeRows(recallReceiptForOwnCompany(recallStore.value)); // never another company's remembered conflict
870
864
  if (recallStore.state === 'damaged' && runDir) {
871
865
  try {
872
866
  runLog(runDir, { event: 'probe-over-cap-unreadable', store: recallStore.name, error: recallStore.error });
@@ -954,6 +948,14 @@ export async function readClearanceDocument({ runId, reportMd, auditMd, findings
954
948
  // rendering worldwide runs have always had: chips from the coverage ledger and the findings' own
955
949
  // regions — the citation focus, which is exactly what the worldwide notes beneath them promise.
956
950
  if (scopeBasis === 'worldwide') searchedJurisdictions = [];
951
+ // THE REGISTER SERVICE'S REACH, as the run recorded it when it stamped the coverage line (scope-facts.mjs): the
952
+ // service and how many offices it searched. Read, never recomputed, so a republish states what the line states.
953
+ // Null when the run recorded none, which is every run before the record and every service with no office list.
954
+ let registerReach = null;
955
+ {
956
+ const r = readStore(runDir ?? dirname(reportMd), '_driver/scope-facts.json').value?.register_reach;
957
+ if (typeof r?.service === 'string' && r.service && Number.isInteger(r.offices) && r.offices > 0) registerReach = { service: r.service, offices: r.offices };
958
+ }
957
959
  // T7 (E5) — the case-law layer joins DETERMINISTICALLY (was: a prompt fished in the md and
958
960
  // hit 2 of 3 copper-spire cards): parse the grounded profiles, join by ordinal (fresh runs dictate
959
961
  // "- ord:") falling back to mark/owner (archived runs) — every matched card gets its strand.
@@ -1092,12 +1094,12 @@ export async function readClearanceDocument({ runId, reportMd, auditMd, findings
1092
1094
  } catch { /* no frozen profile — a legacy run keeps its wording */ }
1093
1095
 
1094
1096
  // Jurisdiction line for the Summary — searched register scope + the common-law surface layer.
1095
- const regScope = (searchedJurisdictions && searchedJurisdictions.length) ? searchedJurisdictions.join('/') : 'Worldwide';
1097
+ const regScope = (searchedJurisdictions && searchedJurisdictions.length) ? searchedJurisdictions.join('/') : W.jurisdictionLine.worldwide;
1096
1098
  const jurisdiction = registerOnly
1097
- ? `${regScope} (register only — no common-law / marketplace search)`
1099
+ ? W.jurisdictionLine.registerOnly(regScope)
1098
1100
  : noMarketplacesPicked
1099
- ? `${regScope} (register) + common-law (Western web / social, plus any stores chosen for this matter)`
1100
- : `${regScope} (register) + common-law (Western web / marketplace / social)`;
1101
+ ? W.jurisdictionLine.noMarketplaces(regScope)
1102
+ : W.jurisdictionLine.withCommonLaw(regScope);
1101
1103
 
1102
1104
  // Common-law URL-join: a grid hit whose candidate URL resolves to a finding's own link PROVES that search
1103
1105
  // term became a finding (rescues an anchor term whose finding wears a different name). Best-effort; absent
@@ -1285,7 +1287,7 @@ export async function readClearanceDocument({ runId, reportMd, auditMd, findings
1285
1287
  quarantined, findingsError, coverageJudgment, markAssessment, actionsRegister, askAnswers, correctionsDoc,
1286
1288
  fourAnswers, findingsSchemaVersion, findingsKept, assessmentNotCompleted, coverageJudgmentDisplay, recordsByUri,
1287
1289
  runProviderConf, recordOrigin, providerLabel, runOrigins, seniorRights, verdictInfo, droppedConditions,
1288
- undispatchedProbes, withheldFamilies, setAside, framework, frameworkMethod, scopeBasis, searchedJurisdictions,
1290
+ undispatchedProbes, withheldFamilies, setAside, framework, frameworkMethod, scopeBasis, searchedJurisdictions, registerReach,
1289
1291
  planTerritories, caseLawByOrdinal, caseLawNotice, enforcerSignals, officeLinks, reviewReceipts, clientGate,
1290
1292
  fetchState, searchPolicy, registerOnly, noMarketplacesPicked, jurisdiction, commonLawJoinedTerms, stageLabel,
1291
1293
  depthNote, productName, publishParts, auditParsed, degradedRows, releasedFamilies, served, searchDepth, issuedAt,
@@ -1332,7 +1334,7 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1332
1334
  findingsKept, assessmentNotCompleted, coverageJudgmentDisplay, recordsByUri, runProviderConf, recordOrigin, providerLabel,
1333
1335
  runOrigins, seniorRights, verdictInfo, droppedConditions, undispatchedProbes, withheldFamilies, setAside, framework,
1334
1336
  frameworkMethod, scopeBasis, searchedJurisdictions, planTerritories, caseLawByOrdinal, caseLawNotice, enforcerSignals,
1335
- officeLinks, reviewReceipts, clientGate, fetchState, searchPolicy, registerOnly, jurisdiction, commonLawJoinedTerms,
1337
+ officeLinks, reviewReceipts, clientGate, fetchState, searchPolicy, registerOnly, jurisdiction, commonLawJoinedTerms, registerReach,
1336
1338
  stageLabel, depthNote, productName, publishParts, auditParsed, degradedRows, releasedFamilies, served, searchDepth,
1337
1339
  issuedAt, renderedAt, markName, project, organisation, tokenRollup, reportRoute, frozenStageLabel, ratingWord,
1338
1340
  ratingBadge, caption } = doc;
@@ -1358,7 +1360,7 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1358
1360
  // the same rule (the workbook's own BANNED gate had already started firing on the raw detail —
1359
1361
  // advisory, so CI stayed green). reviewReceipts.lint keeps its raw detail for the internal
1360
1362
  // readers above (fetchState reads registry-record-coverage's URIs out of it).
1361
- const built = await buildAudit({ degradedParts: degradedRows, droppedConditions, undispatchedProbes, withheldFamilies, releasedFamilies, setAside, findings, frameworkMethod, coverage, contextNotes, coverageJudgment, markAssessment, corrections: correctionsDoc, fetchState, verdict: verdictInfo, jurisdiction, commonLawJoinedTerms, registerOnly, clientGate, lintFailures: deliveryFlagLines(reviewReceipts.lint), productName, registerPublishesRecordPages: runOrigins == null ? null : runOrigins.length > 0, recordLinks: officeLinks?.byUri ?? null, assessmentNotCompleted }, auditParsed, at, fm.title, fm);
1363
+ const built = await buildAudit({ degradedParts: degradedRows, droppedConditions, undispatchedProbes, withheldFamilies, releasedFamilies, setAside, findings, frameworkMethod, coverage, contextNotes, coverageJudgment, markAssessment, corrections: correctionsDoc, fetchState, verdict: verdictInfo, jurisdiction, commonLawJoinedTerms, registerOnly, clientGate, lintFailures: deliveryFlagLines(reviewReceipts.lint), productName, registerPublishesRecordPages: runOrigins == null ? null : runOrigins.length > 0, recordLinks: officeLinks?.byUri ?? null, assessmentNotCompleted, registerReach }, auditParsed, at, fm.title, fm);
1362
1364
  if (built?.gateViolations?.length) console.warn(`[audit-workbook] advisory: ${built.gateViolations.join(' | ')}`);
1363
1365
  return built;
1364
1366
  })); // a REAL exception only — the report ships without the workbook, and nothing names it
@@ -1369,19 +1371,13 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1369
1371
  // caveat banner (H1/H2); the receipts live on audit.xlsx. The machine QC above decides nothing
1370
1372
  // about this write.
1371
1373
  // homeHref — the floating "← All reports" pill returns to the listing (the staff index one level up).
1372
- // The floating cross-page nav on the INTERNAL report too (jump to Archive/Status from a report).
1373
- // '../' prefix — a report lives one level down at <pool>/<runId>/report.html; existence-gating stays poolRoot-
1374
- // absolute. portal-report.mjs strips the nav at serve time (it lists every customer key).
1375
- // anon:false — the demo-privacy toggle is a STAFF-INDEX feature (its __ANON__ config + overlay JS are
1376
- // injected there only); on a report page the button rendered "Privacy ON" while doing nothing. Omit it
1377
- // rather than wire the overlay in: client names saturate privileged report prose — a partial blur is a
1378
- // worse demo than no toggle.
1379
- const reportNav = siteNav(poolRoot, 'report', null, '../', { anon: false });
1374
+ // NO SITE NAV IS BUILT FOR A REPORT. One was, from a walk of the pool on every publish, and handed to a
1375
+ // renderer that never read it; reports published before that carry one, and the portal still strips it.
1380
1376
  // How much was read to reach the answer, written where the document holds it (an additive record: a publish never
1381
1377
  // fails for want of it).
1382
1378
  if (searchDepth) { try { writeRO('search-depth.json', JSON.stringify(searchDepth, null, 2)); } catch { /* additive */ } }
1383
1379
 
1384
- writeRO('report.html', renderHtml(parsed, findings, coverage, { demoData, frameworkMethod, servedModels: served, productName, depthNote, scopeBasis, auditFile: auditFile || undefined, runId, delivery: deliv, recordsByUri, contextNotes, coverageJudgment: coverageJudgmentDisplay, markAssessment, fourAnswers, homeHref: '../index.html', nav: reportNav, chromeHref: '../assets/chrome.css', issued, asOf, verdictInfo, framework, searchedJurisdictions, planTerritories, caseLawByOrdinal, caseLawNotice, enforcerSignals, recordOrigin, recordOrigins: runOrigins, recordCitation: runProviderConf?.recordCitation ?? null, recordLinks: officeLinks?.byUri ?? null, providerLabel, seniorRights, findingsSchemaVersion, searchDepth, assessmentNotCompleted }));
1380
+ writeRO('report.html', renderHtml(parsed, findings, coverage, { demoData, frameworkMethod, servedModels: served, productName, depthNote, scopeBasis, auditFile: auditFile || undefined, runId, delivery: deliv, recordsByUri, contextNotes, coverageJudgment: coverageJudgmentDisplay, markAssessment, fourAnswers, homeHref: '../index.html', chromeHref: '../assets/chrome.css', issued, asOf, verdictInfo, framework, searchedJurisdictions, planTerritories, caseLawByOrdinal, caseLawNotice, enforcerSignals, recordOrigin, recordOrigins: runOrigins, recordCitation: runProviderConf?.recordCitation ?? null, recordLinks: officeLinks?.byUri ?? null, providerLabel, seniorRights, findingsSchemaVersion, searchDepth, assessmentNotCompleted }));
1385
1381
  // ONE report (spec 2026-07-30 §5): report.client.html is no longer written. The knockout lane's own
1386
1382
  // collapse note is the precedent: "two renderings of one run is how the wrong link gets sent". The
1387
1383
  // client host serves the same report.html through the portal's readReport() (cleaning built in) — its
@@ -1391,9 +1387,8 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1391
1387
  // had to be passed to BOTH renders. There is one render now, so `fourAnswers` rides the one call — the
1392
1388
  // panel reaches the client through the same cleaning path as every other reader-facing block.
1393
1389
  // PR-9 — the clearance run as data (publish/report-data.mjs): the client-cut projection the assistant
1394
- // drafts mail from and the portal's native-render path reads. BEST-EFFORT with a hard receipt rule:
1395
- // meta.reportSchema is stamped ONLY when the file actually wrote — a run whose meta advertises a data
1396
- // file that is not there would break the portal's presence branch. A producer throw never blocks the
1390
+ // drafts mail from. BEST-EFFORT with a hard receipt rule: meta.reportSchema is stamped ONLY when the file
1391
+ // actually wrote, so a meta never names a data file that is not there. A producer throw never blocks the
1397
1392
  // report (the baked HTML above is already on disk).
1398
1393
  const reportSchema = writeDataFile('report-data.json', () => clearanceReportData({
1399
1394
  runId, codename, matter: fm.matter, markName, title: fm.title, customerKey: customerKey || 'generic',
@@ -1408,7 +1403,7 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1408
1403
  framework, verdictInfo, findings, coverage, contextNotes, markAssessment, fourAnswers, askAnswers,
1409
1404
  actions: actionsRegister, jurisdiction, searchedJurisdictions, scopeBasis, caption,
1410
1405
  assessmentNotCompleted,
1411
- })) ? 'report-data/1' : null;
1406
+ })) ? 'report-data/clearance-1' : null;
1412
1407
  const total = finishPoolRun({ writeRO, poolRoot, skipRegen, regenIndex, meta: {
1413
1408
  runId, codename: codename || '', matter: fm.matter, title: fm.title, client: fm.client,
1414
1409
  // The mark as typed — see above. Distinct from `title`, which is the report's own headline.
@@ -1476,9 +1471,9 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1476
1471
  clientGate: { released: clientGate.released, reasons: clientGate.reasons,
1477
1472
  inputsAbsent: clientGate.inputsAbsent?.length ? clientGate.inputsAbsent : undefined, notClosing: clientGate.notClosing?.length ? clientGate.notClosing : undefined,
1478
1473
  evaluationError: clientGate.evaluationError ?? undefined },
1479
- // PR-9 — present ⇒ report-data.json is beside the report and the portal can render natively (the
1480
- // same stamp the knockout lane writes; the consumer branch had readers before it had a writer).
1481
- // undefined on a producer miss, so the meta never advertises a file that is not there.
1474
+ // PR-9 — present ⇒ report-data.json is beside the report, in the shape the string names
1475
+ // (`report-data/clearance-1`; a Knockout stamps `report-data/knockout-1`). undefined on a producer
1476
+ // miss, so the meta never advertises a file that is not there.
1482
1477
  reportSchema: reportSchema ?? undefined,
1483
1478
  } });
1484
1479
  await refreshStaffPages({ regenSurfaces, poolRoot, skipRegen, runDir });
@@ -1499,12 +1494,13 @@ const BADGE_EMOJI = { l4: '🔴', l3: '🟠', mh: '🟠', l2: '🟢', l1: '⚪'
1499
1494
  // config, NOT a literal: this string was hardcoded, so the 2026-07-17 repo split rewrote it to a
1500
1495
  // example.com domain and both 2026-07-19 deliveries told the reader to sign in with an account that
1501
1496
  // does not exist. Unset ⇒ NO note: silence beats confidently wrong sign-in instructions.
1497
+ import { EMAIL, CLIENT_INDEX as IX, WORKBOOK as W } from './strings.mjs'; // kept down here, below every line the tree cites in this file by number
1502
1498
  export function accessNoteMd(domain = config.accessDomain) {
1503
- return domain ? `*Access-controlled — sign in with a **${domain}** account. Reply to this email with any questions.*` : '';
1499
+ return domain ? `*${EMAIL.accessNote(`**${domain}**`)}*` : '';
1504
1500
  }
1505
1501
  export function accessNoteHtml(font, domain = config.accessDomain) {
1506
1502
  return domain
1507
- ? `<p style="${font};font-size:9.5pt;color:#7a8290;margin:14px 0 0"><i>Access-controlled — sign in with a <b>${domain}</b> account. Reply to this email with any questions.</i></p>`
1503
+ ? `<p style="${font};font-size:9.5pt;color:${EC.quiet};margin:14px 0 0"><i>${EMAIL.accessNote(`<b>${domain}</b>`)}</i></p>`
1508
1504
  : '';
1509
1505
  }
1510
1506
 
@@ -1654,14 +1650,14 @@ export function composeEmailBody(reportMdPath, url, auditFile, productName = nul
1654
1650
 
1655
1651
  // A scannable meta line — only the fields that are present.
1656
1652
  const meta = [
1657
- fm.client && `**Client:** ${fm.client}`,
1658
- fm.classes && `**Classes:** ${fm.classes}`,
1659
- fm.run && `**Basis:** ${fm.run}`,
1653
+ fm.client && `**${EMAIL.client}** ${fm.client}`,
1654
+ fm.classes && `**${EMAIL.classes}** ${fm.classes}`,
1655
+ fm.run && `**${EMAIL.basis}** ${fm.run}`,
1660
1656
  ].filter(Boolean).join(' · ');
1661
1657
 
1662
1658
  const links = [
1663
- url && `[**▶ Open the full report**](${url})`,
1664
- auditUrl && `[Download audit (Excel)](${auditUrl})`,
1659
+ url && `[**${EMAIL.openReport}**](${url})`,
1660
+ auditUrl && `[${EMAIL.downloadAudit}](${auditUrl})`,
1665
1661
  ].filter(Boolean).join(' · ');
1666
1662
 
1667
1663
  return [
@@ -1686,9 +1682,9 @@ export function composeEmailBody(reportMdPath, url, auditFile, productName = nul
1686
1682
  // failure mode here was a pointer written before its target, and one true sentence beats two where
1687
1683
  // the second is a promise. When a surface exists that renders open floors in client language, this is
1688
1684
  // where the pointer to it belongs.
1689
- fm.envelope_note ? `**Search scope:** Some scoped searches remained open at delivery.` : '',
1685
+ fm.envelope_note ? `**${EMAIL.scopeLabel}** ${EMAIL.scopeOpen}` : '',
1690
1686
  fm.overall_label
1691
- ? `${dot} **Overall risk: ${fm.overall_label}**${fm.overall_caption ? `\n\n${fm.overall_caption}` : ''}`
1687
+ ? `${dot} **${EMAIL.overallRisk} ${fm.overall_label}**${fm.overall_caption ? `\n\n${fm.overall_caption}` : ''}`
1692
1688
  : '',
1693
1689
  meta || '',
1694
1690
  links || '',
@@ -1708,37 +1704,55 @@ export function composeEmailBody(reportMdPath, url, auditFile, productName = nul
1708
1704
  // ---------------------------------------------------------------------------------------------------
1709
1705
  const FONT = "font-family:Calibri,'Segoe UI',Arial,sans-serif";
1710
1706
 
1711
- // 5-tier reporting-template risk scheme — the whole left "NAME / RISK RATING" cell takes the bg colour.
1712
- // Matches skills/clearance-search/templates/search-request-form.html + knockout-searches/template-formatting.md.
1707
+ // 5-tier risk scheme on the report's ramp (shared/brand.mjs EMAIL_TIER) — the whole left "NAME / RISK RATING"
1708
+ // cell takes the bg colour, and `txt` colours a band's word on a light ground.
1713
1709
  // `txt` = a readable text-colour version of the tier (for the EXECUTIVE SUMMARY risk phrase, where a bright
1714
1710
  // fill like yellow/red is unreadable as text). Order matters: VERY HIGH before HIGH.
1711
+ const tier = (t, label) => ({ bg: t.bg, fg: t.fg, label, txt: t.txt });
1715
1712
  export const RISK_TIERS = [
1716
- [/VERY[\s-]?HIGH/, { bg: '#ff0000', fg: '#fff', label: 'VERY HIGH', txt: '#d10000' }],
1717
- [/HIGH/, { bg: '#ED7D31', fg: '#fff', label: 'HIGH', txt: '#c75b13' }],
1718
- [/MEDIUM/, { bg: '#ffff00', fg: '#000', label: 'MEDIUM', txt: '#9a8400' }],
1719
- [/MANAGEABLE/, { bg: '#70AD47', fg: '#fff', label: 'MANAGEABLE', txt: '#4e7a31' }],
1720
- [/LOW/, { bg: '#4472C4', fg: '#fff', label: 'LOW', txt: '#2f55a4' }],
1713
+ [/VERY[\s-]?HIGH/, tier(EMAIL_TIER.veryHigh, 'VERY HIGH')],
1714
+ [/HIGH/, tier(EMAIL_TIER.high, 'HIGH')],
1715
+ [/MEDIUM/, tier(EMAIL_TIER.medium, 'MEDIUM')],
1716
+ [/MANAGEABLE/, tier(EMAIL_TIER.manageable, 'MANAGEABLE')],
1717
+ [/LOW/, tier(EMAIL_TIER.low, 'LOW')],
1721
1718
  ];
1722
1719
  // doc 50 — the run's band LADDER (from opts.bands / meta.framework.bands): per-run vocabulary with the
1723
1720
  // same template palette keyed by TONE, so "Moderate" (house) and "Medium" (a customer ladder) both colour correctly
1724
1721
  // and a 5-band matrix framework (incl. "Low") lands on the same ramp. Set per compose; null = legacy.
1725
1722
  let EMAIL_BANDS = null;
1723
+ // THE INDEX'S BAND PILL TAKES THE REPORT'S RAMP: the run's band, its tone on the run's own frozen ladder, then
1724
+ // that tone's stop (2026-11-18). A run recorded before its ladder was kept falls back to its badge, a coarser
1725
+ // step: l2 reads as the low stop, l3 as medium, l4 as high, and l1, no rated band, stays grey.
1726
+ function bandClassOf(r) {
1727
+ const word = String(r?.overall ?? '').trim().toLowerCase();
1728
+ const tone = (Array.isArray(r?.framework?.bands) ? r.framework.bands : []).find((b) => String(b?.label ?? '').toLowerCase() === word)?.tone;
1729
+ return BAND_BY_TONE[tone] ?? r?.badge;
1730
+ }
1726
1731
  export const TONE_TIER = {
1727
- severe: { bg: '#ff0000', fg: '#fff', txt: '#d10000' },
1728
- high: { bg: '#ED7D31', fg: '#fff', txt: '#c75b13' },
1729
- medium: { bg: '#ffff00', fg: '#000', txt: '#9a8400' },
1730
- low: { bg: '#70AD47', fg: '#fff', txt: '#4e7a31' },
1731
- minimal: { bg: '#4472C4', fg: '#fff', txt: '#2f55a4' },
1732
+ severe: EMAIL_TIER.veryHigh,
1733
+ high: EMAIL_TIER.high,
1734
+ medium: EMAIL_TIER.medium,
1735
+ low: EMAIL_TIER.manageable,
1736
+ minimal: EMAIL_TIER.low,
1732
1737
  };
1738
+ /**
1739
+ * The gaps-sheet rows for the recall probes a run left over the cap. The probe id is the engine's: it stays in the
1740
+ * receipt and the run record, and the cell gets nothing in its place.
1741
+ */
1742
+ export function undispatchedProbeRows(receipt) {
1743
+ return (receipt?.overflow ?? [])
1744
+ .filter((o) => o && (o.term || o.qid))
1745
+ .map((o) => ({ area: String(o.term ?? o.qid), state: 'not-searched', note: W.overTheCap }));
1746
+ }
1733
1747
  export function riskTier(word) {
1734
1748
  const u = String(word || '').toUpperCase();
1735
1749
  if (EMAIL_BANDS) {
1736
1750
  const b = EMAIL_BANDS.find((x) => String(x.label).toUpperCase() === u);
1737
1751
  if (b) return { ...(TONE_TIER[b.tone] ?? TONE_TIER.medium), label: u };
1738
1752
  }
1739
- if (/NO RATED CONFLICTS/.test(u)) return { bg: '#4472C4', fg: '#fff', label: u, txt: '#2f55a4' };
1753
+ if (/NO RATED CONFLICTS/.test(u)) return tier(EMAIL_TIER.low, u);
1740
1754
  for (const [re, t] of RISK_TIERS) if (re.test(u)) return t;
1741
- return { bg: '#bfbfbf', fg: '#000', label: u || '—', txt: '#555' };
1755
+ return tier(EMAIL_TIER.unrated, u || '—');
1742
1756
  }
1743
1757
  // minimal inline markdown -> HTML for a table cell (escape FIRST; drop any stray internal ::p:: defensively)
1744
1758
  function cell(s) {
@@ -1805,8 +1819,8 @@ export function composeEmailHtml(reportMdPath, url, auditFile, names = [], deliv
1805
1819
  // this goes with it.
1806
1820
  // The report link rides HIGH — right under the bottom line in the headline, not buried below the table.
1807
1821
  const reportLink = hrefAttr(url)
1808
- ? `<p style="margin:0 0 10px"><a href="${hrefAttr(url)}" style="color:#1a4fd6;font-weight:bold;font-size:12pt;text-decoration:none">▶ Open the full report</a>`
1809
- + (hrefAttr(auditUrl) ? ` &nbsp;·&nbsp; <a href="${hrefAttr(auditUrl)}" style="color:#3b4fd6;text-decoration:none">Download audit (Excel)</a>` : '')
1822
+ ? `<p style="margin:0 0 10px"><a href="${hrefAttr(url)}" style="color:${EC.reportLink};font-weight:bold;font-size:12pt;text-decoration:none">${EMAIL.openReport}</a>`
1823
+ + (hrefAttr(auditUrl) ? ` &nbsp;·&nbsp; <a href="${hrefAttr(auditUrl)}" style="color:${EC.auditLink};text-decoration:none">${EMAIL.downloadAudit}</a>` : '')
1810
1824
  + `</p>`
1811
1825
  : '';
1812
1826
  // The search-scope signal leads the email. The 2026-06-12 "lint flags do not render on the email" rule
@@ -1823,7 +1837,7 @@ export function composeEmailHtml(reportMdPath, url, auditFile, names = [], deliv
1823
1837
  // are one message in two renderings, and a client reading the HTML must not be told something the
1824
1838
  // markdown does not say.
1825
1839
  const flagBanner =
1826
- (fm.envelope_note ? `<p style="margin:0 0 6px"><b>Search scope:</b> Some scoped searches remained open at delivery.</p>` : '');
1840
+ (fm.envelope_note ? `<p style="margin:0 0 6px"><b>${EMAIL.scopeLabel}</b> ${EMAIL.scopeOpen}</p>` : '');
1827
1841
 
1828
1842
  // ONE report (spec 2026-07-30 §6): the "Not client-ready — for your review only" block is deleted with
1829
1843
  // the two-bit delivery it narrated. The cover note is a cover note — verdict, one-line summary, link —
@@ -1886,12 +1900,12 @@ export function composeEmailHtml(reportMdPath, url, auditFile, names = [], deliv
1886
1900
  // held — and before that the delivery gate's word. It now quotes the report: the rating, then the
1887
1901
  // report's own conclusion (below), and where the report names what only the client can close, those
1888
1902
  // items under the report's own heading. Nothing here composes a sentence of its own.
1889
- const closeBox = (items) => `<p style="margin:0 0 8px;padding:8px 10px;background:#fdeeee;border:1px solid #c98a86;color:#6e1512"><b>Only you can close these</b><br>${items.map((r) => `• ${cell(String(r))}`).join('<br>')}</p>`;
1903
+ const closeBox = (items) => `<p style="margin:0 0 8px;padding:8px 10px;background:${EC.closeBoxFill};border:1px solid ${EC.closeBoxLine};color:${EC.closeBoxText}"><b>${EMAIL.onlyYouCanClose}</b><br>${items.map((r) => `• ${cell(String(r))}`).join('<br>')}</p>`;
1890
1904
  const verdictBound = opts?.verdict === 'CONDITIONAL'
1891
- ? closeBox(emailConditions.length ? emailConditions : ['the open items set out in the report, before relying on a clean result'])
1905
+ ? closeBox(emailConditions.length ? emailConditions : [EMAIL.onlyYouCanCloseDefault])
1892
1906
  : opts?.verdict === 'BLOCKING' && emailConditions.length ? closeBox(emailConditions) : '';
1893
1907
 
1894
- const reviewHeadline = `<div style="${FONT};font-size:11pt;color:#1a1a2e;margin:0 0 14px">`
1908
+ const reviewHeadline = `<div style="${FONT};font-size:11pt;color:${EC.headline};margin:0 0 14px">`
1895
1909
  + flagBanner
1896
1910
  + verdictBound
1897
1911
  + `<p style="margin:0 0 8px"><b>${[opts?.productName ? esc(String(opts.productName)) : '', esc(fm.title || '')].filter(Boolean).join(' — ')} (${esc(fm.matter || '')})</b></p>`
@@ -1899,12 +1913,12 @@ export function composeEmailHtml(reportMdPath, url, auditFile, names = [], deliv
1899
1913
  // model-authored fm label — one authority on every surface. The rating leads, then the report's own
1900
1914
  // conclusion verbatim (ruling 244); with no rating recorded, the conclusion stands alone.
1901
1915
  + ((opts?.tier ?? fm.overall_label)
1902
- ? `<p style="margin:0 0 6px"><b>Overall risk: ${esc(opts?.tier ?? fm.overall_label)}.</b> ${cell(fm.overall_caption || '')}</p>`
1916
+ ? `<p style="margin:0 0 6px"><b>${EMAIL.overallRisk} ${esc(opts?.tier ?? fm.overall_label)}.</b> ${cell(fm.overall_caption || '')}</p>`
1903
1917
  : (fm.overall_caption ? `<p style="margin:0 0 6px">${cell(fm.overall_caption)}</p>` : ''))
1904
1918
  + reportLink
1905
- + (fm.handling_note ? `<p style="margin:0 0 8px;color:#7a2b12"><b>Handling note:</b> ${cell(fm.handling_note)}</p>` : '')
1906
- // T9 (K3): methodology identity — which profile/framework rated this run (+ verifiable sha).
1907
- + (fm.rated_under ? `<p style="margin:0 0 6px;font-size:9.5pt;color:#7a8290">Rated under: ${cell(fm.rated_under)}</p>` : '')
1919
+ + (fm.handling_note ? `<p style="margin:0 0 8px;color:${EC.warning}"><b>${EMAIL.handlingNote}</b> ${cell(fm.handling_note)}</p>` : '')
1920
+ // No "Rated under" line: the report a client reads is cleaned of it, so the note covering it is too
1921
+ // (2026-11-18). The scale stays named on the report's gauge and in the run's record.
1908
1922
  // compute-don't-author (PR-4, review issue 2): the per-class register-coverage truth is computed
1909
1923
  // by the driver (scope-facts.mjs) and stamped as `coverage_line:` front-matter — but the frozen
1910
1924
  // report renderer only renders known keys, so without THIS line the join never reached a surface
@@ -1912,12 +1926,12 @@ export function composeEmailHtml(reportMdPath, url, auditFile, names = [], deliv
1912
1926
  // "Class 30: 76 of 99 slices fully searched — the remaining 23 are non-Latin script forms" (the
1913
1927
  // spec-B4 proportion form) rides beside the report link. Facts about what ran, never a caveat;
1914
1928
  // absent on legacy runs ⇒ byte-identical mail.
1915
- + (fm.coverage_line ? `<p style="margin:0 0 6px;font-size:9.5pt;color:#7a8290">Register coverage — ${cell(fm.coverage_line)}</p>` : '')
1929
+ + (fm.coverage_line ? `<p style="margin:0 0 6px;font-size:9.5pt;color:${EC.quiet}">${EMAIL.registerCoverage} ${cell(fm.coverage_line)}</p>` : '')
1916
1930
  // The WS1c "Model failover:" line stood here and is DELETED: no code path writes `failover_note`
1917
1931
  // into front-matter any more, because the model-failover chain that would have produced one never had a
1918
1932
  // second rung on any shipped build. Nothing renders a failover note into a report.
1919
1933
  // B5b checkpoint 4 — a customer named after the analysis was written ships as a delivery note, never silently.
1920
- + (fm.late_bind_note ? `<p style="margin:0 0 8px;color:#7a2b12"><b>Applicant named mid-run:</b> ${cell(fm.late_bind_note)}</p>` : '')
1934
+ + (fm.late_bind_note ? `<p style="margin:0 0 8px;color:${EC.warning}"><b>${EMAIL.applicantMidRun}</b> ${cell(fm.late_bind_note)}</p>` : '')
1921
1935
  // The reviewer's open points stood here, from the run record. They do not ride the cover any more
1922
1936
  // (owner ruling, 2026-10-01): the sentence naming the independent reviewer reads as a human declining
1923
1937
  // to sign, and the points themselves are the engine's own vocabulary. Both stay on the run, beside the
@@ -2020,8 +2034,8 @@ export function setAsideRows(runDir, { findings = null } = {}) {
2020
2034
  const ended = recordsOfDeliveredPositions(read('declination-spec.json')?.rows ?? [], [...findingUris(delivered.filter((f) => f?.disposition !== 'withdrawn')).keys()]);
2021
2035
  const label = (x) => [x.mark, x.owner].filter((v) => typeof v === 'string' && v.trim()).join(' — ') || x.uri;
2022
2036
  return [
2023
- ...[...d.byUri.entries()].filter(([u]) => !ended.has(u)).map(([, x]) => ({ area: `Set aside: ${label(x)}`, note: String(x.grounds ?? '') })),
2024
- ...[...d.byPage.values()].map((x) => ({ area: `Set aside: ${x.url ?? x.page}`, note: String(x.grounds ?? '') })),
2037
+ ...[...d.byUri.entries()].filter(([u]) => !ended.has(u)).map(([, x]) => ({ area: W.setAside(label(x)), note: String(x.grounds ?? '') })),
2038
+ ...[...d.byPage.values()].map((x) => ({ area: W.setAside(x.url ?? x.page), note: String(x.grounds ?? '') })),
2025
2039
  ];
2026
2040
  } catch { return []; }
2027
2041
  }