clearotron 0.7.0 → 0.8.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +71 -2
- package/build-info.json +2 -2
- package/demo/multi-country-focus-search/run/common-law-grid.json +1 -1
- package/docs/CLIENT-MCP.md +17 -0
- package/docs/assets/README.md +19 -3
- package/docs/assets/portal-clearance-report.jpg +0 -0
- package/docs/assets/portal-conflict-landscape.jpg +0 -0
- package/docs/assets/portal-new-clearance.png +0 -0
- package/driver/CHANGELOG.md +48 -0
- package/driver/config-inventory.mjs +15 -2
- package/driver/dev-portal.mjs +2 -0
- package/driver/effort-model.mjs +34 -4
- package/driver/engine/CONTRACT.md +8 -0
- package/driver/engine/anthropic-agent.mjs +74 -16
- package/driver/engine/jx-turn.mjs +11 -3
- package/driver/engine/openai-agent.mjs +33 -7
- package/driver/engine/run-choices.mjs +28 -7
- package/driver/engine/speed.mjs +107 -0
- package/driver/enqueue-schema.mjs +8 -0
- package/driver/enqueue.mjs +14 -2
- package/driver/jx-units.mjs +2 -2
- package/driver/jx.mjs +1 -1
- package/driver/knockout-plain-language.mjs +96 -0
- package/driver/ladder/attempt-record.mjs +14 -2
- package/driver/ladder/dispatch.mjs +2 -2
- package/driver/ladder/form-repair.mjs +1 -1
- package/driver/ladder/stage.mjs +7 -1
- package/driver/mark-logos.mjs +6 -1
- package/driver/order-receipt.mjs +184 -0
- package/driver/package.json +4 -1
- package/driver/picture-shrink-worker.mjs +21 -0
- package/driver/picture-thumbnail.mjs +132 -0
- package/driver/pipeline-knockout.mjs +14 -0
- package/driver/portal-confirmation.mjs +3 -0
- package/driver/portal-report.mjs +44 -1
- package/driver/portal-routes/run.mjs +19 -9
- package/driver/portal-runs.mjs +118 -63
- package/driver/portal-service.mjs +17 -2
- package/driver/predelivery-lint.mjs +3 -3
- package/driver/progress.mjs +33 -5
- package/driver/publish/column-queries.mjs +86 -0
- package/driver/publish/index.mjs +4 -4
- package/driver/publish/knockout.mjs +35 -8
- package/driver/publish/page-shell.mjs +5 -1
- package/driver/publish/read-document.mjs +3 -0
- package/driver/publish/render-knockout.mjs +61 -16
- package/driver/publish/render.mjs +171 -30
- package/driver/publish/search-depth.mjs +45 -1
- package/driver/publish/strings.mjs +23 -0
- package/driver/publish/templates/report.css +73 -0
- package/driver/research-answers.mjs +17 -6
- package/driver/research-checks.mjs +22 -4
- package/driver/research-records.mjs +81 -0
- package/driver/run-quote.mjs +3 -0
- package/driver/run-speed.mjs +89 -0
- package/driver/runner.mjs +50 -21
- package/driver/saved-register-pages.mjs +23 -22
- package/driver/stage-freshness.mjs +5 -0
- package/driver/stages.mjs +2 -2
- package/driver/steps/open-run.mjs +12 -1
- package/driver/suite-census.json +199 -37
- package/driver/tokens.mjs +3 -0
- package/driver/urgent-count.mjs +54 -0
- package/driver/usage-ledger.mjs +8 -2
- package/driver/web-pictures.mjs +532 -0
- package/mcp-server/CHANGELOG.md +16 -0
- package/mcp-server/lib/document-reads.mjs +28 -0
- package/mcp-server/lib/events.mjs +21 -12
- package/mcp-server/lib/findings.mjs +2 -1
- package/mcp-server/lib/knockout.mjs +3 -2
- package/mcp-server/lib/ops.mjs +103 -6
- package/mcp-server/lib/options.mjs +4 -0
- package/mcp-server/lib/plan.mjs +38 -4
- package/mcp-server/lib/result-shapes.mjs +66 -0
- package/mcp-server/lib/runs.mjs +46 -44
- package/mcp-server/lib/urgent.mjs +29 -0
- package/mcp-server/package.json +1 -1
- package/mcp-server/result-shapes.json +2978 -0
- package/mcp-server/server.mjs +67 -14
- package/package.json +4 -1
- package/portal-ui/dist/assets/{index-qNDhqCw9.js → index-DEkVU2FD.js} +1909 -766
- package/portal-ui/dist/assets/{index-CxAkJXIT.css → index-W6SAoDkS.css} +238 -1
- package/portal-ui/dist/index.html +2 -2
- package/portal-ui/package.json +1 -1
- package/providers/jx/src/turn-envelope.mjs +3 -1
- package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/providers/signa/src/core.js +54 -12
- package/scripts/README.md +3 -0
- package/scripts/e2e-first-time.mjs +2 -2
- package/scripts/mint-result-shapes.mjs +199 -0
- package/scripts/readme-pictures.mjs +227 -0
- package/scripts/render-check.mjs +4 -1
- package/scripts/report-sections-render-check.mjs +191 -0
- package/scripts/settings-render-check.mjs +68 -11
- package/shared/brand.mjs +8 -0
- package/skills/clearotron-account/SKILL.md +24 -0
- package/skills/clearotron-ops/SKILL.md +23 -9
package/driver/portal-runs.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import { orderedQueueFiles } from "./queue-order.mjs";
|
|
|
17
17
|
import { paths, readJson } from "./run-record.mjs";
|
|
18
18
|
import { policyFor, reportIdentityFor } from "./search-policy.mjs";
|
|
19
19
|
import { drainingState } from "./worker-heartbeat.mjs";
|
|
20
|
+
import { config } from "./driver.config.mjs";
|
|
20
21
|
|
|
21
22
|
// A run in one of these has finished; its step is the one its terminal write set, not the stage it last entered.
|
|
22
23
|
const TERMINAL_STATES = new Set(["delivered", "failed", "cancelled"]);
|
|
@@ -39,6 +40,94 @@ function ladderOf(meta) {
|
|
|
39
40
|
return { bands, toneFor };
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
// ── ONE LIST OF STATES, AND THE PORTAL'S PAUSED STATE AS A PROJECTION OF IT ────────────────────────
|
|
44
|
+
//
|
|
45
|
+
// The engine writes these words into a run's status, and the connector passes them through as written. The portal
|
|
46
|
+
// folds the three waits into one paused state with a kind, and this is the one place that fold is written, so the
|
|
47
|
+
// two faces cannot disagree about which wait a run is in. `queued` is an order no worker has claimed yet.
|
|
48
|
+
export const RUN_STATES = Object.freeze(["running", "delivered", "failed", "postponed", "recovering", "parked-for-human", "cancelled", "queued"]);
|
|
49
|
+
const PAUSED_KINDS = Object.freeze({ postponed: "rate-limit", recovering: "recovering", "parked-for-human": "operator" });
|
|
50
|
+
/** The portal's paused kind for an engine state, or null for a state that is not a wait. */
|
|
51
|
+
export const pausedKindOf = (state) => PAUSED_KINDS[state] ?? null;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* WHAT AN UNCLAIMED ORDER IS DOING, in the words the portal has always shown. "Waiting to start" is true of a job
|
|
55
|
+
* behind other work and of a job nothing will pick up; the second says which. `draining` is read once per walk:
|
|
56
|
+
* a queued job cannot answer it itself, and two rows of one answer must agree about whether a worker exists.
|
|
57
|
+
* `null` means not known, which is every install except a local one whose launcher supervises the worker.
|
|
58
|
+
*/
|
|
59
|
+
export const queuedStep = (draining) => (draining === false ? "Waiting for a worker" : "Waiting to start");
|
|
60
|
+
|
|
61
|
+
// ── THE WALK: WHICH RUNS EXIST, READ ONCE FOR BOTH FACES ───────────────────────────────────────────────
|
|
62
|
+
//
|
|
63
|
+
// The portal's list and the connector's tools both answer "which runs are there, for whom, in what state", and
|
|
64
|
+
// each used to make its own walk of the same folders, with its own rules about which folders count. Two walks
|
|
65
|
+
// gave two answers. This is the only walk: each face projects its own rows from what it read, and keeps only
|
|
66
|
+
// what is its own, its row shape and its access filter.
|
|
67
|
+
//
|
|
68
|
+
// WHAT IT READS, AND NOTHING MORE. `records` reads the pool's delivered records (the portal's delivered rows);
|
|
69
|
+
// `archive` reads the status of runs moved into the archive (the connector's delivered rows); `orders` reads the
|
|
70
|
+
// queue. A face asks only for what it shows, so a connector lookup never pays for the pool or the queue, and a
|
|
71
|
+
// portal poll never walks the archive.
|
|
72
|
+
//
|
|
73
|
+
// records [{ name, meta }] — <pool>/<name>/meta.json
|
|
74
|
+
// runs [{ dir, agent, where, status }] — studio/<slug>/<run> ("live"), archive/<month>/<slug>/<run>
|
|
75
|
+
// queued [{ lane, laneIdx, file, job, mtimeMs }] — every pending `<id>.json` in every queue lane, in admission order
|
|
76
|
+
// retired the run ids the portal's list leaves out (the pool's archive tags)
|
|
77
|
+
// draining whether a worker is draining the queue: true, false, or null for not known
|
|
78
|
+
//
|
|
79
|
+
// A folder whose name starts with `_` or `.` holds no run: history, what-if shadows, a run's own working files.
|
|
80
|
+
export function walkRuns({ poolRoot = null, workspaceRoot = null, queueDirs = [], records = false, archive = false, orders = true } = {}) {
|
|
81
|
+
const walk = { records: [], runs: [], queued: [], retired: poolRoot ? readArchivedSet(poolRoot) : new Set(), draining: orders ? drainingState() : null };
|
|
82
|
+
if (records && poolRoot) {
|
|
83
|
+
let names = []; try { names = readdirSync(poolRoot); } catch { /* no pool yet */ }
|
|
84
|
+
for (const name of names) {
|
|
85
|
+
const metaPath = join(poolRoot, name, "meta.json");
|
|
86
|
+
if (!existsSync(metaPath)) continue;
|
|
87
|
+
try { walk.records.push({ name, meta: readJson(metaPath) }); } catch { /* unreadable meta — skip */ }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const statusAt = (dir, agent, where) => {
|
|
91
|
+
try { walk.runs.push({ dir, agent, where, status: readJson(join(dir, "status.json")) }); } catch { /* not a run dir */ }
|
|
92
|
+
};
|
|
93
|
+
const subdirs = (dir) => { try { return readdirSync(dir).filter((n) => !n.startsWith("_") && !n.startsWith(".")); } catch { return []; } };
|
|
94
|
+
const lanes = [], laneKeys = new Set();
|
|
95
|
+
const lane = (dir) => { const key = pathResolve(dir); if (!laneKeys.has(key)) { laneKeys.add(key); lanes.push(dir); } };
|
|
96
|
+
// THE CANONICAL INTAKE FIRST: the configured queue is where the enqueue CLI and the connector's `start_run`
|
|
97
|
+
// write, and a headless install may have no workspace at all. The workspace lanes are a union with it, so a
|
|
98
|
+
// deployment whose queue is not configured keeps working: this adds a place to look, never removes one.
|
|
99
|
+
for (const d of Array.isArray(queueDirs) ? queueDirs : []) if (typeof d === "string" && d) lane(d);
|
|
100
|
+
let workspaces = []; try { workspaces = readdirSync(workspaceRoot); } catch { /* no workspace */ }
|
|
101
|
+
for (const ws of workspaces) {
|
|
102
|
+
const agent = config.agentIdFromWorkspaceName(ws);
|
|
103
|
+
if (agent == null) continue;
|
|
104
|
+
const studio = studioDirFor(join(workspaceRoot, ws));
|
|
105
|
+
for (const slug of subdirs(studio)) {
|
|
106
|
+
if (slug === "queue") { lane(join(studio, slug)); continue; }
|
|
107
|
+
if (slug === "archive") {
|
|
108
|
+
if (!archive) continue;
|
|
109
|
+
for (const month of subdirs(join(studio, slug)))
|
|
110
|
+
for (const aSlug of subdirs(join(studio, slug, month)))
|
|
111
|
+
for (const r of subdirs(join(studio, slug, month, aSlug))) statusAt(join(studio, slug, month, aSlug, r), agent, "archive");
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
for (const r of subdirs(join(studio, slug))) statusAt(join(studio, slug, r), agent, "live");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// A PENDING job is `<id>.json` with no suffix; the runner renames it `.done` or `.failed` when it is through, and
|
|
118
|
+
// those are history the pool and the status files already own. The order is the order the runner admits them
|
|
119
|
+
// (queue-order.mjs, the same function the drain sorts with), so a list and the engine can never disagree.
|
|
120
|
+
for (const dir of orders ? lanes : []) {
|
|
121
|
+
let files = []; try { files = readdirSync(dir); } catch { continue; }
|
|
122
|
+
const ordered = orderedQueueFiles(dir, files.filter((f) => f.endsWith(".json") && !f.startsWith(".")));
|
|
123
|
+
for (const [laneIdx, f] of ordered.entries()) {
|
|
124
|
+
try { walk.queued.push({ lane: dir, laneIdx, file: f, job: readJson(join(dir, f)), mtimeMs: statSync(join(dir, f)).mtimeMs }); }
|
|
125
|
+
catch { /* not a job file */ }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return walk;
|
|
129
|
+
}
|
|
130
|
+
|
|
42
131
|
// ── run listing: delivered (pool metas) + live (workspace status + frozen profile sidecar) ─────────
|
|
43
132
|
//
|
|
44
133
|
// `account` null means EVERY account — the staff "All brand owners" view. Every row carries its own
|
|
@@ -102,13 +191,11 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
102
191
|
// rewrite exists precisely so those keep resolving — 404ing them here would rot them from a curation
|
|
103
192
|
// command, which is not what "archive" means to the person typing it. Ownership is still enforced at
|
|
104
193
|
// that route, unchanged; retirement is about what the pool ADVERTISES, not about who may read what.
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (!existsSync(metaPath)) continue;
|
|
194
|
+
const walk = walkRuns({ poolRoot, workspaceRoot, queueDirs, records: true });
|
|
195
|
+
const retired = walk.retired;
|
|
196
|
+
{
|
|
197
|
+
for (const { name, meta } of walk.records) {
|
|
110
198
|
try {
|
|
111
|
-
const meta = readJson(metaPath);
|
|
112
199
|
const owner = meta.customerKey || "generic";
|
|
113
200
|
if (!mine(owner, meta.organisation ?? null)) continue;
|
|
114
201
|
// Tagged by runId — the same key pool-admin writes, which is the pool DIRECTORY name. Checking
|
|
@@ -218,13 +305,12 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
218
305
|
// row, on every surface that has ever consumed this listing; a `retired: false` on all of
|
|
219
306
|
// them would be a new field for every reader to ignore.
|
|
220
307
|
...(isRetired ? { retired: true } : {}) });
|
|
221
|
-
} catch { /*
|
|
308
|
+
} catch { /* a row that cannot be built — skip */ }
|
|
222
309
|
}
|
|
223
|
-
}
|
|
310
|
+
}
|
|
224
311
|
// live runs: status.json + the frozen profile sidecar (freezeProfile writes `profileKey`)
|
|
225
|
-
const readRun = (dir) => {
|
|
312
|
+
const readRun = ({ dir, status: s }) => {
|
|
226
313
|
try {
|
|
227
|
-
const s = readJson(join(dir, "status.json"));
|
|
228
314
|
// A DELIVERED RUN IS SKIPPED BEFORE ITS PROFILE IS READ: the pool row is its face, and every path
|
|
229
315
|
// below returns for it either way, so reading the profile first only cost a file per delivered run.
|
|
230
316
|
if (s.state === "delivered") return; // the pool row is the delivered face
|
|
@@ -268,7 +354,8 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
268
354
|
// with the run in flight. Mapped HERE, like the other two, so the wire NEVER carries the raw
|
|
269
355
|
// value: the portal contract would coerce an unknown state to "running", which is exactly the
|
|
270
356
|
// zombie face this state exists to end. pausedKind "operator" tells the UI which words to use.
|
|
271
|
-
const
|
|
357
|
+
const pausedKind = pausedKindOf(s.state);
|
|
358
|
+
const paused = pausedKind !== null;
|
|
272
359
|
out.push({ ...(liveRetired ? { retired: true } : {}),
|
|
273
360
|
runId: s.runId, account: owner, ...(owner === "generic" ? { organisation: p.organisation ?? null } : {}), title: s.markName ?? s.slug,
|
|
274
361
|
// THE RUN’S OWN PIPELINE, off the frozen policy sidecar this branch already reads — the same
|
|
@@ -291,7 +378,7 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
291
378
|
product: sp?.level ?? null, stageLabel: stageLabelOf(sp?.level) ?? sp?.stageLabel ?? null,
|
|
292
379
|
productName: productNameOf(sp?.level),
|
|
293
380
|
state: paused ? "paused" : (s.state ?? "running"),
|
|
294
|
-
pausedKind
|
|
381
|
+
pausedKind,
|
|
295
382
|
// The ONE honest ETA this system possesses. The engine computes it from the provider's own
|
|
296
383
|
// reset header and has always written it; it reached the ops surface and stopped one hop short
|
|
297
384
|
// of the browser. Absent for a recovery park, which backs off on a schedule rather than to a
|
|
@@ -304,6 +391,10 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
304
391
|
...(TERMINAL_STATES.has(s.state)
|
|
305
392
|
? { step: s.stepLabel ?? null, stepN: s.stepN ?? null, stepTotal: s.stepTotal ?? null }
|
|
306
393
|
: stageNow(s)),
|
|
394
|
+
// EVERY STEP THE RUN WALKS, by name and in order, as the run wrote its own list (progress.mjs
|
|
395
|
+
// displayStepsFor; the Knockout lane's koSteps). Home lists them on a running card; the browser
|
|
396
|
+
// keeps no copy. Null for a run recorded before the field, which keeps today's single step line.
|
|
397
|
+
steps: Array.isArray(s.steps) && s.steps.length && s.steps.every((x) => typeof x === "string") ? s.steps : null,
|
|
307
398
|
// — a requested stop is a state the screen shows. Stamped by stop_run,
|
|
308
399
|
// preserved by writeRunStatus's spread-merge, replaced by the terminal when the honour check
|
|
309
400
|
// fires. The UI derives "Stopping…" from this beside a non-terminal state.
|
|
@@ -384,25 +475,15 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
384
475
|
// tenants have queued, which is the same thing the 404-never-403 rule exists to prevent. Staff
|
|
385
476
|
// reading across every account see the true lane depth anyway, because for them every row is visible.
|
|
386
477
|
const queuedRows = []; // { row, lane, laneIdx } — positions assigned once the whole scan is in
|
|
387
|
-
//
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
//
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
// drains through the systemd path/timer units, which run `main({once:true})` and write no heartbeat — so
|
|
394
|
-
// a service that read a missing heartbeat as "no worker" would put a false alarm on every queued row in
|
|
395
|
-
// production. Only the launcher that actually supervises a worker claims to know, and it is the same
|
|
396
|
-
// launcher that sets the lock dir, so the two can never be set without each other.
|
|
397
|
-
const draining = drainingState();
|
|
398
|
-
const readQueued = (dir) => {
|
|
399
|
-
let files = []; try { files = readdirSync(dir); } catch { return; }
|
|
400
|
-
const ordered = orderedQueueFiles(dir, files.filter((f) => f.endsWith(".json") && !f.startsWith(".")));
|
|
401
|
-
for (const [laneIdx, f] of ordered.entries()) {
|
|
478
|
+
// Whether a worker is draining is read once, by the walk (`walk.draining`), so every row of one answer agrees.
|
|
479
|
+
// `null` means NOT KNOWN, the default everywhere except a local install: a deployed instance drains through the
|
|
480
|
+
// systemd path/timer units, which write no heartbeat, and reading a missing heartbeat as "no worker" would put a
|
|
481
|
+
// false alarm on every queued row in production (queuedStep).
|
|
482
|
+
const readQueued = ({ lane: dir, laneIdx, file: f, job: j, mtimeMs }) => {
|
|
483
|
+
{
|
|
402
484
|
try {
|
|
403
|
-
const j = readJson(join(dir, f));
|
|
404
485
|
const owner = j.profileKey ?? "generic";
|
|
405
|
-
if (!mine(owner, j.tenant ?? null))
|
|
486
|
+
if (!mine(owner, j.tenant ?? null)) return;
|
|
406
487
|
// ALL the names, spelled the way the run's own status.json and its delivered meta.json spell
|
|
407
488
|
// them — this took `marks[0].name` and named ONE mark of N, so a client who had just ordered a
|
|
408
489
|
// three-name knockout screen saw a single name on the row that tells them it went in.
|
|
@@ -431,16 +512,16 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
431
512
|
// — "Waiting to start" is true of both a job behind other work and a job nothing will
|
|
432
513
|
// ever pick up, and those are not the same thing to whoever just pressed Start. The position
|
|
433
514
|
// still says where it sits in the line; this says whether the line is moving at all.
|
|
434
|
-
state: "queued", step: draining
|
|
515
|
+
state: "queued", step: queuedStep(walk.draining), stepN: null, stepTotal: null,
|
|
435
516
|
reason: null, failedStage: null,
|
|
436
517
|
// Part of the row contract now; a job that has not started has none of them.
|
|
437
518
|
pausedKind: null, resetsAt: null, startedAt: null,
|
|
438
519
|
// A job file has no updatedAt — it has not run. Its MTIME is when it was queued, which is a
|
|
439
520
|
// real fact rather than a fabricated one, sorts a just-queued run to the top where the
|
|
440
521
|
// person who pressed Start will look, and is deterministic under test.
|
|
441
|
-
date: new Date(
|
|
522
|
+
date: new Date(mtimeMs).toISOString().slice(0, 10), overall: null,
|
|
442
523
|
// Queued: its mtime, at full precision, for the same reason the day-level `date` uses it.
|
|
443
|
-
issuedAt: new Date(
|
|
524
|
+
issuedAt: new Date(mtimeMs).toISOString(),
|
|
444
525
|
// The names the job was submitted with — no bands, because nothing has been rated. Same rule as
|
|
445
526
|
// the live row: this array answers "which names", and only the delivered row can answer "at
|
|
446
527
|
// what band".
|
|
@@ -456,37 +537,11 @@ export function scanAccountRuns({ poolRoot, workspaceRoot, account = null, gener
|
|
|
456
537
|
// EVERY QUEUE ONCE. A directory can be reached both ways — `config.queueDirs`
|
|
457
538
|
// lists the workspace queues too — and reading one twice would list every job in it twice and give
|
|
458
539
|
// each row two positions in the line.
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
readQueued(dir);
|
|
465
|
-
};
|
|
466
|
-
// THE CANONICAL INTAKE FIRST, and it is why this parameter exists. `CLEAROTRON_QUEUE_DIR` is where the
|
|
467
|
-
// enqueue CLI and ops-MCP `start_run` write — which is where the PORTAL's own submissions land, since
|
|
468
|
-
// its `trigger` is an ops-MCP hop. The walk below finds only `workspace-*/studio/clearance-search/queue`,
|
|
469
|
-
// and a documented headless install has no workspaces at all: measured on a test deployment, the only queue
|
|
470
|
-
// under the whole tree is the configured one, and it holds portal-prefixed jobs. So this scan ran ZERO
|
|
471
|
-
// times there, and a submitted search was invisible on the dashboard from submit until claim — a
|
|
472
|
-
// minute and a half of a client believing their order was lost.
|
|
473
|
-
for (const d of Array.isArray(queueDirs) ? queueDirs : []) {
|
|
474
|
-
if (typeof d === "string" && d) scanQueue(d);
|
|
475
|
-
}
|
|
476
|
-
try {
|
|
477
|
-
for (const ws of readdirSync(workspaceRoot).filter((n) => n.startsWith("workspace-"))) {
|
|
478
|
-
const studio = studioDirFor(join(workspaceRoot, ws));
|
|
479
|
-
let slugs = []; try { slugs = readdirSync(studio); } catch { continue; }
|
|
480
|
-
for (const slug of slugs) {
|
|
481
|
-
// Still walked, so a deployment whose queue is not in `queueDirs` keeps working. The union is
|
|
482
|
-
// deliberate: this must add a place to look, never remove one.
|
|
483
|
-
if (slug === "queue") { scanQueue(join(studio, slug)); continue; }
|
|
484
|
-
if (slug === "archive" || slug.startsWith("_") || slug.startsWith(".")) continue;
|
|
485
|
-
let runs = []; try { runs = readdirSync(join(studio, slug)); } catch { continue; }
|
|
486
|
-
for (const r of runs) readRun(join(studio, slug, r));
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
} catch { /* no workspace */ }
|
|
540
|
+
// The walk's runs in the order it read them, then the queued orders: the same rows, in the same order, the
|
|
541
|
+
// portal's own walk produced before the connector and the portal shared one.
|
|
542
|
+
for (const run of walk.runs) readRun(run);
|
|
543
|
+
// An order is active work, so it belongs in the ordinary list; the retired index lists retired runs and nothing else.
|
|
544
|
+
if (!includeRetired) for (const q of walk.queued) readQueued(q);
|
|
490
545
|
// Assign the ordinals last, across every lane at once. Cross-lane order is genuinely undefined —
|
|
491
546
|
// the lanes are per-agent and drain concurrently against one shared pair of slots — so lanes are
|
|
492
547
|
// ordered by path purely to make the result STABLE. An ordinal that reshuffled between two polls
|
|
@@ -146,6 +146,7 @@ import { makeUpstream } from "./portal-upstream.mjs";
|
|
|
146
146
|
import { flagView } from "./portal-config-view.mjs";
|
|
147
147
|
import { livePosture } from "./flag-snapshot.mjs"; // — for the capture-vs-box comparison only, never for a value
|
|
148
148
|
import { DEFAULT_CLIENT_DAILY_RUNS, accountUsage } from "./usage-ledger.mjs";
|
|
149
|
+
import { urgentRunsHere } from "./urgent-count.mjs";
|
|
149
150
|
import { SOURCE_REPO } from "../shared/product-identity.mjs"; // AGPL §13 — one answer, three surfaces
|
|
150
151
|
import { engineCommit } from "./engine-build.mjs"; // — the SAME stamp pool meta records
|
|
151
152
|
// — siblings, on their own line: the guard pins the line above and its subject is the JOIN
|
|
@@ -292,6 +293,9 @@ export const PORTAL_JOB_FIELDS = Object.freeze({
|
|
|
292
293
|
"tenant",
|
|
293
294
|
"jurisdictions", "platforms", "geography",
|
|
294
295
|
"product", "recipeKey", "nativeLanguage", "caseLaw", "searchLevel", "deliveryRoute",
|
|
296
|
+
// An Urgent order, carried only as `true`: New clearance offers it with its count of searches, and
|
|
297
|
+
// admission counts it (urgent-count.mjs).
|
|
298
|
+
"urgent",
|
|
295
299
|
"upfrontInstructions", "commercialFlexibility", "priorUse", "campaignShape", "deadline",
|
|
296
300
|
// stamped by the ROUTE rather than copied by jobFor, and on the stored job all the same:
|
|
297
301
|
// `clientPrincipal` from the verified principal's role. It can only ever ADD a cap to the run that
|
|
@@ -656,6 +660,9 @@ export function makePortalService({
|
|
|
656
660
|
// injected for the reason `demo` is: the bootstrap below is the only place that reads the environment for it,
|
|
657
661
|
// and a fixture can drive both answers. The default refuses nothing, which is every fixture that does not ask.
|
|
658
662
|
orderRefusal = async () => null,
|
|
663
|
+
// — CAN AN URGENT ORDER RUN FAST HERE? The answer the run records when it starts (urgent-count.mjs `urgentRunsHere`),
|
|
664
|
+
// injected for the reason `orderRefusal` is. The default is no, so a fixture that does not ask offers Standard only.
|
|
665
|
+
urgentAvailable = () => false,
|
|
659
666
|
audit = () => {},
|
|
660
667
|
// The audit log's PATH, for the one surface that reads it back rather than writing to it
|
|
661
668
|
// (/portal/admin/observed). Separate from `audit` above because that is a sink and this is a source,
|
|
@@ -856,6 +863,9 @@ export function makePortalService({
|
|
|
856
863
|
// Whether the Describe-it half of the composer can actually read. Rides the capability payload
|
|
857
864
|
// the composer already fetches rather than getting its own probe: one round trip decides what the
|
|
858
865
|
// whole screen offers, and a second one would be a second thing to go stale.
|
|
866
|
+
// Whether an Urgent order runs on the faster setting here. New clearance offers Urgent only where it does,
|
|
867
|
+
// and says why not where it does not.
|
|
868
|
+
urgent: { available: urgentAvailable() === true },
|
|
859
869
|
read: {
|
|
860
870
|
available: Boolean(composeRead),
|
|
861
871
|
maxBrief: MAX_BRIEF,
|
|
@@ -929,6 +939,9 @@ export function makePortalService({
|
|
|
929
939
|
// carries verbatim for exactly that reason. A hand-rolled POST sending `false` believed it had
|
|
930
940
|
// switched the investigation off; validateJob now refuses it, in products.mjs's own words.
|
|
931
941
|
...("nativeLanguage" in body && body.nativeLanguage != null ? { nativeLanguage: body.nativeLanguage } : {}),
|
|
942
|
+
// AN URGENT ORDER travels only as `true`, the run's own reading of the field. It is in the review's job hash,
|
|
943
|
+
// so a review confirmed at Standard cannot start an Urgent order (portal-confirmation.mjs).
|
|
944
|
+
...(body.urgent === true ? { urgent: true } : {}),
|
|
932
945
|
// `deliveryRoute` IS CARRIED, and its absence here was THE defect of this round.
|
|
933
946
|
//
|
|
934
947
|
// It is a DECLARED job field with a refusal sentence of its own (enqueue-schema PORTAL_ROUTE_-
|
|
@@ -1013,7 +1026,7 @@ export function makePortalService({
|
|
|
1013
1026
|
// own constants a group prints or answers with, and what the request carries (`request`). A group answers a request it serves and returns undefined for any other, and the dispatcher asks the
|
|
1014
1027
|
// groups in the order its routes have always been matched, so a request is answered by the route that answered it before.
|
|
1015
1028
|
const svc = { poolRoot, workspaceRoot, secret, grants, localSignIn, writeGrants, revokeConnectorKeys, queueDirs, trigger,
|
|
1016
|
-
stopRun, stopControl, demo, orderRefusal, audit, auditPath, auditLog, feedbackCapture, readBuilt, readCanCount,
|
|
1029
|
+
stopRun, stopControl, demo, orderRefusal, urgentAvailable, audit, auditPath, auditLog, feedbackCapture, readBuilt, readCanCount,
|
|
1017
1030
|
readTerritories, upstream, composeRead, readBudget, loadProfilesImpl, usedJtis, sweepJtis, searchesFor, jobFor, selectorOf,
|
|
1018
1031
|
engineProgramDisputed, connectCaches, INSTALL_ROOT, INSTALL_CHANNEL, READ_OFF_NOTE, refusalFor, allowanceExhaustedLine };
|
|
1019
1032
|
|
|
@@ -2859,7 +2872,9 @@ const PORT = PORT_CHOICE.port;
|
|
|
2859
2872
|
// demo out of one. Anything but the literal "1" is not a demo.
|
|
2860
2873
|
demo: isDemo(process.env), // — one name, shared with the MCP door
|
|
2861
2874
|
// The runner's own order-time test, asked of the runner's own tables: the portal refuses what the runner would.
|
|
2862
|
-
orderRefusal: async () => portalOrderRefusal({ tables: await runTables() })
|
|
2875
|
+
orderRefusal: async () => portalOrderRefusal({ tables: await runTables() }),
|
|
2876
|
+
// Whether an Urgent order runs fast here: the same answer the runner counts by and the run records.
|
|
2877
|
+
urgentAvailable: urgentRunsHere });
|
|
2863
2878
|
const { RateLimiter } = await import("../mcp-server/lib/ratelimit.mjs");
|
|
2864
2879
|
const limiter = new RateLimiter({ perMinute: Number(process.env.PORTAL_RATE_PER_MIN || 120) });
|
|
2865
2880
|
const { createServer } = await import("node:http");
|
|
@@ -215,12 +215,12 @@ export function templateChecks({ headerName, ratedNames, searchedNames }) {
|
|
|
215
215
|
|
|
216
216
|
// THE LINES THE DELIVERED PAGE DRAWS FROM THE RECORD, OUTSIDE report.md, THAT CAN NAME A PARTY. The page (render.mjs)
|
|
217
217
|
// draws the coverage rows that are not clean under "What was searched", less a driver-composed follow-up row that another
|
|
218
|
-
// row already restates, and
|
|
218
|
+
// row already restates, and every web and marketplace name under "Also considered" (search-depth.mjs's clearedNames
|
|
219
|
+
// decides which blocks are names, so the page and this read one list). A party
|
|
219
220
|
// named only in a row the page hides is not shown to the reader, so the page's rules are applied here exactly. They are
|
|
220
221
|
// copied rather than imported: importing the page renderer would hand every tool server that loads this lint the
|
|
221
222
|
// branding settings the renderer reads. The test a-party-the-page-shows-is-introduced-to-the-reader renders a page and
|
|
222
223
|
// holds this copy to it, the hidden follow-up row included.
|
|
223
|
-
export const PAGE_WEB_NAMES_SHOWN = 8;
|
|
224
224
|
const PAGE_FOLLOW_UP_PREFIX = "Follow-up / ";
|
|
225
225
|
const PAGE_AXIS_LABELLED = /\s\/\s/;
|
|
226
226
|
const PAGE_COV_STOPWORDS = new Set(["the", "a", "an", "as", "for", "of", "in", "on", "and", "or", "to", "is",
|
|
@@ -249,7 +249,7 @@ function pageDrawnCoverage(coverage, followUpKinds = null) {
|
|
|
249
249
|
export function pageNameLines({ coverage = [], webNames = [], followUpKinds = null } = {}) {
|
|
250
250
|
return [
|
|
251
251
|
...pageDrawnCoverage(coverage, followUpKinds).map((c) => `${c.area ?? ""} ${c.note ?? ""}`),
|
|
252
|
-
...(Array.isArray(webNames) ? webNames : []).
|
|
252
|
+
...(Array.isArray(webNames) ? webNames : []).map((w) => String(w?.title ?? "")),
|
|
253
253
|
];
|
|
254
254
|
}
|
|
255
255
|
/** The parties a step names, read as the check below reads the step's line on the page: its text and condition. PURE. */
|
package/driver/progress.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import { isStopReason, stopReason } from "../shared/stop-reason.mjs"; // a sto
|
|
|
20
20
|
import { DRIVER_DIR, atomicWrite, readJson } from "./run-record.mjs";
|
|
21
21
|
import { config } from "./driver.config.mjs";
|
|
22
22
|
import { batchMarkName } from "./mark-name.mjs";
|
|
23
|
+
import { productSpec } from "./products.mjs"; // which products read case law, which names the sixth step
|
|
23
24
|
import { runLog, note } from "./log.mjs";
|
|
24
25
|
// — the seed's pid stamp. claim-liveness.mjs is the real home of the /proc reader (runner.mjs
|
|
25
26
|
// imports and re-exports it rather than owning it), so this takes it from the source and adds no
|
|
@@ -42,6 +43,28 @@ export const DISPLAY_STEPS = [
|
|
|
42
43
|
"Sending to you", // 9 notify, notify-chat → .delivered
|
|
43
44
|
];
|
|
44
45
|
|
|
46
|
+
// THE SIXTH STEP OF A SEARCH THAT DOES NOT READ CASE LAW. Global preliminary and Multi-country focus run
|
|
47
|
+
// the same stages, and their sixth step is the review of the conclusions: they do not search case law
|
|
48
|
+
// (`caseLaw: false` in products.mjs). Named "Case law & refutation" there, a list that ticks it tells the
|
|
49
|
+
// reader case law was covered. Approved wording, 2026-11-25.
|
|
50
|
+
export const CONCLUSIONS_STEP = "Checking the conclusions";
|
|
51
|
+
const CASE_LAW_STEP_INDEX = 5;
|
|
52
|
+
const CONCLUSIONS_STEPS = Object.freeze(DISPLAY_STEPS.map((s, i) => (i === CASE_LAW_STEP_INDEX ? CONCLUSIONS_STEP : s)));
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The display steps of a clearance of this product, in order: the ONE home of every name a person reads
|
|
56
|
+
* for a clearance's progress. A product that does not read case law names its sixth step
|
|
57
|
+
* CONCLUSIONS_STEP; every other product, and one this build cannot place, keeps DISPLAY_STEPS. PURE.
|
|
58
|
+
*/
|
|
59
|
+
export function displayStepsFor(product) {
|
|
60
|
+
return productSpec(product)?.caseLaw === false ? CONCLUSIONS_STEPS : DISPLAY_STEPS;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The display steps a clearance run walks, from its frozen search policy. */
|
|
64
|
+
function runDisplaySteps(ctx) {
|
|
65
|
+
return displayStepsFor(ctx?.searchPolicy?.product ?? ctx?.searchPolicy?.level ?? null);
|
|
66
|
+
}
|
|
67
|
+
|
|
45
68
|
// Real STAGES key (no axis suffix) → 0-based DISPLAY_STEPS index.
|
|
46
69
|
//
|
|
47
70
|
// — this map, STAGE_NO_STEP and NON_STAGE_STEPS below are a CLOSED PARTITION of Object.keys(STAGES),
|
|
@@ -91,12 +114,13 @@ export const NON_STAGE_STEPS = {
|
|
|
91
114
|
};
|
|
92
115
|
|
|
93
116
|
// rawStageKey may carry an axis suffix ("register-unit:primary-sweep") — strip it. Returns null for an
|
|
94
|
-
// unknown key so callers can no-op (an unmapped stage must never touch the displayed step).
|
|
95
|
-
|
|
117
|
+
// unknown key so callers can no-op (an unmapped stage must never touch the displayed step). `steps` is
|
|
118
|
+
// the run's own list (displayStepsFor); the index is the same in every list, only a name differs.
|
|
119
|
+
export function stepForStage(rawStageKey, steps = DISPLAY_STEPS) {
|
|
96
120
|
const key = String(rawStageKey ?? "").split(":")[0];
|
|
97
121
|
const index = STAGE_TO_STEP[key];
|
|
98
122
|
if (index == null) return null;
|
|
99
|
-
return { index, label:
|
|
123
|
+
return { index, label: steps[index], n: index + 1, total: steps.length };
|
|
100
124
|
}
|
|
101
125
|
|
|
102
126
|
/**
|
|
@@ -397,7 +421,8 @@ export function resumeRecord(runDir, resume) {
|
|
|
397
421
|
|
|
398
422
|
export function seedRunStatus(ctx, { resume = false } = {}) {
|
|
399
423
|
const { job, run, agent } = ctx;
|
|
400
|
-
const
|
|
424
|
+
const steps = runDisplaySteps(ctx);
|
|
425
|
+
const first = stepForStage("matter-frame", steps);
|
|
401
426
|
const pass = resumeRecord(run.runDir, resume);
|
|
402
427
|
writeRunStatus(ctx, {
|
|
403
428
|
schema: 1,
|
|
@@ -426,6 +451,9 @@ export function seedRunStatus(ctx, { resume = false } = {}) {
|
|
|
426
451
|
...identitySeed(),
|
|
427
452
|
stepIndex: first.index, stepLabel: first.label, stepN: first.n, stepTotal: first.total,
|
|
428
453
|
currentStep: currentStepOf(first),
|
|
454
|
+
// EVERY STEP THIS RUN WALKS, by name and in order, so a surface that lists them reads the run's own
|
|
455
|
+
// list rather than keeping a copy. The Knockout lane writes its own list the same way.
|
|
456
|
+
steps: [...steps],
|
|
429
457
|
lastStage: null,
|
|
430
458
|
review: null,
|
|
431
459
|
url: null,
|
|
@@ -452,7 +480,7 @@ export function seedRunStatus(ctx, { resume = false } = {}) {
|
|
|
452
480
|
// raw key; this is the same moment in the stepper's own words, for a surface that shows where the run is.
|
|
453
481
|
// A stage with no display step leaves it where it was: those stages run inside the step already shown.
|
|
454
482
|
export function recordTransition(ctx, rawStageKey) {
|
|
455
|
-
const step = stepForStage(rawStageKey);
|
|
483
|
+
const step = stepForStage(rawStageKey, runDisplaySteps(ctx));
|
|
456
484
|
writeRunStatus(ctx, {
|
|
457
485
|
...(step ? { stepIndex: step.index, stepLabel: step.label, stepN: step.n, stepTotal: step.total, currentStep: currentStepOf(step) } : {}),
|
|
458
486
|
lastStage: rawStageKey,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright 2026 Cordillera Sàrl. Additional terms under section 7 of the AGPL-3.0 apply — see ADDITIONAL-TERMS.md
|
|
3
|
+
// publish/column-queries.mjs — the report's own narrow layout, for a column narrower than the window.
|
|
4
|
+
//
|
|
5
|
+
// The report's responsive rules ask the WINDOW how wide it is. The conflict panel needs the report's narrow layout in a
|
|
6
|
+
// column that is narrow while the window is not: beside the panel on a laptop, the column is narrowed to the width the
|
|
7
|
+
// report already has a layout for, and the card inside the panel is drawn at the panel's width. A third layout is not
|
|
8
|
+
// wanted, and neither is a second copy of the rules kept in step by hand, so each width rule is answered here, in code,
|
|
9
|
+
// by a twin that asks the column instead.
|
|
10
|
+
//
|
|
11
|
+
// THE TWINS CHANGE NOTHING UNTIL THEY ARE ASKED TO. Each one is scoped by a zero-specificity :where() to a column that
|
|
12
|
+
// opted in: the report's column while the page carries `rep-narrow`, and the panel. Everywhere else they match nothing,
|
|
13
|
+
// so with the panel shut every element is styled by exactly the rules it had before, in the same order. A max-width rule
|
|
14
|
+
// keeps its window form, which a wide window never meets; a min-width rule's window form is kept for every column that
|
|
15
|
+
// did not opt in, and its twin answers for the one that did. Print rules and rules that ask anything but width are left
|
|
16
|
+
// as they are.
|
|
17
|
+
//
|
|
18
|
+
// THE COLUMN'S WIDTH IS MEASURED INSIDE ITS PADDING, the window's outside it. The report's column has 26 px each side, so
|
|
19
|
+
// a twin asks for the window's breakpoint less 52 px: a column narrowed to 664 px lays out as a 664 px window would.
|
|
20
|
+
// The panel is a query container without padding, so it is offset the same way by the CSS that sizes it.
|
|
21
|
+
import { strict as assert } from "node:assert";
|
|
22
|
+
|
|
23
|
+
export const COLUMN = "repcol";
|
|
24
|
+
export const INSET = 52;
|
|
25
|
+
const OPTED_IN = ":where(html.rep-narrow,.cpanel)";
|
|
26
|
+
const NOT_OPTED_IN = ":where(html:not(.rep-narrow))";
|
|
27
|
+
|
|
28
|
+
/** The index just after the block that opens at `open` (a `{`), skipping comments and strings. */
|
|
29
|
+
function blockEnd(css, open) {
|
|
30
|
+
let depth = 0;
|
|
31
|
+
for (let i = open; i < css.length; i++) {
|
|
32
|
+
const c = css[i];
|
|
33
|
+
if (c === "/" && css[i + 1] === "*") { const j = css.indexOf("*/", i + 2); i = j < 0 ? css.length : j + 1; continue; }
|
|
34
|
+
if (c === '"' || c === "'") { let j = i + 1; while (j < css.length && css[j] !== c) j += css[j] === "\\" ? 2 : 1; i = j; continue; }
|
|
35
|
+
if (c === "{") depth++;
|
|
36
|
+
else if (c === "}" && --depth === 0) return i + 1;
|
|
37
|
+
}
|
|
38
|
+
throw new Error("column-queries: a block in the stylesheet never closes");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The plain rules inside a block body, as [selectors, declarations]. A nested at-rule is refused: none exists today. */
|
|
42
|
+
function rulesOf(body) {
|
|
43
|
+
const out = [];
|
|
44
|
+
let i = 0;
|
|
45
|
+
while (i < body.length) {
|
|
46
|
+
const open = body.indexOf("{", i);
|
|
47
|
+
if (open < 0) { assert.equal(body.slice(i).replace(/\/\*[\s\S]*?\*\//g, "").trim(), "", "column-queries: text after the last rule"); break; }
|
|
48
|
+
const head = body.slice(i, open).replace(/\/\*[\s\S]*?\*\//g, "").trim();
|
|
49
|
+
if (head.startsWith("@")) throw new Error(`column-queries: a nested at-rule (${head}) inside a width rule is not handled`);
|
|
50
|
+
const end = blockEnd(body, open);
|
|
51
|
+
out.push([head, body.slice(open + 1, end - 1)]);
|
|
52
|
+
i = end;
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const scope = (selectors, prefix) => selectors.split(",").map((s) => `${prefix} ${s.trim()}`).join(",");
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The stylesheet with a column twin beside each width rule. PURE: the same text in gives the same text out.
|
|
61
|
+
* @param {string} css
|
|
62
|
+
*/
|
|
63
|
+
export function withColumnQueries(css) {
|
|
64
|
+
let out = "";
|
|
65
|
+
let i = 0;
|
|
66
|
+
const at = /@media\s*([^{]*)\{/g;
|
|
67
|
+
let m;
|
|
68
|
+
while ((m = at.exec(css))) {
|
|
69
|
+
const cond = m[1].trim();
|
|
70
|
+
const open = m.index + m[0].length - 1;
|
|
71
|
+
const end = blockEnd(css, open);
|
|
72
|
+
const width = cond.match(/^(?:(screen)\s+and\s+)?\(\s*(max|min)-width\s*:\s*(\d+)px\s*\)$/);
|
|
73
|
+
if (!width) { at.lastIndex = open + 1; continue; } // print, motion, colour scheme: left as they are, and searched inside
|
|
74
|
+
const [, screen, kind, px] = width;
|
|
75
|
+
const rules = rulesOf(css.slice(open + 1, end - 1));
|
|
76
|
+
const n = Number(px) - INSET;
|
|
77
|
+
const twin = `@container ${COLUMN} (${kind}-width:${n}px){${rules.map(([s, d]) => `${scope(s, OPTED_IN)}{${d}}`).join("")}}`;
|
|
78
|
+
const original = kind === "min"
|
|
79
|
+
? `@media ${cond}{${rules.map(([s, d]) => `${scope(s, NOT_OPTED_IN)}{${d}}`).join("")}}`
|
|
80
|
+
: css.slice(m.index, end);
|
|
81
|
+
out += css.slice(i, m.index) + original + (screen ? `@media screen{${twin}}` : twin);
|
|
82
|
+
i = end;
|
|
83
|
+
at.lastIndex = end;
|
|
84
|
+
}
|
|
85
|
+
return out + css.slice(i);
|
|
86
|
+
}
|
package/driver/publish/index.mjs
CHANGED
|
@@ -1368,7 +1368,7 @@ function clearanceRead(r) {
|
|
|
1368
1368
|
const { parsed, fm, deliv, dates, issued, asOf, demoData, demoMd, inputsAbsent, findings, coverage, contextNotes,
|
|
1369
1369
|
quarantined, findingsError, coverageJudgment, markAssessment, actionsRegister, askAnswers, correctionsDoc,
|
|
1370
1370
|
fourAnswers, findingsSchemaVersion, findingsKept, assessmentNotCompleted, coverageJudgmentDisplay, recordsByUri,
|
|
1371
|
-
logos, followUpKinds, runProviderConf, recordOrigin, providerLabel, runOrigins, seniorRights, verdictInfo,
|
|
1371
|
+
logos, webPictures, followUpKinds, runProviderConf, recordOrigin, providerLabel, runOrigins, seniorRights, verdictInfo,
|
|
1372
1372
|
droppedConditions, undispatchedProbes, withheldFamilies, setAside, framework, frameworkMethod, scopeBasis,
|
|
1373
1373
|
searchedJurisdictions, registerReach, registerScope, planTerritories, caseLawByOrdinal, caseLawNotice,
|
|
1374
1374
|
enforcerSignals, officeLinks, reviewReceipts, clientGate, fetchState, searchPolicy, registerOnly,
|
|
@@ -1378,7 +1378,7 @@ function clearanceRead(r) {
|
|
|
1378
1378
|
return {
|
|
1379
1379
|
parsed, fm, deliv, dates, issued, asOf, demoData, demoMd, inputsAbsent, findings, coverage, contextNotes,
|
|
1380
1380
|
quarantined, findingsError, coverageJudgment, markAssessment, actionsRegister, askAnswers, correctionsDoc,
|
|
1381
|
-
fourAnswers, findingsSchemaVersion, findingsKept, assessmentNotCompleted, coverageJudgmentDisplay, recordsByUri, logos, followUpKinds,
|
|
1381
|
+
fourAnswers, findingsSchemaVersion, findingsKept, assessmentNotCompleted, coverageJudgmentDisplay, recordsByUri, logos, webPictures, followUpKinds,
|
|
1382
1382
|
runProviderConf, recordOrigin, providerLabel, runOrigins, seniorRights, verdictInfo, droppedConditions,
|
|
1383
1383
|
undispatchedProbes, withheldFamilies, setAside, framework, frameworkMethod, scopeBasis, searchedJurisdictions, registerReach, registerScope,
|
|
1384
1384
|
planTerritories, caseLawByOrdinal, caseLawNotice, enforcerSignals, officeLinks, reviewReceipts, clientGate,
|
|
@@ -1457,7 +1457,7 @@ const CLEARANCE_SHAPE = {
|
|
|
1457
1457
|
return built;
|
|
1458
1458
|
}); // a REAL exception only — the report ships without the workbook, and nothing names it
|
|
1459
1459
|
},
|
|
1460
|
-
surfaces({ writeRO, writeDataFile }, reportDocument, { doc: { searchDepth, recordsByUri, logos, deliv, demoData } }) {
|
|
1460
|
+
surfaces({ writeRO, writeDataFile }, reportDocument, { doc: { searchDepth, recordsByUri, logos, webPictures, deliv, demoData } }) {
|
|
1461
1461
|
// THE report. The render receives no QC flags — the report a lawyer signs carries no
|
|
1462
1462
|
// caveat banner (H1/H2); the receipts live on audit.xlsx. The machine QC above decides nothing
|
|
1463
1463
|
// about this write.
|
|
@@ -1468,7 +1468,7 @@ const CLEARANCE_SHAPE = {
|
|
|
1468
1468
|
// fails for want of it).
|
|
1469
1469
|
if (searchDepth) { try { writeRO('search-depth.json', JSON.stringify(searchDepth, null, 2)); } catch { /* additive */ } }
|
|
1470
1470
|
|
|
1471
|
-
writeRO('report.html', renderReport(pageDocument(reportDocument), { recordsByUri, logos, homeHref: '../index.html', chromeHref: '../assets/chrome.css', delivery: deliv, demoData })); // the page reads the report document, with its surface beside it
|
|
1471
|
+
writeRO('report.html', renderReport(pageDocument(reportDocument), { recordsByUri, logos, webPictures, homeHref: '../index.html', chromeHref: '../assets/chrome.css', delivery: deliv, demoData })); // the page reads the report document, with its surface beside it
|
|
1472
1472
|
// ONE report: report.client.html is no longer written. The knockout lane's own
|
|
1473
1473
|
// collapse note is the precedent: "two renderings of one run is how the wrong link gets sent". The
|
|
1474
1474
|
// client host serves the same report.html through the portal's readReport() (cleaning built in) — its
|