clearotron 0.7.0-beta.2 → 0.7.0-beta.3

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 (131) hide show
  1. package/INSTALL.md +5 -5
  2. package/QUICKSTART.md +4 -4
  3. package/README.md +2 -2
  4. package/bin/README.md +3 -4
  5. package/bin/clearotron.mjs +1 -1
  6. package/bin/onboard.mjs +28 -40
  7. package/bin/status.mjs +11 -0
  8. package/build-info.json +2 -2
  9. package/docs/DELIVERY.md +30 -6
  10. package/docs/architecture/04-configuration-reference.md +1 -0
  11. package/driver/CHANGELOG.md +21 -0
  12. package/driver/compose-read.mjs +4 -3
  13. package/driver/contract-arm2-baseline.json +1 -2
  14. package/driver/contract-dictation-registry.mjs +7 -48
  15. package/driver/contract-e3-backlog.mjs +55 -52
  16. package/driver/contract-e3-baseline.json +22 -7
  17. package/driver/contract-vocabulary.mjs +4 -2
  18. package/driver/coverage-form.mjs +4 -0
  19. package/driver/coverage-rows-run.mjs +68 -4
  20. package/driver/engine/anthropic-agent.mjs +10 -13
  21. package/driver/engine/common.mjs +34 -22
  22. package/driver/engine/health.mjs +251 -0
  23. package/driver/engine/jx-turn.mjs +2 -1
  24. package/driver/engine/mcp/codex-config.mjs +16 -1
  25. package/driver/engine/mcp/crowd-note.mjs +1 -1
  26. package/driver/engine/mcp/gather-config.mjs +34 -9
  27. package/driver/engine/mcp/perplexity-server.mjs +33 -23
  28. package/driver/engine/mcp/recording-server.mjs +67 -58
  29. package/driver/engine/mcp/unit-note-server.mjs +2 -0
  30. package/driver/engine/openai-agent.mjs +9 -24
  31. package/driver/engine/probe.mjs +24 -7
  32. package/driver/findings-model.mjs +54 -0
  33. package/driver/jx-units.mjs +139 -30
  34. package/driver/knockout-assess-record.mjs +2 -2
  35. package/driver/knockout-correction-check.mjs +119 -0
  36. package/driver/knockout-correction-record.mjs +1 -1
  37. package/driver/knockout-frame-record.mjs +24 -10
  38. package/driver/knockout-review-record.mjs +35 -430
  39. package/driver/ladder/dispatch.mjs +4 -2
  40. package/driver/ladder/form-repair.mjs +5 -5
  41. package/driver/ladder/form-sync.mjs +4 -6
  42. package/driver/ladder/next-rung.mjs +10 -0
  43. package/driver/ladder/repair-messages.mjs +37 -65
  44. package/driver/ladder/stage.mjs +3 -3
  45. package/driver/ladder/turn-signals.mjs +4 -14
  46. package/driver/manual-paragraphs.mjs +22 -2
  47. package/driver/mark-logos.mjs +20 -5
  48. package/driver/package.json +1 -1
  49. package/driver/pipeline-knockout.mjs +2 -2
  50. package/driver/predelivery-lint.mjs +39 -7
  51. package/driver/product-fault.mjs +53 -0
  52. package/driver/publish/knockout.mjs +2 -1
  53. package/driver/publish/render.mjs +13 -7
  54. package/driver/recording-agreement.mjs +6 -4
  55. package/driver/register-band-run.mjs +2 -2
  56. package/driver/register-digest-record.mjs +31 -9
  57. package/driver/register-unit-record.mjs +10 -1
  58. package/driver/repair-composers.mjs +12 -11
  59. package/driver/repair-contract.mjs +6 -6
  60. package/driver/repair-targets.mjs +7 -6
  61. package/driver/run-outcome.mjs +8 -0
  62. package/driver/runner.mjs +42 -3
  63. package/driver/skills/README.md +5 -4
  64. package/driver/skills/blind-frame/SKILL.md +1 -1
  65. package/driver/skills/case-law-citation/SKILL.md +1 -1
  66. package/driver/skills/clearance-common-law/SKILL.md +6 -423
  67. package/driver/skills/clearance-common-law/grid.md +272 -0
  68. package/driver/skills/clearance-common-law/meaning.md +142 -0
  69. package/driver/skills/clearance-common-law/perplexity-prompts.md +4 -2
  70. package/driver/skills/clearance-register/SKILL.md +7 -174
  71. package/driver/skills/clearance-register/digest.md +89 -25
  72. package/driver/skills/clearance-register/providers/clarivate-questions.md +154 -0
  73. package/driver/skills/clearance-register/providers/clarivate.md +5 -149
  74. package/driver/skills/clearance-register/providers/signa-questions.md +120 -0
  75. package/driver/skills/clearance-register/providers/signa.md +3 -114
  76. package/driver/skills/clearance-register/providers/uspto-local.md +3 -3
  77. package/driver/skills/clearance-register/register-recipes.md +10 -10
  78. package/driver/skills/clearance-register/status-rules.md +2 -2
  79. package/driver/skills/clearance-register/unit.md +96 -54
  80. package/driver/skills/clearance-search/delivery-contract.md +11 -49
  81. package/driver/skills/clearance-search/firm-wide-reasoning.md +10 -13
  82. package/driver/skills/clearance-search/look-at-what-you-have.md +7 -0
  83. package/driver/skills/clearance-search/phase2-execution.md +12 -117
  84. package/driver/skills/clearance-search/report-card-rules.md +2 -2
  85. package/driver/skills/clearance-search/report-prose.md +30 -23
  86. package/driver/skills/clearance-search/synthesis-rules.md +27 -69
  87. package/driver/skills/clearance-search/worked-examples.md +11 -16
  88. package/driver/skills/clearance-variants/SKILL.md +7 -7
  89. package/driver/skills/clearance-variants/transliteration-scripts.md +2 -2
  90. package/driver/skills/frame-diff/SKILL.md +1 -1
  91. package/driver/skills/knockout-assess/SKILL.md +54 -41
  92. package/driver/skills/knockout-frame/SKILL.md +13 -12
  93. package/driver/skills/knockout-register-read/SKILL.md +2 -10
  94. package/driver/skills/matter-frame/SKILL.md +2 -2
  95. package/driver/skills/narrative-refutation/SKILL.md +7 -6
  96. package/driver/skills/placement-inquiry/SKILL.md +3 -3
  97. package/driver/skills/skeptic/SKILL.md +111 -0
  98. package/driver/skills/whatif-memo/SKILL.md +5 -2
  99. package/driver/stage-declarations.mjs +6 -0
  100. package/driver/stages-knockout.mjs +36 -38
  101. package/driver/stages.mjs +69 -64
  102. package/driver/steps/delivery.mjs +6 -4
  103. package/driver/steps/open-run.mjs +2 -0
  104. package/driver/steps/overview-and-cards.mjs +2 -2
  105. package/driver/steps/register-sweep.mjs +20 -1
  106. package/driver/steps/synthesis.mjs +28 -11
  107. package/driver/suite-census.json +213 -57
  108. package/driver/synthesis-record.mjs +24 -2
  109. package/driver/verify-knockout.mjs +23 -3
  110. package/driver/whatif-memo-run.mjs +39 -10
  111. package/driver/whatif-queue.mjs +53 -7
  112. package/mcp-server/CHANGELOG.md +4 -0
  113. package/mcp-server/lib/ops.mjs +19 -10
  114. package/mcp-server/lib/whatif.mjs +7 -6
  115. package/mcp-server/package.json +1 -1
  116. package/mcp-server/server.mjs +55 -19
  117. package/package.json +1 -1
  118. package/portal-ui/package.json +1 -1
  119. package/providers/clarivate/src/adapter.js +3 -0
  120. package/providers/jx/src/nativeread.js +5 -3
  121. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  122. package/providers/oauth-mcp-bridge/package.json +1 -1
  123. package/providers/perplexity/src/core.js +7 -2
  124. package/providers/signa/src/adapter.js +3 -0
  125. package/scripts/e2e-first-time.mjs +2 -2
  126. package/shared/connector-signin-probe.mjs +1 -1
  127. package/shared/names-in-force.mjs +1 -0
  128. package/skills/clearotron-account/SKILL.md +21 -11
  129. package/skills/clearotron-client/SKILL.md +15 -15
  130. package/skills/clearotron-ops/COURIER.md +5 -1
  131. package/skills/clearotron-ops/SKILL.md +21 -14
