clearotron 0.5.0-beta.9 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -109,7 +109,8 @@ CLEAROTRON_TOOL_ANSWER_BYTES=
109
109
  # Runtime-injected — do NOT set this by hand. The driver sets it to 1 in the band tool server's env for the
110
110
  # placement step alone (driver/stages.mjs GROUP_READING_STAGES): that step is offered band_lookup's group
111
111
  # filter and reads the band shape with the orders written for it. Every other step is served both without
112
- # them. Set by hand, it would offer every step the group pages, and nothing in a run records that it did.
112
+ # them. Leave it empty: a stage's program starts with a listed environment that does not carry this name,
113
+ # so a value set here reaches no tool server.
113
114
  # effect: silent-output-change
114
115
  # CLEAROTRON_BAND_GROUPS=
115
116
 
package/INSTALL.md CHANGED
@@ -905,9 +905,10 @@ that proves the caller and passes the identity through. Which door runs and what
905
905
  once in [docs/SECURITY.md](docs/SECURITY.md); the procedure for standing the second one up, with a
906
906
  worked example, is [docs/PORTAL.md](docs/PORTAL.md#putting-your-own-login-provider-in-front).
907
907
 
908
- **Leaving `PORTAL_AUTH_MODE` unset selects auth-proxy, not local.** An install that sets nothing and has
909
- no proxy in front is the one shape to avoid — the portal refuses to start without an issuer. Say
910
- `PORTAL_AUTH_MODE=local` if you want the passphrase door.
908
+ **`clearotron start` always runs the local door,** and refuses to start if `PORTAL_AUTH_MODE` names
909
+ another one. Where you run the portal service yourself, without `clearotron start`, an unset
910
+ `PORTAL_AUTH_MODE` selects auth-proxy, and the portal refuses to start without an issuer. Set
911
+ `PORTAL_AUTH_MODE=local` there if you want the local door.
911
912
 
912
913
  ### It drains its own queue
913
914
 
package/QUICKSTART.md ADDED
@@ -0,0 +1,78 @@
1
+ # Quickstart
2
+
3
+ A first clearance in three commands, sized in minutes. [INSTALL.md](INSTALL.md) is the reference for
4
+ everything this page leaves out.
5
+
6
+ ## Before you start
7
+
8
+ Three self-serve accounts. Each is yours, signed in on your own machine — this product holds no keys
9
+ of its own and calls nothing on your behalf.
10
+
11
+ | What | Why | Where |
12
+ |---|---|---|
13
+ | A reasoning program | Every stage runs as a headless turn of it | [Claude Code](https://claude.com/claude-code) (`claude`) or the Codex CLI (`codex`). Setup installs it if the machine has none. Sign in with the program setup installed (doctor prints its path), or with `claude` or `codex login` if the machine has its own |
14
+ | A register | Sets what the search reaches, and what it costs | [Signa](https://signa.so) — one key, self-serve, US + EU + WIPO and ten more offices |
15
+ | Web research | Covers the open web and the marketplaces | [Perplexity](https://www.perplexity.ai) |
16
+
17
+ The register is the one with a real choice in it. EUIPO and a local USPTO index cost nothing and
18
+ reach one office each; Signa is the recommended paid route and the fastest to a real clearance.
19
+ [The six, and what each reaches](providers/README.md).
20
+
21
+ **macOS, Linux or Windows.** On Windows everything runs natively in PowerShell, with no WSL2, no Git and no
22
+ administrator rights: `npm install --global clearotron`, then `clearotron install`, which installs the AI
23
+ program you choose into your own user folder. On Windows and macOS Clearotron runs in the window you start
24
+ it from, and closing the window stops it.
25
+
26
+ [INSTALL.md](INSTALL.md) §1 has the exact version floor and why it is one.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ npx clearotron install # offers to install the reasoning program if the machine has none, and shows you how to sign it in
32
+ clearotron doctor --probe-engine
33
+ ```
34
+
35
+ `install` puts the program under `~/.local` and needs no root, and every command after it here uses the
36
+ `clearotron` it installed. If `~/.local/bin` is not on your `PATH` yet, type `~/.local/bin/clearotron`. Installing with npm's own global form
37
+ instead is covered in [INSTALL.md](INSTALL.md) §2.
38
+
39
+ `doctor` is the one to read. It checks that the reasoning program is there, on `PATH` or as the copy
40
+ setup installed; that it is signed in, by running a turn rather than by finding the executable; and
41
+ that your register credential resolves. An executable that is signed out passes every other check and
42
+ fails at the first stage.
43
+
44
+ ## Run one
45
+
46
+ Write `job.json`:
47
+
48
+ ```json
49
+ {
50
+ "id": "job-2026-0001",
51
+ "forwarder": "alex",
52
+ "forwarderEmail": "alex@example.com",
53
+ "marks": [{ "ref": "TM-0001", "name": "IRONWHISK", "classes": [9, 42] }],
54
+ "goods": "cloud software for weather analytics",
55
+ "jurisdictions": ["US"],
56
+ "product": "knockout-search"
57
+ }
58
+ ```
59
+
60
+ ```bash
61
+ clearotron run --job job.json
62
+ ```
63
+
64
+ **Name `product`.** It orders a knockout search: the cheapest of the four and the fastest way to
65
+ prove the install works. Delete that line and the territories decide instead — and one country gives
66
+ you a full country search, the deepest of the four, with case law on. Narrowing the scope orders
67
+ **more** work, not less.
68
+
69
+ **A knockout search takes 5 to 10 minutes. The other three take 1.5 to 2.5 hours.** Every finished
70
+ stage stays on disk, so a run survives interruption and a resume re-runs only what is missing.
71
+
72
+ ## Then
73
+
74
+ - See it before you buy anything: `npx clearotron demo` replays a finished clearance with no account, no
75
+ key and no network.
76
+ - The four searches, and what each reaches: [README.md](README.md).
77
+ - Everything else — configuration, the config store, the portal, access control:
78
+ [INSTALL.md](INSTALL.md).
package/bin/onboard.mjs CHANGED
@@ -1542,17 +1542,22 @@ export async function runCheck() {
1542
1542
  warn(couldNotDetermine("CLEAROTRON_BOX", unitEnv));
1543
1543
  } else {
1544
1544
  const raw = (boxFileEnv?.CLEAROTRON_BOX ?? "").trim();
1545
+ // THE ACCEPTED NAMES ARE NEVER PRINTED. They are the names of the deployments this build was made for,
1546
+ // and the line offered them to a newcomer to name their own machine after (measured on a fresh install
1547
+ // of a beta, 2026-11-03). An install without units says nothing of an unset name: nothing there reads
1548
+ // it. Installed units are warned, because the services read it, and `start --background` installs the
1549
+ // same units a hosted deployment runs, from the same renderer, so nothing here can tell the two apart.
1545
1550
  if (!raw) {
1546
1551
  // AN ABSENCE IS NOT A MISCONFIGURATION, and this command already separates the two — a machine
1547
1552
  // nobody has configured yet has no box, legitimately, and `--check` on one exits 0 by contract.
1548
1553
  // Reported at `!` so it is visible rather than silent, which is the whole requirement; raising it
1549
1554
  // to `✗` made every unconfigured machine fail its own acceptance arm, and said "fault" about a
1550
1555
  // state that is the normal beginning of an install.
1551
- warn(`no CLEAROTRON_BOX in ${boxSource} — this deployment does not name itself, so nothing below `
1552
- + `can be read as a statement about a particular box. Set it to one of: ${DEPLOYMENT_BOXES.join(", ")}`);
1556
+ if (hosted) warn(`no CLEAROTRON_BOX in ${boxSource} — this deployment does not name itself, so nothing below `
1557
+ + "can be read as a statement about a particular box");
1553
1558
  } else if (!DEPLOYMENT_BOXES.includes(raw)) {
1554
- problem(`CLEAROTRON_BOX is "${raw}" in ${boxSource}, which is not a box this build knows `
1555
- + `(${DEPLOYMENT_BOXES.join(", ")}). An unrecognised name reads as NO box everywhere it is `
1559
+ problem(`CLEAROTRON_BOX is "${raw}" in ${boxSource}, which is not a box this build knows. `
1560
+ + `An unrecognised name reads as NO box everywhere it is `
1556
1561
  + "consulted, which is quieter than a wrong one and just as wrong");
1557
1562
  } else {
1558
1563
  ok(`this box names itself "${raw}", from ${boxSource}`);
package/build-info.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "a133cbb3001da9c7c037168cf2e4dfeafab02770",
3
- "version": "0.5.0-beta.9"
2
+ "commit": "74fa5ad8caf43cc0c142aecff3fb248494cbd02e",
3
+ "version": "0.5.0"
4
4
  }
@@ -0,0 +1,77 @@
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
+ # 0.5.0 — what was checked before it was published
5
+
6
+ Tested on both engines: Claude, with Opus, Sonnet and Haiku 5.5, and OpenAI's Codex, with GPT-6.1 Sol,
7
+ GPT-6.1 Terra and GPT-6 Luna.
8
+
9
+ A stable version is published only after a beta has run a real clearance end to end and has been
10
+ installed from scratch by somebody who had not used the product before. This is that record for 0.5.0.
11
+ It names what was run and who ran it by role and date, never by name, and it carries no mark and no
12
+ party to a search.
13
+
14
+ ## The beta it was cut from
15
+
16
+ 0.5.0 was cut from 0.5.0-beta.10, which was published to the beta channel on 4 November 2026 from commit
17
+ `f3353125` and installed on the staging deployment before this stable was cut.
18
+
19
+ | | |
20
+ |---|---|
21
+ | Candidate | `clearotron@0.5.0-beta.10` |
22
+ | Commit | `f3353125c597a723ebb03ac628c3113230408558` |
23
+ | Registry integrity | `sha512-QWL2n8+j0rob2jxeVF4v4EsViXerIRfrBQ+w3QMLMPqiFcNeK8fkDHOulWlUVWnKoHLvkDvtZVDcBeCUkxDluw==` |
24
+
25
+ ## A real clearance, end to end
26
+
27
+ On 4 November 2026 the product's owner ran a full worldwide preliminary clearance in four classes against
28
+ Clarivate's live register service, on 0.5.0-beta.9 (commit `a133cbb3`), with OpenAI's Codex doing the
29
+ reasoning on GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna. It ran to a delivered report 54 minutes 56 seconds
30
+ after it started, and the owner reviewed that report as delivered.
31
+
32
+ 0.5.0-beta.10 differs from beta.9 by the fixes in this version's notes. On 4 November 2026 the product's test
33
+ team ran a smaller live clearance on beta.10, with the same engine and register service: a knockout search of
34
+ two marks, in one class and one territory. It ran to a delivered report 7 minutes 42 seconds after it started.
35
+
36
+ ## Installs from scratch
37
+
38
+ - **Install as a new user, on beta.9.** On 3 November 2026, on 0.5.0-beta.9, a tester with no prior
39
+ knowledge of the product installed the published beta as a new user on a Linux machine, following only
40
+ the public instructions, signed in to nothing and making no paid call. The demo, setup, `doctor` and the
41
+ local portal all ran. In a second fresh install, setup's test of the AI program, run before signing in,
42
+ spent nothing on either engine and named the command that signs the program in. The tester found
43
+ fourteen places where the install documents and the program disagree. Three are fixed in beta.10: the
44
+ quickstart guide now ships, `doctor` no longer suggests deployment names, and the install guide says
45
+ which sign-in `clearotron start` runs. The rest are left for 0.5.1.
46
+ - **Install as a new user, on beta.10.** On 4 November 2026, on 0.5.0-beta.10 (commit `f3353125`), a second
47
+ tester with no prior knowledge of the product repeated the install on the same Linux machine, again from
48
+ the public instructions only, signed in to nothing and making no paid call. The demo, setup, `doctor` and the
49
+ local portal all ran, and the three fixes held. Following the quickstart guide, the tester started a search
50
+ with no register chosen: instead of refusing, it was set aside to retry, and the reason was written only in
51
+ the run's own files. That is left for 0.5.1, with the remaining places where the documents and the program
52
+ disagree.
53
+ - **macOS.** An automated job packs the candidate's own bytes, installs them for a user with nothing
54
+ installed, and runs `doctor` and the demo. The release runs it on this stable's bytes before publishing
55
+ them.
56
+
57
+ ## Known limits
58
+
59
+ These are known and stated, so that nothing in this record is read wider than it was checked.
60
+
61
+ - No overall gain in report quality or speed is measured for this version, and the clearance above was
62
+ reviewed as delivered, with no independent legal check.
63
+ - The fixes to the report's summary and to the goods a finding cites are proved on saved clearances only.
64
+ - These have not run live on this version: a full preliminary clearance in a single territory, the
65
+ case-law step, the reuse of saved answers, and a search Clarivate refuses.
66
+ - On a crowded search at Clarivate, some register records are counted without being read; the report shows
67
+ this only as coverage limited.
68
+ - At Clarivate, an exact phrase containing AND, OR or NOT is not searched, and the report says so.
69
+ - On one test clearance on Claude, the engine asked five times for a tool it is not given, and each
70
+ request was refused.
71
+ - The repair of a goods claim before delivery can miss other wording, and the writer can leave a finding
72
+ unchanged.
73
+
74
+ ## Between the beta and the stable
75
+
76
+ The code is the code 0.5.0-beta.10 shipped. The commits between that beta and this stable change nothing the
77
+ product does: they add this record, reword 25 release notes, and set the version numbers and changelogs.
@@ -1,5 +1,95 @@
1
1
  # clearotron-driver
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Fixed: Faults the final checks find in a finding's own summary sentence, a short entry, or a grouped line are now corrected before delivery. Before, they shipped as found.
8
+
9
+ ### Patch Changes
10
+
11
+ - Fixed: The delivery email for a result the review could not sign off now lists the report's "Only you can close these" items.
12
+ - Fixed: A clearance on the Signa register no longer loses searches to a brief rate limit; it waits as long as the register asks and searches again.
13
+ - Fixed: A clearance on the Claude engine no longer stops with a false "not signed in" message before the search begins, while the Claude sign-in is being renewed.
14
+ - Fixed: On the Codex engine, a clearance no longer sees temporary files that another clearance left on the same machine.
15
+ - Fixed: A report's copy for the client is no longer held back when a live finding shares its mark and owner with a finding the review withdrew.
16
+ - Fixed: A clearance on the Codex engine no longer stops as if signed out when the Codex sign-in fails to renew for a moment.
17
+ - Fixed: The engine's strongest model now decides whether a wider register search is worth running, so a conflict only a wider search finds is less likely to be skipped.
18
+ - Fixed: Reports no longer show "Nothing found" in "Where it stands" for a country the register could not search; that country is left out.
19
+ - Fixed: A search with more similar marks than can be read now narrows step by step, and stops once the lists it has read answer it.
20
+ - Fixed: A record whose register lookup failed or came back empty no longer counts as retrieved; the clearance fetches the record again, or says it could not.
21
+ - Fixed: When a register search fails, the report's coverage still lists the other crowded searches whose results were not all read, instead of leaving them out.
22
+ - Fixed: When a clearance fails, its chat notice now goes to the person who asked for it, with a copy to the operator.
23
+ - Fixed: A finding added by a late correction now appears with its own card in the delivered report.
24
+ - Fixed: A finding registered in several countries now shows under each of them in "Where it stands". Before, only its first country showed it, and the others could read "Nothing found".
25
+ - Fixed: A clearance no longer repeats a finished step because a web lookup inside it timed out.
26
+ - Fixed: When a report groups filings of one conflict into one finding, the final checks now ask for a wrong goods claim to be corrected in the text the finding shows.
27
+ - Fixed: When a repeated search re-ranks register records after the report is written, the report now says how many and makes a clear result conditional; the audit trail gives their final ranking.
28
+ - Fixed: A report no longer counts a main market as read in a crowded search when the narrower search by goods left that market's register out.
29
+ - Fixed: The audit workbook no longer calls a name an unidentified party when the report identifies it, or when it is a territory such as the UAE.
30
+ - Fixed: The audit workbook no longer says that a machine check on the report did not pass when no check had failed.
31
+ - Fixed: The audit workbook no longer records a correction as checked when the review after it did not complete, and shows that review as not completed.
32
+ - Fixed: The report and the audit workbook now say a record was "retrieved from the register" rather than "read". The workbook's summary explains what that means.
33
+ - Fixed: A search the register refused is now recorded with the register's own reason, and a search the engine itself declined to send is no longer reported as a register error.
34
+ - Fixed: A register record the engine decided to keep as background now appears in the report's context table, instead of being left out of it.
35
+ - Fixed: A clearance whose register search cannot finish, such as one that keeps timing out, now delivers its report instead of ending with none.
36
+ - Fixed: A clearance repaired after a failure now keeps the original order, including who sent it and their instructions, instead of rebuilding a partial one.
37
+ - Fixed: A clearance that resumes after a pause is now held to the same standard as one that never paused: a live registration identical or near-identical to the mark makes its result conditional, and the report says so, only when the report it delivers leaves that registration unaddressed.
38
+ - Fixed: A clearance resumed after an interruption now searches the territories the order named, not the account's default markets.
39
+ - Fixed: A search that cannot be shown to have run is now listed as not searched, and the report is still delivered.
40
+ - Fixed: When the search for an owner's use of a mark could not run, the report no longer says that search found nothing.
41
+ - Fixed: A conflict the review sends back for correction can now be reported as a finding; the correction could previously change only findings already in the report.
42
+ - Fixed: A register record the engine placed on the watchlist now appears in the audit trail with its reason, instead of being left out.
43
+ - Fixed: A wider register search is no longer set aside because a narrower search returned a short list; the engine now weighs what each waiting search could add to the advice and records the reason for each.
44
+ - Fixed: A citation of a finding the review withdrew, in the report's summary panel or methodology, is now sent back for correction before delivery.
45
+ - Fixed: A result made conditional only by legal steps that a later correction withdraws now reads clear again, once the review of that correction accepts it and nothing else is outstanding.
46
+ - Fixed: A result is no longer held at conditional because a wider search that was rightly withheld was asked for again; such a result can now read clear, and its goods category reads as searched.
47
+ - Fixed: A crowded search already answered by the lists read so far no longer appears among the report's coverage limits; its count is still recorded.
48
+ - Fixed: When the report's writing step is interrupted, the next attempt continues from the findings it had already finished instead of starting again.
49
+ - Fixed: An overview that cites a finding no longer in the report is now sent back for correction before delivery, and flagged for the reviewing lawyer if the citation remains.
50
+ - Fixed: Reports can set aside an identical mark registered for unrelated goods, recording the reason in the audit workbook instead of listing it as a finding.
51
+ - Fixed: A clearance that searched common law or the United Kingdom is no longer flagged as claiming a search it did not run.
52
+ - Fixed: A report's list of conditions now shows each legal step as the last correction before delivery left the step, not as first written.
53
+ - Fixed: `clearotron doctor` no longer suggests deployment names to copy, and no longer warns about an unset one on a machine that runs no services.
54
+ - Fixed: The audit workbook no longer lists the same open search twice, once in the report's words and once as a follow-up row with a shortened title.
55
+ - New: A clearance now stops running follow-up searches after 120, and delivers its report with what it has read.
56
+ - Fixed: Knockout ratings now weigh the earlier filings found for the mark itself, and a clearance's register review now follows the ranking of results made before it, so some ratings change.
57
+ - Fixed: Knockout reports no longer carry two standing caveats. The caveat on a conditional result stays.
58
+ - Fixed: A resumed clearance no longer shows the false line "A machine check on the report did not pass".
59
+ - Fixed: A register record that a repeated search finds after the results were ranked is now ranked and reviewed before the report is written. If that cannot be done, the report is still delivered, and it counts the record among those left open. Before, such a record could be left out of the ranking, the review, and the report.
60
+ - Fixed: A clearance no longer stops without a report when register records it retrieved are still unaddressed at the end; the report is delivered, states once how many remain unaddressed, and makes a clear result conditional.
61
+ - Fixed: The reviewing lawyer's open questions no longer say a coverage line was removed when a correction gave it the new title the review asked for.
62
+ - New: Searches now also use OpenAI's GPT-6.1 Terra.
63
+ - For operators: On the Signa register, follow-up searches now send spellings as lists, so a clearance makes fewer requests.
64
+ - Fixed: Searches on the Signa register now ask for each goods statement in full, so a report weighs an owner's whole goods rather than the first 280 characters.
65
+ - New: Searches on the Signa register now reach Spain and Mexico, so an order naming either country is searched there rather than reported as not covered.
66
+ - For operators: When a client door is not up, `clearotron start` now says why, and that the portal and the engine door are unaffected.
67
+ - Fixed: When a late correction adds, changes, or withdraws a finding, the answers in the report's summary panel are now checked against that finding and updated where they rest on it.
68
+ - Fixed: The Audit Trail now says in plain words why a search was not carried out.
69
+ - Fixed: After a late correction, the Audit Trail delivered with the report is rebuilt to match the corrected result, open questions included; if the Audit Trail cannot be rebuilt, the earlier one is withheld, and the audit workbook is still built from the current findings.
70
+ - Fixed: The Audit Trail now lists each register record set aside while the results were ranked, with the reason given.
71
+ - Fixed: The install guide now says that `clearotron start` uses the passphrase sign-in. It no longer says that the command refuses to start without a sign-in provider.
72
+ - Fixed: The package now includes the quickstart guide that the README and the install guide link to.
73
+ - Fixed: On a crowded field, the report is written from the work the clearance has already done, without reading every register record again.
74
+ - Fixed: The lawyer's report now says why a search was not carried out: the register refused it for the day and a later clearance can repeat it, or the register cannot run that kind of search at all.
75
+ - Fixed: The review now sees every conflict set aside while the report was written, with the reason given, and can send one back for correction.
76
+ - Fixed: When two parties use the same name without a registration, the report keeps a finding for each, instead of keeping only the last one saved.
77
+ - Fixed: For a European Union order, the audit workbook now names every national register that was not searched, instead of only the first few.
78
+
79
+ ## 0.5.0-beta.10
80
+
81
+ ### Patch Changes
82
+
83
+ - Fixed: When a report groups filings of one conflict into one finding, the final checks now ask for a wrong goods claim to be corrected in the text the finding shows.
84
+ - Fixed: A report no longer counts a main market as read in a crowded search when the narrower search by goods left that market's register out.
85
+ - Fixed: The audit workbook no longer calls a name an unidentified party when the report identifies it, or when it is a territory such as the UAE.
86
+ - Fixed: The audit workbook no longer says that a machine check on the report did not pass when no check had failed.
87
+ - Fixed: The audit workbook no longer records a correction as checked when the review after it did not complete, and shows that review as not completed.
88
+ - Fixed: A result made conditional only by legal steps that a later correction withdraws now reads clear again, once the review of that correction accepts it and nothing else is outstanding.
89
+ - Fixed: `clearotron doctor` no longer suggests deployment names to copy, and no longer warns about an unset one on a machine that runs no services.
90
+ - Fixed: The install guide now says that `clearotron start` uses the passphrase sign-in. It no longer says that the command refuses to start without a sign-in provider.
91
+ - Fixed: The package now includes the quickstart guide that the README and the install guide link to.
92
+
3
93
  ## 0.5.0-beta.9
4
94
 
5
95
  ### Patch Changes
@@ -221,6 +221,10 @@ function checks(runDir, log) {
221
221
  const reviewOpen = readPartNotCompleted(runDir, "review");
222
222
  if (reviewOpen) failed.push(["the review, not completed", reviewOpen.reason ?? recheck?.fail]);
223
223
  else if (recheck) failed.push(["the review's re-check", recheck.fail]);
224
+ // A re-check that read ok and saved no review verified nothing: the correction stands unreviewed. A later receipt,
225
+ // which only a re-check that saved a review writes, clears it on a resume.
226
+ const unread = failedStep(log, "corrective-cycle-receipt", "verdict-recheck-unread");
227
+ if (unread && !reviewOpen && !recheck) failed.push(["the review's re-check", "it saved no review, so the correction was not verified"]);
224
228
  const rollback = failedStep(log, "corrective-cycle-receipt", "corrective-rollback");
225
229
  if (rollback) failed.push(["the corrective pass, rolled back", rollback.reason]);
226
230
  const crowd = failedStep(log, "crowd-context", "crowd-context-failed");
@@ -41,6 +41,11 @@ import { runPrefixSpellings } from "../shared/pre-rename-spellings.mjs";
41
41
 
42
42
  export const GOODS_EVIDENCE_SCHEMA_VERSION = 1;
43
43
  export const GOODS_EVIDENCE_FILE = "goods-evidence.json";
44
+ // THE EVIDENCE AS THE WRITER HAD IT. The record above is derived again with every band merge, the first merge of a
45
+ // resumed pass among them, from the bodies the run holds by then, so a record the writer had as a cut search answer can
46
+ // read later as an official record held whole. The driver keeps the record a cold dispatch of the writer was given
47
+ // (pipeline.mjs, around `stage`), and the delivery check compares the findings with that copy: what they were written on.
48
+ export const GOODS_EVIDENCE_AS_WRITTEN_FILE = "goods-evidence.as-written.json";
44
49
  export const GOODS_STATES = Object.freeze(["complete", "cut", "unknown", "absent", "unavailable", "not-held"]);
45
50
 
46
51
  const uriKey = (u) => normalizeRecordUri(u);
@@ -263,11 +268,20 @@ export function deriveGoodsEvidence({ records = [], goods = null, held = null, f
263
268
  return { schema_version: GOODS_EVIDENCE_SCHEMA_VERSION, totals: goodsEvidenceTotals(rows), records: rows };
264
269
  }
265
270
 
266
- /** The record the run wrote, or null when there is none or it will not parse. IMPURE. */
267
- export function readGoodsEvidence(runDir) {
268
- const p = driverDir(runDir, GOODS_EVIDENCE_FILE);
271
+ const readDriverJson = (runDir, name) => {
272
+ const p = driverDir(runDir, name);
269
273
  if (!existsSync(p)) return null;
270
274
  try { return JSON.parse(readFileSync(p, "utf8")); } catch { return null; }
275
+ };
276
+
277
+ /** The record the run wrote, or null when there is none or it will not parse. IMPURE. */
278
+ export function readGoodsEvidence(runDir) {
279
+ return readDriverJson(runDir, GOODS_EVIDENCE_FILE);
280
+ }
281
+
282
+ /** The record the writer's last cold dispatch was given, or null when the run kept none or it will not parse. IMPURE. */
283
+ export function readGoodsEvidenceAsWritten(runDir) {
284
+ return readDriverJson(runDir, GOODS_EVIDENCE_AS_WRITTEN_FILE);
271
285
  }
272
286
 
273
287
  /**
@@ -2,7 +2,7 @@
2
2
  "name": "clearotron-driver",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "0.5.0-beta.9",
5
+ "version": "0.5.0",
6
6
  "license": "AGPL-3.0-only",
7
7
  "description": "Deterministic driver for the trademark clearance workflow: orchestration in code (fan-out, fan-in barrier, gating, retries); the model does judgment leaves only, through a reasoning CLI spawned per stage.",
8
8
  "engines": {
@@ -12,7 +12,7 @@ import { join, dirname, basename, resolve, relative } from "node:path"; // res
12
12
  import { driverDir, driverRel, ensureDriverDir } from "../shared/driver-dir.mjs";
13
13
  import { REVIEWER_OPEN_QUESTIONS_FILE } from "./reviewer-open-points.mjs"; // the run-record file the reviewer's open points go to, and the only thing that reads them now
14
14
  import { goodsOf } from "./queue-markers.mjs"; // — one reading of "does this job name goods", shared with the intake gate
15
- import { terminalClampDecision, orderClausesForLede, clientConditions, clauseForDefect, gapPositivelyClosed, verdictWithoutTheClosedGap, jointUnaccounted } from "./terminal-clamp.mjs"; // — deliver and clamp, never withhold
15
+ import { terminalClampDecision, orderClausesForLede, clientConditions, clauseForDefect, gapPositivelyClosed, verdictWithoutTheClosedGap, verdictWhenTheStepsAreWithdrawn, jointUnaccounted } from "./terminal-clamp.mjs"; // — deliver and clamp, never withhold
16
16
  import { recordSpan } from "./attributed-span.mjs"; // — driver work the decomposition can attribute
17
17
  import { fileURLToPath } from "node:url";
18
18
  import { runStage, correctionHint, gridLedgerNameFor, draftCarryEligible, toolWrittenArtifact, selectEngine, saidBackOnly } from "./gateway.mjs";
@@ -162,7 +162,7 @@ import { RECORD_CARRY_SCHEMA_VERSION, traceRecordCarry, parseStageOutcomes, reco
162
162
  import { reconcileSurfaceDuty, surfaceDutyNote } from "./surface-duty.mjs"; // item 3 — silence at the findings surface, read off the rows above
163
163
  import { DISCARD_LEDGER_NAME, seamRows, appendDiscardRows, foldDiscardLedger } from "./record-discard.mjs";
164
164
  import { citedFindingNumbers } from "./finding-citations.mjs"; // the findings an exclusion's ground cites
165
- import { deriveGoodsEvidence, recordGoodsEvidence, heldRecordProvenance, heldBodiesOf, recordFetchOutcomes, readRunCallRows, recordReads, linesRead, registerCallAccount, readGoodsEvidence, GOODS_EVIDENCE_FILE, goodsFromLabel } from "./goods-evidence.mjs"; // — what each band record's goods rest on, written beside the shape and served by no band tool
165
+ import { deriveGoodsEvidence, recordGoodsEvidence, heldRecordProvenance, heldBodiesOf, recordFetchOutcomes, readRunCallRows, recordReads, linesRead, registerCallAccount, readGoodsEvidence, readGoodsEvidenceAsWritten, GOODS_EVIDENCE_FILE, GOODS_EVIDENCE_AS_WRITTEN_FILE, goodsFromLabel } from "./goods-evidence.mjs"; // — what each band record's goods rest on, written beside the shape and served by no band tool
166
166
  import { readDeclinations, declinationCallPaths } from "./declination-tool.mjs"; // — synthesis's own stated declines
167
167
  import { seamReasonFor } from "./declination-call.mjs"; // — the per-record judgment, pure and separately tested
168
168
  import { traceCommonLawCarry, commonLawCarryEvent, mintCommonLawCarryDoubts, reconciliationVerdict, planVsExecutedChannels, CL_STAGES } from "./commonlaw-carry.mjs";
@@ -183,7 +183,7 @@ import { beginAnswerMemory, endAnswerMemory } from "../providers/_shared/answer-
183
183
  import { findScreenGateViolations, findScreenGateParseGaps, screenGateZeroCause, screenGateEvidence, policedDropUris } from "./screen-gate.mjs";
184
184
  import { emptyQueue, coerceQueue, mintItem, pendingItems, markFlushed, receiptKeyFor,
185
185
  buildFlushFollowup, runPostFlushGateRepair } from "./digest-queue.mjs"; // (t1cd) — the digest-trigger funnel
186
- import { foldFindingsFile, foldAfterSave, openPass, modelRecordPath, snapshotFold, restoreFold, readFold, keptModelOrdinal, citingModelOrdinal } from "./record-fold.mjs"; // the folded record from the delivery seam on
186
+ import { foldFindingsFile, foldAfterSave, openPass, modelRecordPath, snapshotFold, restoreFold, readFold, keptModelOrdinal, citingModelOrdinal, FOLD_FILE } from "./record-fold.mjs"; // the folded record from the delivery seam on
187
187
  import { writeStamp, stageStaleness, restamp, restampStage, staleOnPath, reconcileStamps, shaOf, readStamp } from "./stage-freshness.mjs";
188
188
  import { locateReportFaults, reportPartsOf, overviewCitationFault, writersCitationFaults } from "./repair-targets.mjs"; // a delivery-check fault reaches the part of the report that holds it
189
189
  import { parseManifestVariants, variantsParseFailure, findCoverageLimitedCells, partitionClosableCells, findSimilarListingSignals,
@@ -194,7 +194,7 @@ import { recordRunConsumption } from "./consumption-ledger.mjs";
194
194
  import { quoteForJob, reconcileTurnaround } from "./run-quote.mjs";
195
195
  import { assembleRunRecords, recordBodyHasContent, readRecordArtifacts, findRegistryArithmeticIssues, findRegistryViolations, applyRegistryCorrections, extractEnforcerSignals, collectOppositionDeadlines, normalizeRecordUri } from "./registry-fidelity.mjs";
196
196
  import { recallReceiptForOwnCompany } from "./recall-receipt.mjs"; // a past run's recall receipt, as one company's audit may list it
197
- import { runLint, flagLines, properNameCandidates, OVERVIEW_CITATION_ID, goodsHeldWholeDetail } from "./predelivery-lint.mjs";
197
+ import { runLint, flagLines, properNameCandidates, OVERVIEW_CITATION_ID, goodsRepairLine } from "./predelivery-lint.mjs";
198
198
  import { parsePlacementsJson } from "./placement-model.mjs"; // B2 — the structured tier mirror; the lint reads it only to flag an EMPTY one
199
199
  import { readAnchors } from "./anchor-reader.mjs";
200
200
  import { findEngagementReceipts } from "./engagement-receipt.mjs";
@@ -5667,11 +5667,48 @@ function sweepStrayArtifacts(ctx, stageName) {
5667
5667
  } catch { /* a hygiene sweep must never be able to affect a run */ }
5668
5668
  }
5669
5669
 
5670
+ // ── THE GOODS EVIDENCE AS THE WRITER HAD IT (goods-evidence.mjs GOODS_EVIDENCE_AS_WRITTEN_FILE) ─────────────────────
5671
+ //
5672
+ // The delivery check compares a finding that says its goods are cut with the goods evidence the writer was given. That
5673
+ // evidence is derived again with every band merge, and the first merge of a resumed pass reads the record bodies the
5674
+ // run holds by then: a record the writer had as a cut search answer read as an official record, and the check found no
5675
+ // outcome for a record it had handed to the repair, or no longer found a claim the repair left standing.
5676
+ //
5677
+ // So the evidence a cold dispatch of the writer is given is kept, as it stood when the dispatch began, once the stage
5678
+ // has returned a record. A writer that skipped wrote nothing new and leaves the copy as it was. A followup, the delivery
5679
+ // check's own repair among them, corrects a record written on the copy already kept, so it leaves the copy too: the
5680
+ // check after that repair compares the corrected findings with what they were first written on. A writer dispatched
5681
+ // with no evidence leaves no copy, so none can describe an earlier writer.
5682
+ //
5683
+ // The text of the evidence a cold writer dispatch is given, null where it is given none, and undefined where no copy is
5684
+ // to be kept. Never throws.
5685
+ export function goodsEvidenceForTheWriter(name, ctx, opts = {}) { // @internal — driven by its test
5686
+ if (name !== "synthesis" || opts.followup || !ctx?.paths?.runDir) return undefined;
5687
+ try { return readFileSync(driverDir(ctx.paths.runDir, GOODS_EVIDENCE_FILE), "utf8"); } catch { return null; }
5688
+ }
5689
+ /** Keep the evidence `goodsEvidenceForTheWriter` read, once the writer's stage returned a record it wrote. Never throws. */
5690
+ export function keepGoodsEvidenceAsWritten(ctx, r, evidence) { // @internal — driven by its test
5691
+ if (evidence === undefined || !r?.ok || r.skipped) return;
5692
+ const at = driverDir(ctx.paths.runDir, GOODS_EVIDENCE_AS_WRITTEN_FILE);
5693
+ try {
5694
+ if (evidence == null) rmSync(at, { force: true });
5695
+ else { ensureDriverDir(ctx.paths.runDir); atomicWrite(at, evidence); }
5696
+ } catch (e) {
5697
+ note(`[synthesis] the goods evidence the writer was given could not be kept (${String(e?.message ?? e).slice(0, 100)}) — the delivery check reads the evidence as it stands`);
5698
+ }
5699
+ }
5700
+
5670
5701
  async function stage(name, ctx, opts = {}) {
5702
+ const writersEvidence = goodsEvidenceForTheWriter(name, ctx, opts);
5671
5703
  let wedgeCycles = 0;
5672
5704
  for (;;) {
5673
5705
  const r = await stageWithChain(name, ctx, opts);
5674
- if (r.ok || r.fail !== "lane_wedge" || wedgeCycles >= LANE_WEDGE_CHAIN_RETRIES) { sweepStrayArtifacts(ctx, name); await afterLateSynthesisSave(name, ctx, r); return r; }
5706
+ if (r.ok || r.fail !== "lane_wedge" || wedgeCycles >= LANE_WEDGE_CHAIN_RETRIES) {
5707
+ sweepStrayArtifacts(ctx, name);
5708
+ keepGoodsEvidenceAsWritten(ctx, r, writersEvidence);
5709
+ await afterLateSynthesisSave(name, ctx, r);
5710
+ return r;
5711
+ }
5675
5712
  wedgeCycles++;
5676
5713
  note(`[${name}] command-lane wedge — the stage timed out with zero progress (saturated lane). Waiting ${Math.round(LANE_WEDGE_BACKOFF_MS / 1000)}s for it to clear, then re-dispatching (${wedgeCycles}/${LANE_WEDGE_CHAIN_RETRIES}); full per-attempt timeouts preserved.`);
5677
5714
  try { runLog(ctx.paths.runDir, { event: "lane-wedge-retry", stage: name + (ctx.axis ? `:${ctx.axis}` : ""), cycle: wedgeCycles, max: LANE_WEDGE_CHAIN_RETRIES }); } catch { /* telemetry best-effort */ }
@@ -7281,6 +7318,15 @@ export function conditionsFollowingTheRecord({ reasons = [], clauses = [], fromR
7281
7318
  restated: placed.filter(([r, c]) => before.includes(r) && clauseWas.get(r) !== c).map(([r]) => r) };
7282
7319
  }
7283
7320
 
7321
+ /**
7322
+ * IS THE RECORD'S ACTIONS REGISTER A LIST? The one positive sign that a record holding no forward legal step has
7323
+ * withdrawn them, rather than lost them: an unreadable record, a missing register and one that is not a list are not a
7324
+ * withdrawal. Entries dropped as unreadable are the caller's to weigh. PURE.
7325
+ */
7326
+ export function actionsRegisterListed(raw) { // @internal — driven by its test
7327
+ try { return Array.isArray(JSON.parse(String(raw ?? ""))?.actions); } catch { return false; }
7328
+ }
7329
+
7284
7330
  /**
7285
7331
  * WHAT A REPAIR IN THE DELIVERY CHECK LEFT STALE, AND WHAT OF IT IS QUEUED. A stage is this repair's when it is stale now
7286
7332
  * and was not before the repair, or is stale on an input that has moved since; a stage stale before for the same reasons
@@ -9637,6 +9683,9 @@ export function buildReasonedNegativesSection(findings) { // @internal
9637
9683
  // built from and writes the outcome beside it (corrections-delivered.mjs). The last assembly's answer stands.
9638
9684
  // corrections-applied.json, which the open points and the verdict re-check read, is not touched.
9639
9685
  export const CORRECTIONS_DELIVERED_FILE = "corrections-delivered.json";
9686
+ // Whether the recheck after the correction saved an accepted review (`read`) or not (`unread`, with why), with the
9687
+ // entry verdict and the verdict that stood. An unread recheck is a correction nobody verified.
9688
+ export const CORRECTIVE_RECHECK_FILE = "corrective-recheck.json";
9640
9689
 
9641
9690
  /** Keep the basis at the corrective pass, from the two records the applied table was built from. Throws on a write failure; the caller is never-kill. */
9642
9691
  export function recordCorrectionsBasis(runDir, rows, preDoc, postDoc) { // @internal
@@ -14470,8 +14519,13 @@ async function pipelineInner(job, opts = {}) {
14470
14519
  // passes below run on a record that exists, and their failures are theirs. A failure named here, once its recovery
14471
14520
  // is spent, is recorded as the assessment not completed and delivered without it (the run-level catch), never
14472
14521
  // ended on.
14522
+ // The goods evidence this writer is given is kept as written by its stage (around `stage`), and kept here too where
14523
+ // the record comes from the salvage after a failed dispatch: a re-emit, or the record taken with its foreign links
14524
+ // blanked, completes the record that dispatch wrote on that evidence.
14525
+ const writersEvidence = goodsEvidenceForTheWriter("synthesis", ctx);
14473
14526
  const synth = await asPartNotCompleted("assessment", async () =>
14474
14527
  quarantineSynth(await stage("synthesis", ctx, synthExtra ? { extra: synthExtra } : {}), ctx, "synthesis")); // A3: last-resort quarantine instead of must(); A4: one targeted re-emit inside
14528
+ keepGoodsEvidenceAsWritten(ctx, synth, writersEvidence);
14475
14529
  recordSynthesisSeam(ctx, synth); // half one — which surfaced records this pass delivered, and which it did not
14476
14530
  // The corrective re-synthesis is dispatched on the WINNING attempt's key AND model/thinking. A followup's first
14477
14531
  // attempt starts fresh, and it never resumes the synthesis session (no engine resumes by key); but if synthesis
@@ -14909,6 +14963,8 @@ async function pipelineInner(job, opts = {}) {
14909
14963
  const planAuditCarry = (ctx.registerPlan && existsSync(P.planExecution))
14910
14964
  ? `Your rewritten review MUST again contain the section titled exactly "PLAN-EXECUTION CHECK" — carry your prior section forward, updated for the corrected narrative/findings (the deterministic validator requires it whenever the plan-execution receipt exists).`
14911
14965
  : "";
14966
+ const recheckSeq0 = nextRefutationSeq(run.runDir);
14967
+ const reviewShaBefore = shaOf(P.seniorEyeReview);
14912
14968
  const rc = firstRef.key
14913
14969
  ? await stage("narrative-refutation", ctx, {
14914
14970
  force: true, sessionKey: firstRef.key, model: firstRef.model, thinking: firstRef.thinking, trigger: "verdict-recheck",
@@ -14921,9 +14977,31 @@ async function pipelineInner(job, opts = {}) {
14921
14977
  }),
14922
14978
  })
14923
14979
  : await stage("narrative-refutation", ctx, { force: true, model: firstRef.model, thinking: firstRef.thinking, trigger: "verdict-recheck", ...(planAuditExtra(ctx) ? { extra: planAuditExtra(ctx) } : {}) });
14924
- verdict = rc.ok ? (parseVerdict(readFileSync(P.seniorEyeReview, "utf8")) ?? entryVerdict) : entryVerdict;
14925
- correctiveRecheckOk = rc.ok === true;
14926
- runLog(run.runDir, { event: "verdict-2", verdict });
14980
+ // A RECHECK COUNTS ONLY WHEN THIS DISPATCH SAVED A REVIEW. A reviewer whose every save was refused writes
14981
+ // nothing, and the stage still reads ok on the review that stands from before the correction, so its verdict and
14982
+ // its points would pass as the review of the corrected record, and the receipt would stop a resume from finishing
14983
+ // a verification nobody made. Such a recheck is a failed one: the entry verdict stands, the record says the
14984
+ // correction was not verified, no receipt is written, and the earlier review stays in place as the earlier review.
14985
+ //
14986
+ // TWO WAYS TO SAVE, BOTH COUNTED. The message above orders the review file rewritten, and a seat may do that or
14987
+ // record the review through its tool; both are seen on test runs. So a save is an accepted tool call made since
14988
+ // this dispatch began, or review bytes that differ from the ones before it. A byte-identical rewrite reads as no
14989
+ // save, which costs only a cycle run again on a resume: the same bytes carry the same verdict.
14990
+ const recheckCall = rc.ok ? readAcceptedReviewSince(run.runDir, recheckSeq0) : null;
14991
+ const recheckRewrote = rc.ok && !recheckCall && shaOf(P.seniorEyeReview) !== reviewShaBefore && shaOf(P.seniorEyeReview) != null;
14992
+ const recheckRead = recheckCall ? { by: "tool", seq: recheckCall.seq } : recheckRewrote ? { by: "file", seq: null } : null;
14993
+ if (rc.ok && !recheckRead) {
14994
+ runLog(run.runDir, { event: "verdict-recheck-unread", fail: "no-accepted-call", seq0: recheckSeq0, entryVerdict });
14995
+ note(`[corrections] the recheck after the correction recorded no review — the correction is not verified, the entry verdict (${entryVerdict}) stands, and the review in place is the one from before the correction`);
14996
+ }
14997
+ verdict = recheckRead ? (parseVerdict(readFileSync(P.seniorEyeReview, "utf8")) ?? entryVerdict) : entryVerdict;
14998
+ correctiveRecheckOk = rc.ok === true && Boolean(recheckRead);
14999
+ try {
15000
+ atomicWrite(driverDir(run.runDir, CORRECTIVE_RECHECK_FILE), JSON.stringify({ ts: new Date().toISOString(),
15001
+ status: correctiveRecheckOk ? "read" : "unread", by: recheckRead?.by ?? null, entryVerdict, verdict, seq0: recheckSeq0, seq: recheckRead?.seq ?? null,
15002
+ ...(correctiveRecheckOk ? {} : { fail: rc.ok ? "no-accepted-call" : String(rc.fail ?? "failed").slice(0, 160) }) }, null, 2) + "\n");
15003
+ } catch (e) { note(`[corrections] the recheck's record could not be written (${String(e?.message ?? e).slice(0, 100)}) — the run log still holds the outcome`); }
15004
+ runLog(run.runDir, { event: "verdict-2", verdict, read: correctiveRecheckOk });
14927
15005
  writeRunStatus(ctx, signoffPatch(verdict));
14928
15006
  }
14929
15007
  // AD-2 A1 — the completion receipt, written ONLY when the cycle finished with a verified recheck:
@@ -15078,6 +15156,13 @@ async function pipelineInner(job, opts = {}) {
15078
15156
  // THE REASONS THE RECORD'S OWN ACTIONS PUT IN THE LIST, by the floor's legal-actions arm, so the list can follow the
15079
15157
  // record when a repair in the delivery check rewrites, withdraws or adds a step (conditionsFollowingTheRecord).
15080
15158
  let recordConditionReasons = new Set();
15159
+ // WHAT A WITHDRAWAL OF THOSE STEPS NEEDS TO GIVE THE REVIEW'S CLEAR BACK (verdictWhenTheStepsAreWithdrawn): that the
15160
+ // steps raised the result, that none was ever dropped as unreadable, when a readable record last held none of them,
15161
+ // and when a correction in the delivery check was last rejected.
15162
+ let stepsRaisedTheResult = false;
15163
+ let stepsUnreadable = false;
15164
+ let stepsWithdrawnAt = null;
15165
+ let correctionRejectedAt = null;
15081
15166
  const DROPPED_CONDITIONS_REASON = "a forward legal step this opinion named could not be recorded, so the conditions listed here are incomplete";
15082
15167
 
15083
15168
  /**
@@ -15364,6 +15449,7 @@ async function pipelineInner(job, opts = {}) {
15364
15449
  runLog(run.runDir, { event: "coverage-floor-clamp", cause: "forward-actions", from: "CLEAR", to: "CONDITIONAL", legalActions: conditions.length });
15365
15450
  note(`deliver-conditional floor: the opinion names ${conditions.length} forward legal action(s) a human must take (${conditions[0].slice(0, 140)}${conditions.length > 1 ? `; +${conditions.length - 1} more` : ""}) — clamping CLEAR→CONDITIONAL (spec 64: the disposition is derived from the findings' named actions).`);
15366
15451
  verdict = "CONDITIONAL";
15452
+ stepsRaisedTheResult = true;
15367
15453
  writeRunStatus(ctx, signoffPatch(verdict));
15368
15454
  } else if (fresh.length) {
15369
15455
  runLog(run.runDir, { event: "verdict-conditions-recorded", legalActions: fresh.length });
@@ -15383,6 +15469,7 @@ async function pipelineInner(job, opts = {}) {
15383
15469
  // do is read as complete — so the reason says INCOMPLETE in the client's own words, and the
15384
15470
  // engine-side detail (ids, defect tokens) rides the note and the log where an engineer reads.
15385
15471
  const droppedConditions = quarantinedConditionRows(fdoc?.actionsQuarantined);
15472
+ if (droppedConditions.length) stepsUnreadable = true; // a step nobody can read is never shown withdrawn
15386
15473
  const droppedReason = DROPPED_CONDITIONS_REASON;
15387
15474
  // ONCE, not once per entry. This floor is re-entered — the degenerate re-ask and the delivery
15388
15475
  // block both call it again — so the reason, the clause and the telemetry are guarded by the
@@ -15706,8 +15793,8 @@ async function pipelineInner(job, opts = {}) {
15706
15793
  // label. Returns whether the list, its kinds or the result changed.
15707
15794
  const followTheRecordsActions = (why) => {
15708
15795
  if (verdict === "BLOCKING" && !recordConditionReasons.size) return false;
15709
- let fdoc = null;
15710
- try { fdoc = existsSync(P.findings) ? parseFindingsJsonLenient(readFileSync(P.findings, "utf8")) : null; }
15796
+ let raw = null, fdoc = null;
15797
+ try { if (existsSync(P.findings)) { raw = readFileSync(P.findings, "utf8"); fdoc = parseFindingsJsonLenient(raw); } }
15711
15798
  catch { fdoc = null; }
15712
15799
  if (!fdoc) return false; // no record to read: the list stands as stated, and the coherence checks judge it
15713
15800
  const { conditions, conditionClauses } = deriveActionConditions(fdoc.actions, fdoc.findings);
@@ -15722,14 +15809,40 @@ async function pipelineInner(job, opts = {}) {
15722
15809
  recordConditionReasons = f.held;
15723
15810
  if (!conditions.length) delete clampKinds.legalActions;
15724
15811
  if (!dropped) delete clampKinds.actionsDropped;
15812
+ // A WITHDRAWAL IS POSITIVE ONLY ON A RECORD WHOSE ACTIONS REGISTER IS A LIST that holds none of the steps. A missing
15813
+ // or malformed register, or one with an entry dropped as unreadable, withdraws nothing.
15814
+ if (f.held.size || conditions.length || dropped) stepsWithdrawnAt = null;
15815
+ else if (f.withdrawn.length) stepsWithdrawnAt = actionsRegisterListed(raw) ? new Date().toISOString() : null;
15725
15816
  // The floor runs again only where the repaired steps reach it, as the coherence repair runs it.
15726
15817
  if (state() !== stood || (verdict === "CLEAR" && (conditions.length || dropped))) applyCoverageFloor();
15818
+ restoreTheReviewsClear();
15727
15819
  if (state() === stood && verdict === was) return false;
15728
15820
  runLog(run.runDir, { event: "verdict-conditions-followed", why, withdrawn: f.withdrawn.length, added: f.added.length,
15729
15821
  restated: f.restated.length, conditions: recordConditionReasons.size, from: was, to: verdict });
15730
15822
  note(`the conditions follow the record ${why} (${f.withdrawn.length} withdrawn, ${f.added.length} added, ${f.restated.length} restated${verdict === was ? "" : `; ${was} → ${verdict}`})`);
15731
15823
  return true;
15732
15824
  };
15825
+ // A CORRECTION THAT WITHDREW EVERY STEP THAT ALONE MADE THE RESULT CONDITIONAL gives the review's CLEAR back, once the
15826
+ // review of that change has been read and no correction since was rejected (the owner's decision, 2026-11-04). The
15827
+ // result is recomputed as a closed gap's is, and that CLEAR meets the floor any CLEAR meets. The caller saves the label.
15828
+ const restoreTheReviewsClear = () => {
15829
+ let review = null;
15830
+ try { review = JSON.parse(readFileSync(postRepairRecordPath(run.runDir), "utf8")); } catch { review = null; }
15831
+ const now = verdictWhenTheStepsAreWithdrawn({ verdict, assessed, reasons: clampReasons, raisedBySteps: stepsRaisedTheResult,
15832
+ stepsUnreadable, withdrawnAt: stepsWithdrawnAt, reviewReadAt: review?.status === "read" ? review.ts : null,
15833
+ reviewUnread: review?.status === "unread", correctionRejectedAt,
15834
+ // The correction of the first review owed a recheck the cycle did not get accepted: the assessment is not verified.
15835
+ recheckUnaccepted: (correctiveEntryVerdict === "CONDITIONAL" || correctiveEntryVerdict === "BLOCKING") && !correctiveCycleSettled && !correctiveRecheckOk });
15836
+ if (now === verdict) return false;
15837
+ runLog(run.runDir, { event: "verdict-recomputed-steps-withdrawn", from: verdict, to: now, withdrawnAt: stepsWithdrawnAt, reviewReadAt: review?.ts ?? null });
15838
+ note(`every forward legal step that made the result conditional was withdrawn, the review of that change was read, and nothing else conditions the result — ${verdict} goes back to ${now}, the result the review reached`);
15839
+ verdict = now;
15840
+ restoredClear = now === "CLEAR";
15841
+ stepsRaisedTheResult = false;
15842
+ writeRunStatus(ctx, signoffPatch(verdict));
15843
+ applyCoverageFloor(); // the floor any CLEAR meets
15844
+ return true;
15845
+ };
15733
15846
  try { writeVerdictSidecar(); }
15734
15847
  catch (e) { throw new StageFailure("verdict", `verdict sidecar write failed (the single label authority): ${String(e.message).slice(0, 120)}`); }
15735
15848
 
@@ -16822,8 +16935,10 @@ async function pipelineInner(job, opts = {}) {
16822
16935
  // which passes the archived summary.
16823
16936
  reportMd, narrativeMd, auditMd, recordsByUri: assembled.records, searchedNames,
16824
16937
  // What each record's goods rested on when the writer wrote, and the records whose whole text a delivery repair
16825
- // was already handed: a finding written on goods the register cut, whose whole body the run holds now.
16826
- goodsEvidence: readGoodsEvidence(run.runDir), goodsHanded: readGoodsHanded(run.runDir),
16938
+ // was already handed: a finding written on goods the register cut, whose whole body the run holds now. The
16939
+ // evidence is the copy kept when the writer was dispatched cold, which no later band merge rewrites; a run that
16940
+ // kept none, written before the copy existed, is read on the evidence as it stands.
16941
+ goodsEvidence: readGoodsEvidenceAsWritten(run.runDir) ?? readGoodsEvidence(run.runDir), goodsHanded: readGoodsHanded(run.runDir),
16827
16942
  // The overview as its writer wrote it, read for a citation of a finding the report does not carry; and the
16828
16943
  // conditions the email carries, as the email composes them.
16829
16944
  overviewMd: (() => { try { return readFileSync(P.reportOverview, "utf8"); } catch { return null; } })(), emailConditions: emailConditionsOfReport(reportMd, lintVerdict?.verdict),
@@ -17057,8 +17172,12 @@ async function pipelineInner(job, opts = {}) {
17057
17172
  const sentenceFixable = targets.stamped.flatMap((f) => (f.parts ?? []).map((x) => ({ ...f, finding: keptModelOrdinal(fold, x.ordinal), detail: x.detail })));
17058
17173
  const recordFixable = targets.record.flatMap((f) => writersCitationFaults(f, (o) => keptModelOrdinal(fold, o)));
17059
17174
  // A finding named for goods the register cut, whose whole text the run holds now, is named in the writer's
17060
- // numbering, in the line's own words: it opens "Finding <N> cites", so the list puts no "finding N:" before it.
17061
- // Under a fold, N is the writer's finding that cites the record, which need not be the member the fold kept.
17175
+ // numbering, in the line's own words: it opens with the finding it names, so the list puts no "finding N:" before it.
17176
+ // Under a fold the report displays the text of the member the fold kept, and the citation of the record can come
17177
+ // from another member: the line then names both, so the repair reaches the text the report displays (design,
17178
+ // 2026-11-04). Where the fold cannot be read, or no member is read citing the record, the line is not handed: a
17179
+ // member is never guessed, and the run records each finding left unhanded.
17180
+ const foldUnreadable = fold == null && existsSync(driverDir(run.runDir, FOLD_FILE));
17062
17181
  let writersFindings = null; // the writer's record, read once and only for a goods line
17063
17182
  const writersRecord = () => {
17064
17183
  if (writersFindings) return writersFindings;
@@ -17068,9 +17187,17 @@ async function pipelineInner(job, opts = {}) {
17068
17187
  };
17069
17188
  const citesRecord = (wf, uri) => (Array.isArray(wf?.owner?.registrations) ? wf.owner.registrations : [])
17070
17189
  .some((reg) => normalizeRecordUri(reg?.uri ?? reg) === uri);
17071
- const inWritersNumbering = (f) => (String(f.id).startsWith("goods-held-whole:")
17072
- ? { ...f, detail: goodsHeldWholeDetail(citingModelOrdinal(fold, f.ordinal, f.uri, writersRecord(), citesRecord), f.uri, f.goods, f.state) } : f);
17073
- const narrativeFixable = [...modelFixable(bySurface("narrative")).map(inWritersNumbering), ...sentenceFixable, ...recordFixable];
17190
+ const goodsUnhanded = [];
17191
+ const inWritersNumbering = (f) => {
17192
+ if (!String(f.id).startsWith("goods-held-whole:")) return f;
17193
+ const shown = foldUnreadable ? null : keptModelOrdinal(fold, f.ordinal);
17194
+ const citing = shown == null ? null : citingModelOrdinal(fold, f.ordinal, f.uri, writersRecord(), citesRecord);
17195
+ const detail = goodsRepairLine({ shown, citing, uri: f.uri, goods: f.goods, state: f.state });
17196
+ if (detail == null) { goodsUnhanded.push({ id: f.id, why: shown == null ? "fold-not-read" : "no-member-read-citing" }); return null; }
17197
+ return { ...f, detail };
17198
+ };
17199
+ const narrativeFixable = [...modelFixable(bySurface("narrative")).map(inWritersNumbering).filter(Boolean), ...sentenceFixable, ...recordFixable];
17200
+ if (goodsUnhanded.length) runLog(run.runDir, { event: "goods-held-whole-not-handed", unhanded: goodsUnhanded });
17074
17201
  if (narrativeFixable.length && synthesisKey) repairBaseKept = snapshotRepairBase(run.runDir);
17075
17202
  // A writer fault with no writer session to repair it is not repaired, and the run says so.
17076
17203
  if (narrativeFixable.length && !synthesisKey)
@@ -17341,6 +17468,7 @@ async function pipelineInner(job, opts = {}) {
17341
17468
  if (review.rec.flags.length) {
17342
17469
  const pass = await runPostRepairCorrection(ctx, P, run, { rec: review.rec, items: review.items, points: review.points,
17343
17470
  grounds: Boolean(hardened), whole: review.base?.whole === true, synthesisRef: { key: synthesisKey, model: synthesisModel, thinking: synthesisThinking } });
17471
+ if (!pass.ok) correctionRejectedAt = new Date().toISOString(); // a rejected correction gives no result back
17344
17472
  // NOTHING REVIEWS THE CORRECTION: the reviewer's stamp takes what it changed as accounted for, and so
17345
17473
  // does the first cycle's receipt, so a resume re-fires neither.
17346
17474
  settleOneShotStamp(run.runDir, "narrative-refutation", [P.narrative], "post-repair-fix");
@@ -18401,8 +18529,8 @@ function assessmentArtifacts(P, runDir) {
18401
18529
  P.findings, P.narrative, P.report, P.reportOverview, P.reportCardsDir, P.audit, P.seniorEyeReview, P.caseLaw,
18402
18530
  P.caseLawCitations, P.doubtClosure, P.clientSummary, P.emailBody, P.correctionsApplied,
18403
18531
  join(runDir, REPORT_IDENTITY_FILE), join(runDir, ".published"),
18404
- ...["verdict.json", "senior-rights.json", "corrections-state.json", "corrective-cycle.json", "predelivery-lint.json",
18405
- "reasoning-integrity.json"].map((n) => driverDir(runDir, n)),
18532
+ ...["verdict.json", "senior-rights.json", "corrections-state.json", "corrective-cycle.json", CORRECTIVE_RECHECK_FILE,
18533
+ "predelivery-lint.json", "reasoning-integrity.json"].map((n) => driverDir(runDir, n)),
18406
18534
  declinationCallPaths(runDir, 0).ledger,
18407
18535
  ].filter(Boolean);
18408
18536
  }
@@ -106,7 +106,11 @@ export function properNameCandidates(text, extraVocab = null, { actionBullets =
106
106
  // extraVocab (WS-B): the run's profile platform names — a customer's marketplaces are standing
107
107
  // surfaces for THAT run, not entities needing introduction (else every non-gaming report fires
108
108
  // false orphan-reference flags).
109
- const inList = (n) => REF_ALLOWLIST.has(n) || (territories && TERRITORY_VOCAB.has(n)) || Boolean(extraVocab?.has?.(n));
109
+ // A TERRITORY'S OTHER NAMES ARE TERRITORIES TOO. The map names "United Arab Emirates", so "the UAE" in a list of
110
+ // countries was named as a party by both checks. The names prose uses besides the map's are already listed once,
111
+ // for the coverage claims (TERRITORY_NAME_TO_CODE); read at call time, because that list is built further down.
112
+ const inList = (n) => REF_ALLOWLIST.has(n) || (territories && (TERRITORY_VOCAB.has(n) || TERRITORY_NAME_TO_CODE.has(n)))
113
+ || Boolean(extraVocab?.has?.(n));
110
114
  const isVocab = (tok) => {
111
115
  const n = norm(tok);
112
116
  if (inList(n)) return true; // whole-phrase entries ("apple app store", "epic games store")
@@ -141,7 +145,14 @@ export function properNameCandidates(text, extraVocab = null, { actionBullets =
141
145
  bulletOpens.add(b.index + b[0].length);
142
146
  for (const m of t.matchAll(/\b([A-Z][a-z]+(?:[ \t]+(?:[A-Z][a-z0-9]+|\d+|&)){1,4}(?:[ \t]+(?:LLC|Inc\.?|GmbH|Ltd\.?|S\.?A\.?|AG|Corp\.?))?)\b/g)) {
143
147
  const tok = m[1].trim();
144
- if (bulletOpens.has(m.index)) continue;
148
+ // THE VERB GOES, AND THE NAME AFTER IT STAYS. Skipping the whole candidate also skipped the name an item asks
149
+ // about: "Verify <a person>", where the person is named nowhere else, went unread. So only the opening word is
150
+ // dropped, and what follows it is read as any other candidate.
151
+ if (bulletOpens.has(m.index)) {
152
+ const rest = tok.replace(/^\S+[ \t]+/, "");
153
+ if (rest !== tok && rest.split(/\s+/).length >= 2 && !isVocab(rest)) add(rest);
154
+ continue;
155
+ }
145
156
  if (tok.split(/\s+/).length >= 2 && !isVocab(tok)) add(tok);
146
157
  }
147
158
  return [...out.values()].filter((tok) => !/^TMP\d+/i.test(tok));
@@ -153,6 +164,21 @@ function check(id, family, surface, pass, detail) {
153
164
  return { id, family, surface, pass: Boolean(pass), detail: detail ?? "" };
154
165
  }
155
166
 
167
+ // A row that states a boundary rather than judging the run. It sits among the checks in the run record, and it never
168
+ // fails, so no failure list, delivery line or repair reads it.
169
+ function notice(id, family, surface, detail) {
170
+ return { ...check(id, family, surface, true, detail), notice: true };
171
+ }
172
+
173
+ /** The rows written as notices. A run recorded before a row became one carries it as a failure; delivery skips it. */
174
+ export const NOTICE_IDS = new Set(["placement-rows-without-uri"]);
175
+
176
+ /**
177
+ * Whether a delivery surface reports this check as failed: it failed, and it is not a notice. A run recorded before a
178
+ * row became a notice carries it as a failure, and its workbook, rebuilt, would say a check did not pass. PURE.
179
+ */
180
+ export const deliveredFailure = (c) => Boolean(c) && !c.pass && !NOTICE_IDS.has(c.id);
181
+
156
182
  // Template integrity (A2): NAME(S) populated; every searched name has its own assessment row; rating
157
183
  // positions hold searched names, never adverse marks. Works on the parsed client-summary structures the
158
184
  // email is assembled from (the email assembly itself is code we control).
@@ -188,11 +214,13 @@ export function templateChecks({ headerName, ratedNames, searchedNames }) {
188
214
  // rule enumeration against the real texts; gameable by repetition, accepted — a false orphan is
189
215
  // reader noise, the worse failure under the lint's posture, and a missed one costs one flag).
190
216
  // Orphans are reported in ONE check so a noisy heuristic costs one flag line, not many.
191
- export function referenceChecks({ actionsText, fullSurface, searchedNames, surface = "report", extraVocab = null, markNames = null, structural = false }) {
217
+ // `introducedIn` is text outside the surface that still introduces a party to its reader: for the email, the report
218
+ // it links, outside the report's own action block.
219
+ export function referenceChecks({ actionsText, fullSurface, searchedNames, surface = "report", extraVocab = null, markNames = null, structural = false, introducedIn = "" }) {
192
220
  const body = stripHtml(fullSurface);
193
221
  const actions = stripHtml(actionsText);
194
222
  const rest = body.replace(actions, " ");
195
- const restN = norm(rest);
223
+ const restN = norm(`${rest} ${stripHtml(introducedIn)}`);
196
224
  // sentence-segments for the contextualization rule: sentence ends, em/en-dash asides, semicolons
197
225
  const segments = body.split(/(?<=[.!?])\s+|\s+[—–]\s+|;\s+/).map(norm);
198
226
  const searchedN = (searchedNames ?? []).map(norm);
@@ -2001,11 +2029,14 @@ export function placementsChecks({ placements }) {
2001
2029
  // only ever existed as a placement — and their absence read as a clean pass on all three.
2002
2030
  //
2003
2031
  // So this NEVER blocks and is never structural. It states the boundary, so a zero from a URI-keyed
2004
- // gate is not read wider than it was measured. Only failing checks' `detail` reaches a reader, which
2005
- // is why it is written to flag on presence rather than to pass quietly with a count nobody renders.
2032
+ // gate is not read wider than it was measured.
2033
+ //
2034
+ // A NOTICE, NOT A FAILURE (owner ruling, 2026-11-04). It flagged on presence, as a failing check, and so the
2035
+ // lawyer's workbook said "A machine check on the report did not pass." on runs where nothing had failed. It is now
2036
+ // recorded beside the checks, in the run record, with its count and its words, and no delivery surface reads it.
2006
2037
  const withoutUri = placements.filter((e) => !(Array.isArray(e?.records) && e.records.length)).length;
2007
2038
  if (placements.length && withoutUri) {
2008
- out.push(check("placement-rows-without-uri", "content-model", "placement", false,
2039
+ out.push(notice("placement-rows-without-uri", "content-model", "placement",
2009
2040
  `${withoutUri} of ${placements.length} placement row(s) name no record URI. This is expected for a common-law candidate (records: [] by contract) and is NOT a defect — it is a COVERAGE BOUNDARY: every URI-keyed carry gate in this driver is silent about these rows rather than clearing them, so a clean result from those gates says nothing about this ${withoutUri}. placement-carry's own join is what covers them; read its classes before treating any of this as carried.`));
2010
2041
  }
2011
2042
  return out;
@@ -2335,14 +2366,37 @@ export function goodsHeldWholeChecks({ findings, goodsEvidence, recordsByUri, ha
2335
2366
  return [...named, ...unresolved, check("goods-held-whole", "goods-evidence", "narrative", true, summary)];
2336
2367
  }
2337
2368
 
2369
+ const goodsStatements = (goods) => goods.map((g) => `${g.classes.length ? `Class ${g.classes.join(", ")}` : "Goods"}: "${g.text}"`).join(". ");
2370
+
2338
2371
  /** The line the writer's repair reads for one finding, in the numbering the writer's save takes. PURE. */
2339
2372
  export function goodsHeldWholeDetail(ordinal, uri, goods, state) {
2340
- const statements = goods.map((g) => `${g.classes.length ? `Class ${g.classes.join(", ")}` : "Goods"}: "${g.text}"`).join(". ");
2341
2373
  return `Finding ${ordinal} cites ${uri}. Its earlier goods evidence was ${state === "cut" ? "cut by the register" : "of unestablished completeness"}. `
2342
- + `The run now holds these complete goods statements from the register record: ${statements}. `
2374
+ + `The run now holds these complete goods statements from the register record: ${goodsStatements(goods)}. `
2343
2375
  + "Reassess this finding's goods comparison on those statements, and correct any claim that they remain cut or unread. Change its rating only if the evidence requires it.";
2344
2376
  }
2345
2377
 
2378
+ /**
2379
+ * The line for a grouped finding whose displayed text and whose citation of the record come from different members, in
2380
+ * the numbering the writer's save takes (design, 2026-11-04). The report displays the text of the member the fold kept,
2381
+ * so the repair must reach that member, and it names the member the citation comes from beside it. PURE.
2382
+ */
2383
+ export function goodsHeldWholeGroupedDetail(shown, citing, uri, goods) {
2384
+ return `The displayed goods-text claim comes from finding ${shown}. The grouped finding cites ${uri} through finding ${citing}. `
2385
+ + `The run now holds these complete goods statements from that register record: ${goodsStatements(goods)}. `
2386
+ + `Correct the claim in finding ${shown} where these statements resolve it. Reassess finding ${citing}'s goods comparison only where those statements affect it. `
2387
+ + "Change a rating only if the evidence requires it. Preserve unrelated findings and update only conclusions that depend on these changes.";
2388
+ }
2389
+
2390
+ /**
2391
+ * The goods line for one named finding: the member whose text the report displays (`shown`) and the member whose own
2392
+ * finding cites the record (`citing`), both in the writer's numbering. One finding's line where they are the same
2393
+ * member, both named where they differ, and null where either is not established: a member is never guessed. PURE.
2394
+ */
2395
+ export function goodsRepairLine({ shown, citing, uri, goods, state }) {
2396
+ if (!Number.isInteger(shown) || !Number.isInteger(citing)) return null;
2397
+ return shown === citing ? goodsHeldWholeDetail(shown, uri, goods, state) : goodsHeldWholeGroupedDetail(shown, citing, uri, goods);
2398
+ }
2399
+
2346
2400
  /**
2347
2401
  * Does the finding's own text say part of its goods statement is cut or unread? A sentence that names the cut and a
2348
2402
  * part of a goods statement: "The consultancy list is cut", "a further research clause … is cut and unread", "before a
@@ -2422,10 +2476,17 @@ export function runLint({ depth, commonLawGrid, matterContext, clientPartyName,
2422
2476
  // It used to be the report's two buckets, the methodology included, and so named a party from a line the email
2423
2477
  // never carried. The caller hands the conditions in, from the function the email composes its box with
2424
2478
  // (publish/email-conditions.mjs); a caller that hands none is not judged on the email.
2479
+ //
2480
+ // A PARTY THE REPORT INTRODUCES IS INTRODUCED TO THE EMAIL'S READER, who reaches the report from the email (owner
2481
+ // ruling, 2026-11-04). The report counts here as it counts for its own check: everything outside its action block,
2482
+ // so a condition cannot introduce itself through the report's copy of it. A report with no action block adds
2483
+ // nothing. Each condition is an item, written as one, so the word that opens it is read as an item's opening.
2425
2484
  if (Array.isArray(emailConditions)) {
2426
- const emailZone = emailConditions.join("\n");
2485
+ const emailZone = emailConditions.map((c) => `- ${c}`).join("\n");
2486
+ const reportZone = onlyYouZone(reportMd);
2427
2487
  checks.push(...referenceChecks({
2428
2488
  actionsText: emailZone, fullSurface: [emailZone, parseFront(String(reportMd)).fm.overall_caption, clientSummaryMd].filter(Boolean).join("\n"), searchedNames, surface: "email", extraVocab, markNames, structural: actionsExpected === true,
2489
+ introducedIn: reportZone ? String(reportMd).replace(reportZone, " ") : "",
2429
2490
  }).map((c) => ({ ...c, id: `${c.id}:email` })));
2430
2491
  }
2431
2492
  }
@@ -22,7 +22,7 @@ import { parseFrameworkManifest } from '../framework.mjs'; import { readFrozenMe
22
22
  import { rollupTokens, servedModels } from '../tokens.mjs';
23
23
  import { reportIdentityFor, productCoverageNote, isRegisterOnly } from '../search-policy.mjs';
24
24
  import { readRecordArtifacts, bindFindingsToRecords, joinEvidenceStatus } from '../registry-fidelity.mjs';
25
- import { deliveryFlagLines } from '../predelivery-lint.mjs';
25
+ import { deliveryFlagLines, deliveredFailure } from '../predelivery-lint.mjs';
26
26
  import { unrenderableConditions, clientStatement } from '../terminal-clamp.mjs'; // — the conditions that reach no client surface
27
27
  import { runLog } from '../log.mjs'; // — one line in the run record when one does
28
28
  import { PROVIDERS, config } from '../driver.config.mjs';
@@ -1038,7 +1038,7 @@ export async function publishReport({ runId, codename, reportMd, auditMd, findin
1038
1038
  // outcome and the text agree perfectly and both are short of a point. It says what happened on the
1039
1039
  // gaps sheet and in the run record now, in the run record's own words, so the borrowed sentence
1040
1040
  // comes off rather than being replaced by a better one (ruled 2026-09-17).
1041
- lint: (lintSink?.checks ?? []).filter(c => !c.pass && c.id !== 'client-condition-dropped')
1041
+ lint: (lintSink?.checks ?? []).filter(c => deliveredFailure(c) && c.id !== 'client-condition-dropped')
1042
1042
  .map(c => ({ id: c.id ?? '', family: c.family ?? '', detail: c.detail ?? '' })),
1043
1043
  engagement: integritySink?.engagement ?? null,
1044
1044
  registryCorrections: Array.isArray(integritySink?.registryCorrections)
@@ -173,8 +173,9 @@ export function keptModelOrdinal(state, ordinal) {
173
173
  /**
174
174
  * The model's ordinal behind a folded finding's citation of one record. A folded finding carries the citations of every
175
175
  * member the fold merged into it, so the member it kept may not be the one that cites the record: the answer is the
176
- * member whose own finding, in the model's record, cites `uri`, the kept member first. With no fold in force the ordinal
177
- * is its own. Where no member's finding is read citing the record, the kept member, as `keptModelOrdinal` answers.
176
+ * member whose own finding, in the model's record, cites `uri`, the kept member first. With no fold in force, or a
177
+ * finding folded with no other, the ordinal is `keptModelOrdinal`'s, whose finding is the one that cites it. Null where
178
+ * no member's finding is read citing the record: a citation the model's record does not show is not asserted.
178
179
  * `cites(finding, uri)` says whether a finding of the model's record cites the record. PURE.
179
180
  */
180
181
  export function citingModelOrdinal(state, ordinal, uri, modelFindings = [], cites = () => false) {
@@ -183,7 +184,7 @@ export function citingModelOrdinal(state, ordinal, uri, modelFindings = [], cite
183
184
  if (!Array.isArray(members) || members.length < 2) return kept;
184
185
  const byOrdinal = new Map((Array.isArray(modelFindings) ? modelFindings : []).map((f) => [f?.ordinal, f]));
185
186
  const order = [...(members.includes(kept) ? [kept] : []), ...members.filter((m) => m !== kept)];
186
- return order.find((m) => byOrdinal.has(m) && cites(byOrdinal.get(m), uri)) ?? kept;
187
+ return order.find((m) => byOrdinal.has(m) && cites(byOrdinal.get(m), uri)) ?? null;
187
188
  }
188
189
 
189
190
  /** The fold as it stands, to put back if a pass that changed it is rolled back. Never throws. */
@@ -2456,7 +2456,7 @@ export function parseRegisterPlan(raw) {
2456
2456
  // A NARROWING ASKS THE SAME QUESTION WITH TIGHTER LIMITS: the same predicate and the same terms, classes and markets
2457
2457
  // within the parent's, and the parent's goods words or fewer of them (a parent with none takes the client's goods
2458
2458
  // words, as the plan holds them), with the same owner. A list counts when its block is `enumerated`: complete, with no
2459
- // error. Only lists reached through such narrowings count, at any depth.
2459
+ // error. Only lists reached through such narrowings count, at any depth, and a list covers only the markets it asked.
2460
2460
  // list-retrieved a wider question with at least one narrowed list retrieved in full (named in `lists`).
2461
2461
  // no-list a wider question with none: the reading step decides it, with its count on the record.
2462
2462
  // required-covered the identical mark's own question, with a retrieved list in every class it asks, in
@@ -2558,10 +2558,15 @@ export function crowdNarrowing(plan, byQid, { mainMarkets = [] } = {}) {
2558
2558
  const inScope = main.length ? (scope.length ? main.filter((m) => scope.includes(m)) : main) : [];
2559
2559
  const cellMarkets = inScope.length ? inScope : (scope.length ? scope : [WORLDWIDE]);
2560
2560
  const cellClasses = classesOf(e).length ? classesOf(e) : ["*"];
2561
+ // A LIST COVERS ONLY THE MARKETS IT ASKED. A register can answer a list narrowed by goods with offices left out, and
2562
+ // the list's block names them (`offices_without_goods_field`). The list is complete for the offices it asked and read
2563
+ // none of the others, so it covers neither those markets nor a worldwide cell. Counted on its plan's markets, a list
2564
+ // that never asked a client's main market stood as that market's required read.
2565
+ const leftOutOf = (d) => marketsOf(byQid.get(d.qid)?.offices_without_goods_field);
2561
2566
  const covers = (c, m) => lists.some((d) => {
2562
- const dc = classesOf(d), dr = regionsOf(d);
2567
+ const dc = classesOf(d), dr = regionsOf(d), out = leftOutOf(d);
2563
2568
  const classOk = c === "*" ? !dc.length : (!dc.length || dc.includes(c));
2564
- const marketOk = m === WORLDWIDE ? !dr.length : (!dr.length || dr.includes(m));
2569
+ const marketOk = m === WORLDWIDE ? !dr.length && !out.length : (!dr.length || dr.includes(m)) && !out.includes(m);
2565
2570
  return classOk && marketOk;
2566
2571
  });
2567
2572
  const notCovered = [];
@@ -387,6 +387,12 @@
387
387
  "skips": 0,
388
388
  "todos": 0
389
389
  },
390
+ "a-correction-that-withdraws-every-step-gives-the-reviews-clear-back.pipeline.test.mjs": {
391
+ "tests": 15,
392
+ "asserts": 68,
393
+ "skips": 0,
394
+ "todos": 0
395
+ },
390
396
  "a-correction-to-a-line-that-is-not-a-finding-is-observed.test.mjs": {
391
397
  "tests": 7,
392
398
  "asserts": 33,
@@ -754,8 +760,8 @@
754
760
  "todos": 0
755
761
  },
756
762
  "a-finding-written-on-goods-the-register-cut-is-handed-the-whole-text.test.mjs": {
757
- "tests": 6,
758
- "asserts": 35,
763
+ "tests": 10,
764
+ "asserts": 64,
759
765
  "skips": 0,
760
766
  "todos": 0
761
767
  },
@@ -1275,6 +1281,12 @@
1275
1281
  "skips": 0,
1276
1282
  "todos": 0
1277
1283
  },
1284
+ "a-narrowed-list-covers-only-the-markets-it-asked.test.mjs": {
1285
+ "tests": 4,
1286
+ "asserts": 13,
1287
+ "skips": 0,
1288
+ "todos": 0
1289
+ },
1278
1290
  "a-near-spelling-no-buyer-could-confuse-is-set-aside-with-its-reason.test.mjs": {
1279
1291
  "tests": 5,
1280
1292
  "asserts": 25,
@@ -1371,12 +1383,24 @@
1371
1383
  "skips": 0,
1372
1384
  "todos": 0
1373
1385
  },
1386
+ "a-party-the-report-introduces-is-introduced-to-the-email.test.mjs": {
1387
+ "tests": 4,
1388
+ "asserts": 13,
1389
+ "skips": 0,
1390
+ "todos": 0
1391
+ },
1374
1392
  "a-pin-change-asks-for-a-bench-replay.test.mjs": {
1375
1393
  "tests": 16,
1376
1394
  "asserts": 37,
1377
1395
  "skips": 0,
1378
1396
  "todos": 0
1379
1397
  },
1398
+ "a-placement-boundary-is-a-notice-not-a-failed-check.test.mjs": {
1399
+ "tests": 2,
1400
+ "asserts": 13,
1401
+ "skips": 0,
1402
+ "todos": 0
1403
+ },
1380
1404
  "a-placement-decision-reads-alike-at-every-count.test.mjs": {
1381
1405
  "tests": 7,
1382
1406
  "asserts": 22,
@@ -3280,8 +3304,8 @@
3280
3304
  "todos": 0
3281
3305
  },
3282
3306
  "corrective-cycle.test.mjs": {
3283
- "tests": 8,
3284
- "asserts": 76,
3307
+ "tests": 11,
3308
+ "asserts": 108,
3285
3309
  "skips": 0,
3286
3310
  "todos": 0
3287
3311
  },
@@ -3658,8 +3682,8 @@
3658
3682
  "todos": 0
3659
3683
  },
3660
3684
  "doctor-reads-the-units-not-the-shell.test.mjs": {
3661
- "tests": 40,
3662
- "asserts": 116,
3685
+ "tests": 41,
3686
+ "asserts": 122,
3663
3687
  "skips": 3,
3664
3688
  "todos": 0
3665
3689
  },
@@ -4937,7 +4961,7 @@
4937
4961
  },
4938
4962
  "pipeline.mock.test.mjs": {
4939
4963
  "tests": 102,
4940
- "asserts": 863,
4964
+ "asserts": 865,
4941
4965
  "skips": 0,
4942
4966
  "todos": 0
4943
4967
  },
@@ -6713,7 +6737,7 @@
6713
6737
  },
6714
6738
  "the-doubt-carries-its-placement-tier.test.mjs": {
6715
6739
  "tests": 17,
6716
- "asserts": 56,
6740
+ "asserts": 57,
6717
6741
  "skips": 0,
6718
6742
  "todos": 0
6719
6743
  },
@@ -6808,8 +6832,8 @@
6808
6832
  "todos": 0
6809
6833
  },
6810
6834
  "the-first-hour-reads-true.test.mjs": {
6811
- "tests": 8,
6812
- "asserts": 42,
6835
+ "tests": 9,
6836
+ "asserts": 46,
6813
6837
  "skips": 0,
6814
6838
  "todos": 0
6815
6839
  },
@@ -6873,12 +6897,30 @@
6873
6897
  "skips": 0,
6874
6898
  "todos": 0
6875
6899
  },
6900
+ "the-goods-check-reads-the-evidence-the-writer-was-given.test.mjs": {
6901
+ "tests": 5,
6902
+ "asserts": 21,
6903
+ "skips": 0,
6904
+ "todos": 0
6905
+ },
6906
+ "the-goods-evidence-is-kept-where-the-writers-record-comes-from-the-salvage.test.mjs": {
6907
+ "tests": 1,
6908
+ "asserts": 6,
6909
+ "skips": 0,
6910
+ "todos": 0
6911
+ },
6876
6912
  "the-goods-record-reads-a-search-rows-goods-through-the-shared-reader.test.mjs": {
6877
6913
  "tests": 3,
6878
6914
  "asserts": 10,
6879
6915
  "skips": 0,
6880
6916
  "todos": 0
6881
6917
  },
6918
+ "the-goods-repair-reaches-the-text-a-grouped-finding-displays.test.mjs": {
6919
+ "tests": 8,
6920
+ "asserts": 115,
6921
+ "skips": 0,
6922
+ "todos": 0
6923
+ },
6882
6924
  "the-grant-sentence-and-its-carve-out-hold-per-provider.test.mjs": {
6883
6925
  "tests": 6,
6884
6926
  "asserts": 7,
@@ -51,6 +51,27 @@ export function verdictWithoutTheClosedGap({ verdict, assessed, reasons = [] } =
51
51
  return verdict === "CONDITIONAL" && assessed === "CLEAR" && !reasons.length ? "CLEAR" : verdict;
52
52
  }
53
53
 
54
+ /**
55
+ * THE RESULT ONCE A CORRECTION WITHDRAWS EVERY FORWARD LEGAL STEP THAT ALONE MADE IT CONDITIONAL (the owner's decision,
56
+ * 2026-11-04). The review said CLEAR and the floor raised it to CONDITIONAL on the record's steps (`raisedBySteps`). The
57
+ * withdrawal must be positive: a readable record whose actions register is a list holds none of them (`withdrawnAt`),
58
+ * no step was ever dropped as unreadable (`stepsUnreadable`), the review of that change was read after it
59
+ * (`reviewReadAt`, and no review since went unread), no correction since was rejected (`correctionRejectedAt`), and the
60
+ * recheck after the first review's correction, where one was owed, was accepted (`recheckUnaccepted`).
61
+ * Then the result is recomputed as a closed gap's is, from the assessment and the conditions still standing: CLEAR only
62
+ * when none is left. Anything short of that keeps the result as it stands. Times are ISO strings. PURE.
63
+ */
64
+ export function verdictWhenTheStepsAreWithdrawn({ verdict, assessed, reasons = [], raisedBySteps = false, stepsUnreadable = false,
65
+ withdrawnAt = null, reviewReadAt = null, reviewUnread = false, correctionRejectedAt = null, recheckUnaccepted = false } = {}) {
66
+ if (verdict !== "CONDITIONAL" || assessed !== "CLEAR" || raisedBySteps !== true || stepsUnreadable !== false) return verdict;
67
+ if (recheckUnaccepted !== false) return verdict;
68
+ const at = (t) => (typeof t === "string" ? Date.parse(t) : NaN);
69
+ const withdrawn = at(withdrawnAt), read = at(reviewReadAt);
70
+ if (!Number.isFinite(withdrawn) || !Number.isFinite(read) || !(read > withdrawn) || reviewUnread !== false) return verdict;
71
+ if (correctionRejectedAt != null && !(at(correctionRejectedAt) < withdrawn)) return verdict;
72
+ return verdictWithoutTheClosedGap({ verdict, assessed, reasons });
73
+ }
74
+
54
75
  /**
55
76
  * ONE SENTENCE WHEN THE WRITER'S DUTY AND THE RECALL GATE BOTH FIND RECORDS UNADDRESSED. Both state the approved
56
77
  * sentence for records neither addressed nor set aside, each out of its own population: the records the writer was
@@ -1,5 +1,13 @@
1
1
  # trademark-artifacts-mcp
2
2
 
3
+ ## 0.5.0
4
+
5
+ No changes in this release.
6
+
7
+ ## 0.5.0-beta.10
8
+
9
+ No changes in this release.
10
+
3
11
  ## 0.5.0-beta.9
4
12
 
5
13
  No changes in this release.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trademark-artifacts-mcp",
3
- "version": "0.5.0-beta.9",
3
+ "version": "0.5.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "private": true,
6
6
  "description": "MCP server to interrogate clearotron trademark-clearance runs — list/read artifacts, trace the full decision flow, telemetry/cost, coverage, single-run search, and a gated single-step what-if. Imports the clearotron-driver read-only; touches no driver/template/deploy files.",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "clearotron",
3
3
  "mcpName": "io.github.CordilleraSarl/clearotron",
4
4
  "type": "module",
5
- "version": "0.5.0-beta.9",
5
+ "version": "0.5.0",
6
6
  "license": "AGPL-3.0-only",
7
7
  "repository": {
8
8
  "type": "git",
@@ -92,6 +92,7 @@
92
92
  "ADDITIONAL-TERMS.md",
93
93
  "THIRD-PARTY-NOTICES.md",
94
94
  "INSTALL.md",
95
+ "QUICKSTART.md",
95
96
  "CODE_OF_CONDUCT.md",
96
97
  "CONTRIBUTING.md",
97
98
  "SECURITY.md",
@@ -2,7 +2,7 @@
2
2
  "name": "portal-ui",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "0.5.0-beta.9",
5
+ "version": "0.5.0",
6
6
  "license": "AGPL-3.0-only",
7
7
  "description": "The unified trademark portal UI. One address, one login: who you are decides what you see. Built as a static bundle, served by driver/portal-service.mjs — the browser never reaches profile-service or recipe-service.",
8
8
  "engines": {
@@ -1,5 +1,13 @@
1
1
  # trademark-oauth-mcp-bridge
2
2
 
3
+ ## 0.5.0
4
+
5
+ No changes in this release.
6
+
7
+ ## 0.5.0-beta.10
8
+
9
+ No changes in this release.
10
+
3
11
  ## 0.5.0-beta.9
4
12
 
5
13
  No changes in this release.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trademark-oauth-mcp-bridge",
3
- "version": "0.5.0-beta.9",
3
+ "version": "0.5.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "private": true,
6
6
  "description": "OAuth 2.1 MCP stdio bridge used by the engine's case-law gather stage (courtlistener / legaldatahunter).",
@@ -115,6 +115,8 @@ export const COUNTED_EVENTS = {
115
115
  "engine-turn-probe": { kind: FAILED, when: (e) => e.ok === false },
116
116
  // a finding still saying its goods are cut or unread after the delivery repair was given their complete statements
117
117
  "goods-held-whole": { kind: FAILED, when: (e) => (Array.isArray(e.unresolved) ? e.unresolved.length : 0) > 0 },
118
+ // a finding named for that repair and not handed to it, because the fold or the member citing the record was not read
119
+ "goods-held-whole-not-handed": { kind: FAILED, when: (e) => (Array.isArray(e.unhanded) ? e.unhanded.length : 0) > 0 },
118
120
  // a skeptic flag on a code-side axis re-runs its plan queries through the executor
119
121
  "escalation-recheck": [{ kind: REASK, when: (e) => e.dispatched === true },
120
122
  { kind: FAILED, when: (e) => e.outcome === "repair-budget-exhausted" }],
@@ -220,7 +222,7 @@ export const NOT_COUNTED_EVENTS = {
220
222
  "seam-reapplied", "search-policy", "searched-jurisdictions", "senior-rights", "skip",
221
223
  "stage-contract", "stage-limit-derived", "stage-stamps-reconciled", "start", "supplemental-fold", "token-rollup",
222
224
  "turnaround-reconciliation", "verdict", "verdict-conditions-followed", "verdict-conditions-recorded", "verdict-frontmatter",
223
- "whatif-settled-on-archive", "write-up-forms",
225
+ "verdict-recomputed-steps-withdrawn", "whatif-settled-on-archive", "write-up-forms",
224
226
  ],
225
227
  "a note about the answer's content that changes nothing in the run; the quality read judges it": [
226
228
  "audit-not-built-no-findings", "recall-reconciliation-unended-delivered", "late-evidence-no-digest-work", "changed-decision-unread-delivered", "ranking-changed-unread-delivered", "late-evidence-unassessed-delivered",
@@ -242,7 +244,7 @@ export const NOT_COUNTED_EVENTS = {
242
244
  "frame-reopen-reattempt", "grid-ledger-missing", "knockout-assess-invalidated", "lint-redo-skipped", "lint-redo-skipped-structural",
243
245
  "meaning-gap-coverage", "park-resumed", "plan-qids-sticky-gap", "recall-reconciliation-unended",
244
246
  "recovery-classified", "record-discard", "report-repair-targets", "screen-gate-unresolved", "skeptic-escalation", "stage-stale",
245
- "stale-repair-entry", "taint-disclose", "unsettled-inputs", "verdict-2", "verdict-3",
247
+ "stale-repair-entry", "taint-disclose", "unsettled-inputs", "verdict-2", "verdict-3", "verdict-recheck-unread",
246
248
  ],
247
249
  "read from its own record: the stage records, the dispatch records and the tool-call log": [
248
250
  "answer-part", "attempt", "stage", "settled", "started",