clearotron 0.6.0 → 0.7.0-beta.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.
Files changed (110) 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/branding.md +4 -4
  12. package/docs/report-data/clearance-1.schema.json +320 -0
  13. package/docs/report-data/knockout-1.schema.json +268 -0
  14. package/driver/CHANGELOG.md +39 -0
  15. package/driver/connotation-search.mjs +1 -1
  16. package/driver/contract-e3-backlog.mjs +1 -1
  17. package/driver/coverage-ledger.mjs +18 -2
  18. package/driver/deferral-row.mjs +1 -1
  19. package/driver/degraded-parts.mjs +1 -0
  20. package/driver/driver.config.mjs +4 -3
  21. package/driver/effective-scope.mjs +3 -1
  22. package/driver/engagement-receipt.mjs +3 -3
  23. package/driver/engine/anthropic-agent.mjs +15 -1
  24. package/driver/engine/common.mjs +7 -0
  25. package/driver/engine/mcp/band-server.mjs +7 -16
  26. package/driver/engine/mcp/codex-config.mjs +3 -0
  27. package/driver/engine/mcp/recording-server.mjs +45 -34
  28. package/driver/engine/openai-agent.mjs +74 -7
  29. package/driver/gateway.mjs +67 -10
  30. package/driver/jx.mjs +13 -5
  31. package/driver/manuals-seen.mjs +146 -0
  32. package/driver/mark-logos.mjs +144 -0
  33. package/driver/methodology-witness.mjs +2 -1
  34. package/driver/owner-use-check.mjs +3 -3
  35. package/driver/package.json +1 -1
  36. package/driver/pipeline-knockout.mjs +4 -0
  37. package/driver/pipeline.mjs +92 -7
  38. package/driver/portal-local-auth.mjs +6 -2
  39. package/driver/portal-report.mjs +43 -12
  40. package/driver/portal-routes/me.mjs +4 -1
  41. package/driver/portal-runs.mjs +6 -9
  42. package/driver/profiles.mjs +4 -4
  43. package/driver/publish/README.md +9 -7
  44. package/driver/publish/email-conditions.mjs +2 -2
  45. package/driver/publish/evidence-words.mjs +21 -0
  46. package/driver/publish/index.mjs +104 -90
  47. package/driver/publish/knockout.mjs +75 -49
  48. package/driver/publish/office-record-links.mjs +11 -9
  49. package/driver/publish/page-shell.mjs +98 -0
  50. package/driver/publish/publish-inputs.mjs +4 -0
  51. package/driver/publish/regions.mjs +24 -3
  52. package/driver/publish/register-record.mjs +150 -0
  53. package/driver/publish/render-knockout.mjs +195 -642
  54. package/driver/publish/render.mjs +270 -363
  55. package/driver/publish/report-data.mjs +225 -12
  56. package/driver/publish/strings.mjs +662 -0
  57. package/driver/publish/templates/knockout.css +200 -0
  58. package/driver/publish/templates/report.css +72 -52
  59. package/driver/publish/xlsx.mjs +148 -125
  60. package/driver/record-goods.mjs +42 -0
  61. package/driver/reference-score.mjs +4 -1
  62. package/driver/register-reach.mjs +39 -0
  63. package/driver/registry-fidelity.mjs +3 -8
  64. package/driver/repair-composers.mjs +6 -2
  65. package/driver/repair-targets.mjs +4 -1
  66. package/driver/run-delivered.mjs +6 -1
  67. package/driver/runner.mjs +73 -29
  68. package/driver/scope-facts.mjs +27 -6
  69. package/driver/search-policy.mjs +9 -4
  70. package/driver/stages.mjs +3 -3
  71. package/driver/steps/overview-and-cards.mjs +50 -14
  72. package/driver/steps/verdict-gate.mjs +33 -13
  73. package/driver/suite-census.json +368 -68
  74. package/driver/terminal-clamp.mjs +6 -1
  75. package/mcp-server/CHANGELOG.md +4 -0
  76. package/mcp-server/lib/audit-view.mjs +5 -2
  77. package/mcp-server/lib/brief.mjs +2 -1
  78. package/mcp-server/lib/evidence.mjs +31 -4
  79. package/mcp-server/lib/knockout.mjs +1 -1
  80. package/mcp-server/lib/scrub.mjs +1 -1
  81. package/mcp-server/package.json +1 -1
  82. package/mcp-server/server.mjs +5 -3
  83. package/package.json +4 -1
  84. package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-CtkllKJ2.js} +225 -77
  85. package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
  86. package/portal-ui/dist/index.html +2 -2
  87. package/portal-ui/package.json +3 -3
  88. package/providers/_shared/ledger.mjs +30 -2
  89. package/providers/_shared/record-uri.mjs +15 -0
  90. package/providers/clarivate/src/adapter.js +11 -0
  91. package/providers/clarivate/src/core.js +17 -1
  92. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  93. package/providers/oauth-mcp-bridge/package.json +1 -1
  94. package/scripts/README.md +147 -3
  95. package/scripts/e2e-first-time.mjs +3 -3
  96. package/scripts/freeze-example-run.mjs +3 -3
  97. package/scripts/mint-search-level-tags.mjs +61 -0
  98. package/scripts/mint-source-pin-census.mjs +89 -0
  99. package/scripts/release-note-required.mjs +65 -6
  100. package/scripts/test-durations-reporter.mjs +25 -0
  101. package/scripts/test-full.mjs +72 -18
  102. package/scripts/test-run.mjs +18 -1
  103. package/shared/brand.mjs +85 -5
  104. package/shared/inline-markdown.mjs +53 -0
  105. package/shared/portal-tokens.mjs +2 -1
  106. package/shared/register-selection.mjs +8 -3
  107. package/shared/search-level-tags.json +25 -0
  108. package/shared/tools/derive-band-pairs.mjs +10 -0
  109. package/driver/own-rights.mjs +0 -83
  110. package/driver/use-check.mjs +0 -85
