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.
- package/INSTALL.md +7 -4
- package/QUICKSTART.md +1 -0
- package/README.md +5 -2
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/bin/clearotron.mjs +4 -2
- package/bin/onboard.mjs +158 -29
- package/build-info.json +2 -2
- package/docs/CLIENT-MCP.md +3 -1
- package/docs/DELIVERY.md +6 -3
- package/docs/architecture/02-architecture.md +1 -1
- package/docs/branding.md +4 -4
- package/docs/report-data/clearance-1.schema.json +320 -0
- package/docs/report-data/knockout-1.schema.json +268 -0
- package/driver/CHANGELOG.md +39 -0
- package/driver/connotation-search.mjs +1 -1
- package/driver/contract-e3-backlog.mjs +1 -1
- package/driver/coverage-ledger.mjs +18 -2
- package/driver/deferral-row.mjs +1 -1
- package/driver/degraded-parts.mjs +1 -0
- package/driver/driver.config.mjs +4 -3
- package/driver/effective-scope.mjs +3 -1
- package/driver/engagement-receipt.mjs +3 -3
- package/driver/engine/anthropic-agent.mjs +15 -1
- package/driver/engine/common.mjs +7 -0
- package/driver/engine/mcp/band-server.mjs +7 -16
- package/driver/engine/mcp/codex-config.mjs +3 -0
- package/driver/engine/mcp/recording-server.mjs +45 -34
- package/driver/engine/openai-agent.mjs +74 -7
- package/driver/gateway.mjs +67 -10
- package/driver/jx.mjs +13 -5
- package/driver/manuals-seen.mjs +146 -0
- package/driver/mark-logos.mjs +144 -0
- package/driver/methodology-witness.mjs +2 -1
- package/driver/owner-use-check.mjs +3 -3
- package/driver/package.json +1 -1
- package/driver/pipeline-knockout.mjs +4 -0
- package/driver/pipeline.mjs +92 -7
- package/driver/portal-local-auth.mjs +6 -2
- package/driver/portal-report.mjs +43 -12
- package/driver/portal-routes/me.mjs +4 -1
- package/driver/portal-runs.mjs +6 -9
- package/driver/profiles.mjs +4 -4
- package/driver/publish/README.md +9 -7
- package/driver/publish/email-conditions.mjs +2 -2
- package/driver/publish/evidence-words.mjs +21 -0
- package/driver/publish/index.mjs +104 -90
- package/driver/publish/knockout.mjs +75 -49
- package/driver/publish/office-record-links.mjs +11 -9
- package/driver/publish/page-shell.mjs +98 -0
- package/driver/publish/publish-inputs.mjs +4 -0
- package/driver/publish/regions.mjs +24 -3
- package/driver/publish/register-record.mjs +150 -0
- package/driver/publish/render-knockout.mjs +195 -642
- package/driver/publish/render.mjs +270 -363
- package/driver/publish/report-data.mjs +225 -12
- package/driver/publish/strings.mjs +662 -0
- package/driver/publish/templates/knockout.css +200 -0
- package/driver/publish/templates/report.css +72 -52
- package/driver/publish/xlsx.mjs +148 -125
- package/driver/record-goods.mjs +42 -0
- package/driver/reference-score.mjs +4 -1
- package/driver/register-reach.mjs +39 -0
- package/driver/registry-fidelity.mjs +3 -8
- package/driver/repair-composers.mjs +6 -2
- package/driver/repair-targets.mjs +4 -1
- package/driver/run-delivered.mjs +6 -1
- package/driver/runner.mjs +73 -29
- package/driver/scope-facts.mjs +27 -6
- package/driver/search-policy.mjs +9 -4
- package/driver/stages.mjs +3 -3
- package/driver/steps/overview-and-cards.mjs +50 -14
- package/driver/steps/verdict-gate.mjs +33 -13
- package/driver/suite-census.json +368 -68
- package/driver/terminal-clamp.mjs +6 -1
- package/mcp-server/CHANGELOG.md +4 -0
- package/mcp-server/lib/audit-view.mjs +5 -2
- package/mcp-server/lib/brief.mjs +2 -1
- package/mcp-server/lib/evidence.mjs +31 -4
- package/mcp-server/lib/knockout.mjs +1 -1
- package/mcp-server/lib/scrub.mjs +1 -1
- package/mcp-server/package.json +1 -1
- package/mcp-server/server.mjs +5 -3
- package/package.json +4 -1
- package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-CtkllKJ2.js} +225 -77
- package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
- package/portal-ui/dist/index.html +2 -2
- package/portal-ui/package.json +3 -3
- package/providers/_shared/ledger.mjs +30 -2
- package/providers/_shared/record-uri.mjs +15 -0
- package/providers/clarivate/src/adapter.js +11 -0
- package/providers/clarivate/src/core.js +17 -1
- package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/scripts/README.md +147 -3
- package/scripts/e2e-first-time.mjs +3 -3
- package/scripts/freeze-example-run.mjs +3 -3
- package/scripts/mint-search-level-tags.mjs +61 -0
- package/scripts/mint-source-pin-census.mjs +89 -0
- package/scripts/release-note-required.mjs +65 -6
- package/scripts/test-durations-reporter.mjs +25 -0
- package/scripts/test-full.mjs +72 -18
- package/scripts/test-run.mjs +18 -1
- package/shared/brand.mjs +85 -5
- package/shared/inline-markdown.mjs +53 -0
- package/shared/portal-tokens.mjs +2 -1
- package/shared/register-selection.mjs +8 -3
- package/shared/search-level-tags.json +25 -0
- package/shared/tools/derive-band-pairs.mjs +10 -0
- package/driver/own-rights.mjs +0 -83
- package/driver/use-check.mjs +0 -85
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright 2026 Cordillera Sàrl. Additional terms under section 7 of the AGPL-3.0 apply — see ADDITIONAL-TERMS.md
|
|
3
|
+
// publish/register-record.mjs — the register's own record of one cited registration, as the report shows it.
|
|
4
|
+
//
|
|
5
|
+
// A reviewing lawyer checks every cited mark against the register by hand before reading the analysis. The
|
|
6
|
+
// report now opens each cited registration with the register's facts (docs/design/register-record/, the
|
|
7
|
+
// approved board): the mark and its type, the goods by class, the owner and the owner's country, the country,
|
|
8
|
+
// the status with its dates, and the register number linked to the office's own record. This module builds
|
|
9
|
+
// those rows from the record the run saved; the renderers lay them out.
|
|
10
|
+
//
|
|
11
|
+
// EVERY FACT IS COPIED FROM THE SAVED RECORD. Nothing here is composed by a model, and nothing is translated
|
|
12
|
+
// here: a record's goods are its English where it holds English, the vendor's machine translation marked as
|
|
13
|
+
// one where it holds that, and the original as registered otherwise. The goods are read by record-goods.mjs,
|
|
14
|
+
// the one reader of a record's goods; the record's other fields by registry-fidelity.mjs's REC, as the
|
|
15
|
+
// renderer reads them today.
|
|
16
|
+
//
|
|
17
|
+
// PURE — no IO, no register call. A logo is not fetched here: `logo.wanted` says whether a registration's
|
|
18
|
+
// record carries one worth fetching, and the run's logo step does the fetching.
|
|
19
|
+
import { recordGoods, niceClass, untaggedIsEnglish, DEFAULT_ANSWER_CUT } from '../record-goods.mjs';
|
|
20
|
+
import { REC } from '../registry-fidelity.mjs';
|
|
21
|
+
import { officeRecordLink } from './office-record-links.mjs';
|
|
22
|
+
import { normRegion, regionName } from './regions.mjs';
|
|
23
|
+
import { REGISTER_RECORD as R } from './strings.mjs';
|
|
24
|
+
|
|
25
|
+
// The labels and notes, from the catalogue. A renderer takes them from here.
|
|
26
|
+
export const RECORD_LABELS = R.labels;
|
|
27
|
+
export const MT_NOTE = R.mtNote;
|
|
28
|
+
export const NO_GOODS = R.noGoods;
|
|
29
|
+
export const CLASS_NOT_STATED = R.classNotStated;
|
|
30
|
+
export const LOGO_NOT_RETRIEVED = R.logoNotRetrieved;
|
|
31
|
+
export const registrationsCount = R.registrationsCount;
|
|
32
|
+
export const showAllTerms = R.showAllTerms;
|
|
33
|
+
const machineTranslation = R.machineTranslation;
|
|
34
|
+
const asRegistered = R.asRegistered;
|
|
35
|
+
export const logoAlt = R.logoAlt;
|
|
36
|
+
|
|
37
|
+
// A code into the English name a reader knows, from the one naming source every report surface uses.
|
|
38
|
+
export function countryOf(office) {
|
|
39
|
+
const code = normRegion(String(office ?? '').trim());
|
|
40
|
+
return code ? regionName(code) : null;
|
|
41
|
+
}
|
|
42
|
+
// A logo is captioned with its register as a reader names it (EU, US, WIPO), not the office code the record
|
|
43
|
+
// carries (EM for the EUIPO).
|
|
44
|
+
const logoCaption = (office) => {
|
|
45
|
+
const code = normRegion(String(office ?? '').trim());
|
|
46
|
+
return code === 'WO' ? 'WIPO' : code || null;
|
|
47
|
+
};
|
|
48
|
+
const languageNames = new Intl.DisplayNames(['en'], { type: 'language' });
|
|
49
|
+
const nameOf = (names, code) => {
|
|
50
|
+
try { const n = names.of(code); return n && n !== code ? n : null; } catch { return null; }
|
|
51
|
+
};
|
|
52
|
+
const languageOf = (code) => {
|
|
53
|
+
const c = String(code ?? '').trim();
|
|
54
|
+
return c ? nameOf(languageNames, c) : null;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// A register's own words for its status, in the case a sentence takes: "REGISTERED" reads "Registered".
|
|
58
|
+
const statusOf = (rec) => {
|
|
59
|
+
const s = REC.statusStr(rec).trim();
|
|
60
|
+
return s && s === s.toUpperCase() ? s.charAt(0) + s.slice(1).toLowerCase() : s || null;
|
|
61
|
+
};
|
|
62
|
+
const markTypeOf = (rec) => {
|
|
63
|
+
const t = String(rec?.markFeature ?? rec?.markType ?? '').trim();
|
|
64
|
+
return t && t === t.toUpperCase() ? t.charAt(0) + t.slice(1).toLowerCase() : t || null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Whether a registration's logo is worth fetching: the record marks the mark as figurative and says an image
|
|
69
|
+
* exists. A plain word mark is skipped even when its record has an image, because that image is only the word.
|
|
70
|
+
*/
|
|
71
|
+
export function logoWanted(rec) {
|
|
72
|
+
if (rec?.imageAvailable !== true) return false;
|
|
73
|
+
return /design|device|figurative|stylis|styliz|combined|logo|composite|special form/i.test(String(rec?.markFeature ?? rec?.markType ?? ''));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A statement's terms: the register separates them with semicolons. */
|
|
77
|
+
const termsOf = (text) => String(text).split(/\s*;\s*/).map((t) => t.trim()).filter(Boolean);
|
|
78
|
+
|
|
79
|
+
/** One class statement as the board draws it: whole, or a preview cut at a term boundary with the count. */
|
|
80
|
+
function statementOf(g) {
|
|
81
|
+
const cls = g.classes.length ? g.classes.map((c) => `Class ${niceClass(c) ?? c}`).join(', ') : CLASS_NOT_STATED;
|
|
82
|
+
const terms = termsOf(g.text);
|
|
83
|
+
if ([...g.text].length <= DEFAULT_ANSWER_CUT || terms.length < 2) return { class: cls, text: g.text };
|
|
84
|
+
let preview = '';
|
|
85
|
+
for (const t of terms) {
|
|
86
|
+
const next = preview ? `${preview}; ${t}` : t;
|
|
87
|
+
if ([...next].length > DEFAULT_ANSWER_CUT) break;
|
|
88
|
+
preview = next;
|
|
89
|
+
}
|
|
90
|
+
return { class: cls, text: g.text, preview: preview || terms[0], showAll: showAllTerms(terms.length) };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The goods row: English, or a marked machine translation, or the original as registered, or none stated. */
|
|
94
|
+
function goodsRow(rec, uri) {
|
|
95
|
+
// An untagged statement on an English-language register is English, as the run's own goods reader takes it.
|
|
96
|
+
const goods = recordGoods(rec, { english: untaggedIsEnglish(String(rec.uri ?? uri ?? '')) });
|
|
97
|
+
if (!goods.length) return { label: RECORD_LABELS.goods, note: NO_GOODS, entries: [] };
|
|
98
|
+
const translated = goods.filter((g) => g.alt);
|
|
99
|
+
const original = goods.filter((g) => g.en === false);
|
|
100
|
+
const row = { label: RECORD_LABELS.goods, entries: goods.map(statementOf) };
|
|
101
|
+
if (translated.length) {
|
|
102
|
+
const langs = [...new Set(translatedLanguages(rec))];
|
|
103
|
+
row.marker = { tag: machineTranslation(langs.length === 1 ? languageOf(langs[0]) : null), note: MT_NOTE };
|
|
104
|
+
} else if (original.length) {
|
|
105
|
+
const langs = [...new Set(originalLanguages(rec))];
|
|
106
|
+
row.note = asRegistered(langs.length === 1 ? languageOf(langs[0]) : null);
|
|
107
|
+
}
|
|
108
|
+
return row;
|
|
109
|
+
}
|
|
110
|
+
const originalLanguages = (rec) => (Array.isArray(rec?.goodsServices) ? rec.goodsServices : [])
|
|
111
|
+
.filter((g) => !g?.translation && String(g?.language ?? '').trim() && !/^en/i.test(String(g.language)))
|
|
112
|
+
.map((g) => String(g.language).trim());
|
|
113
|
+
const translatedLanguages = (rec) => (Array.isArray(rec?.goodsServices) ? rec.goodsServices : [])
|
|
114
|
+
.filter((g) => g?.translation && String(g?.language ?? '').trim() && !/^en/i.test(String(g.language)))
|
|
115
|
+
.map((g) => String(g.language).trim());
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The register record of one cited registration: its rows in the board's order, and whether its logo is wanted.
|
|
119
|
+
* `receipt` is the report's own receipt line for the record ("verified — … record fetched <date>"), passed as
|
|
120
|
+
* the report already writes it. Returns null when there is no record.
|
|
121
|
+
*/
|
|
122
|
+
export function registerRecordView(rec, { uri = '', receipt = null } = {}) {
|
|
123
|
+
if (!rec || typeof rec !== 'object') return null;
|
|
124
|
+
const mark = String(rec.markText ?? rec.mark ?? '').trim() || null;
|
|
125
|
+
const country = countryOf(rec.office);
|
|
126
|
+
const ownerCountry = countryOf(rec.ownerCountry);
|
|
127
|
+
const link = officeRecordLink(rec, uri);
|
|
128
|
+
const app = REC.serial(rec), reg = REC.regNumber(rec);
|
|
129
|
+
const dates = [
|
|
130
|
+
rec.applicationDate && `filed ${rec.applicationDate}`,
|
|
131
|
+
rec.registrationDate && `registered ${rec.registrationDate}`,
|
|
132
|
+
rec.expiryDate && `expires ${rec.expiryDate}`,
|
|
133
|
+
].filter(Boolean).join(' · ');
|
|
134
|
+
const rows = [
|
|
135
|
+
{ label: RECORD_LABELS.mark, value: mark, ...(markTypeOf(rec) ? { faint: markTypeOf(rec) } : {}) },
|
|
136
|
+
goodsRow(rec, uri),
|
|
137
|
+
{ label: RECORD_LABELS.owner, value: REC.owner(rec) || null, ...(ownerCountry ? { faint: `(${ownerCountry})` } : {}) },
|
|
138
|
+
{ label: RECORD_LABELS.country, value: country },
|
|
139
|
+
{ label: RECORD_LABELS.status, value: statusOf(rec), ...(dates ? { faint: dates } : {}) },
|
|
140
|
+
{
|
|
141
|
+
label: RECORD_LABELS.number, value: link?.label ?? null, href: link?.href ?? null,
|
|
142
|
+
...(app && reg && app !== reg ? { faint: `application ${app}` } : {}),
|
|
143
|
+
...(receipt ? { receipt } : {}),
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
return {
|
|
147
|
+
rows,
|
|
148
|
+
logo: { wanted: logoWanted(rec), caption: logoCaption(rec.office), alt: mark && country ? logoAlt(mark, country) : null, href: link?.href ?? null },
|
|
149
|
+
};
|
|
150
|
+
}
|