clearotron 0.6.0 → 0.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/INSTALL.md +7 -4
  2. package/QUICKSTART.md +1 -0
  3. package/README.md +5 -2
  4. package/THIRD-PARTY-NOTICES.md +1 -1
  5. package/bin/clearotron.mjs +4 -2
  6. package/bin/onboard.mjs +158 -29
  7. package/build-info.json +2 -2
  8. package/docs/CLIENT-MCP.md +3 -1
  9. package/docs/DELIVERY.md +6 -3
  10. package/docs/architecture/02-architecture.md +1 -1
  11. package/docs/branding.md +4 -4
  12. package/docs/report-data/clearance-1.schema.json +320 -0
  13. package/docs/report-data/knockout-1.schema.json +268 -0
  14. package/driver/CHANGELOG.md +39 -0
  15. package/driver/connotation-search.mjs +1 -1
  16. package/driver/contract-e3-backlog.mjs +1 -1
  17. package/driver/coverage-ledger.mjs +18 -2
  18. package/driver/deferral-row.mjs +1 -1
  19. package/driver/degraded-parts.mjs +1 -0
  20. package/driver/driver.config.mjs +4 -3
  21. package/driver/effective-scope.mjs +3 -1
  22. package/driver/engagement-receipt.mjs +3 -3
  23. package/driver/engine/anthropic-agent.mjs +15 -1
  24. package/driver/engine/common.mjs +7 -0
  25. package/driver/engine/mcp/band-server.mjs +7 -16
  26. package/driver/engine/mcp/codex-config.mjs +3 -0
  27. package/driver/engine/mcp/recording-server.mjs +45 -34
  28. package/driver/engine/openai-agent.mjs +74 -7
  29. package/driver/gateway.mjs +67 -10
  30. package/driver/jx.mjs +13 -5
  31. package/driver/manuals-seen.mjs +146 -0
  32. package/driver/mark-logos.mjs +144 -0
  33. package/driver/methodology-witness.mjs +2 -1
  34. package/driver/owner-use-check.mjs +3 -3
  35. package/driver/package.json +1 -1
  36. package/driver/pipeline-knockout.mjs +4 -0
  37. package/driver/pipeline.mjs +92 -7
  38. package/driver/portal-local-auth.mjs +6 -2
  39. package/driver/portal-report.mjs +43 -12
  40. package/driver/portal-routes/me.mjs +4 -1
  41. package/driver/portal-runs.mjs +6 -9
  42. package/driver/profiles.mjs +4 -4
  43. package/driver/publish/README.md +9 -7
  44. package/driver/publish/email-conditions.mjs +2 -2
  45. package/driver/publish/evidence-words.mjs +21 -0
  46. package/driver/publish/index.mjs +104 -90
  47. package/driver/publish/knockout.mjs +75 -49
  48. package/driver/publish/office-record-links.mjs +11 -9
  49. package/driver/publish/page-shell.mjs +98 -0
  50. package/driver/publish/publish-inputs.mjs +4 -0
  51. package/driver/publish/regions.mjs +24 -3
  52. package/driver/publish/register-record.mjs +150 -0
  53. package/driver/publish/render-knockout.mjs +195 -642
  54. package/driver/publish/render.mjs +270 -363
  55. package/driver/publish/report-data.mjs +225 -12
  56. package/driver/publish/strings.mjs +662 -0
  57. package/driver/publish/templates/knockout.css +200 -0
  58. package/driver/publish/templates/report.css +72 -52
  59. package/driver/publish/xlsx.mjs +148 -125
  60. package/driver/record-goods.mjs +42 -0
  61. package/driver/reference-score.mjs +4 -1
  62. package/driver/register-reach.mjs +39 -0
  63. package/driver/registry-fidelity.mjs +3 -8
  64. package/driver/repair-composers.mjs +6 -2
  65. package/driver/repair-targets.mjs +4 -1
  66. package/driver/run-delivered.mjs +6 -1
  67. package/driver/runner.mjs +73 -29
  68. package/driver/scope-facts.mjs +27 -6
  69. package/driver/search-policy.mjs +9 -4
  70. package/driver/stages.mjs +3 -3
  71. package/driver/steps/overview-and-cards.mjs +50 -14
  72. package/driver/steps/verdict-gate.mjs +33 -13
  73. package/driver/suite-census.json +368 -68
  74. package/driver/terminal-clamp.mjs +6 -1
  75. package/mcp-server/CHANGELOG.md +4 -0
  76. package/mcp-server/lib/audit-view.mjs +5 -2
  77. package/mcp-server/lib/brief.mjs +2 -1
  78. package/mcp-server/lib/evidence.mjs +31 -4
  79. package/mcp-server/lib/knockout.mjs +1 -1
  80. package/mcp-server/lib/scrub.mjs +1 -1
  81. package/mcp-server/package.json +1 -1
  82. package/mcp-server/server.mjs +5 -3
  83. package/package.json +4 -1
  84. package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-CtkllKJ2.js} +225 -77
  85. package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
  86. package/portal-ui/dist/index.html +2 -2
  87. package/portal-ui/package.json +3 -3
  88. package/providers/_shared/ledger.mjs +30 -2
  89. package/providers/_shared/record-uri.mjs +15 -0
  90. package/providers/clarivate/src/adapter.js +11 -0
  91. package/providers/clarivate/src/core.js +17 -1
  92. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  93. package/providers/oauth-mcp-bridge/package.json +1 -1
  94. package/scripts/README.md +147 -3
  95. package/scripts/e2e-first-time.mjs +3 -3
  96. package/scripts/freeze-example-run.mjs +3 -3
  97. package/scripts/mint-search-level-tags.mjs +61 -0
  98. package/scripts/mint-source-pin-census.mjs +89 -0
  99. package/scripts/release-note-required.mjs +65 -6
  100. package/scripts/test-durations-reporter.mjs +25 -0
  101. package/scripts/test-full.mjs +72 -18
  102. package/scripts/test-run.mjs +18 -1
  103. package/shared/brand.mjs +85 -5
  104. package/shared/inline-markdown.mjs +53 -0
  105. package/shared/portal-tokens.mjs +2 -1
  106. package/shared/register-selection.mjs +8 -3
  107. package/shared/search-level-tags.json +25 -0
  108. package/shared/tools/derive-band-pairs.mjs +10 -0
  109. package/driver/own-rights.mjs +0 -83
  110. package/driver/use-check.mjs +0 -85
@@ -156,6 +156,48 @@ export function recordGoodsProvenance(body) {
156
156
  return { operation: "undocumented", field: "none" };
157
157
  }
158
158
 