@@ -1,83 +0,0 @@
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
- // own-rights.mjs — spec A4: the own-rights evidence gate for house-mark-dependent candidates.
4
- //
5
- // When a candidate's clearance reasoning RELIES on the client's own house mark or franchise root ("the
6
- // prefix is the client's own registered mark", "covered by the applicant's AGE OF EMPIRES registrations"),
7
- // that supporting claim must itself be EVIDENCED: an own-portfolio register sweep confirming the
8
- // registrations (existence, classes, key jurisdictions), cited in the narrative. The affiliate-exclusion
9
- // mandate governs CONFLICTS (don't flag the client against itself); it must never suppress this
10
- // supporting-evidence sweep — those are different things.
11
- //
12
- // Same enforcement substrate and shape as use-check.mjs: pure over the narrative document; a reliance
13
- // without its evidence line fails validators.narrative and drives the existing corrective-retry loop
14
- // (PR-8: synthesis holds the READ-ONLY band tools, so the check runs inline as an owner-scoped
15
- // band_lookup over the run's frozen register material — exactly like the inline use-check; synthesis
16
- // no longer carries live register tools). Because that frozen material is scoped to the matter's
17
- // dispatched slices, an empty owner lookup is NOT a register-negative about the client's portfolio —
18
- // the honest negative names what was consulted, and the missing owner query is raised as an open
19
- // Coverage/open-item row for the escalation lane (supplemental mint), never asserted as a sweep that
20
- // found nothing. The satisfying line is:
21
- // **Own-rights source:** /mark/<cc>/<id>[, /mark/...] (record URIs from the owner-scoped lookup)
22
- // or the honest scoped negative that removes the crutch:
23
- // **Own-rights source:** no applicant-owned registrations in the searched register material
24
- // (This module only requires the "Own-rights source:" line to exist — the source text is free-form,
25
- // so archived runs carrying the retired "own-portfolio sweep — no registrations found" still lint.)
26
-
27
- // Reasoning that leans on the client's/applicant's own rights. Anchored on the stock vocabulary; the
28
- // possessive forms ("client's own", "applicant's own", "its own registered") are the load-bearing signal.
29
- const OWN_RIGHTS_RELIANCE_RE = new RegExp([
30
- "(?:client|applicant|customer)'?s? own (?:live |registered |prior )?(?:mark|registration|rights|portfolio|family)",
31
- "house[- ]mark",
32
- "franchise (?:root|prefix|family)",
33
- "own[- ]rights (?:cover|protect|shield)",
34
- "(?:prefix|root|element) is (?:the )?(?:client|applicant|customer)'?s?(?: own)? (?:registered|live)",
35
- ].join("|"), "i");
36
-
37
- const OWN_RIGHTS_SOURCE_RE = /own-?rights source\s*:/i;
38
-
39
- // Applicant-own hypothesis: on an applicant-unknown run an identical hit carries a neutral
40
- // "if this is the applicant's own prior filing, disregard" note (2026-06-18 — replaces the retired
41
- // candidate-self treatment). That note is a HYPOTHESIS about identity, not clearance reasoning relying on
42
- // the client's rights — there is nothing to evidence until the applicant is named (the late-bind re-classify
43
- // resolves it). Without this exemption such a finding tripped own_rights_missing (caught by the B5 e2e suite).
44
- // Matches the new note AND the retired phrasing, defensively.
45
- const CANDIDATE_SELF_RE = /candidate-?self\s*:|is this you\?|if this is the applicant'?s own|own prior filing,?\s*disregard/i;
46
-
47
- function isFinding(heading, block) {
48
- return /\bfinding\b/i.test(heading) || /\*\*\s*composite\b/i.test(block) || /\bcandidate\b/i.test(heading);
49
- }
50
-
51
- /**
52
- * Find findings whose clearance reasoning relies on the client's own house mark/franchise root without
53
- * citing the own-portfolio sweep evidence. Pure: empty/missing input → no violations, never throws.
54
- *
55
- * @param {string} narrativeContent the narrative.md text
56
- * @returns {Array<{finding:string}>} offending findings (empty ⇒ clean)
57
- */
58
- export function findOwnRightsViolations(narrativeContent) {
59
- const lines = (narrativeContent || "").split("\n");
60
- const blocks = [];
61
- let cur = null;
62
- for (const ln of lines) {
63
- const h = ln.match(/^(#{2,4})\s+(.*)/);
64
- if (h) {
65
- if (cur) blocks.push(cur);
66
- cur = { heading: h[2].trim(), body: [] };
67
- } else if (cur) {
68
- cur.body.push(ln);
69
- }
70
- }
71
- if (cur) blocks.push(cur);
72
-
73
- const violations = [];
74
- for (const b of blocks) {
75
- const block = `${b.heading}\n${b.body.join("\n")}`;
76
- if (!isFinding(b.heading, block)) continue;
77
- if (CANDIDATE_SELF_RE.test(block)) continue; // B5c conditional treatment — hypothesis, not reliance
78
- if (!OWN_RIGHTS_RELIANCE_RE.test(block)) continue; // reasoning doesn't lean on the client's own rights
79
- if (OWN_RIGHTS_SOURCE_RE.test(block)) continue; // the sweep evidence (or honest negative) is cited
80
- violations.push({ finding: b.heading });
81
- }
82
- return violations;
83
- }
@@ -1,85 +0,0 @@
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
- // use-check.mjs — WS2 (spec 11): the deterministic enforcement substrate for the targeted use-check.
4
- //
5
- // The pivotal practical question for a registered-but-maybe-unused conflict is "does the owner actually USE
6
- // the mark for these goods?" On marble-keystone the run INFERRED "no use" from the owner's profile (a music act)
7
- // and simultaneously handed "confirm actual use" to the requester — a must-have, search-answerable question
8
- // both asserted and deferred. The Step-3.5 use-check that should have run is mandated in the skill prose AND
9
- // LEAKED anyway, so a stronger instruction is not the fix.
10
- //
11
- // Enforcement here is on the only machine-checkable substrate available: the DOCUMENT SHAPE of narrative.md.
12
- // (There is no perplexity call ledger — unlike the Corsearch record_fetch URIs the screen-gate cross-checks —
13
- // so the cited result inside the narrative is the only proof a query ran.) Rule: a finding at Composite ≥3
14
- // whose mitigant depends on the ABSENCE of use must carry a "**Use-check source:**" line (a real URL, or the
15
- // honest "perplexity_research — no result"). This is wired into validators.narrative (verify.mjs) and is FATAL
16
- // — a violating narrative cannot pass validation, so it cannot reach report-synthesis. Pure over the narrative
17
- // text, like screen-gate, so it tests without a gateway.
18
-
19
- // The mitigant/verdict depends on the (absence of) actual use. Anchored on the synthesis stage's own stock
20
- // vocabulary for a filed-but-unused conflict.
21
- const USE_NEGATIVE_RE = new RegExp([
22
- "non-use", // "vulnerable to non-use", "non-use cancellation/revocation"
23
- "not in actual use",
24
- "\\bunused\\b", // "almost certainly unused"
25
- "no [^.\\n]{0,40}\\buse\\b[^.\\n]{0,24}\\b(?:found|identified)\\b", // "no marketplace use … found"
26
- "\\buse\\b[^.\\n]{0,14}\\b(?:unknown|unconfirmed|unclear)\\b", // "owner's use unknown/unconfirmed"
27
- "filed-vs-used",
28
- ].join("|"), "i");
29
-
30
- // A cited use-result satisfies the requirement. Loose on purpose (bold optional) — we must NOT false-flag a
31
- // finding that already carries an honest use-result/inconclusive line.
32
- const USE_SOURCE_RE = /use-?check source\s*:/i;
33
-
34
- // Composite digit from a finding block, e.g. "**Composite — 3 (Medium).**" or "Composite 2 (Manageable)".
35
- function parseComposite(block) {
36
- const m = block.match(/\bComposite\b[^\d\n]{0,14}(\d)/i);
37
- return m ? Number(m[1]) : null;
38
- }
39
-
40
- // A block is a rated FINDING (the only thing the use-check polices) if its heading names a Finding or its body
41
- // carries a Composite marker. This deliberately excludes the "## Actions" / "## Bottom line" / coverage
42
- // sections, which paraphrase the same use language but are not the finding that must carry the searched result.
43
- function isFinding(heading, block) {
44
- return /\bfinding\b/i.test(heading) || /\*\*\s*composite\b/i.test(block);
45
- }
46
-
47
- /**
48
- * Find Composite ≥3 use-dependent findings that assert a use-negative without a searched use-result.
49
- *
50
- * A finding block VIOLATES when: it is a rated finding, its text matches a use-negative, it is Composite ≥3
51
- * (floor-safe: an unparseable Composite that still matches the use-negative is treated as ≥3 — never let a
52
- * format wobble drop the gate), AND it carries no "**Use-check source:**" line. Composite <3 never triggers
53
- * (a manageable finding doesn't justify the query). Pure: empty/missing input → no violations, never throws.
54
- *
55
- * @param {string} narrativeContent the narrative.md text
56
- * @returns {Array<{finding:string, composite:number|null}>} offending findings (empty ⇒ clean)
57
- */
58
- export function findUseCheckViolations(narrativeContent) {
59
- const lines = (narrativeContent || "").split("\n");
60
- const blocks = [];
61
- let cur = null;
62
- for (const ln of lines) {
63
- const h = ln.match(/^(#{2,4})\s+(.*)/);
64
- if (h) {
65
- if (cur) blocks.push(cur);
66
- cur = { heading: h[2].trim(), body: [] };
67
- } else if (cur) {
68
- cur.body.push(ln);
69
- }
70
- }
71
- if (cur) blocks.push(cur);
72
-
73
- const violations = [];
74
- for (const b of blocks) {
75
- const block = `${b.heading}\n${b.body.join("\n")}`;
76
- if (!isFinding(b.heading, block)) continue;
77
- if (!USE_NEGATIVE_RE.test(block)) continue; // mitigant doesn't turn on the absence of use
78
- const composite = parseComposite(block);
79
- const triggers = composite === null ? true : composite >= 3; // floor-safe on an unparseable Composite
80
- if (!triggers) continue;
81
- if (USE_SOURCE_RE.test(block)) continue; // a searched use-result (or honest "no result") is cited
82
- violations.push({ finding: b.heading, composite });
83
- }
84
- return violations;
85
- }