clearotron 0.2.2 → 0.2.4

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 (161) hide show
  1. package/.env.example +64 -37
  2. package/.nvmrc +1 -1
  3. package/CONTRIBUTING.md +8 -4
  4. package/INSTALL.md +36 -14
  5. package/README.md +18 -22
  6. package/THIRD-PARTY-NOTICES.md +1 -1
  7. package/bin/clearotron.mjs +22 -0
  8. package/bin/example.mjs +10 -5
  9. package/bin/onboard.mjs +370 -28
  10. package/bin/start.mjs +220 -12
  11. package/build-info.json +2 -2
  12. package/demo/README.md +1 -1
  13. package/demo/full-country-search/run/_driver/framework.json +1 -1
  14. package/demo/global-preliminary-search/run/_driver/framework.json +1 -1
  15. package/demo/knockout-search/run/_driver/framework.json +1 -1
  16. package/demo/multi-country-focus-search/run/_driver/framework.json +1 -1
  17. package/docs/E2E.md +5 -5
  18. package/docs/GLOSSARY.md +85 -0
  19. package/docs/PORTAL.md +2 -2
  20. package/docs/README.md +6 -4
  21. package/docs/SECURITY.md +17 -0
  22. package/docs/architecture/01-product-overview.md +21 -9
  23. package/docs/architecture/04-configuration-reference.md +2 -0
  24. package/docs/architecture/05-config-governance.md +19 -0
  25. package/docs/architecture/05-customer-profiles.md +2 -2
  26. package/docs/configuration.md +4 -3
  27. package/docs/decisions/0006-what-the-public-repository-carries.md +30 -5
  28. package/driver/CHANGELOG.md +90 -0
  29. package/driver/README.md +25 -6
  30. package/driver/common-law-receipts.mjs +1 -1
  31. package/driver/config-staleness.mjs +1 -1
  32. package/driver/connotation-search.mjs +1 -1
  33. package/driver/contract-audit.mjs +5 -1
  34. package/driver/contract-e3-baseline.json +11 -11
  35. package/driver/dev-portal.mjs +2 -2
  36. package/driver/doubt-selection.mjs +1 -1
  37. package/driver/drainer-identity.mjs +1 -1
  38. package/driver/driver.config.mjs +1 -1
  39. package/driver/effort-model.mjs +2 -2
  40. package/driver/engine/cli-version.mjs +103 -0
  41. package/driver/engine/probe.mjs +45 -5
  42. package/driver/enqueue-schema.mjs +8 -8
  43. package/driver/feedback-store.mjs +1 -1
  44. package/driver/findings-model.mjs +52 -2
  45. package/driver/flag-snapshot.mjs +20 -0
  46. package/driver/framework.mjs +1 -1
  47. package/driver/gateway.mjs +20 -3
  48. package/driver/outbox-backoff.mjs +1 -1
  49. package/driver/package.json +3 -3
  50. package/driver/party-facts.mjs +2 -2
  51. package/driver/phase0.mjs +1 -1
  52. package/driver/pipeline.mjs +211 -106
  53. package/driver/plain-register.mjs +134 -0
  54. package/driver/portal-access.mjs +1 -1
  55. package/driver/portal-config-view.mjs +70 -2
  56. package/driver/portal-families.mjs +1 -1
  57. package/driver/portal-local-auth.mjs +5 -1
  58. package/driver/portal-report.mjs +1 -1
  59. package/driver/portal-service.mjs +79 -9
  60. package/driver/portal-upstream.mjs +2 -2
  61. package/driver/predelivery-lint.mjs +151 -2
  62. package/driver/profile-page.html +10 -2
  63. package/driver/profile-service.mjs +4 -4
  64. package/driver/profiles/README.md +3 -3
  65. package/driver/profiles.mjs +144 -12
  66. package/driver/publish/index.mjs +2 -2
  67. package/driver/publish/knockout.mjs +7 -1
  68. package/driver/publish/render-knockout.mjs +453 -118
  69. package/driver/publish/render.mjs +111 -16
  70. package/driver/reference-strip-signatures.mjs +20 -0
  71. package/driver/search-policy.mjs +3 -3
  72. package/driver/skills/blind-frame/SKILL.md +1 -1
  73. package/driver/skills/knockout-assess/SKILL.md +84 -0
  74. package/driver/skills/matter-frame/SKILL.md +6 -6
  75. package/driver/skills/matter-frame/watchlist-reference.md +2 -2
  76. package/driver/skills/prelim-common-law/SKILL.md +1 -1
  77. package/driver/skills/prelim-search/SKILL.md +1 -1
  78. package/driver/skills/prelim-search/report-prose.md +82 -0
  79. package/driver/skills/prelim-search/risk-framework-demo.manifest.json +1 -1
  80. package/driver/skills/prelim-search/risk-framework-triage.manifest.json +1 -1
  81. package/driver/skills/prelim-search/risk-framework.manifest.json +1 -1
  82. package/driver/skills/prelim-search/synthesis-rules.md +1 -1
  83. package/driver/skills/prelim-variants/SKILL.md +3 -3
  84. package/driver/stage-context.mjs +13 -0
  85. package/driver/stages.mjs +54 -7
  86. package/driver/suite-census.json +220 -58
  87. package/driver/systemd/clearotron-worker.service +3 -3
  88. package/driver/tokens.mjs +1 -1
  89. package/driver/unit-inventory.mjs +214 -27
  90. package/driver/verify.mjs +1 -1
  91. package/driver/whatif-memo-run.mjs +26 -4
  92. package/driver/whatif-memo.mjs +19 -1
  93. package/examples/README.md +2 -2
  94. package/examples/grants.example.json +6 -7
  95. package/mcp-server/CHANGELOG.md +4 -0
  96. package/mcp-server/lib/scrub.mjs +1 -1
  97. package/mcp-server/lib/whatif.mjs +2 -2
  98. package/mcp-server/package.json +1 -1
  99. package/mcp-server/packs/ops/EXAMPLES.md +2 -2
  100. package/mcp-server/server.mjs +1 -1
  101. package/package.json +31 -19
  102. package/portal-ui/dist/assets/{index-Ct3iQtZ2.css → index-1ziUJX1E.css} +43 -2
  103. package/portal-ui/dist/assets/{index-BUGgiYtF.js → index-KFAHMgdT.js} +289 -73
  104. package/portal-ui/dist/index.html +2 -2
  105. package/portal-ui/package.json +1 -1
  106. package/providers/_shared/term-shape.mjs +1 -1
  107. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  108. package/providers/oauth-mcp-bridge/package.json +1 -1
  109. package/providers/uspto-local/src/index-store.js +2 -2
  110. package/scripts/added-reference-check.mjs +45 -89
  111. package/scripts/citation-line-check.mjs +121 -2
  112. package/scripts/e2e.mjs +2 -2
  113. package/scripts/env-classify.mjs +67 -3
  114. package/scripts/generated-files-are-current.mjs +125 -0
  115. package/scripts/live-surface-check.mjs +38 -1
  116. package/scripts/mint-names-in-force.mjs +4 -2
  117. package/scripts/mint-public-residue.mjs +74 -0
  118. package/scripts/mint-reference-strip-backlog.mjs +12 -1
  119. package/scripts/mint-suite-census.mjs +5 -2
  120. package/scripts/nightly-notice.mjs +0 -2
  121. package/scripts/preinstall-node-check.mjs +24 -0
  122. package/scripts/render-check.mjs +13 -2
  123. package/scripts/report-frame-check.mjs +8 -1
  124. package/scripts/report-screenshot.mjs +6 -3
  125. package/scripts/revisit-render-check.mjs +6 -3
  126. package/scripts/score.mjs +1 -1
  127. package/scripts/strip-tracker-citations.mjs +38 -7
  128. package/scripts/test-full.mjs +226 -0
  129. package/scripts/test-run.mjs +16 -0
  130. package/shared/README.md +2 -1
  131. package/shared/anon-overlay.mjs +3 -3
  132. package/shared/browser-temp-root.mjs +142 -0
  133. package/shared/checkout-move.mjs +1 -1
  134. package/shared/client-door.mjs +4 -3
  135. package/shared/customer-store.mjs +1 -1
  136. package/shared/identifier-scan.mjs +1 -1
  137. package/shared/install-auth.mjs +35 -0
  138. package/shared/invocation.mjs +33 -1
  139. package/shared/listen.mjs +55 -3
  140. package/shared/names-in-force.mjs +6 -1
  141. package/shared/node-floor.mjs +97 -0
  142. package/shared/os-advice.mjs +91 -0
  143. package/shared/reap-on-exit.mjs +42 -0
  144. package/shared/reference-guard-classes.mjs +351 -0
  145. package/shared/staff-domain.mjs +154 -0
  146. package/shared/store-in-repo.mjs +23 -2
  147. package/shared/suite-census.mjs +31 -3
  148. package/shared/withheld-paths-access.mjs +36 -18
  149. package/skills/clearotron-ops/SKILL.md +1 -1
  150. package/driver/recipes/README.md +0 -49
  151. package/driver/skills/prelim-search/risk-framework-aurora.manifest.json +0 -19
  152. package/driver/skills/prelim-search/risk-framework-aurora.md +0 -77
  153. package/driver/skills/prelim-search/risk-framework-zephyr.manifest.json +0 -14
  154. package/driver/skills/prelim-search/risk-framework-zephyr.md +0 -33
  155. package/driver/skills/prelim-search/worked-examples-aurora.md +0 -10
  156. package/driver/skills/prelim-search/worked-examples-zephyr.md +0 -10
  157. package/scripts/ai-page-render-check.mjs +0 -532
  158. package/scripts/clearances-render-check.mjs +0 -480
  159. package/scripts/composer-render-check.mjs +0 -1027
  160. package/scripts/home-render-check.mjs +0 -526
  161. package/scripts/portal-lifecycle-check.mjs +0 -639
