clearotron 0.6.0 → 0.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) 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/architecture/04-configuration-reference.md +105 -8
  12. package/docs/branding.md +4 -4
  13. package/docs/report-data/clearance-1.schema.json +320 -0
  14. package/docs/report-data/knockout-1.schema.json +268 -0
  15. package/driver/CHANGELOG.md +77 -0
  16. package/driver/cancel.mjs +19 -0
  17. package/driver/connotation-search.mjs +1 -1
  18. package/driver/contract-e3-backlog.mjs +41 -41
  19. package/driver/contract-vocabulary.mjs +1 -1
  20. package/driver/coverage-ledger.mjs +18 -2
  21. package/driver/deferral-row.mjs +1 -1
  22. package/driver/degraded-parts.mjs +1 -0
  23. package/driver/driver.config.mjs +5 -5
  24. package/driver/effective-scope.mjs +3 -1
  25. package/driver/engagement-receipt.mjs +3 -3
  26. package/driver/engine/anthropic-agent.mjs +15 -1
  27. package/driver/engine/common.mjs +7 -0
  28. package/driver/engine/mcp/band-server.mjs +7 -16
  29. package/driver/engine/mcp/codex-config.mjs +3 -0
  30. package/driver/engine/mcp/recording-server.mjs +45 -34
  31. package/driver/engine/openai-agent.mjs +74 -7
  32. package/driver/engine/session-record.mjs +44 -2
  33. package/driver/findings-model.mjs +14 -2
  34. package/driver/follow-up-twins.mjs +86 -0
  35. package/driver/gateway.mjs +77 -12
  36. package/driver/jx-units.mjs +3 -1
  37. package/driver/jx.mjs +13 -5
  38. package/driver/manuals-inline.mjs +98 -0
  39. package/driver/manuals-seen.mjs +134 -0
  40. package/driver/mark-logos.mjs +174 -0
  41. package/driver/methodology-witness.mjs +2 -1
  42. package/driver/owner-use-check.mjs +8 -4
  43. package/driver/package.json +1 -1
  44. package/driver/pipeline-knockout.mjs +23 -4
  45. package/driver/pipeline.mjs +128 -15
  46. package/driver/portal-local-auth.mjs +6 -2
  47. package/driver/portal-report.mjs +45 -14
  48. package/driver/portal-routes/me.mjs +4 -1
  49. package/driver/portal-runs.mjs +19 -16
  50. package/driver/predelivery-lint.mjs +7 -5
  51. package/driver/profiles.mjs +4 -4
  52. package/driver/publish/README.md +9 -7
  53. package/driver/publish/email-conditions.mjs +22 -5
  54. package/driver/publish/evidence-words.mjs +21 -0
  55. package/driver/publish/index.mjs +304 -211
  56. package/driver/publish/knockout.mjs +297 -247
  57. package/driver/publish/office-record-links.mjs +11 -9
  58. package/driver/publish/page-shell.mjs +98 -0
  59. package/driver/publish/pool-admin.mjs +2 -2
  60. package/driver/publish/publish-inputs.mjs +4 -0
  61. package/driver/publish/regions.mjs +28 -3
  62. package/driver/publish/register-record-html.mjs +105 -0
  63. package/driver/publish/register-record.mjs +165 -0
  64. package/driver/publish/render-knockout.mjs +299 -671
  65. package/driver/publish/render.mjs +561 -492
  66. package/driver/publish/report-data.mjs +226 -13
  67. package/driver/publish/report-document.mjs +353 -0
  68. package/driver/publish/search-depth.mjs +88 -7
  69. package/driver/publish/shell.mjs +41 -1
  70. package/driver/publish/strings.mjs +810 -0
  71. package/driver/publish/templates/clearance-print.css +23 -0
  72. package/driver/publish/templates/knockout.css +224 -0
  73. package/driver/publish/templates/report.css +112 -53
  74. package/driver/publish/xlsx.mjs +158 -139
  75. package/driver/record-goods.mjs +42 -0
  76. package/driver/reference-score.mjs +4 -1
  77. package/driver/register-count.mjs +5 -1
  78. package/driver/register-reach.mjs +39 -0
  79. package/driver/registry-fidelity.mjs +155 -37
  80. package/driver/repair-composers.mjs +7 -3
  81. package/driver/repair-targets.mjs +4 -1
  82. package/driver/replay-archive.mjs +4 -3
  83. package/driver/run-delivered.mjs +14 -8
  84. package/driver/run-record.mjs +1 -0
  85. package/driver/runner.mjs +73 -29
  86. package/driver/scope-facts.mjs +27 -6
  87. package/driver/search-policy.mjs +9 -4
  88. package/driver/skills/clearance-search/report-prose.md +3 -0
  89. package/driver/skills/knockout-assess/SKILL.md +8 -0
  90. package/driver/stage-freshness.mjs +8 -5
  91. package/driver/stages.mjs +69 -43
  92. package/driver/steps/delivery.mjs +9 -5
  93. package/driver/steps/overview-and-cards.mjs +54 -15
  94. package/driver/steps/register-sweep.mjs +5 -4
  95. package/driver/steps/skeptic-and-follow-up.mjs +3 -2
  96. package/driver/steps/verdict-gate.mjs +35 -14
  97. package/driver/suite-census.json +579 -87
  98. package/driver/synthesis-record.mjs +4 -3
  99. package/driver/terminal-clamp.mjs +6 -1
  100. package/driver/withdrawn-rating.mjs +72 -0
  101. package/mcp-server/CHANGELOG.md +8 -0
  102. package/mcp-server/lib/audit-view.mjs +5 -2
  103. package/mcp-server/lib/brief.mjs +6 -2
  104. package/mcp-server/lib/evidence.mjs +94 -23
  105. package/mcp-server/lib/findings.mjs +19 -2
  106. package/mcp-server/lib/knockout.mjs +13 -4
  107. package/mcp-server/lib/scrub.mjs +1 -1
  108. package/mcp-server/package.json +1 -1
  109. package/mcp-server/server.mjs +22 -3
  110. package/package.json +4 -1
  111. package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-BBlN4CYq.js} +238 -80
  112. package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
  113. package/portal-ui/dist/index.html +2 -2
  114. package/portal-ui/package.json +3 -3
  115. package/providers/_shared/ledger.mjs +30 -2
  116. package/providers/_shared/record-uri.mjs +15 -0
  117. package/providers/clarivate/src/adapter.js +11 -0
  118. package/providers/clarivate/src/core.js +17 -1
  119. package/providers/jx/src/core.js +4 -4
  120. package/providers/jx/src/judge.js +1 -3
  121. package/providers/jx/src/nativeread.js +1 -3
  122. package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
  123. package/providers/oauth-mcp-bridge/package.json +1 -1
  124. package/scripts/README.md +147 -3
  125. package/scripts/added-reference-check.mjs +35 -7
  126. package/scripts/e2e-first-time.mjs +4 -4
  127. package/scripts/env-audit.mjs +16 -9
  128. package/scripts/freeze-example-run.mjs +3 -3
  129. package/scripts/mint-public-residue.mjs +3 -3
  130. package/scripts/mint-search-level-tags.mjs +61 -0
  131. package/scripts/mint-source-pin-census.mjs +89 -0
  132. package/scripts/release-note-required.mjs +65 -6
  133. package/scripts/test-durations-reporter.mjs +25 -0
  134. package/scripts/test-full.mjs +72 -18
  135. package/scripts/test-run.mjs +18 -1
  136. package/shared/brand.mjs +93 -6
  137. package/shared/inline-markdown.mjs +53 -0
  138. package/shared/names-in-force.mjs +0 -1
  139. package/shared/portal-tokens.mjs +2 -1
  140. package/shared/reference-guard-classes.mjs +43 -2
  141. package/shared/register-selection.mjs +8 -3
  142. package/shared/search-level-tags.json +25 -0
  143. package/shared/source-spans.mjs +91 -0
  144. package/shared/tools/derive-band-pairs.mjs +10 -0
  145. package/driver/own-rights.mjs +0 -83
  146. package/driver/use-check.mjs +0 -85
@@ -3,12 +3,12 @@
3
3
  > Part of the architecture pack (`docs/architecture/`). The driver's module tree and the headless
4
4
  > integrator contract are in [`driver/README.md`](../../driver/README.md).
5
5
 
