clearotron 0.6.0 → 0.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +7 -4
- package/QUICKSTART.md +1 -0
- package/README.md +5 -2
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/bin/clearotron.mjs +4 -2
- package/bin/onboard.mjs +158 -29
- package/build-info.json +2 -2
- package/docs/CLIENT-MCP.md +3 -1
- package/docs/DELIVERY.md +6 -3
- package/docs/architecture/02-architecture.md +1 -1
- package/docs/architecture/04-configuration-reference.md +105 -8
- package/docs/branding.md +4 -4
- package/docs/report-data/clearance-1.schema.json +320 -0
- package/docs/report-data/knockout-1.schema.json +268 -0
- package/driver/CHANGELOG.md +77 -0
- package/driver/cancel.mjs +19 -0
- package/driver/connotation-search.mjs +1 -1
- package/driver/contract-e3-backlog.mjs +41 -41
- package/driver/contract-vocabulary.mjs +1 -1
- package/driver/coverage-ledger.mjs +18 -2
- package/driver/deferral-row.mjs +1 -1
- package/driver/degraded-parts.mjs +1 -0
- package/driver/driver.config.mjs +5 -5
- package/driver/effective-scope.mjs +3 -1
- package/driver/engagement-receipt.mjs +3 -3
- package/driver/engine/anthropic-agent.mjs +15 -1
- package/driver/engine/common.mjs +7 -0
- package/driver/engine/mcp/band-server.mjs +7 -16
- package/driver/engine/mcp/codex-config.mjs +3 -0
- package/driver/engine/mcp/recording-server.mjs +45 -34
- package/driver/engine/openai-agent.mjs +74 -7
- package/driver/engine/session-record.mjs +44 -2
- package/driver/findings-model.mjs +14 -2
- package/driver/follow-up-twins.mjs +86 -0
- package/driver/gateway.mjs +77 -12
- package/driver/jx-units.mjs +3 -1
- package/driver/jx.mjs +13 -5
- package/driver/manuals-inline.mjs +98 -0
- package/driver/manuals-seen.mjs +134 -0
- package/driver/mark-logos.mjs +174 -0
- package/driver/methodology-witness.mjs +2 -1
- package/driver/owner-use-check.mjs +8 -4
- package/driver/package.json +1 -1
- package/driver/pipeline-knockout.mjs +23 -4
- package/driver/pipeline.mjs +128 -15
- package/driver/portal-local-auth.mjs +6 -2
- package/driver/portal-report.mjs +45 -14
- package/driver/portal-routes/me.mjs +4 -1
- package/driver/portal-runs.mjs +19 -16
- package/driver/predelivery-lint.mjs +7 -5
- package/driver/profiles.mjs +4 -4
- package/driver/publish/README.md +9 -7
- package/driver/publish/email-conditions.mjs +22 -5
- package/driver/publish/evidence-words.mjs +21 -0
- package/driver/publish/index.mjs +304 -211
- package/driver/publish/knockout.mjs +297 -247
- package/driver/publish/office-record-links.mjs +11 -9
- package/driver/publish/page-shell.mjs +98 -0
- package/driver/publish/pool-admin.mjs +2 -2
- package/driver/publish/publish-inputs.mjs +4 -0
- package/driver/publish/regions.mjs +28 -3
- package/driver/publish/register-record-html.mjs +105 -0
- package/driver/publish/register-record.mjs +165 -0
- package/driver/publish/render-knockout.mjs +299 -671
- package/driver/publish/render.mjs +561 -492
- package/driver/publish/report-data.mjs +226 -13
- package/driver/publish/report-document.mjs +353 -0
- package/driver/publish/search-depth.mjs +88 -7
- package/driver/publish/shell.mjs +41 -1
- package/driver/publish/strings.mjs +810 -0
- package/driver/publish/templates/clearance-print.css +23 -0
- package/driver/publish/templates/knockout.css +224 -0
- package/driver/publish/templates/report.css +112 -53
- package/driver/publish/xlsx.mjs +158 -139
- package/driver/record-goods.mjs +42 -0
- package/driver/reference-score.mjs +4 -1
- package/driver/register-count.mjs +5 -1
- package/driver/register-reach.mjs +39 -0
- package/driver/registry-fidelity.mjs +155 -37
- package/driver/repair-composers.mjs +7 -3
- package/driver/repair-targets.mjs +4 -1
- package/driver/replay-archive.mjs +4 -3
- package/driver/run-delivered.mjs +14 -8
- package/driver/run-record.mjs +1 -0
- package/driver/runner.mjs +73 -29
- package/driver/scope-facts.mjs +27 -6
- package/driver/search-policy.mjs +9 -4
- package/driver/skills/clearance-search/report-prose.md +3 -0
- package/driver/skills/knockout-assess/SKILL.md +8 -0
- package/driver/stage-freshness.mjs +8 -5
- package/driver/stages.mjs +69 -43
- package/driver/steps/delivery.mjs +9 -5
- package/driver/steps/overview-and-cards.mjs +54 -15
- package/driver/steps/register-sweep.mjs +5 -4
- package/driver/steps/skeptic-and-follow-up.mjs +3 -2
- package/driver/steps/verdict-gate.mjs +35 -14
- package/driver/suite-census.json +579 -87
- package/driver/synthesis-record.mjs +4 -3
- package/driver/terminal-clamp.mjs +6 -1
- package/driver/withdrawn-rating.mjs +72 -0
- package/mcp-server/CHANGELOG.md +8 -0
- package/mcp-server/lib/audit-view.mjs +5 -2
- package/mcp-server/lib/brief.mjs +6 -2
- package/mcp-server/lib/evidence.mjs +94 -23
- package/mcp-server/lib/findings.mjs +19 -2
- package/mcp-server/lib/knockout.mjs +13 -4
- package/mcp-server/lib/scrub.mjs +1 -1
- package/mcp-server/package.json +1 -1
- package/mcp-server/server.mjs +22 -3
- package/package.json +4 -1
- package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-BBlN4CYq.js} +238 -80
- package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
- package/portal-ui/dist/index.html +2 -2
- package/portal-ui/package.json +3 -3
- package/providers/_shared/ledger.mjs +30 -2
- package/providers/_shared/record-uri.mjs +15 -0
- package/providers/clarivate/src/adapter.js +11 -0
- package/providers/clarivate/src/core.js +17 -1
- package/providers/jx/src/core.js +4 -4
- package/providers/jx/src/judge.js +1 -3
- package/providers/jx/src/nativeread.js +1 -3
- package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/scripts/README.md +147 -3
- package/scripts/added-reference-check.mjs +35 -7
- package/scripts/e2e-first-time.mjs +4 -4
- package/scripts/env-audit.mjs +16 -9
- package/scripts/freeze-example-run.mjs +3 -3
- package/scripts/mint-public-residue.mjs +3 -3
- package/scripts/mint-search-level-tags.mjs +61 -0
- package/scripts/mint-source-pin-census.mjs +89 -0
- package/scripts/release-note-required.mjs +65 -6
- package/scripts/test-durations-reporter.mjs +25 -0
- package/scripts/test-full.mjs +72 -18
- package/scripts/test-run.mjs +18 -1
- package/shared/brand.mjs +93 -6
- package/shared/inline-markdown.mjs +53 -0
- package/shared/names-in-force.mjs +0 -1
- package/shared/portal-tokens.mjs +2 -1
- package/shared/reference-guard-classes.mjs +43 -2
- package/shared/register-selection.mjs +8 -3
- package/shared/search-level-tags.json +25 -0
- package/shared/source-spans.mjs +91 -0
- package/shared/tools/derive-band-pairs.mjs +10 -0
- package/driver/own-rights.mjs +0 -83
- package/driver/use-check.mjs +0 -85
package/driver/stages.mjs
CHANGED
|
@@ -309,6 +309,15 @@ export const providerMeta = (register) => PROVIDERS[register] ?? { // a run's
|
|
|
309
309
|
|
|
310
310
|
// ---- message builders (faithful to the spawn briefs in phase2-execution.md; the leaf reads the skill for detail) ----
|
|
311
311
|
export const lines = (...a) => a.filter(Boolean).join("\n");
|
|
312
|
+
// THE CASE'S OWN VALUES CLOSE THE MESSAGE (design, 2026-11-19: the heading and the instruction are word for word as approved).
|
|
313
|
+
// A stage whose sessions differ only by their paths and identifiers sends the shared instructions first, naming each input,
|
|
314
|
+
// and lists the values once, at the end, so sessions of one stage send the same leading text.
|
|
315
|
+
export const INPUTS_HEADING = "Inputs for this task";
|
|
316
|
+
export const USE_THE_INPUTS = "Use the inputs listed at the end of this message.";
|
|
317
|
+
export const inputsBlock = (rows) => lines(INPUTS_HEADING, ...rows.filter(([, v]) => v != null && v !== "").map(([k, v]) => `- ${k}: ${v}`));
|
|
318
|
+
/** A common-law half's inputs: its half, the two documents it reads, and the three files its tool and its findings use. */
|
|
319
|
+
const halfInputs = (P, half) => inputsBlock([["Assigned half", half], ["Variant manifest", P.variantManifest], ["Matter frame", P.matterContext],
|
|
320
|
+
["Grid specification (grid_spec_path)", P.gridSpecHalf(half)], ["Grid ledger", P.commonLawGridHalf(half)], ["Findings file", P.commonLawHalf(half)]]);
|
|
312
321
|
|
|
313
322
|
// ── — THE PROSE RUNG FOR SYNTHESIS ──────────────────────────────────────────────────────────
|
|
314
323
|
//
|
|
@@ -1879,18 +1888,19 @@ export const STAGES = {
|
|
|
1879
1888
|
// a floor teaches a model to fabricate rows to pass it.
|
|
1880
1889
|
if (half === MEANING_SEAT) return lines(
|
|
1881
1890
|
reads(["skills/clearance-common-law/SKILL.md"]),
|
|
1882
|
-
|
|
1891
|
+
USE_THE_INPUTS,
|
|
1883
1892
|
systemScope,
|
|
1884
1893
|
`You own this matter's MEANING SWEEP and nothing else. Two sibling members are running the marketplace grid concurrently and the driver merges all three in code — do NOT sweep marketplaces, do NOT judge listings, and do NOT widen beyond your dictated queries.`,
|
|
1885
|
-
`Run the sweep via the DETERMINISTIC grid: call perplexity_research with enable_sandbox:true and grid_spec_path
|
|
1886
|
-
`Do NOT author the grid program, do NOT save
|
|
1887
|
-
`If your spec's connotation carries "none_named": true, the matter frame named no meaning question for this mark, so there is nothing to search: do not call perplexity_research, and write
|
|
1894
|
+
`Run the sweep via the DETERMINISTIC grid: call perplexity_research with enable_sandbox:true and grid_spec_path set to your grid specification. Your spec carries the dictated meaning queries and NO term x platform cells. The tool runs exactly those queries and WRITES your grid ledger itself.`,
|
|
1895
|
+
`Do NOT author the grid program, do NOT save your grid ledger yourself, and do NOT re-emit the ledger JSON in your message.`,
|
|
1896
|
+
`If your spec's connotation carries "none_named": true, the matter frame named no meaning question for this mark, so there is nothing to search: do not call perplexity_research, and write your findings file with a "Findings" heading saying no meaning search ran because the matter frame named no meaning question, and an "Audit trail" section saying the same.`,
|
|
1888
1897
|
// The MEANING seat always owns meaning queries — that is what it is for — so the may-own-nothing
|
|
1889
1898
|
// sentence is FALSE here. It used to be served anyway, because the option was keyed on being a
|
|
1890
1899
|
// half rather than on the obligations.
|
|
1891
1900
|
meaningSweepReceiptsInstruction({ lead: "MEANING-SWEEP RECEIPTS — THIS IS THE WORK.", findingsTail: false }),
|
|
1892
|
-
`Then write
|
|
1901
|
+
`Then write your findings file: a short report of the sweep under a "Findings" heading — every LOADED reading as its own finding, with the receipt behind it — and an "Audit trail" section saying which queries ran and what each returned. The driver renders the disposition TABLE from your recorded rulings, so do not hand-write that table.`,
|
|
1893
1902
|
WEB_EVIDENCE_ONLY_THROUGH_RESEARCH,
|
|
1903
|
+
halfInputs(P, half),
|
|
1894
1904
|
writeReturn(P.commonLawHalf(half)),
|
|
1895
1905
|
);
|
|
1896
1906
|
// Instructed checks are receipts executed ONCE per run — half "a" is the designated owner (the
|
|
@@ -1903,13 +1913,12 @@ export const STAGES = {
|
|
|
1903
1913
|
) : "";
|
|
1904
1914
|
return lines(
|
|
1905
1915
|
reads(["skills/clearance-common-law/SKILL.md"]),
|
|
1906
|
-
|
|
1916
|
+
USE_THE_INPUTS,
|
|
1907
1917
|
systemScope,
|
|
1908
|
-
asksBlock,
|
|
1909
1918
|
`You are running ONE HALF of this matter's marketplace grid — a sibling member runs the other half concurrently, and the driver merges the two in code. Cover ONLY your half's dictated terms; never widen to terms outside your spec.`,
|
|
1910
|
-
`Run your half of the sweep via the DETERMINISTIC grid: call perplexity_research with enable_sandbox:true and grid_spec_path
|
|
1911
|
-
`Do NOT author the grid program, do NOT save
|
|
1912
|
-
`Judge each returned candidate into the fixed taxonomy and write your findings file
|
|
1919
|
+
`Run your half of the sweep via the DETERMINISTIC grid: call perplexity_research with enable_sandbox:true and grid_spec_path set to your grid specification. The tool runs EXACTLY your half's dictated term × platform grid and WRITES this half's complete grid ledger itself.`,
|
|
1920
|
+
`Do NOT author the grid program, do NOT save your grid ledger yourself, and do NOT re-emit the grid JSON in your message (re-emitting is exactly what truncated/dropped cells before). The tool returns only the candidate hits that need judgment.`,
|
|
1921
|
+
`Judge each returned candidate into the fixed taxonomy and write your findings file with its Findings, Negative-results matrix, Coverage ledger, and Audit trail sections. The driver validates grid completeness from the ledger the tool wrote — never from your prose.`,
|
|
1913
1922
|
// P2-C (Round-2 §8b leg 2) — the SAME dictate the single-member message carries, half-scoped
|
|
1914
1923
|
// (2026-07-31 review round): under the split THIS seat writes the PR section, so leaving the
|
|
1915
1924
|
// obligation to skill prose here is exactly the "prose-only contracts get skipped under output
|
|
@@ -1928,6 +1937,9 @@ export const STAGES = {
|
|
|
1928
1937
|
meaningSweepReceiptsInstruction({ mayOwnNoQueries: true }),
|
|
1929
1938
|
CROSS_CHECK_HANDOFF,
|
|
1930
1939
|
WEB_EVIDENCE_ONLY_THROUGH_RESEARCH,
|
|
1940
|
+
// Half a's instructed checks are this session's own, so they close the message with its inputs.
|
|
1941
|
+
asksBlock,
|
|
1942
|
+
halfInputs(P, half),
|
|
1931
1943
|
writeReturn(P.commonLawHalf(half)),
|
|
1932
1944
|
);
|
|
1933
1945
|
},
|
|
@@ -2048,7 +2060,7 @@ export const STAGES = {
|
|
|
2048
2060
|
// that does the excluding, and returns NULL — not an empty sentence — when the provider cannot be
|
|
2049
2061
|
// resolved, which is the path `--experiment` takes.
|
|
2050
2062
|
grantVocabularySentence(register),
|
|
2051
|
-
`You are register UNIT mode, axis
|
|
2063
|
+
`You are register UNIT mode, on the axis listed at the end of this message. Active register provider: ${providerMeta(register).label}.`
|
|
2052
2064
|
// A provider with no vocabulary doc is a provider this seat cannot be briefed on. Emitting the
|
|
2053
2065
|
// sentence with a null path in it would instruct the model to read a file that does not exist,
|
|
2054
2066
|
// which it resolves by carrying on unbriefed — indistinguishable from choosing not to read.
|
|
@@ -2061,17 +2073,14 @@ export const STAGES = {
|
|
|
2061
2073
|
// agreement it never obtained.
|
|
2062
2074
|
? ` Read and follow ${providerMeta(register).skillDoc} for THIS provider's exact tool names + operator vocabulary; use only that provider's register tools. There is exactly ONE register in this run — if its coverage does not reach a territory the matter needs, that is a DEFERRED coverage row you disclose, never a gap you fill from somewhere else.`
|
|
2063
2075
|
: " NO provider vocabulary doc is registered for it, so there is nothing to read for its tool names — treat that as a fault and say so rather than improvising an operator vocabulary."),
|
|
2064
|
-
|
|
2076
|
+
USE_THE_INPUTS,
|
|
2065
2077
|
planEntries.length
|
|
2066
2078
|
? lines(
|
|
2067
2079
|
// (2026-07-03, the senior lawyer): the TOOL executes the plan — the model never runs
|
|
2068
2080
|
// dictated entries by hand and never re-types results (the transcription defect class
|
|
2069
2081
|
// dies at the source, the deterministic-grid precedent). The entry list stays in the
|
|
2070
2082
|
// message for transparency and so judgment knows what is already covered.
|
|
2071
|
-
`EXECUTE THE FROZEN PLAN VIA THE TOOL: call register_execute_plan ONCE with
|
|
2072
|
-
`For your audit context, the dictated entries the tool will run:`,
|
|
2073
|
-
romanisedFiling && `This register files foreign marks by their romanised form, and says so: a question below in another script is searched by the romanised form shown on it.`,
|
|
2074
|
-
...planEntries.map((e) => `- qid "${e.qid}": ${e.predicate} ${e.terms ? `names ${JSON.stringify(e.terms)} (one OR-stacked call)` : JSON.stringify(e.term)}${romanisedNote(e)}${e.owner ? ` · owner ${JSON.stringify(e.owner)}` : ""} · nice_classes ${JSON.stringify(e.nice_classes)}${e.regions?.length ? ` · regions ${JSON.stringify(e.regions)}` : ""}${e.when ? (awaitsReadingTurn(e.when) ? ` · WAITING FOR YOU: after reading the identical mark's list, release it or withhold it, with your reason` : ` · when: "${e.when.runs_if_enumerated}" enumerated`) : ""} · expected: ${e.expected_kind}${Array.isArray(e.covered_by) && e.covered_by.length ? ` · crowd context — coverage is ${e.covered_by.join(", ")}` : ""}`),
|
|
2083
|
+
`EXECUTE THE FROZEN PLAN VIA THE TOOL: call register_execute_plan ONCE with the arguments listed at the end of this message; call it again only with the qids of waiting families you release. The tool runs every dictated entry listed there ITSELF (paged enumerates; count-only crowd descriptors; a "when"-guarded fringe only if its parent enumerated; a waiting family only once you release it) and WRITES the band file itself with each block's qid stamped. Do NOT run these dictated entries manually and do NOT write their blocks yourself.`,
|
|
2075
2084
|
// copper-lattice re-route (supplemental_lane contract): judgment additions stay the model's
|
|
2076
2085
|
// CALL — which queries the manifest/frame warrant beyond the dictated set — but their
|
|
2077
2086
|
// EXECUTION and their band blocks are code's (register_propose_supplemental mints qid'd
|
|
@@ -2096,19 +2105,17 @@ export const STAGES = {
|
|
|
2096
2105
|
// those owner queries effectively unscreened. Enforcement needs matching
|
|
2097
2106
|
// invitation control — whatever forbids the old path must also, in the same breath, name the new one.
|
|
2098
2107
|
supplementalLane
|
|
2099
|
-
? `JUDGMENT ADDITIONS${planEntries.length ? " beyond the dictated plan" : ""} are yours to PROPOSE — call register_propose_supplemental with
|
|
2100
|
-
: `JUDGMENT ADDITIONS${planEntries.length ? " beyond the dictated plan" : ""} are yours — run register_enumerate calls for everything the manifest/frame warrants${planEntries.length ? " beyond the dictated set" : " on this axis"} and APPEND each as a block WITHOUT a qid to
|
|
2108
|
+
? `JUDGMENT ADDITIONS${planEntries.length ? " beyond the dictated plan" : ""} are yours to PROPOSE — call register_propose_supplemental with your axis as "axis", your band file as "output_path", and "proposals": [{"predicate": "exact|default|wildcard|phonetic|owner", "term" OR "terms", "romanization" (MANDATORY beside a single non-Latin term — its plain-ASCII Latin form, space-separated syllables; a register that indexes filings by transliteration cannot answer bare characters), "nice_classes": […], "rationale": "why"} …] for everything the manifest/frame warrants${planEntries.length ? " beyond the dictated set" : " on this axis"}. Batch related proposals into one call; iterate freely — propose, read the returned counts/term_counts/record previews, propose narrower. The tool mints each proposal as a qid'd supplemental entry, executes it through the SAME deterministic executor as the dictated plan, and MERGES its block into the band ITSELF. ${SUPPLEMENTAL_LANE_STEERING} You NEVER write or edit band blocks yourself — a hand-authored band block fails the stage. Never edit or remove a qid-stamped block.`
|
|
2109
|
+
: `JUDGMENT ADDITIONS${planEntries.length ? " beyond the dictated plan" : ""} are yours — run register_enumerate calls for everything the manifest/frame warrants${planEntries.length ? " beyond the dictated set" : " on this axis"} and APPEND each as a block WITHOUT a qid to your band file (the tool's merge preserves them on any re-run). Never edit or remove a qid-stamped block. Every block you append MUST carry "state":"enumerated" (ONLY if you paged it to has_more:false) or "state":"incomplete" — EXACTLY those two strings; there is no "verified"/"checked"/"complete"/"clean" state, and any other value fails the stage.`,
|
|
2101
2110
|
// Owner-axis steering rides the lane only: off-lane the unit still has register_enumerate, so the
|
|
2102
2111
|
// proposal grammar this text is about does not apply to it.
|
|
2103
2112
|
supplementalLane ? OWNER_SWEEP_STEERING : "",
|
|
2104
|
-
planEntries.length ? "" : `This axis carries NO dictated plan entries: the whole axis is yours to cover by ${supplementalLane ? "proposal" : "enumeration"} per the manifest/frame. "No entries" means the plan had nothing to freeze here — it does NOT mean the axis is out of scope, and it is never a reason to leave it thin.`,
|
|
2105
2113
|
// Lever-1 (2026-06-24): EVERY register_enumerate MUST be class-scoped, or it returns an all-45-class crowd
|
|
2106
2114
|
// that floods the band and TIMES OUT the stage. Scoping by class = which Nice classes the matter instructed
|
|
2107
2115
|
// = BREADTH (region/variant/match-mode are the breadth dials); it is NOT sampling/sufficiency.
|
|
2108
2116
|
// ION/copper-foundry: these lines name the tool the unit is expected to class-scope, so they MUST
|
|
2109
2117
|
// follow the lane too — naming register_enumerate to a unit that cannot call it is what taught ION's
|
|
2110
2118
|
// incumbent-class pass that the tool was broken.
|
|
2111
|
-
inScopeClassLine(inScope, supplementalLane),
|
|
2112
2119
|
// CROWD BOUND: gate the dangerous-category substring enumeration on the class-scoped RESULT (tractable
|
|
2113
2120
|
// vs crowd), not the manifest label. A slice that returns a crowd is no longer terminal (ruled 2026-09-25):
|
|
2114
2121
|
// the listing ceiling is a call limit, never a decision point, and the unit decides on the crowd as on the
|
|
@@ -2116,7 +2123,7 @@ export const STAGES = {
|
|
|
2116
2123
|
// stripped common component (GREAT/OUTDOORS) write none — saturation-probe already counted it (immaterial).
|
|
2117
2124
|
// This removes the primary-sweep grind that double-SIGKILLed an all-common-words phrase run. Boundary held: the funnel
|
|
2118
2125
|
// counts + hands up; it never writes coverage-limited and never drives CONDITIONAL (judgment's call, Layer B).
|
|
2119
|
-
`CROWD BOUND (removal — prevents the primary-sweep timeout, spec-46): every dangerous-category substring slice (the dominant token / formative root as a contains predicate + its phonetic slice) is attempted ONCE class-scoped and gated on its RESULT, not on the manifest label. Returns enumerated (tractable — NOVA PULSE∩class≈257, the phrase "QUIET FIELD"≈99) → keep it, take its majors from it by jurisdictions, and run its phonetic pass. Returns incomplete because the slice is ITSELF a crowd over the ceiling (a hyper-common word — GREAT≈28k, OUTDOORS≈2.7k) → the ceiling is a call limit, never a decision point: decide on that crowd with the same steps (unit.md, \"Read the identical mark first\"), only as far as reading it would change what you tell the client; record what stays a crowd with its count. On a crowd slice, WHAT you write depends which slice it is: the DISTINCTIVE anchor / dominant category → write ONE incomplete block (a material could-not-finish for judgment); a stripped COMMON component (GREAT/OUTDOORS — NOT the anchor) → write NO block, the saturation-probe axis already counted it (immaterial dilution; a duplicate primary-sweep crowd risks mis-reading as a material in-class gap). For an all-common-words phrase mark ("The Quiet Field" — dominant unit = the phrase), the exact phrase + near-neighbours IS the dangerous band; the common-word components are dilution counts. The funnel counts + hands up; it never writes coverage-limited and never drives CONDITIONAL.`,
|
|
2126
|
+
`CROWD BOUND (removal — prevents the primary-sweep timeout, spec-46): every dangerous-category substring slice (the dominant token / formative root as a contains predicate + its phonetic slice) is attempted ONCE class-scoped and gated on its RESULT, not on the manifest label. Returns enumerated (tractable — NOVA PULSE∩class≈257, the phrase "QUIET FIELD"≈99) → keep it, take its majors from it by jurisdictions, and run its phonetic pass. Returns incomplete because the slice is ITSELF a crowd over the ceiling (a hyper-common word — GREAT≈28k, OUTDOORS≈2.7k) → the ceiling is a call limit, never a decision point: decide on that crowd with the same steps (unit.md, \"Read the identical mark first\"), only as far as reading it would change what you tell the client; record what stays a crowd with its count. On a crowd slice, WHAT you write depends which slice it is: the DISTINCTIVE anchor / dominant category → write ONE incomplete block (a material could-not-finish for judgment); a stripped COMMON component (GREAT/OUTDOORS — NOT the anchor) → write NO block, the saturation-probe axis already counted it (immaterial dilution; a duplicate primary-sweep crowd risks mis-reading as a material in-class gap). For an all-common-words phrase mark ("The Quiet Field" — dominant unit = the phrase), the exact phrase + near-neighbours IS the dangerous band; the common-word components are dilution counts. The funnel counts + hands up; it never writes coverage-limited and never drives CONDITIONAL.`,
|
|
2120
2127
|
// judgment-relocation (2026-06-23): the funnel ENUMERATES or reports HONEST INCOMPLETENESS — it decides
|
|
2121
2128
|
// NOTHING about relevance or sufficiency. For the DANGEROUS NAMED BAND (the exact mark + each manifest
|
|
2122
2129
|
// variant × in-scope class × material/major jurisdiction) you MUST use register_enumerate, which owns the
|
|
@@ -2131,8 +2138,8 @@ export const STAGES = {
|
|
|
2131
2138
|
// register_enumerate call" ordered precisely the thing the validator kills, using a tool it does not
|
|
2132
2139
|
// have. ION's incumbent-class band carries ten qid-less blocks written exactly that way.
|
|
2133
2140
|
supplementalLane
|
|
2134
|
-
? `BAND ARTIFACT:
|
|
2135
|
-
: `BAND ARTIFACT (MANDATORY): ALSO write the COMPLETE NAMED BAND for this axis to
|
|
2141
|
+
? `BAND ARTIFACT: your band file is written BY THE TOOLS — register_execute_plan for the dictated entries, register_propose_supplemental for your proposals — with every block qid-stamped. You NEVER author, edit or append a band block: a hand-written block fails the stage. Your job is to READ the band back and judge it by the steps in unit.md: read the identical mark first, narrow a crowd until it gives a list you can read, and decide as a lawyer would whether more searching would change what you tell the client. Every block the tools write is either {"state":"enumerated", …records} (paged to has_more:false) or {"state":"incomplete", total_hits, fetched, sample, reason} (a crowd over the ceiling / the provider window / a provider error). Never sample a slice yourself with register_search, and never record a sample as though it were a band. The band is the real material the lawyer reads: an unenumerable band is an HONEST "incomplete" descriptor, NEVER a clean negative.`
|
|
2142
|
+
: `BAND ARTIFACT (MANDATORY): ALSO write the COMPLETE NAMED BAND for this axis to your band file — a JSON ARRAY, one block per register_enumerate / count-probe call, in the named-band contract: {"state":"enumerated","query":"<what was searched>","total_hits":N,"records":[{record_id, mark_text, classes, status, owner_name, owner_country, application_date, registration_date, expiry_date, jurisdictions, screen_verdict}, …]} for a band you paged to has_more:false (carry EVERY enumerated record, with its screening facts — live AND recently-dead, with the status/lapse-date; status is surfaced, never date-cut), and {"state":"incomplete","query":"…","total_hits":N,"fetched":K,"sample":[…],"reason":"…"} for any band/crowd you could NOT enumerate to completion (genuinely too large, hit the provider window, a provider error). The band is the real material the lawyer reads — a missing/sampled enumerated record is a recall hole; an unenumerable band is an HONEST "incomplete" descriptor, NEVER a clean negative.`,
|
|
2136
2143
|
// judgment-relocation (2026-06-24): the funnel writes NO coverage ledger and NO clearance verdict — the
|
|
2137
2144
|
// band IS the coverage signal (Layer B reads it and authors the ledger). The .md is a SHORT prose audit
|
|
2138
2145
|
// note only (what you searched, counts) — it is gated for existence, but the BAND is the load-bearing
|
|
@@ -2145,7 +2152,23 @@ export const STAGES = {
|
|
|
2145
2152
|
// is the quiet one: the note says nine enumerated queries, the band holds eight, and nothing compares
|
|
2146
2153
|
// them. Deriving removes the disagreement rather than detecting it.
|
|
2147
2154
|
`FILE THIS AXIS'S AUDIT NOTE WITH \`record_unit_note\`. THE DISPATCH NAMES NO PATH FOR IT, deliberately — the driver writes this axis's note from what you send and you never open it, so there is no path here for you to hold. THE COUNTS ARE NOT YOURS TO TYPE: queries enumerated, incomplete blocks and records carried forward are taken from the band, so the note and the band cannot disagree. Send only what the band cannot say — \`null_result\` if this axis genuinely found nothing (refused against a band that carries records), and \`note\`, ONE short observation an auditor would want, in a lawyer's words. Still NO coverage-limited/confirmed-clean/deferred rows and NO clearance verdict: those are judgment's, Layer B. Call it AFTER the band exists (on a plan run with no entries for this axis, the driver has written it empty) — a note over a band that has not been written is refused by name, because an account of a sweep that has not happened is not a short note, it is a wrong one.`,
|
|
2148
|
-
CROSS_CHECK_HANDOFF,
|
|
2155
|
+
CROSS_CHECK_HANDOFF,
|
|
2156
|
+
// THIS AXIS'S OWN CONDITIONS AND VALUES CLOSE THE MESSAGE (design, 2026-11-19), so units of one run send the same
|
|
2157
|
+
// leading text: whether the plan dictates anything here, the classes, then the inputs and the dictated entries.
|
|
2158
|
+
planEntries.length ? "" : `This axis carries NO dictated plan entries: the whole axis is yours to cover by ${supplementalLane ? "proposal" : "enumeration"} per the manifest/frame. "No entries" means the plan had nothing to freeze here — it does NOT mean the axis is out of scope, and it is never a reason to leave it thin.`,
|
|
2159
|
+
narrowingOrderLine(job, profile, inScope),
|
|
2160
|
+
inScopeClassLine(inScope, supplementalLane),
|
|
2161
|
+
inputsBlock([["Assigned axis", axis], ["Register provider", providerMeta(register).label],
|
|
2162
|
+
["Variant manifest", P.variantManifest], ["Matter frame", P.matterContext],
|
|
2163
|
+
["Band file (output_path)", P.registerBand(axis)],
|
|
2164
|
+
...(planEntries.length ? [["register_execute_plan arguments", `{"plan_path": ${JSON.stringify(P.registerPlan)}, "axis": "${axis}", "output_path": ${JSON.stringify(P.registerBand(axis))}}`]] : [])]),
|
|
2165
|
+
planEntries.length ? lines(
|
|
2166
|
+
`For your audit context, the dictated entries the tool will run:`,
|
|
2167
|
+
romanisedFiling && `This register files foreign marks by their romanised form, and says so: a question below in another script is searched by the romanised form shown on it.`,
|
|
2168
|
+
...planEntries.map((e) => `- qid "${e.qid}": ${e.predicate} ${e.terms ? `names ${JSON.stringify(e.terms)} (one OR-stacked call)` : JSON.stringify(e.term)}${romanisedNote(e)}${e.owner ? ` · owner ${JSON.stringify(e.owner)}` : ""} · nice_classes ${JSON.stringify(e.nice_classes)}${e.regions?.length ? ` · regions ${JSON.stringify(e.regions)}` : ""}${e.when ? (awaitsReadingTurn(e.when) ? ` · WAITING FOR YOU: after reading the identical mark's list, release it or withhold it, with your reason` : ` · when: "${e.when.runs_if_enumerated}" enumerated`) : ""} · expected: ${e.expected_kind}${Array.isArray(e.covered_by) && e.covered_by.length ? ` · crowd context — coverage is ${e.covered_by.join(", ")}` : ""}`),
|
|
2169
|
+
) : "",
|
|
2170
|
+
// After the entries, so its "the plan above" names them: the waiting families are among them (withheld-families.mjs).
|
|
2171
|
+
DECIDE_WAITING_FAMILIES,
|
|
2149
2172
|
// THE CLOSING LINE SPLITS WITH THE LANE, because what the seat owes splits with it. Under the
|
|
2150
2173
|
// supplemental-lane contract the seat writes NOTHING — the band is the tools' and the note is the
|
|
2151
2174
|
// driver's — so the dispatch names no file and ends the way conversion 9's reviewer does. With the
|
|
@@ -2963,8 +2986,8 @@ export const STAGES = {
|
|
|
2963
2986
|
// twin of the use-negative the USE-CHECK forbids. The negative literal now states exactly what was
|
|
2964
2987
|
// consulted, the prompt forbids reading it as a portfolio negative, and the un-answerable case gets
|
|
2965
2988
|
// the instructed-check treatment: an open row naming the missing owner query for the escalation
|
|
2966
|
-
// lane / supplemental mint.
|
|
2967
|
-
// validator contract is unchanged.
|
|
2989
|
+
// lane / supplemental mint. The finding's `own_rights.source` carries it, and verify.mjs's
|
|
2990
|
+
// checkFindingsSibling asks only that it is not blank, so the validator contract is unchanged.
|
|
2968
2991
|
`OWN-RIGHTS (enforced): if ANY finding's clearance reasoning relies on the client's own house mark / franchise root ("the prefix is the client's own registered mark"), run ONE own-portfolio check over the run's FROZEN register material — band_lookup with owner:<the applicant/house-mark owner> (plus band_record for any registration you cite) — and record its result in that finding's own_rights.source: <record URI(s) | "no applicant-owned registrations in the searched register material"> citing the record URIs the lookup returned. KNOW WHAT THE NEGATIVE MEANS: the searched material covers only this matter's dispatched slices (its classes, its mark texts), so an empty owner lookup is NEVER evidence the client's registrations do not exist — a house mark's own registrations usually live in the client's home classes under mark text no slice here covers. NEVER write "no registrations found" or any other portfolio-wide register-negative, and never leave the reasoning leaning on the unverified reliance: write the honest scoped negative, let the finding stand or fall without the crutch, AND record the un-run owner query (owner + house root + its home classes/key jurisdictions) as an open Coverage/open-item row so the escalation lane can propose it through the supplemental mint — the same treatment every instructed check the frozen material cannot answer gets. The affiliate-exclusion mandate covers CONFLICTS only — it never suppresses this supporting-evidence check. ALSO populate that finding's own_rights field in findings.json: {"source": "<comma-separated record URIs | no applicant-owned registrations in the searched register material>"} — the structured field is the authoritative cite.`,
|
|
2969
2992
|
// CHANGE 5c (attribution source) — a named-entity attribution that is NOT itself a registry / common-law
|
|
2970
2993
|
// record fact needs a source or it does not ship. (BEST EFFORT: the doc-30 Fix B exact spec is not in the
|
|
@@ -3187,7 +3210,7 @@ export const STAGES = {
|
|
|
3187
3210
|
// author declares the kind from the legal read; code only partitions the closed enum — never a keyword
|
|
3188
3211
|
// grep over prose (the spec's named failure mode). The report's "Only you can close these" section is
|
|
3189
3212
|
// code-rendered FROM this register, so bucket prose and disposition can never drift apart.
|
|
3190
|
-
`ACTIONS REGISTER (MANDATORY top-level field of the findings record you send): emit "actions": [...] — ONE object per forward step your opinion names that a HUMAN must still take, each EXACTLY {"id","kind","text","ordinals"} plus an OPTIONAL "deadline" and an OPTIONAL "condition". RULE: if your narrative, your overall reasoning, or any finding names a forward legal step (consent, coexistence, territorial delimitation, narrowing the goods, changing the mark, responding to an examiner objection or opposition, clearing a senior right, a required in-jurisdiction counsel opinion), that step MUST exist here as a typed action whose kind matches your own words — a prose-only condition is a delivery defect the reviewer flags. id: 1-based unique integer. kind: EXACTLY one of — CONDITIONS (a forward legal act must happen before the client can rely on a clean result; any one of these makes the run deliver CONDITIONAL): consent / coexistence-agreement / territorial-delimitation / goods-amendment / mark-modification / senior-clearance / proceeding-response / counsel-opinion-required; ADVISORY (never gates a clean result): client-fact (a fact only the client holds — their own prior filing, intended markets; renders as a labelled open question) / commercial-decision (a risk-appetite call that is theirs) / monitoring / filing-routine (ordinary filing mechanics — the "nothing beyond ordinary filing" home). DECLARE the kind from your legal read of what must happen, never from how severe the band is — the kind, not the band, decides CLEAR vs CONDITIONAL. text: ONE client-plain sentence starting with a capital letter that a lay client can act on — it renders VERBATIM and WHOLE in the email's "subject to:" box and the report's action list, so nothing you write here is dropped and nothing is summarised for you. IT MUST FIT ONE LINE OF THE VERDICT STATEMENT: the delivered sentence every surface joins reads "<Tier> — conditional on: <this> (and N more)." and clips at ${STATEMENT_CLAUSE_MAX} characters with an ellipsis, so an ask longer than that ends "…" on the index, the run status, the report hero, the email headline and the workbook. A delivered report carried asks of 350-600 characters. THE ASK IS THE STEP, NOT THE ARGUMENT FOR IT: the reasoning belongs in the finding this action closes (its "ordinals"), where a reader who wants it will look. If the step will not fit in one short sentence, it is not yet clear enough to ask for. LAWYER ENGLISH, NEVER ENGINE ENGLISH (§L): write what a lawyer would actually say to a client — "Investigate whether <owner> is using the mark in <market>", never "Test for non-use". An ask may NEVER name one of this system's own mechanisms as the step: no "rerun the watchlist owner-by-owner screen", no "close the script gaps by the transliteration index route", no "read the N unread registry documents". What the run read, and what it set aside with its count and reason, is the ENGINE's record — printing it as something the reader must do is a defect, not an action. Test each one: if it does not read as a sentence a lawyer would say aloud to a client, it is not an action — it is either work this run owed, or it is nothing. condition (OPTIONAL, CONDITION kinds only): the SAME demand restated as the factual open-state it closes — a FACT, never an instruction, and a fact THIS RUN ESTABLISHED (§L — never assume the client's own file): "No consent from <owner> appears on the record searched", "The examiner's objection is unanswered". Do NOT write "consent is not in hand" or "no coexistence agreement is in place": the client may hold one and no search this run ran could see it — say what the record shows, scoped to the record. The delivered verdict statement's "conditional on:" lede prefers this field over the imperative text, so type it whenever the fact reads better than the ask. ordinals: the findings[] ordinals this action closes ([] for a run-level action). deadline: {"kind","date"} (ISO date) whenever the action has a hard date — an opposition window, a statement-of-use date; a recorded register deadline that demands action must ride here, never only in prose. A clean run with nothing beyond ordinary filing legitimately emits "actions": [] — never invent an action, and never leave a named one out.`,
|
|
3213
|
+
`ACTIONS REGISTER (MANDATORY top-level field of the findings record you send): emit "actions": [...] — ONE object per forward step your opinion names that a HUMAN must still take, each EXACTLY {"id","kind","text","ordinals"} plus an OPTIONAL "deadline" and an OPTIONAL "condition". RULE: if your narrative, your overall reasoning, or any finding names a forward legal step (consent, coexistence, territorial delimitation, narrowing the goods, changing the mark, responding to an examiner objection or opposition, clearing a senior right, a required in-jurisdiction counsel opinion), that step MUST exist here as a typed action whose kind matches your own words — a prose-only condition is a delivery defect the reviewer flags. id: 1-based unique integer. kind: EXACTLY one of — CONDITIONS (a forward legal act must happen before the client can rely on a clean result; any one of these makes the run deliver CONDITIONAL): consent / coexistence-agreement / territorial-delimitation / goods-amendment / mark-modification / senior-clearance / proceeding-response / counsel-opinion-required; ADVISORY (never gates a clean result): client-fact (a fact only the client holds — their own prior filing, intended markets; renders as a labelled open question) / commercial-decision (a risk-appetite call that is theirs) / monitoring / filing-routine (ordinary filing mechanics — the "nothing beyond ordinary filing" home). DECLARE the kind from your legal read of what must happen, never from how severe the band is — the kind, not the band, decides CLEAR vs CONDITIONAL. text: ONE client-plain sentence starting with a capital letter that a lay client can act on — it renders VERBATIM and WHOLE in the email's "subject to:" box and the report's action list, so nothing you write here is dropped and nothing is summarised for you. IT MUST FIT ONE LINE OF THE VERDICT STATEMENT: the delivered sentence every surface joins reads "<Tier> — conditional on: <this> (and N more)." and clips at ${STATEMENT_CLAUSE_MAX} characters with an ellipsis, so an ask longer than that ends "…" on the index, the run status, the report hero, the email headline and the workbook. A delivered report carried asks of 350-600 characters. THE ASK IS THE STEP, NOT THE ARGUMENT FOR IT: the reasoning belongs in the finding this action closes (its "ordinals"), where a reader who wants it will look. If the step will not fit in one short sentence, it is not yet clear enough to ask for. LAWYER ENGLISH, NEVER ENGINE ENGLISH (§L): write what a lawyer would actually say to a client — "Investigate whether <owner> is using the mark in <market>", never "Test for non-use". An ask may NEVER name one of this system's own mechanisms as the step: no "rerun the watchlist owner-by-owner screen", no "close the script gaps by the transliteration index route", no "read the N unread registry documents". What the run read, and what it set aside with its count and reason, is the ENGINE's record — printing it as something the reader must do is a defect, not an action. Test each one: if it does not read as a sentence a lawyer would say aloud to a client, it is not an action — it is either work this run owed, or it is nothing. condition (OPTIONAL, CONDITION kinds only): the SAME demand restated as the factual open-state it closes — a FACT, never an instruction, and a fact THIS RUN ESTABLISHED (§L — never assume the client's own file): "No consent from <owner> appears on the record searched", "The examiner's objection is unanswered". Do NOT write "consent is not in hand" or "no coexistence agreement is in place": the client may hold one and no search this run ran could see it — say what the record shows, scoped to the record. The delivered verdict statement's "conditional on:" lede prefers this field over the imperative text, so type it whenever the fact reads better than the ask. ordinals: the findings[] ordinals this action closes ([] for a run-level action). deadline: {"kind","date"} (ISO date) whenever the action has a hard date — an opposition window, a statement-of-use date; a recorded register deadline that demands action must ride here, never only in prose. A clean run with nothing beyond ordinary filing legitimately emits "actions": [] — never invent an action, and never leave a named one out. An action naming a conflict party must have a basis in the surviving assessment, with that party introduced in a delivered finding or through the existing open identification route for an otherwise eligible unidentified-proprietor lead. Do not introduce a party only in the action, retain a demand whose basis you rejected, or create a finding solely to satisfy the reference check.`,
|
|
3191
3214
|
`COVERAGE JUDGMENT (MANDATORY top-level field of the findings record you send): emit "coverage_judgment": {"sufficient":<bool>, "reason":"<one line: what you have seen of the dangerous category and why it is / is not enough to sign>"} — EXACTLY those two keys. Do NOT emit "rows": the driver writes that register itself, one row per open slice, from the coverage ledger and the plan-execution receipt you were handed above; anything you type there is replaced wholesale. Retyping a slice identifier is how a slice comes to be named two ways that nothing makes agree — the machine writes the row, you rule on it. Decide it on the RISK PICTURE, never a count. Its ONLY effect: sufficient:false clamps the verdict CLEAR→CONDITIONAL (the report still ships, carrying your reason). Do NOT emit commands[] or halt — there is no re-enumeration loop and no human-halt; you deliver a conditional instead:`,
|
|
3192
3215
|
`- An `+"`incomplete`"+` crowd that is IMMATERIAL to the dangerous category (off-field noise, a saturated everyday-word substring pile that is not the named band) → sufficient:true. That is you, the lawyer, deciding it is enough; the run delivers clean (subject to the findings). A crowd-gated SKIPPED fringe is not itself a coverage hole, and a crowd descriptor is risk-REDUCING dilution evidence for your per-mark reasoning (cap-as-ceiling, synthesis-rules §Crowded field analysis) — only a MATERIAL uncleared slice (exact/near-identical named variant × in-scope class) drives sufficient:false, with the per-mark reason named. The descriptor's existence alone NEVER makes the verdict conditional.`,
|
|
3193
3216
|
`- An `+"`incomplete`"+` band that IS material (the exact mark / a near-identical named variant in an in-scope class was NOT enumerated to has_more:false) → sufficient:false, with a reason that NAMES the un-cleared slice specifically ("the exact-NOVA PULSE × cl.9 live slice returned ~N,NNN hits and could not be fully enumerated"). The run ships CONDITIONAL and names the un-cleared dangerous slice in the RISK READ as a substantive verdict input — analysis: you, the lawyer, stating what you could not fully clear and why it bears on the answer — NOT as a "[Gap] we should close" caveat in # Actions (doc-35: the report states its reasoned view, it does not narrate an unfinished search as a client to-do). Be specific — name the slice, not "coverage limited".`,
|
|
@@ -3785,22 +3808,9 @@ export const STAGES = {
|
|
|
3785
3808
|
// misread away from writing another finding's card. It also gives the harness a stable handle:
|
|
3786
3809
|
// the knob that fails ONE card used to key on `report-cards/2.md`, a path this dispatch no longer
|
|
3787
3810
|
// names at all.
|
|
3788
|
-
`THIS TURN IS BOUND TO CARD ${axis}. Send \`ordinal\`: "${axis}" — the tool refuses a payload naming any other card, and you hold no other finding's record.`,
|
|
3789
3811
|
`Send \`full_detail\` — one entry per item, each \`{text, lead, internal}\`. \`text\` is your sentence; \`lead\` is a one-word lead-in ("Portfolio", "Risk assessment", "Enforcement") sent as the word ALONE — the driver renders the bold and the full stop. §L: the entry carrying the risk read is led "Risk assessment", NEVER "Legal lever", which reads as leverage the client can pull rather than the assessment it is. THAT ENTRY IS REQUIRED, and the tool refuses the card without it (reportcard_read_lead_missing): the report suppresses the record's own legal and practical reads wherever this bullet is present, so a card that omits it — or marks it internal — reaches the client with no risk read at all, and nothing downstream recovers it. NO "Filing" BULLET (ruled): the driver already renders every registration from the FETCHED record — number, classes, status, filing and registration years, jurisdiction, designations, priority — so a typed filing bullet is that same fact retyped by a seat nothing can transposition-check. State a filing fact only where it carries the read you are making. Every other lead is optional. Mark an internal-only note with \`internal: true\`; do not type a \`::p::\` marker — the driver places it where the render splits.`,
|
|
3790
|
-
// T7 (E5) — the MATCHED grounded profile arrives INLINE (deterministic join), replacing
|
|
3791
|
-
// the old "if the file exists, fish in it" discretion that missed cards on copper-spire.
|
|
3792
|
-
caseLawProfile ? lines(
|
|
3793
|
-
`GROUNDED CASE-LAW for THIS finding (deterministically matched — weave its bearing into the card; quote a fetched citation where it grounds the enforcer/confusability read; never cite a proceeding it does not carry${caseLawProfile.none ? "; it records an explicit NO-ON-POINT-PRECEDENT result — that honest negative may be stated" : ""}):`,
|
|
3794
|
-
"```markdown",
|
|
3795
|
-
String(caseLawProfile.body ?? "").slice(0, 4000),
|
|
3796
|
-
"```",
|
|
3797
|
-
) : "",
|
|
3798
|
-
`The finding's OWN record — the ONLY source for this card (owner, mark, registrations, meters with their basis, band, disposition, source link):`,
|
|
3799
|
-
"```json",
|
|
3800
|
-
JSON.stringify(finding ?? {}, null, 2),
|
|
3801
|
-
"```",
|
|
3802
3812
|
// TRANSFORM, NOT FREE-GENERATION (Fix B1 — main's claims-must-not-outrun-evidence discipline, applied per card).
|
|
3803
|
-
`TRANSFORM, NOT FREE-GENERATION: RESHAPE this record into the card — do not re-derive or re-judge. Use ONLY the fields
|
|
3813
|
+
`TRANSFORM, NOT FREE-GENERATION: RESHAPE this record into the card — do not re-derive or re-judge. Use ONLY the fields below; NEVER re-compute the band (synthesis fixed it). Carry each claim's BASIS: a meter/owner fact whose basis is "verified-from-record" stays stated as fact; one whose basis is "inferred-from-signal" reads AS an inference ("on the available signals…"), never flattened into bald fact. The enforcer / "litigious" label especially — established only when a filing backs it (verified-from-record); otherwise present it as the inference it is.`,
|
|
3804
3814
|
// T6 (H6/I8): the "- label:" risk-expression line is RETIRED — the RENDER builds the risk
|
|
3805
3815
|
// chip from the record's typed band (the framework in force's own word, on every surface), so a
|
|
3806
3816
|
// re-invented label can no longer disagree with the finding it describes and no code tag is
|
|
@@ -3816,7 +3826,7 @@ export const STAGES = {
|
|
|
3816
3826
|
//
|
|
3817
3827
|
// A card that still ARRIVES with a head renders the old way, so archived runs and a drifted seat
|
|
3818
3828
|
// are byte-identical rather than gaining a second head. See carriesOwnFrame().
|
|
3819
|
-
`WRITE THE CARD'S DETAIL ONLY — NO HEAD, NO META LINES. Your output STARTS at "### Full detail" and contains nothing above it: no "## …" heading, and none of "- ord:", "- group:", "- source:", "- net:", "- one:", "- label:", "- open:". Every one of those is composed by the driver from the record
|
|
3829
|
+
`WRITE THE CARD'S DETAIL ONLY — NO HEAD, NO META LINES. Your output STARTS at "### Full detail" and contains nothing above it: no "## …" heading, and none of "- ord:", "- group:", "- source:", "- net:", "- one:", "- label:", "- open:". Every one of those is composed by the driver from the record below, where they are already typed — a line you write there is discarded, not read.`,
|
|
3820
3830
|
`Emit NO "### The read" narrative — RETIRED. It was a THIRD condensation of the same finding, beside this card's own one-liner and the typed net. The legal read and the enforcement read are already TYPED on the record (legal_position / practical_position) and render from there; the finding sentence is the typed net. Your whole output is the \`full_detail\` entries — filing, portfolio, the risk assessment, enforcement — and the driver builds the section around them.`,
|
|
3821
3831
|
// The SOURCE bullet is gone from the ask entirely. It was the transcription class in its purest
|
|
3822
3832
|
// form: a seat composing a URL from a host table it is not even given (providers/<name>.md is NOT
|
|
@@ -3837,7 +3847,7 @@ export const STAGES = {
|
|
|
3837
3847
|
// so the prompt no longer asks for it (it would double-render).
|
|
3838
3848
|
// T6 (J9) — the delivery lint's constraints, stated at DRAFT time so the first generation
|
|
3839
3849
|
// passes (the lint-repair redo was a deterministic ~2-generation tax on 83% of runs).
|
|
3840
|
-
`LINT CONTRACTS (the delivery lint fails a card that breaks these — state them right the first time): state an owner's registration COUNT at most once, and only as the number of registrations in the record
|
|
3850
|
+
`LINT CONTRACTS (the delivery lint fails a card that breaks these — state them right the first time): state an owner's registration COUNT at most once, and only as the number of registrations in the record below (unsure ⇒ name the owner without a count). NEVER pair a WIPO/Madrid/international registration with "worldwide"/"global" reach language — name the designated countries or omit the reach claim.`,
|
|
3841
3851
|
// P6 — the house prose contract. This card is the surface where "each fact once, at its rank"
|
|
3842
3852
|
// actually bites: the delivered report told WAVO PUNCH in six sections, and 43% of it was
|
|
3843
3853
|
// on-field conflict prose. delivery-contract.md (this stage's skill read) carries the same rules.
|
|
@@ -3846,6 +3856,22 @@ export const STAGES = {
|
|
|
3846
3856
|
profile?.riskAppetite ? `CUSTOMER RISK POSTURE (emphasis only — never moves the band, already set): ${profile.riskAppetite}` : "",
|
|
3847
3857
|
profile?.delivery?.style ? `PROSE STYLE (presentation tone only — register/phrasing; NEVER a risk word or a band): ${profile.delivery.style}` : "",
|
|
3848
3858
|
`Do NOT write or edit any file. There is no path for you to write to: the driver renders the card from your values and assembles the report around it, and nothing you hand-write is read.`,
|
|
3859
|
+
// THIS CARD'S OWN MATERIAL COMES LAST, before the output instruction: the manuals lead, the instructions every card
|
|
3860
|
+
// shares follow, and what is only this card's (its ordinal, its case law, its record) closes the message, so two cards
|
|
3861
|
+
// of a run send the same leading text (design, 2026-11-19).
|
|
3862
|
+
`THIS TURN IS BOUND TO CARD ${axis}. Send \`ordinal\`: "${axis}" — the tool refuses a payload naming any other card, and you hold no other finding's record.`,
|
|
3863
|
+
// T7 (E5) — the MATCHED grounded profile arrives INLINE (deterministic join), replacing
|
|
3864
|
+
// the old "if the file exists, fish in it" discretion that missed cards on copper-spire.
|
|
3865
|
+
caseLawProfile ? lines(
|
|
3866
|
+
`GROUNDED CASE-LAW for THIS finding (deterministically matched — weave its bearing into the card; quote a fetched citation where it grounds the enforcer/confusability read; never cite a proceeding it does not carry${caseLawProfile.none ? "; it records an explicit NO-ON-POINT-PRECEDENT result — that honest negative may be stated" : ""}):`,
|
|
3867
|
+
"```markdown",
|
|
3868
|
+
String(caseLawProfile.body ?? "").slice(0, 4000),
|
|
3869
|
+
"```",
|
|
3870
|
+
) : "",
|
|
3871
|
+
`The finding's OWN record — the ONLY source for this card (owner, mark, registrations, meters with their basis, band, disposition, source link):`,
|
|
3872
|
+
"```json",
|
|
3873
|
+
JSON.stringify(finding ?? {}, null, 2),
|
|
3874
|
+
"```",
|
|
3849
3875
|
`When the tool accepts your call, return ONLY a 2-3 line summary of the card.`,
|
|
3850
3876
|
),
|
|
3851
3877
|
},
|
|
@@ -42,6 +42,8 @@ import { clauseForDefect } from "../terminal-clamp.mjs";
|
|
|
42
42
|
import { VERDICT_RANK, findReviewerCoherenceFlags, lateReviewAgainst, parseVerdict } from "../verify.mjs";
|
|
43
43
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
44
44
|
import { basename, join } from "node:path";
|
|
45
|
+
import { followUpKindsOf } from "../follow-up-twins.mjs"; // the search each deferred directive recorded
|
|
46
|
+
import { stopsWithTheRun } from "../cancel.mjs"; // every paid call the code makes itself reads the stop first
|
|
45
47
|
|
|
46
48
|
export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontMatter, applyScopeFrontMatter, applyVerdictFrontMatter, assembledOrdinals, byRight, cardOrdinals, checkLateBind, clampOnTheFloorDuty, clampOnTheWritersDuty, ctx, deliverAndClamp, findingsForCards, followTheRecordsActions, groupedMembers, job, opts, overviewOpen, publishAndDeliver, rebuildTheDeliveredRecord, restoreTheBrokenRecord, reviewOpen, rov, run, runState, saveTheLabel, saveTheOwedLabel, synthesisKey, synthesisModel, synthesisThinking, writeScopeFacts, writeUps, writeVerdictSidecar }, helpers) {
|
|
47
49
|
const { CITED_URI_RE, NO_CHANGE, REBUILDS_THE_DELIVERED_RECORD, StageFailure, UPSTREAM_STALE_REPAIR, assembleReportMd, cardsNeverBuilt, caseLawJoin, computeOpenFloors, defaultRecordFetcher, fullProseOrdinals, inScopeClassList, injectFrontMatter, keepRankingReadByWriter, lateRecordIds, loadCoverageLedger, owedCardOrdinals, ownerScreenForDelivery, partitionDeliveryStale, postRepairScope, queuedForTheRecordOnly, rankingReadByWriterPath, readFindingsForReport, readFloorAxes, readGoodsHanded, reassembleFromTheRecord, recordChangeOwesReview, recordGoodsHanded, relabelCoverageRows, retainStateBeforeReview, runPostRepairCorrection, runPostRepairReview, runWholeReviewForRecord, safeReadJson, settleDerivedBases, stage, stageCharter, stagesStaleOnPlacement, unreadRecordFindingOnly, unreadRecordReview, whatTheRepairLeftStale } = helpers;
|
|
@@ -107,7 +109,7 @@ export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontM
|
|
|
107
109
|
const missing = [...cited].filter((u) => !assembled.records.has(u)).sort();
|
|
108
110
|
if (missing.length) {
|
|
109
111
|
note(`registry-record closure: ${missing.length} cited record(s) absent from the run's set — targeted fetch`);
|
|
110
|
-
const fetcher = opts.recordFetcher ?? defaultRecordFetcher;
|
|
112
|
+
const fetcher = stopsWithTheRun(run.runDir, "record-closure-fetch", opts.recordFetcher ?? defaultRecordFetcher);
|
|
111
113
|
for (const uri of missing) {
|
|
112
114
|
const r = await fetcher(uri, { agentId: "clearotron-driver", sessionKey: `${lintPrefix}record-closure`, recordLog: runRecordLogPath(run.runDir) });
|
|
113
115
|
if (!r.ok) recordFetchFailures.set(uri, r.cause);
|
|
@@ -191,6 +193,8 @@ export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontM
|
|
|
191
193
|
// is presence-gated and simply emits nothing here; they stay alive for replay-archive.mjs,
|
|
192
194
|
// which passes the archived summary.
|
|
193
195
|
reportMd, narrativeMd, auditMd, recordsByUri: assembled.records, searchedNames,
|
|
196
|
+
// The search each deferred directive recorded, so the lint reads Left open as the page draws it.
|
|
197
|
+
followUpKinds: followUpKindsOf(run.runDir),
|
|
194
198
|
// What each record's goods rested on when the writer wrote, and the records whose whole text a delivery repair
|
|
195
199
|
// was already handed: a finding written on goods the register cut, whose whole body the run holds now. The
|
|
196
200
|
// evidence is the copy kept when the writer was dispatched cold, which no later band merge rewrites; a run that
|
|
@@ -198,7 +202,7 @@ export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontM
|
|
|
198
202
|
goodsEvidence: readGoodsEvidenceAsWritten(run.runDir) ?? readGoodsEvidence(run.runDir), goodsHanded: readGoodsHanded(run.runDir),
|
|
199
203
|
// The overview as its writer wrote it, read for a citation of a finding the report does not carry; and the
|
|
200
204
|
// conditions the email carries, as the email composes them.
|
|
201
|
-
overviewMd: (() => { try { return readFileSync(P.reportOverview, "utf8"); } catch { return null; } })(), emailConditions: emailConditionsOfReport(reportMd, lintVerdict?.verdict),
|
|
205
|
+
overviewMd: (() => { try { return readFileSync(P.reportOverview, "utf8"); } catch { return null; } })(), emailConditions: emailConditionsOfReport(reportMd, lintVerdict?.verdict, { assessmentNotCompleted: readPartNotCompleted(run.runDir, "assessment") != null }),
|
|
202
206
|
fetchFailures: recordFetchFailures, findings: lintFindings, narrativeFindings: lintNarrativeFindings, findingsRaw: lintFindingsRaw, actionsRegister: lintActions, verdictDoc: lintVerdict,
|
|
203
207
|
// WP-56 B2 — fresh v4 runs expect the standing mark-assessment (structural banner flag when
|
|
204
208
|
// absent). The replay harness's runLint call never passes this, so archived runs never flip.
|
|
@@ -581,7 +585,7 @@ export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontM
|
|
|
581
585
|
let caseLawNow = new Map();
|
|
582
586
|
try {
|
|
583
587
|
if (existsSync(P.caseLaw)) caseLawNow = caseLawJoin(P, findingsNow);
|
|
584
|
-
} catch { /* no case-law layer */ }
|
|
588
|
+
} catch { /* no case-law layer, or a join that failed, which caseLawJoin has recorded */ }
|
|
585
589
|
let reassemble = false;
|
|
586
590
|
// THE LATE VERDICT, ONE RULE FOR BOTH REVIEWS THIS LOOP CAN RUN — the whole review and the review after
|
|
587
591
|
// a delivery-check repair. A late review may only harden the run's verdict, and a softer one is logged,
|
|
@@ -743,7 +747,7 @@ export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontM
|
|
|
743
747
|
ordinalsNow = fullProseOrdinals(findingsNow);
|
|
744
748
|
try {
|
|
745
749
|
if (existsSync(P.caseLaw)) caseLawNow = caseLawJoin(P, findingsNow);
|
|
746
|
-
} catch { /* no case-law layer */ }
|
|
750
|
+
} catch { /* no case-law layer, or a join that failed, which caseLawJoin has recorded */ }
|
|
747
751
|
// After a correction, and after a rollback that rebuilt the record from a save, what reads the record is
|
|
748
752
|
// rebuilt from it; a rollback that put the same bytes back leaves nothing stale, and queues nothing.
|
|
749
753
|
if (pass.ok || pass.rollback) {
|
|
@@ -816,7 +820,7 @@ export async function runDelivery({ P, applyCoverageFloor, applyRatedUnderFrontM
|
|
|
816
820
|
ordinalsNow = fullProseOrdinals(findingsNow);
|
|
817
821
|
try {
|
|
818
822
|
if (existsSync(P.caseLaw)) caseLawNow = caseLawJoin(P, findingsNow);
|
|
819
|
-
} catch { /* no case-law layer */ }
|
|
823
|
+
} catch { /* no case-law layer, or a join that failed, which caseLawJoin has recorded */ }
|
|
820
824
|
for (const owed of cardsNeverBuilt(P, ctx.depth, cardOrdinals)) if (!runState.staleStages.some((x) => x.label === owed.label)) runState.staleStages.push(owed);
|
|
821
825
|
// — AND THE REVIEW IS ALSO SOMETHING THIS PASS JUST WROTE.
|
|
822
826
|
//
|
|
@@ -10,6 +10,7 @@ import { ensureDriverDir } from "../../shared/driver-dir.mjs";
|
|
|
10
10
|
import { applyAskClosure, deriveAsks, finalizeOpenHandoffs, summarizeAsks } from "../ask-ledger.mjs";
|
|
11
11
|
import { mintCommonLawCarryDoubts } from "../commonlaw-carry.mjs";
|
|
12
12
|
import { readDeclinations } from "../declination-tool.mjs";
|
|
13
|
+
import { injectWithdrawnRatingCoverage } from "../withdrawn-rating.mjs";
|
|
13
14
|
import { CLOSURE_EVIDENCE_FILES } from "../doubt-closure-call.mjs";
|
|
14
15
|
import { readAcceptedClosures } from "../doubt-closure-tool.mjs";
|
|
15
16
|
import { applyClosure, mintContradictionDoubts, mintCrossCheckDoubts, stitchDoubts } from "../doubt-ledger.mjs";
|
|
@@ -40,7 +41,7 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from
|
|
|
40
41
|
import { basename, join } from "node:path";
|
|
41
42
|
|
|
42
43
|
export async function runOverviewAndCards({ P, applyCoverageFloor, clampOnTheWritersDuty, ctx, followTheRecordsActions, job, run, runState, saveTheLabel, writeVerdictSidecar }, helpers) {
|
|
43
|
-
const { StageFailure, applyScopeFrontMatterOf, asPartNotCompleted, assembleReportMd, caseLawJoin, consolidateFindingsFile, correctionsTheRestoreLacks, deriveCommonLawCarry, deriveRecordCarry, inScopeClassList, injectDeferralCoverage, injectFrontMatter, injectLaneDepthCoverage, injectMeaningGapCoverage, injectScreenGateCoverage, injectScriptScopeCoverage, keepDeliveredRecordAsHistory, localLanguageStateOf, must, openAskForClosure, originRowsForReport, planWriteUps, readFindingsForReport, readReadingLog, rebuildDeliveredRecord, reportIdentityRecord, restoreTheRecordThatPassed, rewriteFromBeforeTheSeam,
|
|
44
|
+
const { StageFailure, applyScopeFrontMatterOf, asPartNotCompleted, assembleReportMd, caseLawJoin, consolidateFindingsFile, correctionsTheRestoreLacks, deriveCommonLawCarry, deriveRecordCarry, inScopeClassList, injectDeferralCoverage, injectFrontMatter, injectLaneDepthCoverage, injectMeaningGapCoverage, injectScreenGateCoverage, injectScriptScopeCoverage, injectUncoveredMarketCoverage, keepDeliveredRecordAsHistory, localLanguageStateOf, must, openAskForClosure, originRowsForReport, planWriteUps, readFindingsForReport, readReadingLog, rebuildDeliveredRecord, reportIdentityRecord, restoreTheRecordThatPassed, rewriteFromBeforeTheSeam, safeReadJson, settleDerivedBases, stage, stampCoverageJudgmentRows, withdrawSupersededAudit, writeScopeFactsOf, writeShortEntries } = helpers;
|
|
44
45
|
// Phase 3 — delivery (v14 post-mortem fix). One LLM step curates the report; the audit, the page render,
|
|
45
46
|
// and the email body are deterministic CODE; a tiny LLM step only SENDS. Each step is independent — a
|
|
46
47
|
// failure in the audit or the email never loses the report.
|
|
@@ -93,6 +94,11 @@ export async function runOverviewAndCards({ P, applyCoverageFloor, clampOnTheWri
|
|
|
93
94
|
// mark+uri). The CONDITIONAL clamp came from applyCoverageFloor's screenGateGap arm above, never
|
|
94
95
|
// from these coverage-limited rows.
|
|
95
96
|
injectScreenGateCoverage(P, run.runDir, note, ctx);
|
|
97
|
+
// The fifth: every market the register service does not reach gets a "Not searched" row, written by code
|
|
98
|
+
// (register-reach.mjs); the coverage line names the same markets.
|
|
99
|
+
injectUncoveredMarketCoverage(P, run.runDir, note, ctx);
|
|
100
|
+
// The sixth: each right that stands with its rating withdrawn is listed as left open, with its ground's approved sentence.
|
|
101
|
+
injectWithdrawnRatingCoverage(P, run.runDir, note);
|
|
96
102
|
// — the fourth sibling, and the one that REPLACES rather than adds: coverage_judgment.rows
|
|
97
103
|
// is derived from the machine ledger and the plan-execution receipt instead of retyped by the seat.
|
|
98
104
|
// Same seam and same reason as injectDeferralCoverage above — every synthesis re-run has settled, so
|
|
@@ -167,8 +173,30 @@ export async function runOverviewAndCards({ P, applyCoverageFloor, clampOnTheWri
|
|
|
167
173
|
reportIdentityRecord(job, ctx, run.runDir, runState.displayVerdict)));
|
|
168
174
|
runLog(run.runDir, { event: "overview-not-completed-delivery", stage: overviewOpen.stage ?? null });
|
|
169
175
|
}
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
// ── THE OVERVIEW AND THE CARDS RUN TOGETHER, UNDER ONE CAP ──────────────────────────────────────
|
|
177
|
+
//
|
|
178
|
+
// The cards waited for the overview to finish, and neither reads the other's output: the overview reads the
|
|
179
|
+
// narrative and the findings and writes only its prose and its accepted call (report-overview-record.mjs), and a
|
|
180
|
+
// card reads its finding and the case-law join. Measured on 18 production clearances: the first card started a
|
|
181
|
+
// median 0.9 minutes after the overview, which was the overview's own wall. So the overview starts here and the
|
|
182
|
+
// cards start beside it; nothing below until the join reads anything the overview writes.
|
|
183
|
+
//
|
|
184
|
+
// ONE CAP FOR THE STEP. The overview holds one of `cardConcurrency`'s sessions while it runs, so the engine never
|
|
185
|
+
// sees more of this step's sessions at once than it did, and with a cap of 1 the step runs serially as before.
|
|
186
|
+
//
|
|
187
|
+
// THE CARDS SETTLE BEFORE THE OVERVIEW'S OUTCOME IS READ. An overview that fails, a usage limit included, is raised
|
|
188
|
+
// at the join exactly as it was raised before the cards, after every card in flight has settled: no card is
|
|
189
|
+
// abandoned mid-call, and each card that landed is file-gated, so a resume skips it. A card set the overview's
|
|
190
|
+
// failure interrupted reads on resume as the same partial set a card-side limit leaves.
|
|
191
|
+
let free = config.cardConcurrency;
|
|
192
|
+
const waiting = [];
|
|
193
|
+
const withSession = async (fn) => {
|
|
194
|
+
if (free > 0) free -= 1; else await new Promise((r) => waiting.push(r));
|
|
195
|
+
try { return await fn(); } finally { const next = waiting.shift(); if (next) next(); else free += 1; }
|
|
196
|
+
};
|
|
197
|
+
const overviewDone = overviewOpen ? Promise.resolve(null)
|
|
198
|
+
: withSession(() => asPartNotCompleted("overview", async () => must(await stage("report-overview", { ...ctx, displayVerdict: runState.displayVerdict }, {}), "report-overview"))); // T3a: a BLOCKING run now DELIVERS; its open points are rendered at assembly, not dispatched here
|
|
199
|
+
overviewDone.catch(() => {}); // read at the join below; never an unhandled rejection while the cards run
|
|
172
200
|
const findingsRead = readFindingsForReport(P);
|
|
173
201
|
const findingsForCards = findingsRead.findings;
|
|
174
202
|
//: a rejected findings.json is a defect, not an emptiness. Say so HERE, where the file was read,
|
|
@@ -212,11 +240,11 @@ export async function runOverviewAndCards({ P, applyCoverageFloor, clampOnTheWri
|
|
|
212
240
|
let caseLawByOrd = new Map();
|
|
213
241
|
try {
|
|
214
242
|
if (existsSync(P.caseLaw)) caseLawByOrd = caseLawJoin(P, findingsForCards);
|
|
215
|
-
} catch { /* no case-law layer */ }
|
|
243
|
+
} catch { /* no case-law layer, or a join that failed, which caseLawJoin has recorded */ }
|
|
216
244
|
// A2 — cards are isolated BY DESIGN (each sees ONLY its own finding and writes its own
|
|
217
245
|
// P.reportCard(ord) file), so they fan out like the gather members instead of paying 8–14 serial
|
|
218
246
|
// LLM walls. The first card runs alone to warm the shared prompt-prefix cache; the rest batch at
|
|
219
|
-
//
|
|
247
|
+
// `config.cardConcurrency` (CLEAROTRON_CARD_CONCURRENCY), shared with the overview while it runs. A failed card stays non-fatal (render shows it structured-only) and never
|
|
220
248
|
// fails a sibling — renderCard resolves on rc.fail, it never throws. assembleReportMd runs
|
|
221
249
|
// strictly after every card settles; the lint-repair re-render loop below stays serial.
|
|
222
250
|
const cardFindings = findingsForCards.filter((f) => cardOrdinals.includes(f.ordinal)); // secondary findings render structured-only (no LLM call)
|
|
@@ -236,16 +264,27 @@ export async function runOverviewAndCards({ P, applyCoverageFloor, clampOnTheWri
|
|
|
236
264
|
}
|
|
237
265
|
note(`report-card[${f.ordinal}] failed (non-fatal — render shows it structured-only): ${rc.fail}`);
|
|
238
266
|
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
267
|
+
// The warm-up card still runs alone among the cards, beside the overview only.
|
|
268
|
+
let cardsThrew = null;
|
|
269
|
+
try {
|
|
270
|
+
if (cardFindings.length) await withSession(() => renderCard(cardFindings[0]));
|
|
271
|
+
// — THE ONE SETTING ALLOWED TO FALL BACK IS NOT ALLOWED TO DO IT QUIETLY. Every
|
|
272
|
+
// other numeric setting refuses a value it cannot parse, by name, at the read. This one is read
|
|
273
|
+
// mid-run and is not grade-moving, so refusing would turn a delivering search into a refusal over an
|
|
274
|
+
// operator's typo — the run continues on the default instead. It says so here, once, in the run's own
|
|
275
|
+
// record: a fallback nobody can see is how a deployment ends up running on a number nobody chose,
|
|
276
|
+
// which is the same defect one register quieter.
|
|
277
|
+
const cardCapNote = fallbackNoteFor("CLEAROTRON_CARD_CONCURRENCY");
|
|
278
|
+
if (cardCapNote) note(`[config] ${cardCapNote}`);
|
|
279
|
+
// Every card settles, even when one throws, so none is left running behind the join.
|
|
280
|
+
const settled = await Promise.allSettled(cardFindings.slice(1).map((f) => withSession(() => renderCard(f))));
|
|
281
|
+
const threw = settled.find((r) => r.status === "rejected");
|
|
282
|
+
if (threw) throw threw.reason;
|
|
283
|
+
} catch (e) { cardsThrew = e; }
|
|
284
|
+
// THE JOIN. The overview's failure first, as when it ran before the cards; then a card that threw; then the cards'
|
|
285
|
+
// usage limits, collected over the fan-out.
|
|
286
|
+
const rov = await overviewDone;
|
|
287
|
+
if (cardsThrew) throw cardsThrew;
|
|
249
288
|
if (cardRateLimited.length) {
|
|
250
289
|
const earliest = cardRateLimited.map((c) => c.resetsAt).filter(Boolean).sort()[0] ?? null;
|
|
251
290
|
runLog(run.runDir, { event: "report-cards-rate-limited", count: cardRateLimited.length,
|
|
@@ -33,6 +33,7 @@ import { readWithheldFamilies, releasedFamilyQids } from "../withheld-families.m
|
|
|
33
33
|
import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
34
34
|
import { seedUnplannedBands } from "../register-unit-record.mjs";
|
|
35
35
|
import { join } from "node:path";
|
|
36
|
+
import { stopsWithTheRun } from "../cancel.mjs"; // every paid call the code makes itself reads the stop first
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Which cross-checks this pass folds into the plan, and which the receipt keeps from an earlier pass. PURE.
|
|
@@ -124,9 +125,9 @@ export async function runRegisterSweep({ P, agent, axes, ctx, job, opts, run, ru
|
|
|
124
125
|
// lane fully ARMED. envGateOn accepts both spellings rather than switching to a bare `!== "0"`:
|
|
125
126
|
// deployments and 15 test files already say "off", and breaking that would arm dispatch silently,
|
|
126
127
|
// which is the same bug in the other direction.
|
|
127
|
-
const planExec = opts.planExecutor
|
|
128
|
+
const planExec = stopsWithTheRun(run.runDir, "register-plan", opts.planExecutor
|
|
128
129
|
?? (envGateOn("CLEAROTRON_PLAN_DISPATCH") && registerAdapter(ctx.register).executePlan
|
|
129
|
-
? (args, c) => noteAdapter(c ?? ctx, registerAdapter(ctx.register)).executePlan(args, c) : null);
|
|
130
|
+
? (args, c) => noteAdapter(c ?? ctx, registerAdapter(ctx.register)).executePlan(args, c) : null));
|
|
130
131
|
// Kill switch CLEAROTRON_SATPROBE_CODESIDE=0 (the inline `!== "0"` pattern): legacy mock harnesses
|
|
131
132
|
// opt out — their scenarios pre-date the code-side member and script the AGENT path (and an armed
|
|
132
133
|
// real executor lane would dial the provider from a test). Production default is ON.
|
|
@@ -234,7 +235,7 @@ export async function runRegisterSweep({ P, agent, axes, ctx, job, opts, run, ru
|
|
|
234
235
|
note(`the meaning half recorded all but ${short.length} of its dictated searches — the engine re-issues `
|
|
235
236
|
+ `${short.length === 1 ? "it" : "them"} itself rather than asking for the sweep again`);
|
|
236
237
|
clConnotationReissueSpent = true;
|
|
237
|
-
const reissuer = opts.connotationReissuer ?? defaultConnotationReissuer;
|
|
238
|
+
const reissuer = stopsWithTheRun(run.runDir, "connotation-reissue", opts.connotationReissuer ?? defaultConnotationReissuer);
|
|
238
239
|
const r = await reissuer(short, { spec, rawPath: driverDir(run.runDir, "web-results", `connotation-reissue-${h}-${Date.now()}.json`) });
|
|
239
240
|
runLog(run.runDir, { event: "connotation-reissue-result", ok: !!r?.ok,
|
|
240
241
|
recovered: Array.isArray(r?.rows) ? r.rows.length : 0,
|
|
@@ -546,7 +547,7 @@ export async function runRegisterSweep({ P, agent, axes, ctx, job, opts, run, ru
|
|
|
546
547
|
runLog(run.runDir, { event: "connotation-reissue", count: missing.length });
|
|
547
548
|
note(`${missing.length} dictated meaning quer${missing.length === 1 ? "y" : "ies"} missing after the `
|
|
548
549
|
+ "model's one repair turn — the engine re-issues them itself through the same tool");
|
|
549
|
-
const reissuer = opts.connotationReissuer ?? defaultConnotationReissuer;
|
|
550
|
+
const reissuer = stopsWithTheRun(run.runDir, "connotation-reissue", opts.connotationReissuer ?? defaultConnotationReissuer);
|
|
550
551
|
const r = await reissuer(missing, { spec, rawPath: driverDir(run.runDir, "web-results", `connotation-reissue-${Date.now()}.json`) });
|
|
551
552
|
runLog(run.runDir, { event: "connotation-reissue-result", ok: !!r?.ok,
|
|
552
553
|
recovered: Array.isArray(r?.rows) ? r.rows.length : 0,
|
|
@@ -20,6 +20,7 @@ import { findScreenGateParseGaps, findScreenGateViolations, screenGateZeroCause
|
|
|
20
20
|
import { escalatedAxes } from "../skeptic-record.mjs";
|
|
21
21
|
import { STAGES, lines } from "../stages.mjs";
|
|
22
22
|
import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
23
|
+
import { stopsWithTheRun } from "../cancel.mjs"; // every paid call the code makes itself reads the stop first
|
|
23
24
|
|
|
24
25
|
export async function runSkepticAndFollowUp({ P, agent, axes, ctx, dispatchPlanQids, flushDigestQueue, job, mintDigestWork, opts, planExec, run, unitKey }, helpers) {
|
|
25
26
|
const { askableOf, bandBytesOf, capabilityGapAxes, defaultRecordFetcher, deriveBandShape, deriveNamedBand, envelopeDecision, envelopeHeldNote, escalationHeldNote, findFloorBreaches, forceFromActive, isInactiveAxisRow, lateRecordIds, loadCoverageLedger, officeGapOf, readFloorAxes, readPlanExecution, reaskFollowUpErrors, recordPlacementPass, recordScreenGateEvidence, refreshSupplementalExecution, remergeIfBandsMoved, runBatched, screenGateSnapshot, settleOneShotStamp, skepticDeferralExtra, stage, stickyGapUnits } = helpers;
|
|
@@ -544,7 +545,7 @@ export async function runSkepticAndFollowUp({ P, agent, axes, ctx, dispatchPlanQ
|
|
|
544
545
|
// the mechanism). Registered here so the flush (which runs later, at the frame-reopen seam)
|
|
545
546
|
// reuses the exact same check + fetched-universe closure as the gate itself.
|
|
546
547
|
ctx.screenGateRecheck = async (pass) => {
|
|
547
|
-
const fetcher = opts.recordFetcher ?? defaultRecordFetcher;
|
|
548
|
+
const fetcher = stopsWithTheRun(run.runDir, "screen-gate-refetch", opts.recordFetcher ?? defaultRecordFetcher);
|
|
548
549
|
const { violations: leftover, failures: postFlushFailures } = await runPostFlushGateRepair({
|
|
549
550
|
check: enforcedViolations,
|
|
550
551
|
fetcher: (uri) => fetcher(uri, { agentId: agent, sessionKey: `${runPrefix}screen-gate-refetch`, recordLog: runRecordLogPath(run.runDir) }),
|
|
@@ -614,7 +615,7 @@ export async function runSkepticAndFollowUp({ P, agent, axes, ctx, dispatchPlanQ
|
|
|
614
615
|
// every event consumer to null-guard. Stamp `unnamed:<mark>` — the digest-queue keyParts shape.
|
|
615
616
|
runLog(run.runDir, { event: "screen-gate-violation", count: violations.length, uris: violations.map((v) => v.uri ?? `unnamed:${v.mark}`), action: "driver-refetch" });
|
|
616
617
|
note(`screen-gate: ${violations.length} in-scope-live goods/field drop(s) not record_fetched — DRIVER code-fetch + re-decide (no hard-halt)`);
|
|
617
|
-
const fetcher = opts.recordFetcher ?? defaultRecordFetcher;
|
|
618
|
+
const fetcher = stopsWithTheRun(run.runDir, "screen-gate-fetch", opts.recordFetcher ?? defaultRecordFetcher);
|
|
618
619
|
const fetchFailures = new Map();
|
|
619
620
|
for (const v of violations) {
|
|
620
621
|
if (!v.uri) continue; // an unnamed drop — the driver cannot fetch what nobody named; the re-digest below must name it
|