package/.env.example CHANGED
@@ -18,7 +18,7 @@
18
18
  # and never listed here: CLEAROTRON_KNOCKOUT_MODE, CLEAROTRON_JX_LANES, CLEAROTRON_RECIPES_MODE — if any of the
19
19
  # three is still in your .env, delete the line; the pipeline CLI warns on stderr when it sees one.
20
20
  #
21
- # WHERE THE REST WENT (tracker issue 1838). This file used to carry 237 rows and a new reader met 230 variables to
21
+ # WHERE THE REST WENT. This file used to carry 237 rows and a new reader met 230 variables to
22
22
  # reach the fourteen they need. The deployment and tuning names — identity, ports, tenancy, timeouts,
23
23
  # batch sizes — now live in `.env.deployment.example`. Nothing was dropped: `node scripts/env-audit.mjs`
24
24
  # reads BOTH files, and the ratchet that refuses a product variable with no row anywhere reads both too.
@@ -41,8 +41,8 @@
41
41
  # otherwise.
42
42
  # • Where a var takes a NAMED MODE, the comment says so and no other value does anything at all
43
43
  # (CLEAROTRON_SCREEN_GATE_UNNAMED = "enforce"; CLEAROTRON_UNREACHABLE_SENIOR = open-item|clamp).
44
- # • `# effect: <class>` above a row DECLARES WHAT CHANGES when that name is changed (tracker issue 1149-12,
45
- # ADR-0002). The vocabulary is closed — silent-output-change | disclosed-gate | credential |
44
+ # • `# effect: <class>` above a row DECLARES WHAT CHANGES when that name is changed
45
+ # (ADR-0002). The vocabulary is closed — silent-output-change | disclosed-gate | credential |
46
46
  # deployment | tuning | harness — and EFFECT_CLASSES in scripts/env-audit.mjs says what each one
47
47
  # claims. Like `# external:`, the marker must be the LAST comment above its rows and reaches the
48
48
  # contiguous run below it. The environment-governance guard reds on a NEW `CLEAROTRON_*` read by
@@ -76,7 +76,7 @@
76
76
  # gateway-bin adapter was a runtime, not a provider choice; removed in the extraction.)
77
77
  #
78
78
  # TWO adapters are implemented — engine/CONTRACT.md:3 is the accurate statement, and this file said
79
- # otherwise until tracker issue 547:
79
+ # otherwise until the free-register work corrected it:
80
80
  # anthropic-agent `claude -p`, off-gateway. The default.
81
81
  # openai-agent `codex exec`. Built and $0-tested; live verification still pending.
82
82
  # Either way the reasoning needs a subscription or an API key of its own — that is separate from every
@@ -99,13 +99,13 @@ CLEAROTRON_CUSTOMERS_DIR=
99
99
  # Compute-skills tree the stage prompts resolve `skills/foo/SKILL.md` against. Default = <driverDir>/skills.
100
100
  CLEAROTRON_INSTRUCTIONS_DIR=
101
101
  # Delivery pool: report.html + audit.xlsx land here (served by Caddy behind Cloudflare Access).
102
- # REQUIRED — tracker issue 774 removed the code default. Unset, the engine refuses and names this variable instead
102
+ # REQUIRED — the code default was removed. Unset, the engine refuses and names this variable instead
103
103
  # of falling back to /srv/trademark-archive, which on a deployed box is real client matter.
104
104
  CLEAROTRON_REPORTS_DIR=/srv/trademark-archive
105
105
  # Run-slot lock dir. Default = $CLEAROTRON_WORK_DIR/prelim-run-locks. Every run takes a slot here,
106
106
  # whether the runner dispatched it or somebody launched it by hand, so this is what bounds concurrency
107
107
  # across an install rather than within one process. The portal also reads it to find the worker
108
- # heartbeat (tracker issue 1721); two installs pointed at one lock dir would share a cap they do not expect to.
108
+ # heartbeat; two installs pointed at one lock dir would share a cap they do not expect to.
109
109
  # effect: deployment
110
110
  CLEAROTRON_RUN_LOCK_DIR=