6
- > **Scope note:** this reference covers the DRIVER-COMPUTE surface (the `driver.config.mjs` layer).
7
- > The rest of the repo's env vars — the MCP faces, the three admin services, native-language/knockout lanes,
8
- > outbox, brand and auth — are catalogued, with ownership tiers and the drift/rotation map, in
9
- > **[05-config-governance.md](05-config-governance.md)**. When adding a var anywhere in the
10
- > repo, add its row there. `node scripts/env-audit.mjs` reports every name read by code, splits
11
- > product from harness-only, and lists the product names that have no governance row yet; the
6
+ > **Scope note:** this reference has a row for every setting product code reads, named in the row's
7
+ > first column. When adding a setting anywhere in the repo, add its row here; a setting named only in
8
+ > another row's text is not found by a reader looking it up, and the audit counts it as missing.
9
+ > [05-config-governance.md](05-config-governance.md) carries the same settings with their ownership
10
+ > tiers and the drift and rotation map. `node scripts/env-audit.mjs` reports every name read by code,
11
+ > splits product from harness-only, and lists the product names with no row here; the
12
12
  > placeholder-default guards in `driver/test/deployment-hostnames.test.mjs` enforce the fallback
13
13
  > rules mechanically.
14
14
 
@@ -216,6 +216,7 @@ deployment may override (verify live values per deployment).
216
216
  | `CLEAROTRON_ACCESS_DOMAIN` | unset (note omitted) | Identity domain named in the delivery email's access note ("sign in with a `<domain>` account"). Unset ⇒ the note is omitted rather than naming the wrong domain. |
217
217
  | `CLEAROTRON_RUN_LOCK_DIR` | `<workspaceRoot>/clearance-run-locks` | Run-slot lock dir (turn locks under `…/turns`). |
218
218
  | `CLEAROTRON_OUTBOX_DIR` | `<workspaceRoot>/clearance-outbox` | Delivery outbox (`<runId>.pending` wake markers). Renamed from `clearance-outbox`; when this variable is unset the old directory is still READ, so a box that never pinned it does not orphan markers it has already written. Writers use the new name only. |
219
+ | `CLEAROTRON_ACCESS_FILE` | `<base>/grants.json`: the base is the parent of `CLEAROTRON_REPORTS_DIR` when that is set, else `~/trademark` (`~/trademark-demo` for the demo) | The grants file: each person who may use the portal, and each connection `clearotron connect` records. `clearotron start` writes it the first time it runs and passes its path to the services it starts; `clearotron grant`, `connect` and `disconnect` edit it. Set this only when the file lives elsewhere. *(read from `bin/start.mjs`, `bin/grant.mjs`, `bin/connect.mjs`, `bin/disconnect.mjs`)* |
219
220
  | `CLEAROTRON_OAUTH_BRIDGE` | module-relative `providers/oauth-mcp-bridge/bridge.mjs` | Case-law MCP bridge script. (Portable since the module-relative default; set explicitly only for a bridge outside the repo tree.) |
220
221
  | `CLEAROTRON_REGISTER_CALL_LOG` | `~/trademark/telemetry/register-calls.jsonl`, or the existing file wherever it already is | Billing-grade provider-call ledger, shared by whichever ONE register provider is wired — not a vendor artifact. Every read site derives the default from`homedir()` at call time (2026-07-19: two sites had hardcoded a literal home directory, splitting the ledger under any other service account — guarded by `test/deployment-hostnames.test.mjs`). |
221
222
  | `CLEAROTRON_REGISTER_RECORD_LOG` | **runtime-injected per run**: `<runDir>/_driver/register-record-bodies.jsonl` | Citation-fidelity log: the BODY of every fetched official record. ** moved it INTO the run** — created with the run, unioned into the run's`_records/`, archived and purged with it. There is no retention setting and no cleanup job, because it no longer grows on the box: held globally it reached 432 MB in 61 days on production and needed a rotation timer on every install. **Do not set this by hand** — a fixed value pins every run's bodies to one file and restores the problem. A box upgraded across still holds its old global file; nothing writes or reads it, the driver names it once per process on stderr, and archiving it is one`mv`. An empty log cannot read as verified: the run's successful `record_fetch` rows in the (still global) call ledger are compared against the assembled record set, and a gap is reported as a failure. |
@@ -229,6 +230,20 @@ deployment may override (verify live values per deployment).
229
230
  | `CLEAROTRON_ENGINES_DIR` | unset ⇒ `~/.local/share/clearotron/engines` | The folder `clearotron install` installs the chosen engine's program into, `clearotron update` refreshes, and the engine resolver reads as its last step after the explicit setting and `PATH`: an npm project holding `node_modules/@anthropic-ai/claude-code` or `node_modules/@openai/codex`, where an empty directory means there is none. The test suite points it at an empty directory, so a test never reaches a program the developer's own setup installed. |
230
231
  | `FEEDBACK_GH_TOKEN` | unset ⇒ `gh`'s own auth | GitHub token for the unattended feedback minter (`scripts/feedback-mint.mjs`), for a service account with no `gh auth` login. Present ⇒ exported to `gh` as `GH_TOKEN` for that call only. A credential: it is not a placeholder value and must not be committed. |
231
232
  | `USPTO_API_KEY` | unset ⇒ the download path refuses | API key for the USPTO bulk download path in `bin/uspto-sync.mjs`. The INGEST path needs no key and says so; only the download half reads this. A credential. |
233
+ | `CLEAROTRON_CUSTOMERS_DIR` | unset ⇒ the bundled demo roster | The config store's company profiles. *(read from `driver/profiles.mjs`)* |
234
+ | `CLEAROTRON_RECIPES_DIR` | unset ⇒ saved searches off | The store saved searches are read from and written to. Unset, the portal answers its saved-search routes with 404 and the recipe service refuses to start. *(read from `driver/portal-service.mjs`, `driver/recipe-service.mjs`)* |
235
+ | `CLEAROTRON_QUEUE_DIR` | unset | A queue folder drained in addition to each workspace's own queue. A job claimed from it runs as `CLEAROTRON_DEFAULT_AGENT`. *(read from `driver/driver.config.mjs`)* |
236
+ | `CLEAROTRON_WORKSPACE_PREFIX` | `workspace-` | The prefix of the per-agent folders under `CLEAROTRON_WORK_DIR`. *(read from `driver/driver.config.mjs`)* |
237
+ | `CLEAROTRON_DEFAULT_AGENT` | `localagent` | The agent id a job runs as when nothing names one, such as a job claimed from `CLEAROTRON_QUEUE_DIR`. *(read from `driver/driver.config.mjs`)* |
238
+ | `CLEAROTRON_STAFF_POOL_ROOT` | unset ⇒ the publish pool | The pool the staff profiles page is written into when that page is regenerated from the command line. *(read from `driver/publish/profiles-page.mjs`)* |
239
+ | `PROFILE_REPO_ROOT` | the install's own folder | The git repository the profile service commits profile changes in. With `CLEAROTRON_INSTRUCTIONS_DIR` unset, the portal also reads the config store's manuals from it. *(read from `driver/profile-service.mjs`, `driver/portal-service.mjs`)* |
240
+ | `RECIPE_REPO_ROOT` | unset ⇒ `PROFILE_REPO_ROOT` | The git repository saved searches are committed in, which holds `CLEAROTRON_RECIPES_DIR`. *(read from `bin/start.mjs`, `driver/portal-service.mjs`)* |
241
+ | `PORTAL_AUDIT` | `portal-audit.log` beside the installed code | The portal's audit log: every admin write, refusal and 500. *(read from `driver/portal-service.mjs`)* |
242
+ | `PROFILE_AUDIT` | `_audit.log` in the profile store | The profile service's audit log. *(read from `driver/profile-service.mjs`)* |
243
+ | `RECIPE_AUDIT` | `_audit.log` in `CLEAROTRON_RECIPES_DIR` | The recipe service's audit log. *(read from `driver/recipe-service.mjs`)* |
244
+ | `TRADEMARK_MCP_AUDIT_LOG` | `~/trademark/telemetry/trademark-mcp-access.jsonl`, or the file at its older location if one exists there | The staff MCP door's access log. *(read from `mcp-server/lib/audit.mjs`)* |
245
+ | `TRADEMARK_MCP_TOKEN_DENYLIST` | a file in the install's home | The list of revoked access keys, which the doors read and refuse. *(read from `shared/client-door.mjs`, `mcp-server/mint-token.mjs`)* |
246
+ | `TRADEMARK_MCP_KEY_SOCKET` | unset ⇒ no key door | The local key door, and it is a PATH rather than a port on purpose: a tunnel forwards to a port and cannot reach a unix socket, so the transport separates programs on this machine holding a scoped access key from people arriving through a tunnel. Unset means no key door, and a deployment gets exactly the door it had before. |
232
247
 
