clearotron 0.5.0-beta.6 → 0.5.0-beta.8
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/.env.example +9 -1
- package/INSTALL.md +1 -1
- package/THIRD-PARTY-NOTICES.md +122 -96
- package/bin/signa-sync.mjs +1 -1
- package/build-info.json +2 -2
- package/docs/architecture/04-configuration-reference.md +2 -1
- package/docs/configuration.md +1 -1
- package/driver/CHANGELOG.md +18 -0
- package/driver/accepted-order.mjs +139 -0
- package/driver/contract-e3-backlog.mjs +31 -30
- package/driver/contract-vocabulary.mjs +1 -1
- package/driver/corrections-feedforward.mjs +29 -10
- package/driver/coverage-form.mjs +4 -3
- package/driver/coverage-ledger.mjs +6 -2
- package/driver/declination-duty.mjs +24 -2
- package/driver/declination-tool.mjs +10 -1
- package/driver/derived-state.mjs +104 -0
- package/driver/engine/CONTRACT.md +2 -2
- package/driver/engine/mcp/correction-positions.mjs +18 -0
- package/driver/engine/mcp/gather-config.mjs +7 -3
- package/driver/engine/mcp/recording-server.mjs +8 -4
- package/driver/engine/openai-agent.mjs +3 -2
- package/driver/finding-citations.mjs +38 -0
- package/driver/findings-model.mjs +4 -2
- package/driver/gateway.mjs +26 -16
- package/driver/goods-evidence.mjs +37 -1
- package/driver/narrative-refutation-record.mjs +36 -4
- package/driver/not-searched-sentences.mjs +118 -0
- package/driver/package.json +1 -1
- package/driver/pipeline.mjs +435 -82
- package/driver/predelivery-lint.mjs +72 -17
- package/driver/publish/audit-from-spine.mjs +8 -2
- package/driver/publish/email-conditions.mjs +21 -0
- package/driver/publish/index.mjs +19 -5
- package/driver/register-plan.mjs +8 -44
- package/driver/repair-composers.mjs +62 -20
- package/driver/repair-targets.mjs +11 -31
- package/driver/replay-archive.mjs +2 -2
- package/driver/research-answers.mjs +47 -2
- package/driver/skeptic-search.mjs +4 -2
- package/driver/skills/clearance-register/SKILL.md +4 -10
- package/driver/skills/clearance-register/providers/signa.md +6 -4
- package/driver/skills/clearance-search/SKILL.md +2 -2
- package/driver/skills/clearance-search/phase2-execution.md +1 -1
- package/driver/skills/narrative-refutation/SKILL.md +7 -10
- package/driver/stage-context.mjs +47 -3
- package/driver/stages.mjs +63 -7
- package/driver/suite-census.json +109 -19
- package/driver/synthesis-record.mjs +165 -33
- package/driver/verify.mjs +11 -1
- package/mcp-server/CHANGELOG.md +8 -0
- package/mcp-server/package.json +1 -1
- package/node_modules/@isaacs/nonrecursive-glob-match/LICENSE.md +55 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/README.md +333 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts +114 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js +762 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts +4 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js +142 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts +114 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js +758 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js.map +7 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts +4 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js +138 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/package.json +56 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/src/index.ts +900 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/src/parse-class.ts +158 -0
- package/node_modules/balanced-match/LICENSE.md +3 -1
- package/node_modules/balanced-match/README.md +15 -55
- package/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
- package/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/node_modules/balanced-match/dist/esm/index.js.map +1 -0
- package/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/node_modules/balanced-match/package.json +48 -28
- package/node_modules/brace-expansion/LICENSE +3 -1
- package/node_modules/brace-expansion/README.md +10 -56
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +12 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/brace-expansion/dist/commonjs/index.js +333 -0
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
- package/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts +12 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
- package/node_modules/brace-expansion/dist/esm/index.js +329 -0
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
- package/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/node_modules/brace-expansion/package.json +52 -37
- package/node_modules/minimatch/LICENSE.md +55 -0
- package/node_modules/minimatch/README.md +388 -109
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts +185 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.js +1550 -0
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/index.d.ts +185 -0
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/index.js +1539 -0
- package/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/minimatch/package.json +58 -17
- package/package.json +1 -1
- package/portal-ui/package.json +1 -1
- package/providers/README.md +1 -1
- package/providers/_shared/execute-plan.mjs +22 -2
- package/providers/clarivate/src/core.js +13 -3
- package/providers/euipo/src/core.js +3 -2
- package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/providers/signa/src/offices.generated.js +15 -13
- package/scripts/e2e-first-time.mjs +1 -1
- package/scripts/freeze-example-run.mjs +6 -6
- package/scripts/release-notes-lint.mjs +5 -3
- package/scripts/third-party-notices.mjs +12 -0
- package/shared/names-in-force.mjs +1 -0
- package/shared/register-selection.mjs +2 -2
- package/node_modules/balanced-match/.github/FUNDING.yml +0 -2
- package/node_modules/balanced-match/index.js +0 -62
- package/node_modules/brace-expansion/index.js +0 -438
- package/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/concat-map/index.js +0 -13
- package/node_modules/concat-map/package.json +0 -43
- package/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/minimatch/LICENSE +0 -15
- package/node_modules/minimatch/minimatch.js +0 -1005
- package/node_modules/readdir-glob/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
- package/node_modules/readdir-glob/node_modules/brace-expansion/LICENSE +0 -21
- package/node_modules/readdir-glob/node_modules/brace-expansion/README.md +0 -157
- package/node_modules/readdir-glob/node_modules/brace-expansion/index.js +0 -394
- package/node_modules/readdir-glob/node_modules/brace-expansion/package.json +0 -49
- package/node_modules/readdir-glob/node_modules/minimatch/LICENSE +0 -15
- package/node_modules/readdir-glob/node_modules/minimatch/README.md +0 -296
- package/node_modules/readdir-glob/node_modules/minimatch/lib/path.js +0 -4
- package/node_modules/readdir-glob/node_modules/minimatch/minimatch.js +0 -996
- package/node_modules/readdir-glob/node_modules/minimatch/package.json +0 -35
|
@@ -171,7 +171,7 @@ export const E3_BACKLOG = [
|
|
|
171
171
|
{
|
|
172
172
|
stage: "common-law",
|
|
173
173
|
kind: "dictated-line-shape",
|
|
174
|
-
where: "driver/stages.mjs:
|
|
174
|
+
where: "driver/stages.mjs:1131 (emitted at 1918, 1947, 2127, 2347)",
|
|
175
175
|
surface: "stage-message",
|
|
176
176
|
evidence: "CROSS-CHECK HAND-OFF: … record it on its OWN line in EXACTLY the form \"CROSS-CHECK REQUIRED: <what> — <why>\" (that exact prefix; an em-dash between what and why; name the mark in CAPS in <what>). The driver parses ONLY this exact line shape…",
|
|
177
177
|
reparsedBy: "driver/doubt-ledger.mjs:183 CROSS_CHECK_RE = /^(?:[-*]\\s+)?CROSS-CHECK REQUIRED:\\s*(.+?)\\s+—\\s+(.+?)\\s*$/ → mintCrossCheckDoubts",
|
|
@@ -212,7 +212,7 @@ export const E3_BACKLOG = [
|
|
|
212
212
|
where: "driver/skills/clearance-common-law/SKILL.md:117-164",
|
|
213
213
|
surface: "skill-file",
|
|
214
214
|
evidence: "### Format\\n```markdown\\n# Common-law findings — Dusk: Tales of Thornmantle (2026-05-11)\\n\\n## Summary\\n\\n- Perplexity calls executed: 4 …",
|
|
215
|
-
reparsedBy: "driver/publish/audit-from-spine.mjs:
|
|
215
|
+
reparsedBy: "driver/publish/audit-from-spine.mjs:15 parseTables → parseSpineFindingBlocks (audit-from-spine.mjs:124) re-parses the common-law finding tables into audit.md",
|
|
216
216
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
217
217
|
},
|
|
218
218
|
{
|
|
@@ -256,7 +256,7 @@ export const E3_BACKLOG = [
|
|
|
256
256
|
{
|
|
257
257
|
stage: "register-unit",
|
|
258
258
|
kind: "literal-json-skeleton",
|
|
259
|
-
where: "driver/stages.mjs:
|
|
259
|
+
where: "driver/stages.mjs:2334 (the non-supplemental-lane branch)",
|
|
260
260
|
surface: "stage-message",
|
|
261
261
|
evidence: "BAND ARTIFACT (MANDATORY): ALSO write the COMPLETE NAMED BAND for this axis to <path> — 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,",
|
|
262
262
|
reparsedBy: "driver/named-band.mjs parseNamedBand / bandRecords / bandCrowds / mergeNamedBands (named in driver/skills/clearance-register/unit.md:60-62); validators.registerUnit",
|
|
@@ -265,7 +265,7 @@ export const E3_BACKLOG = [
|
|
|
265
265
|
{
|
|
266
266
|
stage: "register-unit",
|
|
267
267
|
kind: "exactly-these-keys",
|
|
268
|
-
where: "driver/stages.mjs:
|
|
268
|
+
where: "driver/stages.mjs:2299",
|
|
269
269
|
surface: "stage-message",
|
|
270
270
|
evidence: "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.",
|
|
271
271
|
reparsedBy: "driver/named-band.mjs parseNamedBand (off-enum state fails validators.registerUnit)",
|
|
@@ -283,7 +283,7 @@ export const E3_BACKLOG = [
|
|
|
283
283
|
{
|
|
284
284
|
stage: "register-unit",
|
|
285
285
|
kind: "exactly-these-keys",
|
|
286
|
-
where: "driver/stages.mjs:
|
|
286
|
+
where: "driver/stages.mjs:4307 (the frame-reopen / scoped-retry message builder). A second number stood here and had been stale for some time: it pointed at a contract-element description rather than a builder, at its old line and at every mechanical shift of it. Two candidate builders sit beside 4164 and picking one would be a guess, so the wrong pointer is removed rather than moved a third time — one accurate citation beats one accurate and one invented.",
|
|
287
287
|
surface: "stage-message",
|
|
288
288
|
evidence: "Every block you append MUST carry \"state\":\"enumerated\" (ONLY if paged to has_more:false) or \"state\":\"incomplete\" — EXACTLY those two strings … (re-dispatch builders, which REPLACE def.message)",
|
|
289
289
|
reparsedBy: "driver/named-band.mjs parseNamedBand. Scope warning: these builders replace def.message on every escalation / envelope-close / frame-reopen dispatch, so an E3 lint that walks STAGES[*].message only never sees them",
|
|
@@ -301,7 +301,7 @@ export const E3_BACKLOG = [
|
|
|
301
301
|
{
|
|
302
302
|
stage: "placement-inquiry",
|
|
303
303
|
kind: "exactly-these-keys",
|
|
304
|
-
where: "driver/stages.mjs:
|
|
304
|
+
where: "driver/stages.mjs:2495",
|
|
305
305
|
surface: "stage-message",
|
|
306
306
|
evidence: "· tier EXACTLY one of headline-candidate / sheet-2 / watchlist-annex / out-of-scope-filtered.",
|
|
307
307
|
reparsedBy: "driver/placement-form.mjs / driver/placement-model.mjs via validators.placement",
|
|
@@ -347,7 +347,7 @@ export const E3_BACKLOG = [
|
|
|
347
347
|
// (coverage-form.mjs coverageFormBrief) and the tool schema, with every row receiver-validated at
|
|
348
348
|
// call time. Same dictated vocabulary, same authored site, new route — this row's evidence follows
|
|
349
349
|
// the dictation so the row keeps describing something that exists.
|
|
350
|
-
where: "driver/stages.mjs:
|
|
350
|
+
where: "driver/stages.mjs:2706 (the digest message) + driver/coverage-form.mjs (coverageFormBrief — the dispatch block carrying the enum and the row shape)",
|
|
351
351
|
surface: "stage-message",
|
|
352
352
|
evidence: "Record a \"status\" and a \"reason\" on EVERY row ONLY by calling the … tool — the driver validates each row as it arrives, holds the record itself, and renders both the ## Coverage ledger table and the coverage JSON from it",
|
|
353
353
|
reparsedBy: "driver/coverage-call.mjs validateCoverageCall (receiver-validated at call time, the same predicates the gate judges with) + driver/coverage-form.mjs rowIsSettled via validators.registerFindings over the _driver/ accumulator",
|
|
@@ -430,7 +430,7 @@ export const E3_BACKLOG = [
|
|
|
430
430
|
{
|
|
431
431
|
stage: "frame-diff",
|
|
432
432
|
kind: "exactly-these-keys",
|
|
433
|
-
where: "driver/stages.mjs:
|
|
433
|
+
where: "driver/stages.mjs:2874",
|
|
434
434
|
surface: "stage-message",
|
|
435
435
|
evidence: "For each blind-model variant / field / source the run did NOT scope or search, emit one directive {layer, item, observation, severity} … severity = dominant-element (the omission is ON the spine) | material (a real omission worth a targeted sweep) | minor (already covered, or presentation only).",
|
|
436
436
|
reparsedBy: "driver/verify.mjs validators.frameDiff + driver/pipeline.mjs runSupplementalSweeps (the parser REFUSES a firing variant directive that dictates nothing dispatchable)",
|
|
@@ -454,7 +454,7 @@ export const E3_BACKLOG = [
|
|
|
454
454
|
{
|
|
455
455
|
stage: "synthesis",
|
|
456
456
|
kind: "literal-json-skeleton",
|
|
457
|
-
where: "driver/stages.mjs:
|
|
457
|
+
where: "driver/stages.mjs:3257",
|
|
458
458
|
surface: "stage-message",
|
|
459
459
|
evidence: "MACHINE FINDINGS (MANDATORY): … a JSON OBJECT {\"schema_version\":<FINDINGS_SCHEMA_VERSION>,\"rated_under_framework\":\"…\",\"findings\":[...],\"coverage\":[...],\"context_notes\":[...],\"actions\":[...],\"ask_answers\":[...]} … Each finding object has EXACTLY these keys: {\"ordinal\",\"mark\",\"owner\",\"band\",\"net\",\"bor",
|
|
460
460
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson via validators.narrative",
|
|
@@ -468,7 +468,7 @@ export const E3_BACKLOG = [
|
|
|
468
468
|
{
|
|
469
469
|
stage: "synthesis",
|
|
470
470
|
kind: "exactly-these-keys",
|
|
471
|
-
where: "driver/stages.mjs:
|
|
471
|
+
where: "driver/stages.mjs:3290",
|
|
472
472
|
surface: "stage-message",
|
|
473
473
|
evidence: "- off_field_ground (MANDATORY on every off-field finding, FORBIDDEN on every other disposition): EXACTLY one bare token of: ${OFF_FIELD_GROUNDS.join(\" / \")}",
|
|
474
474
|
reparsedBy: "driver/findings-model.mjs validateOffFieldGround — the enum is imported from findings-model.mjs and interpolated back into the prompt, so code already holds the list it asks the model to type",
|
|
@@ -477,7 +477,7 @@ export const E3_BACKLOG = [
|
|
|
477
477
|
{
|
|
478
478
|
stage: "synthesis",
|
|
479
479
|
kind: "literal-json-skeleton",
|
|
480
|
-
where: "driver/stages.mjs:
|
|
480
|
+
where: "driver/stages.mjs:3291",
|
|
481
481
|
surface: "stage-message",
|
|
482
482
|
evidence: "- manageable …: {\"category\":\"<EXACTLY one of large-competitor / commercial-partner / troll / well-known-enforcer>\",\"reason\":\"<one-two lines…>\"}",
|
|
483
483
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson",
|
|
@@ -486,16 +486,16 @@ export const E3_BACKLOG = [
|
|
|
486
486
|
{
|
|
487
487
|
stage: "synthesis",
|
|
488
488
|
kind: "literal-json-skeleton",
|
|
489
|
-
where: "driver/stages.mjs:
|
|
489
|
+
where: "driver/stages.mjs:3307",
|
|
490
490
|
surface: "stage-message",
|
|
491
491
|
evidence: "- meters: {\"mark_similarity\":{...},\"goods_proximity\":{...},\"use\":{...},\"enforcer\":{...}} — all four present, each {\"token\",\"basis\",\"source\"}. … mark_similarity = high | medium | low. goods_proximity = high | medium | low. enforcer = high | medium | low | unknown. use = confirmed | not-confirmed | un",
|
|
492
|
-
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson; driver/verify.mjs:
|
|
492
|
+
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson; driver/verify.mjs:1181 checkFindingsSibling gates meters.*.source; finding_basis_source_missing",
|
|
493
493
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
494
494
|
},
|
|
495
495
|
{
|
|
496
496
|
stage: "synthesis",
|
|
497
497
|
kind: "literal-json-skeleton",
|
|
498
|
-
where: "driver/stages.mjs:
|
|
498
|
+
where: "driver/stages.mjs:3308",
|
|
499
499
|
surface: "stage-message",
|
|
500
500
|
evidence: "- quadrant: {\"x\",\"y\"} numbers in [0,1]. x = goods/services proximity (0 = distant, 1 = identical). y = mark similarity (0 = distinct, 1 = identical).",
|
|
501
501
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson",
|
|
@@ -504,7 +504,7 @@ export const E3_BACKLOG = [
|
|
|
504
504
|
{
|
|
505
505
|
stage: "synthesis",
|
|
506
506
|
kind: "literal-json-skeleton",
|
|
507
|
-
where: "driver/stages.mjs:
|
|
507
|
+
where: "driver/stages.mjs:3309",
|
|
508
508
|
surface: "stage-message",
|
|
509
509
|
evidence: "- source: {\"source_type\",\"resolved_link\"}. source_type EXACTLY one of: register-vendor / register-euipo / common-law-marketplace / common-law-web / case-law",
|
|
510
510
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson",
|
|
@@ -513,7 +513,7 @@ export const E3_BACKLOG = [
|
|
|
513
513
|
{
|
|
514
514
|
stage: "synthesis",
|
|
515
515
|
kind: "exactly-these-keys",
|
|
516
|
-
where: "driver/stages.mjs:
|
|
516
|
+
where: "driver/stages.mjs:3310",
|
|
517
517
|
surface: "stage-message",
|
|
518
518
|
evidence: "coverage[]: ONE object per coverage AREA, EXACTLY {\"area\",\"state\",\"note\"}. … state EXACTLY one of: confirmed-clean / coverage-limited / open / not-searched / note.",
|
|
519
519
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson; the render owns the coverage panel from these typed states",
|
|
@@ -522,7 +522,7 @@ export const E3_BACKLOG = [
|
|
|
522
522
|
{
|
|
523
523
|
stage: "synthesis",
|
|
524
524
|
kind: "literal-json-skeleton",
|
|
525
|
-
where: "driver/stages.mjs:
|
|
525
|
+
where: "driver/stages.mjs:3319",
|
|
526
526
|
surface: "stage-message",
|
|
527
527
|
evidence: "use_check = {\"source\",\"quality\",\"question\"}: … quality: OPTIONAL, EXACTLY one of owner-site / independent / register-mirror … own_rights = {\"source\"}",
|
|
528
528
|
reparsedBy: "driver/verify.mjs checkFindingsSibling (finding_use_check_missing); driver/own-rights.mjs:19-22",
|
|
@@ -531,7 +531,7 @@ export const E3_BACKLOG = [
|
|
|
531
531
|
{
|
|
532
532
|
stage: "synthesis",
|
|
533
533
|
kind: "literal-json-skeleton",
|
|
534
|
-
where: "driver/stages.mjs:
|
|
534
|
+
where: "driver/stages.mjs:3376",
|
|
535
535
|
surface: "stage-message",
|
|
536
536
|
evidence: "MARK ASSESSMENT … STRUCTURED FORM …: either field may instead be an OBJECT {\"read\":\"…\",\"spectrum\":\"…\",\"per_class\":[{\"class\":\"5\",\"note\":\"…\"}],\"per_market\":[{\"market\":\"CN\",\"note\":\"…\"}],\"counter_registrations\":[{\"mark\":\"…\",\"uri\":\"/mark/…\",\"note\":\"…\"}],\"acquired\":\"<optional>\",\"note\":\"<optional residual>",
|
|
537
537
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson; the report collapses the rows behind toggles and the audit workbook renders them",
|
|
@@ -540,7 +540,7 @@ export const E3_BACKLOG = [
|
|
|
540
540
|
{
|
|
541
541
|
stage: "synthesis",
|
|
542
542
|
kind: "literal-json-skeleton",
|
|
543
|
-
where: "driver/stages.mjs:
|
|
543
|
+
where: "driver/stages.mjs:3382",
|
|
544
544
|
surface: "stage-message",
|
|
545
545
|
evidence: "FOUR ANSWERS …: \"four_answers\": {\"third_party_rights\":{...},\"objection_likelihood\":{...},\"registrability\":{...},\"client_enforceability\":{...}} … Each answer … is {\"read\":\"…\",\"token\":\"…\",\"basis\":\"…\",\"ordinals\":[…]}. Tokens (closed enums …): third_party_rights = strong|moderate|weak; objection_likelih",
|
|
546
546
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson",
|
|
@@ -558,7 +558,7 @@ export const E3_BACKLOG = [
|
|
|
558
558
|
{
|
|
559
559
|
stage: "synthesis",
|
|
560
560
|
kind: "exactly-these-keys",
|
|
561
|
-
where: "driver/stages.mjs:
|
|
561
|
+
where: "driver/stages.mjs:3389",
|
|
562
562
|
surface: "stage-message",
|
|
563
563
|
evidence: "COVERAGE JUDGMENT …: emit \"coverage_judgment\": {\"sufficient\":<bool>, \"reason\":\"<one line…>\"} — EXACTLY those two keys. Do NOT emit \"rows\": the driver writes that register itself … anything you type there is replaced wholesale.",
|
|
564
564
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson. The \"Do NOT emit rows\" clause is the purest E3 case in the tree — the prompt names a field, dictates its shape and states in the same breath that code overwrites it",
|
|
@@ -567,7 +567,7 @@ export const E3_BACKLOG = [
|
|
|
567
567
|
{
|
|
568
568
|
stage: "synthesis",
|
|
569
569
|
kind: "literal-json-skeleton",
|
|
570
|
-
where: "driver/stages.mjs:
|
|
570
|
+
where: "driver/stages.mjs:3235",
|
|
571
571
|
surface: "stage-message",
|
|
572
572
|
// RE-QUOTED, NOT PARKED. The writer's conversion reworded this dictation — the
|
|
573
573
|
// ask answers ride the findings RECORD now and the driver renders the labelled line into both the
|
|
@@ -591,7 +591,7 @@ export const E3_BACKLOG = [
|
|
|
591
591
|
{
|
|
592
592
|
stage: "synthesis",
|
|
593
593
|
kind: "dictated-line-shape",
|
|
594
|
-
where: "driver/stages.mjs:
|
|
594
|
+
where: "driver/stages.mjs:3153 (restated at driver/skills/clearance-search/synthesis-rules.md:426)",
|
|
595
595
|
surface: "stage-message",
|
|
596
596
|
evidence: "END that finding's actual-use line with a literal \"- **Use-check source:** <result URL | \"perplexity_research — no result\">\" line",
|
|
597
597
|
reparsedBy: "driver/verify.mjs validators.narrative (spec-11 hard reject); the repair hint re-dictates the literal in correctionHint() in gateway.mjs",
|
|
@@ -600,7 +600,7 @@ export const E3_BACKLOG = [
|
|
|
600
600
|
{
|
|
601
601
|
stage: "synthesis",
|
|
602
602
|
kind: "dictated-line-shape",
|
|
603
|
-
where: "driver/stages.mjs:
|
|
603
|
+
where: "driver/stages.mjs:3166 (restated at driver/skills/clearance-search/synthesis-rules.md:473)",
|
|
604
604
|
surface: "stage-message",
|
|
605
605
|
evidence: "END that finding's reasoning with a literal \"- **Own-rights source:** <record URI(s) | \"no applicant-owned registrations in the searched register material\">\" line",
|
|
606
606
|
reparsedBy: "driver/own-rights.mjs, in its header — \"This module only requires the 'Own-rights source:' line to exist\"; repair hint in correctionHint() in gateway.mjs (the `own_rights_missing` branch; re-verified 2026-08-29 — the old :1736 predated this branch and pointed into the A4 repeat-signature block)",
|
|
@@ -609,7 +609,7 @@ export const E3_BACKLOG = [
|
|
|
609
609
|
{
|
|
610
610
|
stage: "synthesis",
|
|
611
611
|
kind: "exactly-these-keys",
|
|
612
|
-
where: "driver/stages.mjs:
|
|
612
|
+
where: "driver/stages.mjs:3368",
|
|
613
613
|
surface: "stage-message",
|
|
614
614
|
evidence: "add it to the top-level \"context_notes\" array — each object EXACTLY {\"type\":\"famous-neighbour-ungrounded\",\"mark\",\"owner\",\"context\"}",
|
|
615
615
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson",
|
|
@@ -618,7 +618,7 @@ export const E3_BACKLOG = [
|
|
|
618
618
|
{
|
|
619
619
|
stage: "synthesis",
|
|
620
620
|
kind: "literal-json-skeleton",
|
|
621
|
-
where: "driver/stages.mjs:
|
|
621
|
+
where: "driver/stages.mjs:3259",
|
|
622
622
|
surface: "stage-message",
|
|
623
623
|
evidence: "- owner: {\"name\",\"country\",\"registrations\":[...]}. … Each registration: {\"uri\", optionally \"classes\":[\"9\",\"41\"],\"status\",\"filed\",\"expiry\",\"jurisdiction\"}. The \"uri\" is the ONLY field that matters: the driver BINDS classes/status/filed/expiry/jurisdiction AND the owner name from the FETCHED record ke",
|
|
624
624
|
reparsedBy: "driver/findings-model.mjs:848 parseFindingsJson + the record-binding join. Six of the seven keys are stated in the prompt and overwritten by code in the same sentence",
|
|
@@ -627,7 +627,7 @@ export const E3_BACKLOG = [
|
|
|
627
627
|
{
|
|
628
628
|
stage: "case-law",
|
|
629
629
|
kind: "literal-json-skeleton",
|
|
630
|
-
where: "driver/stages.mjs:
|
|
630
|
+
where: "driver/stages.mjs:3546",
|
|
631
631
|
surface: "stage-message",
|
|
632
632
|
evidence: "ALSO write the RETRIEVAL RECORD to <path> — a JSON OBJECT with EXACTLY these keys: {\"schema_version\":2,\"queries\":[{\"query\":\"<the search you dispatched, verbatim>\",\"jurisdiction\":\"…\",\"results\":<how many hits it returned, or null when the query never reached a source — never 0 for a query you could not send>}, …],\"citations\":[{\"proceeding\":\"…\",\"forum\":\"…\",\"jurisdiction\":\"…\",\"decided\":\"…\"",
|
|
633
633
|
reparsedBy: "driver/verify.mjs validators.caseLaw — the ledger arm, armed by the stage-contract marker `citations` (the case-law stage's `contract: { citations: 1 }` in stages.mjs)",
|
|
@@ -636,7 +636,7 @@ export const E3_BACKLOG = [
|
|
|
636
636
|
{
|
|
637
637
|
stage: "case-law",
|
|
638
638
|
kind: "dictated-line-shape",
|
|
639
|
-
where: "driver/stages.mjs:
|
|
639
|
+
where: "driver/stages.mjs:3554",
|
|
640
640
|
surface: "stage-message",
|
|
641
641
|
evidence: "EVERY \"Grounded profile\" section MUST start its body with the line \"- ord: <N>\" naming which finding it grounds (use the ordinal from this list; a profile that grounds no listed finding omits the line)",
|
|
642
642
|
reparsedBy: "driver/publish/parse.mjs:339, parseCaseLawProfiles() in parse.mjs (\"the optional '- ord: <N>' first body line … gives an EXACT join\"); driver/findings-model.mjs:274 /^-\\s*ord:\\s*(\\d+)\\s*$/m; driver/publish/index.mjs publishReport (joinCaseLawProfiles)",
|
|
@@ -670,7 +670,7 @@ export const E3_BACKLOG = [
|
|
|
670
670
|
{
|
|
671
671
|
stage: "narrative-refutation",
|
|
672
672
|
kind: "dictated-line-shape",
|
|
673
|
-
where: "driver/stages.mjs:
|
|
673
|
+
where: "driver/stages.mjs:4891",
|
|
674
674
|
surface: "stage-message",
|
|
675
675
|
// RE-QUOTED BY CONVERSION 9. The LINE-TOKEN half is gone — no "anywhere on the line", no "[kind: …]
|
|
676
676
|
// token", no "a line with no token is treated as fact", because a kind is a typed field now and an
|
|
@@ -697,7 +697,8 @@ export const E3_BACKLOG = [
|
|
|
697
697
|
// ordinals the seat sends, and the bracketed forms are now labelled as what the DRIVER renders. The
|
|
698
698
|
// `[on: -]` case went from a value to an ABSENCE — you omit the field — which is the one part a
|
|
699
699
|
// reader could get wrong from the old wording, since there is no value meaning "no finding".
|
|
700
|
-
|
|
700
|
+
// RE-QUOTED 2026-10-30: the heading is design's ruled one, because the old one said every flag names a finding.
|
|
701
|
+
evidence: "**Identify what each flag is about** — the `on` field, an array of ordinals. Same rule as `kind`: you send the values, the driver renders the token.",
|
|
701
702
|
reparsedBy: "driver/verify.mjs:864 CORRECTION_ON_RE = /\\[on:\\s*([0-9,\\s-]*?)\\s*\\]/i. SKILL-FILE ONLY — the stage message (narrative-refutation's, in stages.mjs) never mentions `[on:]`. This is #850's \"the element shape is in the skill file, not the stage message\" in its purest form: an E3 lint reading stages.mjs alone sees the [kind:] token and misses its twin",
|
|
702
703
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
703
704
|
},
|
|
@@ -769,7 +770,7 @@ export const E3_BACKLOG = [
|
|
|
769
770
|
{
|
|
770
771
|
stage: "report-card",
|
|
771
772
|
kind: "literal-json-skeleton",
|
|
772
|
-
where: "driver/stages.mjs:
|
|
773
|
+
where: "driver/stages.mjs:3995",
|
|
773
774
|
surface: "stage-message",
|
|
774
775
|
evidence: "The finding's OWN record — the ONLY source for this card …:\\n```json\\n<JSON.stringify(finding, null, 2)>\\n```",
|
|
775
776
|
reparsedBy: "none — this is the INPUT side, and that is why it belongs in the survey: a full JSON object rendered into the prompt is exactly the mechanism #850 proves produced R-RECEIPT (the model pattern-matches a shown shape). E3's clause 1 as written (\"a code fence or inline example showing the exact object shape the model must emit\") does not reach an injected record, so the lint needs an explicit rule for shown-but-not-owed structure",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
//
|
|
18
18
|
// D1 verify.mjs connotationDispositionFail fail(`connotation_${reason}:…`) — reason is a member of CALL_REASON_SET
|
|
19
19
|
// D2 verify.mjs checkFindingsSibling fail(String(e.message)…) — parseFindingsJson throws token-first
|
|
20
|
-
// D3 verify.mjs:
|
|
20
|
+
// D3 verify.mjs:1259 checkJson: fail(String(e.message)…) — FIVE parsers reach this one site
|
|
21
21
|
// D4 verify.mjs parseCoverageLedgerJson, same shape
|
|
22
22
|
// D5 verify.mjs validators.registerFindings fail(`${unaccounted[0].token}:…`) — token minted in a DATA ROW
|
|
23
23
|
// D6 verify.mjs validators.registerFindings fail(`${violations[0].token}…`) — findUnexecutedCleanClaims() in register-plan.mjs
|
|
@@ -204,19 +204,37 @@ function byName(doc) {
|
|
|
204
204
|
//
|
|
205
205
|
// { scoped: true, ordinals: [6, 9, 12] } every flag declared what it is about; the corrective pass
|
|
206
206
|
// may be told to leave everything else alone.
|
|
207
|
-
// { scoped: false, ordinals: [] } at least one flag
|
|
208
|
-
// that anything may need to move
|
|
207
|
+
// { scoped: false, ordinals: [] } at least one flag's target could not be read, so the safe
|
|
208
|
+
// reading is that anything may need to move.
|
|
209
209
|
//
|
|
210
|
-
//
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
//
|
|
210
|
+
// A FLAG ABOUT THE DOCUMENT IS A DECLARED TARGET (ruled 2026-10-30): it names the passage, section or coverage
|
|
211
|
+
// claim in its text and carries no finding ordinal, which is normal for it, so its `ordinals` are `[]` and the
|
|
212
|
+
// pass is told to change the passages the flags identify along with the named findings. Only a target that
|
|
213
|
+
// cannot be read, `null`, leaves the pass open: a review written before the token, a rendered flag without
|
|
214
|
+
// one, or a typed flag with no text.
|
|
215
|
+
//
|
|
216
|
+
// ALL-OR-NOTHING ON THAT, ON PURPOSE. A partial scope is the dangerous shape: it reads like a narrow
|
|
217
|
+
// instruction while one flag's subject is unknown, so the pass is told not to touch the finding that flag
|
|
218
|
+
// is about. Under-correcting a client deliverable is worse than paying for a wide pass, and `kind`'s own
|
|
219
|
+
// fail-safe takes the same direction one field over.
|
|
220
|
+
//
|
|
221
|
+
// A FLAG ABOUT A WRITER'S EXCLUSION DECLARES ITS SUBJECT TOO: the position it names, which has no finding ordinal. It
|
|
222
|
+
// counts as declared, so a flag on an excluded position narrows the pass to that position instead of opening the
|
|
223
|
+
// whole report (ruled 2026-10-29). `positions` lists them, as the review's list keys them. PURE.
|
|
214
224
|
export function correctionScope(rows) {
|
|
215
225
|
const list = rows ?? [];
|
|
216
226
|
if (!list.length) return { scoped: false, ordinals: [] };
|
|
217
|
-
|
|
227
|
+
const named = (r) => Array.isArray(r.positions) && r.positions.length > 0;
|
|
228
|
+
if (list.some((r) => r.ordinals == null && !named(r))) return { scoped: false, ordinals: [] };
|
|
218
229
|
const ords = [...new Set(list.flatMap((r) => r.ordinals ?? []))].sort((a, b) => a - b);
|
|
219
|
-
|
|
230
|
+
const positions = flaggedPositions(list);
|
|
231
|
+
return { scoped: true, ordinals: ords, ...(positions.length ? { positions } : {}) };
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** The writer's excluded positions the flags named, whether or not every flag declared its subject: the narrowing
|
|
235
|
+
* stays all-or-nothing, and a flag on a position is still answered by that position's row. PURE. */
|
|
236
|
+
export function flaggedPositions(rows) {
|
|
237
|
+
return [...new Set((rows ?? []).flatMap((r) => (Array.isArray(r.positions) ? r.positions : [])))];
|
|
220
238
|
}
|
|
221
239
|
|
|
222
240
|
/** The ordinals a findings doc actually carries. PURE. */
|
|
@@ -241,7 +259,8 @@ export function scopeDrift(rows, preDoc, postDoc) {
|
|
|
241
259
|
const named = new Set(scope.ordinals);
|
|
242
260
|
const have = ordinalsOf(preDoc?.findings ? preDoc : postDoc);
|
|
243
261
|
const unbound = [...new Set((rows ?? []).flatMap((r) => r.ordinals ?? []))].filter((o) => !have.has(o));
|
|
244
|
-
|
|
262
|
+
const positions = scope.positions ? { positions: scope.positions } : {};
|
|
263
|
+
if (!scope.scoped || !preDoc || !postDoc) return { scoped: scope.scoped, named: [...named], ...positions, moved: [], unbound };
|
|
245
264
|
const pre = byOrdinal(preDoc), post = byOrdinal(postDoc);
|
|
246
265
|
const moved = [];
|
|
247
266
|
for (const [ord, a] of pre) {
|
|
@@ -249,7 +268,7 @@ export function scopeDrift(rows, preDoc, postDoc) {
|
|
|
249
268
|
const b = post.get(ord);
|
|
250
269
|
if (!b || stateOf(a) !== stateOf(b)) moved.push(ord);
|
|
251
270
|
}
|
|
252
|
-
return { scoped: true, named: [...named], moved, unbound };
|
|
271
|
+
return { scoped: true, named: [...named], ...positions, moved, unbound };
|
|
253
272
|
}
|
|
254
273
|
|
|
255
274
|
// `sections`, optional: the flags whose target is a narrative section, as `{n, label, before, after}` with the
|
package/driver/coverage-form.mjs
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import { REGISTER_AXES, COVERAGE_STATUSES, normalizeAxis, CROWD_RULING_TOKEN,
|
|
32
32
|
CROWD_RULING_UNIT_GRAMMAR } from "./coverage-ledger.mjs";
|
|
33
33
|
import { shortId } from "./connotation-search.mjs";
|
|
34
|
-
import { openBlocksByAxis, crowdNarrowing, blocksByQidOf, isProviderHardErrorReason, refusedSearchSentence } from "./register-plan.mjs";
|
|
34
|
+
import { openBlocksByAxis, crowdNarrowing, blocksByQidOf, isProviderHardErrorReason, refusedSearchSentence, notSearchedSentence } from "./register-plan.mjs";
|
|
35
35
|
import { territoryLayerReport, unsearchedLayerReason } from "./binding-layers.mjs"; import { goodsTermsList } from "../providers/_shared/term-shape.mjs";
|
|
36
36
|
|
|
37
37
|
const STATUS_SET = new Set(COVERAGE_STATUSES);
|
|
@@ -979,8 +979,9 @@ export function renderCoverageLedgerSection(rows) {
|
|
|
979
979
|
Number.isInteger(r.total_hits) ? `${r.total_hits} hits` : "",
|
|
980
980
|
r.unaccounted_classes?.length ? `classes unaccounted: ${r.unaccounted_classes.join(", ")}` : "",
|
|
981
981
|
r.unaccounted_terms?.length ? `terms unaccounted: ${r.unaccounted_terms.join(", ")}` : "",
|
|
982
|
-
// A search
|
|
983
|
-
|
|
982
|
+
// A search left undone reads as the owner's sentence for its kind, not as its recorded line; a line of no known
|
|
983
|
+
// kind stands as recorded.
|
|
984
|
+
r.receipt_reason ? `receipt: ${refusedSearchSentence(r.receipt_reason) ?? notSearchedSentence(r.receipt_reason) ?? r.receipt_reason}` : "",
|
|
984
985
|
].filter(Boolean).join("; ");
|
|
985
986
|
const reason = [cell(r.reason), detail ? `(${cell(detail)})` : ""].filter(Boolean).join(" ");
|
|
986
987
|
return `| ${cell(r.unit)} | ${cell(String(r.status).trim().toLowerCase())} | ${reason} | ${cell(r.qid ?? "—")} |`;
|
|
@@ -220,7 +220,10 @@ export function deriveCoverageStatus(rows, { excludeAxes = NON_MATERIAL_AXES } =
|
|
|
220
220
|
// close it. register-plan.mjs's unsupportedPredicateReason / uncoveredJurisdictionReason emit exactly
|
|
221
221
|
// these two phrasings, and the per-provider relabel tests pin them. Deliberately narrow: both require
|
|
222
222
|
// the literal "register provider" tail, so ordinary saturation prose cannot trip them.
|
|
223
|
-
|
|
223
|
+
// The lawyer's ledger prints the owner's sentence for a search left undone in place of its recorded line
|
|
224
|
+
// (register-plan.mjs NOT_SEARCHED_SENTENCES), so a ledger read back from its rendered table holds the sentence. The
|
|
225
|
+
// sentence says the search was set aside and is disclosed, never a limit accepted as covered, so it reads as deferred.
|
|
226
|
+
const TOOL_ABSENCE_RE = /It was set aside and is disclosed here\.|not (?:supported|covered) by (?:the )?(?:active )?register provider|tool[- ](?:absent|unavailable|missing|access)|no (?:such )?tool\b|not on the allowlist|tool not (?:available|configured|enabled|present)|provider (?:unavailable|down|error|not configured|absent|failure)|no (?:register )?provider\b|fetch (?:failed|blocked|error|unavailable)|(?:could not|cannot|couldn't|unable to) (?:reach|fetch|access|retrieve|query|call|invoke) (?:the )?(?:provider|data|register|endpoint|api|source|tool|record|mcp)|mcp (?:tool )?(?:unavailable|error|missing|absent|failed)|endpoint (?:unavailable|unreachable|down|failed)|connection (?:failed|refused|error|timed out)|api (?:error|unavailable|down|failure)/i;
|
|
224
227
|
export function coerceToolAbsenceDeferred(rows) {
|
|
225
228
|
return (rows ?? []).map((r) =>
|
|
226
229
|
(r && r.status === "coverage-limited" && TOOL_ABSENCE_RE.test(String(r.reason ?? "")))
|
|
@@ -257,7 +260,8 @@ export function coerceToolAbsenceDeferred(rows) {
|
|
|
257
260
|
// registerGap clamp stays armed) — it is simply never closed by the clock. Closing it needs a DIFFERENT
|
|
258
261
|
// question (the owner×term slices its covered_by names, or the register's own styling from a human),
|
|
259
262
|
// which is precisely what "held" means here. PURE.
|
|
260
|
-
|
|
263
|
+
// As for TOOL_ABSENCE_RE above: the owner's sentences for the kinds whose recorded lines state a capability gap.
|
|
264
|
+
const CAPABILITY_GAP_REASON_RE = /files marks in other alphabets under a Latin spelling|this register does not offer this kind of search|the register did not recognise this owner's name|which this register treats as a search command|longer than this register can search as one phrase|asked for too many names at once|this register cannot run this search|capability-gap:|not supported by (?:the )?(?:active )?register provider|not covered by (?:the )?(?:active )?register provider|owner.{0,3}term intersection is not supported|indexes non-latin filings by their transliteration|provider capability absent|has no owner surface|owner vocabulary returned no applicant styling/i;
|
|
261
265
|
|
|
262
266
|
/** Does this reason state a deterministic capability gap (nothing a re-run can change)? PURE. */
|
|
263
267
|
export const isCapabilityGapReason = (reason) => CAPABILITY_GAP_REASON_RE.test(String(reason ?? ""));
|
|
@@ -42,6 +42,29 @@ const uriSet = (xs) => {
|
|
|
42
42
|
return out;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
/** Every record a spec row stands for: its own, and for an entry's row every record of the entry. PURE. */
|
|
46
|
+
export const positionRecords = (row) => {
|
|
47
|
+
const uri = normalizeRecordUri(row?.uri ?? row?.record_id);
|
|
48
|
+
const members = uriSet(Array.isArray(row?.uris) && row.uris.length ? row.uris : [uri]);
|
|
49
|
+
if (uri) members.add(uri);
|
|
50
|
+
return members;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Every record of a position a delivered finding ends: each record the findings name, and every record of a row one of
|
|
55
|
+
* them belongs to. The reading the duty below and the synthesis seam make, so a reader that sets these records' declinations
|
|
56
|
+
* aside drops exactly the positions the run's trace reads as delivered. PURE.
|
|
57
|
+
*/
|
|
58
|
+
export function recordsOfDeliveredPositions(rows, deliveredUris) {
|
|
59
|
+
const delivered = uriSet(deliveredUris);
|
|
60
|
+
const out = new Set(delivered);
|
|
61
|
+
for (const row of Array.isArray(rows) ? rows : []) {
|
|
62
|
+
const members = positionRecords(row);
|
|
63
|
+
if ([...members].some((u) => delivered.has(u))) for (const u of members) out.add(u);
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
|
|
45
68
|
/**
|
|
46
69
|
* Reconcile what synthesis was handed against what it did with each record.
|
|
47
70
|
*
|
|
@@ -84,8 +107,7 @@ export function reconcileDeclinationDuty({ owed = null, deliveredUris = null, de
|
|
|
84
107
|
seen.add(uri);
|
|
85
108
|
// AN ENTRY'S ROW STANDS FOR ALL ITS RECORDS: a finding naming any of them delivers the entry, and the row's
|
|
86
109
|
// declination declines it. The duty is the entry's; the reader is still told how many records it holds.
|
|
87
|
-
const members =
|
|
88
|
-
members.add(uri);
|
|
110
|
+
const members = positionRecords(row);
|
|
89
111
|
const isDelivered = [...members].some((u) => delivered.has(u));
|
|
90
112
|
const isDeclined = [...members].some((u) => declined.has(u));
|
|
91
113
|
recordsOwed += members.size;
|
|
@@ -20,6 +20,7 @@ import { join, basename } from "node:path";
|
|
|
20
20
|
import { driverDir, ensureDriverDir } from "../shared/driver-dir.mjs"; // — one definition of where `_driver/` is
|
|
21
21
|
import { acceptDeclinationCall, MAX_DECLINATIONS_PER_CALL, PAGE_KEY_PREFIX } from "./declination-call.mjs";
|
|
22
22
|
import { normalizeRecordUri } from "./registry-fidelity.mjs";
|
|
23
|
+
import { citedFindingNumbers } from "./finding-citations.mjs"; // the findings a ground cites, recorded with it
|
|
23
24
|
import { idSetHash, priorCallWithIdSet, listGeneration } from "./call-repeat.mjs"; //
|
|
24
25
|
import { PARK_AFTER_REFUSALS, parkedIds, refusalCountsBy } from "./refusal-bound.mjs"; //
|
|
25
26
|
|
|
@@ -104,10 +105,18 @@ export function declinationKey(k) {
|
|
|
104
105
|
return s.startsWith(PAGE_KEY_PREFIX) ? s : normalizeRecordUri(s);
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
/** The findings a ground cites by number, as the ledger keeps them: `{cites}`, or nothing when it cites none. PURE. */
|
|
109
|
+
export const groundCites = (grounds) => { const cites = citedFindingNumbers(grounds, { bare: false }); return cites.length ? { cites } : {}; };
|
|
110
|
+
|
|
107
111
|
/**
|
|
108
112
|
* Merge newly accepted rows into the ledger. LAST DECISION WINS per uri and the supersession is kept:
|
|
109
113
|
* a seat that re-states a declination after a refusal, or after a corrective, is doing the right thing,
|
|
110
114
|
* and losing the earlier row would hide that it happened. `supersedes` carries the previous decision.
|
|
115
|
+
*
|
|
116
|
+
* THE FINDINGS A GROUND CITES ARE RECORDED WITH IT (ruled 2026-10-30). A ground that says "carried as finding 9" rests
|
|
117
|
+
* on that finding, and nothing else in the ledger said so: a later review could not be told when finding 9 changed.
|
|
118
|
+
* `cites` holds the numbers the ground gives with the word "finding", in the writer's own numbering; it is left out
|
|
119
|
+
* where the ground cites none. Only the writer's own number is read, never a name.
|
|
111
120
|
*/
|
|
112
121
|
export function appendDeclinations(runDir, accepted, { now = () => new Date().toISOString() } = {}) {
|
|
113
122
|
const { ledger } = declinationCallPaths(runDir, 0);
|
|
@@ -122,7 +131,7 @@ export function appendDeclinations(runDir, accepted, { now = () => new Date().to
|
|
|
122
131
|
const was = byUri.get(u);
|
|
123
132
|
byUri.set(u, {
|
|
124
133
|
...(isPage ? { page: a.page, url: a.url ?? null } : { uri: u }),
|
|
125
|
-
mark: a.mark ?? null, owner: a.owner ?? null, reason: a.reason, grounds: a.grounds, recordedAt: now(),
|
|
134
|
+
mark: a.mark ?? null, owner: a.owner ?? null, reason: a.reason, grounds: a.grounds, ...groundCites(a.grounds), recordedAt: now(),
|
|
126
135
|
...(was ? { supersedes: { reason: was.reason, grounds: was.grounds, recordedAt: was.recordedAt } } : {}),
|
|
127
136
|
});
|
|
128
137
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
//
|
|
4
|
+
// derived-state.mjs — what a stage was handed of the register picture the driver derives, by content, so that a
|
|
5
|
+
// replay of the stage can tell whether it is being handed the same picture.
|
|
6
|
+
//
|
|
7
|
+
// THE DEFECT. Every `--experiment` arm runs the band-shape derivation again in its sandbox, from the run's files as
|
|
8
|
+
// they stand now. That is right for an arm that changes the derivation, as a seeded arm does. For an arm meant to
|
|
9
|
+
// reproduce a pass, the run's inputs may have grown since that pass was handed its shape, and the re-derived shape is
|
|
10
|
+
// then a later picture than the pass read: on a saved R2 run, the arm's set-aside block kept 2 of the pass's 5 group
|
|
11
|
+
// rows. Nothing said so. No run recorded which picture a stage was handed, so no replay could be checked against it.
|
|
12
|
+
//
|
|
13
|
+
// SO EACH DISPATCH RECORDS IT, on its `stage` row in run.jsonl: for every derivation in the stage's context
|
|
14
|
+
// (stage-context.mjs CONTEXT_DERIVATIONS), the files it wrote and the files it was derived from, each by content. A
|
|
15
|
+
// directory, such as the official records the band tools serve, is identified by its entries' names and sizes. An arm
|
|
16
|
+
// then keeps the run's own derived files where the run still holds exactly what the dispatch it reproduces was
|
|
17
|
+
// handed, and re-derives where it does not, or where it changes the derivation. Its receipt says which, and calls the
|
|
18
|
+
// replay faithful only where the picture is the dispatch's own. A run from before this record is never called
|
|
19
|
+
// faithful.
|
|
20
|
+
|
|
21
|
+
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
|
+
import { join, relative } from "node:path";
|
|
24
|
+
import { CONTEXT_DERIVATIONS, derivationsFor } from "./stage-context.mjs";
|
|
25
|
+
import { driverDir } from "../shared/driver-dir.mjs";
|
|
26
|
+
|
|
27
|
+
/** A file's identity by content, or a directory's by its entries' names and sizes, recursively. `sha` null when absent. */
|
|
28
|
+
function identityOf(path, runDir) {
|
|
29
|
+
const rel = relative(runDir, path) || path;
|
|
30
|
+
try {
|
|
31
|
+
const st = statSync(path);
|
|
32
|
+
const h = createHash("sha256");
|
|
33
|
+
if (st.isDirectory()) {
|
|
34
|
+
const walk = (dir) => {
|
|
35
|
+
for (const ent of readdirSync(dir, { withFileTypes: true }).sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))) {
|
|
36
|
+
const p = join(dir, ent.name);
|
|
37
|
+
if (ent.isDirectory()) { h.update(`d ${relative(path, p)}\n`); walk(p); }
|
|
38
|
+
else if (ent.isFile()) h.update(`f ${relative(path, p)} ${statSync(p).size}\n`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
walk(path);
|
|
42
|
+
} else h.update(readFileSync(path));
|
|
43
|
+
return { name: rel, sha: h.digest("hex").slice(0, 16) };
|
|
44
|
+
} catch { return { name: rel, sha: null }; }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* For each derivation in stage `name`'s context: its id, what it wrote and what it was derived from, by content.
|
|
49
|
+
* `opts` are the stage's context options (axes, axis, registerOnly). [] when the stage's context reaches no
|
|
50
|
+
* derivation. Never throws: a record that cannot be taken is an empty one, and an empty one is never faithful.
|
|
51
|
+
*/
|
|
52
|
+
export function derivedStateOf(name, P, opts = {}) {
|
|
53
|
+
try {
|
|
54
|
+
return derivationsFor(name, P, opts).map((id) => {
|
|
55
|
+
const d = CONTEXT_DERIVATIONS.find((x) => x.id === id);
|
|
56
|
+
return { id, writes: d.writes(P).map((p) => identityOf(p, P.runDir)), reads: d.reads(P).map((e) => identityOf(e.path, P.runDir)) };
|
|
57
|
+
});
|
|
58
|
+
} catch { return []; }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// A file absent at the dispatch and absent now is the same state; one that has appeared since is not.
|
|
62
|
+
const sameFiles = (a, b) => Array.isArray(a) && Array.isArray(b) && a.length === b.length
|
|
63
|
+
&& a.every((x, i) => x?.name === b[i]?.name && (x?.sha ?? null) === (b[i]?.sha ?? null));
|
|
64
|
+
|
|
65
|
+
/** The derived state recorded on the run's last dispatch of `label` with this trigger, or null when none was recorded. */
|
|
66
|
+
export function recordedDerivedState(runDir, label, trigger = "fresh") {
|
|
67
|
+
let rows = [];
|
|
68
|
+
try { rows = readFileSync(driverDir(runDir, "run.jsonl"), "utf8").split("\n"); } catch { return null; }
|
|
69
|
+
let found = null;
|
|
70
|
+
for (const line of rows) {
|
|
71
|
+
if (!line.includes('"derivedState"')) continue;
|
|
72
|
+
try {
|
|
73
|
+
const r = JSON.parse(line);
|
|
74
|
+
if (r?.event === "stage" && r.stage === label && (r.trigger ?? "fresh") === trigger && Array.isArray(r.derivedState)) found = r.derivedState;
|
|
75
|
+
} catch { /* a torn line is no record */ }
|
|
76
|
+
}
|
|
77
|
+
return found;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* How a replay is handed one derivation's output, and whether that is the picture the dispatch it reproduces was
|
|
82
|
+
* handed. `recorded` is that dispatch's record, `current` the run's files now, `changesDerivation` an arm that changes
|
|
83
|
+
* the derivation (a seed). PURE.
|
|
84
|
+
* - kept, faithful: the arm changes nothing upstream and the run still holds exactly what the dispatch was handed;
|
|
85
|
+
* - re-derived, faithful: the arm changes the derivation, from the inputs the dispatch's own was derived from;
|
|
86
|
+
* - re-derived, not faithful: anything else, and why.
|
|
87
|
+
* A projection the dispatch took (`projection` in CONTEXT_DERIVATIONS) is always the run's copy, as the rig has always
|
|
88
|
+
* handed it; it is faithful when that copy is the one the dispatch wrote.
|
|
89
|
+
*/
|
|
90
|
+
export function replayOfDerivation(id, recorded, current, { changesDerivation = false } = {}) {
|
|
91
|
+
const rec = (recorded ?? []).find((d) => d?.id === id) ?? null;
|
|
92
|
+
const cur = (current ?? []).find((d) => d?.id === id) ?? null;
|
|
93
|
+
if (!rec) return { id, how: "re-derived", faithful: false, why: "the run recorded no picture for the dispatch this arm reproduces" };
|
|
94
|
+
const readsSame = Boolean(cur) && sameFiles(rec.reads, cur.reads);
|
|
95
|
+
const writesSame = Boolean(cur) && sameFiles(rec.writes, cur.writes);
|
|
96
|
+
// A projection the dispatch took is its own picture whatever it was read from since.
|
|
97
|
+
if (CONTEXT_DERIVATIONS.find((d) => d.id === id)?.projection === true)
|
|
98
|
+
return writesSame ? { id, how: "kept", faithful: true, why: null }
|
|
99
|
+
: { id, how: "kept", faithful: false, why: "the run's copy was written after the dispatch this arm reproduces" };
|
|
100
|
+
if (!changesDerivation && readsSame && writesSame) return { id, how: "kept", faithful: true, why: null };
|
|
101
|
+
if (changesDerivation && readsSame) return { id, how: "re-derived", faithful: true, why: null };
|
|
102
|
+
return { id, how: "re-derived", faithful: false, why: "the run's files have changed since the dispatch this arm reproduces" };
|
|
103
|
+
}
|
|
104
|
+
|
|
@@ -183,8 +183,8 @@ Stages must name **abstract tiers**, not provider aliases. Per-engine maps:
|
|
|
183
183
|
|
|
184
184
|
| tier | role (stage examples) | anthropic-agent (claude alias) | openai-agent (codex `-m`) |
|
|
185
185
|
|---|---|---|---|
|
|
186
|
-
| `judgment` | matter-frame, register-digest, synthesis, narrative-refutation | `opus` | `$CLEAROTRON_OPENAI_MODEL_JUDGMENT` |
|
|
187
|
-
| `sweep` | register-unit
|
|
186
|
+
| `judgment` | matter-frame, register-digest, synthesis, narrative-refutation, register-unit on `primary-sweep` | `opus` | `$CLEAROTRON_OPENAI_MODEL_JUDGMENT` |
|
|
187
|
+
| `sweep` | register-unit on `transliteration-numeric` and `incumbent-class`, case-law, skeptic, report-overview, report-card | `sonnet` | `$CLEAROTRON_OPENAI_MODEL_SWEEP` |
|
|
188
188
|
| `cheap` | saturation-probe | `haiku` | `$CLEAROTRON_OPENAI_MODEL_CHEAP` |
|
|
189
189
|
|
|
190
190
|
**AN UNHONOURED OVERRIDE IS AN ERROR, NOT A SUBSTITUTION** (2026-08-03). This
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
//
|
|
4
|
+
// THE POSITIONS A CORRECTION HANDS ITS SAVE: the excluded positions its review flags name, for which the writer's save
|
|
5
|
+
// may add a finding (synthesis-record.mjs, `correctionPositions`). The driver writes them into the tool servers' env
|
|
6
|
+
// for that correction's dispatch (gather-config.mjs), and the save tool's server reads them there, never from the
|
|
7
|
+
// payload (recording-server.mjs). Their own module, so a server reading them imports nothing else.
|
|
8
|
+
|
|
9
|
+
/** Where a correction's positions reach the save tool's server. */
|
|
10
|
+
export const CORRECTION_POSITIONS_ENV = "CLEAROTRON_CORRECTION_POSITIONS";
|
|
11
|
+
|
|
12
|
+
/** The positions a server was handed, or null where it was handed none it can read: no correction's dispatch. PURE. */
|
|
13
|
+
export function correctionPositionsFrom(env = process.env) {
|
|
14
|
+
if (!env) return null;
|
|
15
|
+
let v;
|
|
16
|
+
try { v = JSON.parse(String(env.CLEAROTRON_CORRECTION_POSITIONS ?? "")); } catch { return null; }
|
|
17
|
+
return Array.isArray(v) && v.length && v.every((u) => typeof u === "string") ? v : null;
|
|
18
|
+
}
|