111
111
  # Delivery outbox dir (instant handoff-mode delivery wake). Default = $CLEAROTRON_WORK_DIR/prelim-outbox.
@@ -114,7 +114,7 @@ CLEAROTRON_OUTBOX_DIR=
114
114
  # HEADLESS intake: one explicit queue dir (no agent workspaces needed) — the enqueue CLI + ops-MCP
115
115
  # start_run write here and the runner drains it (additive to the workspace scan). See docs/INTAKE.md.
116
116
  CLEAROTRON_QUEUE_DIR=
117
- # REQUIRED, on every deployment including dev (tracker issue 503). Which register vendor gets called and billed:
117
+ # REQUIRED, on every deployment including dev. Which register vendor gets called and billed:
118
118
  # corsearch | clarivate | signa | euipo | uspto-local | free-tier. There is NO default — unset, the driver refuses at run start rather
119
119
  # than choosing for you.
120
120
  #
@@ -134,9 +134,9 @@ CLEAROTRON_QUEUE_DIR=
134
134
  # not run beside it (corsearch and clarivate already
135
135
  # aggregate both free offices, so a second call buys nothing).
136
136
  #
137
- # FREE euipo the EU register ALONE (tracker issue 546) — needs EUIPO_CLIENT_ID + _SECRET
138
- # uspto-local the US register ALONE (tracker issue 547) — needs USPTO_LOCAL_DB (a built index)
139
- # free-tier BOTH, as ONE register (tracker issue 548) — needs all three of the above
137
+ # FREE euipo the EU register ALONE — needs EUIPO_CLIENT_ID + _SECRET
138
+ # uspto-local the US register ALONE — needs USPTO_LOCAL_DB (a built index)
139
+ # free-tier BOTH, as ONE register — needs all three of the above
140
140
  #
141
141
  # Choosing a free value makes every territory outside its coverage a DISCLOSED DEFERRED coverage row.
142
142
  # That is the honest trade of running without a subscription, not a defect to work around.
@@ -151,7 +151,7 @@ CLEAROTRON_DATABASE=clarivate
151
151
  # CLEAROTRON_GATHER_SESSION_KEY, CLEAROTRON_GATHER_SESSION_ID, CLEAROTRON_GATHER_AGENT,
152
152
  # CLEAROTRON_REGISTER_CALL_LOG, CLEAROTRON_REGISTER_RECORD_LOG
153
153
  #
154
- # THERE IS NO RETENTION SETTING AND NO CLEANUP JOB (tracker issue 743). CLEAROTRON_REGISTER_LEDGER_MAX_BYTES,
154
+ # THERE IS NO RETENTION SETTING AND NO CLEANUP JOB. CLEAROTRON_REGISTER_LEDGER_MAX_BYTES,
155
155
  # CLEAROTRON_REGISTER_LEDGER_KEEP and `npm run prune:ledger` are gone with the rotation tool, because the
156
156
  # thing they bounded no longer grows: RECORD BODIES ARE WRITTEN INTO THE RUN'S OWN DIRECTORY
157
157
  # (<run>/_driver/register-record-bodies.jsonl), archived with the run and purged with it. Nobody should
@@ -164,19 +164,19 @@ CLEAROTRON_DATABASE=clarivate
164
164
  # CLEAROTRON_REGISTER_CALL_LOG is the one that stays box-global: it is one small row per provider call, read
165
165
  # ACROSS runs by the provider-usage tally, and it is the independent witness that a run made record
166
166
  # fetches at all (so a run whose bodies went missing reports as a failure and not as a clean zero).
167
- # Leave it unset: the default is ~/trademark/telemetry/register-calls.jsonl (tracker issue 774 an existing ledger
168
- # under the pre-tracker issue 774 telemetry directory keeps being read where it sits), and an existing corsearch-named
169
- # file from before tracker issue 594 is still read where it sits — production is on that filename today, and reading
170
- # it is not a fault. The vendor-named ENV VARS are gone (tracker issue 605).
167
+ # Leave it unset: the default is ~/trademark/telemetry/register-calls.jsonl (an existing ledger under the older
168
+ # telemetry directory keeps being read where it sits), and an existing corsearch-named file from before
169
+ # the vendor rename is still read where it sits — production is on that filename today, and reading it
170
+ # is not a fault. The vendor-named ENV VARS are gone.
171
171
  #
172
- # tracker issue 1269 — BEING BOX-GLOBAL, IT USED TO COLLECT THE TEST SUITE'S FIXTURE TRAFFIC. A full-suite run on a
172
+ # BEING BOX-GLOBAL, IT USED TO COLLECT THE TEST SUITE'S FIXTURE TRAFFIC. A full-suite run on a
173
173
  # dev or test box appended mock provider calls to this same file, and nothing on the rows said so, so
174
174
  # every usage pattern, provider comparison and cost read over it silently included them. `npm test`
175
175
  # now exports CLEAROTRON_SUITE_TELEMETRY_DIR into its own temp root and the ledgers resolve under that
176
176
  # instead. It is set by the test wrapper and is NOT an operator setting: setting it by hand sends a
177
177
  # real run's billing rows somewhere the tally never reads.
178
178
  #
179
- # A box upgraded across tracker issue 743 still holds its old global RECORD file. Nothing writes or reads it now; the
179
+ # A box upgraded across the retention change still holds its old global RECORD file. Nothing writes or reads it now; the
180
180
  # driver says so once per process on stderr. Archive it with one `mv` when convenient.
181
181
 
182
182
 
@@ -187,7 +187,7 @@ CLEAROTRON_DATABASE=clarivate
187
187
  # subprocess by default so it bills the OAuth SUBSCRIPTION (cheaper), not the API. Keep it set
188
188
  # for the gateway + as the api-key fallback (see CLEAROTRON_AI_BILLING).
189
189
  ANTHROPIC_API_KEY=sk-ant-...
190
- # The headless subscription sign-in's token (tracker issue 2070). `claude setup-token` — run on any
190
+ # The headless subscription sign-in's token. `claude setup-token` — run on any
191
191
  # machine you can sign in on — prints it; setup captures it by paste. The stage subprocess inherits it
192
192
  # untouched in both billing modes (spawnEnv strips only the API key), so this row is the whole
193
193
  # mechanism by which a browserless server authenticates the subscription lane.
@@ -202,7 +202,7 @@ CLAUDE_CODE_OAUTH_TOKEN=
202
202
  # clean subscription bill, so it cannot serve as the key)
203
203
  #
204
204
  # `npm run setup` asks this as its own question, adopts the key, and proves the pair with one cheap
205
- # turn before writing anything (tracker issue 1149 item 5) — so a hand-edit here is the second-best route.
205
+ # turn before writing anything — so a hand-edit here is the second-best route.
206
206
  CLEAROTRON_AI_BILLING=subscription
207
207
  # The api-key credential for openai-agent. Only read when CLEAROTRON_AI=openai-agent and
208
208
  # CLEAROTRON_AI_BILLING=api-key; under "subscription" that engine reads ~/.codex/auth.json instead and