233
248
  ### Concurrency and admission
234
249
 
@@ -236,6 +251,7 @@ deployment may override (verify live values per deployment).
236
251
  |---|---|---|
237
252
  | `CLEAROTRON_MAX_CONCURRENT_RUNS` | **2** (min 1; re-read at call time) | Global run-slot cap — concurrently executing whole runs, however launched (manual CLI runs included). A deployment's `.env` may set a different value; read the live value rather than this column when you need the one in force. A value that is not a number is refused at the read, by name; the staff status page and the portal report the cap as absent with the reason rather than stating a number nobody chose. |
238
253
  | `CLEAROTRON_GATHER_CONCURRENCY` | 7 | Parallel gather members per run (also batches escalation re-runs, the closure fan-out, the envelope close and the frame-reopen sweep). A split gather is three common-law seats + four register units = 7, so the default runs them in one wave; it was 6 before the meaning seat got its own dispatch. Report cards have their own knob, `CLEAROTRON_CARD_CONCURRENCY` (default 8). |
254
+ | `CLEAROTRON_CARD_CONCURRENCY` | 8 | How many report cards are written at once, a cap shared with the report overview while it runs. A value that is not a number falls back to 8, and the run's record says so, rather than refusing mid-run (see the rule above the tables). *(read from `driver/driver.config.mjs`, `driver/steps/overview-and-cards.mjs`)* |
239
255
  | `CLEAROTRON_RUN_LOCK_POLL_MS` | 15000 | Run-slot acquire poll cadence. |
240
256
  | `CLEAROTRON_ADMISSION_BUDGET_MS` | 7200000 (2 h) | Runner stops claiming new jobs after this per activation; leftovers re-trigger a fresh activation. |
241
257
  | `CLEAROTRON_QUEUE_SCAN_MS` | 10000 (min 1000) | Mid-drain re-scan for newly arrived jobs. |
@@ -265,11 +281,22 @@ deployment may override (verify live values per deployment).
265
281
  | `CLEAROTRON_RATE_LIMIT_PROBE_MS` | `600000` (10 min) | How long a run parked on a provider cap waits before re-probing. Clamped to a 60s minimum — a probe loop tighter than that bills the cap it is waiting on. |
266
282
  | `CLEAROTRON_RATE_LIMIT_PROBE_CEILING_MS` | `2400000` (40 min) | The longest that backoff may grow to. Also clamped to 60s minimum. |
267
283
  | `CLEAROTRON_WALL_RESCUE` | **on** | The wall-clock rescue that salvages a torn draft when a stage hits its wall. `0`/`off`/`false`/`no` disarms it; anything else, including unset, leaves it armed. |
284
+ | `CLEAROTRON_OUTBOX_BACKOFF_BASE_SEC` | `60` | The first wait before a failed delivery wake is retried, in seconds; it doubles with each consecutive failure. *(read from `driver/outbox-backoff.mjs`)* |
285
+ | `CLEAROTRON_OUTBOX_BACKOFF_CAP_SEC` | `900` | The longest wait between delivery retries, in seconds. *(read from `driver/outbox-backoff.mjs`)* |
286
+ | `CLEAROTRON_OUTBOX_BACKOFF_MAX_RETRIES` | `5` | Consecutive failures before the outbox gives up on a delivery. *(read from `driver/outbox-backoff.mjs`)* |
287
+ | `CLEAROTRON_OUTBOX_GIVEUP_COOLDOWN_SEC` | `3600` | How long a given-up delivery waits before it is tried again, in seconds. Note that this one drops `BACKOFF` from the prefix. *(read from `driver/outbox-backoff.mjs`)* |
288
+ | `CLEAROTRON_OUTBOX_NOPROGRESS_MAX` | `5` | Consecutive wakes that return ok without delivering anything before the marker is set aside and an alert is queued. *(read from `driver/outbox-backoff.mjs`)* |
289
+ | `CLEAROTRON_HTTP_TIMEOUT_MS` | 30 minutes | How long the engine's outbound HTTP waits for a response's headers, in the tool servers and the driver. Under a second, or not a number, falls back to the default. *(read from `driver/engine/mcp/http-dispatcher.mjs`)* |
290
+ | `CLEAROTRON_SPAWN_GRACE_MS` | 2 s, and only where it exceeds the stall window | A floor under the stall window at a stage program's start, so its start-up is not charged to the stall clock. *(read from `driver/engine/common.mjs`)* |
291
+ | `CLEAROTRON_MIN_TOKENS_PER_SEC` | `1` | The trickle floor, counted in output tokens per second of ACTIVE time (elapsed minus tool wait). A turn under the floor is stopped there and recorded as a stall. `0` disables the floor entirely and is read as "no floor", never as a floor of zero. |
292
+ | `CLEAROTRON_MIN_TOKENS_WARMUP_MS` | 5 minutes | How long a turn is left alone before the trickle floor applies. |
293
+ | `CLEAROTRON_JX_SERP_DEADLINE_MS` | 5 minutes | The wall clock for the whole native-language web grid; `0` is a valid instant deadline. *(read from `driver/jx-units.mjs`)* |
268
294
 
269
295
  ### Pipeline feature gates and caps
270
296
 
