clearotron 0.5.1 → 0.6.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.
- package/.env.example +7 -7
- package/INSTALL.md +10 -10
- package/QUICKSTART.md +6 -6
- package/README.md +2 -2
- package/THIRD-PARTY-NOTICES.md +4 -4
- package/bin/README.md +2 -2
- package/bin/clearotron.mjs +1 -1
- package/bin/connect.mjs +1 -1
- package/bin/disconnect.mjs +1 -1
- package/bin/example.mjs +2 -2
- package/bin/grant.mjs +1 -1
- package/bin/onboard.mjs +78 -23
- package/bin/start.mjs +49 -18
- package/bin/update.mjs +13 -3
- package/build-info.json +2 -2
- package/docs/DELIVERY.md +1 -1
- package/docs/PORTAL.md +1 -1
- package/docs/RELEASES.md +1 -1
- package/docs/architecture/02-architecture.md +10 -2
- package/docs/architecture/03-run-lifecycle.md +6 -2
- package/docs/architecture/04-configuration-reference.md +3 -3
- package/docs/architecture/05-config-governance.md +5 -4
- package/docs/architecture/08-development-guide.md +4 -4
- package/docs/architecture/09-security-and-data.md +1 -1
- package/{driver/skills/clearance-search/SKILL.md → docs/architecture/retired-manuals/clearance-search-spine.md} +17 -30
- package/{driver/skills/clearance-search/templates/email/generic.md → docs/architecture/retired-manuals/email-generic.md} +1 -1
- package/{driver/skills/clearance-search → docs/architecture/retired-manuals}/template-formatting.md +3 -4
- package/docs/configuration.md +1 -1
- package/docs/decisions/0002-no-dark-functionality.md +5 -0
- package/driver/CHANGELOG.md +60 -0
- package/driver/README.md +11 -1
- package/driver/accepted-order.mjs +13 -5
- package/driver/attempt-rows.mjs +64 -0
- package/driver/attributed-span.mjs +1 -1
- package/driver/authority-trees.mjs +1 -1
- package/driver/best-draft.mjs +3 -3
- package/driver/blind-frame-record.mjs +2 -2
- package/driver/cancel.mjs +3 -2
- package/driver/carry-through.mjs +2 -2
- package/driver/citation-census.json +3 -3
- package/driver/clearance-variants-record.mjs +4 -10
- package/driver/common-law-coverage-status.mjs +3 -3
- package/driver/common-law-receipts.mjs +2 -2
- package/driver/compare.mjs +1 -1
- package/driver/config-inventory.mjs +6 -79
- package/driver/consumption-ledger.mjs +2 -1
- package/driver/contract-dictation-registry.mjs +5 -0
- package/driver/contract-e3-backlog.mjs +45 -66
- package/driver/contract-e3-baseline.json +16 -16
- package/driver/contract-vocabulary.mjs +8 -6
- package/driver/corrections-feedforward.mjs +3 -1
- package/driver/coverage-form-io.mjs +7 -8
- package/driver/coverage-tool.mjs +1 -1
- package/driver/declination-tool.mjs +2 -2
- package/driver/degraded-parts.mjs +9 -9
- package/driver/demo-container.mjs +5 -4
- package/driver/deploy-live-run-guard.mjs +19 -7
- package/driver/derived-state.mjs +2 -2
- package/driver/dev-portal.mjs +2 -1
- package/driver/dispatch-record.mjs +1 -1
- package/driver/disposition-tool.mjs +2 -1
- package/driver/doubt-closure-tool.mjs +2 -2
- package/driver/driver.config.mjs +35 -724
- package/driver/e2e-rounds.mjs +3 -4
- package/driver/engine/CONTRACT.md +3 -0
- package/driver/engine/README.md +2 -0
- package/driver/engine/anthropic-agent.mjs +8 -37
- package/driver/engine/auth.mjs +74 -0
- package/driver/engine/child-record.mjs +1 -1
- package/driver/engine/deny-authority-write.mjs +2 -2
- package/driver/engine/jx-turn.mjs +10 -2
- package/driver/engine/mcp/README.md +1 -1
- package/driver/engine/mcp/band-server.mjs +6 -6
- package/driver/engine/mcp/codex-config.mjs +1 -1
- package/driver/engine/mcp/declination-server.mjs +2 -3
- package/driver/engine/mcp/dispositions-server.mjs +3 -3
- package/driver/engine/mcp/gather-config.mjs +24 -19
- package/driver/engine/mcp/grid-provenance.mjs +1 -1
- package/driver/engine/mcp/held-answers.mjs +5 -5
- package/driver/engine/mcp/perplexity-server.mjs +16 -7
- package/driver/engine/mcp/recording-server.mjs +7 -6
- package/driver/engine/mcp/register-server.mjs +29 -0
- package/driver/engine/mcp/stdio-server.mjs +5 -5
- package/driver/engine/mcp/supplemental.mjs +9 -9
- package/driver/engine/openai-agent.mjs +5 -2
- package/driver/engine/registry.mjs +103 -0
- package/driver/engine/run-choices.mjs +162 -0
- package/driver/engine/stamps.mjs +35 -0
- package/driver/enqueue-schema.mjs +4 -4
- package/driver/envelope-settle.mjs +3 -2
- package/driver/feedback-issues.mjs +1 -1
- package/driver/feedback-mint.mjs +3 -2
- package/driver/feedback-store.mjs +3 -2
- package/driver/findings-model.mjs +1 -1
- package/driver/flag-snapshot.mjs +5 -4
- package/driver/floor-duty.mjs +3 -3
- package/driver/foreign-record-links.mjs +1 -1
- package/driver/frame-diff-record.mjs +2 -8
- package/driver/framework.mjs +1 -1
- package/driver/gate-metrics.mjs +10 -11
- package/driver/gateway.mjs +220 -839
- package/driver/goods-evidence.mjs +10 -6
- package/driver/jx-lanes.mjs +3 -3
- package/driver/jx-units.mjs +31 -37
- package/driver/jx.mjs +44 -59
- package/driver/knockout-assess-record.mjs +3 -3
- package/driver/knockout-caveats.mjs +21 -0
- package/driver/knockout-correction-record.mjs +58 -28
- package/driver/knockout-frame-record.mjs +2 -2
- package/driver/knockout-register-read.mjs +38 -21
- package/driver/knockout-register-record.mjs +5 -6
- package/driver/knockout-review-record.mjs +12 -11
- package/driver/ladder/model-gauge.mjs +88 -0
- package/driver/ladder/next-rung.mjs +296 -0
- package/driver/ladder/rescue.mjs +146 -0
- package/driver/ladder/stage-tools.mjs +57 -0
- package/driver/ladder/turn-failure.mjs +166 -0
- package/driver/log.mjs +2 -2
- package/driver/matter-frame-record.mjs +4 -4
- package/driver/methodology-witness.mjs +2 -2
- package/driver/narrative-refutation-record.mjs +145 -42
- package/driver/one-build-per-run.mjs +62 -0
- package/driver/outbox-backoff.mjs +4 -4
- package/driver/owner-screen.mjs +0 -10
- package/driver/owner-use-check.mjs +2 -28
- package/driver/package.json +1 -1
- package/driver/partial-payload-baseline.json +1 -1
- package/driver/parts-not-completed.mjs +1 -1
- package/driver/pipeline-knockout.mjs +1015 -1001
- package/driver/pipeline.mjs +511 -9265
- package/driver/placement-decisions.mjs +2 -2
- package/driver/placement-form-io.mjs +7 -9
- package/driver/placement-union.mjs +0 -6
- package/driver/plan-stability.mjs +7 -10
- package/driver/portal-acks.mjs +3 -2
- package/driver/portal-confirmation.mjs +48 -0
- package/driver/portal-families.mjs +3 -2
- package/driver/portal-local-auth.mjs +1 -2
- package/driver/portal-routes/README.md +24 -0
- package/driver/portal-routes/admin.mjs +425 -0
- package/driver/portal-routes/compose.mjs +66 -0
- package/driver/portal-routes/config.mjs +118 -0
- package/driver/portal-routes/connect.mjs +283 -0
- package/driver/portal-routes/feedback.mjs +178 -0
- package/driver/portal-routes/me.mjs +165 -0
- package/driver/portal-routes/queue.mjs +64 -0
- package/driver/portal-routes/report.mjs +106 -0
- package/driver/portal-routes/run.mjs +508 -0
- package/driver/portal-routes/runs.mjs +127 -0
- package/driver/portal-routes/usage.mjs +82 -0
- package/driver/portal-runs.mjs +588 -0
- package/driver/portal-service.mjs +78 -2592
- package/driver/portal-static.mjs +3 -1
- package/driver/predelivery-lint.mjs +92 -9
- package/driver/production-pool-guard.mjs +1 -1
- package/driver/profiles.mjs +5 -4
- package/driver/progress.mjs +29 -24
- package/driver/publish/README.md +10 -5
- package/driver/publish/archive-tags.mjs +3 -2
- package/driver/publish/demo-marking.mjs +2 -2
- package/driver/publish/index.mjs +215 -140
- package/driver/publish/knockout.mjs +153 -107
- package/driver/publish/office-record-links.mjs +22 -0
- package/driver/publish/parse.mjs +20 -5
- package/driver/publish/pool-admin.mjs +9 -3
- package/driver/publish/render.mjs +11 -3
- package/driver/publish/report-dates.mjs +3 -4
- package/driver/publish/report-registry.mjs +7 -10
- package/driver/publish/seed-pool.mjs +3 -2
- package/driver/publish/shell.mjs +106 -0
- package/driver/publish/templates/report.css +3 -1
- package/driver/queue-order.mjs +4 -3
- package/driver/record-carry.mjs +0 -9
- package/driver/record-discard.mjs +1 -4
- package/driver/record-fold.mjs +3 -3
- package/driver/record-goods.mjs +5 -5
- package/driver/reference-score.mjs +2 -3
- package/driver/register-capabilities.mjs +0 -6
- package/driver/register-count.mjs +3 -2
- package/driver/register-digest-record.mjs +7 -7
- package/driver/register-fixture-marker.mjs +3 -3
- package/driver/register-plan.mjs +2 -2
- package/driver/register-records.mjs +2 -2
- package/driver/register-taint.mjs +3 -3
- package/driver/register-unit-record.mjs +48 -9
- package/driver/register-unreachable.mjs +4 -3
- package/driver/registry-fidelity.mjs +79 -34
- package/driver/repair-composers.mjs +14 -9
- package/driver/repair-digest.mjs +4 -6
- package/driver/repair-scope.mjs +3 -3
- package/driver/repair-targets.mjs +24 -9
- package/driver/repairs.mjs +44 -58
- package/driver/replay-archive.mjs +7 -7
- package/driver/report-card-record.mjs +3 -3
- package/driver/report-overview-record.mjs +4 -4
- package/driver/research-answers.mjs +38 -6
- package/driver/research-checks.mjs +4 -4
- package/driver/result-noun-fields.mjs +28 -11
- package/driver/review-addresses.mjs +163 -0
- package/driver/rule-shape.mjs +1 -1
- package/driver/run-delivered.mjs +340 -0
- package/driver/run-economics.mjs +8 -26
- package/driver/run-failed.mjs +545 -0
- package/driver/run-integrity.mjs +1 -1
- package/driver/run-outcome.mjs +314 -0
- package/driver/run-park.mjs +23 -0
- package/driver/run-quote.mjs +32 -0
- package/driver/run-record.mjs +352 -0
- package/driver/run-requirements.mjs +22 -0
- package/driver/run-shell.mjs +55 -0
- package/driver/runner.mjs +71 -33
- package/driver/saved-register-pages.mjs +4 -4
- package/driver/score-redaction.mjs +2 -2
- package/driver/search-policy.mjs +12 -13
- package/driver/settle-stamp.mjs +4 -3
- package/driver/skeptic-record.mjs +2 -2
- package/driver/skeptic-search.mjs +1 -1
- package/driver/skills/README.md +7 -7
- package/driver/skills/blind-frame/SKILL.md +1 -2
- package/driver/skills/case-law-citation/SKILL.md +9 -37
- package/driver/skills/case-law-citation/sources/courtlistener.md +1 -3
- package/driver/skills/case-law-citation/sources/eurlex.md +8 -11
- package/driver/skills/case-law-citation/sources/legaldatahunter.md +1 -1
- package/driver/skills/clearance-common-law/SKILL.md +45 -111
- package/driver/skills/clearance-common-law/perplexity-prompts.md +7 -79
- package/driver/skills/clearance-register/SKILL.md +15 -33
- package/driver/skills/clearance-register/digest.md +31 -92
- package/driver/skills/clearance-register/providers/clarivate.md +2 -2
- package/driver/skills/clearance-register/providers/corsearch.md +5 -5
- package/driver/skills/clearance-register/providers/euipo.md +1 -2
- package/driver/skills/clearance-register/providers/free-tier.md +0 -19
- package/driver/skills/clearance-register/providers/signa.md +6 -25
- package/driver/skills/clearance-register/providers/uspto-local.md +0 -24
- package/driver/skills/clearance-register/register-recipes.md +8 -15
- package/driver/skills/clearance-register/status-rules.md +6 -24
- package/driver/skills/clearance-register/unit.md +11 -20
- package/driver/skills/clearance-search/delivery-contract.md +24 -120
- package/driver/skills/clearance-search/field-doctrine-pharma.md +1 -5
- package/driver/skills/clearance-search/firm-wide-reasoning.md +24 -43
- package/driver/skills/clearance-search/phase2-execution.md +29 -77
- package/driver/skills/clearance-search/report-prose.md +3 -4
- package/driver/skills/clearance-search/risk-framework-demo.md +1 -1
- package/driver/skills/clearance-search/risk-framework-triage.manifest.json +3 -3
- package/driver/skills/clearance-search/risk-framework-triage.md +7 -9
- package/driver/skills/clearance-search/risk-framework.manifest.json +1 -1
- package/driver/skills/clearance-search/risk-framework.md +1 -1
- package/driver/skills/clearance-search/synthesis-rules.md +30 -107
- package/driver/skills/clearance-search/worked-examples.md +5 -5
- package/driver/skills/clearance-variants/SKILL.md +46 -45
- package/driver/skills/clearance-variants/transliteration-scripts.md +4 -4
- package/driver/skills/frame-diff/SKILL.md +1 -1
- package/driver/skills/knockout-assess/SKILL.md +6 -14
- package/driver/skills/knockout-frame/SKILL.md +1 -1
- package/driver/skills/matter-frame/SKILL.md +7 -12
- package/driver/skills/matter-frame/watchlist-reference.md +1 -4
- package/driver/skills/narrative-refutation/SKILL.md +20 -30
- package/driver/skills/placement-inquiry/SKILL.md +8 -18
- package/driver/skills-store-provenance.mjs +1 -1
- package/driver/stage-context.mjs +32 -35
- package/driver/stage-freshness.mjs +127 -11
- package/driver/stages-knockout.mjs +49 -22
- package/driver/stages.mjs +88 -283
- package/driver/status-snapshot.mjs +2 -1
- package/driver/steps/correction-cycle.mjs +311 -0
- package/driver/steps/corrections.mjs +644 -0
- package/driver/steps/delivery.mjs +1287 -0
- package/driver/steps/frame-comparison.mjs +922 -0
- package/driver/steps/intake.mjs +84 -0
- package/driver/steps/open-run.mjs +419 -0
- package/driver/steps/overview-and-cards.mjs +899 -0
- package/driver/steps/placement-and-digest.mjs +23 -0
- package/driver/steps/register-sweep.mjs +1563 -0
- package/driver/steps/skeptic-and-follow-up.mjs +831 -0
- package/driver/steps/synthesis.mjs +261 -0
- package/driver/steps/verdict-gate.mjs +968 -0
- package/driver/suite-census.json +403 -91
- package/driver/surface-exit-verdict.mjs +0 -8
- package/driver/synthesis-record.mjs +72 -6
- package/driver/terminal-clamp.mjs +10 -0
- package/driver/tokens.mjs +8 -62
- package/driver/tool-calls.mjs +2 -2
- package/driver/unit-state-verdict.mjs +1 -1
- package/driver/usage-ledger.mjs +2 -1
- package/driver/verify-knockout.mjs +20 -35
- package/driver/verify.mjs +47 -36
- package/driver/web-grid.mjs +3 -4
- package/driver/whatif-memo-run.mjs +2 -2
- package/driver/whatif-queue.mjs +4 -3
- package/driver/withheld-families.mjs +14 -15
- package/driver/worker-heartbeat.mjs +3 -2
- package/driver/write-up-form.mjs +0 -3
- package/mcp-server/CHANGELOG.md +4 -0
- package/mcp-server/http-server.mjs +1 -1
- package/mcp-server/lib/brief.mjs +22 -4
- package/mcp-server/lib/events.mjs +2 -2
- package/mcp-server/lib/evidence.mjs +3 -2
- package/mcp-server/lib/findings.mjs +2 -1
- package/mcp-server/lib/knockout.mjs +9 -10
- package/mcp-server/lib/ops.mjs +9 -9
- package/mcp-server/lib/runs.mjs +9 -10
- package/mcp-server/lib/trace.mjs +1 -1
- package/mcp-server/lib/whatif.mjs +2 -3
- package/mcp-server/package.json +1 -1
- package/mcp-server/server.mjs +5 -5
- package/package.json +2 -1
- package/portal-ui/dist/assets/{index-fPqAU0sx.js → index-D5rkCjDc.js} +26 -14
- package/portal-ui/dist/index.html +1 -1
- package/portal-ui/package.json +3 -3
- package/providers/README.md +1 -1
- package/providers/_shared/answer-memory.mjs +4 -5
- package/providers/_shared/execute-plan.mjs +48 -1
- package/providers/_shared/records-from-search.mjs +46 -0
- package/providers/clarivate/README.md +2 -2
- package/providers/clarivate/src/adapter.js +147 -0
- package/providers/clarivate/src/core.js +1 -14
- package/{driver/engine/mcp/clarivate-server.mjs → providers/clarivate/src/mount.js} +5 -10
- package/providers/corsearch/README.md +3 -3
- package/providers/corsearch/src/adapter.js +80 -0
- package/providers/corsearch/src/core.js +14 -11
- package/{driver/engine/mcp/corsearch-server.mjs → providers/corsearch/src/mount.js} +5 -10
- package/providers/euipo/README.md +2 -2
- package/providers/euipo/src/adapter.js +85 -0
- package/providers/euipo/src/core.js +1 -1
- package/providers/euipo/src/euipo-client.js +1 -2
- package/{driver/engine/mcp/euipo-server.mjs → providers/euipo/src/mount.js} +5 -10
- package/providers/free-tier/README.md +2 -2
- package/providers/free-tier/src/adapter.js +127 -0
- package/{driver/engine/mcp/free-tier-server.mjs → providers/free-tier/src/mount.js} +5 -10
- package/providers/jx-subclass/coverage.mjs +1 -6
- package/providers/jx-subclass/score-truth.mjs +2 -1
- package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/providers/perplexity/src/core.js +2 -2
- package/providers/signa/README.md +2 -2
- package/providers/signa/src/adapter.js +157 -0
- package/providers/signa/src/capabilities.js +0 -3
- package/providers/signa/src/core.js +2 -2
- package/{driver/engine/mcp/signa-server.mjs → providers/signa/src/mount.js} +7 -12
- package/providers/signa/src/offices.generated.js +17 -15
- package/providers/uspto-local/README.md +1 -1
- package/providers/uspto-local/bin/verify-index.mjs +1 -1
- package/providers/uspto-local/src/adapter.js +75 -0
- package/{driver/engine/mcp/uspto-local-server.mjs → providers/uspto-local/src/mount.js} +5 -10
- package/scripts/band-shape-probe.mjs +2 -2
- package/scripts/citation-line-check.mjs +7 -7
- package/scripts/compare.mjs +1 -1
- package/scripts/dead-names.mjs +2 -2
- package/scripts/e2e-first-time.mjs +19 -7
- package/scripts/e2e.mjs +13 -13
- package/scripts/engine-probe.mjs +1 -1
- package/scripts/env-audit.mjs +7 -4
- package/scripts/env-classify.mjs +5 -1
- package/scripts/feedback-mint.mjs +1 -1
- package/scripts/freeze-example-run.mjs +7 -7
- package/scripts/mint-suite-census.mjs +2 -2
- package/scripts/nightly-notice.mjs +1 -1
- package/scripts/release-cut-decision.mjs +7 -2
- package/scripts/release-note-required.mjs +26 -9
- package/scripts/release-notes-lint.mjs +3 -2
- package/scripts/release-version-pr-checks.mjs +1 -1
- package/scripts/settings-render-check.mjs +23 -3
- package/scripts/test-run.mjs +5 -5
- package/scripts/travelling-predicates.mjs +1 -1
- package/scripts/undeclared-field-census.mjs +1 -1
- package/scripts/unexecuted-asserts.mjs +1 -1
- package/scripts/verify-publishable.mjs +1 -1
- package/shared/client-door.mjs +1 -1
- package/shared/connect-clients.mjs +1 -1
- package/shared/connector-signin-probe.mjs +1 -1
- package/shared/env-aliases.mjs +1 -1
- package/shared/invocation.mjs +14 -2
- package/shared/names-in-force.mjs +2 -0
- package/shared/register-selection.mjs +2 -2
- package/shared/store-in-repo.mjs +3 -3
- package/shared/summary-blocks.mjs +0 -3
- package/shared/trigger-lane.mjs +1 -1
- package/shared/vacuous-pass.mjs +2 -2
- package/shared/verb-shim.mjs +4 -2
- package/node_modules/exceljs/README.md +0 -3023
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
// A model free-typing into `classes:` welded an engine clause onto a class list. Structured KEYS are the
|
|
36
36
|
// allowlist; structured VALUES still have to be recognised, not trusted.
|
|
37
37
|
|
|
38
|
-
import { existsSync
|
|
38
|
+
import { existsSync } from "node:fs";
|
|
39
39
|
import { join } from "node:path";
|
|
40
40
|
import { parseAudit, stripEngineInternals } from "./driver.mjs";
|
|
41
41
|
import { readRecordArtifacts } from "../../driver/registry-fidelity.mjs";
|
|
42
|
+
import { readJson } from "../../driver/run-record.mjs";
|
|
42
43
|
|
|
43
44
|
// The client report's own display word per coverage state (publish/render.mjs COV_STATE). Carried here so
|
|
44
45
|
// the connector and the PDF call the same state the same thing; a state absent from the map degrades to
|
|
@@ -81,7 +82,7 @@ const clean = (s) => {
|
|
|
81
82
|
// below IS the rule, and it lives in exactly one place.
|
|
82
83
|
function readFindingsJson(runDir) {
|
|
83
84
|
try {
|
|
84
|
-
const doc =
|
|
85
|
+
const doc = readJson(join(runDir, "findings.json"));
|
|
85
86
|
return (doc && typeof doc === "object" && !Array.isArray(doc)) ? doc : null;
|
|
86
87
|
} catch { return null; }
|
|
87
88
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { existsSync, readFileSync } from "node:fs";
|
|
11
11
|
import { parseAudit, parseReport, parseBlocks, parseFront, parseSections, buildAuditMd, placementAuditRows } from "./driver.mjs";
|
|
12
|
+
import { readJson } from "../../driver/run-record.mjs";
|
|
12
13
|
|
|
13
14
|
// id-stamp the three block lists so callers (get_finding / trace) can address a single record.
|
|
14
15
|
function idStamp(lists) {
|
|
@@ -26,7 +27,7 @@ function idStamp(lists) {
|
|
|
26
27
|
function readRunFindings(P) {
|
|
27
28
|
try {
|
|
28
29
|
if (!P?.findings || !existsSync(P.findings)) return null;
|
|
29
|
-
const j =
|
|
30
|
+
const j = readJson(P.findings);
|
|
30
31
|
if (Array.isArray(j)) return j;
|
|
31
32
|
return Array.isArray(j?.findings) ? j.findings : null;
|
|
32
33
|
} catch { return null; }
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
//
|
|
25
25
|
// AND THE RULE THAT MATTERS MOST: a projection with no knockout equivalent returns a STATED refusal, never
|
|
26
26
|
// an empty list. `[]` reads as "we looked and found nothing" — that reading is the whole incident above.
|
|
27
|
-
import { existsSync,
|
|
27
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
28
28
|
import { basename, join } from "node:path";
|
|
29
29
|
|
|
30
30
|
import { koPaths, addressListedFilings, declaredRecordOrigins } from "./driver.mjs";
|
|
31
|
-
import {
|
|
31
|
+
import { paths, readJsonOrNull } from "../../driver/run-record.mjs";
|
|
32
32
|
|
|
33
|
-
const readJson = (p) => { try { return JSON.parse(readFileSync(p, "utf8")); } catch { return null; } };
|
|
34
33
|
|
|
35
34
|
/**
|
|
36
35
|
* Is this run a knockout? Answered from DISK, never from a stored lane string.
|
|
@@ -47,7 +46,7 @@ export function isKnockoutRun(run) {
|
|
|
47
46
|
|
|
48
47
|
/** The assessment artifact, parsed. `null` when the run has not reached the assess stage (or it failed). */
|
|
49
48
|
export function knockoutDoc(run) {
|
|
50
|
-
return run?.runDir ?
|
|
49
|
+
return run?.runDir ? readJsonOrNull(koPaths(run.runDir).findings) : null;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
const marksOf = (doc) => (Array.isArray(doc?.marks) ? doc.marks : []);
|
|
@@ -86,7 +85,7 @@ export function knockoutArtifacts(run) {
|
|
|
86
85
|
{ name: "registerCounts", file: basename(K.registerCounts), path: K.registerCounts },
|
|
87
86
|
{ name: "registerRecords", file: basename(K.registerRecords), path: K.registerRecords },
|
|
88
87
|
{ name: "sweepLedger", file: basename(K.sweepLedger), path: K.sweepLedger },
|
|
89
|
-
{ name: "runLog", file: "run.jsonl", path:
|
|
88
|
+
{ name: "runLog", file: "run.jsonl", path: paths(run.runDir).run },
|
|
90
89
|
].map((a) => ({ name: a.name, file: a.file, exists: existsSync(a.path) }));
|
|
91
90
|
|
|
92
91
|
// The published half. A knockout's report lives in the pool and NOWHERE in the run dir, so a list built
|
|
@@ -126,7 +125,7 @@ export function knockoutArtifactPath(run, name) {
|
|
|
126
125
|
const direct = {
|
|
127
126
|
frame: K.frame, plan: K.plan, findings: K.findings, assessment: K.assessment,
|
|
128
127
|
registerCounts: K.registerCounts, registerRecords: K.registerRecords,
|
|
129
|
-
sweepLedger: K.sweepLedger, "run.jsonl":
|
|
128
|
+
sweepLedger: K.sweepLedger, "run.jsonl": paths(run.runDir).run,
|
|
130
129
|
}[name];
|
|
131
130
|
if (direct) return direct;
|
|
132
131
|
if (name?.startsWith("research:")) return K.research(name.slice("research:".length));
|
|
@@ -206,7 +205,7 @@ const knockoutNegatives = (doc) => marksOf(doc).flatMap((m) =>
|
|
|
206
205
|
*/
|
|
207
206
|
export function knockoutEvidence(run) {
|
|
208
207
|
const doc = knockoutDoc(run);
|
|
209
|
-
const recordsDoc =
|
|
208
|
+
const recordsDoc = readJsonOrNull(koPaths(run.runDir).registerRecords);
|
|
210
209
|
// EACH FILING ADDRESSED AS PUBLISH ADDRESSES IT, keyed on the sidecar's own register. On a register with
|
|
211
210
|
// no record pages of its own, the listing's link is the engine's handle, `/mark/<office>/<id>`, which a
|
|
212
211
|
// reader can open nowhere, and the report never shows it for a filing with an office number: it gives the
|
|
@@ -285,7 +284,7 @@ export function knockoutSearches(run) {
|
|
|
285
284
|
}
|
|
286
285
|
// The register lane's own asked-and-unanswered terms, when it ran. `terms[].ok === false` is a search
|
|
287
286
|
// that did NOT answer — reporting it as a clean no-hit would be the un-run check dressed as a negative.
|
|
288
|
-
const recordsDoc =
|
|
287
|
+
const recordsDoc = readJsonOrNull(koPaths(run.runDir).registerRecords);
|
|
289
288
|
for (const entry of (Array.isArray(recordsDoc?.marks) ? recordsDoc.marks : [])) {
|
|
290
289
|
for (const t of (Array.isArray(entry.terms) ? entry.terms : [])) {
|
|
291
290
|
searches.push({
|
|
@@ -329,8 +328,8 @@ export function knockoutCoverage(run) {
|
|
|
329
328
|
+ `${(m.findings ?? []).length} conflict(s) recorded, ${(m.negatives ?? []).length} search(es) recorded as returning nothing.`,
|
|
330
329
|
}));
|
|
331
330
|
|
|
332
|
-
const recordsDoc =
|
|
333
|
-
const countsDoc =
|
|
331
|
+
const recordsDoc = readJsonOrNull(koPaths(run.runDir).registerRecords);
|
|
332
|
+
const countsDoc = readJsonOrNull(koPaths(run.runDir).registerCounts);
|
|
334
333
|
if (recordsDoc || countsDoc) {
|
|
335
334
|
areas.push({
|
|
336
335
|
area: "Register",
|
package/mcp-server/lib/ops.mjs
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import { writeFileSync, existsSync, mkdirSync, rmSync, renameSync, readFileSync, readdirSync } from "node:fs";
|
|
12
12
|
import { join, basename } from "node:path";
|
|
13
|
-
import { driverDir } from "../../shared/driver-dir.mjs"; // — one definition of where `_driver/` is
|
|
14
13
|
import { randomUUID } from "node:crypto";
|
|
15
14
|
import { config } from "./driver.mjs";
|
|
16
15
|
import { validateJob } from "../../driver/enqueue-schema.mjs";
|
|
@@ -23,6 +22,7 @@ import { readEngineChild, engineChildIsLive, endEngineChild } from "../../driver
|
|
|
23
22
|
import { killEscalateMs } from "../../driver/engine/common.mjs"; // the watchdogs' grace, reused by an immediate stop
|
|
24
23
|
import { stopReason } from "../../shared/stop-reason.mjs"; //
|
|
25
24
|
import { envFrom } from "../../shared/env-aliases.mjs"; // — resolves EITHER spelling; names the retired one because that is the live-writable half
|
|
25
|
+
import { driverDir, paths, readJson } from "../../driver/run-record.mjs"; // — one definition of where `_driver/` is
|
|
26
26
|
|
|
27
27
|
// Queue resolution (mirrors the enqueue CLI, docs/INTAKE.md): with NO explicit agent, a
|
|
28
28
|
// headless deployment's CLEAROTRON_QUEUE_DIR wins; otherwise the default agent's workspace queue. An
|
|
@@ -326,7 +326,7 @@ export async function stopRun(args = {}, { scope, endTurn = endEngineChild } = {
|
|
|
326
326
|
const scopedOut = (file) => {
|
|
327
327
|
if (!Array.isArray(scope?.accounts)) return false;
|
|
328
328
|
let jobAccount = null;
|
|
329
|
-
try { jobAccount =
|
|
329
|
+
try { jobAccount = readJson(file).profileKey ?? "generic"; } catch { jobAccount = null; }
|
|
330
330
|
try { assertAccountAccess(scope, jobAccount, `queued job "${args.id}"`); return false; } catch { return true; }
|
|
331
331
|
};
|
|
332
332
|
if (existsSync(f)) {
|
|
@@ -435,7 +435,7 @@ export async function stopRun(args = {}, { scope, endTurn = endEngineChild } = {
|
|
|
435
435
|
let wrote = false;
|
|
436
436
|
try {
|
|
437
437
|
const sp = join(run.runDir, "status.json");
|
|
438
|
-
const s =
|
|
438
|
+
const s = readJson(sp);
|
|
439
439
|
// BOTH due-clock keys are cleared (A4 split: resetsAt = rate-limit cap, recoveryResumesAt =
|
|
440
440
|
// recovery backoff) — a cancelled recovery-parked run must not keep a stale resume clock.
|
|
441
441
|
// — the sidecar written just below already carried `via`/`by`; status.json nulled it, so a
|
|
@@ -462,7 +462,7 @@ export async function stopRun(args = {}, { scope, endTurn = endEngineChild } = {
|
|
|
462
462
|
if (!alreadyStopping) {
|
|
463
463
|
try {
|
|
464
464
|
const sp = join(run.runDir, "status.json");
|
|
465
|
-
const s =
|
|
465
|
+
const s = readJson(sp);
|
|
466
466
|
s.stopRequestedAt = rec?.ts ?? new Date().toISOString();
|
|
467
467
|
s.updatedAt = new Date().toISOString();
|
|
468
468
|
writeFileSync(sp, JSON.stringify(s, null, 2) + "\n");
|
|
@@ -523,7 +523,7 @@ export function getDeliveryPacket(args = {}) {
|
|
|
523
523
|
if (!args.runId) throw new Error("get_delivery_packet: runId is required");
|
|
524
524
|
const run = resolveRun(String(args.runId));
|
|
525
525
|
if (!run) throw new Error(`get_delivery_packet: run "${args.runId}" not found`);
|
|
526
|
-
const read = (n) => { try { return
|
|
526
|
+
const read = (n) => { try { return readJson(driverDir(run.runDir, n)); } catch { return null; } };
|
|
527
527
|
const delivery = read("delivery.json");
|
|
528
528
|
const failure = read("failure.json");
|
|
529
529
|
if (!delivery && !failure)
|
|
@@ -623,8 +623,8 @@ export function markSent(args = {}) {
|
|
|
623
623
|
if (!args.runId) throw new Error("mark_sent: runId is required");
|
|
624
624
|
const run = resolveRun(String(args.runId));
|
|
625
625
|
if (!run) throw new Error(`mark_sent: run "${args.runId}" not found`);
|
|
626
|
-
const deliveryPath =
|
|
627
|
-
const failurePath =
|
|
626
|
+
const deliveryPath = paths(run.runDir).delivery;
|
|
627
|
+
const failurePath = paths(run.runDir).failure;
|
|
628
628
|
const packetPath = existsSync(deliveryPath) ? deliveryPath : failurePath;
|
|
629
629
|
if (!existsSync(packetPath))
|
|
630
630
|
throw new Error(`mark_sent: run "${run.runId}" has no delivery or failure packet — nothing was pending a send`);
|
|
@@ -645,7 +645,7 @@ export function markSent(args = {}) {
|
|
|
645
645
|
// already applies when it decides a marker is already queued (charter P1 §3): one settle clears every
|
|
646
646
|
// name that delivery could have been minted under. Best-effort per form; a missing one is a no-op.
|
|
647
647
|
const clearMarker = () => {
|
|
648
|
-
const packet = (() => { try { return
|
|
648
|
+
const packet = (() => { try { return readJson(packetPath); } catch { return {}; } })();
|
|
649
649
|
const sanitize = (s) => String(s).replace(/[^A-Za-z0-9._-]/g, "_"); // rescanOwedRuns' own marker-name gate
|
|
650
650
|
// The three OBSERVED ids are not the whole set: rescanOwedRuns DERIVES the legacy
|
|
651
651
|
// `<slug>-<codename>` form (outbox-backoff.mjs), and a marker minted under that name is named by
|
|
@@ -702,7 +702,7 @@ export function markSent(args = {}) {
|
|
|
702
702
|
let statusFlipped = true;
|
|
703
703
|
try {
|
|
704
704
|
const sp = join(run.runDir, "status.json");
|
|
705
|
-
const status =
|
|
705
|
+
const status = readJson(sp);
|
|
706
706
|
status.sendPending = false;
|
|
707
707
|
writeFileSync(`${sp}.tmp`, JSON.stringify(status, null, 2) + "\n");
|
|
708
708
|
renameSync(`${sp}.tmp`, sp);
|
package/mcp-server/lib/runs.mjs
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
// importing it, so the MCP stays a pure additive consumer (no edit to the shared driver file the parallel
|
|
7
7
|
// skill work may also touch). Keep SKIP_DIRS in sync with progress.mjs if that walk ever changes.
|
|
8
8
|
|
|
9
|
-
import { readdirSync,
|
|
9
|
+
import { readdirSync, existsSync } from "node:fs";
|
|
10
10
|
import { join } from "node:path";
|
|
11
|
-
import { DRIVER_DIR, driverDir } from "../../shared/driver-dir.mjs"; //
|
|
12
11
|
import { channelPackage } from "../../shared/permanent-install.mjs"; // — the check a reader is sent to, on this install's channel
|
|
13
12
|
import { config, paths, reportIdentityFor } from "./driver.mjs";
|
|
13
|
+
import { DRIVER_DIR, readJson, readJsonOrNull } from "../../driver/run-record.mjs";
|
|
14
14
|
|
|
15
15
|
// Mirror of progress.mjs SKIP_DIRS — the high-churn leaf dirs that never hold a run-level status.json.
|
|
16
16
|
const SKIP_DIRS = new Set([DRIVER_DIR, "register-units", "queue", "_history", "_experiments"]);
|
|
@@ -53,7 +53,7 @@ export const bandWord = (v) => {
|
|
|
53
53
|
export function tierFromRecord(runDir) {
|
|
54
54
|
if (!runDir) return null;
|
|
55
55
|
try {
|
|
56
|
-
const v =
|
|
56
|
+
const v = readJson(paths(runDir).verdict);
|
|
57
57
|
const t = String(v?.tier ?? "").trim();
|
|
58
58
|
return t || null;
|
|
59
59
|
} catch { return null; }
|
|
@@ -90,12 +90,11 @@ export function studioRoots() {
|
|
|
90
90
|
return out;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function readJson(p) { try { return JSON.parse(readFileSync(p, "utf8")); } catch { return null; } }
|
|
94
93
|
|
|
95
94
|
// Build a Run summary from a status.json path. runDir = its parent; location from the path (archive vs live).
|
|
96
95
|
function runFromStatusFile(statusFile, agent) {
|
|
97
96
|
const runDir = statusFile.slice(0, -"/status.json".length);
|
|
98
|
-
const s =
|
|
97
|
+
const s = readJsonOrNull(statusFile);
|
|
99
98
|
if (!s || !s.slug || !s.codename) return null; // a torn/partial status.json is skipped, never thrown
|
|
100
99
|
return {
|
|
101
100
|
runId: s.runId ?? `${s.slug}-${s.date}-${s.codename}`,
|
|
@@ -221,7 +220,7 @@ export function readReportData(run) {
|
|
|
221
220
|
let names = [];
|
|
222
221
|
try { names = readdirSync(dir).filter((n) => /^report-data(-.+)?\.json$/.test(n)).sort(); } catch { return []; }
|
|
223
222
|
const out = [];
|
|
224
|
-
for (const n of names) { const d =
|
|
223
|
+
for (const n of names) { const d = readJsonOrNull(join(dir, n)); if (d && typeof d === "object") out.push(d); }
|
|
225
224
|
return out;
|
|
226
225
|
}
|
|
227
226
|
|
|
@@ -240,7 +239,7 @@ export function readReportData(run) {
|
|
|
240
239
|
// render-knockout.mjs).
|
|
241
240
|
export function productIdentityFor(run, docs = null) {
|
|
242
241
|
try {
|
|
243
|
-
const pol =
|
|
242
|
+
const pol = readJson(paths(run.runDir).searchPolicy);
|
|
244
243
|
const id = reportIdentityFor(pol).identity;
|
|
245
244
|
if (id) return id;
|
|
246
245
|
} catch { /* no frozen sidecar on this run — fall through to the published level id */ }
|
|
@@ -261,7 +260,7 @@ export function productIdentityFor(run, docs = null) {
|
|
|
261
260
|
// full-grant sessions.
|
|
262
261
|
export function runAccountKey(run) {
|
|
263
262
|
try {
|
|
264
|
-
const p =
|
|
263
|
+
const p = readJson(paths(run.runDir).profile);
|
|
265
264
|
return p.profileKey ?? p.key ?? null;
|
|
266
265
|
} catch { return null; }
|
|
267
266
|
}
|
|
@@ -280,7 +279,7 @@ export function runAccountKey(run) {
|
|
|
280
279
|
// `known: false` says the engine cannot tell, which is a different sentence and an actionable one.
|
|
281
280
|
export function runProfileFacts(run) {
|
|
282
281
|
try {
|
|
283
|
-
const p =
|
|
282
|
+
const p = readJson(paths(run.runDir).profile);
|
|
284
283
|
const key = p.profileKey ?? p.key ?? null;
|
|
285
284
|
return {
|
|
286
285
|
known: true,
|
|
@@ -299,7 +298,7 @@ export function runProfileFacts(run) {
|
|
|
299
298
|
// visible only to a full-grant session.
|
|
300
299
|
export function runOrganisation(run) {
|
|
301
300
|
try {
|
|
302
|
-
const p =
|
|
301
|
+
const p = readJson(paths(run.runDir).profile);
|
|
303
302
|
return typeof p.organisation === "string" && p.organisation ? p.organisation : null;
|
|
304
303
|
} catch { return null; }
|
|
305
304
|
}
|
package/mcp-server/lib/trace.mjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { readFileSync, existsSync, readdirSync } from "node:fs";
|
|
16
16
|
import { join, basename } from "node:path";
|
|
17
|
-
import { driverDir, driverFileName } from "../../
|
|
17
|
+
import { driverDir, driverFileName } from "../../driver/run-record.mjs"; //
|
|
18
18
|
import { STAGES, STAGE_ORDER, stageInputs, stageOrdinal, REGISTER_AXES, fileMeta, parseVerdict } from "./driver.mjs";
|
|
19
19
|
import { loadFindings } from "./findings.mjs";
|
|
20
20
|
import { providerUsage } from "./usage.mjs";
|
|
@@ -23,12 +23,11 @@
|
|
|
23
23
|
import { STAGES, STAGE_ORDER, stageOrdinal, REGISTER_AXES, axisTier, resolveModel, config, deriveSlug } from "./driver.mjs";
|
|
24
24
|
import { readCapped } from "./util.mjs";
|
|
25
25
|
import { join, basename } from "node:path";
|
|
26
|
-
import { readFileSync } from "node:fs"; // the canonical run's frozen profile
|
|
27
|
-
import { driverDir } from "../../shared/driver-dir.mjs"; //
|
|
28
26
|
// — the SHARED eligibility composer. A leaf module (fs/path/crypto only), so a
|
|
29
27
|
// static import here costs the read-only surface nothing and buys the one thing three copies of this
|
|
30
28
|
// question could not give: the same answer at the door and at the worker.
|
|
31
29
|
import { whatIfRefusal } from "../../driver/whatif-queue.mjs";
|
|
30
|
+
import { driverDir, paths, readJson } from "../../driver/run-record.mjs";
|
|
32
31
|
|
|
33
32
|
// ── — THE NOTE SAYS WHAT IS TRUE, AND IT IS THE STRONGER SENTENCE ────────
|
|
34
33
|
//
|
|
@@ -294,7 +293,7 @@ export async function whatIfRun({ confirmationToken } = {}, deps = {}) {
|
|
|
294
293
|
// resolveProfile THROWS `profile_key_unknown` on a named key it cannot find, so a what-if against a
|
|
295
294
|
// store that no longer holds the customer now refuses instead of substituting one.
|
|
296
295
|
const canonicalProfileKey = (() => {
|
|
297
|
-
try { return
|
|
296
|
+
try { return readJson(paths(run.runDir).profile)?.profileKey ?? null; }
|
|
298
297
|
catch { return null; }
|
|
299
298
|
})();
|
|
300
299
|
if (canonicalProfileKey) job.profileKey = canonicalProfileKey;
|
package/mcp-server/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trademark-artifacts-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-beta.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/mcp-server/server.mjs
CHANGED
|
@@ -26,9 +26,8 @@ import {
|
|
|
26
26
|
ListResourcesRequestSchema, ReadResourceRequestSchema, ListResourceTemplatesRequestSchema,
|
|
27
27
|
ListPromptsRequestSchema, GetPromptRequestSchema,
|
|
28
28
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
29
|
-
import { existsSync, readdirSync
|
|
29
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
30
30
|
import { join, basename } from "node:path";
|
|
31
|
-
import { driverDir } from "../shared/driver-dir.mjs"; //
|
|
32
31
|
import { fileURLToPath } from "node:url";
|
|
33
32
|
|
|
34
33
|
import { enumerateRuns, resolveRun, runAccountKey, runOrganisation, runProfileFacts, productIdentityFor, unreadableRunsReason } from "./lib/runs.mjs";
|
|
@@ -93,6 +92,7 @@ import { instructionsFor } from "./lib/instructions.mjs";
|
|
|
93
92
|
import { isEntrypoint } from "../shared/is-entrypoint.mjs"; // — one entry-point test, all spellings
|
|
94
93
|
import { BRAND } from "../shared/brand.mjs"; // — the operator name a client is told to expect, from the tenant seam
|
|
95
94
|
import { productIdentity } from "../shared/product-identity.mjs"; // AGPL §13 — one answer, three surfaces
|
|
95
|
+
import { driverDir, readJson } from "../driver/run-record.mjs";
|
|
96
96
|
|
|
97
97
|
const NS = "trademark-artifacts";
|
|
98
98
|
const log = (...a) => process.stderr.write(`[${NS}] ${a.join(" ")}\n`);
|
|
@@ -129,7 +129,7 @@ function artifactPath(run, name) {
|
|
|
129
129
|
// That is the defect this issue is about, reappearing one layer down. Returning null instead makes the
|
|
130
130
|
// tool refuse the name and name the artifacts this run actually has.
|
|
131
131
|
if (isKnockoutRun(run)) return knockoutArtifactPath(run, name);
|
|
132
|
-
if (name === "run.jsonl" || name === "telemetry/run.jsonl") return
|
|
132
|
+
if (name === "run.jsonl" || name === "telemetry/run.jsonl") return paths(runDir).run;
|
|
133
133
|
if (REGISTER_AXES.includes(name)) return P.registerUnit(name);
|
|
134
134
|
// validate the axis against the known set — never let a "registerUnit:../../x" escape the run-dir
|
|
135
135
|
if (name.startsWith("registerUnit:")) { const ax = name.split(":")[1]; return REGISTER_AXES.includes(ax) ? P.registerUnit(ax) : null; }
|
|
@@ -148,7 +148,7 @@ function listArtifacts(run) {
|
|
|
148
148
|
for (const [k, v] of Object.entries(P)) { if (k === "runDir" || typeof v === "function") continue; if (existsSync(v)) out.push({ name: k, file: basename(v) }); }
|
|
149
149
|
for (const ax of REGISTER_AXES) { const p = P.registerUnit(ax); if (existsSync(p)) out.push({ name: `registerUnit:${ax}`, file: basename(p) }); }
|
|
150
150
|
if (existsSync(join(run.runDir, "status.json"))) out.push({ name: "status.json", file: "status.json" });
|
|
151
|
-
if (existsSync(
|
|
151
|
+
if (existsSync(paths(run.runDir).run)) out.push({ name: "run.jsonl", file: "_driver/run.jsonl" });
|
|
152
152
|
return out;
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -250,7 +250,7 @@ function runSummary(run) {
|
|
|
250
250
|
function channelState(runDir) {
|
|
251
251
|
const legacySent = existsSync(join(runDir, ".sent"));
|
|
252
252
|
let receipts = {};
|
|
253
|
-
try { receipts =
|
|
253
|
+
try { receipts = readJson(paths(runDir).sendReceipts) ?? {}; }
|
|
254
254
|
catch { /* absent (fresh/legacy run) or unreadable — fall back to the .sent marker alone */ }
|
|
255
255
|
const chan = (key, idField) => ({
|
|
256
256
|
sent: Boolean(receipts[key]) || legacySent,
|
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
|
+
"version": "0.6.0-beta.0",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -129,6 +129,7 @@
|
|
|
129
129
|
"!driver/skills/clearance-search/worked-examples-*",
|
|
130
130
|
"driver/skills/clearance-search/worked-examples.md",
|
|
131
131
|
"driver/skills/clearance-search/worked-examples-demo.md",
|
|
132
|
+
"!scripts/secret-scanner-fetch.mjs",
|
|
132
133
|
"!scripts/home-render-check.mjs",
|
|
133
134
|
"!scripts/ai-page-render-check.mjs",
|
|
134
135
|
"!scripts/composer-render-check.mjs",
|
|
@@ -11446,6 +11446,9 @@ function runKey(run) {
|
|
|
11446
11446
|
// src/contract/api.ts
|
|
11447
11447
|
var isOk = (r) => r.kind === "ok";
|
|
11448
11448
|
var companyRead = (needsOwner, read) => needsOwner ? Promise.resolve({ kind: "pickAccount" }) : read();
|
|
11449
|
+
function mustPickCompany(me, owner) {
|
|
11450
|
+
return owner === null && (me.allAccounts || me.accounts.length !== 1);
|
|
11451
|
+
}
|
|
11449
11452
|
function saveFailureText(r, fallback = "That change could not be saved.") {
|
|
11450
11453
|
switch (r.kind) {
|
|
11451
11454
|
case "ok": return fallback;
|
|
@@ -14837,8 +14840,8 @@ function blockers(d, product, names = 0, inheritedTerritories = []) {
|
|
|
14837
14840
|
const budget = nameBudget(product, names);
|
|
14838
14841
|
if (budget) out.push(budget.allowed === 1 ? `A ${product.name} reads one name at a time, and you have ${budget.allowed + budget.over}.` : `A ${product.name} reads ${budget.allowed} names at a time, and you have ${budget.allowed + budget.over}.`);
|
|
14839
14842
|
const named = product.geography !== "worldwide, and nothing else" && !d.territories.length ? inheritedTerritories : d.territories;
|
|
14840
|
-
const countries = named.filter((t) =>
|
|
14841
|
-
const regions = named.filter((t) =>
|
|
14843
|
+
const countries = named.filter((t) => tierOfPlace(t) === "country");
|
|
14844
|
+
const regions = named.filter((t) => tierOfPlace(t) === "region");
|
|
14842
14845
|
switch (product.geography) {
|
|
14843
14846
|
case "worldwide, and nothing else":
|
|
14844
14847
|
if (named.length) out.push(`A ${product.name} is worldwide and is not narrowed. Remove the territories, or pick a Multi-country focus search to read them.`);
|
|
@@ -18947,7 +18950,7 @@ function engineNotice({ programDisputed }) {
|
|
|
18947
18950
|
return {
|
|
18948
18951
|
state: "absent",
|
|
18949
18952
|
headline: NO_ENGINE,
|
|
18950
|
-
before: "
|
|
18953
|
+
before: "Demo mode — new searches are unavailable. The example report, its audit trail and the assistant connection need no engine. The setup wizard offers to install a reasoning CLI if this machine has none, and asks how it is paid for. To start new searches, run the setup wizard",
|
|
18951
18954
|
namesSetupCommand: true,
|
|
18952
18955
|
after: "Then restart the service: this reading was taken when it started, and it will not notice a new install until it starts again."
|
|
18953
18956
|
};
|
|
@@ -19377,9 +19380,9 @@ function useUnsaved(dirty) {
|
|
|
19377
19380
|
ref.current = dirty;
|
|
19378
19381
|
(0, import_react.useEffect)(() => registerGuard(() => ref.current), []);
|
|
19379
19382
|
}
|
|
19380
|
-
function unsavedChanges({ current, empty, saved, submitted }) {
|
|
19383
|
+
function unsavedChanges({ current, empty, saved, submitted, untouched = null }) {
|
|
19381
19384
|
if (submitted) return false;
|
|
19382
|
-
if (current === empty) return false;
|
|
19385
|
+
if (current === empty || current === untouched) return false;
|
|
19383
19386
|
return current !== saved;
|
|
19384
19387
|
}
|
|
19385
19388
|
// src/contract/companyCreated.ts
|
|
@@ -19429,7 +19432,7 @@ var EMPTY = {
|
|
|
19429
19432
|
};
|
|
19430
19433
|
function NewClearance({ ctx }) {
|
|
19431
19434
|
const account = ctx.owner;
|
|
19432
|
-
const needsOwner = ctx.me
|
|
19435
|
+
const needsOwner = mustPickCompany(ctx.me, account);
|
|
19433
19436
|
const { result: searches, reload: retrySearches } = useLoad(() => companyRead(needsOwner, () => api.searches(account)), [account, needsOwner]);
|
|
19434
19437
|
const { result: profileRes } = useLoad(() => companyRead(needsOwner, () => api.profile(account)), [account, needsOwner]);
|
|
19435
19438
|
const { result: projectsRes } = useLoad(() => companyRead(needsOwner, () => api.projects(account)), [account, needsOwner]);
|
|
@@ -19463,6 +19466,7 @@ function NewClearance({ ctx }) {
|
|
|
19463
19466
|
const [submitted, setSubmitted] = (0, import_react.useState)(null);
|
|
19464
19467
|
const [savedDraft, setSavedDraft] = (0, import_react.useState)(null);
|
|
19465
19468
|
const [landed, setLanded] = (0, import_react.useState)(null);
|
|
19469
|
+
const [autoDraft, setAutoDraft] = (0, import_react.useState)(null);
|
|
19466
19470
|
const [leaveTo, setLeaveTo] = (0, import_react.useState)(null);
|
|
19467
19471
|
(0, import_react.useEffect)(() => {
|
|
19468
19472
|
if (leaveTo) ctx.go(leaveTo);
|
|
@@ -19471,12 +19475,14 @@ function NewClearance({ ctx }) {
|
|
|
19471
19475
|
current: JSON.stringify(draft),
|
|
19472
19476
|
empty: JSON.stringify(EMPTY),
|
|
19473
19477
|
saved: savedDraft,
|
|
19474
|
-
submitted: submitted != null || landed != null
|
|
19478
|
+
submitted: submitted != null || landed != null,
|
|
19479
|
+
untouched: autoDraft
|
|
19475
19480
|
}), [
|
|
19476
19481
|
draft,
|
|
19477
19482
|
submitted,
|
|
19478
19483
|
savedDraft,
|
|
19479
|
-
landed
|
|
19484
|
+
landed,
|
|
19485
|
+
autoDraft
|
|
19480
19486
|
]));
|
|
19481
19487
|
const { result: projectRes } = useLoad(() => draft.project ? api.project(account, draft.project) : Promise.resolve({
|
|
19482
19488
|
kind: "ok",
|
|
@@ -19565,7 +19571,13 @@ function NewClearance({ ctx }) {
|
|
|
19565
19571
|
(0, import_react.useEffect)(() => {
|
|
19566
19572
|
if (pickedByHand || draft.savedSearch || editingSlug || !recommendation) return;
|
|
19567
19573
|
if (draft.pick.product === recommendation.product.key) return;
|
|
19568
|
-
|
|
19574
|
+
const pick = chooseProduct(draft.pick, recommendation.product);
|
|
19575
|
+
const now = JSON.stringify(draft);
|
|
19576
|
+
setAutoDraft(now === JSON.stringify(EMPTY) || now === autoDraft ? JSON.stringify({
|
|
19577
|
+
...draft,
|
|
19578
|
+
pick
|
|
19579
|
+
}) : null);
|
|
19580
|
+
edit({ pick });
|
|
19569
19581
|
}, [
|
|
19570
19582
|
recommendation?.product.key,
|
|
19571
19583
|
pickedByHand,
|
|
@@ -22536,7 +22548,7 @@ function RowMenu({ actions, disabled = false }) {
|
|
|
22536
22548
|
// src/screens/SavedSearches.tsx
|
|
22537
22549
|
function SavedSearches({ ctx }) {
|
|
22538
22550
|
const account = ctx.owner;
|
|
22539
|
-
const needsOwner = ctx.me
|
|
22551
|
+
const needsOwner = mustPickCompany(ctx.me, account);
|
|
22540
22552
|
const { result, reload } = useLoad(() => companyRead(needsOwner, () => api.savedSearches(account)), [account, needsOwner]);
|
|
22541
22553
|
const { result: menu } = useLoad(() => companyRead(needsOwner, () => api.searches(account)), [account, needsOwner]);
|
|
22542
22554
|
const levels = menu?.kind === "ok" ? menu.value.products : [];
|
|
@@ -23583,7 +23595,7 @@ function ContextPackEditor({ value, onChange, title, hint, rows = 8, tag = null,
|
|
|
23583
23595
|
// src/screens/Profile.tsx
|
|
23584
23596
|
function Profile({ ctx }) {
|
|
23585
23597
|
const account = ctx.owner;
|
|
23586
|
-
const needsOwner = ctx.me
|
|
23598
|
+
const needsOwner = mustPickCompany(ctx.me, account);
|
|
23587
23599
|
const { result, reload } = useLoad(() => companyRead(needsOwner, () => api.profile(account)), [account, needsOwner]);
|
|
23588
23600
|
const loaded = result?.kind === "ok" ? result.value : null;
|
|
23589
23601
|
const { result: searchesResult } = useLoad(() => companyRead(needsOwner, () => api.searches(account)), [account, needsOwner]);
|
|
@@ -24116,7 +24128,7 @@ function explain(r) {
|
|
|
24116
24128
|
function Projects({ ctx }) {
|
|
24117
24129
|
const mayChange = canManage(ctx.me);
|
|
24118
24130
|
const account = ctx.owner;
|
|
24119
|
-
const needsOwner = ctx.me
|
|
24131
|
+
const needsOwner = mustPickCompany(ctx.me, account);
|
|
24120
24132
|
const [open, setOpen] = (0, import_react.useState)(() => new URLSearchParams(window.location.search).get("project") || null);
|
|
24121
24133
|
const [creating, setCreating] = (0, import_react.useState)(false);
|
|
24122
24134
|
const [rowBusy, setRowBusy] = (0, import_react.useState)(null);
|
|
@@ -25382,14 +25394,14 @@ function Row$1({ ok, off = false, name, mono, state, faults, note = null, detail
|
|
|
25382
25394
|
className: "cfg-act",
|
|
25383
25395
|
children: [(0, import_jsx_runtime.jsx)("p", {
|
|
25384
25396
|
className: "cfg-note bad",
|
|
25385
|
-
children: f
|
|
25397
|
+
children: (0, import_jsx_runtime.jsx)(Ticked, { text: f })
|
|
25386
25398
|
}), (0, import_jsx_runtime.jsx)(GuideButton, {
|
|
25387
25399
|
guide,
|
|
25388
25400
|
repo
|
|
25389
25401
|
})]
|
|
25390
25402
|
}, f) : (0, import_jsx_runtime.jsx)("p", {
|
|
25391
25403
|
className: "cfg-note bad",
|
|
25392
|
-
children: f
|
|
25404
|
+
children: (0, import_jsx_runtime.jsx)(Ticked, { text: f })
|
|
25393
25405
|
}, f))
|
|
25394
25406
|
]
|
|
25395
25407
|
});
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
chosen anywhere in the product holds everywhere in it.
|
|
37
37
|
-->
|
|
38
38
|
<script>(function(){try{var t=localStorage.getItem('cordillera-theme');if(t==='dark'||t==='light')document.documentElement.setAttribute('data-theme',t);}catch(e){}})();</script>
|
|
39
|
-
<script type="module" crossorigin src="/portal/assets/index-
|
|
39
|
+
<script type="module" crossorigin src="/portal/assets/index-D5rkCjDc.js"></script>
|
|
40
40
|
<link rel="stylesheet" crossorigin href="/portal/assets/index-AtB9ZpDH.css">
|
|
41
41
|
</head>
|
|
42
42
|
<body>
|
package/portal-ui/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "portal-ui",
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.6.0-beta.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": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/react": "^19.3.0",
|
|
24
24
|
"@types/react-dom": "^19.3.0",
|
|
25
|
-
"@vitejs/plugin-react": "^6.1
|
|
25
|
+
"@vitejs/plugin-react": "^6.2.1",
|
|
26
26
|
"typescript": "^7.0.2",
|
|
27
|
-
"vite": "^8.3.
|
|
27
|
+
"vite": "^8.3.6"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/providers/README.md
CHANGED
|
@@ -44,7 +44,7 @@ the vendor's own site, over either adapter that needs a sales agreement.
|
|
|
44
44
|
|
|
45
45
|
One API key, issued self-serve from the vendor's own site: no sales call, no contract, no waiting. It
|
|
46
46
|
covers the **US and EU registers together**, plus WIPO/Madrid, the UK, Switzerland, Canada, Australia,
|
|
47
|
-
France, Spain, Mexico, Singapore, Norway and Sweden — **
|
|
47
|
+
France, Spain, Italy, Mexico, Brazil, Singapore, Norway and Sweden — **fifteen offices**. Native sound-alike search, exact result counts,
|
|
48
48
|
opposition state, and one call returns every layer of rights binding a territory, so an EU trade mark that
|
|
49
49
|
blocks use in France is actually found rather than missed by a national-only search.
|
|
50
50
|
|
|
@@ -53,15 +53,14 @@ export const ANSWER_MEMORY_MODES = Object.freeze(["off", "watch", "on"]);
|
|
|
53
53
|
* The registers whose core consults this memory, the environment switch that sets it for each (`env`, the
|
|
54
54
|
* table shape the configuration audit reads), and the mode a run takes when that switch is unset. Every other register is `off`, whatever any switch says.
|
|
55
55
|
*
|
|
56
|
-
* SIGNA
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* SIGNA and CLARIVATE both start `on`, by the owner's rulings. Clarivate had no watch period: the repeated
|
|
57
|
+
* answers of its past runs were already compared and matched. Signa keeps `watch` for an install that wants
|
|
58
|
+
* the comparison.
|
|
59
59
|
*/
|
|
60
60
|
export const ANSWER_MEMORY_PROVIDERS = Object.freeze({
|
|
61
|
-
signa: Object.freeze({ env: "CLEAROTRON_SIGNA_ANSWER_MEMORY", defaultMode: "
|
|
61
|
+
signa: Object.freeze({ env: "CLEAROTRON_SIGNA_ANSWER_MEMORY", defaultMode: "on" }),
|
|
62
62
|
clarivate: Object.freeze({ env: "CLEAROTRON_CLARIVATE_ANSWER_MEMORY", defaultMode: "on" }),
|
|
63
63
|
});
|
|
64
|
-
export const ANSWER_MEMORY_SWITCH = ANSWER_MEMORY_PROVIDERS.signa.env;
|
|
65
64
|
export const ANSWER_MEMORY_DIR = "register-answers";
|
|
66
65
|
export const ANSWER_WATCH_LOG = "register-answer-watch.jsonl";
|
|
67
66
|
const ATTEMPT_FILE = "attempt.json";
|