@@ -217,10 +217,10 @@ OPENAI_API_KEY=
217
217
  # Azure OpenAI provider creds. RECONSTRUCTED: only $AZURE_OPENAI_DEPLOYMENT is referenced in this
218
218
  # repo (as the rendered catalog id); these follow the azure-openai provider convention of the agent
219
219
  # platform that consumes them, NOT this repo directly. Verify the exact names against that platform's
220
- # own configuration at deploy — that config belongs to it and is not in this tree under any name (tracker issue 876).
220
+ # own configuration at deploy — that config belongs to it and is not in this tree under any name.
221
221
  # There was never a reader HERE to retire, which is what separates these rows from a stranded one — and
222
- # the line below is what tells the catalogue guard so (tracker issue 1426).
223
- # external: the agent platform's azure-openai provider config (tracker issue 876)
222
+ # the line below is what tells the catalogue guard so.
223
+ # external: the agent platform's azure-openai provider config
224
224
  AZURE_OPENAI_API_KEY=changeme
225
225
  AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
226
226
  AZURE_OPENAI_DEPLOYMENT=gpt-5.4
@@ -235,7 +235,7 @@ AZURE_OPENAI_API_VERSION=2024-10-21
235
235
  # file — an ENV VAR, not a committed literal, and there is no literal under any spelling to edit.
236
236
  #
237
237
  # THERE IS NO DEFAULT PROVIDER, and this block said there was until now. Unset, CLEAROTRON_DATABASE
238
- # resolves to null and every use of it throws at the run door. tracker issue 503 removed the old default for the
238
+ # resolves to null and every use of it throws at the run door. The old default was removed for the
239
239
  # reason worth knowing before you leave it unset: an unset variable took Corsearch in silence, and the
240
240
  # credential guard could not catch it because both boxes carried CORSEARCH_SESSION_KEY.
241
241
  #
@@ -248,7 +248,7 @@ CLARIVATE_API_KEY=changeme
248
248
  # Signa.
249
249
  SIGNA_API_KEY=changeme
250
250
  #
251
- # USPTO, local (tracker issue 547) — the free US source, and the only one here that is not a paid vendor. TWO
251
+ # USPTO, local — the free US source, and the only one here that is not a paid vendor. TWO
252
252
  # variables, and they are needed at different moments, which is why neither substitutes for the other.
253
253
  #
254
254
  # USPTO_LOCAL_DB — where the register FILE lives. The provider searches this; at SEARCH time there is no
@@ -279,13 +279,13 @@ USPTO_API_KEY=changeme
279
279
  # used to imply. There are four products and all four use it, though they behave differently without
280
280
  # it and the difference is worth knowing before you diagnose one:
281
281
  #
282
- # Knockout search RUNS ANYWAY, and says what it skipped (tracker issue 1223 acceptance 6). The screen
282
+ # Knockout search RUNS ANYWAY, and says what it skipped. The screen
283
283
  # carries the register count probe, so its register half is a whole answer
284
284
  # without this key: it delivers counts, marks every name for manual
285
285
  # verification, and states on the report that the open-web half did not
286
286
  # run. The sweep is NOT ATTEMPTED — nothing is billed and nothing 429s.
287
287
  # CLEAROTRON_KNOCKOUT_SWEEP_FIXTURES still gives a $0 dev run WITH a sweep.
288
- # The three clearances REFUSE AT PREFLIGHT, before a stage has spent (tracker issue 1149 item 6). All three
288
+ # The three clearances REFUSE AT PREFLIGHT, before a stage has spent. All three
289
289
  # (global preliminary, carry `commonLawGrid: true` and a saved search cannot switch it off
290
290
  # multi-country focus, (search-policy.mjs), so the deterministic grid sweep always runs, and the
291
291
  # full country) run door refuses by name — grep the tree for the exact string:
@@ -311,15 +311,15 @@ PERPLEXITY_API_KEY=pplx-...
311
311
  # top-up somebody can do in five minutes rather than a defect to diagnose.
312
312
  #
313
313
  # WITHOUT IT the lane does not silently shrink: every grid cell gaps and the run says so, naming the
314
- # dominant cause (`SERPAPI_API_KEY absent from driver env`). There is no switch to arm first — tracker issue 1149
315
- # item 8 deleted it — so any run whose product carries the zh lane needs this key or discloses the gap.
314
+ # dominant cause (`SERPAPI_API_KEY absent from driver env`). There is no switch to turn on first — that
315
+ # switch was deleted — so any run whose product carries the zh lane needs this key or discloses the gap.
316
316
  SERPAPI_API_KEY=your-serpapi-key
317
317
 
318
318
 
319
319
  # -----------------------------------------------------------------------------
320
320
  # 5. REGISTER / EU (EUIPO — OAuth2 client-credentials)
321
321
  # -----------------------------------------------------------------------------
322
- # Needed ONLY when CLEAROTRON_DATABASE=euipo (section 4). Until tracker issue 546, these were read by a side
322
+ # Needed ONLY when CLEAROTRON_DATABASE=euipo (section 4). They used to be read by a side
323
323
  # tool that attached to every register stage whether or not they were set — so an instance with no
324
324
  # EUIPO key looked identical to one with a key. EUIPO is a register provider now: unset credentials
325
325
  # make a run REFUSE at preflight, by name, before any model spend.
@@ -342,7 +342,7 @@ EUIPO_ENVIRONMENT=production
342
342
  PROFILE_REPO_ROOT=
343
343
  SIGNA_FIXTURES_DIR= # canned signa payloads — the $0 seam for that adapter
344
344
 
345
- # ── Names the audit could not see until tracker issue 1460 ───────────────────────────────────────
345
+ # ── Names the audit could not see until the catalogue widened ────────────────────────────────────
346
346
  # Each of these is read through a name held in a string constant — `const IDENT = "NAME"` in one file,
347
347
  # `process.env[IDENT]` in another. Both halves are literals at the author's keyboard, so they were
348
348
  # always governed names; the scanner simply could not reach them. They are catalogued here now.
@@ -356,7 +356,7 @@ SIGNA_FIXTURES_DIR= # canned signa payloads — the $0 seam for that
356
356
  # sets one. This name has no default — unset, the lane refuses. Moving it there would spend that
357
357
  # header's credibility, which every other row in that file depends on, to buy a tidier taxonomy.
358
358
  # `.env.example` promises "what you decide at install", and a must-set variable fits deciding-at-install
359
- # better than it fits never-set-one. Owner ruling, 2026-08-30, on tracker issue 1838.
359
+ # better than it fits never-set-one. Owner ruling, 2026-08-30.
360
360
  #
361
361
  # GIVING THE LANE A DEFAULT WAS CONSIDERED AND REFUSED: refuse-by-name-when-unset is the honest design —
362
362
  # the same family as the pool root, where an unset value THROWS rather than quietly resolving somewhere
@@ -368,7 +368,7 @@ CLEAROTRON_JX_SUBCLASS_DB=
368
368
  # box's ledger and never inherits it. Sits BELOW an explicitly-named ledger file: a test that names its
