clearotron 0.7.0-beta.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/build-info.json +2 -2
- package/docs/architecture/04-configuration-reference.md +105 -8
- package/driver/CHANGELOG.md +38 -0
- package/driver/cancel.mjs +19 -0
- package/driver/contract-e3-backlog.mjs +40 -40
- package/driver/contract-vocabulary.mjs +1 -1
- package/driver/driver.config.mjs +1 -2
- 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 +10 -2
- package/driver/jx-units.mjs +3 -1
- package/driver/manuals-inline.mjs +98 -0
- package/driver/manuals-seen.mjs +4 -16
- package/driver/mark-logos.mjs +31 -1
- package/driver/owner-use-check.mjs +5 -1
- package/driver/package.json +1 -1
- package/driver/pipeline-knockout.mjs +19 -4
- package/driver/pipeline.mjs +36 -8
- package/driver/portal-report.mjs +2 -2
- package/driver/portal-runs.mjs +13 -7
- package/driver/predelivery-lint.mjs +7 -5
- package/driver/publish/email-conditions.mjs +20 -3
- package/driver/publish/index.mjs +218 -139
- package/driver/publish/knockout.mjs +252 -228
- package/driver/publish/pool-admin.mjs +2 -2
- package/driver/publish/regions.mjs +4 -0
- package/driver/publish/register-record-html.mjs +105 -0
- package/driver/publish/register-record.mjs +26 -11
- package/driver/publish/render-knockout.mjs +108 -33
- package/driver/publish/render.mjs +311 -149
- package/driver/publish/report-data.mjs +1 -1
- 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 +152 -4
- package/driver/publish/templates/clearance-print.css +23 -0
- package/driver/publish/templates/knockout.css +24 -0
- package/driver/publish/templates/report.css +40 -1
- package/driver/publish/xlsx.mjs +16 -20
- package/driver/register-count.mjs +5 -1
- package/driver/registry-fidelity.mjs +152 -29
- package/driver/repair-composers.mjs +2 -2
- package/driver/replay-archive.mjs +4 -3
- package/driver/run-delivered.mjs +8 -7
- package/driver/run-record.mjs +1 -0
- 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 +66 -40
- package/driver/steps/delivery.mjs +9 -5
- package/driver/steps/overview-and-cards.mjs +4 -1
- package/driver/steps/register-sweep.mjs +5 -4
- package/driver/steps/skeptic-and-follow-up.mjs +3 -2
- package/driver/steps/verdict-gate.mjs +2 -1
- package/driver/suite-census.json +224 -32
- package/driver/synthesis-record.mjs +4 -3
- package/driver/withdrawn-rating.mjs +72 -0
- package/mcp-server/CHANGELOG.md +4 -0
- package/mcp-server/lib/brief.mjs +4 -1
- package/mcp-server/lib/evidence.mjs +66 -22
- package/mcp-server/lib/findings.mjs +19 -2
- package/mcp-server/lib/knockout.mjs +12 -3
- package/mcp-server/package.json +1 -1
- package/mcp-server/server.mjs +19 -2
- package/package.json +1 -1
- package/portal-ui/dist/assets/{index-CtkllKJ2.js → index-BBlN4CYq.js} +13 -3
- package/portal-ui/dist/index.html +1 -1
- package/portal-ui/package.json +1 -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 +4 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/scripts/added-reference-check.mjs +35 -7
- package/scripts/e2e-first-time.mjs +1 -1
- package/scripts/env-audit.mjs +16 -9
- package/scripts/mint-public-residue.mjs +3 -3
- package/shared/brand.mjs +8 -1
- package/shared/names-in-force.mjs +0 -1
- package/shared/reference-guard-classes.mjs +43 -2
- package/shared/source-spans.mjs +91 -0
|
@@ -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:963 (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",
|
|
@@ -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:2147 (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:2112",
|
|
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:4136 (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:2319",
|
|
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",
|
|
@@ -341,7 +341,7 @@ export const E3_BACKLOG = [
|
|
|
341
341
|
// (coverage-form.mjs coverageFormBrief) and the tool schema, with every row receiver-validated at
|
|
342
342
|
// call time. Same dictated vocabulary, same authored site, new route — this row's evidence follows
|
|
343
343
|
// the dictation so the row keeps describing something that exists.
|
|
344
|
-
where: "driver/stages.mjs:
|
|
344
|
+
where: "driver/stages.mjs:2530 (the digest message) + driver/coverage-form.mjs (coverageFormBrief — the dispatch block carrying the enum and the row shape)",
|
|
345
345
|
surface: "stage-message",
|
|
346
346
|
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",
|
|
347
347
|
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",
|
|
@@ -424,7 +424,7 @@ export const E3_BACKLOG = [
|
|
|
424
424
|
{
|
|
425
425
|
stage: "frame-diff",
|
|
426
426
|
kind: "exactly-these-keys",
|
|
427
|
-
where: "driver/stages.mjs:
|
|
427
|
+
where: "driver/stages.mjs:2698",
|
|
428
428
|
surface: "stage-message",
|
|
429
429
|
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).",
|
|
430
430
|
reparsedBy: "driver/verify.mjs validators.frameDiff + driver/pipeline.mjs runSupplementalSweeps (the parser REFUSES a firing variant directive that dictates nothing dispatchable)",
|
|
@@ -448,10 +448,10 @@ export const E3_BACKLOG = [
|
|
|
448
448
|
{
|
|
449
449
|
stage: "synthesis",
|
|
450
450
|
kind: "literal-json-skeleton",
|
|
451
|
-
where: "driver/stages.mjs:
|
|
451
|
+
where: "driver/stages.mjs:3082",
|
|
452
452
|
surface: "stage-message",
|
|
453
453
|
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",
|
|
454
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
454
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson via validators.narrative",
|
|
455
455
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
456
456
|
},
|
|
457
457
|
// RETIRED 2026-08-16 — synthesis's dictated disposition list, and I am the one who left it standing.
|
|
@@ -462,7 +462,7 @@ export const E3_BACKLOG = [
|
|
|
462
462
|
{
|
|
463
463
|
stage: "synthesis",
|
|
464
464
|
kind: "exactly-these-keys",
|
|
465
|
-
where: "driver/stages.mjs:
|
|
465
|
+
where: "driver/stages.mjs:3115",
|
|
466
466
|
surface: "stage-message",
|
|
467
467
|
evidence: "- off_field_ground (MANDATORY on every off-field finding, FORBIDDEN on every other disposition): EXACTLY one bare token of: ${OFF_FIELD_GROUNDS.join(\" / \")}",
|
|
468
468
|
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",
|
|
@@ -471,52 +471,52 @@ export const E3_BACKLOG = [
|
|
|
471
471
|
{
|
|
472
472
|
stage: "synthesis",
|
|
473
473
|
kind: "literal-json-skeleton",
|
|
474
|
-
where: "driver/stages.mjs:
|
|
474
|
+
where: "driver/stages.mjs:3116",
|
|
475
475
|
surface: "stage-message",
|
|
476
476
|
evidence: "- manageable …: {\"category\":\"<EXACTLY one of large-competitor / commercial-partner / troll / well-known-enforcer>\",\"reason\":\"<one-two lines…>\"}",
|
|
477
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
477
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson",
|
|
478
478
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
481
|
stage: "synthesis",
|
|
482
482
|
kind: "literal-json-skeleton",
|
|
483
|
-
where: "driver/stages.mjs:
|
|
483
|
+
where: "driver/stages.mjs:3144",
|
|
484
484
|
surface: "stage-message",
|
|
485
485
|
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",
|
|
486
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
486
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson; driver/verify.mjs:1192 checkFindingsSibling gates meters.*.source; finding_basis_source_missing",
|
|
487
487
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
488
488
|
},
|
|
489
489
|
{
|
|
490
490
|
stage: "synthesis",
|
|
491
491
|
kind: "literal-json-skeleton",
|
|
492
|
-
where: "driver/stages.mjs:
|
|
492
|
+
where: "driver/stages.mjs:3144",
|
|
493
493
|
surface: "stage-message",
|
|
494
494
|
evidence: "- quadrant: {\"x\",\"y\"} numbers in [0,1]. x = goods/services proximity (0 = distant, 1 = identical). y = mark similarity (0 = distinct, 1 = identical).",
|
|
495
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
495
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson",
|
|
496
496
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
497
497
|
},
|
|
498
498
|
{
|
|
499
499
|
stage: "synthesis",
|
|
500
500
|
kind: "literal-json-skeleton",
|
|
501
|
-
where: "driver/stages.mjs:
|
|
501
|
+
where: "driver/stages.mjs:3134",
|
|
502
502
|
surface: "stage-message",
|
|
503
503
|
evidence: "- source: {\"source_type\",\"resolved_link\"}. source_type EXACTLY one of: register-vendor / register-euipo / common-law-marketplace / common-law-web / case-law",
|
|
504
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
504
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson",
|
|
505
505
|
removedByMove: "M1 removes the opaque `resolved_link` URI (ordinal / record-handle selection); the object shape and the source_type enum survive",
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
stage: "synthesis",
|
|
509
509
|
kind: "exactly-these-keys",
|
|
510
|
-
where: "driver/stages.mjs:
|
|
510
|
+
where: "driver/stages.mjs:3135",
|
|
511
511
|
surface: "stage-message",
|
|
512
512
|
evidence: "coverage[]: ONE object per coverage AREA, EXACTLY {\"area\",\"state\",\"note\"}. … state EXACTLY one of: confirmed-clean / coverage-limited / open / not-searched / note.",
|
|
513
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
513
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson; the render owns the coverage panel from these typed states",
|
|
514
514
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
515
515
|
},
|
|
516
516
|
{
|
|
517
517
|
stage: "synthesis",
|
|
518
518
|
kind: "literal-json-skeleton",
|
|
519
|
-
where: "driver/stages.mjs:
|
|
519
|
+
where: "driver/stages.mjs:3144",
|
|
520
520
|
surface: "stage-message",
|
|
521
521
|
evidence: "use_check = {\"source\",\"quality\",\"question\"}: … quality: OPTIONAL, EXACTLY one of owner-site / independent / register-mirror … own_rights = {\"source\"}",
|
|
522
522
|
reparsedBy: "driver/verify.mjs checkFindingsSibling (finding_use_check_missing, finding_own_rights_source_missing)",
|
|
@@ -525,43 +525,43 @@ export const E3_BACKLOG = [
|
|
|
525
525
|
{
|
|
526
526
|
stage: "synthesis",
|
|
527
527
|
kind: "literal-json-skeleton",
|
|
528
|
-
where: "driver/stages.mjs:
|
|
528
|
+
where: "driver/stages.mjs:3201",
|
|
529
529
|
surface: "stage-message",
|
|
530
530
|
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>",
|
|
531
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
531
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson; the report collapses the rows behind toggles and the audit workbook renders them",
|
|
532
532
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
533
533
|
},
|
|
534
534
|
{
|
|
535
535
|
stage: "synthesis",
|
|
536
536
|
kind: "literal-json-skeleton",
|
|
537
|
-
where: "driver/stages.mjs:
|
|
537
|
+
where: "driver/stages.mjs:3207",
|
|
538
538
|
surface: "stage-message",
|
|
539
539
|
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",
|
|
540
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
540
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson",
|
|
541
541
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
542
542
|
},
|
|
543
543
|
{
|
|
544
544
|
stage: "synthesis",
|
|
545
545
|
kind: "literal-json-skeleton",
|
|
546
|
-
where: "driver/stages.mjs:
|
|
546
|
+
where: "driver/stages.mjs:3201",
|
|
547
547
|
surface: "stage-message",
|
|
548
548
|
evidence: "ACTIONS REGISTER …: emit \"actions\": [...] — ONE object per forward step …, each EXACTLY {\"id\",\"kind\",\"text\",\"ordinals\"} plus an OPTIONAL \"deadline\" and an OPTIONAL \"condition\". … kind: EXACTLY one of — consent / coexistence-agreement / territorial-delimitation / goods-amendment / mark-modification /",
|
|
549
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
549
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson; pipeline applyCoverageFloor legalActions arm derives the delivered disposition from the closed kind enum",
|
|
550
550
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
551
551
|
},
|
|
552
552
|
{
|
|
553
553
|
stage: "synthesis",
|
|
554
554
|
kind: "exactly-these-keys",
|
|
555
|
-
where: "driver/stages.mjs:
|
|
555
|
+
where: "driver/stages.mjs:3214",
|
|
556
556
|
surface: "stage-message",
|
|
557
557
|
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.",
|
|
558
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
558
|
+
reparsedBy: "driver/findings-model.mjs:855 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",
|
|
559
559
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
562
|
stage: "synthesis",
|
|
563
563
|
kind: "literal-json-skeleton",
|
|
564
|
-
where: "driver/stages.mjs:
|
|
564
|
+
where: "driver/stages.mjs:3060",
|
|
565
565
|
surface: "stage-message",
|
|
566
566
|
// RE-QUOTED, NOT PARKED. The writer's conversion reworded this dictation — the
|
|
567
567
|
// ask answers ride the findings RECORD now and the driver renders the labelled line into both the
|
|
@@ -570,7 +570,7 @@ export const E3_BACKLOG = [
|
|
|
570
570
|
// in E3_EVIDENCE_UNRESOLVED instead would have grown the not-checked slice for a row that is
|
|
571
571
|
// perfectly checkable, which is the avoidable coverage loss conversion 9's note names one row up.
|
|
572
572
|
evidence: "SEND ONE \"ask_answers\" ENTRY PER ASK, as a TOP-LEVEL field of the findings record you hand to the call (never as a narrative section — the driver renders the labelled line",
|
|
573
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
573
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson (finding_ask_answer_answer_missing); assembleReportMd · buildAskAnswersSection joins on the retyped ask string",
|
|
574
574
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
575
575
|
},
|
|
576
576
|
// DELETED at conversion 10, recorded rather than absorbed — E3's own rule for a
|
|
@@ -585,25 +585,25 @@ export const E3_BACKLOG = [
|
|
|
585
585
|
{
|
|
586
586
|
stage: "synthesis",
|
|
587
587
|
kind: "exactly-these-keys",
|
|
588
|
-
where: "driver/stages.mjs:
|
|
588
|
+
where: "driver/stages.mjs:3193",
|
|
589
589
|
surface: "stage-message",
|
|
590
590
|
evidence: "add it to the top-level \"context_notes\" array — each object EXACTLY {\"type\":\"famous-neighbour-ungrounded\",\"mark\",\"owner\",\"context\"}",
|
|
591
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
591
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson",
|
|
592
592
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
595
|
stage: "synthesis",
|
|
596
596
|
kind: "literal-json-skeleton",
|
|
597
|
-
where: "driver/stages.mjs:
|
|
597
|
+
where: "driver/stages.mjs:3084",
|
|
598
598
|
surface: "stage-message",
|
|
599
599
|
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",
|
|
600
|
-
reparsedBy: "driver/findings-model.mjs:
|
|
600
|
+
reparsedBy: "driver/findings-model.mjs:855 parseFindingsJson + the record-binding join. Six of the seven keys are stated in the prompt and overwritten by code in the same sentence",
|
|
601
601
|
removedByMove: "M1 removes the opaque `uri` (ordinal / record-handle selection against the band); the object skeleton and the five overwritten keys survive",
|
|
602
602
|
},
|
|
603
603
|
{
|
|
604
604
|
stage: "case-law",
|
|
605
605
|
kind: "literal-json-skeleton",
|
|
606
|
-
where: "driver/stages.mjs:
|
|
606
|
+
where: "driver/stages.mjs:3371",
|
|
607
607
|
surface: "stage-message",
|
|
608
608
|
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\":\"…\"",
|
|
609
609
|
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)",
|
|
@@ -612,10 +612,10 @@ export const E3_BACKLOG = [
|
|
|
612
612
|
{
|
|
613
613
|
stage: "case-law",
|
|
614
614
|
kind: "dictated-line-shape",
|
|
615
|
-
where: "driver/stages.mjs:
|
|
615
|
+
where: "driver/stages.mjs:3379",
|
|
616
616
|
surface: "stage-message",
|
|
617
617
|
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)",
|
|
618
|
-
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:
|
|
618
|
+
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:280 /^-\\s*ord:\\s*(\\d+)\\s*$/m; driver/publish/index.mjs publishReport (joinCaseLawProfiles)",
|
|
619
619
|
removedByMove: "NOTHING ON THE #850 PLAN REMOVES THIS",
|
|
620
620
|
},
|
|
621
621
|
{
|
|
@@ -646,7 +646,7 @@ export const E3_BACKLOG = [
|
|
|
646
646
|
{
|
|
647
647
|
stage: "narrative-refutation",
|
|
648
648
|
kind: "dictated-line-shape",
|
|
649
|
-
where: "driver/stages.mjs:
|
|
649
|
+
where: "driver/stages.mjs:4720",
|
|
650
650
|
surface: "stage-message",
|
|
651
651
|
// RE-QUOTED BY CONVERSION 9. The LINE-TOKEN half is gone — no "anywhere on the line", no "[kind: …]
|
|
652
652
|
// token", no "a line with no token is treated as fact", because a kind is a typed field now and an
|
|
@@ -746,7 +746,7 @@ export const E3_BACKLOG = [
|
|
|
746
746
|
{
|
|
747
747
|
stage: "report-card",
|
|
748
748
|
kind: "literal-json-skeleton",
|
|
749
|
-
where: "driver/stages.mjs:
|
|
749
|
+
where: "driver/stages.mjs:3871",
|
|
750
750
|
surface: "stage-message",
|
|
751
751
|
evidence: "The finding's OWN record — the ONLY source for this card …:\\n```json\\n<JSON.stringify(finding, null, 2)>\\n```",
|
|
752
752
|
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",
|
|
@@ -425,7 +425,7 @@ export const TRIPWIRE_OUT_OF_SCOPE = [
|
|
|
425
425
|
},
|
|
426
426
|
{
|
|
427
427
|
prefix: "knockout_",
|
|
428
|
-
site: "driver/findings-model.mjs:
|
|
428
|
+
site: "driver/findings-model.mjs:2353 validateKnockoutFinding, for `knockout_finding_*` and `knockout_findings_*`",
|
|
429
429
|
reason: "The knockout lane's parser. knockout-frame and knockout-assess live in driver/stages-knockout.mjs, not in STAGES, so they carry no E1 declaration and are outside this partition. RECORDED AS A GAP: #850 audits both stages, and an E1 declaration for the knockout lane is not in this scaffolding.",
|
|
430
430
|
},
|
|
431
431
|
{
|
package/driver/driver.config.mjs
CHANGED
|
@@ -1093,8 +1093,7 @@ export const RESEARCH_PROVIDERS = {
|
|
|
1093
1093
|
|
|
1094
1094
|
// ── jx providers (Phase 2b, Stage-1.5 lanes) — the same lazy-import + cred-guard idiom. ONE
|
|
1095
1095
|
// non-agentic schema-enforced completions call per mark×lane turns the mark into native-script
|
|
1096
|
-
// register candidates; tests inject an executor, the dev instance uses CLEAROTRON_JX_FIXTURES.
|
|
1097
|
-
// CLEAROTRON_JX_MODEL — model override (default haiku — cheap structured task)
|
|
1096
|
+
// register candidates; tests inject an executor, the dev instance uses CLEAROTRON_JX_FIXTURES. Knob:
|
|
1098
1097
|
// CLEAROTRON_JX_FIXTURES — dir of <mark-kebab>.<lane>.json canned candidate lists
|
|
1099
1098
|
// ({candidates:[{term,kind,rationale}]}) — the $0 seam
|
|
1100
1099
|
//
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
// said in plain words that the session had expired. On a healthy ending that field is the model's answer
|
|
40
40
|
// and stays off the row.
|
|
41
41
|
|
|
42
|
-
import { mkdirSync, openSync, writeSync, closeSync, statfsSync } from "node:fs";
|
|
42
|
+
import { mkdirSync, openSync, writeSync, closeSync, readSync, statfsSync, existsSync, readFileSync, writeFileSync, unlinkSync, statSync } from "node:fs";
|
|
43
43
|
import { dirname } from "node:path";
|
|
44
|
+
import { gzipSync, gunzipSync } from "node:zlib";
|
|
44
45
|
|
|
45
46
|
/** The program's words for a classifier cut, as it writes them into the session. Matched, never quoted. */
|
|
46
47
|
export const CLASSIFIER_CUT_RE = /stopped by a safety classifier/i;
|
|
@@ -203,6 +204,32 @@ export function countTool(byName, name) {
|
|
|
203
204
|
// name it took, so every row names the bytes of its own session.
|
|
204
205
|
export const STREAM_FLOOR_BYTES = 5 * 1024 ** 3;
|
|
205
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Each line of a saved stream, as bytes, whether it was kept gzipped (a session that closed) or plain (one that never
|
|
209
|
+
* did). The one reader of the format, beside the one writer. A plain stream is read a megabyte at a time, so a long one is
|
|
210
|
+
* never held whole; a gzipped one is held whole once decompressed, at most the size the session wrote.
|
|
211
|
+
*/
|
|
212
|
+
export function* streamLines(file) {
|
|
213
|
+
if (String(file).endsWith(".gz")) {
|
|
214
|
+
const text = gunzipSync(readFileSync(file));
|
|
215
|
+
let at = 0;
|
|
216
|
+
for (let nl; (nl = text.indexOf(10, at)) >= 0; at = nl + 1) yield text.subarray(at, nl);
|
|
217
|
+
if (at < text.length) yield text.subarray(at);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const fd = openSync(file, "r");
|
|
221
|
+
try {
|
|
222
|
+
const chunk = Buffer.alloc(1 << 20);
|
|
223
|
+
let rest = Buffer.alloc(0);
|
|
224
|
+
for (let n; (n = readSync(fd, chunk, 0, chunk.length, null)) > 0;) {
|
|
225
|
+
let buf = Buffer.concat([rest, chunk.subarray(0, n)]), at;
|
|
226
|
+
while ((at = buf.indexOf(10)) >= 0) { yield buf.subarray(0, at); buf = buf.subarray(at + 1); }
|
|
227
|
+
rest = Buffer.from(buf);
|
|
228
|
+
}
|
|
229
|
+
if (rest.length) yield rest;
|
|
230
|
+
} finally { closeSync(fd); }
|
|
231
|
+
}
|
|
232
|
+
|
|
206
233
|
/** `<stem>.jsonl` for the first session under a name, `<stem>.session<n>.jsonl` for each later one. */
|
|
207
234
|
const nthStreamName = (file, n) => (n === 1 ? file : file.replace(/(\.jsonl)?$/, (ext) => `.session${n}${ext}`));
|
|
208
235
|
|
|
@@ -222,6 +249,9 @@ export function streamSink(file, { floorBytes = STREAM_FLOOR_BYTES, freeBytes =
|
|
|
222
249
|
// "wx" creates or refuses, in one step, so two sessions can never both take one name.
|
|
223
250
|
for (let n = 1; fd === null; n += 1) {
|
|
224
251
|
const name = nthStreamName(file, n);
|
|
252
|
+
// A closed session's stream is kept gzipped under `<name>.gz`, so the plain name is free again once it closes: a
|
|
253
|
+
// name is taken when either is there.
|
|
254
|
+
if (existsSync(`${name}.gz`)) continue;
|
|
225
255
|
try { fd = openSync(name, "wx", 0o600); file = name; }
|
|
226
256
|
catch (e) { if (e?.code !== "EEXIST" || n >= 999) throw e; }
|
|
227
257
|
}
|
|
@@ -235,7 +265,19 @@ export function streamSink(file, { floorBytes = STREAM_FLOOR_BYTES, freeBytes =
|
|
|
235
265
|
},
|
|
236
266
|
close() {
|
|
237
267
|
if (fd !== null) { try { closeSync(fd); } catch { /* the bytes are on disk or they are not; bytes says which */ } fd = null; }
|
|
238
|
-
|
|
268
|
+
if (reason) return { file, present: bytes > 0, bytes, reason };
|
|
269
|
+
// A SESSION THAT CLOSED IS KEPT GZIPPED. One long session wrote 28 to 41 MB as plain lines, and the archive keeps every
|
|
270
|
+
// run's streams. Compressed here, once the session has closed: a session that is killed never reaches this, so its
|
|
271
|
+
// stream stays plain and readable to its last line, which is the stream someone most wants to read. A compression that
|
|
272
|
+
// fails keeps the plain file and says so; it never fails the turn.
|
|
273
|
+
try {
|
|
274
|
+
const gz = `${file}.gz`;
|
|
275
|
+
writeFileSync(gz, gzipSync(readFileSync(file)), { mode: 0o600, flag: "wx" });
|
|
276
|
+
unlinkSync(file);
|
|
277
|
+
return { file: gz, present: true, bytes, storedBytes: statSync(gz).size };
|
|
278
|
+
} catch (e) {
|
|
279
|
+
return { file, present: true, bytes, notCompressed: String(e?.message ?? e).slice(0, 120) };
|
|
280
|
+
}
|
|
239
281
|
},
|
|
240
282
|
};
|
|
241
283
|
}
|
|
@@ -115,6 +115,12 @@ export const FINDINGS_SCHEMA_VERSION = 7;
|
|
|
115
115
|
// and re-saves, the file is re-validated, and the model would have to author a legal read for a card it
|
|
116
116
|
// is deleting. See issue comment 2026-08-03.
|
|
117
117
|
export const POSITION_REQUIRED_DISPOSITIONS = ["adversarial", "coexistence-partner", "distinguished", "off-field"];
|
|
118
|
+
// A WITHDRAWN RATING IS NOT A REJECTED FINDING. The review can withdraw a finding whose right still stands, because the
|
|
119
|
+
// rating it carried cannot be supported: its goods wording could not be used. `withdrawn` alone took that right off the
|
|
120
|
+
// page with the rejected ones. `rating_withdrawn_ground` says which case it is and why: present, the right stands
|
|
121
|
+
// unrated for that reason and the report lists it as left open; absent, the review rejected the finding, as before.
|
|
122
|
+
// Valid only beside `disposition: "withdrawn"`, so every card, total and summary keeps leaving it out.
|
|
123
|
+
export const RATING_WITHDRAWN_GROUNDS = ["goods-wording-unavailable"];
|
|
118
124
|
// requirement 2 — off-field's TWO sanctioned grounds, made to declare themselves.
|
|
119
125
|
//
|
|
120
126
|
// `off-field` had been carrying two different claims under one token: "the same token in a different
|
|
@@ -702,8 +708,9 @@ const FINDING_KEYS_V4 = ["ordinal", "mark", "owner", "band", "borderline_between
|
|
|
702
708
|
// this negative rests on (see OFF_FIELD_GROUNDS). Required on off-field, forbidden everywhere else — a
|
|
703
709
|
// field ground on a rated conflict is a mis-typed disposition, not extra colour.
|
|
704
710
|
const FINDING_KEYS_V6 = [...FINDING_KEYS_V4, "off_field_ground"];
|
|
705
|
-
// (v7) —
|
|
706
|
-
|
|
711
|
+
// (v7) — the change is to `net`'s permitted CONTENT, not the shape. One OPTIONAL key joined it later, back-compatible
|
|
712
|
+
// like `ruled_out` before it: `rating_withdrawn_ground` (see RATING_WITHDRAWN_GROUNDS). No archived document carries it.
|
|
713
|
+
const FINDING_KEYS_V7 = [...FINDING_KEYS_V6, "rating_withdrawn_ground"];
|
|
707
714
|
// which dispositions carry a band on v4: a rated conflict needs one; off-field IS the unrated
|
|
708
715
|
// commercial-awareness home ("a conflict the entity clearly wins with no material risk is not a rated
|
|
709
716
|
// conflict" — doc 50); withdrawn tolerates a stale band (forensic record, renders nowhere).
|
|
@@ -855,6 +862,7 @@ const onlyKeys = (obj, allowed, tokenFor) => {
|
|
|
855
862
|
* | finding_deadline_invalid:<ordinal> | finding_deadline_key_unknown:<key> | finding_deadline_date_missing:<ordinal>
|
|
856
863
|
* | findings_context_note_invalid | findings_context_note_key_unknown:<key> | findings_context_note_type_invalid:<v>
|
|
857
864
|
* | findings_net_chained:<ordinal> (v7 only — PLURAL on purpose; see validateNetShape)
|
|
865
|
+
* | finding_rating_withdrawn_ground_invalid:<v> | finding_rating_withdrawn_ground_orphan:<ordinal>
|
|
858
866
|
* (the composite>=3 NON-EMPTY-source gate for use_check/own_rights is raised by the caller in verify.mjs —
|
|
859
867
|
* this parser only enforces SHAPE: object / key-allowlist / source-is-a-string. Both fields are OPTIONAL.)
|
|
860
868
|
*
|
|
@@ -1415,6 +1423,10 @@ function validateFinding(f, idx, seenOrdinals, mode = { v4: false, manifest: nul
|
|
|
1415
1423
|
throw new Error(`finding_withdrawn_reason_missing:${ord} (a withdrawn finding must carry withdrawn_reason — the review flag that killed it)`);
|
|
1416
1424
|
if (f.withdrawn_reason != null && f.disposition !== "withdrawn")
|
|
1417
1425
|
throw new Error(`finding_withdrawn_reason_orphan:${ord} (withdrawn_reason is only valid when disposition is "withdrawn")`);
|
|
1426
|
+
if (f.rating_withdrawn_ground != null && !RATING_WITHDRAWN_GROUNDS.includes(f.rating_withdrawn_ground))
|
|
1427
|
+
throw new Error(`finding_rating_withdrawn_ground_invalid:${short(f.rating_withdrawn_ground)} (rating_withdrawn_ground, when present, must be one of: ${RATING_WITHDRAWN_GROUNDS.join(", ")})`);
|
|
1428
|
+
if (f.rating_withdrawn_ground != null && f.disposition !== "withdrawn")
|
|
1429
|
+
throw new Error(`finding_rating_withdrawn_ground_orphan:${ord} (rating_withdrawn_ground is only valid when disposition is "withdrawn")`);
|
|
1418
1430
|
|
|
1419
1431
|
validateOwner(f.owner, ord, mode?.recordOrigins ?? null, mode?.foreignLinks ?? null);
|
|
1420
1432
|
validateMeters(f.meters);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright 2026 Cordillera Sàrl. Additional terms under section 7 of the AGPL-3.0 apply — see ADDITIONAL-TERMS.md
|
|
3
|
+
// follow-up-twins.mjs — when a written coverage row with an axis label stands in for the driver's Follow-up row.
|
|
4
|
+
//
|
|
5
|
+
// "Left open" listed one unfinished search twice: once as the writer's row ("Register / …") and once as the row the
|
|
6
|
+
// driver composes for a deferred directive ("Follow-up / …"). An axis-labelled row was never allowed to stand in,
|
|
7
|
+
// because word containment alone had erased two genuinely different open searches on a delivered page. The rule
|
|
8
|
+
// now rests on the search the run RECORDED for the deferred directive (design, 2026-11-19): the frame receipt
|
|
9
|
+
// (`_driver/frame-reopen.json`) keeps, per directive, the plan questions minted for it, and each question's id names
|
|
10
|
+
// its search kind (`supp:primary-sweep:exact:…`).
|
|
11
|
+
//
|
|
12
|
+
// A WRITTEN ROW STANDS IN ONLY WHEN ALL OF THIS HOLDS, and the Follow-up stays otherwise:
|
|
13
|
+
// - the directive's recorded questions name exactly one kind of search; none recorded, as on every older run and
|
|
14
|
+
// on every common-law directive, or several kinds, keeps the Follow-up;
|
|
15
|
+
// - the written row is open, carries an axis label whose head is that kind's spelling (its own key, its reader
|
|
16
|
+
// label, and "register" for the main register search), and carries every significant word of the directive;
|
|
17
|
+
// - no other open row fits equally well.
|
|
18
|
+
// A completed row never stands in. The driver composing the rows, the lint reading the page and the page itself all
|
|
19
|
+
// ask this one function, so the three cannot disagree. The free-text arm each of them already has is unchanged.
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
21
|
+
import { AXIS_READER_LABEL } from "./coverage-ledger.mjs";
|
|
22
|
+
import { plainDirective } from "./deferral-row.mjs";
|
|
23
|
+
import { paths } from "./run-record.mjs";
|
|
24
|
+
|
|
25
|
+
const STOPWORDS = new Set(["the", "a", "an", "as", "for", "of", "in", "on", "and", "or", "to", "is",
|
|
26
|
+
"was", "it", "its", "this", "that", "with", "by", "at", "be", "been", "run", "search", "searched"]);
|
|
27
|
+
/** The significant words of a text, as the page's Follow-up test reads them. PURE. */
|
|
28
|
+
export const significantWords = (t) => new Set(String(t || "").toLowerCase().match(/[a-z0-9]+/g)?.filter((w) => !STOPWORDS.has(w)) ?? []);
|
|
29
|
+
|
|
30
|
+
const keyOf = (directive) => plainDirective(directive).toLowerCase().replace(/\s+/g, " ").trim();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The search kinds the run recorded for each deferred directive, keyed by the directive as a Follow-up row prints it
|
|
34
|
+
* (its plain form, lower case). A kind is a question id's second segment. A directive with no recorded question has
|
|
35
|
+
* no entry. PURE.
|
|
36
|
+
*/
|
|
37
|
+
export function followUpKinds(receipt) {
|
|
38
|
+
const out = new Map();
|
|
39
|
+
const qids = receipt?.directive_qids && typeof receipt.directive_qids === "object" ? receipt.directive_qids : {};
|
|
40
|
+
for (const d of Array.isArray(receipt?.deferrals) ? receipt.deferrals : []) {
|
|
41
|
+
const directive = typeof d?.directive === "string" ? d.directive : "";
|
|
42
|
+
const ids = Array.isArray(qids[directive]) ? qids[directive].filter((q) => typeof q === "string") : [];
|
|
43
|
+
const segments = ids.map((q) => q.split(":")[1]);
|
|
44
|
+
// Every recorded question must name its kind: one that does not leaves the record incomplete, and nothing folds.
|
|
45
|
+
if (directive && ids.length && segments.every(Boolean)) out.set(keyOf(directive), new Set(segments));
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The kinds recorded for the directive a Follow-up row prints, or null. The directive is its note's opening clause. PURE. */
|
|
51
|
+
export function kindsForFollowUp(row, kinds) {
|
|
52
|
+
if (!(kinds instanceof Map) || !kinds.size) return null;
|
|
53
|
+
return kinds.get(keyOf(String(row?.note ?? "").split("—")[0])) ?? null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const headOf = (area) => {
|
|
57
|
+
const a = String(area ?? "");
|
|
58
|
+
const cut = a.indexOf(" / ");
|
|
59
|
+
return cut < 0 ? null : a.slice(0, cut).trim().toLowerCase();
|
|
60
|
+
};
|
|
61
|
+
const spells = (head, kind) => head === kind || head === AXIS_READER_LABEL[kind] || (kind === "primary-sweep" && head === "register");
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The one written row that stands in for a Follow-up row whose directive is `directive` and whose recorded kinds are
|
|
65
|
+
* `kinds`, or null when none does. `written` is every row that is not a Follow-up row. PURE.
|
|
66
|
+
*/
|
|
67
|
+
export function axisTwin(directive, kinds, written) {
|
|
68
|
+
if (!(kinds instanceof Set) || kinds.size !== 1) return null;
|
|
69
|
+
const [kind] = kinds;
|
|
70
|
+
const want = significantWords(directive);
|
|
71
|
+
if (!want.size) return null;
|
|
72
|
+
const fits = (Array.isArray(written) ? written : []).filter((w) => {
|
|
73
|
+
if (!w || w.state === "confirmed-clean") return false;
|
|
74
|
+
const head = headOf(w.area);
|
|
75
|
+
if (!head || !spells(head, kind)) return false;
|
|
76
|
+
const theirs = significantWords(w.area);
|
|
77
|
+
return [...want].every((word) => theirs.has(word));
|
|
78
|
+
});
|
|
79
|
+
return fits.length === 1 ? fits[0] : null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The recorded kinds of a run's deferred directives, read from its frame receipt; empty when the run has none. IMPURE. */
|
|
83
|
+
export function followUpKindsOf(runDir) {
|
|
84
|
+
if (!runDir) return new Map();
|
|
85
|
+
try { return followUpKinds(JSON.parse(readFileSync(paths(runDir).frameReopenReceipt, "utf8"))); } catch { return new Map(); }
|
|
86
|
+
}
|
package/driver/gateway.mjs
CHANGED
|
@@ -262,6 +262,7 @@ import { progressQuantity } from "./repairs.mjs";
|
|
|
262
262
|
// SIBLING ARTIFACT rather than the fail string, because the fail string is cut at 160 chars.
|
|
263
263
|
import { undispatchableFiringDirectives } from "./frame-diff-model.mjs";
|
|
264
264
|
import { witnessStageMethodology, describeMethodologyDrift } from "./methodology-witness.mjs";
|
|
265
|
+
import { inlineManuals } from "./manuals-inline.mjs";
|
|
265
266
|
import { measureManualsSeen } from "./manuals-seen.mjs";
|
|
266
267
|
// — the meaning-sweep form and its accumulator. Both PURE and acyclic: connotation-search.mjs
|
|
267
268
|
// imports nothing, disposition-union.mjs imports only it, and neither reaches back here.
|
|
@@ -975,7 +976,11 @@ async function runStageLadder(name, opts, stageHome = null, engine = selectEngin
|
|
|
975
976
|
// written to disk before the comparison, so the thing being watched cannot reach it. See
|
|
976
977
|
// run-integrity.mjs for why it is not a manifest file and why the append-only journals are excluded.
|
|
977
978
|
const integrityBefore = frozenSnapshot(runDir);
|
|
978
|
-
|
|
979
|
+
// THE STAGE'S MANUALS RIDE A FRESH SESSION'S OPENING MESSAGE (manuals-inline.mjs), for both engines alike. A resumed session
|
|
980
|
+
// already holds them, and its message names none. The dispatch record and the witness above keep the composed text.
|
|
981
|
+
const wire = warm || timeoutWarm ? { text: effMessage, inlined: [], missing: [] }
|
|
982
|
+
: inlineManuals(effMessage, { resolve: engineResolveSkill, skillsDir: engineSkillsDir });
|
|
983
|
+
const turn = await engine.runTurn({ agent, sessionKey: key, message: wire.text, grantDispatch: base, model, thinking, timeoutSec: effTimeout, resumeRef: warm ? lastSessionRef : undefined, stageHome, mcpConfig, allowedTools: gatherAllowedTools, seatWrites: gatherSeatWrites, skillsDir: engineSkillsDir, skillsGrantRoots: engineSkillsGrantRoots, profilesDir: profilesStoreDir, resolveSkill: engineResolveSkill, runDir, stallSec,
|
|
979
984
|
progressFiles: files, // the no-progress watchdog's artifact-advance signal (anthropic-agent; other adapters ignore it)
|
|
980
985
|
// The raw stream of this session, beside its dispatch record (engine/session-record.mjs). The engines
|
|
981
986
|
// keep it while the disk has room and say on the tuple's `stream` what landed.
|
|
@@ -1525,6 +1530,9 @@ async function runStageLadder(name, opts, stageHome = null, engine = selectEngin
|
|
|
1525
1530
|
//: the spine carries the POINTER and the sha, not the text — enough to find the file and
|
|
1526
1531
|
// to tell two attempts apart without opening either.
|
|
1527
1532
|
dispatch: dispatch?.file ?? null, dispatchSha: dispatch?.sha ?? null,
|
|
1533
|
+
// The manuals this attempt's opening message carried, by name, size and sha, and any left to a read: what was sent
|
|
1534
|
+
// stays apart from what the session read with its tools afterwards.
|
|
1535
|
+
manualsInline: wire.inlined.length ? wire.inlined : undefined, manualsLeftToRead: wire.missing.length ? wire.missing : undefined,
|
|
1528
1536
|
//: the spine carries the convergence pair too — the ladder's shape (25 → 9 → 9 vs
|
|
1529
1537
|
// 29 → 11 → pass) is readable from run.jsonl alone, without joining the per-stage log.
|
|
1530
1538
|
quantity, noChange: noChange || undefined,
|
|
@@ -1868,7 +1876,7 @@ const REPAIR_HINTS = [
|
|
|
1868
1876
|
`${POSITION_REQUIRED_DISPOSITIONS.join(", ").replace(/, ([^,]+)$/, " AND $1")} alike (only a review-killed ${
|
|
1869
1877
|
DISPOSITIONS.filter((d) => !POSITION_REQUIRED_DISPOSITIONS.includes(d)).map((d) => `"${d}"`).join(" / ")
|
|
1870
1878
|
} finding is ` +
|
|
1871
|
-
`outside this, and it carries "withdrawn_reason" instead). An off-field finding additionally carries ` +
|
|
1879
|
+
`outside this, and it carries "withdrawn_reason" instead). If the right stands and only its rating is withdrawn, because its goods wording cannot be used, also set "rating_withdrawn_ground": "goods-wording-unavailable". An off-field finding additionally carries ` +
|
|
1872
1880
|
`"off_field_ground" = "different-field" (the goods do not meet — its own goods_proximity meter must then read ` +
|
|
1873
1881
|
`"low") or "no-material-risk" (a clear win, carrying no field claim). A mark argued apart on sound, rhythm, ` +
|
|
1874
1882
|
`orthography or connotation is "distinguished", never off-field. ` +
|
package/driver/jx-units.mjs
CHANGED
|
@@ -39,6 +39,7 @@ import { kebab } from "./search-policy.mjs";
|
|
|
39
39
|
import { SERP_PROVIDERS, JX_PROVIDERS } from "./driver.config.mjs";
|
|
40
40
|
import { findGridLedgerViolations, findPlatformIdentityViolations } from "./common-law-receipts.mjs";
|
|
41
41
|
import { paths, readJson } from "./run-record.mjs";
|
|
42
|
+
import { stopsWithTheRun } from "./cancel.mjs";
|
|
42
43
|
|
|
43
44
|
export const MAX_UNIT_ATTEMPTS = 3; // degraded-unit retries across resumes (repairable, never terminal)
|
|
44
45
|
export const SERP_TERM_CAP = 12; // terms per grid — 12 × 7 cells = 84 paid calls, the hard ceiling
|
|
@@ -287,7 +288,8 @@ export async function runJxSerpGrid(ctx, job, opts = {}, { runLog = () => {}, no
|
|
|
287
288
|
// wall-clock deadline on top of the per-call transport timeout: past it, remaining cells become
|
|
288
289
|
// honest "deadline exceeded" gaps (the floor logic then decides degraded-vs-done) — a stalled
|
|
289
290
|
// provider can never stall the paid run it shadows.
|
|
290
|
-
const { exec, source } = resolveSerpExecutor(opts, { mark: markName, lane });
|
|
291
|
+
const { exec: serpExec, source } = resolveSerpExecutor(opts, { mark: markName, lane });
|
|
292
|
+
const exec = stopsWithTheRun(run.runDir, `jx-serp-${lane}`, serpExec); // every paid call the code makes itself reads the stop first
|
|
291
293
|
const callsLedger = join(jxDir(run.runDir), "serp-calls.jsonl");
|
|
292
294
|
const sessionKey = `${runPrefix(run)}jx-serp-${lane}`;
|
|
293
295
|
const outPath = join(jxDir(run.runDir), spec.output ?? `${lane}-grid.json`); // legacy absolute output_path is ignored — always run-local
|