159
+ /**
160
+ * The goods of one official record body AS THE REGISTER HOLDS THEM, for a reader who asks for the original wording:
161
+ * [{classes, text, language, translation}], one entry per class statement. `text` is the statement in its own
162
+ * language, copied; `language` is that language where the record names it, else null; `translation` is the
163
+ * provider's machine translation with its language, or null. A provider's marker for no goods is no statement.
164
+ * PURE, over the same shapes recordGoods reads; a statement the record holds in several languages gives one entry
165
+ * per language.
166
+ */
167
+ export function recordGoodsAsRegistered(body) {
168
+ const b = Array.isArray(body) ? body[0] : body;
169
+ if (!b || typeof b !== "object") return [];
170
+ const out = [];
171
+ const lang = (l) => String(l ?? "").trim() || null;
172
+ const push = (classes, text, language, translation = null) => {
173
+ const t = String(text ?? "").trim();
174
+ if (!t || isNoGoodsMarker(t, language)) return;
175
+ out.push({ classes: [...new Set((classes ?? []).map(niceClass).filter(Boolean))], text: t, language: lang(language), translation });
176
+ };
177
+ if (Array.isArray(b.goodsServices)) {
178
+ for (const g of b.goodsServices) {
179
+ const tr = String(textOf(g?.translation) ?? "").trim();
180
+ push(g?.classes, textOf(g?.description), g?.language,
181
+ tr && !isNoGoodsMarker(tr, g?.translation_language) ? { text: tr, language: lang(g?.translation_language) } : null);
182
+ }
183
+ }
184
+ if (out.length === 0 && Array.isArray(b?._raw?.classifications))
185
+ for (const c of b._raw.classifications) push([c?.nice_class], c?.goods_services_text, c?.goods_services_language);
186
+ if (out.length === 0 && b.goodsAndServices != null) {
187
+ const gs = b.goodsAndServices;
188
+ if (typeof gs === "string") push([], gs, null);
189
+ else if (Array.isArray(gs)) {
190
+ for (const g of gs) {
191
+ if (typeof g === "string") { push([], g, null); continue; }
192
+ const classes = [g?.classNumber ?? g?.class ?? g?.niceClass ?? g?.nice_class];
193
+ if (Array.isArray(g?.description)) for (const d of g.description) push(classes, textOf(d), d?.language);
194
+ else push(classes, textOf(g?.description ?? g?.text ?? g?.goods), null);
195
+ }
196
+ }
197
+ }
198
+ return out;
199
+ }
200
+
159
201
  // THE RAW GOODS LIST SAYS NOTHING THE NORMALISED ONE DOES NOT. A Clarivate record holds its goods twice: as the
160
202
  // register wrote them (`_raw.goodsServices.intClassDescriptions`) and as the provider maps them, item for item,
161
203
  // into `goodsServices` beside it (providers/clarivate/src/core.js `normalizeGoodsServices`). On a crowded test
@@ -1867,7 +1867,10 @@ export function readJxLanes(doc) {
1867
1867
  return { recorded: true, asked: v.asked ?? null, ran: v.ran ?? null,
1868
1868
  shortfall: typeof v.shortfall === "boolean" ? v.shortfall : null,
1869
1869
  cause: typeof v.cause === "string" ? v.cause : null,
1870
- why: typeof v.why === "string" ? v.why : null };
1870
+ why: typeof v.why === "string" ? v.why : null,
1871
+ // A depth the record cannot confirm says so to the client in the owner's sentence; what the record does say,
1872
+ // slice by slice, rides beside it as `detail` (jx.mjs), and the scorer keeps it.
1873
+ ...(typeof v.detail === "string" ? { detail: v.detail } : {}) };
1871
1874
  })(),
1872
1875
  // ONLY the fold can state fold health. The declaration is frozen before the fold runs, so a
1873
1876
  // `degraded` there would be a health claim about work not yet done — the fallback leg that used
@@ -0,0 +1,39 @@
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
+ // register-reach.mjs — what the run's register service reaches, against the markets the order is for. PURE.
4
+ //
5
+ // A worldwide order's coverage line read "registers: worldwide (Signa)" while the service searches 15 offices, and
6
+ // whether a market outside them was named anywhere depended on what the writer chose to write: on three deliveries
7
+ // of one order, Vietnam was named on none. The line now states the reach and names the markets outside it, and code
8
+ // writes a "Not searched" row for each of those markets (owner, 2026-11-18).
9
+ //
10
+ // THE REACH IS THE SERVICE'S OWN CONTRACT: the covered office list its capabilities declare, which is the list it
11
+ // searches, and a market is outside it when the contract cannot translate it to an office. The coverage line and
12
+ // the rows both read this one answer, so they cannot disagree. A service that declares no office list (Corsearch)
13
+ // has no reach to state, and the answer is null.
14
+ import { capabilitiesFor } from "./register-capabilities.mjs";
15
+ import { territoryKey } from "./territory-tiers.mjs";
16
+
17
+ /**
18
+ * `{ service, offices, uncovered }` for a provider and the order's markets, or null when the provider declares no
19
+ * office list. `uncovered` keeps the markets' own order, folded to the territory vocabulary's codes, once each.
20
+ */
21
+ export function registerReach(providerId, markets = []) {
22
+ if (!providerId) return null;
23
+ let caps;
24
+ try { caps = capabilitiesFor(providerId); } catch { return null; }
25
+ const offices = caps?.offices;
26
+ if (!Array.isArray(offices?.covered) || !offices.covered.length || typeof offices.translate !== "function") return null;
27
+ const seen = new Set();
28
+ const uncovered = [];
29
+ for (const m of Array.isArray(markets) ? markets : []) {
30
+ const code = territoryKey(m);
31
+ if (!code || seen.has(code)) continue;
32
+ seen.add(code);
33
+ if (offices.translate(code) == null) uncovered.push(code);
34
+ }
35
+ return { service: caps.label ?? providerId, offices: offices.covered.length, uncovered };
36
+ }
37
+
38
+ /** The reason a code-written "Not searched" row gives, in the words approved for it (owner, 2026-11-18). */
39
+ export const NOT_COVERED_REASON = "the register service does not cover this office";
@@ -19,6 +19,7 @@ import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, openSy
19
19
  import { join } from "node:path";
20
20
  import { ledgerPath, runRecordLogPath, ledgerDeprecationNotice, retiredGlobalRecordLogNotice }
21
21
  from "../providers/_shared/ledger-path.mjs";
22
+ import { normalizeRecordUri } from "../providers/_shared/record-uri.mjs"; // one record key for every reader of the record log
22
23
  import { recordedRegister } from "./engine/run-choices.mjs"; // the register the run recorded, which named its receipts
23
24
  import { envFrom } from "../shared/env-aliases.mjs"; // — resolves EITHER spelling; names the retired one because that is the live-writable half
24
25
  import { USE_SOURCE_QUALITY } from "./findings-model.mjs"; // — the attested vocabulary; an unknown value falls back to the heuristic