369
369
  # own path is being deliberate, and this exists for the runs that name nothing.
370
370
  #
371
- # CANNOT LEAVE THIS FILE WHILE PRODUCT CODE READS IT (tracker issue 1838). The catalogue ratchet
371
+ # CANNOT LEAVE THIS FILE WHILE PRODUCT CODE READS IT. The catalogue ratchet
372
372
  # refuses any product-read name with no row, and the backlog it would otherwise join turns ONE WAY.
373
373
  # So the remedy is the knobs step, not the surface step: remove the READ, not the row. A fixture
374
374
  # seam reached through the environment is that argument in its purest form.
@@ -385,7 +385,6 @@ CLEAROTRON_SUITE_TELEMETRY_DIR=
385
385
  # listed here because the catalogue ratchet is about what an operator can FIND, not what they should set.
386
386
  # Replaces PORTAL_DEMO, which named only one of the processes that has to know.
387
387
  # Read by driver/portal-service.mjs, driver/demo-posture.mjs and mcp-server/http-server.mjs.
388
- # Refs tracker issue 2015, 2106.
389
388
  # effect: deployment
390
389
  CLEAROTRON_DEMO=
391
390
 
@@ -400,7 +399,7 @@ CLEAROTRON_DEMO=
400
399
  # IT IS NOT A RUN-SLOT, deliberately. A what-if that took a slot from CLEAROTRON_MAX_CONCURRENT_RUNS could
401
400
  # BLOCK an admitted paid run rather than merely share the machine with it — the same starvation one
402
401
  # layer up. So the two pools are separate and only this one bounds experiments.
403
- # Read by driver/whatif-worker.mjs. Refs tracker issue 1953.
402
+ # Read by driver/whatif-worker.mjs.
404
403
  # effect: tuning
405
404
  CLEAROTRON_WHATIF_MAX_CONCURRENT=1
406
405
 
@@ -421,7 +420,7 @@ CLEAROTRON_WHATIF_MAX_CONCURRENT=1
421
420
  #
422
421
  # Surfaced by the cut-over overlay control once the withheld `ops/` bucket was laid back over the public
423
422
  # tree: the ratchets that would have caught it had had no subject since the cut, so this is a gap of
424
- # long standing rather than a regression. Refs tracker issue 213.
423
+ # long standing rather than a regression.
425
424
  #
426
425
  # Left EMPTY here on purpose. A path in this file would read as a default; there is none, and the
427
426
  # installer supplies the real value.
@@ -438,7 +437,7 @@ CLEAROTRON_CHECKOUT_DIR=
438
437
  # GitHub sets GITHUB_*, so a row would document somebody else's decision. We set these, so a row
439
438
  # documents ours.
440
439
  #
441
- # Found by the audit while closing tracker issue 213, not by that issue's diagnosis — they arrived with
440
+ # Found by the audit rather than by the diagnosis that prompted it — they arrived with
442
441
  # tonight's release-pipeline work and the catalogue ratchet caught them on the next run, which is the
443
442
  # ratchet doing its job. Raised with the release lane rather than silently absorbed.
444
443
 
@@ -485,7 +484,7 @@ CLEAROTRON_RELEASE_WAIT_MS=
485
484
  TRADEMARK_MCP_KEY_SOCKET=
486
485
 
487
486
  # ── Who the completion notice reaches ────────────────────────────────────────────────────────────
488
- # Both arrived with tracker issue 289 and shipped undeclared: they are read by product code and were in
487
+ # Both arrived together and shipped undeclared: they are read by product code and were in
489
488
  # neither this file nor the governance table, which six private environment-contract ratchets caught on
490
489
  # the next overlay run. Catalogued here on the same terms as the release names above — they are OUR
491
490
  # names, read by code that ships.
@@ -508,3 +507,31 @@ CLEAROTRON_REQUESTER_WHATSAPP=
508
507
  # requester notice reaches. Read by driver/stages.mjs (whatsappRouting).
509
508
  # effect: deployment
510
509
  CLEAROTRON_WHATSAPP_OPERATOR_COPY=
510
+
511
+ # ── The two switches that reveal accounts an install deliberately does not offer ──────────────────
512
+ #
513
+ # NEITHER IS FOR AN OPERATOR. Both are set by the product's own commands, and a row here exists because
514
+ # product code reads them, not because copying this file should set them. Leave both unset. Setting
515
+ # either on a real deployment puts accounts in a picker that a clean install is meant not to have.
516
+ #
517
+ # `1` makes the profile loader return the three test-suite fixture accounts in the roster
518
+ # it resolves. They are marked `testFixture` and are refused otherwise on every install route, because a
519
+ # packaging exclusion protects only the tarball and `git clone && npm install` is a documented way in.
520
+ # Set by scripts/test-run.mjs, once, for every child — most checks that need a fixture do not call the
521
+ # loader directly, so there is no argument to pass. An explicit `includeTestFixtures` argument beats
522
+ # this, distinguished on `undefined`, so a check asking what a customer's install resolves is never
523
+ # handed the suite's answer instead. Read by driver/profiles.mjs.
524
+ # effect: harness
525
+ CLEAROTRON_TEST_FIXTURE_PROFILES=
526
+
527
+ # `1` makes the profile loader return the BUNDLED demo account (demo-brand-owner, marked `demoData`).
528
+ # A fresh install resolves `generic` alone — owner ruling 2026-09-08, so nobody has to clean demo
529
+ # material out of an environment they just made — and the demo brings its own account when it runs.
530
+ # Set by `clearotron demo`, by `clearotron start --demo`, and by scripts/test-run.mjs.
531
+ #
532
+ # The gate is on the LAYER, not the flag: a `demoData` account in a deployment's OWN configured store is
533
+ # that deployment's choice and stays offered whatever this is set to, and the admission wall still
534
+ # refuses a real clearance under it. An explicit `includeDemo` argument beats this, on the same rule.
535
+ # Read by driver/profiles.mjs.
536
+ # effect: harness
537
+ CLEAROTRON_DEMO_PROFILES=
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 22
1
+ 22.13
package/CONTRIBUTING.md CHANGED
@@ -6,6 +6,10 @@ you cannot run and why, and the three rules that fail CI if you miss them.
6
6
  Start with [README.md](README.md) for what the engine does and [INSTALL.md](INSTALL.md) for a real
7
7
  installation.
8
8
 
9
+ If a word in the code means something you did not expect, [`docs/GLOSSARY.md`](docs/GLOSSARY.md)
10
+ defines the ones that carry a local meaning — arm, seat, plant, ledger, receipt, carry-through and
11
+ the rest — with the file that owns each.
12
+
9
13
  ## What you can run, with nothing but a clone
10
14
 
11
15
  **Node 22 is a hard floor.** `package.json` declares it, `.nvmrc` pins it, and the free US register
@@ -91,13 +95,13 @@ any writing pass over the documentation, applies to them.
91
95
 
92
96
  ## The three rules that fail CI