@@ -101,10 +101,10 @@ const log = (...a) => process.stderr.write(`[${NS}] ${a.join(" ")}\n`);
101
101
  // `instructions` — one agent platform's runtime was verified reading only tools/capabilities/name — so
102
102
  // the steer travels in the output itself and works on a client that ignores instructions entirely. Context-phrased, not imperative, so the MCP metadata
103
103
  // injection-scrubber (which redacts "ignore previous instructions" patterns) leaves it intact.
104
- const BRIEFING_NOTE =
104
+ export const BRIEFING_NOTE =
105
105
  "Plain-language layer — brief the user in this voice. Translate any risk codes (e.g. 'Level 5 = C + " +
106
- "[dispute type]') into plain English. Model names and internal stage names belong in answers only when the " +
107
- "user explicitly asks how the system reached a conclusion.";
106
+ "[dispute type]') into plain English. Name no internal model, step, tool or document in the answer. You may identify " +
107
+ "a public filing or evidence source to explain the result.";
108
108
 
109
109
  // ---- run / artifact helpers --------------------------------------------------------------------
110
110
 
@@ -404,16 +404,18 @@ const tools = {
404
404
  if (section) { const secs = parseSections(parseFront(text).body); return { ...hint, name, section, text: secs[section] ?? `(section "${section}" not found; available: ${Object.keys(secs).join(", ")})` }; }
405
405
  return { ...hint, name, file: basename(path), text };
406
406
  },
