clearotron 0.7.0-beta.0 → 0.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +2 -2
- package/docs/architecture/04-configuration-reference.md +105 -8
- package/driver/CHANGELOG.md +38 -0
- package/driver/cancel.mjs +19 -0
- package/driver/contract-e3-backlog.mjs +40 -40
- package/driver/contract-vocabulary.mjs +1 -1
- package/driver/driver.config.mjs +1 -2
- package/driver/engine/session-record.mjs +44 -2
- package/driver/findings-model.mjs +14 -2
- package/driver/follow-up-twins.mjs +86 -0
- package/driver/gateway.mjs +10 -2
- package/driver/jx-units.mjs +3 -1
- package/driver/manuals-inline.mjs +98 -0
- package/driver/manuals-seen.mjs +4 -16
- package/driver/mark-logos.mjs +31 -1
- package/driver/owner-use-check.mjs +5 -1
- package/driver/package.json +1 -1
- package/driver/pipeline-knockout.mjs +19 -4
- package/driver/pipeline.mjs +36 -8
- package/driver/portal-report.mjs +2 -2
- package/driver/portal-runs.mjs +13 -7
- package/driver/predelivery-lint.mjs +7 -5
- package/driver/publish/email-conditions.mjs +20 -3
- package/driver/publish/index.mjs +218 -139
- package/driver/publish/knockout.mjs +252 -228
- package/driver/publish/pool-admin.mjs +2 -2
- package/driver/publish/regions.mjs +4 -0
- package/driver/publish/register-record-html.mjs +105 -0
- package/driver/publish/register-record.mjs +26 -11
- package/driver/publish/render-knockout.mjs +108 -33
- package/driver/publish/render.mjs +311 -149
- package/driver/publish/report-data.mjs +1 -1
- package/driver/publish/report-document.mjs +353 -0
- package/driver/publish/search-depth.mjs +88 -7
- package/driver/publish/shell.mjs +41 -1
- package/driver/publish/strings.mjs +152 -4
- package/driver/publish/templates/clearance-print.css +23 -0
- package/driver/publish/templates/knockout.css +24 -0
- package/driver/publish/templates/report.css +40 -1
- package/driver/publish/xlsx.mjs +16 -20
- package/driver/register-count.mjs +5 -1
- package/driver/registry-fidelity.mjs +152 -29
- package/driver/repair-composers.mjs +2 -2
- package/driver/replay-archive.mjs +4 -3
- package/driver/run-delivered.mjs +8 -7
- package/driver/run-record.mjs +1 -0
- package/driver/skills/clearance-search/report-prose.md +3 -0
- package/driver/skills/knockout-assess/SKILL.md +8 -0
- package/driver/stage-freshness.mjs +8 -5
- package/driver/stages.mjs +66 -40
- package/driver/steps/delivery.mjs +9 -5
- package/driver/steps/overview-and-cards.mjs +4 -1
- package/driver/steps/register-sweep.mjs +5 -4
- package/driver/steps/skeptic-and-follow-up.mjs +3 -2
- package/driver/steps/verdict-gate.mjs +2 -1
- package/driver/suite-census.json +224 -32
- package/driver/synthesis-record.mjs +4 -3
- package/driver/withdrawn-rating.mjs +72 -0
- package/mcp-server/CHANGELOG.md +4 -0
- package/mcp-server/lib/brief.mjs +4 -1
- package/mcp-server/lib/evidence.mjs +66 -22
- package/mcp-server/lib/findings.mjs +19 -2
- package/mcp-server/lib/knockout.mjs +12 -3
- package/mcp-server/package.json +1 -1
- package/mcp-server/server.mjs +19 -2
- package/package.json +1 -1
- package/portal-ui/dist/assets/{index-CtkllKJ2.js → index-BBlN4CYq.js} +13 -3
- package/portal-ui/dist/index.html +1 -1
- package/portal-ui/package.json +1 -1
- package/providers/jx/src/core.js +4 -4
- package/providers/jx/src/judge.js +1 -3
- package/providers/jx/src/nativeread.js +1 -3
- package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/scripts/added-reference-check.mjs +35 -7
- package/scripts/e2e-first-time.mjs +1 -1
- package/scripts/env-audit.mjs +16 -9
- package/scripts/mint-public-residue.mjs +3 -3
- package/shared/brand.mjs +8 -1
- package/shared/names-in-force.mjs +0 -1
- package/shared/reference-guard-classes.mjs +43 -2
- package/shared/source-spans.mjs +91 -0
|
@@ -32,11 +32,15 @@ import { COMMON_LAW, normRegion, regionName, REGION_NAMES } from './regions.mjs'
|
|
|
32
32
|
import { parseFindingsJson, bindRecommendation, sentenceCaseLead, CLIENT_TIER_BY_COMPOSITE, bandOf, compareBlockingPower, inDispositionMode, reasonedNegativeGroups } from '../findings-model.mjs';
|
|
33
33
|
import { REC, inPriorityWindow, ownerDisplayName } from '../registry-fidelity.mjs';
|
|
34
34
|
import { registrationSystem } from '../jurisdiction-systems.mjs';
|
|
35
|
-
import { REPORT_PAGE as R, RECORD_LINKS as LINK_WORDS } from './strings.mjs';
|
|
35
|
+
import { REPORT_PAGE as R, RECORD_LINKS as LINK_WORDS, KNOCKOUT_PAGE } from './strings.mjs';
|
|
36
36
|
import { READ_LEAD_RE } from '../report-card-record.mjs'; // D3 — the dedupe gate and the card's acceptance are ONE predicate
|
|
37
37
|
import { logoLockup, BRAND, confPosture, sectionStrip, PALETTE, QUADRANT_COLOURS as QC } from '../../shared/brand.mjs';
|
|
38
38
|
import { NAV_CSS } from '../../shared/site-nav.mjs';
|
|
39
39
|
import { pageShell } from './page-shell.mjs';
|
|
40
|
+
import { registerRecordView, RECORD_LABELS, registrationsCount } from './register-record.mjs';
|
|
41
|
+
import { recordEntryHtml, logoFigureHtml } from './register-record-html.mjs';
|
|
42
|
+
import { axisTwin, kindsForFollowUp } from '../follow-up-twins.mjs'; // when a written row stands in for a Follow-up row // a record entry and a logo, drawn once for both report pages
|
|
43
|
+
import { normalizeRecordUri } from '../registry-fidelity.mjs'; // the register's own record of a cited registration
|
|
40
44
|
import { readerRowHead } from '../coverage-ledger.mjs'; // an engine-token row head in the reader's words // the document shell, shared with the knockout template
|
|
41
45
|
import { EVIDENCE_LABEL, USE_EVIDENCE_LABEL, meterEvidence } from './evidence-words.mjs'; // the meters' evidence words, shared with the audit workbook
|
|
42
46
|
import { inlineMarkdown } from '../../shared/inline-markdown.mjs'; // the inline-markdown dialect, shared with the knockout template
|
|
@@ -106,12 +110,8 @@ let NEGATIVES_GROUPED = false;
|
|
|
106
110
|
// ladder, the footer names it. Absent ⇒ every legacy (composite) surface renders byte-identically.
|
|
107
111
|
let FRAMEWORK = null;
|
|
108
112
|
let FRAMEWORK_METHOD = null; // the frozen method (framework-method.mjs), where the framework states one
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
// the two blocks the design gives the full country alone. Module-level for the same reason FRAMEWORK is:
|
|
112
|
-
// fullDetail is reached through four call sites and threading a flag through all of them to reach one
|
|
113
|
-
// `if` is how the other three drift out of step.
|
|
114
|
-
let FULL_COUNTRY = false;
|
|
113
|
+
let AUDIT_HREF = null; // the audit workbook's address, for the line a capped list ends with; null when the run has none
|
|
114
|
+
let LOGOS = new Map(); // registration → its saved logo ({ state, src }); empty on a run that fetched none
|
|
115
115
|
const GAUGE_STOP_BY_TONE = { minimal: 1, low: 1, medium: 2, high: 3, severe: 4 };
|
|
116
116
|
// Severity rank for sorting/worst-of: band index in the manifest (0 = most severe); legacy composite
|
|
117
117
|
// negated so higher composite = lower rank. Unrated items sink to the bottom.
|
|
@@ -179,6 +179,7 @@ function ratingExtras(fm, findings, coverage, fourAnswers, opts, bandWord, condi
|
|
|
179
179
|
}
|
|
180
180
|
const fa = fourAnswers && typeof fourAnswers === 'object' ? fourAnswers : null;
|
|
181
181
|
if (fa) {
|
|
182
|
+
const shown = new Set((Array.isArray(findings) ? findings : []).map((f) => cardTarget(f?.ordinal)));
|
|
182
183
|
const rows = FOUR_ANSWER_LABELS.map(([key, label], i) => {
|
|
183
184
|
const a = fa[key];
|
|
184
185
|
if (!a || typeof a.read !== 'string' || !a.read.trim()) return '';
|
|
@@ -196,8 +197,11 @@ function ratingExtras(fm, findings, coverage, fourAnswers, opts, bandWord, condi
|
|
|
196
197
|
let tone = 'mid';
|
|
197
198
|
if (i < 2) tone = /weak|unlikely|none|low/.test(tok) ? 'good' : /strong|likely|high/.test(tok) ? 'bad' : 'mid';
|
|
198
199
|
else tone = /^(registrable|strong|clear)$/.test(tok) ? 'good' : /condition|moderate|medium|qualified|narrow/.test(tok) ? 'mid' : /not|weak|unlikely|blocked|obstructed/.test(tok) ? 'bad' : 'mid';
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
// A withdrawn finding renders nowhere, so its ordinal is not cited here either: the token would link to a card the
|
|
201
|
+
// page does not draw. `findings` arrives with the withdrawn ones already out.
|
|
202
|
+
const targets = (Array.isArray(a.ordinals) ? a.ordinals : []).map(cardTarget).filter((t) => t && shown.has(t));
|
|
203
|
+
const ords = targets.length
|
|
204
|
+
? ` <span class="fa-ords">${targets.map((t) => `<a href="#${t}">#${t.slice(1)}</a>`).join(' ')}</span>` : '';
|
|
201
205
|
const basis = a.basis ? inline(String(a.basis).trim()).trim() : '';
|
|
202
206
|
// THE PER-CLASS OBSTACLES RIDE WITH THE ANSWER THEY QUALIFY. An answer that reads "registrable with
|
|
203
207
|
// conditions" and does not say in which classes leaves the reader with the conclusion and none of
|
|
@@ -232,7 +236,6 @@ function ratingExtras(fm, findings, coverage, fourAnswers, opts, bandWord, condi
|
|
|
232
236
|
if (cleared) parts.push(R.rating.nearNamesCleared(cleared.toLocaleString('en-GB')));
|
|
233
237
|
const rated = findings.filter((f) => f && f.band).length;
|
|
234
238
|
parts.push(R.rating.conflicts(rated));
|
|
235
|
-
if (sd.counts.localScriptSearched) parts.push(R.rating.localScript);
|
|
236
239
|
const cd = sd.counts.courtDecisions;
|
|
237
240
|
if (cd === 'found') parts.push(R.rating.courtChecked);
|
|
238
241
|
else if (cd === 'none-found') parts.push(R.rating.courtNoneTouch);
|
|
@@ -310,6 +313,13 @@ function frameworkGauge(fm, findings, coverage = [], fourAnswers = null, opts =
|
|
|
310
313
|
|
|
311
314
|
const esc = s => String(s ?? '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
312
315
|
const escAttr = s => esc(s).replace(/"/g, '"');
|
|
316
|
+
// A finding's card is the page's `c<ordinal>` target when its ordinal is a whole number, the shape the page script
|
|
317
|
+
// reveals and scrolls to. An absent or malformed ordinal has no target: its card draws no id and nothing links to it.
|
|
318
|
+
const cardTarget = (ordinal) => {
|
|
319
|
+
const n = typeof ordinal === 'string' && /^[0-9]+$/.test(ordinal) ? Number(ordinal) : ordinal;
|
|
320
|
+
return Number.isSafeInteger(n) && n >= 0 ? `c${n}` : null;
|
|
321
|
+
};
|
|
322
|
+
const cardId = (f) => { const t = cardTarget(f?.ordinal); return t ? ` id="${t}"` : ''; };
|
|
313
323
|
|
|
314
324
|
// A floating "home" pill that returns to the listing from a report. FULLY INLINE-STYLED on purpose: it is
|
|
315
325
|
// emitted natively here AND injected into already-rendered reports (pool-admin link-home) whose frozen CSS
|
|
@@ -431,7 +441,7 @@ function sourceChip(st) {
|
|
|
431
441
|
function evidenceChips(f) {
|
|
432
442
|
const chips = [];
|
|
433
443
|
if ((f.owner?.registrations ?? []).length || /^register/.test(f.source?.source_type || '')) chips.push({ label: 'Register', cls: 'reg' });
|
|
434
|
-
if (f.use_check?.source || /^common-law/.test(f.source?.source_type || '')) chips.push({ label:
|
|
444
|
+
if (f.use_check?.source || /^common-law/.test(f.source?.source_type || '')) chips.push({ label: R.marketplaceWebChip, cls: 'cl' });
|
|
435
445
|
if (CASE_LAW_BY_ORD.has(f.ordinal)) chips.push({ label: 'Case-law', cls: 'cl' });
|
|
436
446
|
const use = f.meters?.use?.token;
|
|
437
447
|
if (use === 'confirmed') chips.push({ label: 'Use ✓', cls: 'reg' });
|
|
@@ -1152,6 +1162,46 @@ function courtLineFor(opts, state) {
|
|
|
1152
1162
|
return line;
|
|
1153
1163
|
}
|
|
1154
1164
|
|
|
1165
|
+
// The scripts' reader names, in the table's order, for ISO 15924 codes the search-depth record keeps.
|
|
1166
|
+
const scriptNames = (codes) => Object.entries(R.searched.scriptName).filter(([k]) => codes.includes(k)).map(([, name]) => name);
|
|
1167
|
+
// A territory as the page names it, alphabetically in a list; inside a sentence it takes the article English gives it
|
|
1168
|
+
// ("the United States"), from the phrases the Knockout page already prints.
|
|
1169
|
+
const territoryNames = (codes) => codes.map((c) => regionName(c)).sort((a, b) => a.localeCompare(b, 'en-GB'));
|
|
1170
|
+
const territoryPhrase = (c) => KNOCKOUT_PAGE.registerNames[c]?.phrase ?? regionName(c);
|
|
1171
|
+
const byPhrase = (codes) => [...codes].sort((a, b) => regionName(a).localeCompare(regionName(b), 'en-GB')).map(territoryPhrase);
|
|
1172
|
+
// A script searched somewhere that still has a gap: its record by script, in the table's order.
|
|
1173
|
+
const partlySearched = (ls) => Object.keys(R.searched.scriptName).filter((k) => (ls?.searched ?? []).includes(k) && ls?.territories?.[k]);
|
|
1174
|
+
// The script row under "What was searched": each script a search completed in, and for one whose planned worldwide search
|
|
1175
|
+
// did not complete, the places a narrower search in it did complete, where the record names them.
|
|
1176
|
+
function scriptsSearchedLine(ls) {
|
|
1177
|
+
return R.searched.scriptsSearched(Object.entries(R.searched.scriptName).filter(([k]) => ls.searched.includes(k)).map(([k, name]) => {
|
|
1178
|
+
const t = ls.territories?.[k];
|
|
1179
|
+
return t?.worldwide === 'missed' && t.searched.length ? R.searched.scriptIn(name, byPhrase(t.searched)) : name;
|
|
1180
|
+
}));
|
|
1181
|
+
}
|
|
1182
|
+
// THE LOCAL-SCRIPT ROWS UNDER LEFT OPEN, one per distinct gap (design, 2026-11-19, under the owner's delegation). The
|
|
1183
|
+
// scripts planned with no search completed anywhere share the approved sentence's one row. A script searched somewhere
|
|
1184
|
+
// keeps a row for each gap it still has: the territories where none of its searches completed, named up to three and
|
|
1185
|
+
// counted from four with the full list in `detail`; a planned worldwide search that did not complete; and a planned
|
|
1186
|
+
// search whose territory the plan did not record, unless a worldwide search in that script completed. No territory is
|
|
1187
|
+
// guessed, and a run with no execution record draws none of these.
|
|
1188
|
+
function scriptGapRows(ls) {
|
|
1189
|
+
if (!ls) return [];
|
|
1190
|
+
const row = (note, detail) => ({ area: R.searched.localScript, state: 'not-searched', note, ...(detail ? { detail } : {}) });
|
|
1191
|
+
const rows = [];
|
|
1192
|
+
const missed = scriptNames(ls.missed ?? []);
|
|
1193
|
+
if (missed.length) rows.push(row(R.searched.scriptsNotCompleted(missed)));
|
|
1194
|
+
for (const k of partlySearched(ls)) {
|
|
1195
|
+
const t = ls.territories[k], name = R.searched.scriptName[k];
|
|
1196
|
+
const gaps = Array.isArray(t.missed) ? t.missed : [];
|
|
1197
|
+
if (gaps.length > 3) rows.push(row(R.searched.scriptNotCompletedInCount(name, gaps.length.toLocaleString('en-GB')), territoryNames(gaps)));
|
|
1198
|
+
else if (gaps.length) rows.push(row(R.searched.scriptNotCompletedIn(name, byPhrase(gaps))));
|
|
1199
|
+
if (t.worldwide === 'missed') rows.push(row(R.searched.worldwideNotCompleted(name)));
|
|
1200
|
+
if (t.unnamed === 'missed' && t.worldwide !== 'searched') rows.push(row(R.searched.territoryNotRecorded(name)));
|
|
1201
|
+
}
|
|
1202
|
+
return rows;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1155
1205
|
// Counts only, folded closed. A count of records read is engine activity rather than something a reader
|
|
1156
1206
|
// acts on (owner, 2026-09-16), so it lives here and not beside the outcome per country.
|
|
1157
1207
|
// THE OPEN ROWS STAY ON THE PAGE, and that is deliberate rather than a leftover of the old fold. The
|
|
@@ -1162,7 +1212,6 @@ function courtLineFor(opts, state) {
|
|
|
1162
1212
|
// reader's own words, with the counts — never the query text, the refusals or the provider faults.
|
|
1163
1213
|
function whatWasSearchedSection(opts, coverage = [], findings = [], recordsByUri = new Map(), fm = {}) {
|
|
1164
1214
|
const sd = opts && opts.searchDepth;
|
|
1165
|
-
const open = (Array.isArray(coverage) ? coverage : []).filter((c) => COV_STATE[c?.state]?.cls !== 'ok');
|
|
1166
1215
|
const c = (sd && sd.counts) || {}, rows = [];
|
|
1167
1216
|
const places = placesSearched(fm, coverage, findings);
|
|
1168
1217
|
if (places.worldwide && places.focus) rows.push([R.searched.whereSearched, places.list]);
|
|
@@ -1194,7 +1243,10 @@ function whatWasSearchedSection(opts, coverage = [], findings = [], recordsByUri
|
|
|
1194
1243
|
? R.searched.checksWebAndStores(sw.checks.toLocaleString('en-GB'))
|
|
1195
1244
|
: R.searched.checksOnPlatforms(sw.checks.toLocaleString('en-GB'), sw.platforms)]);
|
|
1196
1245
|
if (sw.reputation) rows.push([R.searched.reputation, R.searched.checks(sw.reputation.toLocaleString('en-GB'))]);
|
|
1197
|
-
|
|
1246
|
+
// The local-script row says what the run's record shows ran (owner, 2026-11-19): the scripts a native-script search
|
|
1247
|
+
// completed in, by name, or not searched when the record shows none did, and no row when the run kept no execution
|
|
1248
|
+
// record to say either. The scripts planned with none completed are left open, in the grid below (`scriptGapRows`).
|
|
1249
|
+
if (c.localScripts) rows.push([R.searched.localScript, c.localScripts.searched.length ? scriptsSearchedLine(c.localScripts) : R.searched.notSearched]);
|
|
1198
1250
|
// HOW DEEP THE LOCAL-LANGUAGE INVESTIGATION WENT, which is a different question from the row above it.
|
|
1199
1251
|
// That one answers whether the spellings were searched; this one answers whether the investigation ran
|
|
1200
1252
|
// at the depth the matter configured. The engine can run it shallower than the account asked for, and
|
|
@@ -1238,7 +1290,8 @@ function whatWasSearchedSection(opts, coverage = [], findings = [], recordsByUri
|
|
|
1238
1290
|
const why = c.courtDecisions === 'not-checked' ? courtLineFor(opts, 'not-checked') : '';
|
|
1239
1291
|
rows.push(['Court decisions', { html: `<span class="wstate">${esc(cdWord)}</span>${why ? `<span class="wnote">${esc(why)}</span>` : ''}` }]);
|
|
1240
1292
|
}
|
|
1241
|
-
const
|
|
1293
|
+
const open = leftOpenRows({ coverage, localScripts: c.localScripts, followUpKinds: opts?.followUpKinds });
|
|
1294
|
+
const openHtml = open.length ? `<div class="openrows"><div class="rk">${R.searched.leftOpen}</div>${coverageGrid(open, { verdict: opts?.assessmentNotCompleted !== true, followUpKinds: opts?.followUpKinds })}</div>` : '';
|
|
1242
1295
|
// THE LEGEND FOR WHAT IS ON THE CARDS, kept when the scope fold went. It is not the engine narrating
|
|
1243
1296
|
// its own searching — it is what a linked registration number opens, why the rest are cited by number,
|
|
1244
1297
|
// and what a register-index entry means. A reader cannot read a card without it.
|
|
@@ -1280,7 +1333,7 @@ function alsoConsideredSection(ruledOut, recordsByUri = new Map(), opts = {}) {
|
|
|
1280
1333
|
const practical = f.practical_position ? inline(String(f.practical_position)) : '';
|
|
1281
1334
|
const fold = (legal || practical)
|
|
1282
1335
|
? `<details class="roff"><summary>${R.alsoConsidered.whyRuledOut}</summary>${legal ? `<p><b>${R.alsoConsidered.legal}</b> ${legal}</p>` : ''}${practical ? `<p><b>${R.alsoConsidered.practical}</b> ${practical}</p>` : ''}</details>` : '';
|
|
1283
|
-
return `<div class="card ruled"><div class="top"><div class="rail"></div><div class="body"><div class="cardhead">${
|
|
1336
|
+
return `<div class="card ruled"${cardId(f)}><div class="top"><div class="rail"></div><div class="body"><div class="cardhead">${
|
|
1284
1337
|
f.ordinal != null ? `<span class="fnum">${esc(String(f.ordinal))}</span>` : ''}<h3 class="who mark-first">${esc(f.mark || '')}</h3>${
|
|
1285
1338
|
who ? `<span class="cwho">${esc(who)}</span>` : ''}<span class="tier ruled">${R.alsoConsidered.ruledOut}</span><button class="ask-fi no-print">${R.alsoConsidered.askAi}</button></div><div class="oneline">${why}</div>${fold}</div></div></div>`;
|
|
1286
1339
|
}).join('');
|
|
@@ -1370,7 +1423,7 @@ function dedupeScatter(findings) {
|
|
|
1370
1423
|
|
|
1371
1424
|
// THE CHART'S NAME (owner, 2026-11-18). A screen reader met an unnamed drawing and then a run
|
|
1372
1425
|
// of "#1", "#2" links. The <title>, first in the <svg>, says what the drawing is; its count is the points drawn.
|
|
1373
|
-
const chartTitle =
|
|
1426
|
+
const chartTitle = R.chartTitle;
|
|
1374
1427
|
|
|
1375
1428
|
function quadrant(findings) {
|
|
1376
1429
|
const points = dedupeScatter(findings);
|
|
@@ -1381,9 +1434,10 @@ function quadrant(findings) {
|
|
|
1381
1434
|
const fill = on ? QC.onField : QC.secondary;
|
|
1382
1435
|
const X = cx.toFixed(1), Y = cy.toFixed(1), fs = on ? 12.5 : 8;
|
|
1383
1436
|
const inner = pending
|
|
1384
|
-
? `<circle cx="${X}" cy="${Y}" r="${r}" fill="${QC.pendingFill}" stroke="${fill}" stroke-width="2.5"/><text x="${X}" y="${Y}" text-anchor="middle" dominant-baseline="central" font-size="${fs}" font-weight="900" fill="${fill}">${f.ordinal}</text>`
|
|
1385
|
-
: `<circle cx="${X}" cy="${Y}" r="${r}" fill="${fill}" stroke="${PALETTE.ink}" stroke-opacity=".22" stroke-width="1"/><text x="${X}" y="${Y}" text-anchor="middle" dominant-baseline="central" font-size="${fs}" font-weight="900" fill="#fff">${f.ordinal}</text>`;
|
|
1386
|
-
|
|
1437
|
+
? `<circle cx="${X}" cy="${Y}" r="${r}" fill="${QC.pendingFill}" stroke="${fill}" stroke-width="2.5"/><text x="${X}" y="${Y}" text-anchor="middle" dominant-baseline="central" font-size="${fs}" font-weight="900" fill="${fill}">${esc(f.ordinal)}</text>`
|
|
1438
|
+
: `<circle cx="${X}" cy="${Y}" r="${r}" fill="${fill}" stroke="${PALETTE.ink}" stroke-opacity=".22" stroke-width="1"/><text x="${X}" y="${Y}" text-anchor="middle" dominant-baseline="central" font-size="${fs}" font-weight="900" fill="#fff">${esc(f.ordinal)}</text>`;
|
|
1439
|
+
const t = cardTarget(f.ordinal);
|
|
1440
|
+
return t ? `<a href="#${t}"><title>#${t.slice(1)}</title>${inner}</a>` : inner;
|
|
1387
1441
|
}).join('');
|
|
1388
1442
|
return `<div class="panel land">
|
|
1389
1443
|
<svg viewBox="0 0 560 430" xmlns="http://www.w3.org/2000/svg" font-family="Plus Jakarta Sans, sans-serif">
|
|
@@ -1423,7 +1477,8 @@ function keyRow(f, recordsByUri) {
|
|
|
1423
1477
|
if (who && nrm(who) !== nrm(f.mark)) subParts.push(esc(who));
|
|
1424
1478
|
if (cls) subParts.push(R.key.classes(esc(cls)));
|
|
1425
1479
|
if (src) subParts.push(`<span style="white-space:nowrap">${esc(src)}</span>`);
|
|
1426
|
-
|
|
1480
|
+
const t = cardTarget(f.ordinal);
|
|
1481
|
+
return `<a class="keyrow"${t ? ` href="#${t}"` : ''}><span class="kn" style="background:${kn}">${esc(f.ordinal)}</span><span class="kw"><span class="cm-mark">${esc(f.mark)}</span><em>${subParts.join(' · ')}</em></span><span class="kc ${kc}">${chip}</span><span class="arr">→</span></a>`;
|
|
1427
1482
|
}
|
|
1428
1483
|
|
|
1429
1484
|
// Rights-holder panel → cross-region groups (§2.3). Findings grouped by jurisdiction (region order = lowest
|
|
@@ -1453,8 +1508,12 @@ function keyPanel(findings, recordsByUri = new Map()) {
|
|
|
1453
1508
|
// + the dedicated Common-law & marketplace section carry the reading surface; a fully-open C/L list was
|
|
1454
1509
|
// the main driver of the key-panel height (doc-54 whitespace). Geographic regions: only the top
|
|
1455
1510
|
// (highest-risk) region opens; the rest collapse (doc-55).
|
|
1511
|
+
// The hint lands on the first common-law card the page draws, an on-field one before the rest, as the conflicts come
|
|
1512
|
+
// first. It linked to `#common-law`, which went with the section's heading on 2026-09-16 and left the link dead.
|
|
1513
|
+
const clFirst = cardTarget((findings.find((f) => regionCode(f) === COMMON_LAW && isOnField(f)) ?? clGroup?.findings[0])?.ordinal);
|
|
1514
|
+
const clLink = clFirst ? `<a href="#${clFirst}">${esc(R.key.commonLawSectionLink)}</a>` : esc(R.key.commonLawSectionLink);
|
|
1456
1515
|
const clBlock = clGroup
|
|
1457
|
-
? `<p class="keyhint" style="margin-top:10px">${R.key.commonLawHint(
|
|
1516
|
+
? `<p class="keyhint" style="margin-top:10px">${R.key.commonLawHint(clLink)}</p>${detail(clGroup, R.key.commonLawGroup, `<span style="white-space:nowrap">${R.key.unregisteredUse}</span>`, true)}`
|
|
1458
1517
|
: '';
|
|
1459
1518
|
return `<div class="panel keypanel">
|
|
1460
1519
|
<div class="label">${R.key.title}</div>
|
|
@@ -1480,7 +1539,7 @@ function commonLawSection(clSecondary, clOnField, cardFor, recordsByUri = new Ma
|
|
|
1480
1539
|
// Nothing is lost with it: the cards it linked to sit directly below.
|
|
1481
1540
|
if (!clSecondary.length && !clOnField.length) return '';
|
|
1482
1541
|
const links = clOnField.length
|
|
1483
|
-
? `<p class="clx" style="margin:4px 0 10px;font-size:13.5px">${R.onFieldCommonLaw}${clOnField.map(f => `<a href="
|
|
1542
|
+
? `<p class="clx" style="margin:4px 0 10px;font-size:13.5px">${R.onFieldCommonLaw}${clOnField.map(f => { const t = cardTarget(f.ordinal); return t ? `<a href="#${t}">#${t.slice(1)} ${esc(f.mark)}</a>` : esc(f.mark); }).join(' · ')}</p>`
|
|
1484
1543
|
: '';
|
|
1485
1544
|
const cards = clSecondary.map(f => compactCard(f, cardFor(f), recordsByUri)).join('\n ');
|
|
1486
1545
|
return links + cards;
|
|
@@ -1508,23 +1567,17 @@ function secondaryRegions(findings, cardFor, recordsByUri = new Map()) {
|
|
|
1508
1567
|
//
|
|
1509
1568
|
// The full card is not lost — each member is a <details> whose body is the same fullDetail block the
|
|
1510
1569
|
// compact card carries, so the drill-through is one click from the line.
|
|
1511
|
-
const GROUP_HEADING =
|
|
1512
|
-
distinguished: 'Argued apart on the mark',
|
|
1513
|
-
'coexistence-partner': 'Coexistence on the record',
|
|
1514
|
-
'off-field:different-field': 'A different commercial field',
|
|
1515
|
-
'off-field:no-material-risk': 'Clearly won',
|
|
1516
|
-
'off-field:unstated': 'Cleared — ground not stated on the record',
|
|
1517
|
-
};
|
|
1570
|
+
const GROUP_HEADING = R.setApart;
|
|
1518
1571
|
function negativeLine(f, recordsByUri) {
|
|
1519
1572
|
const who = recordOwner(f, recordsByUri) || f.owner?.name || '';
|
|
1520
1573
|
const regs = f.owner?.registrations || [];
|
|
1521
1574
|
const juris = [...new Set(regs.map(r => r.jurisdiction ? normRegion(r.jurisdiction) : null).filter(Boolean))].join(', ')
|
|
1522
|
-
|| (regionCode(f) === COMMON_LAW ?
|
|
1575
|
+
|| (regionCode(f) === COMMON_LAW ? R.commonLaw : normRegion(regionCode(f)));
|
|
1523
1576
|
const classes = [...new Set(regs.flatMap(r => Array.isArray(r.classes) ? r.classes : []))]
|
|
1524
1577
|
.map(Number).filter(x => !Number.isNaN(x)).sort((a, b) => a - b).join('/');
|
|
1525
1578
|
// Escaped per PART and joined with the entity, exactly as markClassChip does: a literal U+00A0 in
|
|
1526
1579
|
// source is invisible to a reader and to a grep, and esc() would turn a raw ` ` into `&nbsp;`.
|
|
1527
|
-
const facts = [esc(juris), classes ?
|
|
1580
|
+
const facts = [esc(juris), classes ? `${R.classesShort} ${esc(classes)}` : ''].filter(Boolean).join(' · ');
|
|
1528
1581
|
// The reason is the finding's OWN typed sentence, rendered whole like every other surface ( —
|
|
1529
1582
|
// there is no character budget any more). `net` stays OPTIONAL in the parser (an archived run has
|
|
1530
1583
|
// none), so the fallback is the finding's legal_position — which v6 DOES require on every negative.
|
|
@@ -1534,14 +1587,15 @@ function negativeLine(f, recordsByUri) {
|
|
|
1534
1587
|
const reason = clause(f.net) || clause(f.legal_position);
|
|
1535
1588
|
return `<span class="rn-mark">${esc(f.mark)}</span>${who ? `<span class="rn-who">${esc(who)}</span>` : ''}`
|
|
1536
1589
|
+ `${facts ? `<span class="rn-facts">${facts}</span>` : ''}`
|
|
1537
|
-
+ `${reason ? `<span class="rn-why">${inline(sentenceCaseLead(reason))}</span>` : ''}
|
|
1590
|
+
+ `${reason ? `<span class="rn-why">${inline(sentenceCaseLead(reason))}</span>` : ''}`
|
|
1591
|
+
+ logoLine(f, recordsByUri, { small: true });
|
|
1538
1592
|
}
|
|
1539
1593
|
function reasonedNegatives(groups, cardFor, recordsByUri) {
|
|
1540
1594
|
return groups.map(g => {
|
|
1541
1595
|
const members = g.findings.map(f =>
|
|
1542
|
-
`<details class="rgroup rn"><summary>${negativeLine(f, recordsByUri)}</summary><div class="gbody">${fullDetail(f, cardFor(f), recordsByUri)}</div></details>`
|
|
1596
|
+
`<details class="rgroup rn"${cardId(f)}><summary>${negativeLine(f, recordsByUri)}</summary><div class="gbody">${fullDetail(f, cardFor(f), recordsByUri)}</div></details>`
|
|
1543
1597
|
).join('\n ');
|
|
1544
|
-
return `<p class="fold-lead"><b>${esc(GROUP_HEADING[g.key] ?? g.key)}</b> (${esc(g.ground)}) — ${
|
|
1598
|
+
return `<p class="fold-lead"><b>${esc(GROUP_HEADING[g.key] ?? g.key)}</b> (${esc(g.ground)}) — ${R.marks(g.findings.length)}.</p>
|
|
1545
1599
|
${members}`;
|
|
1546
1600
|
}).join('\n ');
|
|
1547
1601
|
}
|
|
@@ -1645,11 +1699,11 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1645
1699
|
// link the number IS the link, and when there is not, the number still stands on its own. The
|
|
1646
1700
|
// workbook note stays: it tells a reader where the full record actually is.
|
|
1647
1701
|
const NO_LINK_NOTE = {
|
|
1648
|
-
workbook:
|
|
1702
|
+
workbook: R.detail.inWorkbook,
|
|
1649
1703
|
};
|
|
1650
1704
|
const regUri = (u, fb) => {
|
|
1651
1705
|
const h = regHref(u);
|
|
1652
|
-
const label = esc(u || fb ||
|
|
1706
|
+
const label = esc(u || fb || R.detail.registration);
|
|
1653
1707
|
if (hrefAttr(h)) return `<a href="${hrefAttr(h)}" target="_blank" rel="noopener noreferrer">${label}</a>`;
|
|
1654
1708
|
const note = RECORD_CITATION ? NO_LINK_NOTE[RECORD_CITATION] : null;
|
|
1655
1709
|
return note ? `${label}<span class="reg-nolink">${note}</span>` : label;
|
|
@@ -1665,62 +1719,27 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1665
1719
|
// failure's cause is the record's (the persisted failure list and the stamp keep it), never the card's:
|
|
1666
1720
|
// it can be an exception's message.
|
|
1667
1721
|
const fetchFailLine = f._recordFetchFailure
|
|
1668
|
-
? `<li class="openitem"><b
|
|
1722
|
+
? `<li class="openitem"><b>${R.detail.recordNotRetrieved}</b>${R.detail.detailsUnverified}</li>`
|
|
1669
1723
|
: '';
|
|
1670
1724
|
const regs = (f.owner?.registrations || []).map(r => {
|
|
1671
1725
|
const uri = String(r.uri || '').toLowerCase();
|
|
1672
1726
|
const rec = uri ? recordsByUri.get(uri) : null;
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
const jur = r.jurisdiction || rec.jurisdiction || '';
|
|
1679
|
-
const ids = [appNum && `app. ${appNum}`, regNum && `reg. ${regNum}`].filter(Boolean).join(', ');
|
|
1680
|
-
const dates = [filingYear && `filed ${filingYear}`, regYear && `registered ${regYear}`].filter(Boolean).join(', ');
|
|
1681
|
-
const tail = [ids, dates].filter(Boolean).join('; ');
|
|
1682
|
-
// A5 (senior lawyer) — an international (WIPO/Madrid) registration's rights reach ONLY its
|
|
1683
|
-
// designated countries. A WO line NAMES them from the fetched record, or states honestly that
|
|
1684
|
-
// the record did not carry them — never lets "international" imply worldwide.
|
|
1685
|
-
const isWO = normRegion(jur) === 'WO' || /\/mark\/wo\//i.test(uri);
|
|
1686
|
-
const desig = isWO ? REC.designations(rec) : null;
|
|
1687
|
-
const desigHtml = !isWO ? ''
|
|
1688
|
-
: (desig ? ` · designating: ${esc(desig.join(', '))}`
|
|
1689
|
-
: ` · <i>designated countries not on the fetched record — rights reach only its designations</i>`);
|
|
1690
|
-
// C1 — the jurisdiction's registration system, labeled from DATA (unknown = unlabeled)
|
|
1691
|
-
const sys = registrationSystem(jur);
|
|
1692
|
-
// C2 — an application inside the 6-month Paris-priority window can be re-filed
|
|
1693
|
-
// elsewhere claiming THIS date; flag it so a fresh local filing is never read as local-only.
|
|
1694
|
-
const prio = AS_OF && inPriorityWindow(rec, AS_OF)
|
|
1695
|
-
? ` · <b>recent filing — Paris-priority window (potential global backdating)</b>` : '';
|
|
1696
|
-
// WP-receipts W2 — the PROVABLE verified label: when the record artifact carries its fetch
|
|
1697
|
-
// receipt (_receipt, embedded at assembly), say what was pulled and when — replacing the
|
|
1698
|
-
// "file exists on disk" inference. Absent receipt (archived runs) renders nothing.
|
|
1699
|
-
const receiptTail = rec._receipt?.fetched_at
|
|
1700
|
-
? ` · <i class="receipt">verified — ${esc(PROVIDER_LABEL || 'register')} record fetched ${esc(String(rec._receipt.fetched_at).slice(0, 10))}</i>` : '';
|
|
1701
|
-
// AS REGISTERED, AND THE DATES — the full country's two extra blocks (the 2026-09-16 report redesign). Both come
|
|
1702
|
-
// off the fetched record and neither is composed: the goods are the register's own wording in the
|
|
1703
|
-
// language it granted them in, and the dates are its own, to the day. The one-line summary above
|
|
1704
|
-
// carries YEARS, which cannot say whether a registration lapses this month.
|
|
1705
|
-
const goods = FULL_COUNTRY ? REC.goods(rec) : null;
|
|
1706
|
-
const recDates = FULL_COUNTRY ? REC.dates(rec) : null;
|
|
1707
|
-
const goodsHtml = !goods ? '' : `<div class="row"><span class="k">As registered</span><span class="v">${
|
|
1708
|
-
goods.map((g) => `${g.classes.length ? `${esc(g.classes.length === 1 ? 'Class' : 'Classes')} ${esc(g.classes.join(', '))}: ` : ''}${esc(g.description)}`).join('<br>')}</span></div>`;
|
|
1709
|
-
const datesHtml = !recDates ? '' : `<div class="row"><span class="k">Dates</span><span class="v">${
|
|
1710
|
-
esc(recDates.map(([k, v]) => `${k} ${v}`).join(' \u00b7 '))}</span></div>`;
|
|
1711
|
-
return `<li><b>${officeRecordCell(r.uri, regUri, RECORD_CITATION ? NO_LINK_NOTE[RECORD_CITATION] : null)}</b>${cls ? ` · Cl.${esc(cls)}` : ''}${status ? ` · ${esc(status)}` : ''}${tail ? ` (${esc(tail)})` : ''}${jur ? ` · ${esc(jur)}${sys ? ` <i class="jsys">(${sys})</i>` : ''}` : ''}${desigHtml}${prio}${receiptTail}${goodsHtml || datesHtml ? `<div class="record">${goodsHtml}${datesHtml}</div>` : ''}</li>`;
|
|
1712
|
-
}
|
|
1727
|
+
// A FETCHED RECORD IS NOT A LINE HERE ANY MORE. Its facts open the card as the register's own record, in
|
|
1728
|
+
// registerRecordBlock below, before this analysis; a line here would state them twice. What stays in Full
|
|
1729
|
+
// detail is what has no record to show: an index-only citation, and the back-compat render of a run that
|
|
1730
|
+
// fetched no records at all.
|
|
1731
|
+
if (rec) return '';
|
|
1713
1732
|
// (2)+(3): a cited record with NO fetched body. NEVER-INVENT when the run has a record set (this URI was
|
|
1714
1733
|
// not fetched ⇒ the model's fields are unconfirmed); also when there are no findings.json facts to show.
|
|
1715
1734
|
if (uri && (hasRecordSet || !(r.status || r.filed || r.expiry || (r.classes && r.classes.length)))) {
|
|
1716
1735
|
// wp50/wi7 + B3: this is a register-INDEX entry (the search saw it and enumerated it); no field
|
|
1717
1736
|
// renders as confirmed. What "register-index entry" means is stated once, in Scope — not per row.
|
|
1718
|
-
return `<li><b>${regUri(r.uri)}</b> <i
|
|
1737
|
+
return `<li><b>${regUri(r.uri)}</b> <i>${R.detail.indexEntry}</i></li>`;
|
|
1719
1738
|
}
|
|
1720
1739
|
// (3) back-compat field render — byte-identical to the prior behaviour for the no-record-set case
|
|
1721
1740
|
const dates = [r.filed && `filed ${r.filed}`, r.expiry && `expiry ${r.expiry}`].filter(Boolean).join(', ');
|
|
1722
1741
|
const cls = (r.classes || []).length ? ` · Cl.${r.classes.join('/')}` : '';
|
|
1723
|
-
return `<li><b>${regUri(r.uri,
|
|
1742
|
+
return `<li><b>${regUri(r.uri, R.detail.registration)}</b>${cls}${r.status ? ` · ${esc(r.status)}` : ''}${dates ? ` (${esc(dates)})` : ''}${r.jurisdiction ? ` · ${esc(r.jurisdiction)}` : ''}</li>`;
|
|
1724
1743
|
}).join('');
|
|
1725
1744
|
// CHANGE 5b — the enforcer basis line. verified-from-record stays stated as FACT (an enforcement record is
|
|
1726
1745
|
// on file). inferred-from-signal is rendered as an EXPLICIT inference — reputation/profile only, NO
|
|
@@ -1747,8 +1766,8 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1747
1766
|
const enfSrc = enf && String(enf.source ?? '').trim();
|
|
1748
1767
|
const enfBasis = enf
|
|
1749
1768
|
? (enfVerified
|
|
1750
|
-
? `<li><b
|
|
1751
|
-
: `<li><b
|
|
1769
|
+
? `<li><b>${R.meters.likelyToEnforce}.</b> ${esc(R.detail.appetite(humanize(enf.token)))} — <b>${R.detail.verified}</b> (${enfSrc ? esc(R.detail.source(enfSrc.slice(0, 60))) : R.detail.enforcementOnFile}).</li>`
|
|
1770
|
+
: `<li><b>${R.meters.likelyToEnforce}.</b> ${esc(R.detail.appetite(humanize(enf.token)))} <i>${R.detail.inferred}</i>${R.detail.profileSignal}</li>`)
|
|
1752
1771
|
: '';
|
|
1753
1772
|
// Instance #5 — the use-check / own-rights cite is rendered FROM the JSON (no prose-regex), so it can never
|
|
1754
1773
|
// diverge from the structured field. The source string may hold ONE URL, SEVERAL (comma/space-separated —
|
|
@@ -1762,7 +1781,7 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1762
1781
|
if (!src) return '';
|
|
1763
1782
|
// D4 — the status is LABELLED as what it is. A bare "· not yet verified" hung off the end of a
|
|
1764
1783
|
// cite with nothing saying which of the two facts on the line it qualified.
|
|
1765
|
-
const stat = status ? ` <i class="evstat"
|
|
1784
|
+
const stat = status ? ` <i class="evstat">${esc(R.evidence(status))}</i>` : '';
|
|
1766
1785
|
const urls = (String(src).match(/https?:\/\/[^\s,|]+/g) || []).map(u => u.replace(/[).,;:]+$/, ''));
|
|
1767
1786
|
if (!urls.length) return `<li><b>${label}</b> ${esc(src)}${stat}</li>`;
|
|
1768
1787
|
const links = urls.map(u => (hrefAttr(u) ? `<a href="${hrefAttr(u)}" target="_blank" rel="noopener noreferrer">${esc(u.replace(/^https?:\/\//, '').slice(0, 48))}</a>` : esc(u))).join(' · ');
|
|
@@ -1779,8 +1798,8 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1779
1798
|
// found. Evidence: inferred", and "inferred" beside "no result" reads as a contradiction: it qualifies
|
|
1780
1799
|
// how a FINDING was established, and there is no finding here. Nothing was found, and that is the
|
|
1781
1800
|
// whole of what the line has to say.
|
|
1782
|
-
const useChk = cite(useSrc,
|
|
1783
|
-
const ownR = cite(f.own_rights?.source,
|
|
1801
|
+
const useChk = cite(useSrc, R.detail.useChecked, isUseCheckNoResult(f.use_check?.source) ? null : useStatus);
|
|
1802
|
+
const ownR = cite(f.own_rights?.source, R.detail.ownMarks, EVIDENCE_LABEL[f.own_rights?._status]);
|
|
1784
1803
|
const proseFull = cardBlock(card, /^full detail/i);
|
|
1785
1804
|
const proseFullShown = proseFull; // one report: the full prose; portal-report strips serve-time chrome, never analysis
|
|
1786
1805
|
const internalNote = cardBlock(card, /^full detail/i) ? '' : ''; // internal notes ride ::p:: inside prose
|
|
@@ -1796,7 +1815,7 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1796
1815
|
.map((r) => ({ r, sig: ENFORCER_SIGNALS.get(String(r.uri ?? '').toLowerCase()) }))
|
|
1797
1816
|
.filter((x) => x.sig && (x.sig.aggression != null || x.sig.oppositions))
|
|
1798
1817
|
.slice(0, 1)
|
|
1799
|
-
.map(({ r, sig }) => `<li><b
|
|
1818
|
+
.map(({ r, sig }) => `<li><b>${R.detail.telemetry}</b> ${R.detail.corsearchRecords}${sig.aggression != null ? R.detail.aggression(esc(String(sig.aggression))) : ''}${sig.aggression != null && sig.oppositions ? R.detail.and : ''}${sig.oppositions ? R.detail.oppositions(sig.oppositions) : ''}${R.detail.onOwnersRecord(`<span class="mono">${esc(String(r.uri ?? ''))}</span>`)}</li>`)
|
|
1800
1819
|
.join('');
|
|
1801
1820
|
// T7 (E5) — the grounded case-law strand, deterministically joined (ordinal / mark+owner).
|
|
1802
1821
|
// The honest no-precedent state renders too: an explicit negative is a result the lawyer relies on.
|
|
@@ -1804,7 +1823,7 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1804
1823
|
// doc-55 A3 (one-report form) — the strand renders its full body for the reviewing reader; ::p::-marked
|
|
1805
1824
|
// internal lines are handled by renderProse's stripInternal choke point, and serve-time client
|
|
1806
1825
|
// preparation is portal-report.mjs's job, never a second render fork here.
|
|
1807
|
-
const clHead = clProfile ? `<b
|
|
1826
|
+
const clHead = clProfile ? `<b>${R.detail.caseLaw}${clProfile.jurisdiction ? ` (${esc(clProfile.jurisdiction)})` : ''}.</b>` : '';
|
|
1808
1827
|
const clBody = !clProfile ? '' : renderProse(clProfile.body); // one report: the full body (renderProse handles ::p:: internal lines)
|
|
1809
1828
|
// Only a pass that FOUND precedent puts a strand on the card. Where none was found, or the research
|
|
1810
1829
|
// could not be completed, the body is the engine's account of the attempt and the Court decisions
|
|
@@ -1826,15 +1845,15 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1826
1845
|
const sr = SENIOR_RIGHTS.get(f.ordinal);
|
|
1827
1846
|
const seniorLine = !sr || !sr.applicable || sr.verified ? ''
|
|
1828
1847
|
: sr.seniorUri
|
|
1829
|
-
? `<li class="openitem"><b
|
|
1830
|
-
: `<li class="openitem"><b
|
|
1848
|
+
? `<li class="openitem"><b>${R.detail.openItem}</b>${R.detail.seniorNotPulled(regUri(sr.seniorUri))}</li>`
|
|
1849
|
+
: `<li class="openitem"><b>${R.detail.openItem}</b>${R.detail.seniorUnknown}</li>`;
|
|
1831
1850
|
// spec 64 — f.impact is code-rendered (it was prompted + validated but reached no reader surface on
|
|
1832
1851
|
// structured-only cards; the prompt-lane IMPACT bullet is retired so it renders exactly once). Stated
|
|
1833
1852
|
// as consequences FOR THE CLIENT TO CONSIDER, never a conclusion; suppressed when the card's own prose
|
|
1834
1853
|
// already carries an "If enforced" bullet (the reasoned read wins — the enfLine dedupe pattern).
|
|
1835
1854
|
const proseHasImpact = /(^|\n)\s*-\s*(\*\*)?\s*If enforced\b/i.test(proseFull || '');
|
|
1836
1855
|
const impactLine = (f.impact && !proseHasImpact)
|
|
1837
|
-
? `<li><b
|
|
1856
|
+
? `<li><b>${R.detail.ifEnforced}</b> ${esc(f.impact)}</li>` : ''; // its "— for the client to consider." tail is gone (owner, 2026-11-18)
|
|
1838
1857
|
// — THE REASONING LEADS THE DRAWER, and this is where it now lives. legal_position /
|
|
1839
1858
|
// practical_position and the manageable category used to render uncut ABOVE the fold on every card:
|
|
1840
1859
|
// roughly 600 characters of prose per finding before a reader opened anything, while the one sentence
|
|
@@ -1890,7 +1909,83 @@ function fullDetail(f, card, recordsByUri = new Map()) {
|
|
|
1890
1909
|
const proseHasRead = READ_LEAD_RE.test(proseFull || '');
|
|
1891
1910
|
const positions = `${proseHasRead ? '' : lpSplit(f)}${manageableLine(f)}`;
|
|
1892
1911
|
const body = `${positions}${regs || seniorLine || fetchFailLine || enfLine || enfTelemetry || useChk || ownR || impactLine ? `<ul>${fetchFailLine}${seniorLine}${regs}${enfLine}${enfTelemetry}${useChk}${ownR}${impactLine}</ul>` : ''}${proseFullShown ? renderProse(proseFullShown) : ''}${caseLawStrand}${prov}`;
|
|
1893
|
-
|
|
1912
|
+
// The register number of each record entry: the office's label as plain text, the text a handle-cited record shows,
|
|
1913
|
+
// and the page's own cell for a label. Where the run's office links do not name a record, the record still holds its
|
|
1914
|
+
// office number, and the row prints that, opening the record where its handle did, rather than the bare handle.
|
|
1915
|
+
const numberOf = (u, rec) => {
|
|
1916
|
+
const office = RECORD_LINKS?.get(String(u || '').toLowerCase())?.label ?? null;
|
|
1917
|
+
const own = office ? null : (officeRecordLink(rec, u)?.label ?? null);
|
|
1918
|
+
const note = RECORD_CITATION ? NO_LINK_NOTE[RECORD_CITATION] : null;
|
|
1919
|
+
return {
|
|
1920
|
+
label: office ?? own,
|
|
1921
|
+
fallbackText: u || 'registration',
|
|
1922
|
+
cell: (label) => {
|
|
1923
|
+
if (!own) return officeRecordCell(u, regUri, note, label);
|
|
1924
|
+
const h = hrefAttr(regHref(u));
|
|
1925
|
+
return h ? `<a href="${h}" target="_blank" rel="noopener noreferrer">${esc(label)}</a>` : esc(label);
|
|
1926
|
+
},
|
|
1927
|
+
};
|
|
1928
|
+
};
|
|
1929
|
+
const recordBlock = registerRecordBlock(f, recordsByUri, numberOf);
|
|
1930
|
+
return `${recordBlock}<details class="drill"><summary>${R.detail.fold}</summary><div class="drillbody">${body}</div></details>`;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
// THE REGISTER RECORD (owner, 2026-11-18). A reviewing lawyer checked every cited mark against the register by hand
|
|
1934
|
+
// before reading the analysis. Each cited registration whose record this run fetched now opens with the register's
|
|
1935
|
+
// own facts, in a closed drop-down placed before "Full detail": the mark and its type, the goods by class, the owner
|
|
1936
|
+
// and the owner's country, the country, the status with its dates, and the register number. Every fact is copied
|
|
1937
|
+
// from the saved record by registerRecordView; nothing here is composed by a model, and the words are the approved
|
|
1938
|
+
// labels and the report's own.
|
|
1939
|
+
//
|
|
1940
|
+
// THREE FACTS THE OLD LINE CARRIED KEEP THEIR WORDS AND MOVE TO THEIR ROW (design, 2026-11-19): an international
|
|
1941
|
+
// registration's designated countries, or the sentence saying the record did not carry them, and the registration
|
|
1942
|
+
// system go on the Country row; the Paris-priority flag goes beside the dates on the Status row, with its emphasis.
|
|
1943
|
+
//
|
|
1944
|
+
// AT MOST EIGHT ENTRIES, in the card's order, then the line that sends the reader to the audit workbook for all of
|
|
1945
|
+
// them (owner, 2026-11-18). A card citing dozens of registrations otherwise runs to pages.
|
|
1946
|
+
const RECORD_CAP = 8;
|
|
1947
|
+
function registerRecordBlock(f, recordsByUri, numberOf) {
|
|
1948
|
+
const cited = (f.owner?.registrations || [])
|
|
1949
|
+
.map((r) => ({ r, rec: r?.uri ? recordsByUri.get(String(r.uri).toLowerCase()) : null }))
|
|
1950
|
+
.filter((x) => x.rec);
|
|
1951
|
+
if (!cited.length) return '';
|
|
1952
|
+
const entries = cited.slice(0, RECORD_CAP).map(({ r, rec }) => recordEntry(f, r, rec, numberOf)).join('');
|
|
1953
|
+
const all = R.cleared.allInWorkbook(cited.length.toLocaleString('en-GB'));
|
|
1954
|
+
const more = cited.length > RECORD_CAP ? `<div class="cmore">${AUDIT_HREF ? `<a class="wb" href="${AUDIT_HREF}">${all}</a>` : all}</div>` : '';
|
|
1955
|
+
const count = cited.length > 1 ? ` <span class="rr-count">${esc(registrationsCount(cited.length))}</span>` : '';
|
|
1956
|
+
return `<details class="drill rr-drill"><summary>${esc(RECORD_LABELS.title)}${count}</summary><div class="drillbody">${entries}${more}</div></details>`;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
// LOGOS ON THE CARD, ON A LINE OF THEIR OWN (owner, 2026-11-18). Under the owner line, one logo per registration
|
|
1960
|
+
// in the card's register record whose logo the run saved, each in a box of one fixed size captioned with its
|
|
1961
|
+
// register, so nothing in the card head moves when a card has logos. A logo the run tried and failed to fetch reads
|
|
1962
|
+
// "Logo not retrieved" and opens the office's record; a registration with no logo, or one the run never asked
|
|
1963
|
+
// about, draws nothing, so a run that fetched no logos draws no line. A grouped negative row shows up to three small
|
|
1964
|
+
// logos and "+N" under its text. The image travels inside the report; nothing points at the register's image.
|
|
1965
|
+
function logoLine(f, recordsByUri, { small = false } = {}) {
|
|
1966
|
+
if (!LOGOS.size) return '';
|
|
1967
|
+
const figures = (f.owner?.registrations || [])
|
|
1968
|
+
.filter((r) => r?.uri && recordsByUri.get(String(r.uri).toLowerCase()))
|
|
1969
|
+
.slice(0, RECORD_CAP)
|
|
1970
|
+
.map((r) => {
|
|
1971
|
+
const rec = recordsByUri.get(String(r.uri).toLowerCase());
|
|
1972
|
+
const href = hrefAttr(RECORD_LINKS?.get(String(r.uri).toLowerCase())?.href) || hrefAttr(registerRecordView(rec, { uri: r.uri }).logo.href);
|
|
1973
|
+
return logoFigureHtml(rec, { uri: r.uri, logo: LOGOS.get(normalizeRecordUri(r.uri)), href, caption: !small });
|
|
1974
|
+
})
|
|
1975
|
+
.filter(Boolean);
|
|
1976
|
+
if (!figures.length) return '';
|
|
1977
|
+
if (!small) return `<div class="rr-logos rr-band">${figures.join('')}</div>`;
|
|
1978
|
+
return `<div class="rr-logos rr-sm">${figures.slice(0, 3).join('')}${figures.length > 3 ? `<span class="rr-more">+${figures.length - 3}</span>` : ''}</div>`;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
function recordEntry(f, r, rec, numberOf) {
|
|
1982
|
+
const uri = String(r.uri || '');
|
|
1983
|
+
const receipt = rec._receipt?.fetched_at
|
|
1984
|
+
? R.recordVerified(PROVIDER_LABEL || R.register, String(rec._receipt.fetched_at).slice(0, 10)) : null;
|
|
1985
|
+
// The owner by the card's own rule: a record's Latin owner is a romanisation when it also carries the native
|
|
1986
|
+
// form, and then the resolved name is the one a lawyer can read (recordOwner, above, decides the same way).
|
|
1987
|
+
const ownerName = ownerDisplayName({ raw: REC.owner(rec), native: REC.ownerNative(rec), resolved: f.owner?.name });
|
|
1988
|
+
return recordEntryHtml(rec, { uri, jurisdiction: r.jurisdiction, receipt, asOf: AS_OF, number: numberOf(uri, rec), ownerName });
|
|
1894
1989
|
}
|
|
1895
1990
|
|
|
1896
1991
|
// The contentious MARK + the classes it matched in, as a header chip next to the holder — so a card shows
|
|
@@ -1987,7 +2082,7 @@ function lpSplit(f) {
|
|
|
1987
2082
|
// (promote-or-omit; a category-less manageable finding is a lint flag upstream). Absent ⇒ ''.
|
|
1988
2083
|
// The category is a CLOSED code-owned vocabulary (esc is right for it); the reason is model-authored
|
|
1989
2084
|
// free prose and routes through inline() with the two positions above.
|
|
1990
|
-
const MANAGEABLE_LABEL =
|
|
2085
|
+
const MANAGEABLE_LABEL = R.manageable;
|
|
1991
2086
|
function manageableLine(f) {
|
|
1992
2087
|
const m = f.manageable;
|
|
1993
2088
|
if (!m || !m.category) return '';
|
|
@@ -2034,17 +2129,17 @@ function findingCard(f, card, recordsByUri = new Map()) {
|
|
|
2034
2129
|
const one = clause(f.net) || (card?.meta?.one) || oneFallback(f, who);
|
|
2035
2130
|
const readProse = cardBlock(card, /^the read$/i);
|
|
2036
2131
|
const read = readProse ? `<details class="drill read" open><summary>${R.card.theRead}</summary><div class="drillbody lead">${renderProse(readProse)}</div></details>` : '';
|
|
2037
|
-
return `<div class="card"
|
|
2132
|
+
return `<div class="card"${cardId(f)}>
|
|
2038
2133
|
<div class="top">
|
|
2039
2134
|
<div class="rail ${tierCls}"></div>
|
|
2040
2135
|
<div class="body">
|
|
2041
2136
|
<div class="cardhead">
|
|
2042
|
-
<label class="pick no-print"><input type="checkbox" class="pickbox" checked aria-label="${R.card.includeInPdf(f.ordinal)}"></label>
|
|
2043
|
-
<span class="fnum">${f.ordinal}</span>${cardTitleParts(f, who).title}${evidenceChips(f)}
|
|
2137
|
+
<label class="pick no-print"><input type="checkbox" class="pickbox" checked aria-label="${escAttr(R.card.includeInPdf(f.ordinal))}"></label>
|
|
2138
|
+
<span class="fnum">${esc(f.ordinal)}</span>${cardTitleParts(f, who).title}${evidenceChips(f)}
|
|
2044
2139
|
<span class="tier ${tierCls}">${riskChip(f)}</span>
|
|
2045
2140
|
<button class="ask-fi no-print">${R.card.askAi}</button>
|
|
2046
2141
|
</div>
|
|
2047
|
-
${cardTitleParts(f, who).ownerLine}
|
|
2142
|
+
${cardTitleParts(f, who).ownerLine}${logoLine(f, recordsByUri)}
|
|
2048
2143
|
<div class="oneline">${inline(sentenceCaseLead(one))}</div>
|
|
2049
2144
|
${meters(f)}
|
|
2050
2145
|
</div>
|
|
@@ -2054,7 +2149,34 @@ function findingCard(f, card, recordsByUri = new Map()) {
|
|
|
2054
2149
|
</div>`;
|
|
2055
2150
|
}
|
|
2056
2151
|
|
|
2057
|
-
|
|
2152
|
+
// THE CONFLICTS BELOW THE RISK SIT BEHIND ONE CLOSED HEADING (owner, 2026-11-18). Full cards stay for the conflicts
|
|
2153
|
+
// in the band that sets the report's risk, the highest band any conflict holds on the framework's own ladder. Every
|
|
2154
|
+
// conflict below it renders as the compact card, unticked for export, and the compact cards sit together behind
|
|
2155
|
+
// one closed heading carrying their count: "{N} more conflicts rated {band}", with the framework's band word, each
|
|
2156
|
+
// band named and joined by "or" where several sit below. A lawyer who ticks a card puts it back in the PDF; each compact
|
|
2157
|
+
// card still opens to its full detail.
|
|
2158
|
+
//
|
|
2159
|
+
// A single conflict below the risk folds too, under the singular, "1 more conflict rated Manageable" (owner,
|
|
2160
|
+
// 2026-11-19). A conflict with no band on the ladder keeps its full card, since nothing says it is below the risk. A
|
|
2161
|
+
// run with no framework renders every card in full, as it always has.
|
|
2162
|
+
function conflictCards(onField, cardFor, recordsByUri) {
|
|
2163
|
+
const full = (list) => list.map((f) => findingCard(f, cardFor(f), recordsByUri)).join('\n ');
|
|
2164
|
+
if (!FRAMEWORK) return full(onField);
|
|
2165
|
+
const rated = onField.filter((f) => severityRank(f) < FRAMEWORK.bands.length);
|
|
2166
|
+
if (!rated.length) return full(onField);
|
|
2167
|
+
const top = Math.min(...rated.map(severityRank));
|
|
2168
|
+
const below = onField.filter((f) => severityRank(f) > top && severityRank(f) < FRAMEWORK.bands.length);
|
|
2169
|
+
if (!below.length) return full(onField);
|
|
2170
|
+
const kept = onField.filter((f) => !below.includes(f));
|
|
2171
|
+
const bands = [...new Set(below.map(severityRank))].sort((a, b) => a - b).map((i) => FRAMEWORK.bands[i].label);
|
|
2172
|
+
const cards = below.map((f) => compactCard(f, cardFor(f), recordsByUri, { ticked: false })).join('\n ');
|
|
2173
|
+
return `${full(kept)}
|
|
2174
|
+
<details class="rgroup lowerband"><summary><span class="gname">${esc(R.lowerBand(below.length, bands))}</span></summary><div class="gbody">
|
|
2175
|
+
${cards}
|
|
2176
|
+
</div></details>`;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
function compactCard(f, card, recordsByUri = new Map(), { ticked = true } = {}) {
|
|
2058
2180
|
const who = recordOwner(f, recordsByUri) || f.owner?.name || f.mark; // doc-31 step 4: bound from the record
|
|
2059
2181
|
// — the SAME fallback chain findingCard has carried since item 9b, and this line is why the issue
|
|
2060
2182
|
// exists. The eleventh break pointed findingCard at the typed record and left compactCard behind, so a
|
|
@@ -2066,9 +2188,9 @@ function compactCard(f, card, recordsByUri = new Map()) {
|
|
|
2066
2188
|
// — verbatim here too; the two card renderers must never disagree about one sentence.
|
|
2067
2189
|
const one = clause(f.net) || (card?.meta?.one) || oneFallback(f, '');
|
|
2068
2190
|
const markChip = markClassChip(f, who);
|
|
2069
|
-
return `<div class="card compact"
|
|
2191
|
+
return `<div class="card compact"${cardId(f)}>
|
|
2070
2192
|
<div class="top"><div class="rail low"></div><div class="body">
|
|
2071
|
-
<div class="cardhead"><label class="pick no-print"><input type="checkbox" class="pickbox" checked aria-label="${R.card.includeInPdf(f.ordinal)}"></label><span class="fnum">${f.ordinal}</span>${cardTitleParts(f, who).title}${evidenceChips(f)}<span class="tier low">${riskChip(f)}</span><button class="ask-fi no-print">${R.card.askAi}</button></div>${cardTitleParts(f, who).ownerLine}
|
|
2193
|
+
<div class="cardhead"><label class="pick no-print"><input type="checkbox" class="pickbox"${ticked ? ' checked' : ''} aria-label="${escAttr(R.card.includeInPdf(f.ordinal))}"></label><span class="fnum">${esc(f.ordinal)}</span>${cardTitleParts(f, who).title}${evidenceChips(f)}<span class="tier low">${riskChip(f)}</span><button class="ask-fi no-print">${R.card.askAi}</button></div>${cardTitleParts(f, who).ownerLine}${logoLine(f, recordsByUri)}
|
|
2072
2194
|
<div class="oneline">${inline(sentenceCaseLead(one))}</div>
|
|
2073
2195
|
</div></div>
|
|
2074
2196
|
${fullDetail(f, card, recordsByUri)}
|
|
@@ -2081,11 +2203,11 @@ function compactCard(f, card, recordsByUri = new Map()) {
|
|
|
2081
2203
|
// splits "covered" from "next steps & monitoring". Every row still renders (doc-35: a not-searched row
|
|
2082
2204
|
// is the reader's only deterministic signal a layer didn't run — nothing is hidden).
|
|
2083
2205
|
const COV_STATE = {
|
|
2084
|
-
'confirmed-clean': { cls: 'ok', ic: '✓', word: '
|
|
2085
|
-
'coverage-limited': { cls: 'todo', ic: '→', word: '
|
|
2086
|
-
open: { cls: 'todo', ic: '→', word:
|
|
2087
|
-
'not-searched': { cls: 'todo', ic: '→', word: '
|
|
2088
|
-
note: { cls: 'info', ic: 'i', word:
|
|
2206
|
+
'confirmed-clean': { cls: 'ok', ic: '✓', word: R.coverageStates['confirmed-clean'] },
|
|
2207
|
+
'coverage-limited': { cls: 'todo', ic: '→', word: R.coverageStates['coverage-limited'] },
|
|
2208
|
+
open: { cls: 'todo', ic: '→', word: R.coverageStates.open },
|
|
2209
|
+
'not-searched': { cls: 'todo', ic: '→', word: R.coverageStates['not-searched'] }, // owner, 2026-11-18: it read "Not run this run"
|
|
2210
|
+
note: { cls: 'info', ic: 'i', word: R.coverageStates.note },
|
|
2089
2211
|
};
|
|
2090
2212
|
/**
|
|
2091
2213
|
* ONE ROW PER GAP, where the driver's follow-up row and the model's own row are the same search.
|
|
@@ -2104,19 +2226,23 @@ const COV_STATE = {
|
|
|
2104
2226
|
* from the reader, which is the failure worth avoiding. So the driver's row goes only when another row
|
|
2105
2227
|
* carries EVERY significant word of the directive it names — a near-match keeps both.
|
|
2106
2228
|
*/
|
|
2107
|
-
const FOLLOW_UP_PREFIX =
|
|
2229
|
+
const FOLLOW_UP_PREFIX = R.followUpPrefix;
|
|
2108
2230
|
// `<axis> / <what was swept>` — the shape unitLabel composes for a plan-derived coverage unit.
|
|
2109
2231
|
const AXIS_LABELLED = /\s\/\s/;
|
|
2110
2232
|
const COV_STOPWORDS = new Set(['the', 'a', 'an', 'as', 'for', 'of', 'in', 'on', 'and', 'or', 'to', 'is',
|
|
2111
2233
|
'was', 'it', 'its', 'this', 'that', 'with', 'by', 'at', 'be', 'been', 'run', 'search', 'searched']);
|
|
2112
2234
|
const covWords = (t) => new Set(String(t || '').toLowerCase().match(/[a-z0-9]+/g)?.filter((w) => !COV_STOPWORDS.has(w)) ?? []);
|
|
2113
2235
|
|
|
2114
|
-
function dedupeFollowUps(coverage) {
|
|
2236
|
+
function dedupeFollowUps(coverage, followUpKinds = null) {
|
|
2115
2237
|
const composed = (c) => String(c?.area || '').startsWith(FOLLOW_UP_PREFIX);
|
|
2116
2238
|
const written = coverage.filter((c) => !composed(c));
|
|
2117
2239
|
if (!written.length) return coverage;
|
|
2118
2240
|
return coverage.filter((c) => {
|
|
2119
2241
|
if (!composed(c)) return true;
|
|
2242
|
+
// AN AXIS-LABELLED ROW STANDS IN ONLY ON THE SEARCH THE RUN RECORDED (design, 2026-11-19): the directive's
|
|
2243
|
+
// recorded questions name one kind of search, and exactly one open row of that kind carries the directive's
|
|
2244
|
+
// words. follow-up-twins.mjs holds the rule; the driver and the lint ask it too.
|
|
2245
|
+
if (axisTwin(String(c.note || '').split('—')[0], kindsForFollowUp(c, followUpKinds), written)) return false;
|
|
2120
2246
|
// The directive is the note's opening clause — the same string the area was clipped from, unclipped.
|
|
2121
2247
|
const directive = covWords(String(c.note || '').split('—')[0]);
|
|
2122
2248
|
if (!directive.size) return true;
|
|
@@ -2182,11 +2308,24 @@ function sharedNoteCells(rows, cell) {
|
|
|
2182
2308
|
});
|
|
2183
2309
|
}
|
|
2184
2310
|
|
|
2311
|
+
/**
|
|
2312
|
+
* THE ROWS UNDER "LEFT OPEN", as the page draws them: the run's coverage rows that are not clean, then the rows for the
|
|
2313
|
+
* native scripts whose planned search did not complete, less any follow-up row another open row restates
|
|
2314
|
+
* (`dedupeFollowUps`). One list for every surface that prints it, so the page and a delivered document cannot disagree.
|
|
2315
|
+
* `localScripts` is the search-depth record's `counts.localScripts`. PURE.
|
|
2316
|
+
* @returns {{ area: string, state: string, note: string, detail?: string[] }[]} `detail` is the list a note counts, printed
|
|
2317
|
+
* after it; coverage rows keep their other fields
|
|
2318
|
+
*/
|
|
2319
|
+
export function leftOpenRows({ coverage = [], localScripts = null, followUpKinds = null } = {}) {
|
|
2320
|
+
const open = (Array.isArray(coverage) ? coverage : []).filter((c) => COV_STATE[c?.state]?.cls !== 'ok');
|
|
2321
|
+
return dedupeFollowUps([...open, ...scriptGapRows(localScripts)], followUpKinds);
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2185
2324
|
// `verdict: false` — a report whose overall assessment was not completed has no verdict above the grid, so the open
|
|
2186
2325
|
// rows' lead line, which says the material ones are carried in it, is not printed. The rows are.
|
|
2187
2326
|
// Exported for the Knockout's own Left open grid (render-knockout.mjs): one grid, in the clearance's words, on both pages.
|
|
2188
|
-
export function coverageGrid(coverage, { verdict = true } = {}) {
|
|
2189
|
-
coverage = dedupeFollowUps(coverage);
|
|
2327
|
+
export function coverageGrid(coverage, { verdict = true, followUpKinds = null } = {}) {
|
|
2328
|
+
coverage = dedupeFollowUps(coverage, followUpKinds);
|
|
2190
2329
|
if (!coverage.length) return '';
|
|
2191
2330
|
const cell = (c) => {
|
|
2192
2331
|
const s = COV_STATE[c.state] || COV_STATE.note;
|
|
@@ -2196,7 +2335,9 @@ export function coverageGrid(coverage, { verdict = true } = {}) {
|
|
|
2196
2335
|
// mark that does not exist, inside the report that clears it. Measured across the nine delivered
|
|
2197
2336
|
// runs in the pool, `coverage[]` carries no axis identifier at all; the ones that leaked were the
|
|
2198
2337
|
// coverage_judgment rows, which now carry a driver-emitted `areaLabel` and fold through it.
|
|
2199
|
-
|
|
2338
|
+
// A row's `detail` is the list its note counts, such as the territories a script's search did not complete in.
|
|
2339
|
+
const detail = Array.isArray(c.detail) && c.detail.length ? `<div class="cd">${esc(c.detail.join(', '))}</div>` : '';
|
|
2340
|
+
return `<div class="covcell ${s.cls}"><div class="ck">${s.ic}</div><div><div class="ct">${esc(cap(readerRowHead(c.area)))}${tag}</div><div class="cd">${inline(c.note || '')}</div>${detail}</div></div>`;
|
|
2200
2341
|
};
|
|
2201
2342
|
const covered = coverage.filter(c => c.state === 'confirmed-clean');
|
|
2202
2343
|
const rest = coverage.filter(c => c.state !== 'confirmed-clean');
|
|
@@ -2208,7 +2349,7 @@ export function coverageGrid(coverage, { verdict = true } = {}) {
|
|
|
2208
2349
|
const groups = Object.keys(COV_STATE).map((state) => [state, rest.filter((c) => (COV_STATE[c.state] ? c.state : 'note') === state)])
|
|
2209
2350
|
.filter(([, rows]) => rows.length);
|
|
2210
2351
|
if (rest.length) parts.push(
|
|
2211
|
-
(verdict ? `<p class="covnext"><b
|
|
2352
|
+
(verdict ? `<p class="covnext"><b>${esc(R.nextStepsHead)}</b></p>` : '') // the head alone (owner, 2026-11-18)
|
|
2212
2353
|
+ groups.map(([state, rows]) => `<div class="covgrp"><div class="covgh">${esc(COV_STATE[state].word)} <span class="covgn">(${rows.length})</span></div><div class="cov">${(verdict ? rows.map(cell) : sharedNoteCells(rows, cell)).join('')}</div></div>`).join(''));
|
|
2213
2354
|
return parts.join('');
|
|
2214
2355
|
}
|
|
@@ -2247,22 +2388,26 @@ function method(_text) {
|
|
|
2247
2388
|
// already-published internal report on the next view with no re-render. The <link> is emitted AFTER the inline
|
|
2248
2389
|
// <style> so the cascade order (chrome after report.css, as today) is identical to the all-inline export.
|
|
2249
2390
|
const NAV_SHEET = NAV_CSS;
|
|
2391
|
+
// How a clearance prints (owner, 2026-11-19): ticked cards whole, every other fold as it reads on screen. The clearance's
|
|
2392
|
+
// own sheet, after the base sheet whose print rule opens every fold, which the Knockout keeps. The verdict caption is not a
|
|
2393
|
+
// fold the reader chose: the page opens it before printing, and its label stays off the paper.
|
|
2394
|
+
const CLEARANCE_PRINT = readFileSync(join(HERE, 'templates', 'clearance-print.css'), 'utf8');
|
|
2250
2395
|
const REP_OVERRIDE = '.rep-stickyhead .sitenav{position:static;box-shadow:none;border-bottom:none;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}';
|
|
2251
2396
|
const PAGE_JS = `var _hidden=[];
|
|
2252
|
-
function exportPDF(){_hidden=[];document.querySelectorAll('.card').forEach(function(card){var cb=card.querySelector('input.pickbox');if(cb&&!cb.checked){card.classList.add('print-hidden');_hidden.push(card);}});window.print();}
|
|
2397
|
+
function exportPDF(){_hidden=[];document.querySelectorAll('.card').forEach(function(card){var cb=card.querySelector('input.pickbox');if(cb&&!cb.checked){card.classList.add('print-hidden');_hidden.push(card);}});document.querySelectorAll('details.lowerband').forEach(function(d){if(!d.querySelector('.card:not(.print-hidden)')){d.classList.add('print-hidden');_hidden.push(d);}});window.print();}
|
|
2253
2398
|
function pickAll(v){document.querySelectorAll('input.pickbox').forEach(function(cb){cb.checked=v;});}
|
|
2254
2399
|
function openAll(v){document.querySelectorAll('details.drill,details.method,details.scope,details.rgroup,details.rrow').forEach(function(d){d.open=v;});}
|
|
2255
2400
|
// doc-55 A1: a rights-holder / marker / cross-link click targets a card by #c<ordinal>. When that card sits
|
|
2256
2401
|
// inside a collapsed <details> (a secondary region's .rgroup, a .rrow), a plain anchor jump lands wrong or
|
|
2257
2402
|
// nowhere. Open every <details> ancestor of the target FIRST, then land on the card top — scroll-margin-top
|
|
2258
2403
|
// offsets the sticky topbar so the mark headline + risk band read first. Covers click, hashchange and a
|
|
2259
|
-
// deep-link load;
|
|
2404
|
+
// deep-link load; any other #-link falls through to native nav.
|
|
2260
2405
|
function _cardReveal(el){var p=el.parentElement;while(p){if(p.tagName==='DETAILS'&&!p.open)p.open=true;p=p.parentElement;}}
|
|
2261
2406
|
function _cardHashGo(){var id=location.hash.slice(1);if(id.charAt(0)!=='c'||!/^[0-9]+$/.test(id.slice(1)))return;var el=document.getElementById(id);if(!el)return;_cardReveal(el);el.scrollIntoView({block:'start'});}
|
|
2262
2407
|
document.addEventListener('click',function(e){var a=e.target.closest?e.target.closest('a[href^="#c"]'):null;if(!a)return;var id=(a.getAttribute('href')||'').slice(1);if(id.charAt(0)!=='c'||!/^[0-9]+$/.test(id.slice(1)))return;var el=document.getElementById(id);if(!el)return;_cardReveal(el);e.preventDefault();try{if(history.replaceState)history.replaceState(null,'','#'+id);}catch(err){}el.scrollIntoView({behavior:(window.matchMedia&&matchMedia('(prefers-reduced-motion: reduce)').matches)?'auto':'smooth',block:'start'});});
|
|
2263
2408
|
window.addEventListener('hashchange',_cardHashGo);
|
|
2264
2409
|
window.addEventListener('load',_cardHashGo);
|
|
2265
|
-
window.addEventListener('beforeprint',function(){document.querySelectorAll('details').forEach(function(d){d.dataset.o=d.open?'1':'';d.open=true;});});
|
|
2410
|
+
window.addEventListener('beforeprint',function(){document.querySelectorAll('details').forEach(function(d){d.dataset.o=d.open?'1':'';});document.querySelectorAll('details.sub-more').forEach(function(d){d.open=true;});document.querySelectorAll('.card').forEach(function(c){var b=c.querySelector('input.pickbox');if(b&&!b.checked)return;c.querySelectorAll('details').forEach(function(d){d.open=true;});for(var p=c.parentElement;p;p=p.parentElement)if(p.tagName==='DETAILS')p.open=true;});});
|
|
2266
2411
|
window.addEventListener('afterprint',function(){document.querySelectorAll('details').forEach(function(d){d.open=d.dataset.o==='1';});_hidden.forEach(function(c){c.classList.remove('print-hidden');});_hidden=[];});
|
|
2267
2412
|
${EXPORT_MENU_JS}`;
|
|
2268
2413
|
|
|
@@ -2418,7 +2563,7 @@ function heroCaptionHtml(text, { whole = false } = {}) {
|
|
|
2418
2563
|
// `sub-lead` marks the FOLDED first sentence so the stylesheet can tighten its bottom margin without a
|
|
2419
2564
|
// positional selector: `.sub:first-of-type` would have caught an UNFOLDED one-sentence caption too and
|
|
2420
2565
|
// changed the spacing of every archived report that has no fold.
|
|
2421
|
-
return `<p class="sub sub-lead">${inline(first)}</p><details class="sub-more"><summary
|
|
2566
|
+
return `<p class="sub sub-lead">${inline(first)}</p><details class="sub-more"><summary>${R.dependsOn}</summary><p class="sub">${inline(rest)}</p></details>`;
|
|
2422
2567
|
}
|
|
2423
2568
|
|
|
2424
2569
|
// The hero's confidentiality line: the delivery posture and the PRODUCT, joined, and nothing else.
|
|
@@ -2484,20 +2629,47 @@ function depthStripHtml(note) {
|
|
|
2484
2629
|
}
|
|
2485
2630
|
|
|
2486
2631
|
// Signature: renderHtml(parsed, findings, coverage, opts). ONE render path — there is no client variant.
|
|
2487
|
-
// THE
|
|
2488
|
-
// the
|
|
2632
|
+
// THE FIVE ENTRIES, in their order, each in the words of the heading it opens (owner, 2026-11-18). "Conflicts"
|
|
2633
|
+
// opens the Conflicts heading, not the landscape above it. The rule that filters them lives in shared/brand.mjs,
|
|
2634
|
+
// because the knockout renderer draws a strip from its own board and the filtering is the half worth having once.
|
|
2489
2635
|
const STRIP = Object.freeze([
|
|
2490
|
-
['summary', 'Summary'], ['next',
|
|
2491
|
-
['searched',
|
|
2636
|
+
['summary', 'Summary'], ['next', R.next.title], ['conflicts', R.strip.conflicts], ['also-considered', R.alsoConsidered.title],
|
|
2637
|
+
['searched', R.searched.title],
|
|
2492
2638
|
]);
|
|
2493
2639
|
|
|
2640
|
+
// THE CLEARANCE PAGE FROM ITS REPORT DOCUMENT (C14). The run's report document (publish/report-document.mjs, written to
|
|
2641
|
+
// `_driver/report-document.json`) holds every fact the page prints. This reads it, as written, and hands the page the
|
|
2642
|
+
// arguments publish hands it today, so the page is byte for byte the page it was. What the document does not hold is
|
|
2643
|
+
// the page's surface: its two addresses, the confidentiality posture and the demo flag, which publish passes beside the
|
|
2644
|
+
// document as it always has; and the two sets the document holds by reference, the saved records' bodies by uri and the
|
|
2645
|
+
// saved logos' images by ref, which publish resolves from the run. PURE given its inputs.
|
|
2646
|
+
export function renderClearanceDocument(doc, { recordsByUri = new Map(), logos = new Map(), homeHref, chromeHref, delivery, demoData } = {}) {
|
|
2647
|
+
const run = doc?.run ?? {}, scope = doc?.scope ?? {}, client = doc?.client ?? {}, verdict = doc?.verdict ?? {};
|
|
2648
|
+
const framework = doc?.framework ?? {}, prose = doc?.prose ?? {};
|
|
2649
|
+
const asMap = (pairs) => (Array.isArray(pairs) ? new Map(pairs) : null);
|
|
2650
|
+
return renderHtml({ fm: prose.frontMatter ?? {}, secs: prose.sections ?? {}, cards: prose.cards ?? [] }, client.findings ?? [], client.coverage ?? [], {
|
|
2651
|
+
demoData, frameworkMethod: framework.method, servedModels: client.servedModels, productName: run.product?.name,
|
|
2652
|
+
depthNote: run.product?.depthNote, scopeBasis: scope.scopeBasis, auditFile: run.auditFile || undefined, runId: run.runId,
|
|
2653
|
+
delivery, recordsByUri, contextNotes: client.contextNotes, coverageJudgment: client.coverageJudgment,
|
|
2654
|
+
markAssessment: client.markAssessment, fourAnswers: client.fourAnswers, homeHref, chromeHref, issued: run.issued,
|
|
2655
|
+
asOf: run.asOf, verdictInfo: verdict.record, framework: framework.manifest, searchedJurisdictions: scope.searchedJurisdictions,
|
|
2656
|
+
planTerritories: scope.planTerritories, caseLawByOrdinal: asMap(client.caseLaw?.byOrdinal) ?? new Map(),
|
|
2657
|
+
enforcerSignals: client.enforcerSignals, recordOrigin: run.provider?.origin,
|
|
2658
|
+
recordOrigins: run.provider?.origins, recordCitation: run.provider?.citation ?? null, recordLinks: asMap(client.recordLinks?.byUri),
|
|
2659
|
+
providerLabel: run.provider?.label, seniorRights: client.seniorRights, findingsSchemaVersion: run.findingsVersion,
|
|
2660
|
+
searchDepth: scope.searchDepth, assessmentNotCompleted: verdict.assessmentNotCompleted, logos,
|
|
2661
|
+
followUpKinds: new Map((client.followUpKinds ?? []).map(([k, kinds]) => [k, new Set(Array.isArray(kinds) ? kinds : [])])),
|
|
2662
|
+
});
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2494
2665
|
export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
2495
2666
|
if (findings && !Array.isArray(findings)) { opts = findings; findings = []; coverage = []; } // tolerate legacy (parsed, opts)
|
|
2496
2667
|
AS_OF = opts.asOf ?? null; // C2
|
|
2497
2668
|
VERDICT_INFO = (opts.verdictInfo && opts.verdictInfo.tier != null) ? opts.verdictInfo : null; // T2 — only an enriched sidecar is an authority
|
|
2498
2669
|
FRAMEWORK = opts.framework ?? null; // doc 50 — the frozen manifest; null on archived/legacy runs
|
|
2499
2670
|
FRAMEWORK_METHOD = opts.frameworkMethod ?? null;
|
|
2500
|
-
|
|
2671
|
+
AUDIT_HREF = hrefAttr(opts.auditFile, { relative: true }) || null;
|
|
2672
|
+
LOGOS = opts.logos instanceof Map ? opts.logos : new Map();
|
|
2501
2673
|
SEARCHED_JUR = Array.isArray(opts.searchedJurisdictions) && opts.searchedJurisdictions.length ? opts.searchedJurisdictions : null; // T6 (D4)
|
|
2502
2674
|
SCOPE_WORLDWIDE = opts.scopeBasis === 'worldwide' ? true : null; // the plan's scope_basis; null ⇒ fall back to the ledger-prose sniff
|
|
2503
2675
|
CASE_LAW_BY_ORD = opts.caseLawByOrdinal instanceof Map ? opts.caseLawByOrdinal : new Map(); // T7 (E5)
|
|
@@ -2623,30 +2795,19 @@ export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
|
2623
2795
|
// T7 (E4): the section also renders when the ONLY common-law content is the layer's
|
|
2624
2796
|
// contributions to register findings — the layer's work is visible even with zero CL findings.
|
|
2625
2797
|
const clBody = commonLawSection(secCL, clOnField, cardFor, recordsByUri, sorted);
|
|
2626
|
-
// The case-law stage's session-wide preamble (source outages etc.) renders ONCE here — the per-finding
|
|
2627
|
-
// strands cite 'as § Session-wide notice above', which used to point at nothing (the preamble was
|
|
2628
|
-
// discarded at parse). Rendered only when case-law strands exist to reference it.
|
|
2629
|
-
// doc-55 A3 — INTERNAL ONLY: this preamble is operational session narration (which case-law sources were
|
|
2630
|
-
// reachable this run — MCP wiring, tool status, HTTP/quota) = process exhaust, not legal product (doc-52).
|
|
2631
|
-
// It leaked those internals to the client. The client's per-finding case-law lines carry the plain result;
|
|
2632
|
-
// the reviewer keeps the full session note here.
|
|
2633
|
-
const clNoticeText = String(opts.caseLawNotice || '').trim();
|
|
2634
|
-
const clNotice = (clNoticeText && CASE_LAW_BY_ORD.size)
|
|
2635
|
-
? `<div class="panel" style="padding:12px 16px;margin:0 0 12px"><p style="margin:0 0 4px;font-weight:700;font-size:13px">Session-wide notice</p><div style="font-size:13px">${renderProse(clNoticeText)}</div></div>`
|
|
2636
|
-
: '';
|
|
2637
2798
|
// The 2026-09-16 report redesign — the section heading and the session-wide notice are off the page: the heading
|
|
2638
2799
|
// named a layer rather than a thing a reader looks for, and the notice was operational narration. The
|
|
2639
2800
|
// CARDS are not: a rated common-law finding is a finding, and it renders in place with the others.
|
|
2640
2801
|
const hasCL = Boolean(clBody);
|
|
2641
2802
|
let findingsSections, covNum;
|
|
2642
2803
|
if (!DISPOSITION_MODE) {
|
|
2643
|
-
findingsSections = `${onField.length ? `<div class="sec" id="findings"><span class="num"></span><h2
|
|
2804
|
+
findingsSections = `${onField.length ? `<div class="sec" id="findings"><span class="num"></span><h2>${R.findings.landscape}</h2></div>
|
|
2644
2805
|
<div class="landwrap">${quadrant(sorted)}${keyPanel(sorted, recordsByUri)}</div>
|
|
2645
2806
|
|
|
2646
|
-
<div class="sec"><span class="num"></span><h2
|
|
2647
|
-
${onField
|
|
2807
|
+
<div class="sec" id="conflicts"><span class="num"></span><h2>${R.strip.conflicts}</h2></div>
|
|
2808
|
+
${conflictCards(onField, cardFor, recordsByUri)}` : ''}
|
|
2648
2809
|
|
|
2649
|
-
${secReg.length ? `<div class="sec"><span class="num"></span><h2
|
|
2810
|
+
${secReg.length ? `<div class="sec"><span class="num"></span><h2>${esc(R.findings.secondaryWatch)}</h2></div>
|
|
2650
2811
|
${secondaryRegions(secReg, cardFor, recordsByUri)}` : ''}${hasCL ? `
|
|
2651
2812
|
|
|
2652
2813
|
${clBody}` : ''}`;
|
|
@@ -2655,11 +2816,11 @@ export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
|
2655
2816
|
let secNum = 0;
|
|
2656
2817
|
const num = () => String(++secNum).padStart(2, '0');
|
|
2657
2818
|
const landscape = onField.length
|
|
2658
|
-
? `<div class="sec" id="findings"><span class="num"></span><h2
|
|
2819
|
+
? `<div class="sec" id="findings"><span class="num"></span><h2>${R.findings.landscape}</h2></div>
|
|
2659
2820
|
<div class="landwrap">${quadrant(sorted)}${keyPanel(sorted, recordsByUri)}</div>
|
|
2660
2821
|
|
|
2661
|
-
<div class="sec"><span class="num"></span><h2
|
|
2662
|
-
${onField
|
|
2822
|
+
<div class="sec" id="conflicts"><span class="num"></span><h2>${R.strip.conflicts}</h2></div>
|
|
2823
|
+
${conflictCards(onField, cardFor, recordsByUri)}`
|
|
2663
2824
|
: '';
|
|
2664
2825
|
// THE COMMON-LAW CARDS GO WITH THE CONFLICTS, NOT UNDER THE NEXT HEADING. Appended at the end they
|
|
2665
2826
|
// landed beneath "Notable but manageable", which says something about a finding that is not true of
|
|
@@ -2682,20 +2843,20 @@ export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
|
2682
2843
|
// reader guessing. That is right for a working record and wrong for a client's page, where a
|
|
2683
2844
|
// heading followed by a sentence explaining that there is nothing under it is the "nothing here"
|
|
2684
2845
|
// line the owner ruled out. Whether the grouping ran is answered by the counts, not by a paragraph.
|
|
2685
|
-
const notes = contextNotes.length ? `\n <p class="fold-lead"><b
|
|
2846
|
+
const notes = contextNotes.length ? `\n <p class="fold-lead"><b>${R.findings.famousLead}</b> ${R.findings.famousNote}</p>
|
|
2686
2847
|
${contextNotesList(contextNotes)}` : '';
|
|
2687
2848
|
if (negatives.total || notes) {
|
|
2688
|
-
tail += `\n\n <div class="sec"><span class="num"></span><h2>
|
|
2849
|
+
tail += `\n\n <div class="sec"><span class="num"></span><h2>Marks that can coexist</h2></div>
|
|
2689
2850
|
${negatives.total ? reasonedNegatives(negatives.groups, cardFor, recordsByUri) : ''}${notes}`;
|
|
2690
2851
|
}
|
|
2691
2852
|
} else if (band2r.length || band3r.length || contextNotes.length) {
|
|
2692
2853
|
const parts = [];
|
|
2693
2854
|
if (band2r.length) parts.push(secondaryRegions(band2r, cardFor, recordsByUri));
|
|
2694
|
-
if (band3r.length) parts.push(`<p class="fold-lead"><b
|
|
2855
|
+
if (band3r.length) parts.push(`<p class="fold-lead"><b>${R.findings.sameNameLead}</b> ${R.findings.sameNameNote}</p>
|
|
2695
2856
|
${secondaryRegions(band3r, cardFor, recordsByUri)}`);
|
|
2696
|
-
if (contextNotes.length) parts.push(`<p class="fold-lead"><b
|
|
2857
|
+
if (contextNotes.length) parts.push(`<p class="fold-lead"><b>${R.findings.famousLead}</b> ${R.findings.famousNote}</p>
|
|
2697
2858
|
${contextNotesList(contextNotes)}`);
|
|
2698
|
-
tail += `\n\n <div class="sec"><span class="num"></span><h2>
|
|
2859
|
+
tail += `\n\n <div class="sec"><span class="num"></span><h2>Marks that can coexist</h2></div>
|
|
2699
2860
|
${parts.join('\n ')}`;
|
|
2700
2861
|
}
|
|
2701
2862
|
// The 2026-09-16 report redesign — the section heading and its routing notice go; the CARDS stay, or a
|
|
@@ -2712,7 +2873,7 @@ export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
|
2712
2873
|
const linkChrome = !!opts.chromeHref;
|
|
2713
2874
|
const doc = pageShell({
|
|
2714
2875
|
title: `${productName ? `${esc(productName)} — ` : ''}${esc(fm.title || '')}`,
|
|
2715
|
-
css: (linkChrome ? '' : NAV_SHEET) + '\n' + REP_OVERRIDE,
|
|
2876
|
+
css: (linkChrome ? '' : NAV_SHEET) + '\n' + REP_OVERRIDE + '\n' + CLEARANCE_PRINT,
|
|
2716
2877
|
chromeHref: opts.chromeHref,
|
|
2717
2878
|
body: `<div class="rep-stickyhead no-print" data-report-chrome>
|
|
2718
2879
|
<div class="topbar no-print">
|
|
@@ -2738,7 +2899,7 @@ export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
|
2738
2899
|
${EXPORT_TOGGLE}
|
|
2739
2900
|
${exportPopover(`
|
|
2740
2901
|
<div class="tb-pop-title">${esc(R.topbar.exportAndAudit)}</div>
|
|
2741
|
-
<button class="util primary" onclick="exportPDF()">⬇
|
|
2902
|
+
<button class="util primary" onclick="exportPDF()">⬇ ${R.exportPdfTicked}</button>
|
|
2742
2903
|
${excelBtn2}
|
|
2743
2904
|
<div class="tb-sep"></div>
|
|
2744
2905
|
<div class="tb-row"><button class="util" onclick="pickAll(true)">${R.topbar.selectAll}</button><button class="util" onclick="pickAll(false)">${R.topbar.selectNone}</button></div>
|
|
@@ -2835,8 +2996,8 @@ export function renderHtml(parsed, findings = [], coverage = [], opts = {}) {
|
|
|
2835
2996
|
const issuedOn = (String(opts.issued ?? '').match(/^\d{4}-\d{2}-\d{2}/) || [])[0] ?? opts.issued ?? null;
|
|
2836
2997
|
const parts = [
|
|
2837
2998
|
fm.matter ? `Matter ${esc(fm.matter)}` : '',
|
|
2838
|
-
searchedOn ?
|
|
2839
|
-
issuedOn ?
|
|
2999
|
+
searchedOn ? esc(R.searchedOn(searchedOn)) : '',
|
|
3000
|
+
issuedOn ? esc(R.issuedOn(issuedOn)) : '',
|
|
2840
3001
|
provider ? esc(provider) : '',
|
|
2841
3002
|
].filter(Boolean);
|
|
2842
3003
|
const line = parts.length ? `${parts.join(' \u00b7 ')}.` : '';
|
|
@@ -2868,16 +3029,17 @@ if (isEntrypoint(import.meta.url)) {
|
|
|
2868
3029
|
// ── The office's own page for a fetched record, where the run's register publishes none of its own ─────
|
|
2869
3030
|
// publish addresses each fetched record from its own numbers (office-record-links.mjs) and hands the map
|
|
2870
3031
|
// in as `recordLinks`. Kept down here, below every line the rest of the tree cites by number.
|
|
2871
|
-
import { officeReasonSentences } from './office-record-links.mjs';
|
|
3032
|
+
import { officeReasonSentences, officeRecordLink } from './office-record-links.mjs';
|
|
2872
3033
|
|
|
2873
3034
|
// The label is the office and the number, linked where the office has a page. The handle names the
|
|
2874
3035
|
// vendor's record, not the office's, and a reader can look it up nowhere. With no link the number stands
|
|
2875
3036
|
// on its own beside the workbook note, and Scope says once, per office, why it is not a link.
|
|
2876
|
-
function officeRecordCell(uri, regUri, note) {
|
|
3037
|
+
function officeRecordCell(uri, regUri, note, label = null) { // `label` prints in place of the office's own, escaped like it
|
|
2877
3038
|
const l = RECORD_LINKS?.get(String(uri || '').toLowerCase());
|
|
2878
3039
|
if (!l?.label) return regUri(uri);
|
|
2879
|
-
|
|
2880
|
-
return
|
|
3040
|
+
const text = esc(label ?? l.label);
|
|
3041
|
+
if (hrefAttr(l.href)) return `<a href="${hrefAttr(l.href)}" target="_blank" rel="noopener noreferrer">${text}</a>`;
|
|
3042
|
+
return note ? `${text}<span class="reg-nolink">${note}</span>` : text;
|
|
2881
3043
|
}
|
|
2882
3044
|
|
|
2883
3045
|
// What a linked registration number opens and, once per office, why the rest are cited by number. Said
|