93
97
 
94
- **1. Rebuild `portal-ui/dist` before you push.** The bundle is not committed CI builds it from
95
- source and requires byte equality, so a change under `portal-ui/src` that does not build cleanly
96
- fails:
98
+ **1. Build `portal-ui/dist` before you push.** The bundle is not committed; it is gitignored, and
99
+ CI runs `npm run build:ui` from source. So there is nothing to add run it locally when you touch
100
+ `portal-ui/src`, because a bundle that does not build fails CI and there is no committed copy to
101
+ fall back on:
97
102
 
98
103
  ```bash
99
104
  npm run build:ui
100
- git add portal-ui/dist
101
105
  ```
102
106
 
103
107
  CI builds on the exact Node version named in
package/INSTALL.md CHANGED
@@ -1,4 +1,6 @@
1
- # Install & Operate
1
+ # Install & Operate — the reference
2
+
3
+ [QUICKSTART.md](QUICKSTART.md) gets one search running in three commands. This is everything else.
2
4
 
3
5
  Two documents in one file, and most readers need only the first. The engine needs no agent gateway — the
4
6
  reasoning stages' only external LLM dependency is a coding CLI: the Claude CLI (the default) or the codex
@@ -38,15 +40,30 @@ run is [mcp-server/CONNECT.md](mcp-server/CONNECT.md), and why something is the
38
40
  ```
39
41
 
40
42
  Skip this on any machine that already builds software.
41
- - **Node.js >= 22**, and npm. A hard floor: `package.json` declares it, `.nvmrc` pins it, and the free
42
- US register runs on `node:sqlite`, which ships with FTS5 from Node 22. Node 20 installs and then fails
43
- at the first US search. `nvm use` picks the pin up.
44
- - **macOS, Linux, or native Windows for the demo; WSL2 with Node 22 for a clearance.** `npx clearotron
43
+ - **Node.js >= 22.13**, and npm. A hard floor, and the minor matters: the free US register runs on
44
+ `node:sqlite`, which is not a built-in module before 22.13 measured across releases, 2026-09-08. On
45
+ Node 20, or on 22.0 through 22.12, the install succeeds and the first US search fails with
46
+ `ERR_UNKNOWN_BUILTIN_MODULE`, saying nothing about Node. `package.json` declares the floor, the
47
+ install refuses below it before writing anything, and `nvm use` picks the pin up.
48
+ - **macOS, Linux, or native Windows for the demo; WSL2 for a clearance.** `npx clearotron
45
49
  demo` runs anywhere Node does, native Windows included. A real clearance does not: the engine resolves
46
50
  the reasoning CLI the POSIX way, so a native-Windows clearance refuses at preflight even with the CLI
47
- on `PATH`. On Windows, `wsl --install`, then install Node 22 **inside** the Linux distribution and work
48
- through this page from there. A *hosted*
49
- deployment needs Linux for one further thing, the systemd outbox trigger
51
+ on `PATH`. On Windows, `wsl --install -d Ubuntu`, then `wsl -d Ubuntu`, and work through this page
52
+ from **inside** that distribution. Name it: plain `wsl` can open a minimal image with no apt, no
53
+ curl and no bash, and everything below assumes Ubuntu. A fresh Ubuntu has no Node at all, and
54
+ apt's package is below the floor above, so `npx` answers "not found" before anything of ours runs.
55
+ From the Ubuntu prompt:
56
+
57
+ ```bash
58
+ sudo apt update && sudo apt install -y curl
59
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
60
+ . "$HOME/.nvm/nvm.sh" && nvm install 22 # 22.13 or newer, per the floor above
61
+ npm install -g @anthropic-ai/claude-code
62
+ claude # once, interactively, to sign in
63
+ npx clearotron install
64
+ ```
65
+
66
+ A *hosted* deployment needs Linux for one further thing, the systemd outbox trigger —
50
67
  [driver/systemd/README.md](driver/systemd/README.md).
51
68
  - **A reasoning CLI on your `PATH`, signed in.** This is the prerequisite people miss. Every stage runs
52
69
  as a headless turn of a third-party binary, and `CLEAROTRON_AI` picks which one for the whole install.
@@ -149,6 +166,11 @@ you want the second one** — the first assumes access to the repository, which
149
166
 
150
167
  ### From the repository
151
168
 
169
+ **This is the development tree, and it is for contributors.** If you want to run a clearance, take one
170
+ of the two routes above instead. A clone is not a smaller version of the package — it carries the
171
+ fixtures and sample brand owners the project develops against, and those load as real records. They
172
+ are not yours and they are not in the package, which excludes them deliberately.
173
+
152
174
  ```
153
175
  git clone <this-repo> && cd <repo>
154
176
  npm install # installs all workspaces
@@ -459,9 +481,9 @@ matches, the neutral Generic default applies.
459
481
 
460
482
  - **Bundled with the package** (`driver/profiles/`): `generic.json` (the Generic default) and
461
483
  `demo-brand-owner.json`, the account the demo runs as, so you can run and read the machinery
462
- immediately. `driver/profiles/README.md` documents every field. (A clone carries three more
463
- `aurora`, `zephyr`, `petcary` which are fixtures the test suite reads, not accounts to run
464
- clearances for. They are excluded from the published package for exactly that reason.)
484
+ immediately. `driver/profiles/README.md` documents every field. (A clone of the repository carries
485
+ three more, marked `testFixture` in their own files: the test suite reads them, no install offers
486
+ them, and they are excluded from the published package as well.)
465
487
  - **Your real customers live outside the repo.** Point `CLEAROTRON_CUSTOMERS_DIR` at your own private
466
488
  config store and the engine loads *those* accounts instead. **Same engine, different config path** —
467
489
  the code carries no customer identities.
@@ -480,8 +502,8 @@ working examples in `driver/profiles/`:
480
502
  the engine attaches to the profile it loads. One ships beside a bundled demo customer.
481
503
  - **Project overlays** — `projects/<customer-key>/<slug>.json`. A project is one engagement under a
482
504
  customer: a launch screening, a flagship clearance, a regional push. Each may carry its own
483
- `<slug>.context.md` beside it. `projects/aurora/console-ecosystem.json` and
484
- `projects/demo-brand-owner/japan-and-korea-app-launch.json` are the shipped examples.
505
+ `<slug>.context.md` beside it. `projects/demo-brand-owner/japan-and-korea-app-launch.json` is the
506
+ shipped example.
485
507
 
486
508
  ### What a project may and may not change
487
509
 
@@ -536,7 +558,7 @@ Copy or author the customers, context packs and project overlays you want; assum
536
558
  "forwarder": "alex",
537
559
  "forwarderEmail": "alex@example.com",
538
560
  "forwarderDomain": "example.com",
539
- "marks": [{ "ref": "TM-0001", "name": "AURORA SKY", "classes": [9, 42] }],
561
+ "marks": [{ "ref": "TM-0001", "name": "IRONWHISK", "classes": [9, 42] }],
540
562
  "goods": "cloud software for weather analytics",
541
563
  "jurisdictions": ["US"],
542
564
  "product": "knockout-search"
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <p align="center">
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/licence-AGPL--3.0--only-860F09?style=flat-square" alt="Licence: AGPL-3.0-only"></a>
10
- <a href=".nvmrc"><img src="https://img.shields.io/badge/node-%E2%89%A5%2022-250902?style=flat-square" alt="Node 22+"></a>
10
+ <a href=".nvmrc"><img src="https://img.shields.io/badge/node-%E2%89%A5%2022.13-250902?style=flat-square" alt="Node 22.13+"></a>
11
11
  </p>
12
12
 
13
13
  Give it a mark, its classes and a territory. Clearotron searches the trademark registers and the open
@@ -15,7 +15,7 @@ web for conflicts, reasons about the risk the way a clearance lawyer would, and
15
15
  report with a machine-readable audit trail behind every finding. It runs headless on your own machine:
16
16
  no gateway, no platform, and nothing about your matters reaches us.
17
17
 
18
- [Install & operate](INSTALL.md) · [Docs](docs/README.md) · [Security](docs/SECURITY.md) · [Contributing](CONTRIBUTING.md) · [Licence](#licence)
18
+ [Quickstart](QUICKSTART.md) · [Install & operate](INSTALL.md) · [Docs](docs/README.md) · [Security](docs/SECURITY.md) · [Contributing](CONTRIBUTING.md) · [Licence](#licence)
19
19
 
20
20
  ## Install
21
21
 
@@ -35,8 +35,9 @@ calls to us.
35
35
  npm install -g clearotron
36
36
  ```