@@ -625,14 +626,8 @@ export function classifyUseSource(url, ownerName = "") {
625
626
  // use meter whose use_check source is a register mirror (register listing ≠ use evidence) — by URL
626
627
  // host OR by the model's own `quality` attestation, whichever is stricter. PURE
627
628
  // (mutates only the private `_status`/`_useSourceClass` display fields, like bindFindingsToRecords).
628
- // WP-receipts W2 (the VENZY join defect): meter sources sometimes arrive as FULL provider URLs
629
- // (https://tm.corsearch.com/mark/ae/229552) while the record set keys on /mark/ paths — without
630
- // normalization a genuinely FETCHED record demotes to "assumed" at render, with a false integrity
631
- // flag on top. Same broad id shape as pipeline.mjs CITED_URI_RE.
632
- export function normalizeRecordUri(src) {
633
- const m = String(src ?? "").trim().match(/\/mark\/[a-z]{2,6}\/[a-z0-9][a-z0-9_-]*/i);
634
- return m ? m[0].toLowerCase() : "";
635
- }
629
+ // The record key, kept beside the run record log's index so the two cannot drift (record-uri.mjs says why).
630
+ export { normalizeRecordUri };
636
631
 
637
632
  // ── spec 64 (B3) — opposition-window extraction ─────────────────────────────────────────────────────────
638
633
  // The DEMVENZY drop: teal-conduit recorded "CH opposition window open to 2026-07-13"; copper-causeway's
@@ -181,7 +181,7 @@ const correctiveRules = ({ narrative, findings, placement, rulingsTail, adds = f
181
181
  `CORRECT ONLY THE FLAGGED COVERAGE ACCOUNT. Preserve true, relevant coverage facts already in ${narrative}. Where a flagged passage mixes a true fact with an error, correct only the error; you may restate the supported part or correct its factual details from an identified record held at this step. Read that record before relying on it, and keep its question, territory, class, mode and outcome limits. A zero for one question is not a general absence of rights, and a failed, skipped or unread question is not a zero. If the supporting record is unavailable or does not settle the claim, remove the unsupported part and keep the uncertainty explicit. Reconcile the corresponding coverage fields. Do not reopen unrelated coverage, add a new search or claim more than the held record establishes.`,
182
182
  `IF YOU REMOVE THE SUPPORT FOR A CLAIM, THE CLAIM GOES WITH IT. Deleting the evidence and leaving the sentence standing does not make it safer, it makes it unsupported and therefore stronger than the record allows. A run was refused for exactly this.`,
183
183
  `1. Correct the flagged narrative sections — send back ONLY the sections a flag names, and every section the flags do not name is left out and comes back byte-identical;`,
184
- `2. mirror every correction into the finding objects the flags name (owner names, levels/composites, meters). A finding the review KILLS is not deleted: keep its object, set "disposition": "withdrawn" and add "withdrawn_reason": "<the review flag that killed it>". Add a "corrections": {"applied": true, "note": "<one line per flagged entity: corrected / withdrawn / no-change-because-…>"} marker inside the call's \`findings\` object.`,
184
+ `2. mirror every correction into the finding objects the flags name (owner names, levels/composites, meters). A finding the review KILLS is not deleted: keep its object, set "disposition": "withdrawn" and add "withdrawn_reason": "<the review flag that killed it>". When you withdraw a finding or maintain a record's declination, reassess the actions that depended on it, by their text and named parties as well as their ordinals. Remove an unsupported action or its unsupported part. Retain a party or a demand only where surviving evidence supports it; another live finding with a similar name is not that support by itself. Keep an otherwise eligible unidentified-proprietor lead visible through the existing open identification route, without restoring its withdrawn rating. Add a "corrections": {"applied": true, "note": "<one line per flagged entity: corrected / withdrawn / no-change-because-…>"} marker inside the call's \`findings\` object.`,
185
185
  // THE LINES THAT ARE NOT A FINDING. A coverage note, an action and the mark assessment carry no
186
186
  // ordinal, so step 2 cannot reach them, and nothing said where a rewrite of one goes: seven such
187
187
  // flags survived one clearance on the test box, each recorded as naming nothing (2026-09-11). The
@@ -189,7 +189,11 @@ const correctiveRules = ({ narrative, findings, placement, rulingsTail, adds = f
189
189
  // — and this names it. The coverage-account rule above forbids claims the held record does not establish;
190
190
  // a wording change keeps a note's facts and a factual error in one is corrected under that rule. The text
191
191
  // says both, or the seat reads the two as a conflict and does nothing, which is what it did.
192
- `3. A flag about a line the reader sees that is NOT a finding — a coverage row's "note", an action's "text", or the mark assessment's "distinctiveness" or "connotation" — is applied in the same PATCH, inside the call's \`findings\` object beside the "corrections" marker: send the complete \`coverage\` array (every row, the unflagged ones exactly as you last sent them), the complete \`actions\` array, or the complete \`mark_assessment\` object, with the flagged line rewritten. A row left out of the array is a row deleted, so send every row. A wording-only change to a coverage note preserves its area, state and supported facts. If the flag identifies a factual error, correct that error and any corresponding coverage fields under the flagged-coverage rule above; preserve the supported facts and the limits of the identified held record. Leave unrelated coverage unchanged. A flagged line you leave as written is named in the "corrections" note with the reason, as the flag names it — for example: the coverage line for "<area>": no-change-because …`,
192
+ // A STEP RESTING ON A CHANGED FINDING IS IN SCOPE, AND A ROW IS REMOVED ON PURPOSE. Step 2 withdraws a finding and
193
+ // step 3 reached only the lines a flag named, while telling the writer to send every row: in testing (2026-11-17) the
194
+ // correction kept steps whose support it had just rejected. Steps 2 and 3 now reassess those steps by their text and
195
+ // the parties they name, and the complete array still carries the change. Design's wording (2026-11-17).
196
+ `3. A flag about a line the reader sees that is NOT a finding — a coverage row's "note", an action's "text", or the mark assessment's "distinctiveness" or "connotation" — and actions dependent on a finding or disposition changed by the correction are applied in the same PATCH, inside the call's \`findings\` object beside the "corrections" marker: send the complete \`coverage\` array (every row, the unflagged ones exactly as you last sent them), the complete \`actions\` array, or the complete \`mark_assessment\` object, with the flagged line rewritten. A row omitted from an array is deleted. Preserve every unaffected row; remove an action, or its unsupported part, when its support has been rejected. Do not preserve an unsupported action merely to keep the array complete. A wording-only change to a coverage note preserves its area, state and supported facts. If the flag identifies a factual error, correct that error and any corresponding coverage fields under the flagged-coverage rule above; preserve the supported facts and the limits of the identified held record. Leave unrelated coverage unchanged. A flagged line you leave as written is named in the "corrections" note with the reason, as the flag names it — for example: the coverage line for "<area>": no-change-because …`,
193
197
  // THE ANSWERS THAT NAME THE FINDINGS. The four answers cite the findings they rest on by ordinal, and step 3 names
194
198
  // the other registers a correction may send but not this one, so a correction that raised a finding to High left
195
199
  // the third-party-rights answer naming findings 1 to 3 (test run, 2026-11-03). The transport always took it. Design's
@@ -130,11 +130,14 @@ const CITATION_CORRECTION = "The listed references point to findings that have b
130
130
  + "Reassess the affected answers, actions, and conclusions against the surviving findings. "
131
131
  + "Cite a surviving finding only where its evidence supports the statement; otherwise correct the statement. "
132
132
  + "Preserve unaffected work and record the corrections through the existing correction tool.";
133
+ // A forward step's repair adds design's instruction for the step itself (2026-11-17), word for word: a step is read by its
134
+ // text and the parties it names as well as its citations. The overview's repair keeps the general instruction alone.
135
+ const ACTION_REASSESSMENT = "Reassess the action's text as well as its citations, including each party it names. If its only support was withdrawn or rejected, remove the action; removing its citations or making it a run-level action does not preserve a valid basis. Where surviving evidence supports only part of an action, keep that part and remove the unsupported part, including names that belonged only to it. Do not restore a withdrawn finding or promote a declined record merely to introduce a name. Preserve any independently supported open identification task through the existing unidentified-proprietor route, with its held source and named open coverage row.";
133
136
 
134
137
  /** A forward step's citations in the same words, each reference naming the step that holds it. PURE. */
135
138
  function actionCitationDetail(cites) {
136
139
  const each = cites.map((c) => `action ${c.action}, finding ${c.ordinal} (${c.withdrawn ? "withdrawn" : "absent"})`);
137
- return `References: ${each.join("; ")}. ${CITATION_CORRECTION}`;
140
+ return `References: ${each.join("; ")}. ${CITATION_CORRECTION} ${ACTION_REASSESSMENT}`;
138
141
  }
139
142
 
140
143
  /** The overview's citation fault in words, for its repair. PURE. */
@@ -15,6 +15,7 @@ import { degradedParts, writeDegradedParts } from "./degraded-parts.mjs";
15
15
  import { config } from "./driver.config.mjs";
16
16
  import { registerAdapter } from "./engine/run-choices.mjs"; // the run's register adapter, from ctx.register
17
17
  import { note, runLog } from "./log.mjs";
18
+ import { markLogos, logosStep } from "./mark-logos.mjs";
18
19
  import { NOT_COMPLETED_DIR } from "./parts-not-completed.mjs";
19
20
  import { deliveryForRun } from "./profiles.mjs";
20
21
  import { finalStepFields, readRunStatus, recordTransition, signoffPatch, writeRunStatus } from "./progress.mjs";
@@ -31,7 +32,7 @@ import { stampTokenRollup } from "./tokens.mjs";
31
32
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
32
33
  import { join } from "node:path";
33
34
 
34
- export async function deliveryEndState({ P, agent, ctx, job, run }, helpers) {
35
+ export async function deliveryEndState({ P, agent, ctx, job, run, opts = {} }, helpers) {
35
36
  const { applyScopeFrontMatterOf, archive, assessmentCoverageOfRun, localLanguageStateOf, reportIdentityRecord, searchLogAuditMd, sentinel, setAsideTheAssessment, writeScopeFactsOf } = helpers;
36
37
  // ── PUBLISHING AND DELIVERING: ONE PATH, FOR EVERY RUN THAT DELIVERS ─────────────────────────────────
37
38
  //
@@ -66,6 +67,10 @@ export async function deliveryEndState({ P, agent, ctx, job, run }, helpers) {
66
67
  const degraded = writeDegradedParts(run.runDir, degradedParts(run.runDir, { localLanguage }));
67
68
  runLog(run.runDir, { event: "degraded-parts", parts: degraded.parts.map((d) => ({ part: d.part, cause: d.cause })) });
68
69
  } catch (e) { runLog(run.runDir, { event: "degraded-parts-failed", cause: String(e?.message ?? e).slice(0, 200) }); }
70
+ // THE LOGOS, once the findings are final and before the page is built (mark-logos.mjs): one image request per
71
+ // cited registration whose record carries a logo, from this run's own register. It never stops the publish.
72
+ logosStep(run.runDir, await markLogos(run.runDir, { findingsPath: P.findings, provider: (() => { try { return registerAdapter(ctx.register ?? null); } catch { return null; } })(),
73
+ injectedFetcher: Boolean(opts.recordFetcher), agentId: agent }));
69
74
  published = await publishReport({
70
75
  runId: `${run.slug}-${run.date}-${run.codename}`, codename: run.codename,
71
76
  reportMd: P.report, auditMd: P.audit, findingsJson: P.findings, poolRoot: config.poolRoot, poolUrl: config.poolUrl,
package/driver/runner.mjs CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  import "../shared/env-local.mjs"; // side effect: apply <repo>/.env when THIS file is the CLI entry (never on library import)
22
22
  import "./engine/mcp/http-dispatcher.mjs"; // side effect: raise undici headersTimeout (code-side fetches)
23
- import { readdirSync, renameSync, existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync, rmSync, statSync } from "node:fs";
23
+ import { readdirSync, renameSync, existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync, rmSync, statSync, watch as watchFolder } from "node:fs";
24
24
  import { join, dirname, basename } from "node:path"; import { studioDirFor } from "../shared/pre-rename-spellings.mjs";
25
25
  import { crossBuildResumeRefusal } from "./one-build-per-run.mjs"; // a run is finished on the build it started on (owner, 2026-11-09)
26
26
  // The queue's filename vocabulary, in ONE place — the rule, extended by to the prose-sidecar and
@@ -2392,6 +2392,36 @@ const WATCH_WAKE_JUMP_MS = 15_000; // wall clock outrunning a slice by this mu
2392
2392
  // same trap the gateway-preflight hold documents.
2393
2393
  const sleepRefd = (ms) => new Promise((r) => setTimeout(r, ms));
2394
2394
 
2395
+ // ── A JOB FILE WAKES THE LOOP; THE TICK STAYS THE GUARANTEE ─────────────────────────────────────────────
2396
+ //
2397
+ // Between ticks an order waited for the next one: up to 90 s, about 45 s on average, before a search it was
2398
+ // accepted for began, and it fell before the run's own start time, so no record showed it. Measured on the two
2399
+ // production clearances whose order carries `enqueuedAt`: 1.1 and 1.4 minutes from queue to start. So each
2400
+ // queue folder the drain reads is watched, and a `.json` landing in one ends the wait. The watch only says when
2401
+ // to LOOK: the tick that follows reads the folders exactly as a timed tick does, whole job files only.
2402
+ //
2403
+ // `fs.watch` misses events on network filesystems and in some macOS and Windows cases, and a folder can fail
2404
+ // to be watched at all; each of those leaves the 90 s tick, as before. The watchers never keep the process
2405
+ // alive, and the folder list is re-read every tick, because a workspace created after start has a queue too.
2406
+ const WATCH_SETTLE_MS = 250; // a burst of arrivals inside this window starts one drain, not one per file
2407
+
2408
+ /** Watch every queue folder the drain reads; `onJob` on a `.json` arrival. Returns `{ rearm, close }`. */
2409
+ export function watchQueueFolders(onJob, folders = () => config.queueDirs) {
2410
+ const watchers = new Map();
2411
+ const rearm = () => {
2412
+ for (const q of folders()) {
2413
+ if (watchers.has(q)) continue;
2414
+ try {
2415
+ const w = watchFolder(q, { persistent: false }, (_kind, name) => { if (!name || String(name).endsWith(".json")) onJob(); });
2416
+ w.on("error", () => { w.close(); watchers.delete(q); });
2417
+ watchers.set(q, w);
2418
+ } catch { /* not watchable here: the tick reads it */ }
2419
+ }
2420
+ };
2421
+ rearm();
2422
+ return { rearm, close: () => { for (const w of watchers.values()) w.close(); watchers.clear(); } };
2423
+ }
2424
+
2395
2425
  // WAKE FROM SUSPEND. A closed lid is the normal condition for a multi-hour job, and a single
2396
2426
  // setTimeout(90s) handles it badly in both directions depending on the platform: timers run on a
2397
2427
  // MONOTONIC clock that stops while a Linux laptop is suspended, while `resetsAt` and postponedDueAt are
@@ -2422,39 +2452,53 @@ export async function watch({
2422
2452
  // thing keeping this process alive.
2423
2453
  beatEveryMs = WATCH_TICK_MS,
2424
2454
  startBeating = (fn, everyMs) => { const t = setInterval(fn, everyMs); t.unref?.(); return () => clearInterval(t); },
2455
+ // A job file arriving ends the wait early (see watchQueueFolders). Injectable so the arms can watch a folder
2456
+ // of their own, or none.
2457
+ queueWatch = (onJob) => watchQueueFolders(onJob), settleMs = WATCH_SETTLE_MS,
2425
2458
  } = {}) {
2426
2459
  note(`[runner] watch: checking every ${Math.round(tickMs / 1000)}s for a search to start or to resume. Ctrl-C to stop.`);
2427
- for (let n = 0; ; n++) {
2428
- if (stopped()) break;
2429
- // One bad tick must never end the loop — that would put us back where a laptop started, with nothing
2430
- // re-invoking anything. main() already isolates per-queue failures; this catches everything above them.
2431
- // — the beat goes BEFORE the tick's work, not after. The portal reads this to tell "waiting for
2432
- // a worker that is not running" from "waiting its turn", and a beat written only on completion would
2433
- // leave a freshly-started worker looking absent for its whole first tick — which is exactly the window
2434
- // a user watches after pressing Start.
2435
- heartbeat();
2436
- const stopBeating = startBeating(heartbeat, beatEveryMs);
2437
- try { await run({ once: true }); }
2438
- catch (e) { note(`[runner] watch tick FAILED (isolated — retrying next tick): ${e?.message ?? e}`); }
2439
- // Reached on every path out of the tick, including the one where the catch above swallows a
2440
- // failure. A timer left running would go on beating for a worker that had stopped — the one
2441
- // direction this file's fail-safe rule forbids, because it is the reading nobody checks twice.
2442
- finally { stopBeating(); }
2443
- if (n + 1 >= ticks) break;
2444
- const due = now() + tickMs;
2445
- for (;;) {
2460
+ // Arrivals during a drain are not lost and not raced: they leave `woken` set, and the drain's next pass starts as
2461
+ // soon as this one ends. Never a second main() beside one in flight.
2462
+ let woken = false, rouse = null;
2463
+ const watcher = queueWatch(() => { woken = true; rouse?.(); });
2464
+ try {
2465
+ for (let n = 0; ; n++) {
2446
2466
  if (stopped()) break;
2447
- const before = now();
2448
- const asked = Math.min(sliceMs, due - before);
2449
- if (asked <= 0) break;
2450
- await sleep(asked);
2451
- const elapsed = now() - before;
2452
- if (elapsed > asked + wakeJumpMs) {
2453
- note(`[runner] watch: ${Math.round(elapsed / 1000)}s of wall clock passed during a ${Math.round(asked / 1000)}s sleep — treating this as wake-from-suspend and ticking now, so a window that elapsed while asleep is not waited out again`);
2454
- break;
2467
+ watcher?.rearm?.();
2468
+ woken = false;
2469
+ // One bad tick must never end the loop — that would put us back where a laptop started, with nothing
2470
+ // re-invoking anything. main() already isolates per-queue failures; this catches everything above them.
2471
+ // — the beat goes BEFORE the tick's work, not after. The portal reads this to tell "waiting for
2472
+ // a worker that is not running" from "waiting its turn", and a beat written only on completion would
2473
+ // leave a freshly-started worker looking absent for its whole first tick — which is exactly the window
2474
+ // a user watches after pressing Start.
2475
+ heartbeat();
2476
+ const stopBeating = startBeating(heartbeat, beatEveryMs);
2477
+ try { await run({ once: true }); }
2478
+ catch (e) { note(`[runner] watch tick FAILED (isolated — retrying next tick): ${e?.message ?? e}`); }
2479
+ // Reached on every path out of the tick, including the one where the catch above swallows a
2480
+ // failure. A timer left running would go on beating for a worker that had stopped — the one
2481
+ // direction this file's fail-safe rule forbids, because it is the reading nobody checks twice.
2482
+ finally { stopBeating(); }
2483
+ if (n + 1 >= ticks) break;
2484
+ const due = now() + tickMs;
2485
+ for (;;) {
2486
+ if (stopped()) break;
2487
+ if (woken) { await sleep(settleMs); break; } // let a burst of arrivals land, then one drain reads them all
2488
+ const before = now();
2489
+ const asked = Math.min(sliceMs, due - before);
2490
+ if (asked <= 0) break;
2491
+ await Promise.race([sleep(asked), new Promise((r) => { rouse = r; })]);
2492
+ rouse = null;
2493
+ if (woken) continue;
2494
+ const elapsed = now() - before;
2495
+ if (elapsed > asked + wakeJumpMs) {
2496
+ note(`[runner] watch: ${Math.round(elapsed / 1000)}s of wall clock passed during a ${Math.round(asked / 1000)}s sleep — treating this as wake-from-suspend and ticking now, so a window that elapsed while asleep is not waited out again`);
2497
+ break;
2498
+ }
2455
2499
  }
2456
2500
  }
2457
- }
2501
+ } finally { watcher?.close?.(); }
2458
2502
  note(`[runner] watch: stopped${stopSignal ? ` (${stopSignal})` : ""} — anything still parked resumes the next time this runs.`);
2459
2503
  }
2460
2504
 
@@ -27,6 +27,8 @@
27
27
 
28
28
  import { classTokensFromScopeText, isCapabilityGapReason } from "./coverage-ledger.mjs";
29
29
  import { capabilitiesFor } from "./register-capabilities.mjs";
30
+ import { registerReach } from "./register-reach.mjs";
31
+ import { regionName } from "./publish/regions.mjs";
30
32
 
31
33
  const clsStr = (c) => String(c ?? "").trim();
32
34
 
@@ -66,7 +68,7 @@ const entryIsNonLatinScript = (e) => {
66
68
  * `classes_line`/`coverage_line` are null when there is genuinely nothing to compute — the caller
67
69
  * (applyScopeFrontMatter) then leaves the surface untouched rather than stamping an empty claim.
68
70
  */
69
- export function deriveScopeFacts({ instructedScope = null, plan = null, planExecution = null, coverageRows = [], withheldQids = [] } = {}) {
71
+ export function deriveScopeFacts({ instructedScope = null, plan = null, planExecution = null, coverageRows = [], withheldQids = [], markets = [] } = {}) {
70
72
  const instructedClasses = (Array.isArray(instructedScope?.classes) ? instructedScope.classes : (plan?.nice_classes ?? []))
71
73
  .map(clsStr).filter((c) => c);
72
74
  const entries = Array.isArray(plan?.entries) ? plan.entries : [];
@@ -222,10 +224,13 @@ export function deriveScopeFacts({ instructedScope = null, plan = null, planExec
222
224
  const searched_jurisdictions = Array.isArray(plan?.regions) ? plan.regions.map(String) : [];
223
225
  const scope_basis = plan?.scope_basis === "worldwide" ? "worldwide" : null;
224
226
  const register_service = registerServiceOf(plan);
227
+ // A worldwide order's reach, against the markets the order is for (register-reach.mjs). Null for a named list, and for
228
+ // a service that declares no office list, which keep the lines they had.
229
+ const register_reach = scope_basis === "worldwide" ? registerReach(plan?.provider, markets) : null;
225
230
 
226
231
  const classes_line = instructedClasses.length ? instructedClasses.join(", ") : null;
227
232
  const coverage_line = instructedClasses.length && entries.length
228
- ? buildCoverageLine(instructedClasses, per_class, { searched_jurisdictions, scope_basis, instructedScope, register_service })
233
+ ? buildCoverageLine(instructedClasses, per_class, { searched_jurisdictions, scope_basis, instructedScope, register_service, register_reach })
229
234
  : null;
230
235
 
231
236
  return {
@@ -237,6 +242,7 @@ export function deriveScopeFacts({ instructedScope = null, plan = null, planExec
237
242
  per_class,
238
243
  searched_jurisdictions,
239
244
  ...(scope_basis ? { scope_basis } : {}),
245
+ ...(register_reach ? { register_reach } : {}),
240
246
  classes_line,
241
247
  coverage_line,
242
248
  };
@@ -262,7 +268,7 @@ export function deriveScopeFacts({ instructedScope = null, plan = null, planExec
262
268
  // clause is word-for-word the same are stated ONCE, over the classes they are about. Nothing is pooled
263
269
  // and no number moves: the grouping is on the rendered text, so two classes only share a line when the
264
270
  // line they would each have printed is already the same string.
265
- function buildCoverageLine(classes, per_class, { searched_jurisdictions = [], scope_basis = null, instructedScope = null, register_service = null } = {}) {
271
+ function buildCoverageLine(classes, per_class, { searched_jurisdictions = [], scope_basis = null, instructedScope = null, register_service = null, register_reach = null } = {}) {
266
272
  const sorted = [...classes].sort((a, b) => (Number(a) || 0) - (Number(b) || 0));
267
273
  const byBody = new Map();
268
274
  for (const c of sorted) {
@@ -275,7 +281,7 @@ function buildCoverageLine(classes, per_class, { searched_jurisdictions = [], sc
275
281
  // bodies A, B, A renders "Classes 5 and 32: A; Class 9: B", not A twice.
276
282
  const groups = [...byBody.entries()].map(([body, classes]) => ({ body, classes }));
277
283
  const head = (cs) => (cs.length === 1 ? `Class ${cs[0]}` : `Classes ${joinAnd(cs.map(String))}`);
278
- return `${groups.map((g) => `${head(g.classes)}: ${g.body}`).join("; ")}${jurisdictionTail({ searched_jurisdictions, scope_basis, instructedScope, register_service })}`;
284
+ return `${groups.map((g) => `${head(g.classes)}: ${g.body}`).join("; ")}${jurisdictionTail({ searched_jurisdictions, scope_basis, instructedScope, register_service, register_reach })}`;
279
285
  }
280
286
 
281
287
  // One plain-language clause per class, routed on the COUNTS (state-agnostic), not on the state label.
@@ -359,17 +365,32 @@ const WORLDWIDE_TOKEN_RE = /^(worldwide|world|ww|global)$/i;
359
365
  // installation and 186 on another, and a reader can only tell which by being told the service. The name is
360
366
  // the provider's own label from its capabilities contract — the same name the order form shows — read off
361
367
  // the provider the frozen plan records. A plan that records none, or one this build does not know, keeps
362
- // the bare word: a guessed name would be worse than none. Never a list of offices, never a count.
368
+ // the bare word: a guessed name would be worse than none.
369
+ // AND NOW ITS REACH (owner, 2026-11-18, replacing "never a list of offices, never a count"): where the service
370
+ // declares its office list, the line states how many offices it searched and names the order's markets outside them,
371
+ // "registers: Signa, 15 offices; <the markets, by name> not covered", and ends after the count when none is.
372
+ // THE ARTICLE, IN THIS LINE ONLY (owner, 2026-11-18). The shared country names carry none, so the approved line
373
+ // "Japan, the Philippines, Indonesia and Vietnam not covered" printed "Philippines". A name that takes "the" in English
374
+ // gets it here: a union or kingdom of states, a group of islands, a republic or territory named as one, and the plural
375
+ // names. The test is on the name, not the code, so a name the shared table changes still reads right. Rows and
376
+ // other surfaces keep the bare name.
377
+ const TAKES_THE = /^(United |(Philippines|Bahamas|Gambia|Maldives|Comoros|Seychelles|European Union|Isle of Man)$)|(Islands|Republic|Netherlands|Territories|Territory)$/;
378
+ const withArticle = (name) => (TAKES_THE.test(name) ? `the ${name}` : name);
379
+
363
380
  function registerServiceOf(plan) {
364
381
  if (!plan?.provider) return null;
365
382
  try { return capabilitiesFor(plan.provider).label ?? null; } catch { return null; }
366
383
  }
367
384
 
368
- function jurisdictionTail({ searched_jurisdictions = [], scope_basis = null, instructedScope = null, register_service = null } = {}) {
385
+ function jurisdictionTail({ searched_jurisdictions = [], scope_basis = null, instructedScope = null, register_service = null, register_reach = null } = {}) {
369
386
  const list = (searched_jurisdictions.length
370
387
  ? searched_jurisdictions
371
388
  : (Array.isArray(instructedScope?.jurisdictions) ? instructedScope.jurisdictions : [])).map((j) => String(j).trim()).filter((j) => j);
372
389
  if (scope_basis === "worldwide" || list.some((j) => WORLDWIDE_TOKEN_RE.test(j))) {
390
+ if (register_reach) {
391
+ const outside = register_reach.uncovered.map((c) => withArticle(regionName(c)));
392
+ return ` · registers: ${register_reach.service}, ${register_reach.offices} office${register_reach.offices === 1 ? "" : "s"}${outside.length ? `; ${joinAnd(outside)} not covered` : ""}`;
393
+ }
373
394
  return ` · registers: worldwide${register_service ? ` (${register_service})` : ""}`;
374
395
  }
375
396
  if (!list.length) return "";
@@ -170,6 +170,11 @@ export const COMPONENTS = {
170
170
  // queries included. Grids stay on the tier they run on today; this is their lever.
171
171
  // The run freezes the pair in its search policy, which is its record of what it ran on; a run frozen
172
172
  // before this rule carries none and runs as every run did before it.
173
+ // `report.tag` IS THE SHORT NAME the Clearances list prints under a name and offers as a filter: "KO",
174
+ // "Prelim", "Multi", "Full". It sits beside `identity` so a product cannot ship without naming its own,
175
+ // and the page reads it from shared/search-level-tags.json, minted from this table
176
+ // (scripts/mint-search-level-tags.mjs), never from a list of its own. A retired product has none: its runs
177
+ // carry no tag and show only under All.
173
178
  export const PRODUCT_POLICIES = {
174
179
  // ONE knockout, and it carries the register hit-counts. There used to be two levels here — a plain
175
180
  // screen and the same screen plus a filing count per name — and the offering has one Knockout search.
@@ -180,7 +185,7 @@ export const PRODUCT_POLICIES = {
180
185
  // those words ("register-cannot-count") instead of the release-note sentence that would be a lie.
181
186
  "knockout-search": {
182
187
  product: "knockout-search", stageLabel: "Knockout search", pipeline: "knockout",
183
- report: { template: "knockout", identity: "Knockout search" },
188
+ report: { template: "knockout", identity: "Knockout search", tag: "KO" },
184
189
  components: { registerProbe: true, jxLanes: false, commonLawGrid: false },
185
190
  web: { questionPreset: "pro-search", resultsPerCell: 10 },
186
191
  // — NO DEPTH ROW ON PURPOSE. Product 1 is out of scope by the spec: the knockout lane has its
@@ -189,7 +194,7 @@ export const PRODUCT_POLICIES = {
189
194
  },
190
195
  "global-preliminary-search": {
191
196
  product: "global-preliminary-search", stageLabel: "Global preliminary search", pipeline: "clearance",
192
- report: { template: "clearance", identity: "Global preliminary search" },
197
+ report: { template: "clearance", identity: "Global preliminary search", tag: "Prelim" },
193
198
  // WORLDWIDE — the higher bar everywhere it is graded.
194
199
  depth: {
195
200
  narrativeProse: "adversarial", // per-finding prose in narrative.md: `adversarial` findings only
@@ -239,7 +244,7 @@ export const PRODUCT_POLICIES = {
239
244
  // multi-country search whether or not anybody bought one.
240
245
  "multi-country-focus-search": {
241
246
  product: "multi-country-focus-search", stageLabel: "Multi-country focus search", pipeline: "clearance",
242
- report: { template: "clearance", identity: "Multi-country focus search" },
247
+ report: { template: "clearance", identity: "Multi-country focus search", tag: "Multi" },
243
248
  // MULTI-COUNTRY — the same instructions, a lower bar than worldwide.
244
249
  depth: {
245
250
  narrativeProse: "adversarial+floors", // `adversarial` findings plus tier-`identical` floor marks
@@ -289,7 +294,7 @@ export const PRODUCT_POLICIES = {
289
294
  // only where one was asked for, so this can never refuse a request we ourselves shaped.
290
295
  "full-country-search": {
291
296
  product: "full-country-search", stageLabel: "Full country search", pipeline: "clearance",
292
- report: { template: "clearance", identity: "Full country search" },
297
+ report: { template: "clearance", identity: "Full country search", tag: "Full" },
293
298
  // ONE COUNTRY — every value is TODAY'S BEHAVIOUR, declared. This row is the byte-identical guard.
294
299
  depth: {
295
300
  narrativeProse: "every-finding",
package/driver/stages.mjs CHANGED
@@ -2963,8 +2963,8 @@ export const STAGES = {
2963
2963
  // twin of the use-negative the USE-CHECK forbids. The negative literal now states exactly what was
2964
2964
  // consulted, the prompt forbids reading it as a portfolio negative, and the un-answerable case gets
2965
2965
  // the instructed-check treatment: an open row naming the missing owner query for the escalation
2966
- // lane / supplemental mint. own-rights.mjs accepts any text after "Own-rights source:", so the
2967
- // validator contract is unchanged.
2966
+ // lane / supplemental mint. The finding's `own_rights.source` carries it, and verify.mjs's
2967
+ // checkFindingsSibling asks only that it is not blank, so the validator contract is unchanged.
2968
2968
  `OWN-RIGHTS (enforced): if ANY finding's clearance reasoning relies on the client's own house mark / franchise root ("the prefix is the client's own registered mark"), run ONE own-portfolio check over the run's FROZEN register material — band_lookup with owner:<the applicant/house-mark owner> (plus band_record for any registration you cite) — and record its result in that finding's own_rights.source: <record URI(s) | "no applicant-owned registrations in the searched register material"> citing the record URIs the lookup returned. KNOW WHAT THE NEGATIVE MEANS: the searched material covers only this matter's dispatched slices (its classes, its mark texts), so an empty owner lookup is NEVER evidence the client's registrations do not exist — a house mark's own registrations usually live in the client's home classes under mark text no slice here covers. NEVER write "no registrations found" or any other portfolio-wide register-negative, and never leave the reasoning leaning on the unverified reliance: write the honest scoped negative, let the finding stand or fall without the crutch, AND record the un-run owner query (owner + house root + its home classes/key jurisdictions) as an open Coverage/open-item row so the escalation lane can propose it through the supplemental mint — the same treatment every instructed check the frozen material cannot answer gets. The affiliate-exclusion mandate covers CONFLICTS only — it never suppresses this supporting-evidence check. ALSO populate that finding's own_rights field in findings.json: {"source": "<comma-separated record URIs | no applicant-owned registrations in the searched register material>"} — the structured field is the authoritative cite.`,
2969
2969
  // CHANGE 5c (attribution source) — a named-entity attribution that is NOT itself a registry / common-law
2970
2970
  // record fact needs a source or it does not ship. (BEST EFFORT: the doc-30 Fix B exact spec is not in the
@@ -3187,7 +3187,7 @@ export const STAGES = {
3187
3187
  // author declares the kind from the legal read; code only partitions the closed enum — never a keyword
3188
3188
  // grep over prose (the spec's named failure mode). The report's "Only you can close these" section is
3189
3189
  // code-rendered FROM this register, so bucket prose and disposition can never drift apart.
3190
- `ACTIONS REGISTER (MANDATORY top-level field of the findings record you send): emit "actions": [...] — ONE object per forward step your opinion names that a HUMAN must still take, each EXACTLY {"id","kind","text","ordinals"} plus an OPTIONAL "deadline" and an OPTIONAL "condition". RULE: if your narrative, your overall reasoning, or any finding names a forward legal step (consent, coexistence, territorial delimitation, narrowing the goods, changing the mark, responding to an examiner objection or opposition, clearing a senior right, a required in-jurisdiction counsel opinion), that step MUST exist here as a typed action whose kind matches your own words — a prose-only condition is a delivery defect the reviewer flags. id: 1-based unique integer. kind: EXACTLY one of — CONDITIONS (a forward legal act must happen before the client can rely on a clean result; any one of these makes the run deliver CONDITIONAL): consent / coexistence-agreement / territorial-delimitation / goods-amendment / mark-modification / senior-clearance / proceeding-response / counsel-opinion-required; ADVISORY (never gates a clean result): client-fact (a fact only the client holds — their own prior filing, intended markets; renders as a labelled open question) / commercial-decision (a risk-appetite call that is theirs) / monitoring / filing-routine (ordinary filing mechanics — the "nothing beyond ordinary filing" home). DECLARE the kind from your legal read of what must happen, never from how severe the band is — the kind, not the band, decides CLEAR vs CONDITIONAL. text: ONE client-plain sentence starting with a capital letter that a lay client can act on — it renders VERBATIM and WHOLE in the email's "subject to:" box and the report's action list, so nothing you write here is dropped and nothing is summarised for you. IT MUST FIT ONE LINE OF THE VERDICT STATEMENT: the delivered sentence every surface joins reads "<Tier> — conditional on: <this> (and N more)." and clips at ${STATEMENT_CLAUSE_MAX} characters with an ellipsis, so an ask longer than that ends "…" on the index, the run status, the report hero, the email headline and the workbook. A delivered report carried asks of 350-600 characters. THE ASK IS THE STEP, NOT THE ARGUMENT FOR IT: the reasoning belongs in the finding this action closes (its "ordinals"), where a reader who wants it will look. If the step will not fit in one short sentence, it is not yet clear enough to ask for. LAWYER ENGLISH, NEVER ENGINE ENGLISH (§L): write what a lawyer would actually say to a client — "Investigate whether <owner> is using the mark in <market>", never "Test for non-use". An ask may NEVER name one of this system's own mechanisms as the step: no "rerun the watchlist owner-by-owner screen", no "close the script gaps by the transliteration index route", no "read the N unread registry documents". What the run read, and what it set aside with its count and reason, is the ENGINE's record — printing it as something the reader must do is a defect, not an action. Test each one: if it does not read as a sentence a lawyer would say aloud to a client, it is not an action — it is either work this run owed, or it is nothing. condition (OPTIONAL, CONDITION kinds only): the SAME demand restated as the factual open-state it closes — a FACT, never an instruction, and a fact THIS RUN ESTABLISHED (§L — never assume the client's own file): "No consent from <owner> appears on the record searched", "The examiner's objection is unanswered". Do NOT write "consent is not in hand" or "no coexistence agreement is in place": the client may hold one and no search this run ran could see it — say what the record shows, scoped to the record. The delivered verdict statement's "conditional on:" lede prefers this field over the imperative text, so type it whenever the fact reads better than the ask. ordinals: the findings[] ordinals this action closes ([] for a run-level action). deadline: {"kind","date"} (ISO date) whenever the action has a hard date — an opposition window, a statement-of-use date; a recorded register deadline that demands action must ride here, never only in prose. A clean run with nothing beyond ordinary filing legitimately emits "actions": [] — never invent an action, and never leave a named one out.`,
3190
+ `ACTIONS REGISTER (MANDATORY top-level field of the findings record you send): emit "actions": [...] — ONE object per forward step your opinion names that a HUMAN must still take, each EXACTLY {"id","kind","text","ordinals"} plus an OPTIONAL "deadline" and an OPTIONAL "condition". RULE: if your narrative, your overall reasoning, or any finding names a forward legal step (consent, coexistence, territorial delimitation, narrowing the goods, changing the mark, responding to an examiner objection or opposition, clearing a senior right, a required in-jurisdiction counsel opinion), that step MUST exist here as a typed action whose kind matches your own words — a prose-only condition is a delivery defect the reviewer flags. id: 1-based unique integer. kind: EXACTLY one of — CONDITIONS (a forward legal act must happen before the client can rely on a clean result; any one of these makes the run deliver CONDITIONAL): consent / coexistence-agreement / territorial-delimitation / goods-amendment / mark-modification / senior-clearance / proceeding-response / counsel-opinion-required; ADVISORY (never gates a clean result): client-fact (a fact only the client holds — their own prior filing, intended markets; renders as a labelled open question) / commercial-decision (a risk-appetite call that is theirs) / monitoring / filing-routine (ordinary filing mechanics — the "nothing beyond ordinary filing" home). DECLARE the kind from your legal read of what must happen, never from how severe the band is — the kind, not the band, decides CLEAR vs CONDITIONAL. text: ONE client-plain sentence starting with a capital letter that a lay client can act on — it renders VERBATIM and WHOLE in the email's "subject to:" box and the report's action list, so nothing you write here is dropped and nothing is summarised for you. IT MUST FIT ONE LINE OF THE VERDICT STATEMENT: the delivered sentence every surface joins reads "<Tier> — conditional on: <this> (and N more)." and clips at ${STATEMENT_CLAUSE_MAX} characters with an ellipsis, so an ask longer than that ends "…" on the index, the run status, the report hero, the email headline and the workbook. A delivered report carried asks of 350-600 characters. THE ASK IS THE STEP, NOT THE ARGUMENT FOR IT: the reasoning belongs in the finding this action closes (its "ordinals"), where a reader who wants it will look. If the step will not fit in one short sentence, it is not yet clear enough to ask for. LAWYER ENGLISH, NEVER ENGINE ENGLISH (§L): write what a lawyer would actually say to a client — "Investigate whether <owner> is using the mark in <market>", never "Test for non-use". An ask may NEVER name one of this system's own mechanisms as the step: no "rerun the watchlist owner-by-owner screen", no "close the script gaps by the transliteration index route", no "read the N unread registry documents". What the run read, and what it set aside with its count and reason, is the ENGINE's record — printing it as something the reader must do is a defect, not an action. Test each one: if it does not read as a sentence a lawyer would say aloud to a client, it is not an action — it is either work this run owed, or it is nothing. condition (OPTIONAL, CONDITION kinds only): the SAME demand restated as the factual open-state it closes — a FACT, never an instruction, and a fact THIS RUN ESTABLISHED (§L — never assume the client's own file): "No consent from <owner> appears on the record searched", "The examiner's objection is unanswered". Do NOT write "consent is not in hand" or "no coexistence agreement is in place": the client may hold one and no search this run ran could see it — say what the record shows, scoped to the record. The delivered verdict statement's "conditional on:" lede prefers this field over the imperative text, so type it whenever the fact reads better than the ask. ordinals: the findings[] ordinals this action closes ([] for a run-level action). deadline: {"kind","date"} (ISO date) whenever the action has a hard date — an opposition window, a statement-of-use date; a recorded register deadline that demands action must ride here, never only in prose. A clean run with nothing beyond ordinary filing legitimately emits "actions": [] — never invent an action, and never leave a named one out. An action naming a conflict party must have a basis in the surviving assessment, with that party introduced in a delivered finding or through the existing open identification route for an otherwise eligible unidentified-proprietor lead. Do not introduce a party only in the action, retain a demand whose basis you rejected, or create a finding solely to satisfy the reference check.`,
3191
3191
  `COVERAGE JUDGMENT (MANDATORY top-level field of the findings record you send): emit "coverage_judgment": {"sufficient":<bool>, "reason":"<one line: what you have seen of the dangerous category and why it is / is not enough to sign>"} — EXACTLY those two keys. Do NOT emit "rows": the driver writes that register itself, one row per open slice, from the coverage ledger and the plan-execution receipt you were handed above; anything you type there is replaced wholesale. Retyping a slice identifier is how a slice comes to be named two ways that nothing makes agree — the machine writes the row, you rule on it. Decide it on the RISK PICTURE, never a count. Its ONLY effect: sufficient:false clamps the verdict CLEAR→CONDITIONAL (the report still ships, carrying your reason). Do NOT emit commands[] or halt — there is no re-enumeration loop and no human-halt; you deliver a conditional instead:`,
3192
3192
  `- An `+"`incomplete`"+` crowd that is IMMATERIAL to the dangerous category (off-field noise, a saturated everyday-word substring pile that is not the named band) → sufficient:true. That is you, the lawyer, deciding it is enough; the run delivers clean (subject to the findings). A crowd-gated SKIPPED fringe is not itself a coverage hole, and a crowd descriptor is risk-REDUCING dilution evidence for your per-mark reasoning (cap-as-ceiling, synthesis-rules §Crowded field analysis) — only a MATERIAL uncleared slice (exact/near-identical named variant × in-scope class) drives sufficient:false, with the per-mark reason named. The descriptor's existence alone NEVER makes the verdict conditional.`,
3193
3193
  `- An `+"`incomplete`"+` band that IS material (the exact mark / a near-identical named variant in an in-scope class was NOT enumerated to has_more:false) → sufficient:false, with a reason that NAMES the un-cleared slice specifically ("the exact-NOVA PULSE × cl.9 live slice returned ~N,NNN hits and could not be fully enumerated"). The run ships CONDITIONAL and names the un-cleared dangerous slice in the RISK READ as a substantive verdict input — analysis: you, the lawyer, stating what you could not fully clear and why it bears on the answer — NOT as a "[Gap] we should close" caveat in # Actions (doc-35: the report states its reasoned view, it does not narrate an unfinished search as a client to-do). Be specific — name the slice, not "coverage limited".`,