271
- The **gates** default on, and `0` disables most of them. One does not read it that way:
272
- `CLEAROTRON_PLAN_DISPATCH` goes through `envGateOn` and so takes any off-word. (`CLEAROTRON_COMMONLAW_SPLIT`
297
+ The **gates** default on, and `0` disables most of them. Three do not read it that way:
298
+ `CLEAROTRON_PLAN_DISPATCH`, `CLEAROTRON_MODEL_WIRE_CHECK` and `CLEAROTRON_FORM_REPAIR` go through
299
+ `envGateOn` and so take any off-word. (`CLEAROTRON_COMMONLAW_SPLIT`
273
300
  was the other, and its `!== "off"` test meant `0` left the split armed — a spelling trap that is gone
274
301
  with the switch, deleted by item 8.) The numeric
275
302
  **caps** and the policy enum in the last three rows are not on/off switches at all: `0` disables none of
@@ -282,6 +309,11 @@ unrecognised policy value that leaves the default behaviour standing.
282
309
  | `CLEAROTRON_FRAME_REOPEN` (+ `CLEAROTRON_FRAME_REOPEN_MAX`, default 1) | The bounded frame-diff reopen. |
283
310
  | `CLEAROTRON_REGISTER_GAP_CLAMP` | The registerGap verdict clamp arm. |
284
311
  | `CLEAROTRON_UNREACHABLE_SENIOR` (`open-item` \| `clamp`, default `open-item`) | Policy when a verdict-driving senior right can't be retrieved. |
312
+ | `CLEAROTRON_SATPROBE_CODESIDE` | The code-side saturation probe in the register sweep. It needs an `executePlan` adapter (it rides the same lane as `CLEAROTRON_PLAN_DISPATCH`). *(read from `driver/steps/register-sweep.mjs`)* |
313
+ | `CLEAROTRON_BAND_TRUTH_GATE` | The band truth gate in the register sweep. **Never disable in prod — restores the fabrication.** *(read from `driver/steps/register-sweep.mjs`)* |
314
+ | `CLEAROTRON_MODEL_WIRE_CHECK` (`0`, `off`, `false` or `no` disables) | Fails a turn whose provider reports a different model FAMILY than the driver asked for; disarming it silences the refusal and never the record: `modelActual`/`modelMismatch` keep landing on every dispatch row. *(the off-words read from `driver/driver.config.mjs`)* |
315
+ | `CLEAROTRON_FORM_REPAIR` (`0`, `off`, `false` or `no` disables) | Repairs a form-class stage failure inside the dispatch, up to twice; disarmed, the defect falls through to the retry ladder exactly as it did before, visibly, and is never swallowed as "validated fine". *(the off-words read from `driver/driver.config.mjs`)* |
316
+ | `CLEAROTRON_WHATSAPP_OPERATOR_COPY` (`0`, `false` or `no` disables) | Keeps or drops the operator's own copy of the completion notice. It is independent of `CLEAROTRON_REQUESTER_WHATSAPP`: an operator can stop receiving copies of other people's runs without changing who the requester notice reaches. |
285
317
 
286
318
  ### Payload ceilings
287
319
 
@@ -293,6 +325,8 @@ of truncations.
293
325
  |---|---|---|
294
326
  | `CLEAROTRON_BAND_RESPONSE_CHARS` | five sixths of `CLEAROTRON_TOOL_ANSWER_BYTES`: 37,500 on the Claude engine, 30,000 on the OpenAI engine; 70,000 with no answer size | Characters per band-server response, the band summary's parts included; a summary part is never longer than 70,000 whatever this says. Floor 4096. The sixth left over is room for the quotes and line breaks a printout adds and for a banner, so a band answer is never split again into answer parts. On the OpenAI engine it is at most 30,000; a smaller value set here still applies. |
295
327
  | `CLEAROTRON_TOOL_ANSWER_BYTES` | 45,000 on the Claude engine, 36,000 on the OpenAI engine | Bytes per tool answer from every local tool server and the case-law bridge, counted as a quoted string (a quote or line break counts two). A longer answer is served in parts, each naming the next, and the tool runs once: a later part is read from the answer the server holds. Each engine writes its size into every server's entry: Claude Code saves an answer longer than 50,000 characters to a file the model must read for itself, and Codex removes the middle of a tool read longer than about 39,000 bytes. A smaller value set here still applies on both. A server started outside a stage, with no size, serves every answer whole. Floor 8192. |
328
+ | `CLEAROTRON_ENUMERATE_NAMES_CHUNK` | `80` | How many names one register enumerate call carries before it is split into windows. *(read from `providers/clarivate/src/core.js`)* |
329
+ | `TRADEMARK_MCP_MAX_BYTES` | 64 MiB | The largest file an MCP face reads; a larger one fails and names this setting. *(read from `mcp-server/lib/util.mjs`)* |
296
330
 
297
331
  ### Surfaces beside the driver — portal, demo, e2e harness
298
332
 
@@ -308,6 +342,7 @@ because the rule is about what PRODUCT CODE reads, not about what a run reads.
308
342
  | `CLEAROTRON_ADMINISTRATOR_CONTACT` | unset | Who a signed-in person contacts to change the address, the permissions or the companies on their sign-in: a mail address (with or without `mailto:`) or an http(s) address. The portal reads it where it reads the organisation name and sends it on the same `/me` answer; Preferences then links the words "Clearotron administrator" to it. Unset, or any value that is neither a mail nor a web address, ⇒ the words are plain text. Effect class `deployment`; the full contract is its row in `.env.example`. |
309
343
  | `PORTAL_LOCAL_CREDENTIAL` | `~/.cordillera/portal-local-credential.json` | Where local sign-in keeps its passphrase DIGEST. `clearotron start` points it inside the install's own base directory for a new install, so it mints its own passphrase instead of adopting a digest another install left; an install that has been signing in with the shared file keeps it. `npx clearotron demo` always points it inside the demo's own base directory and mints a new passphrase there on every start, so a demo never inherits a digest minted for another address, and removing the demo stays one `rm -rf`. |
310
344
  | `PORTAL_LOCAL_PASSPHRASE` | unset | **NEVER set this in a file.** An internal one-shot handoff, not an operator control: on a first FOREGROUND start the supervisor mints the passphrase and hands it to the portal it spawns *at the spawn call*, so the closing summary can print the value beside the address rather than sending a first-time reader back into eleven startup log lines for the one value in this product that cannot be read back. It is deliberately absent from the composed child environments, because that composition is what `--background` writes into the units' env file — a passphrase there would be a permanent plaintext copy on disk and the product's own sentence, "it is stored only as a digest", would stop being true. Setting it in any env file recreates exactly that. Lost passphrase: `clearotron passphrase --reset`. |
345
+ | `PORTAL_SERVICE_HOST`, `PORTAL_SERVICE_PORT` | `127.0.0.1`, `18802` | The address the portal listens on. `clearotron start` sets both from the ports it resolves. In `local` sign-in mode the portal refuses to start on any address but loopback, because the passphrase and the session cookie would cross the network in plain text. *(read from `driver/portal-service.mjs`, `bin/start.mjs`)* |
311
346
  | `PORTAL_URL` | `http://127.0.0.1:18802`, or built from `PORTAL_SERVICE_HOST`/`PORTAL_SERVICE_PORT` | Where the deploy tick's live-surface check expects to reach the portal. |
312
347
  | `PORTAL_OPS_TOKEN_FILE` | `~/.config/systemd/user/trademark-portal.service.d/secrets.conf` | The systemd drop-in the live-surface check reads `PORTAL_OPS_TOKEN` out of. It reads the FILE rather than the environment so a check run by hand sees the same token the service does. |
313
348
  | `CLEAROTRON_INVOKED_AS` | unset (⇒ the verb's own `argv[1]`) | How the reader typed the command, so every command a verb prints for them to type next is spelled the way they type it: `clearotron …` after a global install, `npx clearotron …` otherwise. The dispatcher runs each verb as a process of its own, whose `argv[1]` is always `bin/<verb>.mjs`, so `bin/clearotron.mjs` passes its own `argv[1]` down in this name. **Set by the dispatcher, never by an operator.** Effect class `deployment`; the full contract is its row in `.env.example`. |
@@ -323,6 +358,50 @@ because the rule is about what PRODUCT CODE reads, not about what a run reads.
323
358
  | `CLEAROTRON_AGENTS` | derived | Comma-separated agent ids for `scripts/purge-runs.mjs` to sweep. |
324
359
  | `CLEAROTRON_E2E_DIR` | **none — the script refuses without it** | The config repo's `e2e/` directory. There is one suite and it is not in this repo (ruling 2026-08-07), so the comparison script names the variable rather than defaulting anywhere. |
325
360
  | `CLEAROTRON_E2E_EXPECT_DEMO_ROSTER` | unset | `1` makes the live-surface check REQUIRE the bundled demo roster. For a box that is meant to ship the demos; off elsewhere, so a real deployment is not failed for lacking them. |
361
+ | `CLEAROTRON_BOX` | none — required (unset or unrecognised ⇒ the unit-inventory line fails and names this variable) | Which deployment this is (`prod` \| `test`), for `scripts/live-surface-check.mjs`'s unit inventory. Self-declared, never inferred from the login name. |
362
+ | `CLEAROTRON_BRAND_NAME` / `CLEAROTRON_BRAND_TAGLINE` / `CLEAROTRON_BRAND_PRODUCT` | reference-deployment literals in `shared/brand.mjs` | Installation brand seam (single-sourced). |
363
+ | `CLEAROTRON_AGENT_WHATSAPP` | unset ⇒ an empty roster | A JSON map of agent id → chat number for the completion notice. Every user of a deployment shares one agent, so this reaches the operator and never the person who ordered the search. Unset is an EMPTY roster and never a demo one. *(the JSON map read from `driver/stages.mjs`)* |
364
+ | `CLEAROTRON_REQUESTER_WHATSAPP` | empty | A JSON map of requester email or handle → number: who the completion notice reaches. It holds contact data; treat it as a mirror-aware value wherever an integrator holds a copy. |
365
+ | `TRADEMARK_MSGID_DOMAIN` | `enqueue.local` | The domain in the message id of a job queued through the staff MCP door. *(read from `mcp-server/lib/ops.mjs`)* |
366
+ | `TRADEMARK_MCP_HTTP_PORT` | `18790` | The staff MCP door's port. Every caller there gets the read tools; an ops token also gets the write tools that start and stop runs, `start_run` among them. *(read from `mcp-server/http-server.mjs`)* |
367
+ | `TRADEMARK_MCP_HTTP_HOST` | `127.0.0.1` | The address the staff MCP door listens on; in `token` mode it must be a loopback address. *(read from `mcp-server/http-server.mjs`)* |
368
+ | `TRADEMARK_MCP_ALLOWED_HOSTS` | **none — set it** | The `host:port` values the staff MCP door answers to. With authentication on, or in `token` mode, unset refuses to start, because DNS-rebinding protection would be off. *(read from `mcp-server/http-server.mjs`)* |
369
+ | `TRADEMARK_MCP_SESSION_TTL_MS` | 30 minutes | Session lifetime on the staff MCP door. *(read from `mcp-server/http-server.mjs`)* |
370
+ | `TRADEMARK_MCP_SESSION_MAX` | `500` | Most sessions the staff MCP door holds at once. *(read from `mcp-server/http-server.mjs`)* |
371
+ | `TRADEMARK_MCP_RATE_PER_MIN` | `120` | Request rate limit on the staff MCP door, per minute. *(read from `mcp-server/http-server.mjs`)* |
372
+ | `TRADEMARK_MCP_OPS_RATE_PER_MIN` | `30` | Rate limit on the staff MCP door's ops requests, per minute. *(read from `mcp-server/http-server.mjs`)* |
373
+ | `TRADEMARK_MCP_AUTH_MODE` | unset ⇒ `cf-access` | Selects the door: unset or `cf-access` is a JWT-fronting proxy at the edge; `token` requires a valid HMAC-signed scoped access key on **every** request and runs no auth proxy at all. An unrecognised value is fatal. |
374
+ | `TRADEMARK_MCP_OIDC_ISSUER` / `TRADEMARK_MCP_JWKS_URL` | unset ⇒ the shapes derived from `CF_ACCESS_TEAM` | The issuer, and the signing-key set, the staff MCP door verifies sign-in tokens against. *(read from `mcp-server/http-server.mjs`)* |
375
+ | `TRADEMARK_MCP_EMAIL_CLAIM` | `email` | The token claim the staff MCP door reads the email address from. *(read from `mcp-server/http-server.mjs`)* |
376
+ | `TRADEMARK_MCP_AUTH_HEADER` | `cf-access-jwt-assertion` | The request header carrying the sign-in token to the staff MCP door; lowercased when read. *(read from `mcp-server/http-server.mjs`)* |
377
+ | `CLIENT_MCP_HTTP_PORT` | `18811` | The client MCP door's port. It was 18795, which collided with a co-hosted warm-MCP block, so keep any unit override that names a port. |
378
+ | `CLIENT_MCP_HTTP_HOST` | `127.0.0.1` | The address the client MCP door listens on. *(read from `mcp-server/http-server-client.mjs`)* |
379
+ | `CLIENT_MCP_ALLOWED_HOSTS` | **none — set it** | The `host:port` values the client MCP door answers to. With authentication on, or in key-only mode, unset refuses to start. *(read from `mcp-server/http-server-client.mjs`)* |
380
+ | `CLIENT_MCP_SESSION_TTL_MS` | 30 minutes | Session lifetime on the client MCP door. *(read from `mcp-server/http-server-client.mjs`)* |
381
+ | `CLIENT_MCP_SESSION_MAX` | `500` | Most sessions the client MCP door holds at once. *(read from `mcp-server/http-server-client.mjs`)* |
382
+ | `CLIENT_MCP_RATE_PER_MIN` | `120` | Request rate limit on the client MCP door, per minute. *(read from `mcp-server/http-server-client.mjs`)* |
383
+ | `CLIENT_MCP_OIDC_ISSUER` / `CLIENT_MCP_JWKS_URL` / `CLIENT_MCP_EMAIL_CLAIM` / `CLIENT_MCP_AUTH_HEADER` | unset ⇒ the staff face's matching value, then the shapes derived from `CF_ACCESS_TEAM` | The client MCP door's issuer, signing-key set, email claim and token header. |
384
+ | `CF_ACCESS_TEAM` | **none — set it, or an issuer** | The JWT-fronting proxy's team, from which the doors derive their issuer and signing-key shapes. With `CLEAROTRON_OIDC_AUDIENCE` and `MCP_ALLOWED_EMAIL_DOMAINS` it appears in unit files as a **mirror of the dashboard**, not a second setup; they must match the edge. The boot guard is an audience PLUS either a team or an issuer. |
385
+ | `CLEAROTRON_OIDC_AUDIENCE` | **none — set it** | The proxy application's audience tag, which the portal, the staff MCP door and the profile and recipe services verify. A mirror of the dashboard; missing it is a refusal to start. *(which services verify it, read from `driver/portal-service.mjs`, `driver/profile-service.mjs`, `driver/recipe-service.mjs`, `mcp-server/http-server.mjs`)* |
386
+ | `CLEAROTRON_CLIENT_OIDC_AUDIENCE` | **none — set it** | The audience the client MCP door verifies. It may not be one of the audiences `CLEAROTRON_OIDC_AUDIENCE` accepts. *(read from `mcp-server/http-server-client.mjs`)* |
387
+ | `MCP_ALLOWED_EMAIL_DOMAINS` | **none — set it, or `MCP_ALLOWED_EMAILS`** | Comma-separated email domains the doors admit; a mirror of the dashboard. The portal and the staff MCP door start with this or `MCP_ALLOWED_EMAILS`; the profile service and the recipe service require this one when sign-in is on. *(read from `driver/portal-service.mjs`, `driver/profile-service.mjs`, `driver/recipe-service.mjs`, `mcp-server/http-server.mjs`)* |
388
+ | `MCP_ALLOWED_EMAILS` | unset | Comma-separated email addresses the portal and the staff MCP door admit, beside `MCP_ALLOWED_EMAIL_DOMAINS`. *(read from `driver/portal-service.mjs`, `mcp-server/http-server.mjs`)* |
389
+ | `PORTAL_AUTH_MODE` | unset ⇒ `auth-proxy` | Selects the door: unset or `auth-proxy` (the default for a hosted deployment) means any login system in front that authenticates in the browser and forwards a verifiable JWT per request; `local` means one address and one passphrase on loopback. `cf-access` is the older word for `auth-proxy`, accepted forever and meaning exactly the same thing. |
390
+ | `PORTAL_OIDC_ISSUER` / `PORTAL_JWKS_URL` | unset ⇒ the shapes derived from `CF_ACCESS_TEAM` | Bringing your own login provider: the issuer, and the signing-key set, the portal verifies against. |
391
+ | `PORTAL_EMAIL_CLAIM` | `email` | The token claim the portal reads the email address from. *(read from `driver/portal-service.mjs`)* |
392
+ | `PORTAL_AUTH_HEADER` | `cf-access-jwt-assertion` | The request header carrying the sign-in token to the portal. Lowercased when read, because Node lowercases incoming header names. *(the default read from `driver/portal-service.mjs`)* |
393
+ | `PORTAL_LOCAL_USER` | none — required in `local` mode | The one email address that signs in to the portal in `local` mode. The service refuses to start without it, and the address must ALSO be enrolled in `CLEAROTRON_ACCESS_FILE`, because signing in is not being enrolled. |
394
+ | `PORTAL_LOCAL_WORKER` | unset | Set only by `bin/start.mjs` when it supervises a worker, and what licenses the portal to say a queued job is waiting for one. |
395
+ | `PORTAL_MCP_URL` | unset ⇒ starting and stopping a run is not wired | The staff MCP door the portal sends start and stop requests to, with `PORTAL_OPS_TOKEN`. `clearotron start` derives it from its resolved ports. *(read from `driver/portal-service.mjs`)* |
396
+ | `PORTAL_OPS_TOKEN` | unset ⇒ starting and stopping a run is not wired | The access key the portal presents to the staff MCP door at `PORTAL_MCP_URL` to start and stop runs. `clearotron start` mints it, capped to the companies on the roster when it started. *(read from `driver/portal-service.mjs`, `bin/brandowner.mjs`, `bin/onboard.mjs`)* |
397
+ | `PORTAL_RATE_PER_MIN` | `120` | Request rate limit on the portal, per minute. *(read from `driver/portal-service.mjs`)* |
398
+ | `PORTAL_PORT` / `PORTAL_HOST` | `18899` / `127.0.0.1` | The dev cockpit's port and address. *(read from `driver/dev-portal.mjs`)* |
399
+ | `PROFILE_PORT` / `PROFILE_HOST` | `18794` / `127.0.0.1` | The profile service's port and address. *(read from `driver/profile-service.mjs`)* |
400
+ | `PROFILE_RATE_PER_MIN` | `60` | Request rate limit on the profile service, per minute. *(read from `driver/profile-service.mjs`)* |
401
+ | `PROFILE_OIDC_ISSUER` / `PROFILE_JWKS_URL` / `PROFILE_EMAIL_CLAIM` / `PROFILE_AUTH_HEADER` | unset ⇒ the shapes derived from `CF_ACCESS_TEAM`; `email`; `cf-access-jwt-assertion` | The profile service's issuer, signing-key set, email claim and token header. *(read from `driver/profile-service.mjs`)* |
402
+ | `RECIPE_PORT` / `RECIPE_HOST` | `18801` / `127.0.0.1` | The recipe service's port and address. *(read from `driver/recipe-service.mjs`)* |
403
+ | `RECIPE_RATE_PER_MIN` | `60` | Request rate limit on the recipe service, per minute. *(read from `driver/recipe-service.mjs`)* |
404
+ | `RECIPE_OIDC_ISSUER` / `RECIPE_JWKS_URL` / `RECIPE_EMAIL_CLAIM` / `RECIPE_AUTH_HEADER` | unset ⇒ the shapes derived from `CF_ACCESS_TEAM`; `email`; `cf-access-jwt-assertion` | The recipe service's issuer, signing-key set, email claim and token header. *(read from `driver/recipe-service.mjs`)* |
326
405
 
327
406
  ### Gates that are OFF by default
328
407
 
@@ -332,6 +411,11 @@ cannot be read as one list.
332
411
  | Var | Default | Meaning |
333
412
  |---|---|---|
334
413
  | `CLEAROTRON_SCREEN_GATE_UNNAMED` | unset (⇒ evidence only) | `enforce` arms the unnamed-row screen gate as terminal. Unset, the run RECORDS whether it enumerated anything under each unnamed row and does not fail — the evidence a decision about the semantics would be built from. Named in `.env.example`; this is the reference row. |
414
+ | `TRADEMARK_MCP_AUTH_DISABLED` / `TRADEMARK_MCP_DEV` | unset | Dev seams — never set in prod. `1` on both turns authentication off on the staff MCP door; the first without the second refuses to start, and it contradicts `TRADEMARK_MCP_AUTH_MODE=token`. *(read from `mcp-server/http-server.mjs`)* |
415
+ | `CLIENT_MCP_AUTH_DISABLED` / `CLIENT_MCP_DEV` | unset | Dev seams — never set in prod. `1` on both turns authentication off on the client MCP door; the first without the second refuses to start. *(read from `mcp-server/http-server-client.mjs`)* |
416
+ | `PROFILE_AUTH_DISABLED` / `PROFILE_DEV` | unset | Auth seams for the profile service. `1` on both turns its authentication off; the first without the second refuses to start. *(read from `driver/profile-service.mjs`)* |
417
+ | `RECIPE_AUTH_DISABLED` / `RECIPE_DEV` | unset | Auth seams for the recipe service. `1` on both turns its authentication off; the first without the second refuses to start. *(read from `driver/recipe-service.mjs`)* |
418
+ | `CLIENT_MCP_TOKEN_ONLY` | unset | `1` runs the client MCP door as a key-only door: every request carries a scoped access key. It requires `TRADEMARK_MCP_TOKEN_SECRET`, `CLIENT_MCP_ACCOUNT_ACCESS=1` and `CLIENT_MCP_ALLOWED_HOSTS`, and refuses `CLIENT_MCP_AUTH_DISABLED`. *(read from `mcp-server/http-server-client.mjs`)* |
335
419
 
336
420
 
337
421
  ### Credentials and gather services (names only — values live in the deployment `.env`)
@@ -346,6 +430,7 @@ cannot be read as one list.
346
430
  | `AWS_REGION` / `AWS_PROFILE` / `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN` | Bedrock's region, optionally the AWS profile, and the standard AWS key variables (the session token only for temporary credentials), read by the Claude program. Without the keys it uses the machine's other AWS credentials, such as an instance role. |
347
431
  | `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` | A gateway in front of a cloud, and its token, read by the Claude program. With no cloud switch, `ANTHROPIC_BASE_URL` is the gateway form of `CLEAROTRON_AI_BILLING=cloud`; the gateway's credential must then be the token, because `ANTHROPIC_API_KEY` is deleted. |
348
432
  | `ANTHROPIC_DEFAULT_OPUS_MODEL` / `ANTHROPIC_DEFAULT_SONNET_MODEL` / `ANTHROPIC_DEFAULT_HAIKU_MODEL` / `ANTHROPIC_DEFAULT_FABLE_MODEL` | The model each tier's alias resolves to, read by the Claude program: on Foundry, the deployment names; anywhere, a way to hold a tier still. Set the fable one to your Fable deployment's name if you set `CLEAROTRON_SYNTHESIS_MODEL=fable`; setup does not ask for it. |
433
+ | `CODEX_API_KEY` | unset | The OpenAI key the `openai-agent` engine bills under `CLEAROTRON_AI_BILLING=api-key`. With that billing and no key, the engine refuses rather than billing the ChatGPT subscription instead. *(read from `driver/engine/auth.mjs`, `driver/driver.config.mjs`)* |
349
434
  | `OPENAI_API_KEY` | **Read only to be DELETED.** The `openai-agent` adapter strips it from the `codex exec` environment under subscription billing, so an unrelated key exported on the box cannot spoil a clean subscription bill. It is never the api-key credential for this product — that is `CODEX_API_KEY`. Listed because a reader who has one set needs to know it is removed. |
350
435
  | `CORSEARCH_SESSION_KEY` | Register provider auth (session cookie). **Preflighted at run start — a missing credential fails fast before any model spend.** |
351
436
  | `CLARIVATE_API_KEY` / `CLARIVATE_API_BASE` | Clarivate adapter — on the engine path: `providers/clarivate/src/mount.js` in `gather-config.mjs`'s stage-grant table, plus driver-side `recordFetch` / `countHits` / `listRecords` / `executePlan`. `CLARIVATE_API_BASE` overrides the core's `DEFAULT_BASE`. |
@@ -355,6 +440,11 @@ cannot be read as one list.
355
440
  | `CLEAROTRON_MCP_URL` | Staff "Ask your AI" connector base, baked into the report at render — there is one report, and `portal-report.mjs` strips the block for non-staff readers at serve time. Fails closed → link omitted when unset. |
356
441
  | `CLEAROTRON_CLIENT_MCP_URL` | The client connector's "Ask your AI" base address, served LIVE by the portal's `/portal/api/mcp-access` (the Connect your AI page) — set it on the portal unit, or the screen shows its (correct) empty state. The render no longer reads it: the baked block is the staff connector above. Fails closed → `{url:null}` when unset. **Never pin a placeholder value:** the fail-closed branch keys on the var being EMPTY, so a placeholder host defeats the guard and hands out a dead connector address. |
357
442
  | `CLIENT_MCP_ACCOUNT_ACCESS` | `1` admits the signed-in principal from outside your staff (kind `account`) on the client MCP surface: no token, scoped to the companies the CF-verified email is granted. Off by default. Set WITHOUT `CLEAROTRON_ACCESS_FILE` ⇒ fatal start (`accountsForEmail` answers `"*"` with no guest list, and an unscoped wildcard must never be admitted). See `docs/CLIENT-MCP.md` — enabling this for a company with no `runCaps.dailyRuns` lets it start paid searches all day. |
443
+ | `PORTAL_SECRET` | The portal. Required in BOTH modes, and signs both token families; unset refuses to start. *(the refusal read from `driver/portal-service.mjs`)* |
444
+ | `SERPAPI_API_KEY` | The SerpAPI web search behind the grid's marketplace cells; absent, those cells are not searched. *(read from `driver/driver.config.mjs`)* |
445
+ | `TRADEMARK_MCP_TOKEN_SECRET` | Signs and verifies the scoped access keys the doors accept. *(read from `shared/scope.mjs`, `driver/systemd/render-units.mjs`)* |
446
+ | `TRADEMARK_MCP_TOKEN_SECRET_PREVIOUS` | The previous signing secret, still accepted during a rotation window. *(read from `shared/scope.mjs`)* |
447
+ | `OAUTH_BRIDGE_CREDS_DIR` / `OAUTH_BRIDGE_CLIENT_NAME` | The case-law bridge: where its sign-in lives (unset ⇒ `~/.config/trademark-oauth-mcp`), and the name it registers under (unset ⇒ `trademark-oauth-mcp-bridge`). *(read from `providers/oauth-mcp-bridge/bridge.mjs`)* |
358
448
 
359
449
  ### Scrub guard
360
450
 
@@ -378,6 +468,13 @@ cannot be read as one list.
378
468
  | `PORTAL_READ_MODEL` | `sonnet` | The model the portal's own compose-read turn uses. Distinct from the pipeline's tiers: this is a portal surface, not a stage. |
379
469
  | `CLEAROTRON_ORDER_PROBE_SEED` | unset | Seed for `scripts/band-shape-probe.mjs`, so an ordering probe can be replayed. A diagnostic script's knob, not a run's. |
380
470
  | `PROBE_TERM` | `DELTA` | The mark word `providers/uspto-local/bin/verify-index.mjs` searches when verifying a built local USPTO index. A diagnostic script's knob, not a run's. Change it when a row reports MEASURES NOTHING: that means the term had no exact hit, so the row's timing is not a result. |
471
+ | `CLEAROTRON_KNOCKOUT_MODEL` | unset ⇒ opus | Model override for every Knockout stage. *(read from `driver/pipeline-knockout.mjs`)* |
472
+ | `CLEAROTRON_JX_FIXTURES` | unset ⇒ live | A folder of canned answers the native-language lanes read instead of calling out: the $0 test seam. *(read from `driver/jx-units.mjs`, `driver/jx.mjs`)* |
473
+ | `CLEAROTRON_KNOCKOUT_SWEEP_FIXTURES` | unset ⇒ live | A folder of saved grid ledgers and answers the Knockout's web sweep reads instead of calling out. *(read from `driver/pipeline-knockout.mjs`)* |
474
+ | `SIGNA_FIXTURES_DIR` | the provider's own test fixtures | The fixtures the Signa provider's mock lane reads. *(read from `providers/signa/src/core.js`)* |
475
+ | `CLEAROTRON_REPLAY_SNAPSHOT` / `CLEAROTRON_REPLAY_ROOTS` | a snapshot file in the home folder / every workspace under `CLEAROTRON_WORK_DIR` | The validator-replay harness's recorded verdict snapshot, and the colon-separated run roots it replays. *(read from `driver/replay-archive.mjs`)* |
476
+ | `SIGNA_SYNC_STAMP` | unset ⇒ the clock | Read only by `bin/signa-sync.mjs`, to make its output reproducible: it pins the generated office snapshot's `fetched_at`, so the same vendor response yields the same bytes. Unset in every deployment, and never read at run time. |
477
+ | `CLEAROTRON_DOCTOR_ASSUME_PINNED` | unset | A CI workspace declaration, read only by `bin/onboard.mjs`, and only to answer whether this checkout being behind its upstream is a question worth asking. |
381
478
 
382
479
  ### Retired — set these and nothing happens
383
480
 
package/docs/branding.md CHANGED
@@ -15,7 +15,7 @@ install needs no change — but the names below are the ones to write:
15
15
 
16
16
  | Variable | Default | Where it surfaces |
17
17
  |---|---|---|
18
- | `CLEAROTRON_BRAND_NAME` | `Clearotron` | Report title and watermark, pool index header, portal nav, Excel metadata, connector instructions |
18
+ | `CLEAROTRON_BRAND_NAME` | `Clearotron` | Report title, pool index header, the portal's logo, its page title and the sentences that name the installation, Excel metadata, connector instructions |
19
19
  | `CLEAROTRON_BRAND_TAGLINE` | *(empty — no strapline is rendered)* | Report and portal chrome |
20
20
  | `CLEAROTRON_BRAND_PRODUCT` | `Trademark clearance` | Artifact naming and connector instructions |
21
21
 
@@ -39,9 +39,9 @@ Unset, the words are plain text.
39
39
 
40
40
  - **The palette is not env-overridable.** Brand colours are defined in code beside those variables.
41
41
  Changing them is a code change, not configuration.
42
- - **Neither is the mark.** The ridge mark is drawn in code (`shared/brand.mjs`) and is Cordillera's,
43
- not the product's. A deployment that sets the three variables gets its own *name* on every artifact
44
- and still gets that mark beside it. Replacing it is a code change today; if you are deploying under
42
+ - **Neither is the mark.** The bracket mark is drawn in code (`shared/brand.mjs`) and is the product's.
43
+ A deployment that sets the three variables gets its own *name* on every artifact and still gets that
44
+ mark beside it. Replacing it is a code change today; if you are deploying under
45
45
  your own name, do it. The Swiss flag that used to sit inside the wordmark is **gone** — a shape is
46
46
  not a claim, but a national flag beside someone else's name was one.
47
47
  - **`portal-ui/dist` is committed and CI byte-compares it against a fresh build.** Brand strings are
@@ -0,0 +1,320 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://clearotron.ai/schemas/report-data/clearance-1.schema.json",
4
+ "title": "report-data/clearance-1",
5
+ "description": "report-data.json beside a clearance report: the client's cut of the run as data. Written by driver/publish/report-data.mjs (clearanceReportData).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema", "kind", "runId", "codename", "matter", "markName", "title", "customerKey", "issued", "engineCommit", "servedModels", "url", "auditFile", "level", "framework", "rating", "caption", "jurisdiction", "scopeBasis", "searchedJurisdictions", "markAssessment", "fourAnswers", "findings", "contextNotes", "coverage", "actions", "askAnswers"],
9
+ "properties": {
10
+ "schema": { "const": "report-data/clearance-1" },
11
+ "kind": { "const": "clearance" },
12
+ "runId": { "type": "string" },
13
+ "codename": { "type": ["string", "null"] },
14
+ "matter": { "type": "string" },
15
+ "markName": { "type": ["string", "null"] },
16
+ "title": { "type": ["string", "null"] },
17
+ "customerKey": { "type": "string" },
18
+ "issued": { "type": ["string", "null"] },
19
+ "engineCommit": { "type": ["string", "null"], "description": "The engine build that produced the report." },
20
+ "servedModels": { "type": ["array", "null"], "items": { "type": "string" }, "description": "The models that served the run, in first-use order; null when none was read." },
21
+ "url": { "type": ["string", "null"] },
22
+ "auditFile": { "type": ["string", "null"] },
23
+ "level": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["searchLevel", "stageLabel"],
27
+ "properties": {
28
+ "searchLevel": { "type": ["string", "null"] },
29
+ "stageLabel": { "type": ["string", "null"] }
30
+ }
31
+ },
32
+ "framework": {
33
+ "type": ["object", "null"],
34
+ "additionalProperties": false,
35
+ "required": ["key", "title", "bands"],
36
+ "properties": {
37
+ "key": { "type": "string" },
38
+ "title": { "type": "string" },
39
+ "bands": { "type": "array", "items": { "$ref": "#/$defs/band" } }
40
+ }
41
+ },
42
+ "rating": {
43
+ "type": ["object", "null"],
44
+ "additionalProperties": false,
45
+ "required": ["tier", "badge", "band", "statement", "conditions"],
46
+ "properties": {
47
+ "tier": { "type": ["string", "null"] },
48
+ "badge": { "type": ["string", "null"] },
49
+ "band": {
50
+ "type": ["object", "null"],
51
+ "additionalProperties": false,
52
+ "required": ["label", "rankFromTop", "scale"],
53
+ "properties": {
54
+ "label": { "type": "string" },
55
+ "rankFromTop": { "type": "integer" },
56
+ "scale": { "type": "integer" }
57
+ }
58
+ },
59
+ "statement": { "type": ["string", "null"] },
60
+ "conditions": { "type": "array", "items": { "type": "string" } }
61
+ }
62
+ },
63
+ "caption": { "type": ["string", "null"] },
64
+ "assessment": { "const": "not-completed", "description": "Present only when the run's overall assessment could not be completed: there is then no rating and no finding." },
65
+ "jurisdiction": { "type": ["string", "null"] },
66
+ "scopeBasis": { "enum": ["instructed", "worldwide", "inferred", null] },
67
+ "searchedJurisdictions": { "type": "array", "items": { "type": "string" } },
68
+ "markAssessment": {
69
+ "type": ["object", "null"],
70
+ "additionalProperties": false,
71
+ "required": ["distinctiveness", "connotation"],
72
+ "properties": {
73
+ "distinctiveness": { "$ref": "#/$defs/assessmentField" },
74
+ "connotation": { "$ref": "#/$defs/assessmentField" }
75
+ }
76
+ },
77
+ "fourAnswers": {
78
+ "type": ["object", "null"],
79
+ "additionalProperties": false,
80
+ "properties": {
81
+ "third_party_rights": { "$ref": "#/$defs/answer", "properties": { "token": { "enum": ["strong", "moderate", "weak"] } } },
82
+ "objection_likelihood": { "$ref": "#/$defs/answer", "properties": { "token": { "enum": ["likely", "possible", "unlikely"] } } },
83
+ "registrability": { "$ref": "#/$defs/answer", "properties": { "token": { "enum": ["registrable", "registrable-with-conditions", "obstructed"] } } },
84
+ "client_enforceability": { "$ref": "#/$defs/answer", "properties": { "token": { "enum": ["strong", "moderate", "weak"] } } }
85
+ }
86
+ },
87
+ "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } },
88
+ "contextNotes": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": ["type", "mark", "context"],
94
+ "properties": {
95
+ "type": { "enum": ["famous-neighbour-ungrounded"] },
96
+ "mark": { "type": "string" },
97
+ "owner": { "type": "string" },
98
+ "context": { "type": ["string", "null"] }
99
+ }
100
+ }
101
+ },
102
+ "coverage": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["area", "state"],
108
+ "properties": {
109
+ "area": { "type": ["string", "null"] },
110
+ "state": { "enum": ["confirmed-clean", "coverage-limited", "open", "not-searched", "note"] },
111
+ "note": { "type": "string" }
112
+ }
113
+ }
114
+ },
115
+ "actions": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": ["conditions", "advisories"],
119
+ "properties": {
120
+ "conditions": { "type": "array", "items": { "$ref": "#/$defs/action", "properties": { "kind": { "enum": ["consent", "coexistence-agreement", "territorial-delimitation", "goods-amendment", "mark-modification", "senior-clearance", "proceeding-response", "counsel-opinion-required"] } } } },
121
+ "advisories": { "type": "array", "items": { "$ref": "#/$defs/action", "properties": { "kind": { "enum": ["client-fact", "commercial-decision", "monitoring", "filing-routine"] } } } }
122
+ }
123
+ },
124
+ "askAnswers": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "required": ["ask", "answer"],
130
+ "properties": {
131
+ "ask": { "type": "string" },
132
+ "answer": { "type": "string" }
133
+ }
134
+ }
135
+ }
136
+ },
137
+ "$defs": {
138
+ "band": {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "required": ["label", "tone"],
142
+ "properties": {
143
+ "label": { "type": "string" },
144
+ "tone": { "enum": ["severe", "high", "medium", "low", "minimal"] }
145
+ }
146
+ },
147
+ "deadline": {
148
+ "type": ["object", "null"],
149
+ "additionalProperties": false,
150
+ "required": ["kind", "date"],
151
+ "properties": {
152
+ "kind": { "type": ["string", "null"] },
153
+ "date": { "type": "string" }
154
+ }
155
+ },
156
+ "classNote": {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "required": ["class", "note"],
160
+ "properties": {
161
+ "class": { "type": "string" },
162
+ "note": { "type": ["string", "null"] }
163
+ }
164
+ },
165
+ "assessmentField": {
166
+ "type": ["object", "null"],
167
+ "additionalProperties": false,
168
+ "required": ["text"],
169
+ "properties": {
170
+ "text": { "type": ["string", "null"] },
171
+ "spectrum": { "type": "string" },
172
+ "per_class": { "type": "array", "items": { "$ref": "#/$defs/classNote" } },
173
+ "per_market": {
174
+ "type": "array",
175
+ "items": {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": ["market", "note"],
179
+ "properties": {
180
+ "market": { "type": ["string", "null"] },
181
+ "note": { "type": ["string", "null"] }
182
+ }
183
+ }
184
+ },
185
+ "counter_registrations": {
186
+ "type": "array",
187
+ "items": {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "properties": {
191
+ "mark": { "type": "string" },
192
+ "uri": { "type": "string" },
193
+ "owner": { "type": "string" },
194
+ "note": { "type": "string" }
195
+ }
196
+ }
197
+ },
198
+ "acquired": { "type": "string" },
199
+ "note": { "type": "string" }
200
+ }
201
+ },
202
+ "answer": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": ["read"],
206
+ "properties": {
207
+ "read": { "type": ["string", "null"] },
208
+ "token": { "type": "string" },
209
+ "basis": { "type": "string" },
210
+ "ordinals": { "type": "array", "items": { "type": "integer" } },
211
+ "obstacles": { "type": "array", "items": { "$ref": "#/$defs/classNote" } }
212
+ }
213
+ },
214
+ "meter": {
215
+ "type": "object",
216
+ "additionalProperties": false,
217
+ "required": ["token", "basis"],
218
+ "properties": {
219
+ "token": { "type": ["string", "null"] },
220
+ "basis": { "enum": ["verified-from-record", "inferred-from-signal", null] }
221
+ }
222
+ },
223
+ "finding": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["ordinal", "mark", "band", "net", "group", "composite", "level", "owner", "meters", "quadrant", "source", "impact", "legal_position", "practical_position", "manageable", "deadline"],
227
+ "properties": {
228
+ "ordinal": { "type": "integer" },
229
+ "mark": { "type": "string" },
230
+ "band": { "type": ["string", "null"] },
231
+ "inputs": { "type": "object", "additionalProperties": { "type": "string" }, "description": "The framework's own inputs for the finding, present only where the framework states a method." },
232
+ "net": { "type": ["string", "null"] },
233
+ "group": { "enum": ["on-field", "off-field", "out-of-scope", null] },
234
+ "composite": { "type": ["integer", "null"], "description": "Kept on runs rated before bands, so an archived run still publishes." },
235
+ "level": { "enum": ["A", "B", "C", "D", "E", null] },
236
+ "owner": {
237
+ "type": "object",
238
+ "additionalProperties": false,
239
+ "required": ["name", "country", "registrations"],
240
+ "properties": {
241
+ "name": { "type": ["string", "null"] },
242
+ "country": { "type": ["string", "null"] },
243
+ "registrations": {
244
+ "type": "array",
245
+ "items": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": ["uri", "classes", "status", "filed", "expiry", "jurisdiction"],
249
+ "properties": {
250
+ "uri": { "type": "string" },
251
+ "classes": { "type": "array", "items": { "type": "string" } },
252
+ "status": { "type": ["string", "null"] },
253
+ "filed": { "type": ["string", "null"] },
254
+ "expiry": { "type": ["string", "null"] },
255
+ "jurisdiction": { "type": ["string", "null"] }
256
+ }
257
+ }
258
+ }
259
+ }
260
+ },
261
+ "meters": {
262
+ "type": ["object", "null"],
263
+ "additionalProperties": false,
264
+ "properties": {
265
+ "mark_similarity": { "$ref": "#/$defs/meter", "properties": { "token": { "enum": ["high", "medium", "low", null] } } },
266
+ "goods_proximity": { "$ref": "#/$defs/meter", "properties": { "token": { "enum": ["high", "medium", "low", null] } } },
267
+ "use": { "$ref": "#/$defs/meter", "properties": { "token": { "enum": ["confirmed", "not-confirmed", "unknown", null] } } },
268
+ "enforcer": { "$ref": "#/$defs/meter", "properties": { "token": { "enum": ["high", "medium", "low", "unknown", null] } } }
269
+ }
270
+ },
271
+ "quadrant": {
272
+ "type": ["object", "null"],
273
+ "additionalProperties": false,
274
+ "required": ["x", "y"],
275
+ "properties": {
276
+ "x": { "type": "number", "minimum": 0, "maximum": 1 },
277
+ "y": { "type": "number", "minimum": 0, "maximum": 1 }
278
+ }
279
+ },
280
+ "source": {
281
+ "type": ["object", "null"],
282
+ "additionalProperties": false,
283
+ "required": ["source_type", "resolved_link"],
284
+ "properties": {
285
+ "source_type": { "enum": ["register-vendor", "register-euipo", "common-law-marketplace", "common-law-web", "case-law", null] },
286
+ "resolved_link": { "type": ["string", "null"] }
287
+ }
288
+ },
289
+ "impact": { "type": ["string", "null"] },
290
+ "legal_position": { "type": ["string", "null"] },
291
+ "practical_position": { "type": ["string", "null"] },
292
+ "off_field_ground": { "enum": ["different-field", "no-material-risk"] },
293
+ "manageable": {
294
+ "type": ["object", "null"],
295
+ "additionalProperties": false,
296
+ "required": ["category", "reason"],
297
+ "properties": {
298
+ "category": { "enum": ["large-competitor", "commercial-partner", "troll", "well-known-enforcer"] },
299
+ "reason": { "type": ["string", "null"] }
300
+ }
301
+ },
302
+ "deadline": { "$ref": "#/$defs/deadline" },
303
+ "ruled_out": { "const": true },
304
+ "ruled_out_reason": { "type": ["string", "null"] }
305
+ }
306
+ },
307
+ "action": {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "required": ["id", "kind", "text", "ordinals", "deadline"],
311
+ "properties": {
312
+ "id": { "type": ["integer", "null"] },
313
+ "kind": { "type": ["string", "null"] },
314
+ "text": { "type": ["string", "null"] },
315
+ "ordinals": { "type": "array", "items": { "type": "integer" } },
316
+ "deadline": { "$ref": "#/$defs/deadline" }
317
+ }
318
+ }
319
+ }
320
+ }