37
37
 
38
- Node 22 or newer, on macOS, Linux, or Windows via WSL2. That puts `clearotron` on your `PATH`; every
39
- command below works in that short form.
38
+ Node 22.13 or newer, on macOS or Linux. That puts `clearotron` on your `PATH`; every command below
39
+ works in that short form. **On Windows the demo above runs natively; a real clearance needs WSL2** —
40
+ the engine resolves the reasoning CLI the POSIX way and refuses at preflight otherwise.
40
41
 
41
42
  That command gives you the **stable** release — the one that has run a real clearance end to end before it
42
43
  was published. If you want the newest code instead, a beta is published whenever there is something worth
@@ -49,17 +50,6 @@ npm install -g clearotron@beta
49
50
  What each channel promises, and when a stable is cut: [docs/RELEASES.md](docs/RELEASES.md). If you are not
50
51
  sure, the first command is the one you want.
51
52
 
52
- **Or run it from source**, which is what you want if you intend to change it:
53
-
54
- ```bash
55
- git clone https://github.com/CordilleraSarl/Clearotron
56
- cd clearotron
57
- npm install # every workspace
58
- npm run build -w portal-ui # the browser bundle is not committed — build it once
59
- ```
60
-
61
- From a clone the commands are `npx clearotron …`, run from that directory.
62
-
63
53
  ## Quick start
64
54
 
65
55
  Check the install before it does anything. `doctor` only reads — it writes nothing, calls nobody, and
@@ -81,7 +71,7 @@ sentence, or set the classes, marketplaces and search depth yourself:
81
71
  ![The new-clearance screen — classes, marketplaces and the four search depths](docs/assets/portal-new-clearance.png)
82
72
 
83
73
  A finished clearance reads like this — the verdict, the risk band and the four answers. **The mark
84
- VENQORI is invented; the EUIPO register data behind it is real and live**, and the report says so on
74
+ VENQORI is invented; the register data behind it is real and live**, and the report says so on
85
75
  its own face:
86
76
 
87
77
  ![A finished clearance report — the verdict, the risk band and the four answers](docs/assets/portal-clearance-report.jpg)
@@ -100,7 +90,7 @@ npx clearotron run --job my-job.json
100
90
 
101
91
  ## How it fits together
102
92
 
