clearotron 0.6.0 → 0.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/INSTALL.md +7 -4
  2. package/QUICKSTART.md +1 -0
  3. package/README.md +5 -2
  4. package/THIRD-PARTY-NOTICES.md +1 -1
  5. package/bin/clearotron.mjs +4 -2
  6. package/bin/onboard.mjs +158 -29
  7. package/build-info.json +2 -2
  8. package/docs/CLIENT-MCP.md +3 -1
  9. package/docs/DELIVERY.md +6 -3
  10. package/docs/architecture/02-architecture.md +1 -1
  11. package/docs/architecture/04-configuration-reference.md +105 -8
  12. package/docs/branding.md +4 -4
  13. package/docs/report-data/clearance-1.schema.json +320 -0
  14. package/docs/report-data/knockout-1.schema.json +268 -0
  15. package/driver/CHANGELOG.md +77 -0
  16. package/driver/cancel.mjs +19 -0
  17. package/driver/connotation-search.mjs +1 -1
  18. package/driver/contract-e3-backlog.mjs +41 -41
  19. package/driver/contract-vocabulary.mjs +1 -1
  20. package/driver/coverage-ledger.mjs +18 -2
  21. package/driver/deferral-row.mjs +1 -1
  22. package/driver/degraded-parts.mjs +1 -0
  23. package/driver/driver.config.mjs +5 -5
  24. package/driver/effective-scope.mjs +3 -1
  25. package/driver/engagement-receipt.mjs +3 -3
  26. package/driver/engine/anthropic-agent.mjs +15 -1
  27. package/driver/engine/common.mjs +7 -0
  28. package/driver/engine/mcp/band-server.mjs +7 -16
  29. package/driver/engine/mcp/codex-config.mjs +3 -0
  30. package/driver/engine/mcp/recording-server.mjs +45 -34
  31. package/driver/engine/openai-agent.mjs +74 -7
  32. package/driver/engine/session-record.mjs +44 -2
  33. package/driver/findings-model.mjs +14 -2
  34. package/driver/follow-up-twins.mjs +86 -0
  35. package/driver/gateway.mjs +77 -12
  36. package/driver/jx-units.mjs +3 -1
  37. package/driver/jx.mjs +13 -5
  38. package/driver/manuals-inline.mjs +98 -0
  39. package/driver/manuals-seen.mjs +134 -0
  40. package/driver/mark-logos.mjs +174 -0
  41. package/driver/methodology-witness.mjs +2 -1
  42. package/driver/owner-use-check.mjs +8 -4
  43. package/driver/package.json +1 -1
  44. package/driver/pipeline-knockout.mjs +23 -4
  45. package/driver/pipeline.mjs +128 -15
  46. package/driver/portal-local-auth.mjs +6 -2
  47. package/driver/portal-report.mjs +45 -14
  48. package/driver/portal-routes/me.mjs +4 -1
  49. package/driver/portal-runs.mjs +19 -16
  50. package/driver/predelivery-lint.mjs +7 -5
  51. package/driver/profiles.mjs +4 -4
  52. package/driver/publish/README.md +9 -7
  53. package/driver/publish/email-conditions.mjs +22 -5
  54. package/driver/publish/evidence-words.mjs +21 -0
  55. package/driver/publish/index.mjs +304 -211
  56. package/driver/publish/knockout.mjs +297 -247
  57. package/driver/publish/office-record-links.mjs +11 -9
  58. package/driver/publish/page-shell.mjs +98 -0
  59. package/driver/publish/pool-admin.mjs +2 -2
  60. package/driver/publish/publish-inputs.mjs +4 -0
  61. package/driver/publish/regions.mjs +28 -3
  62. package/driver/publish/register-record-html.mjs +105 -0
  63. package/driver/publish/register-record.mjs +165 -0
  64. package/driver/publish/render-knockout.mjs +299 -671
  65. package/driver/publish/render.mjs +561 -492
  66. package/driver/publish/report-data.mjs +226 -13
  67. package/driver/publish/report-document.mjs +353 -0
  68. package/driver/publish/search-depth.mjs +88 -7
  69. package/driver/publish/shell.mjs +41 -1
  70. package/driver/publish/strings.mjs +810 -0
  71. package/driver/publish/templates/clearance-print.css +23 -0
  72. package/driver/publish/templates/knockout.css +224 -0
  73. package/driver/publish/templates/report.css +112 -53
  74. package/driver/publish/xlsx.mjs +158 -139
  75. package/driver/record-goods.mjs +42 -0
  76. package/driver/reference-score.mjs +4 -1
  77. package/driver/register-count.mjs +5 -1
  78. package/driver/register-reach.mjs +39 -0
  79. package/driver/registry-fidelity.mjs +155 -37
  80. package/driver/repair-composers.mjs +7 -3
  81. package/driver/repair-targets.mjs +4 -1
  82. package/driver/replay-archive.mjs +4 -3
  83. package/driver/run-delivered.mjs +14 -8
  84. package/driver/run-record.mjs +1 -0
  85. package/driver/runner.mjs +73 -29
  86. package/driver/scope-facts.mjs +27 -6
  87. package/driver/search-policy.mjs +9 -4
  88. package/driver/skills/clearance-search/report-prose.md +3 -0
  89. package/driver/skills/knockout-assess/SKILL.md +8 -0
  90. package/driver/stage-freshness.mjs +8 -5
  91. package/driver/stages.mjs +69 -43
  92. package/driver/steps/delivery.mjs +9 -5
  93. package/driver/steps/overview-and-cards.mjs +54 -15
  94. package/driver/steps/register-sweep.mjs +5 -4
  95. package/driver/steps/skeptic-and-follow-up.mjs +3 -2
  96. package/driver/steps/verdict-gate.mjs +35 -14
  97. package/driver/suite-census.json +579 -87
  98. package/driver/synthesis-record.mjs +4 -3
  99. package/driver/terminal-clamp.mjs +6 -1
  100. package/driver/withdrawn-rating.mjs +72 -0
  101. package/mcp-server/CHANGELOG.md +8 -0
  102. package/mcp-server/lib/audit-view.mjs +5 -2
  103. package/mcp-server/lib/brief.mjs +6 -2
  104. package/mcp-server/lib/evidence.mjs +94 -23
  105. package/mcp-server/lib/findings.mjs +19 -2
  106. package/mcp-server/lib/knockout.mjs +13 -4
  107. package/mcp-server/lib/scrub.mjs +1 -1
  108. package/mcp-server/package.json +1 -1
  109. package/mcp-server/server.mjs +22 -3
  110. package/package.json +4 -1
  111. package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-BBlN4CYq.js} +238 -80
  112. package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
  113. package/portal-ui/dist/index.html +2 -2
  114. package/portal-ui/package.json +3 -3
  115. package/providers/_shared/ledger.mjs +30 -2
  116. package/providers/_shared/record-uri.mjs +15 -0
  117. package/providers/clarivate/src/adapter.js +11 -0
  118. package/providers/clarivate/src/core.js +17 -1
  119. package/providers/jx/src/core.js +4 -4
  120. package/providers/jx/src/judge.js +1 -3
  121. package/providers/jx/src/nativeread.js +1 -3
  122. package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
  123. package/providers/oauth-mcp-bridge/package.json +1 -1
  124. package/scripts/README.md +147 -3
  125. package/scripts/added-reference-check.mjs +35 -7
  126. package/scripts/e2e-first-time.mjs +4 -4
  127. package/scripts/env-audit.mjs +16 -9
  128. package/scripts/freeze-example-run.mjs +3 -3
  129. package/scripts/mint-public-residue.mjs +3 -3
  130. package/scripts/mint-search-level-tags.mjs +61 -0
  131. package/scripts/mint-source-pin-census.mjs +89 -0
  132. package/scripts/release-note-required.mjs +65 -6
  133. package/scripts/test-durations-reporter.mjs +25 -0
  134. package/scripts/test-full.mjs +72 -18
  135. package/scripts/test-run.mjs +18 -1
  136. package/shared/brand.mjs +93 -6
  137. package/shared/inline-markdown.mjs +53 -0
  138. package/shared/names-in-force.mjs +0 -1
  139. package/shared/portal-tokens.mjs +2 -1
  140. package/shared/reference-guard-classes.mjs +43 -2
  141. package/shared/register-selection.mjs +8 -3
  142. package/shared/search-level-tags.json +25 -0
  143. package/shared/source-spans.mjs +91 -0
  144. package/shared/tools/derive-band-pairs.mjs +10 -0
  145. package/driver/own-rights.mjs +0 -83
  146. package/driver/use-check.mjs +0 -85