407
- list_findings({ runId, kind, sourceLayer, group }) {
407
+ list_findings({ runId, kind, sourceLayer, group }, { scope } = {}) {
408
408
  const run = mustRun(runId);
409
409
  if (isKnockoutRun(run)) {
410
410
  // `group` is the clearance report's on-field/off-field/out-of-scope curation. A knockout report has
411
- // no such sectioning, so the honest answer names that rather than filtering to nothing.
411
+ // no such sectioning, so the honest answer names that rather than filtering to nothing. A report link
412
+ // cannot call without `group` (shared/scope.mjs), so it is sent where its findings are (design, 2026-11-24).
412
413
  if (group) {
413
414
  return {
414
415
  _note: BRIEFING_NOTE, kind: "cards", group, items: [],
415
- ...notProducedOnThisProduct("on-field/off-field/out-of-scope card groups",
416
- "Call list_findings without `group` for this run's findings, each with its band."),
416
+ ...notProducedOnThisProduct("on-field/off-field/out-of-scope card groups", scope?.kind === "user"
417
+ ? "Read this run's findings in brief and in the report."
418
+ : "Call list_findings without `group` for this run's findings, each with its band."),
417
419
  };
418
420
  }
419
421
  return { _note: BRIEFING_NOTE, ...knockoutFindings(run, { kind, sourceLayer }) };
@@ -699,20 +701,20 @@ const TOOL_DEFS = [
699
701
  { name: "run_changes", description: "Change-feed for monitoring a live run: the timeline events since a timestamp, plus a cursor to poll with. MCP has no push, so poll again with since=cursor. Optional kinds[] to filter event kinds (e.g. ['verdict','skeptic-escalation','failed']).", inputSchema: { type: "object", properties: { ...runIdProp, since: { type: "string", description: "Poll cursor — a stable sequence number from a prior call's `cursor` (preferred), OR an ISO timestamp for the first call. Returns only newer events; omit for the full timeline." }, kinds: { type: "array", items: { type: "string" }, description: "Optional event-kind filter." } }, required: ["runId"] } },
700
702
  { name: "diff_artifact", description: "Diff two versions of an artifact (what actually changed between them). Versions exist only when something snapshotted them — an in-place re-dispatch (_history) or a what-if experiment (_experiments); the automated escalation/correction overwrites in place, so a normal run has only 'canonical' and there's nothing to diff (reported honestly). Defaults: a=canonical, b=newest snapshot.", inputSchema: { type: "object", properties: { ...runIdProp, name: { type: "string", description: "Artifact: registerFindings, narrative, report, placement, a register axis (e.g. primary-sweep), …" }, a: { type: "string", description: "ref for THIS run: canonical | _history/<dir> | _experiments/<dir> (must be a real snapshot of this artifact; absolute/`..` paths are rejected). Default canonical." }, b: { type: "string", description: "ref (same grammar as a). Default = newest _history snapshot for this artifact." }, axis: { type: "string", description: "Required (and validated against the known axes) only if name is a bare 'register-unit'." } }, required: ["runId", "name"] } },
701
703
  { name: "search_runs", description: "Cross-run search across ALL runs (in-flight + archived) — e.g. 'has the MYRK- root shown up in prior clearances?'. scope: findings (default; the mark/owner/search-term columns — cheapest), audit, key-artifacts (report+registerFindings+commonLaw+narrative), or all-artifacts (full text, most expensive). Same ranked all|any|phrase modes as search. Capped by maxRuns.", inputSchema: { type: "object", properties: { query: { type: "string" }, mode: { type: "string", enum: ["all", "any", "phrase"] }, scope: { type: "string", enum: ["findings", "audit", "key-artifacts", "all-artifacts"] }, agent: { type: "string" }, state: { type: "string", enum: ["running", "delivered", "failed", "postponed", "recovering", "parked-for-human", "cancelled"] }, slug: { type: "string" }, maxRuns: { type: "number" }, limit: { type: "number" } }, required: ["query"] } },
702
- { name: "what_if_plan", description: "DRY-RUN a what-if (no spend), in one of two kinds. kind 'stage' (the default) re-runs a single stage of a LIVE run: what re-runs, the cost prior, what downstream is NOT recomputed, a completeness verdict, and a confirmationToken — pass `stage`, and express the change via instructions (e.g. 'treat ACME as expired') and/or model. kind 'memo' answers a what-if about a DELIVERED report instead: a bounded re-read of that run's archived findings and records under a stated assumption, spending model tokens only — no searching, no register calls, and the report and its archive are never modified. A memo takes no stage; put the reader's own words in `instructions`.", inputSchema: { type: "object", properties: { ...runIdProp, kind: { type: "string", enum: ["stage", "memo"], description: "'stage' (default) re-runs one stage of a live run; 'memo' reasons over a delivered run's archived evidence." }, stage: { type: "string", description: "Required for kind 'stage'. A memo re-runs no stage and must not pass one." }, axis: { type: "string" }, instructions: { type: "string", description: "For kind 'memo' this is REQUIRED and is the assumption to apply, in the reader's own words." }, model: { type: "string" } }, required: ["runId"] } },
703
- { name: "what_if_run", description: "EXECUTE a planned what-if (SPENDS tokens / maybe billed calls): re-runs ONE stage in a sandbox (original untouched) and diffs it. Requires the confirmationToken from what_if_plan. Approval-gated — confirm cost before calling. Over the client connector this QUEUES the experiment on the server and returns an experimentId instead of a diff — pass `runId` too, and collect the result with what_if_result.", inputSchema: { type: "object", properties: { confirmationToken: { type: "string" }, ...runIdProp }, required: ["confirmationToken"] } },
704
+ { name: "what_if_plan", description: "DRY-RUN a what-if (no spend), in one of two kinds. kind 'stage' (the default) re-runs a single stage of a LIVE run: what re-runs, the cost prior, what downstream is NOT recomputed, a completeness verdict, and a confirmationToken — pass `stage`, and express the change via instructions (e.g. 'treat ACME as expired') and/or model. kind 'memo' answers a what-if about a DELIVERED clearance report instead: a bounded re-read of that run's archived findings under a stated assumption, spending model tokens only — no searching, no register calls, and the report and its archive are never modified. A memo takes no stage; put the reader's own words in `instructions`.", inputSchema: { type: "object", properties: { ...runIdProp, kind: { type: "string", enum: ["stage", "memo"], description: "'stage' (default) re-runs one stage of a live run; 'memo' reasons over a delivered run's archived evidence." }, stage: { type: "string", description: "Required for kind 'stage'. A memo re-runs no stage and must not pass one." }, axis: { type: "string" }, instructions: { type: "string", description: "For kind 'memo' this is REQUIRED and is the assumption to apply, in the reader's own words." }, model: { type: "string" } }, required: ["runId"] } },
705
+ { name: "what_if_run", description: "EXECUTE a planned what-if (SPENDS tokens / maybe billed calls): a stage what-if re-runs ONE stage in a sandbox (original untouched) and diffs it; a memo writes a short document beside the delivered report. Requires the confirmationToken from what_if_plan. Approval-gated — confirm cost before calling. Over the client connector this QUEUES the experiment on the server and returns an experimentId instead of a diff — pass `runId` too, and collect the result with what_if_result.", inputSchema: { type: "object", properties: { confirmationToken: { type: "string" }, ...runIdProp }, required: ["confirmationToken"] } },
704
706
  { name: "what_if_result", description: "Collect a QUEUED what-if: its state (queued | running | done | failed) and, once done, the diff against the canonical run. Pass runId and the experimentId what_if_run returned; omit experimentId to list every what-if asked of this run. The original run is never modified — the experiment lives in its own sandbox.", inputSchema: { type: "object", properties: { ...runIdProp, experimentId: { type: "string" } }, required: ["runId"] } },
705
707
  // ---- Option discovery + the free preview (NO ops token; both accountSafe, both write nothing —
706
708
  // a client connector's first two calls) ----
707
- { name: "describe_options", description: "START HERE before composing a search — the option space, for free. Returns the four searches this deployment can actually run — each with the geography it accepts, how many names it reads, its turnaround, whether it carries the case-law reading, whether the native-language investigation is optional or automatic, and a plain note when one is unavailable — plus the combination rules the servers enforce (territories, native-language routing, marketplaces, classes, names per search), and — for a client connector — YOUR OWN account: its key (the profileKey plan_run and start_run require), its projects, its saved searches (the recipeKey slugs) and what is left of today's allowance. Omit profileKey to be answered about your own account(s); pass it to ask about a specific one. Reserves nothing, spends nothing, starts nothing. Then: plan_run (free) with the arguments you intend, and start_run with the SAME arguments once the requester has confirmed.", inputSchema: { type: "object", properties: { profileKey: { type: "string", description: "OPTIONAL: the customer ACCOUNT key to describe. Omit it to be answered about the account(s) this session holds — that is how a client connector discovers the key it must pass to plan_run/start_run." } } } },
709
+ { name: "describe_options", description: "START HERE before composing a search — the option space, for free. Returns the four searches this deployment can actually run — each with the geography it accepts, how many names it reads, its turnaround, whether it carries the case-law reading, whether the native-language investigation is optional or automatic, and a plain note when one is unavailable — plus the combination rules the servers enforce (territories, native-language routing, marketplaces, classes, names per search), and — for a client connector — YOUR OWN account: its key (the profileKey plan_run and start_run require), its projects, its saved searches (the recipeKey slugs) and what is left of today's allowance. Omit profileKey to be answered about your own account(s); pass it to ask about a specific one. Reserves nothing, spends nothing, starts nothing. Then: plan_run (free) with the arguments you intend, and start_run with the SAME arguments.", inputSchema: { type: "object", properties: { profileKey: { type: "string", description: "OPTIONAL: the customer ACCOUNT key to describe. Omit it to be answered about the account(s) this session holds — that is how a client connector discovers the key it must pass to plan_run/start_run." } } } },
708
710
  { name: "plan_run", description: "FREE PREVIEW — resolve what a search WOULD do and return it, spending nothing and queueing nothing. Takes the SAME arguments as start_run. Use this BEFORE start_run whenever the requester has not already confirmed the specifics: it reports the PRODUCT that resolves and WHERE it came from (their request, the account default, a saved search, or the territories themselves), the territories and marketplaces that would ACTUALLY be searched, the turnaround, and any blockers as questions to put back. Show the result to the requester; then call start_run with the SAME arguments to actually run it. Nothing here reserves or holds anything.", inputSchema: { type: "object", properties: { markName: { type: "string", description: "The mark (single-mark form). REQUIRED unless marks[] is given." }, marks: { type: "array", items: { type: "object", properties: { name: { type: "string" }, classes: { type: "array", items: { type: "number" } }, ref: { type: "string" } }, required: ["name"] } }, classes: { type: "array", items: { type: "number" } }, goods: { type: "string" }, jurisdictions: { type: "array", items: { type: "string" }, description: JURISDICTIONS_DESC }, platforms: { type: "array", items: { type: "string" } }, customer: { type: "string" }, profileKey: { type: "string", description: "The customer ACCOUNT key (see list_profiles). OMIT it for a new or unknown client and the search runs under the neutral generic profile, which is never a reason to refuse a search — offer that and the portal route (their own company, with its own framework and territories) in the same reply. On a session whose access names accounts, omitting it needs the generic profile to be one of them; when it is not, the refusal says so and names what the session does hold (see describe_options)." }, projectKey: { type: "string" }, forwarder: { type: "string", description: "Requester/reply-routing key — same as start_run, so the preview describes the job that would actually be built. Account sessions may omit it — it is stamped from your verified identity." }, forwarderEmail: { type: "string" }, ref: { type: "string" }, product: { type: "string", enum: ORDERABLE_PRODUCTS, description: PRODUCT_DESC }, nativeLanguage: { type: "boolean", description: "OPTIONAL, and only on a multi-country-focus-search: the native-language investigation. Send TRUE or omit the field — FALSE IS REFUSED, not honoured: the toggle only ever added, so there is nothing for false to switch off, and accepting it would let you believe you had removed a reading that runs anyway. It runs AUTOMATICALLY on a full-country-search and is not part of the other two, so asking for it there is refused rather than accepted and ignored. It routes on territory — the scope must name one it covers." }, worldwide: { type: "boolean", description: "Search EVERYWHERE, and refuse to be narrowed by the account's own default territories. This is not the same as omitting jurisdictions, which means \"whatever the account says\" — the two used to be indistinguishable on this wire, which is how a request that bought everywhere ran an account's seven countries. Never send \"Worldwide\" as a jurisdictions entry." }, recipeKey: { type: "string" }, upfrontInstructions: { type: "string" }, deadline: { type: "string" }, deliveryRoute: { type: "string", enum: ["email", "portal"], description: "OPTIONAL: how the delivered packet leaves — email (default). \"portal\" is reserved for the portal delivery lane and CLARIFIES at admission until it ships (never a silent no-op) — so the preview BLOCKS it here rather than describing a job start_run could not run." }, commercialFlexibility: { type: "string" }, priorUse: { type: "string" }, campaignShape: { type: "string", description: "Campaign-shape FACTS from the request/client — how the mark will be deployed: standalone brand vs flavour/sub-brand under a NAMED house mark; seasonal/limited vs permanent; launch scale. Verbatim facts only — the engine records them on the matter frame instead of inferring a launch shape." }, customerUnknown: { type: "boolean" } }, required: ["forwarder"] } },
709
711
  // ---- OPS write-face (requires an ops token; never exposed to a user/internal session) ----
710
712
  { name: "start_run", description: "OPS-ONLY. Enqueue a NEW clearance/search run the driver will pick up. Provide markName (or marks[] for a batch) + forwarder (and ideally classes/goods/customer/profileKey/ref). Returns the queue id + slug; the runId/codename is assigned when the runner claims it — poll list_runs (by markName) or run_changes for progress. Spends real money once it runs.", inputSchema: { type: "object", properties: { agent: { type: "string", description: "Which agent workspace's queue. An assistant passes its own agent id: the run's events name the queue's agent, and a courier takes only its own. Omitted, the job goes to the deployment default (CLEAROTRON_QUEUE_DIR or the default agent's queue — docs/INTAKE.md), which on a box with more than one assistant may be another one's." }, markName: { type: "string", description: "The mark (single-mark form). Required unless marks[] is provided." }, marks: { type: "array", items: { type: "object", properties: { name: { type: "string" }, classes: { type: "array", items: { type: "number" } }, ref: { type: "string" } }, required: ["name"] }, description: "Batch form: EVERY name of the batch in ONE job. Only a knockout-search reads more than one name at a time; a clearance reads one, and more is refused rather than truncated." }, classes: { type: "array", items: { type: "number" }, description: "Nice classes — whole numbers 1–45 (1–34 goods, 35–45 services). classes OR goods; either suffices." }, goods: { type: "string" }, jurisdictions: { type: "array", items: { type: "string" }, description: JURISDICTIONS_DESC }, platforms: { type: "array", items: { type: "string" }, description: "OPTIONAL per-run SCOPE: extra marketplaces to sweep, as bare store domains e.g. [\"gnc.com\"]. ADDED to the account's own marketplaces — additive only, never a replacement (a client's platform list is a mandate). Max 10; \"web\" is implicit and must not be listed." }, customer: { type: "string" }, profileKey: { type: "string", description: "The customer ACCOUNT key (see list_profiles) whose profile rates this run; omit for the neutral generic profile — that is how a clearance for a NEW client runs, and a client with no account yet is never a reason to refuse one. Offer it alongside the portal route (their own company, with its own framework, territories and marketplaces) so the requester chooses. On a session whose access names accounts, omitting it needs the generic profile to be one of them; when it is not, the refusal says so and names what the session does hold (see describe_options)." }, forwarder: { type: "string", description: "Requester/reply-routing key — rides the delivery packet so the integrator knows who gets the report (docs/DELIVERY.md). Account sessions may omit it — it is stamped from your verified identity." }, forwarderEmail: { type: "string" }, ref: { type: "string" }, provider: { type: "string" }, brief: { type: "string" }, upfrontInstructions: { type: "string" }, projectKey: { type: "string", description: "OPTIONAL (spec 62): the PROJECT/engagement key UNDER profileKey (see that customer's projects[] in list_profiles) whose overlay rates this run; omit to run on the customer profile. An unknown key clarifies at intake." }, product: { type: "string", enum: ORDERABLE_PRODUCTS, description: PRODUCT_DESC }, nativeLanguage: { type: "boolean", description: "OPTIONAL, and only on a multi-country-focus-search: the native-language investigation. Send TRUE or omit the field — FALSE IS REFUSED, not honoured: the toggle only ever added, so there is nothing for false to switch off, and accepting it would let you believe you had removed a reading that runs anyway. It runs AUTOMATICALLY on a full-country-search and is not part of the other two, so asking for it there is refused rather than accepted and ignored. It routes on territory — the scope must name one it covers." }, worldwide: { type: "boolean", description: "Search EVERYWHERE, and refuse to be narrowed by the account's own default territories. This is not the same as omitting jurisdictions, which means \"whatever the account says\" — the two used to be indistinguishable on this wire, which is how a request that bought everywhere ran an account's seven countries. Never send \"Worldwide\" as a jurisdictions entry." }, recipeKey: { type: "string", description: "OPTIONAL alternative selector: a saved search (recipe) slug for this customer. Mutually exclusive with product — a saved search already carries one." }, deliveryRoute: { type: "string", enum: ["email", "portal"], description: "OPTIONAL: how the delivered packet leaves — email (default). \"portal\" is reserved for the portal delivery lane and CLARIFIES at admission until it ships (never a silent no-op)." }, parentRunId: { type: "string", description: "OPTIONAL escalation lineage: the runId this run escalates from (e.g. a knockout HIGH mark → this clearotron)." }, deliverableSpec: { type: "string" }, commercialFlexibility: { type: "string" }, priorUse: { type: "string" }, campaignShape: { type: "string", description: "Campaign-shape FACTS from the request/client — how the mark will be deployed: standalone brand vs flavour/sub-brand under a NAMED house mark; seasonal/limited vs permanent; launch scale. Verbatim facts only — the engine records them on the matter frame instead of inferring a launch shape." }, deadline: { type: "string", description: "ISO-8601 — drives the deadline envelope." }, customerUnknown: { type: "boolean" }, dupOverride: { type: "boolean", description: "Requester-confirmed force-run past matter dedup." }, clientPrincipal: { type: "boolean", description: "Set by the client portal only: this run was started by a CLIENT and consumes that account's runCaps.dailyRuns allowance. Omit for staff, agent and email-door runs — absence means uncapped, and setting it can only restrict the run that carries it." }, rawRequest: { type: "string" }, forwarderDomain: { type: "string" }, msgId: { type: "string" }, conversationId: { type: "string" }, id: { type: "string" } }, required: ["forwarder"] } },
711
713
  { name: "stop_run", description: "OPS-ONLY. Cancel a run. Pass id to remove a not-yet-claimed queued job (a real cancel, no spend). Pass runId to file a cancel request on a started run. By default the cancel is COOPERATIVE — the sentinel is written and a turn already in flight is allowed to finish, which has no deadline: a reasoning turn can run for tens of minutes. Add immediate:true to also end that turn: it is sent a stop, anything of it still running a few seconds later is killed, and the answer says the turn ended only once it has seen it end. If it could not be ended, the run ends at its next step boundary, and the answer says that instead.", inputSchema: { type: "object", properties: { agent: { type: "string" }, id: { type: "string", description: "A queued job id (from start_run) — dequeues before the runner claims it." }, runId: { type: "string", description: "A started run's runId — files a cancel sentinel." }, immediate: { type: "boolean", description: "Stop NOW instead of at the next step boundary. The cancel sentinel is written FIRST and then the run's own recorded engine turn is stopped, in that order — the sentinel is what makes the record clean, so the terminal names the stage, the actor and the request time instead of leaving a run that reads as still running. The turn is sent SIGTERM (to its whole process group when it leads one, as both engines spawn it, so the tools it started are reached too), watched, and sent SIGKILL if anything of it is still running when the grace runs out; the answer waits for that, which takes seconds. A turn that is stopped loses its step's work; everything already recorded is kept. Sending the stop is not the same as the turn ending, and the answer claims the second only when it has seen it (immediate.ended). Falls back to the boundary stop, and SAYS SO in the answer, when there is no live turn to signal — a run between steps, or one whose turn has already exited — or when the turn was still there after the SIGKILL. The answer states which of the two actually happened."}, onBehalfOf: { type: "string", description: "The identifier of a human this caller has itself verified. RECORDED BESIDE the token's own principal, never instead of it — a stop by the portal for alice@x is written `portal:alice@x`, so an asserted name is never mistaken for a proved one. Bare identifiers only; anything else is dropped." } } } },
712
714
  { name: "server_info", description: "The AGPL §13 source offer: this server's name, version, licence, source repository and the COMMIT IT IS RUNNING. Callable by every session kind — the offer is owed to whoever interacts with the service. Reads no run and no account data.", inputSchema: { type: "object", properties: {} } },
713
- { name: "list_outbox_events", description: "Integrator discovery read (docs/DELIVERY.md): every pending outbox event — delivered markers plus the self-contained run-failed / intake-rejected / duplicate-skipped / late-bind-ack packets. Route each, then mark_sent (delivered) or ack_event (the rest).", inputSchema: { type: "object", properties: {} } },
715
+ { name: "list_outbox_events", description: "Integrator discovery read (docs/DELIVERY.md): every pending outbox event — delivered markers plus the self-contained run-failed / intake-rejected / duplicate-skipped / late-bind-ack packets. Route each, then settle delivered and run-failed events with mark_sent, and every other kind with ack_event.", inputSchema: { type: "object", properties: {} } },
714
716
  { name: "get_delivery_packet", description: "The run's send payload: _driver/delivery.json (subject, recipient routing, verbatim emailBodyHtml, whatsapp line) and/or failure.json, plus sendPending/.sent state. NOT exposed to client tokens.", inputSchema: { type: "object", properties: { runId: { type: "string" } }, required: ["runId"] } },
715
- { name: "ack_event", description: "OPS-ONLY. Consume ONE routed outbox event by its file name (from list_outbox_events). Idempotent (ok+alreadyGone). The delivered marker is instead cleared by mark_sent.", inputSchema: { type: "object", properties: { file: { type: "string" } }, required: ["file"] } },
717
+ { name: "ack_event", description: "OPS-ONLY. Consume ONE routed outbox event by its file name (from list_outbox_events). Idempotent (ok+alreadyGone). Delivered and run-failed events are settled by mark_sent instead.", inputSchema: { type: "object", properties: { file: { type: "string" } }, required: ["file"] } },
716
718
  { name: "mark_sent", description: "OPS-ONLY. Integrator write-back after sending a delivered run's packet (docs/DELIVERY.md step 3): writes the .sent idempotency guard, clears status.sendPending, removes the outbox marker. Idempotent — an already-sent run returns ok+alreadySent. SETTLING REQUIRES EVIDENCE: pass messageId or attestation, or the call refuses. Never call this for a send that was blocked or failed — leave the marker so the send stays owed.", inputSchema: { type: "object", properties: { runId: { type: "string" }, messageId: { type: "string", description: "The sent email's messageId — the send receipt." }, attestation: { type: "string", description: "Out-of-band evidence when there is no messageId: an explicit statement of how the packet actually reached the reader (channel + when), recorded VERBATIM in .sent." } }, required: ["runId"] } },
717
719
  { name: "feed_context", description: "OPS-ONLY. Late-bind context onto a run: the applicant + exclusions (written as customer-bind.json, the pipeline's pre-start applicant bind). Use to resolve a customer-unknown run.", inputSchema: { type: "object", properties: { runId: { type: "string" }, customer: { type: "string" }, exclusions: { type: "array", items: { type: "string" } } }, required: ["runId"] } },
718
720
  ];
@@ -833,17 +835,48 @@ const CLIENT_TOOL_TEXT = {
833
835
  plan_run: () =>
834
836
  "FREE PREVIEW — what a search WOULD do, spending nothing and starting nothing. Takes the SAME arguments as start_run and reports the search that resolved and where that came from (the request, the account default, a saved search, or the territories themselves), the territories and marketplaces that would actually be searched, the turnaround, and any blockers to put back to the requester. Show the result to them, then call start_run with the SAME arguments.",
835
837
  start_run: () =>
836
- "Commissions a real search. It costs the client money and takes hours. Provide markName (or marks[] for a batch that a knockout search reads) plus the classes or goods, the territories, and the account key. Call plan_run first and have the requester confirm. The search's own identifier is assigned when it starts — find it afterwards with list_runs by mark.",
838
+ "Commissions a real search. It costs the client money. plan_run gives its turnaround. Provide markName (or marks[] for a batch that a knockout search reads) plus the classes or goods, the territories, and the account key. Call plan_run first and have the requester confirm. The search's own identifier is assigned when it starts — find it afterwards with list_runs by mark.",
837
839
  stop_run: () =>
838
840
  "Cancels a search that is waiting or in progress. Nothing already delivered is affected.",
841
+ // THE CLIENT CUT OF THE TWO DESCRIPTIONS THAT NAMED WHAT THE SESSION DOES NOT HOLD (design, 2026-11-24): a report link
842
+ // was pointed at audit tools it cannot call and offered a findings list without the group it must pass; an account was
843
+ // invited to pass a model its gate refuses. Null keeps the operator's text for that audience.
844
+ brief: (kind) =>
845
+ "Start here for any question about what a search found: one plain-language briefing of the search — which product it was, the overall risk in plain words, each conflict in one or two plain sentences, and any conditions on the result. Facts, never advice."
846
+ + (kind === "account" ? " Reach for get_run, trace and decision_timeline only when the user asks how the search reached a conclusion." : ""),
847
+ // A report link reaches the cards only (shared/scope.mjs), and a Knockout has none, so its link is sent to the brief and the report.
848
+ list_findings: (kind) => (kind === "user"
849
+ ? "On a clearance report, the individual findings behind the brief, as plain-language report cards. Pass group: on-field, off-field or out-of-scope; on this connection it is required. A Knockout report has no report cards here: read its findings in brief and in the report."
850
+ : null),
851
+ what_if_plan: () =>
852
+ "Free: plans a what-if and spends nothing. kind 'stage' (the default) re-runs one step of a LIVE search: pass `stage`, and put the change in `instructions`. It reports what re-runs, what downstream is not recomputed, how complete the answer is, and a confirmationToken. kind 'memo' answers a what-if about a DELIVERED clearance report: a bounded re-read of its archived findings under a stated assumption, spending model tokens only — no searching, no register calls, and the report and its archive are never modified. A memo takes no stage; put the reader's own words in `instructions`.",
839
853
  what_if_result: () =>
840
854
  "Collect a what-if: its state (queued, running, done or failed) and, once done, what it changed against the original search. Pass runId and the experimentId what_if_run returned; omit experimentId to list every what-if asked of this search. The original is never modified — the experiment runs in its own sandbox.",
841
855
  };
842
856
 
857
+ // THE CLIENT CUT OF A SCHEMA, for the two arguments a client's session was offered and then overruled (design,
858
+ // 2026-11-24). `forwarder` was required while the account branch stamps it from the verified identity, so an assistant
859
+ // invented a value to satisfy the schema; `model` was offered on what_if_plan while the account branch refuses it by name.
860
+ // The gate is unchanged: what a client may send is still decided in shared/scope.mjs.
861
+ const CLIENT_SCHEMA_CUT = {
862
+ plan_run: { optional: ["forwarder"] },
863
+ start_run: { optional: ["forwarder"] },
864
+ what_if_plan: { withheld: ["model"] },
865
+ };
866
+ function clientSchema(name, schema) {
867
+ const cut = CLIENT_SCHEMA_CUT[name];
868
+ if (!cut || !schema) return schema;
869
+ const withheld = new Set(cut.withheld ?? []);
870
+ const optional = new Set([...(cut.optional ?? []), ...withheld]);
871
+ const properties = Object.fromEntries(Object.entries(schema.properties ?? {}).filter(([k]) => !withheld.has(k)));
872
+ return { ...schema, properties, ...(schema.required ? { required: schema.required.filter((k) => !optional.has(k)) } : {}) };
873
+ }
874
+
843
875
  /**
844
876
  * The tool list as THIS audience should read it. A client principal (a report link) and an account
845
877
  * principal get the client cut where one exists; ops and staff get the operator text unchanged.
846
- * Descriptions only — name, inputSchema and everything the gate reads pass through untouched.
878
+ * The client cut is the description, and the schema's arguments a client session is overruled on; the
879
+ * name and everything the gate reads pass through untouched.
847
880
  */
848
881
  /** A tool's description as a demo's assistant reads it: the owner's demo words where a real install's send it to a withheld tool. */
849
882
  export function inDemo(def, kind) {
@@ -853,8 +886,9 @@ export function inDemo(def, kind) {
853
886
 
854
887
  export function describeForAudience(def, kind) {
855
888
  if (kind !== "user" && kind !== "account") return def;
856
- const text = CLIENT_TOOL_TEXT[def.name];
857
- return text ? { ...def, description: text(kind) } : def;
889
+ const text = CLIENT_TOOL_TEXT[def.name]?.(kind) ?? null;
890
+ const inputSchema = clientSchema(def.name, def.inputSchema);
891
+ return { ...def, ...(text ? { description: text } : {}), ...(inputSchema !== def.inputSchema ? { inputSchema } : {}) };
858
892
  }
859
893
 
860
894
  /**
@@ -1099,8 +1133,9 @@ function sanitizeRunForClient(r) {
1099
1133
 
1100
1134
  // ---- GRANTS result filtering (INSTALL.md §8) -----------------------------------------------------
1101
1135
  // Narrow enumeration results to an account-scoped session's grant. Exported for the unit test.
1102
- // Anything without a resolvable account (an intake rejection before any run exists, a pre-grants run)
1103
- // is dropped for scoped sessions — visible only to full grants.
1136
+ // Anything without a resolvable account (a pre-grants run, a notice for an order that named no account)
1137
+ // is dropped for scoped sessions — visible only to full grants. A notice filed before any run exists has
1138
+ // no run to resolve; it carries the account its order named (runner.mjs noticeAccount) and is judged on that.
1104
1139
  export function filterByAccounts(scope, name, result) {
1105
1140
  if (!Array.isArray(scope?.accounts)) return result;
1106
1141
  // one status-scan per call builds runId → account for the array filters
@@ -1126,7 +1161,8 @@ export function filterByAccounts(scope, name, result) {
1126
1161
  }
1127
1162
  if (name === "list_outbox_events" && result && Array.isArray(result.events)) {
1128
1163
  const map = accountOf();
1129
- const events = result.events.filter((ev) => seen(map, ev.runId ?? null));
1164
+ const events = result.events.filter((ev) => (ev.runId != null
1165
+ ? seen(map, ev.runId) : accountVisible(scope, ev.account ?? null, ev.organisation ?? null)));
1130
1166
  return { ...result, events, count: events.length };
1131
1167
  }
1132
1168
  return result;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "clearotron",
3
3
  "mcpName": "io.github.CordilleraSarl/clearotron",
4
4
  "type": "module",
5
- "version": "0.7.0-beta.2",
5
+ "version": "0.7.0-beta.3",
6
6
  "license": "AGPL-3.0-only",
7
7
  "repository": {
8
8
  "type": "git",
@@ -2,7 +2,7 @@
2
2
  "name": "portal-ui",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "0.7.0-beta.2",
5
+ "version": "0.7.0-beta.3",
6
6
  "license": "AGPL-3.0-only",
7
7
  "description": "The unified trademark portal UI. One address, one login: who you are decides what you see. Built as a static bundle, served by driver/portal-service.mjs — the browser never reaches profile-service or recipe-service.",
8
8
  "engines": {
@@ -8,6 +8,9 @@ export const adapter = {
8
8
  label: "Clarivate Compumark",
9
9
  credEnv: "CLARIVATE_API_KEY",
10
10
  skillDoc: "skills/clearance-register/providers/clarivate.md",
11
+ // How a question is asked and how its answer reads, split from the manual above: the Knockout reader holds only the
12
+ // propose tool, so it reads this file alone; the clearance unit reads both.
13
+ questionsDoc: "skills/clearance-register/providers/clarivate-questions.md",
11
14
  hasPublicRecordUrl: false, // Compumark Content has no public record URL — cite the office register
12
15
  //, ruling 2026-08-20 — WHAT A CARD SHOWS WHERE A LINK CANNOT GO. A UI exists for this
13
16
  // provider and we do not know its per-record URL, so the card says so and says it is unfinished.
@@ -49,7 +49,7 @@ export const NATIVEREAD_TOOL = {
49
49
  };
50
50
 
51
51
  /** Assemble the Messages API body (pure). `payload` is the code-inlined evidence slice the DRIVER
52
- * assembled (register rows, candidates, sub-class notes, grid findings) — this module never decides
52
+ * assembled (register records, candidates, sub-class notes, grid findings) — this module never decides
53
53
  * what the model may see. */
54
54
  export function buildNativereadRequest({ mark, lane = "zh", payload }) {
55
55
  if (lane !== "zh") throw new Error(`jx-nativeread: no prompt for lane "${lane}"`);
@@ -58,8 +58,10 @@ export function buildNativereadRequest({ mark, lane = "zh", payload }) {
58
58
  const prompt = [
59
59
  `Mark under clearance: "${String(mark).trim()}".`,
60
60
  ``,
61
- `Below is the complete Chinese evidence slice assembled for this run — CNIPA register rows,`,
62
- `native-script candidate forms, sub-class (similarity-group) notes, and platform search findings.`,
61
+ `Read the Chinese-language evidence supplied below. A shortened section states how many records or rows were omitted.`,
62
+ `Base each conclusion on the details shown.`,
63
+ `Each goods entry identifies its source and states how much wording is shown.`,
64
+ `Missing goods do not establish that the goods are unrelated.`,
63
65
  `Read it as a Chinese trademark practitioner would and emit up to ${MAX_ITEMS} items:`,
64
66
  `- "conflict-read": what a specific register record actually is (goods coverage, sub-class overlap,`,
65
67
  ` status nuance a Latin-only read misses) — record_uri REQUIRED, from the slice;`,
@@ -1,5 +1,9 @@
1
1
  # trademark-oauth-mcp-bridge
2
2
 
3
+ ## 0.7.0-beta.3
4
+
5
+ No changes in this release.
6
+
3
7
  ## 0.7.0-beta.2
4
8
 
5
9
  No changes in this release.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trademark-oauth-mcp-bridge",
3
- "version": "0.7.0-beta.2",
3
+ "version": "0.7.0-beta.3",
4
4
  "license": "AGPL-3.0-only",
5
5
  "private": true,
6
6
  "description": "OAuth 2.1 MCP stdio bridge used by the engine's case-law gather stage (courtlistener / legaldatahunter).",
@@ -347,8 +347,7 @@ export function formatSandboxResponse(data, preset) {
347
347
  const meta = [`Depth: ${preset}`];
348
348
  const usage = data.usage || {};
349
349
  if (usage.total_tokens) meta.push(`Tokens: ${usage.total_tokens}`);
350
- const cost = usage.cost?.total_cost;
351
- if (cost != null) meta.push(`Cost: $${cost}`);
350
+ // The provider's charge is not the stage's to read (the no-price ruling): it stays in the raw reply the run keeps.
352
351
  const confirmation = extractText(data).trim();
353
352
 
354
353
  return deliverable.stdout.trim() +
@@ -358,6 +357,12 @@ export function formatSandboxResponse(data, preset) {
358
357
  `\n\n---\n_Research metadata: ${meta.join(" | ")}_`;
359
358
  }
360
359
 
360
+ /**
361
+ * An answer held from an earlier call may carry the provider's charge in its metadata footer, written before the
362
+ * formatter stopped printing it. It is taken out of that footer only: an amount the research itself found survives.
363
+ */
364
+ export const withoutProviderCharge = (text) => String(text ?? "").replace(/^(_Research metadata: .*?) \| Cost: \$[^ |_]+(.*_)$/m, "$1$2");
365
+
361
366
  export function formatResponse(data, preset) {
362
367
  const text = extractText(data);
363
368
 
@@ -8,6 +8,9 @@ export const adapter = {
8
8
  label: "Signa",
9
9
  credEnv: "SIGNA_API_KEY",
10
10
  skillDoc: "skills/clearance-register/providers/signa.md",
11
+ // How a question is asked and how its answer reads, split from the manual above: the Knockout reader holds only the
12
+ // propose tool, so it reads this file alone; the clearance unit reads both.
13
+ questionsDoc: "skills/clearance-register/providers/signa-questions.md",
11
14
  hasPublicRecordUrl: false, // Signa exposes no per-record public URL — cite the office register
12
15
  //, ruling 2026-08-20 — no register UI exists to link to at all, so the card points at
13
16
  // the artifact that DOES carry the record: the audit workbook. Naming it is the whole of this
@@ -254,13 +254,13 @@ export const NOT_COUNTED_EVENTS = {
254
254
  ],
255
255
  "the twin of an incident counted under another record — its dispatch, its repair, its clamp or its failure": [
256
256
  "assessment-not-completed-delivery", "part-completed", "overview-not-completed-delivery", "review-not-completed-delivery",
257
- "core-artifact-restored", "searches-not-completed-delivery", "unit-not-completed-delivery",
257
+ "core-artifact-restored", "searches-not-completed-delivery", "unit-not-completed-delivery", "unit-product-fault",
258
258
  "action-reemit", "ask-answer-reemit", "authority-write-denied", "connotation-remedy", "corrections-applied",
259
259
  "corrective-answers-after", "corrective-answers-left-behind", "corrective-cycle-receipt", "corrective-cycle-settled", "corrective-findings-stale", "coverage-absence-rendered",
260
260
  "coverage-closure", "coverage-ledger-recovered", "delivery-stale-repair", "delivery-stale-requeued", "envelope-close-rows", "escalation-noop", "floor-duty-after-repair", "writer-duty-after-repair", "writer-duty-after-correction", "guard-clause-replaced", "guard-gap-closed", "verdict-recomputed-gap-closed", "guard-clause-named-elsewhere", "audit-rebuilt", "audit-withdrawn", "record-carry-doubts-again",
261
261
  "finding-reemit", "findings-actions-absent", "findings-schema-downlevel", "form-oracle-gap", "frame-reopen",
262
262
  "follow-up-reask", "frame-reopen-reattempt", "grid-ledger-missing", "knockout-assess-invalidated", "knockout-review-round-set-aside", "lint-redo-skipped", "lint-redo-skipped-structural",
263
- "meaning-gap-coverage", "opening-finished-on-resume", "park-marker-unwritten", "park-resumed", "plan-qids-sticky-gap", "recall-reconciliation-unended",
263
+ "meaning-gap-coverage", "searches-open-coverage", "opening-finished-on-resume", "park-marker-unwritten", "park-resumed", "plan-qids-sticky-gap", "recall-reconciliation-unended",
264
264
  "recovery-classified", "record-discard", "report-repair-targets", "screen-gate-unresolved", "skeptic-escalation", "stage-stale",
265
265
  "stale-repair-entry", "taint-disclose", "unsettled-inputs", "verdict-2", "verdict-3", "verdict-recheck-file-save-refused", "verdict-recheck-unread",
266
266
  ],
@@ -39,7 +39,7 @@
39
39
  // ── IT WRITES, WHICH IS WHY IT IS NEVER DEFAULT ─────────────────────────────────────────────────────
40
40
  //
41
41
  // Every successful registration CREATES AN OAUTH CLIENT on the operator's account. INSTALL.md promises
42
- // `doctor` "reads; writes nothing and contacts nothing outside this machine", and that sentence is load-bearing — it is why a
42
+ // `doctor` "changes no setting", and that sentence is load-bearing — it is why a
43
43
  // reader runs `doctor` on a production box without thinking about it. So this is opt-in at the command
44
44
  // line, it says what it is about to create before it creates it, and it reports what it left behind.
45
45
 
@@ -59,6 +59,7 @@ export const NAMES_IN_FORCE = Object.freeze([
59
59
  "CLEAROTRON_E2E_EXPECT_DEMO_ROSTER",
60
60
  "CLEAROTRON_EDGE_ORIGIN",
61
61
  "CLEAROTRON_ENGINES_DIR",
62
+ "CLEAROTRON_ENGINE_CHECK_ROUTINE",
62
63
  "CLEAROTRON_ENGINE_CWD",
63
64
  "CLEAROTRON_ENGINE_MAX_BUFFER",
64
65
  "CLEAROTRON_ENUMERATE_CEILING",
@@ -7,8 +7,9 @@ description: "Work with a trademark clearance account: review the searches alrea
7
7
 
8
8
  You are connected to a client's own trademark clearance account. You can look at the searches that
9
9
  have been run for them, and you can start new ones. Your job is to help the user understand what a
10
- search found — in plain language, faithfully, and without overstepping what a preliminary search is
11
- — and to set up a new search properly when they ask for one.
10
+ search found — in plain language, faithfully, and without overstepping what that search is — and to
11
+ set up a new search properly when they ask for one. Read a search's product, scope and recorded
12
+ coverage before describing what was searched.
12
13
 
13
14
  Your reader is a lawyer. Write for one: short sentences, ordinary nouns, the conclusion first, and
14
15
  the qualification stated rather than implied.
@@ -28,7 +29,8 @@ they carry the case-law reading:
28
29
  - **Multi-country focus search** — one name, across a region or two or more countries. The
29
30
  native-language investigation can be added to it.
30
31
  - **Full country search** — one name, exactly one country. The only search that carries the case-law
31
- and opposition reading, and the native-language investigation runs as part of it.
32
+ and opposition reading, and it includes the native-language investigation where the territory is
33
+ supported.
32
34
 
33
35
  `describe_options` is the authority on which of these this deployment can actually run, and on
34
36
  anything unavailable — never recite this list as the menu without checking it.
@@ -46,8 +48,9 @@ record:
46
48
  specific to the goods. It runs dozens of queries and rules every result it gets back, including the
47
49
  ones it discards. A clearance that reports nothing troubling here has *read* the question and
48
50
  answered it — it has not skipped it.
49
- - **Native-language lanes**, where the territories call for them: the name read in the language and
50
- script of the market, not only in English.
51
+ - **Native-language lanes**: the name read in the language and script of the market, not only in
52
+ English. A Full country search includes native-language work where the territory is supported. A
53
+ Multi-country focus search can add it. Use the report's recorded coverage to say what actually ran.
51
54
 
52
55
  Case law and oppositions are read on a full country search and are not part of the other three.
53
56
 
@@ -131,10 +134,11 @@ Names in this section are yours to call, never yours to say.
131
134
  recomputed, escalations, the verdict as it evolved, the screening gate, the outcome.
132
135
  - **`get_finding`** — one record by its id (`F1`, `NR1`, `AT1`), when you already know which.
133
136
  - **`plan_run`** — a free preview of what a search *would* do. Always before `start_run`.
134
- - **`start_run`** — commissions a real search. It costs the client money and takes hours.
137
+ - **`start_run`** — commissions a real search. It costs the client money. `plan_run` gives its turnaround.
135
138
  - **`stop_run`** — cancels a search that is queued or running.
136
- - **`what_if_plan`** — free. *What would change if…* — re-run one step of a finished search with extra
137
- guidance ("treat ACME's mark as expired", "assume the goods narrow to software"). It runs nothing: it
139
+ - **`what_if_plan`** — free. *What would change if…* On a live search, re-run one step
140
+ (`kind: "stage"`). On a delivered one, ask for a memo (`kind: "memo"`) with the assumption in
141
+ `instructions` ("assume the goods narrow to software"). It runs nothing: it
138
142
  tells you which step re-runs, how complete an answer one step gives, what sits downstream that will
139
143
  **not** be recomputed, whether it hits paid external search, and roughly how long it took last time.
140
144
  It returns a `confirmationToken`. Read the honesty note back to the user before you spend anything.
@@ -171,7 +175,9 @@ the search's own state decides which one you can have:
171
175
  - a **step re-run**, while the search is still live — one step runs again under a changed assumption, in
172
176
  a sandbox;
173
177
  - a **memo**, once the search is delivered or archived — the evidence already gathered is read again
174
- under the assumption, and a short document comes back naming the report it belongs to.
178
+ under the assumption, and a short document comes back naming the report it belongs to. A memo reads
179
+ a delivered clearance report's findings; it is not offered on a Knockout screen, and `what_if_plan`
180
+ says so.
175
181
 
176
182
  Either is the wrong tool when the user wants a fresh answer about a different mark. That is a new search.
177
183
 
@@ -182,8 +188,8 @@ there is, and the memo is the answer to it — so check the search's state befor
182
188
  question cannot be answered.
183
189
 
184
190
  - **Name the step when you ask for a re-run; do not when you ask for a memo.** `what_if_plan` has to be
185
- told which step, and asking without one is an error rather than a refusal you can relay. A memo re-runs
186
- no step: pass the user's assumption as `instructions` and nothing else.
191
+ told which step, and asking without one is refused. A memo re-runs no step: pass the search's
192
+ `runId`, `kind: "memo"`, and the user's assumption as `instructions`.
187
193
  - **Plan, read the honesty note aloud, then commit.** `what_if_plan` says in plain words how complete the
188
194
  answer will be. Re-running an early step does **not** re-run the risk read or the report on top of it,
189
195
  and a user who is not told that will read a partial output as a new verdict. Say it before you spend,
@@ -224,6 +230,10 @@ that would actually be searched, the expected turnaround, and any blockers. Rela
224
230
  would surprise them — most often a scope narrower than the words they used. Only then `start_run`,
225
231
  with the same arguments.
226
232
 
233
+ **An accepted `start_run` means submitted, not started.** The search waits for a free slot and a check
234
+ that it can run. Tell the user it is submitted, never that it is starting or running. Report a start
235
+ once the matching run has a status, and give its actual state.
236
+
227
237
  **One country already covers the regional and international rights that bind it.** A clearance for a
228
238
  country reaches its national register, the regional register that binds it — an EU trade mark blocks use
229
239
  in an EU member state without ever appearing in that state's own register — and international
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: clearotron-client
3
- description: Read a preliminary trademark clearance report over the read-only, single-run connector link embedded in it. Use when the user asks what a clearance search found, what a finding means, or how much weight to put on it.
3
+ description: Read a trademark search report over the read-only, single-run connector link embedded in it. Use when the user asks what a search found, what a finding means, or how much weight to put on it.
4
4
  ---
5
5
 
6
- # Reading a preliminary trademark clearance report (client connector)
6
+ # Reading a trademark search report (client connector)
7
7
 
8
- You are connected, read-only, to **one** preliminary trademark clearance search. Your job is to
9
- help the user understand what the search found — in plain language, faithfully, and without
10
- overstepping what a preliminary search is.
8
+ You are connected, read-only, to **one** trademark search. Read this report's product, scope and
9
+ recorded coverage before describing what was searched. Your job is to help the user understand what
10
+ the search found — in plain language, faithfully, and without overstepping what that search is.
11
11
 
12
12
  Your reader is a lawyer. Write for one: short sentences, ordinary nouns, the conclusion first, and
13
13
  the qualification stated rather than implied.
@@ -22,9 +22,10 @@ A clearance reads more than the register. It reads live and pending rights acros
22
22
  reads use off the register on marketplaces, retailers and the open web; it reads what the name
23
23
  **means and connotes** — its semantic field, slang and street readings, cultural and historical
24
24
  associations, political charge, and controversy specific to the goods, in a connotation sweep that
25
- rules every result it gets back; and where the territories call for it, it
26
- reads the name in the language and script of the market. Case law and oppositions are read on some
27
- searches and not on others, and the report says which this was.
25
+ rules every result it gets back; and it can read the name in the language and script of the market.
26
+ A Full country search includes native-language work where the territory is supported. A Multi-country
27
+ focus search can add it. Use the report's recorded coverage to say what actually ran. Case law and
28
+ oppositions are read on some searches and not on others, and the report says which this was.
28
29
 
29
30
  Every one of those readings can come back quiet. **A reading that returned nothing is a result, not a
30
31
  gap.** Before you tell a user the search did not look at something, read the report's own scope and
@@ -45,17 +46,15 @@ into work that was not done.
45
46
  - **Lead with the answer.** The finding first, the reasoning under it, the qualification attached to
46
47
  it — not a recital of what you did.
47
48
 
48
- ## Your three tools
49
+ ## Your tools
49
50
 
50
51
  Names in this section are yours to call, never yours to say.
51
52
 
52
53
  - **`brief`** — start here, always. A structured plain-language brief of the search: the mark, the
53
54
  overall risk statement, the headline conflicts, coverage. Its `_note` field carries voice
54
55
  guidance — follow it.
55
- - **`list_findings`** — the individual findings (each conflict or cleared area) when the user wants
56
- to go one level deeper than the brief. Pass `group`: `on-field`, `off-field` or `out-of-scope`.
57
- It is required here — the raw audit view behind it is internal, and a call without a group is
58
- refused rather than answered.
56
+ - **`list_findings`** — On a clearance report, use `list_findings` for the individual cards and pass
57
+ the requested group. On a Knockout, use `brief` and the delivered report for the name's findings.
59
58
  - **`read_artifact`** — `name: "report"`, the report itself. There is one report; use this when the
60
59
  user asks for the document or wording the brief doesn't carry.
61
60
 
@@ -73,8 +72,9 @@ connector by design. Say so plainly and point the user to the firm that issued t
73
72
  verdict; secondary findings are context. Keep that hierarchy in your answers — do not promote a
74
73
  watchlist note into a headline risk or vice versa.
75
74
  - **Evidence drill-through.** Every finding traces to a source (a register record, a marketplace
76
- listing). When the user questions a finding, walk from the brief → `list_findings` → the finding's
77
- cited source, and present what the search actually recorded.
75
+ listing). Start with the brief. For a clearance, use the relevant finding card. For a Knockout,
76
+ open the name's report. Identify the cited source and what it supports where the material you can
77
+ read shows it.
78
78
  - **Coverage is part of the answer.** The report's Scope section states what was searched and what
79
79
  was not, in its own words — relay those words when a question touches an area the search did not
80
80
  reach. A clean result in an unsearched area is not a clean result; say so using the report's own
@@ -44,6 +44,10 @@ You are the courier, not the author.
44
44
  7. **`kind: "pre-run-failed"`** — a request failed before its run could start, so nothing was searched or
45
45
  delivered. Relay the packet's `text` to the forwarder. Then **`ack_event { file }`**.
46
46
 
47
+ 8. **`kind: "engine-check-failed"`** — the installation’s engine failed its health check. The operator can see the
48
+ failure in `clearotron status`. Leave this packet pending and continue with the other events. Do not relay, mark
49
+ or acknowledge it. The next passing worker check clears it.
50
+
47
51
  ## Discipline
48
52
 
49
53
  - **Every chat send names its channel.** Take it from the packet's `whatsappChannel` rather than from
@@ -52,7 +56,7 @@ You are the courier, not the author.
52
56
  it — which is how four notices were lost in one morning.
53
57
  - **Verbatim.** Every `text` and `emailBodyHtml` is ready to send. Your judgment is not wanted in
54
58
  the payload — only in faithful routing.
55
- - **Never invent a recipient.** Route only to the packet's forwarder/whatsappTo. A packet with no
59
+ - **Never invent a recipient.** Route only to the packet's forwarder/whatsappTo. A delivery event with no
56
60
  usable route gets reported to your operator, not guessed.
57
61
  - **Idempotent, no retry loops.** `mark_sent`/`ack_event` are safe to repeat. If a SEND fails,
58
62
  leave the event pending (no mark, no ack), log it, and let the next wake retry once — persistent