103
- - **A reasoning CLI does the thinking.** Every stage runs as a headless turn of the [Claude CLI](https://claude.com/claude-code) (`claude`) or the Codex CLI (`codex`), installed and signed in. An `ANTHROPIC_API_KEY` is not a substitute: the key decides what the child process is handed, not whether one is spawned.
93
+ - **A reasoning CLI does the thinking.** Every stage runs as a headless turn of the [Claude CLI](https://claude.com/claude-code) (`claude`) or the Codex CLI (`codex`), which must be installed. `CLEAROTRON_AI_BILLING` chooses what pays for the turn: your signed-in subscription, or an API key. Either way the CLI is what runs there is no path that calls the model directly.
104
94
  - **One register credential sets coverage and cost.** `CLEAROTRON_DATABASE` has no default — a run refuses rather than picking a vendor for you. EUIPO and a local USPTO index cost nothing; Signa, Clarivate and Corsearch are subscriptions. [The six, and what each reaches](providers/README.md).
105
95
  - **One research key.** `PERPLEXITY_API_KEY` covers the open web and the marketplaces. A clearance refuses without it at the door, before a register stage has spent.
106
96
  - **A run takes hours, and survives interruption.** Every finished stage stays on disk; a resume re-runs only what is missing, and a run parked on a provider cap continues by itself.
@@ -125,7 +115,8 @@ credential.
125
115
 
126
116
  | Goal | Start here |
127
117
  |---|---|
128
- | Install, configure and operate it | [INSTALL.md](INSTALL.md) |
118
+ | Get one search running | [QUICKSTART.md](QUICKSTART.md) |
119
+ | Install, configure and operate it | [INSTALL.md](INSTALL.md) — the reference |
129
120
  | Pick a register, or run without a paid vendor | [INSTALL.md § 3a](INSTALL.md#3a-running-without-a-paid-register-vendor) |
130
121
  | Submit jobs, or consume what a run emits | [INTAKE](docs/INTAKE.md) · [DELIVERY](docs/DELIVERY.md) |
131
122
  | Read and question a finished run from a chat app | [mcp-server/CONNECT.md](mcp-server/CONNECT.md) |
@@ -135,13 +126,18 @@ credential.
135
126
 
136
127
  ## Development
137
128
 
129
+ A clone is the working tree, not a way to install the product — install it from the package above.
130
+
138
131
  ```bash
139
- git clone https://github.com/CordilleraSarl/Clearotron
140
- cd Clearotron
141
- npm install
142
- npm test # the offline suiteno credentials, no network
132
+ git clone https://github.com/CordilleraSarl/clearotron
133
+ cd clearotron
134
+ npm install # every workspace
135
+ npm run build -w portal-ui # the browser bundle is not committed build it once
136
+ npm test # the offline suite — no credentials, no network
143
137
  ```
144
138
 
139
+ From a clone the commands are `npx clearotron …`, run from that directory.
140
+
145
141
  `npm test` is the whole verification story for someone with no credentials, and it is the first thing
146
142
  [CONTRIBUTING.md](CONTRIBUTING.md) asks of a contributor.
147
143
 
@@ -6193,7 +6193,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
6193
6193
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6194
6194
  ```
6195
6195
 
6196
- ## undici@8.10.2
6196
+ ## undici@7.29.1
6197
6197
 
6198
6198
  - **Licence declared:** `MIT`
6199
6199
  - **Repository:** https://github.com/nodejs/undici
@@ -22,6 +22,7 @@ import { dirname, join } from "node:path";
22
22
  import { fileURLToPath } from "node:url";
23
23
  import { constants as SIG } from "node:os";
24
24
  import { isEntrypoint } from "../shared/is-entrypoint.mjs";
25
+ import { nodeFloorVerdict, nodeFloorRefusal } from "../shared/node-floor.mjs"; // — one floor, read from package.json
25
26
  import { invocationPrefix } from "../shared/invocation.mjs"; // — print a command the reader can type
26
27
 
27
28
  export const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
@@ -133,6 +134,27 @@ const [verb, ...rest] = process.argv.slice(2);
133
134
  process.exit(2);
134
135
  }
135
136
 
137
+ // — THE RUNTIME FLOOR, REFUSED HERE, AND THE ONE THING THIS DISPATCHER LOOKS AT.
138
+ //
139
+ // This file's header says it implements nothing and does not inspect what it forwards, and that rule
140
+ // is right: a second, weaker copy of a check that already exists is worse than no copy. This is not
141
+ // that. It is not about the verb — it is about whether ANY verb can run, which is prior to dispatch
142
+ // and cannot live inside a child that will not start.
143
+ //
144
+ // It exists because the checks we had were in `doctor` and `setup`, which are things you run AFTER
145
+ // `npm install` succeeds. A reader whose runtime is too old meets a failure inside a command instead,
146
+ // and on one report it was an engine door exiting 1 with its message lost. `npx clearotron demo` and
147
+ // `clearotron start` never reached the sentence written for them.
148
+ //
149
+ // `--version` and `--help` above are DELIBERATELY on the near side of this. They are the two things a
150
+ // person runs while writing a bug report, and refusing them would take away the answer to the first
151
+ // question we ask.
152
+ const floor = nodeFloorVerdict();
153
+ if (!floor.ok) {
154
+ console.error(`clearotron: ${nodeFloorRefusal(floor)}`);
155
+ process.exit(1);
156
+ }
157
+
136
158
  // — EVERY VERB ANSWERS --help, INCLUDING THE TWO WHOSE CHILDREN REFUSE IT.
137
159
  //
138
160
  // `run` and `run-queue` dispatch to driver/pipeline.mjs and driver/runner.mjs, orchestrator entry points
package/bin/example.mjs CHANGED
@@ -6,7 +6,7 @@
6
6
  // npx clearotron demo replay demo into ~/trademark-demo and open the portal
7
7
  // npx clearotron demo --product <id> replay a different product's demo (the ids are listed below)
8
8
  // npx clearotron demo --run-dir <dir> replay a frozen example from somewhere else
9
- // npx clearotron demo --base <dir> put the whole demo somewhere else (remove it with one rm -rf)
9
+ // npx clearotron demo --base <dir> put the whole demo somewhere else (one directory to remove later)
10
10
  // npx clearotron demo --port 9000 serve on another port (the demo opens three doors:
11
11
  // 9000, 9001 and 9002)
12
12
  // npx clearotron demo --no-open do not try to open a browser
@@ -39,6 +39,7 @@ import "../shared/env-local.mjs"; // step 4 / — FIRST: this program read a
39
39
  // back-filled. Placed above every other import because a side-effecting import runs in order.
40
40
  import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, statSync } from "node:fs";
41
41
  import { homedir, tmpdir } from "node:os";
42
+ import { removeDirectory } from "../shared/os-advice.mjs";
42
43
  import { invoke } from "../shared/invocation.mjs"; // — the printed command is resolved once, for the reader who is actually standing there
43
44
  import { basename, dirname, join, resolve, sep } from "node:path";
44
45
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -95,6 +96,10 @@ const die = (...lines) => { console.error(`\n${lines.join("\n")}\n`); process.ex
95
96
  // already walked a container — every child holding a meta.json and a run/ — and `bin/start.mjs` seeds the
96
97
  // portal's archive from it. A bare run directory here would have left that call finding nothing and the
97
98
  // installed portal serving an empty archive, silently. Same directory, both readers, no second mechanism.
99
+ // THE PLAYER IS THE DEMO, so it asks for the demo account the same way `start --demo` does. Without
100
+ // this the roster it resolves is a fresh install's — `generic` alone — and the account whose reports
101
+ // it is about would not be there to name.
102
+ process.env.CLEAROTRON_DEMO_PROFILES ??= "1";
98
103
  const DEMO_ROOT = join(REPO, "demo");
99
104
  // The rule lives in `driver/demo-container.mjs` — ONE definition, because it used to be three and they
100
105
  // disagreed. That file records what a knockout demo carries instead of a report.md, and why this line
@@ -253,8 +258,8 @@ const published = results[0].published;
253
258
 
254
259
  // THE LABEL. The reader is about to look at a document that reads like advice about a real mark. It is
255
260
  // not, and the demo says so before the browser opens rather than in a footnote nobody reaches.
256
- console.log(" Real engine output for the fictional mark VENQORI captured 2026-08-11 against the");
257
- console.log(" production EU register, replayed locally: no keys, no model calls, no register queried.");
261
+ console.log(" Real engine output for the fictional mark VENQORI, captured against Clarivate Compumark.");
262
+ console.log(" Replaying it needs no account, no key and no network.");
258
263
  console.log(" Every number, band and citation below was produced by that real run and is being");
259
264
  console.log(" re-rendered from its artifacts. It is an example, not advice.\n");
260
265
  // NAMES THE POPULATION. This printed "13 finding(s)" beside a report showing
@@ -311,7 +316,7 @@ if (has("--once")) {
311
316
  // the base there would tell a reader to remove a directory that does not exist and leave the one that
312
317
  // does — worse than silence, because it reads as an answer.
313
318
  const created = flag("--pool") ? poolRoot : demoBase;
314
- console.log(` Removing it later is one directory: rm -rf ${created}\n`);
319
+ console.log(` Removing it later is one directory: ${removeDirectory(created)}\n`);
315
320
  // NOT A BARE ZERO. A demo that failed to replay one of its four sets `exitCode` above, and exiting 0
316
321
  // here would discard it — printing the failure and then reporting success, which is the shape this
317
322
  // change exists to remove. `--once` is also the invocation a script is most likely to use, so it is
@@ -360,7 +365,7 @@ const startArgs = ["--demo", "--base", demoBase];
360
365
  if (flag("--port")) startArgs.push("--port", flag("--port"));
361
366
  if (has("--no-open")) startArgs.push("--no-open");
362
367
 
363
- console.log(` Removing this demo later is one directory: rm -rf ${demoBase}`);
368
+ console.log(` Removing this demo later is one directory: ${removeDirectory(demoBase)}`);
364
369
  strayFromAnOlderDemo();
365
370
  console.log("");
366
371