@@ -25,6 +25,33 @@ import { synthesisDutyForRun } from "../synthesis-record.mjs";
25
25
  import { clauseForDefect, gapPositivelyClosed, jointUnaccounted, orderClausesForLede, terminalClampDecision, verdictWhenTheStepsAreWithdrawn, verdictWithConditionsStanding, verdictWithoutTheClosedGap } from "../terminal-clamp.mjs";
26
26
  import { countCitedDefects, parseCorrections, parseVerdict } from "../verify.mjs";
27
27
  import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
28
+ import { stopsWithTheRun } from "../cancel.mjs"; // every paid call the code makes itself reads the stop first
29
+
30
+ /**
31
+ * THE COVERAGE FLOOR'S CONDITIONS, as run-record reasons and the client's clause for each, in the order the floor
32
+ * records them. PURE: the gate reads the receipts and hands their contents in.
33
+ *
34
+ * Every clause the floor composes itself is `null`: the reason stays in the run record and verdict.json, and the
35
+ * client's conditions get nothing in its place. These sentences are the engine's account of its own steps, and a
36
+ * client reads the list as the conditions on their result, so they are not ours to write (owner, 2026-09-17; ruled
37
+ * 2026-09-18 for the screen-gate line and for the class, engineering words come out of client text with nothing
38
+ * written in their place; ruled 2026-10-13 for the frame comparison). "The lawyer judged a material
39
+ * slice not fully cleared" read as a human lawyer's judgment, and "slice", "this run" and "(policy: clamp)" are
40
+ * engine words. The register lines are the exception: registerGapConditions carries clauses the owner ruled.
41
+ *
42
+ * @returns {{reason: string, clause: string|null}[]}
43
+ */
44
+ export function coverageFloorConditions({ coverageInsufficient = false, coverageReason = null, frameGap = false, frameDeferrals = [],
45
+ screenGateUnresolved = [], seniorUnverified = null, registerRows = [] } = {}) {
46
+ const out = [];
47
+ if (coverageInsufficient) out.push({ reason: `the lawyer judged a material slice not fully cleared: ${coverageReason || "register coverage gap"}`, clause: null });
48
+ if (frameGap) out.push({ reason: "the blind frame-diff flagged a dominant-element omission the reopen pass did not close", clause: null });
49
+ else if (frameDeferrals.length) out.push({ reason: `follow-ups left open this run: ${frameDeferrals.map((d) => plainDirective(d.directive)).slice(0, 3).join(", ")}`, clause: null });
50
+ if (screenGateUnresolved.length) out.push({ reason: `${screenGateUnresolved.length} in-scope mark(s) dropped on goods could not be record_fetched (unverified): ${screenGateUnresolved.map((g) => g.mark).join(", ")}`, clause: null });
51
+ if (seniorUnverified) out.push({ reason: `the oldest registration in a verdict-driving family could not be retrieved (policy: clamp): ${seniorUnverified.map((r) => r.mark).join(", ")}`, clause: null });
52
+ for (const { reason, clause } of registerRows) out.push({ reason, clause });
53
+ return out;
54
+ }
28
55
 
29
56
  export async function runVerdictGate({ P, agent, applyVerdictFrontMatter, correctiveCycleSettled, correctiveEntryVerdict, correctiveRecheckOk, coverageJudgment, ctx, opts, run, runState }, helpers) {
30
57
  const { StageFailure, actionsRegisterListed, conditionsFollowingTheRecord, defaultRecordFetcher, enrichFindingDeadlines, lateRecordsUnaddressed, loadCoverageLedger, loadScreenGateUnresolved, owedUrisFor, planAuditExtra, refusedRecordsLeftOut, registerGapConditions, safeReadJson, saveWithRetries, stage, withdrawByToken } = helpers;
@@ -84,7 +111,7 @@ export async function runVerdictGate({ P, agent, applyVerdictFrontMatter, correc
84
111
  } catch { /* no merged band (legacy run) — fetched-record facts alone rank */ }
85
112
  const srPrefix = `clearance-${run.slug}-${run.codename}-`;
86
113
  let srRecords = assembleRunRecords(run.runDir, srPrefix).records;
87
- const srFetcher = opts.recordFetcher ?? defaultRecordFetcher;
114
+ const srFetcher = stopsWithTheRun(run.runDir, "senior-rights-fetch", opts.recordFetcher ?? defaultRecordFetcher);
88
115
  const srLedger = ctx.repairLedger ?? (ctx.repairLedger = createRepairLedger(run.runDir, { log: (o) => runLog(run.runDir, o) }));
89
116
  const rows = [];
90
117
  for (const f of driving) {
@@ -598,19 +625,13 @@ export async function runVerdictGate({ P, agent, applyVerdictFrontMatter, correc
598
625
  // here and refused: the objection was the class, not the wording. RULED 2026-09-18, design item
599
626
  // 25 — cut the clause: it stays in the run record and leaves the client's result entirely, with
600
627
  // NOTHING written in its place. That is what the `null` clause below means.
601
- const reasons = [], clauseOf = new Map(); // run-record reason → the client's clause: the same words, with any engine token taken out
602
- const machinery = (reason, clause = reason) => { reasons.push(reason); clauseOf.set(reason, clause); };
603
- if (coverageInsufficient) machinery(`the lawyer judged a material slice not fully cleared: ${coverageJudgment.reason || "register coverage gap"}`);
604
- // The frame comparison's reason is the engine's account of its own steps: it stays in the run record, and the
605
- // client's conditions get nothing in its place (ruled 2026-10-13, as the screen-gate line below).
606
- if (frameGap) machinery("the blind frame-diff flagged a dominant-element omission the reopen pass did not close", null);
607
- else if (frameDeferrals.length) machinery(`follow-ups left open this run: ${frameDeferrals.map((d) => plainDirective(d.directive)).slice(0, 3).join(", ")}`);
608
- if (screenGateGap) machinery(`${sgUnresolved.length} in-scope mark(s) dropped on goods could not be record_fetched (unverified): ${sgUnresolved.map((g) => g.mark).join(", ")}`, null); // run record ONLY: no client clause (ruled 2026-09-18)
609
- if (seniorGap) machinery(`the oldest registration in a verdict-driving family could not be retrieved (policy: clamp): ${(ctx.seniorRights?.rows ?? []).filter((r) => r.applicable && !r.verified).map((r) => r.mark).join(", ")}`);
610
- if (registerGap) {
611
- for (const { reason, clause } of registerGapConditions(regGap)) machinery(reason, clause);
612
- // (the deferred and cut-down register lines: registerGapConditions, at the end of this file)
613
- }
628
+ const floor = coverageFloorConditions({
629
+ coverageInsufficient, coverageReason: coverageJudgment.reason, frameGap, frameDeferrals,
630
+ screenGateUnresolved: screenGateGap ? sgUnresolved : [],
631
+ seniorUnverified: seniorGap ? (ctx.seniorRights?.rows ?? []).filter((r) => r.applicable && !r.verified) : null,
632
+ registerRows: registerGap ? registerGapConditions(regGap) : [],
633
+ });
634
+ const reasons = floor.map((c) => c.reason), clauseOf = new Map(floor.map((c) => [c.reason, c.clause])); // run-record reason → the client's clause; null = the run record's alone
614
635
  // ── THE THIRD CLAMP SITE NAMES ITSELF, AND NAMES WHICH OF ITS SIX INPUTS FIRED ────────────────
615
636
  //
616
637
  // All three clamp sites emitted this event under one name with the same from/to, distinguishable