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
|
@@ -12,16 +12,15 @@
|
|
|
12
12
|
// THE ISSUE DATE IS THE FIRST ONE: what the pool's meta.json kept, or the delivery the run recorded when the pool
|
|
13
13
|
// holds no copy (a demo, or a run republished into an empty pool), and the clock only when neither exists, which is
|
|
14
14
|
// a first publish. `renderedAt` is this publish, recorded apart from both.
|
|
15
|
-
import { readFileSync } from "node:fs";
|
|
16
15
|
import { join } from "node:path";
|
|
16
|
+
import { readJsonOrNull } from "../run-record.mjs";
|
|
17
17
|
|
|
18
|
-
const readJson = (file) => { try { return JSON.parse(readFileSync(file, "utf8")); } catch { return null; } };
|
|
19
18
|
const instant = (value) => (typeof value === "string" && !Number.isNaN(Date.parse(value)) ? value : null);
|
|
20
19
|
|
|
21
20
|
/** `{searchedAt, issuedAt, renderedAt}` as ISO strings. `searchedAt` is null when the run records no start. */
|
|
22
21
|
export function reportDates({ runDir, poolRunDir, now = new Date() }) {
|
|
23
|
-
const status =
|
|
24
|
-
const kept =
|
|
22
|
+
const status = readJsonOrNull(join(runDir, "status.json"));
|
|
23
|
+
const kept = readJsonOrNull(join(poolRunDir, "meta.json"));
|
|
25
24
|
return {
|
|
26
25
|
searchedAt: instant(status?.startedAt),
|
|
27
26
|
issuedAt: instant(kept?.issuedAt) ?? instant(status?.deliveredAt) ?? now.toISOString(),
|
|
@@ -12,16 +12,13 @@
|
|
|
12
12
|
// publishReport unconditionally, so `republish <a knockout run>` failed on a missing report.md and no
|
|
13
13
|
// knockout report could ever be re-rendered. A report shape you cannot re-render is a report shape you
|
|
14
14
|
// cannot fix after delivery.
|
|
15
|
-
import { existsSync
|
|
15
|
+
import { existsSync } from 'node:fs';
|
|
16
16
|
import { join } from 'node:path';
|
|
17
|
-
import {
|
|
17
|
+
import { paths, readJson, readJsonOrNull } from "../run-record.mjs";
|
|
18
18
|
import { publishReport } from './index.mjs';
|
|
19
19
|
import { publishKnockout } from './knockout.mjs';
|
|
20
20
|
import { worstBand } from '../verify-knockout.mjs';
|
|
21
21
|
|
|
22
|
-
const readJson = (p) => JSON.parse(readFileSync(p, 'utf8'));
|
|
23
|
-
const readJsonOr = (p, fallback = null) => { try { return readJson(p); } catch { return fallback; } };
|
|
24
|
-
|
|
25
22
|
/** The template a PUBLISHED run was rendered under, read from its meta.
|
|
26
23
|
*
|
|
27
24
|
* `meta.template` has been stamped by both publishers since long before it was read by anything; this is
|
|
@@ -43,7 +40,7 @@ export async function republishRun({ runId, meta, pool, poolUrl, runDir, skipReg
|
|
|
43
40
|
const template = templateOfMeta(meta);
|
|
44
41
|
if (template !== 'knockout') {
|
|
45
42
|
if (!existsSync(join(runDir, 'report.md'))) throw new Error(`${runDir} has no report.md — not a clearance run workspace.`);
|
|
46
|
-
const prof =
|
|
43
|
+
const prof = readJsonOrNull(paths(runDir).profile);
|
|
47
44
|
return publishReport({
|
|
48
45
|
runId,
|
|
49
46
|
codename: meta?.codename || '',
|
|
@@ -66,16 +63,16 @@ export async function republishRun({ runId, meta, pool, poolUrl, runDir, skipReg
|
|
|
66
63
|
const findingsPath = join(runDir, 'knockout-findings.json');
|
|
67
64
|
if (!existsSync(findingsPath)) throw new Error(`${runDir} has no knockout-findings.json — not a knockout run workspace.`);
|
|
68
65
|
const findings = readJson(findingsPath);
|
|
69
|
-
const framework =
|
|
66
|
+
const framework = readJsonOrNull(paths(runDir).framework);
|
|
70
67
|
if (!framework) throw new Error(`${runDir} has no _driver/framework.json — a knockout cannot be re-rendered without the bands it was rated under.`);
|
|
71
|
-
const searchPolicy =
|
|
72
|
-
const prof =
|
|
68
|
+
const searchPolicy = readJsonOrNull(paths(runDir).searchPolicy);
|
|
69
|
+
const prof = readJsonOrNull(paths(runDir).profile);
|
|
73
70
|
return publishKnockout({
|
|
74
71
|
runId,
|
|
75
72
|
codename: meta?.codename || '',
|
|
76
73
|
runDir,
|
|
77
74
|
findings,
|
|
78
|
-
plan:
|
|
75
|
+
plan: readJsonOrNull(join(runDir, 'knockout-plan.json')),
|
|
79
76
|
framework,
|
|
80
77
|
// Recomputed from the frozen framework + the frozen findings, exactly as the lane computed it. The
|
|
81
78
|
// stored meta.overall is not trusted as an input: it is an OUTPUT of this same join, and feeding an
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
// shape that reads like "seeded nothing, all good", because "the archive is empty" and "the archive is
|
|
35
35
|
// empty and nobody noticed why" look identical from the browser.
|
|
36
36
|
|
|
37
|
-
import { existsSync, readdirSync
|
|
37
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
38
38
|
import { join } from "node:path";
|
|
39
|
+
import { readJson } from "../run-record.mjs";
|
|
39
40
|
|
|
40
41
|
/** A pool "run" is a directory holding meta.json. Mirrors pool-admin.mjs's listRuns and regenIndex's
|
|
41
42
|
* scan filter — `customer` is the per-customer page tree, not a run. */
|
|
@@ -79,7 +80,7 @@ export function frozenSamples(examplesDir) {
|
|
|
79
80
|
continue;
|
|
80
81
|
}
|
|
81
82
|
let meta;
|
|
82
|
-
try { meta =
|
|
83
|
+
try { meta = readJson(manifest); }
|
|
83
84
|
catch (e) { problems.push(`${manifest} is not readable JSON (${String(e?.message ?? e)})`); continue; }
|
|
84
85
|
if (!meta?.runId) { problems.push(`${manifest} names no runId — it is not a frozen example manifest`); continue; }
|
|
85
86
|
if (!hasRun) { problems.push(`${dir} names runId ${meta.runId} but has no run/ directory to publish`); continue; }
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
// publish/shell.mjs — what publishing a report does whichever report it is. Both publishers call it; what a report says stays
|
|
4
|
+
// with its own renderer.
|
|
5
|
+
//
|
|
6
|
+
// A PART THAT FAILS DOES NOT STOP THE REPORT, and both publishers answer alike (design ruling, 2026-11-10). A workbook that
|
|
7
|
+
// cannot be built or a data file that cannot be written leaves the report in place, and nothing the run publishes names the
|
|
8
|
+
// missing file. A staff-page refresh that fails is recorded after the report is in place. The report page and `meta.json`
|
|
9
|
+
// are not parts: a failure to write either still throws, because then there is no report to deliver.
|
|
10
|
+
import { chmodSync, copyFileSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
|
|
13
|
+
import { runLog } from '../log.mjs';
|
|
14
|
+
import { RUN_DIR_MODE } from '../run-record.mjs';
|
|
15
|
+
|
|
16
|
+
export const grpRead = (p, mode) => { try { chmodSync(p, mode); } catch { /* best-effort */ } };
|
|
17
|
+
|
|
18
|
+
const reasonOf = (e) => String(e?.message ?? e);
|
|
19
|
+
const record = (runDir, row) => { if (runDir) { try { runLog(runDir, row); } catch { /* meta.json and the return carry it too */ } } };
|
|
20
|
+
const removePart = (p) => { try { rmSync(p, { force: true }); } catch { /* nothing names it, so a leftover is never offered */ } };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Create a run's folder in the report pool and return the ways a publisher puts a file there.
|
|
24
|
+
*
|
|
25
|
+
* The run dir inherits the web-server group + the set-GID bit AUTOMATICALLY from the set-GID pool root
|
|
26
|
+
* (mode 2750, web-server group) — so files written inside take that group and the web server (Caddy in
|
|
27
|
+
* the reference deployment, mode 0640) can read them. Do NOT chmod this dir: the service account is not
|
|
28
|
+
* a member of the web-server group, and POSIX silently strips S_ISGID when a non-member sets it, leaving
|
|
29
|
+
* the dir 0750 → new files fall back to the service account's primary group → every report 403s. (An explicit
|
|
30
|
+
* `grpRead(poolRunDir, 0o2750)` here, added 2026-06-02, WAS that 403 bug; removed 2026-06-08.)
|
|
31
|
+
*
|
|
32
|
+
* The two parts a report can ship without go through the folder too. `buildWorkbook(name, build)` awaits `build(path)` and
|
|
33
|
+
* returns `{ auditFile, auditError, built }`: the file's name and what `build` returned, or a null name and the reason when
|
|
34
|
+
* it threw, with any part of the file it left removed. `writeDataFile(name, produce)` writes `produce()` as JSON and
|
|
35
|
+
* returns the name, or null when either threw, so a caller claims a data file only when it exists. `copyPart(src, name)`
|
|
36
|
+
* copies a run file into the folder the same way, and returns the name or null. All three record a failure in `runDir`'s
|
|
37
|
+
* log when they are given one.
|
|
38
|
+
*/
|
|
39
|
+
export function openPoolRun(poolRoot, runId, { runDir = null } = {}) {
|
|
40
|
+
const poolRunDir = join(poolRoot, runId);
|
|
41
|
+
mkdirSync(poolRunDir, { recursive: true, mode: RUN_DIR_MODE }); // owner and group only; mkdir keeps the pool root's set-GID
|
|
42
|
+
const writeRO = (name, data) => { const p = join(poolRunDir, name); writeFileSync(p, data); grpRead(p, 0o640); };
|
|
43
|
+
const copyRO = (src, name) => { const p = join(poolRunDir, name); copyFileSync(src, p); grpRead(p, 0o640); };
|
|
44
|
+
const buildWorkbook = async (name, build) => {
|
|
45
|
+
const p = join(poolRunDir, name);
|
|
46
|
+
try {
|
|
47
|
+
const built = await build(p);
|
|
48
|
+
grpRead(p, 0o640);
|
|
49
|
+
return { auditFile: name, auditError: null, built };
|
|
50
|
+
} catch (e) {
|
|
51
|
+
removePart(p);
|
|
52
|
+
const auditError = reasonOf(e);
|
|
53
|
+
console.warn(`[audit-workbook] not built, the report ships without it: ${auditError.slice(0, 140)}`);
|
|
54
|
+
record(runDir, { event: 'workbook-not-built', file: name, error: auditError.slice(0, 300) });
|
|
55
|
+
return { auditFile: null, auditError, built: null };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const writeDataFile = (name, produce) => {
|
|
59
|
+
try { writeRO(name, JSON.stringify(produce(), null, 2)); return name; }
|
|
60
|
+
catch (e) {
|
|
61
|
+
removePart(join(poolRunDir, name));
|
|
62
|
+
const error = reasonOf(e);
|
|
63
|
+
console.warn(`[report-data] ${name} not written, the report ships without it: ${error.slice(0, 140)}`);
|
|
64
|
+
record(runDir, { event: 'data-file-not-written', file: name, error: error.slice(0, 300) });
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const copyPart = (src, name) => {
|
|
69
|
+
try { copyRO(src, name); return name; }
|
|
70
|
+
catch (e) {
|
|
71
|
+
removePart(join(poolRunDir, name));
|
|
72
|
+
const error = reasonOf(e);
|
|
73
|
+
console.warn(`[publish] ${name} not copied, the report ships without it: ${error.slice(0, 140)}`);
|
|
74
|
+
record(runDir, { event: 'data-file-not-written', file: name, error: error.slice(0, 300) });
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return { poolRunDir, writeRO, copyRO, copyPart, buildWorkbook, writeDataFile };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Write the run's `meta.json` and refresh the pool's index, and return the index's count (null when the caller asked for
|
|
83
|
+
* no refresh). `meta.json` is the last file a publisher writes, because the index lists only folders that hold one: every
|
|
84
|
+
* document is in place before the run becomes visible. `regenIndex` is passed in because it lives with the clearance
|
|
85
|
+
* publisher, which imports this module.
|
|
86
|
+
*/
|
|
87
|
+
export function finishPoolRun({ writeRO, meta, poolRoot, skipRegen, regenIndex }) {
|
|
88
|
+
writeRO('meta.json', JSON.stringify(meta, null, 2));
|
|
89
|
+
return skipRegen ? null : regenIndex(poolRoot);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Refresh the staff pages once the report and its `meta.json` are in place. A failure is recorded and returned, never
|
|
94
|
+
* thrown: the report is already delivered, and the next publish refreshes the pages again. `regenSurfaces` is passed in for
|
|
95
|
+
* the reason `regenIndex` is. Returns null when the refresh ran or was not asked for.
|
|
96
|
+
*/
|
|
97
|
+
export async function refreshStaffPages({ regenSurfaces, poolRoot, skipRegen, runDir = null }) {
|
|
98
|
+
if (skipRegen) return null;
|
|
99
|
+
try { await regenSurfaces(poolRoot); return null; }
|
|
100
|
+
catch (e) {
|
|
101
|
+
const error = reasonOf(e);
|
|
102
|
+
console.warn(`[publish] staff pages not refreshed, the report is in place: ${error.slice(0, 140)}`);
|
|
103
|
+
record(runDir, { event: 'staff-pages-not-refreshed', error: error.slice(0, 300) });
|
|
104
|
+
return error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -59,7 +59,9 @@
|
|
|
59
59
|
/* the framework that owns the ticks, named where they are read. Normal case and un-tracked on
|
|
60
60
|
purpose: `.label` is an uppercase eyebrow, and a proper name in the eyebrow's own letterforms reads
|
|
61
61
|
as a second heading rather than as the thing being cited. */
|
|
62
|
-
.gauge .
|
|
62
|
+
.gauge .gauge-head{margin-bottom:18px}
|
|
63
|
+
.gauge .gauge-head .label{margin-bottom:0}
|
|
64
|
+
.gauge .gauge-fw{margin-top:5px;font-size:11px;font-weight:600;letter-spacing:0;
|
|
63
65
|
text-transform:none;color:var(--slate)}
|
|
64
66
|
.scale{position:relative;height:11px;border-radius:8px;margin:34px 0 10px;
|
|
65
67
|
background:linear-gradient(90deg,var(--clear) 0%,var(--low) 26%,var(--med) 52%,var(--high) 79%,var(--severe) 100%)}
|
package/driver/queue-order.mjs
CHANGED
|
@@ -20,14 +20,15 @@
|
|
|
20
20
|
// out there it can never match the `*.json` claim glob, checkRunCaps's `*.{json,processing,postponed}`
|
|
21
21
|
// parse set, or prelim-driver.path's watch — and reordering must NOT wake the runner.
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import { writeFileSync, renameSync, mkdirSync, readdirSync } from "node:fs";
|
|
24
24
|
import { join, dirname } from "node:path"; import { studioDirFor } from "../shared/pre-rename-spellings.mjs";
|
|
25
|
+
import { readJson } from "./run-record.mjs";
|
|
25
26
|
|
|
26
27
|
export function queueOrderPath(qdir) { return join(dirname(qdir), ".queue-order.json"); }
|
|
27
28
|
|
|
28
29
|
export function readQueueOrder(qdir) {
|
|
29
30
|
try {
|
|
30
|
-
const j =
|
|
31
|
+
const j = readJson(queueOrderPath(qdir));
|
|
31
32
|
return Array.isArray(j?.order) ? j.order.filter((s) => typeof s === "string" && s) : [];
|
|
32
33
|
} catch { return []; } // absent, unreadable or corrupt ⇒ assert nothing, fall through to enqueuedAt
|
|
33
34
|
}
|
|
@@ -55,7 +56,7 @@ export function orderedQueueFiles(qdir, files) {
|
|
|
55
56
|
const listed = rank.get(f.replace(/\.json$/, ""));
|
|
56
57
|
if (listed !== undefined) return { f, tier: 0, pos: listed, at: "" };
|
|
57
58
|
let at = "";
|
|
58
|
-
try { at = String(
|
|
59
|
+
try { at = String(readJson(join(qdir, f)).enqueuedAt ?? ""); } catch { /* sorts by name */ }
|
|
59
60
|
return { f, tier: 1, pos: 0, at };
|
|
60
61
|
});
|
|
61
62
|
keyed.sort((a, b) => a.tier - b.tier || a.pos - b.pos || a.at.localeCompare(b.at) || a.f.localeCompare(b.f));
|
package/driver/record-carry.mjs
CHANGED
|
@@ -66,10 +66,6 @@ export const RECORD_CARRY_SCHEMA_VERSION = 4;
|
|
|
66
66
|
* clean run came to read as a total loss. Legitimate for a run archived before and
|
|
67
67
|
* for the probe; a fresh run reporting it is a defect, flagged by the predelivery lint.
|
|
68
68
|
*/
|
|
69
|
-
export const TRACE_BASES = ["recorded", "reconstructed"];
|
|
70
|
-
|
|
71
|
-
/** How far a record got. Ordered; index = distance travelled. */
|
|
72
|
-
export const REACH_STAGES = ["retrieved", "screened", "placed", "findings-surface", "finding"];
|
|
73
69
|
|
|
74
70
|
/**
|
|
75
71
|
* WHERE THE REASON WAS AUTHORED — the ruling's "weigh where the reason is authored", made a field so a
|
|
@@ -85,9 +81,6 @@ export const REACH_STAGES = ["retrieved", "screened", "placed", "findings-surfac
|
|
|
85
81
|
*/
|
|
86
82
|
export const REASON_SOURCES = ["step-structural", "step-stated", "step-silent", "absent"];
|
|
87
83
|
|
|
88
|
-
/** The seam a record failed to cross. `null` when it became a finding. */
|
|
89
|
-
export const SEAMS = ["screen", "placement", "digest", "synthesis"];
|
|
90
|
-
|
|
91
84
|
/**
|
|
92
85
|
* WHAT THIS TRACE COVERS AND WHAT IT DOES NOT — carried IN THE ARTIFACT, not just in a PR body.
|
|
93
86
|
*
|
|
@@ -431,8 +424,6 @@ const bump = (o, k) => { o[k] = (o[k] ?? 0) + 1; };
|
|
|
431
424
|
* checked first because execute-plan.mjs writes it ALONGSIDE `error`, never instead of it, and the
|
|
432
425
|
* capability gap is the more specific fact. PURE.
|
|
433
426
|
*/
|
|
434
|
-
export const SLICE_CLASSES = ["counted-not-fetched", "capability-gap", "provider-error", "count-unavailable"];
|
|
435
|
-
|
|
436
427
|
// — the fourth class. `counted-not-fetched` claimed the run HAS a count, which for a slice the
|
|
437
428
|
// register refused to size is the same false claim removed, wearing the new machine field. This
|
|
438
429
|
// one is distinct from the two refusals above: the slice DID run and may have returned records — it is
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
import { appendFileSync, mkdirSync } from "node:fs";
|
|
55
55
|
import { join } from "node:path";
|
|
56
|
-
import { driverDir } from "
|
|
56
|
+
import { driverDir } from "./run-record.mjs"; //
|
|
57
57
|
|
|
58
58
|
import { normalizeRecordUri } from "./registry-fidelity.mjs";
|
|
59
59
|
|
|
@@ -72,9 +72,6 @@ export const DISCARD_LEDGER_NAME = "record-discard.jsonl";
|
|
|
72
72
|
*/
|
|
73
73
|
export const DISCARD_SEAMS = ["placement", "digest", "synthesis"];
|
|
74
74
|
|
|
75
|
-
/** What a pass did with a record. `carried` cancels an earlier `discarded` at the same seam. */
|
|
76
|
-
export const DISCARD_VERDICTS = ["carried", "discarded"];
|
|
77
|
-
|
|
78
75
|
const clip = (s, n = 300) => {
|
|
79
76
|
const t = String(s ?? "").replace(/\s+/g, " ").trim();
|
|
80
77
|
return t.length > n ? `${t.slice(0, n - 1)}…` : t;
|
package/driver/record-fold.mjs
CHANGED
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
// in force.
|
|
30
30
|
import { readFileSync, writeFileSync, existsSync, renameSync, rmSync, mkdirSync } from "node:fs";
|
|
31
31
|
import { dirname } from "node:path";
|
|
32
|
-
import { driverDir } from "../shared/driver-dir.mjs";
|
|
33
32
|
import { consolidateFindings, remapActionOrdinals, remapFourAnswersOrdinals, parseFindingsJson } from "./findings-model.mjs";
|
|
34
33
|
import { parseFrameworkManifest } from "./framework.mjs";
|
|
34
|
+
import { driverDir, paths, readJson } from "./run-record.mjs";
|
|
35
35
|
|
|
36
36
|
export const FOLD_FILE = "fold.json";
|
|
37
37
|
export const UNFOLDED_FILE = "findings-unfolded.json";
|
|
@@ -63,7 +63,7 @@ export function foldRecord(doc, manifest = null) {
|
|
|
63
63
|
|
|
64
64
|
/** The fold state of a run, or null before any seam. Never throws. */
|
|
65
65
|
export function readFold(runDir) {
|
|
66
|
-
try { return
|
|
66
|
+
try { return readJson(driverDir(String(runDir ?? ""), FOLD_FILE)); } catch { return null; }
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function writeFold(runDir, { seamPassed, map = null, merges = [], error = null }) {
|
|
@@ -138,7 +138,7 @@ export function foldFindingsFile(runDir, findingsPath, manifest, { seam = false
|
|
|
138
138
|
/** The fold an accepted save makes, with the run's frozen framework manifest. Never throws. */
|
|
139
139
|
export function foldAfterSave(runDir, findingsPath) {
|
|
140
140
|
let manifest = null;
|
|
141
|
-
try { manifest = parseFrameworkManifest(readFileSync(
|
|
141
|
+
try { manifest = parseFrameworkManifest(readFileSync(paths(String(runDir ?? "")).framework, "utf8")); }
|
|
142
142
|
catch { manifest = null; } // a run with no frozen manifest folds as the seam does for it
|
|
143
143
|
return foldFindingsFile(runDir, findingsPath, manifest);
|
|
144
144
|
}
|
package/driver/record-goods.mjs
CHANGED
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
// what the run simply does not hold.
|
|
18
18
|
import { readFileSync, readdirSync, existsSync } from "node:fs";
|
|
19
19
|
import { join } from "node:path";
|
|
20
|
-
import { driverDir } from "../shared/driver-dir.mjs";
|
|
21
20
|
import { normalizeRecordUri } from "./registry-fidelity.mjs";
|
|
22
21
|
import { foldDiacritics } from "./form-neighbourhood.mjs";
|
|
23
22
|
import { parseVariantManifestModel } from "./variant-manifest-model.mjs";
|
|
24
23
|
import { canonicalJurisdictionCode } from "./jurisdiction-codes.mjs";
|
|
25
24
|
import { savedStatusPages, savedPageStatement, usSerialOf } from "./saved-register-pages.mjs";
|
|
25
|
+
import { paths, readJson } from "./run-record.mjs";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* The registers whose language is English (ruled 2026-10-12): there, a goods statement with no language tag
|
|
@@ -218,7 +218,7 @@ export function bandGoodsIndex(runDir) {
|
|
|
218
218
|
const goods = recordGoods(body, { english: untaggedIsEnglish(key) });
|
|
219
219
|
if (goods.length) index.set(key, goods);
|
|
220
220
|
};
|
|
221
|
-
const ledger =
|
|
221
|
+
const ledger = paths(runDir).registerRecordBodies;
|
|
222
222
|
if (existsSync(ledger)) {
|
|
223
223
|
let text = "";
|
|
224
224
|
try { text = readFileSync(ledger, "utf8"); } catch { text = ""; }
|
|
@@ -233,7 +233,7 @@ export function bandGoodsIndex(runDir) {
|
|
|
233
233
|
let names = [];
|
|
234
234
|
try { names = readdirSync(dir).filter((n) => n.endsWith(".json")); } catch { names = []; }
|
|
235
235
|
for (const n of names) {
|
|
236
|
-
try { const body =
|
|
236
|
+
try { const body = readJson(join(dir, n)); take(body?._uri ?? body?.uri, body); } catch { /* unreadable: skip */ }
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
return index;
|
|
@@ -399,7 +399,7 @@ export function goodsWordMatcher(words) {
|
|
|
399
399
|
*/
|
|
400
400
|
export function instructedOrder(P, job = null) {
|
|
401
401
|
let scope = null;
|
|
402
|
-
try { scope =
|
|
402
|
+
try { scope = readJson(P.instructedScope); } catch { scope = null; }
|
|
403
403
|
const order = { ...(job ?? {}) };
|
|
404
404
|
for (const k of ["goods", "jurisdictions", "geography"]) if (scope?.[k] != null) order[k] = scope[k];
|
|
405
405
|
return order;
|
|
@@ -424,7 +424,7 @@ export function bandShapeGoods(P, records = []) {
|
|
|
424
424
|
try { if (existsSync(P.variantManifestModel)) model = parseVariantManifestModel(readFileSync(P.variantManifestModel, "utf8")); } catch { model = null; }
|
|
425
425
|
let searched = "";
|
|
426
426
|
try {
|
|
427
|
-
const plan =
|
|
427
|
+
const plan = readJson(P.registerPlan);
|
|
428
428
|
searched = String((plan?.entries ?? []).find((e) => /\+goods($|-)/.test(String(e?.qid ?? "")))?.term ?? "");
|
|
429
429
|
} catch { searched = ""; }
|
|
430
430
|
const manifestDominant = String(model?.dominant_element ?? "");
|
|
@@ -336,7 +336,6 @@ function containsWordRun(a, b) {
|
|
|
336
336
|
//
|
|
337
337
|
// An entry in a gold set's `register` array is a REGISTERED RIGHT by construction of the array it sits
|
|
338
338
|
// in — no per-entry flag is needed and no gold set is edited. What was missing is entirely candidate-side.
|
|
339
|
-
export const EVIDENCE_CLASSES = ["register", "common-law", "case-law", "unknown"];
|
|
340
339
|
|
|
341
340
|
/**
|
|
342
341
|
* Fold a run finding's own typed source into the class the scorer reasons about.
|
|
@@ -1862,7 +1861,7 @@ export function readJxLanes(doc) {
|
|
|
1862
1861
|
const v = doc.fold?.depth?.[name];
|
|
1863
1862
|
if (!v || typeof v !== "object") {
|
|
1864
1863
|
return { recorded: false, asked: d.depth ?? null, ran: null, shortfall: null,
|
|
1865
|
-
why: "the run did not state what depth this lane actually got (no fold.depth) —
|
|
1864
|
+
why: "the run did not state what depth this lane actually got (no fold.depth) — an earlier artifact, "
|
|
1866
1865
|
+ "or a run that never reached the delivery statement. Whether the ask was met CANNOT be established" };
|
|
1867
1866
|
}
|
|
1868
1867
|
return { recorded: true, asked: v.asked ?? null, ran: v.ran ?? null,
|
|
@@ -1890,7 +1889,7 @@ export function readJxLanes(doc) {
|
|
|
1890
1889
|
statement: typeof doc.fold?.executes === "string" ? doc.fold.executes : null,
|
|
1891
1890
|
slices: doc.fold?.slices ?? null,
|
|
1892
1891
|
statementWhy: typeof doc.fold?.executes === "string" ? null
|
|
1893
|
-
: "the run did not state which jx slices it executed (no fold.executes) —
|
|
1892
|
+
: "the run did not state which jx slices it executed (no fold.executes) — an earlier artifact, or a fold that never ran",
|
|
1894
1893
|
};
|
|
1895
1894
|
}
|
|
1896
1895
|
|
|
@@ -45,9 +45,3 @@ export function capabilitiesFor(providerId) {
|
|
|
45
45
|
}
|
|
46
46
|
return caps;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
/** The ACTIVE provider's capabilities (driver.config.mjs owns the toggle; this never re-reads the env). */
|
|
50
|
-
export async function activeCapabilities() {
|
|
51
|
-
const { REGISTER_PROVIDER } = await import("./driver.config.mjs");
|
|
52
|
-
return capabilitiesFor(REGISTER_PROVIDER);
|
|
53
|
-
}
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
// mark generates 3–8. `CLEAROTRON_KNOCKOUT_VARIANT_CAP` lowers it per deployment; nothing raises it above
|
|
88
88
|
// the code cap, because the ceiling is a spend guarantee and a knob that can lift it is not one.
|
|
89
89
|
|
|
90
|
-
import {
|
|
90
|
+
import { appendFileSync } from "node:fs";
|
|
91
91
|
import { join } from "node:path";
|
|
92
92
|
|
|
93
93
|
import { kebab } from "./search-policy.mjs"; import { moreThan } from "../shared/register-floor.mjs";
|
|
@@ -96,6 +96,7 @@ import { reachableRegions } from "./register-availability.mjs"; // — pure; t
|
|
|
96
96
|
import { variantForms, VARIANT_RULES, VARIANT_CAP } from "./register-variants.mjs";
|
|
97
97
|
import { isCapabilityGap } from "../providers/_shared/execute-plan.mjs";
|
|
98
98
|
import { plainDeferralReason, plainCause } from "./deferral-row.mjs"; // — the reader's line for a count left open
|
|
99
|
+
import { readJson } from "./run-record.mjs";
|
|
99
100
|
|
|
100
101
|
/** The three questions, in report order. `matchMode` is the provider-neutral predicate name.
|
|
101
102
|
*
|
|
@@ -245,7 +246,7 @@ async function runBatched(items, limit, fn) {
|
|
|
245
246
|
function fixtureCounter(dir) {
|
|
246
247
|
return async (mark, predicate) => {
|
|
247
248
|
let doc;
|
|
248
|
-
try { doc =
|
|
249
|
+
try { doc = readJson(join(dir, `${kebab(mark)}.json`)); }
|
|
249
250
|
catch (e) { return { ok: false, total: null, reason: `count fixture missing for ${kebab(mark)}: ${e.message}` }; }
|
|
250
251
|
// THE KEY IS THE QUESTION ASKED, NOT THE COLUMN IT FEEDS. A variant probe asks the provider's
|
|
251
252
|
// EXACT predicate about a generated form, so its fixture is that form's own file under `identical`
|
|
@@ -43,10 +43,9 @@
|
|
|
43
43
|
// real checks move here, to the values as received, where a refusal names the row the seat can act on
|
|
44
44
|
// instead of a shape it cannot see. THE VALIDATOR IS NOT DELETED: archived runs were hand-written
|
|
45
45
|
// under the old dictation and must keep parsing. A new way in, never a replacement.
|
|
46
|
-
import { readFileSync, writeFileSync,
|
|
46
|
+
import { readFileSync, writeFileSync, existsSync, readdirSync } from "node:fs";
|
|
47
47
|
import { captureCall, stampVerdict } from "./call-capture.mjs";
|
|
48
48
|
import { join } from "node:path";
|
|
49
|
-
import { driverDir } from "../shared/driver-dir.mjs";
|
|
50
49
|
|
|
51
50
|
export const FINDINGS_FILE = "register-findings.md";
|
|
52
51
|
const SCHEMA_VERSION = 1;
|
|
@@ -62,6 +61,7 @@ const SCHEMA_VERSION = 1;
|
|
|
62
61
|
*/
|
|
63
62
|
import { applyFates } from "./hit-list.mjs"; // — the digest marks the list
|
|
64
63
|
import { formKey } from "../providers/_shared/script-form.mjs"; // — the one fold for "is this the same form of the mark"
|
|
64
|
+
import { driverDir, paths as runPaths, readJson } from "./run-record.mjs";
|
|
65
65
|
|
|
66
66
|
export const FACTS_FILE = "register-digest-facts.json";
|
|
67
67
|
/** — the slim hit list the digest marks; a projection of the merged band. */
|
|
@@ -309,7 +309,7 @@ export const DIGEST_SECTIONS = Object.freeze({
|
|
|
309
309
|
|
|
310
310
|
/** Where the call's evidence lives — the driver's own record of what the seat handed it. */
|
|
311
311
|
export function registerDigestCallPaths(runDir) {
|
|
312
|
-
const dir =
|
|
312
|
+
const dir = runPaths(runDir).registerDigestCalls;
|
|
313
313
|
return { dir, payload: join(dir, "call-001.json"), refusals: join(dir, "refusals.jsonl"), model: join(dir, "model.json") };
|
|
314
314
|
}
|
|
315
315
|
|
|
@@ -336,7 +336,7 @@ export function recordedFindingUris(runDir) {
|
|
|
336
336
|
for (const name of names) {
|
|
337
337
|
if (!/^call-\d+\.json$/.test(name)) continue;
|
|
338
338
|
try {
|
|
339
|
-
const doc =
|
|
339
|
+
const doc = readJson(join(registerDigestCallPaths(runDir).dir, name));
|
|
340
340
|
for (const row of doc?.params?.findings_rows ?? []) {
|
|
341
341
|
const uri = row?.uri ?? row?.record_id;
|
|
342
342
|
if (uri) out.add(String(uri).toLowerCase());
|
|
@@ -445,7 +445,7 @@ export const joinKey = (u) => lc(u).replace(/^https?:\/\/[^/]+/, "");
|
|
|
445
445
|
*/
|
|
446
446
|
export function readDigestFacts(runDir) {
|
|
447
447
|
let raw;
|
|
448
|
-
try { raw =
|
|
448
|
+
try { raw = readJson(driverDir(String(runDir ?? ""), FACTS_FILE)); }
|
|
449
449
|
// THE STAMP IS READ EVEN WHEN THE FACTS ARE NOT, and this line is the whole of the stamp-lands-first
|
|
450
450
|
// ordering being worth anything. `emptyFacts()` hardcodes `armed:false`, so returning it bare made the
|
|
451
451
|
// STAMPED-BUT-NO-FACTS state — the exact state that ordering exists to catch — unreachable: the call
|
|
@@ -944,7 +944,7 @@ export function recordRegisterDigest(runDir, received, { facts = null, now = ()
|
|
|
944
944
|
if (Array.isArray(received?.fates) && received.fates.length) {
|
|
945
945
|
try {
|
|
946
946
|
applyFates(join(String(runDir ?? ""), HIT_LIST_FILE), received.fates, {
|
|
947
|
-
readJson: (f) => { try { return
|
|
947
|
+
readJson: (f) => { try { return readJson(f); } catch { return null; } },
|
|
948
948
|
writeJson: (f, o) => writeFileSync(f, JSON.stringify(o, null, 2) + "\n"),
|
|
949
949
|
});
|
|
950
950
|
} catch { /* the marking is a projection; the accepted call stands regardless */ }
|
|
@@ -1030,7 +1030,7 @@ export function refusalsFor(runDir) {
|
|
|
1030
1030
|
* The last model this run accepted, or null. The patch path's base.
|
|
1031
1031
|
*/
|
|
1032
1032
|
export function lastAcceptedModel(runDir) {
|
|
1033
|
-
try { return
|
|
1033
|
+
try { return readJson(registerDigestCallPaths(String(runDir ?? "")).model); }
|
|
1034
1034
|
catch { return null; }
|
|
1035
1035
|
}
|
|
1036
1036
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
// register-fixture-marker.mjs — whether this run's register answers come from a fixture directory. From the job, never
|
|
5
5
|
// the environment: it is a fact about the run, and every tool server a stage spawns reads it here.
|
|
6
|
-
import { existsSync,
|
|
7
|
-
import { driverDir, ensureDriverDir } from "
|
|
6
|
+
import { existsSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { driverDir, ensureDriverDir, readJson } from "./run-record.mjs";
|
|
8
8
|
|
|
9
9
|
export const REGISTER_FIXTURE_MARKER = "register-fixtures.json";
|
|
10
10
|
|
|
@@ -18,5 +18,5 @@ export function writeFixtureMarker(runDir, records) {
|
|
|
18
18
|
export function fixtureRecordsDir(runDir) {
|
|
19
19
|
const p = driverDir(runDir, REGISTER_FIXTURE_MARKER);
|
|
20
20
|
if (!existsSync(p)) return null;
|
|
21
|
-
try { return
|
|
21
|
+
try { return readJson(p)?.records ?? null; } catch { return null; }
|
|
22
22
|
}
|
package/driver/register-plan.mjs
CHANGED
|
@@ -2983,13 +2983,13 @@ export function searchedJurisdictionsFromPlan(plan, execution) {
|
|
|
2983
2983
|
// They live HERE, with the derivation, rather than in pipeline.mjs: `pipeline.mjs` imports
|
|
2984
2984
|
// `gateway.mjs`, so the gateway cannot import back from it, and this module is already imported by both.
|
|
2985
2985
|
export const PLAN_AUDIT_HEAD =
|
|
2986
|
-
`DETERMINISTIC PLAN-EXECUTION CHECK
|
|
2986
|
+
`DETERMINISTIC PLAN-EXECUTION CHECK: this run executed a FROZEN register plan; the code-derived receipt below states what actually ran.`;
|
|
2987
2987
|
// T8 (G5, doctrine): the old directive graded EVERY crowd/incomplete/skipped slice under a clean
|
|
2988
2988
|
// claim as a mechanical BLOCKING flag — the rejected PR- shape (a state label driving the verdict).
|
|
2989
2989
|
// Graded: only a slice that NEVER RAN blocks; a sanctioned skip and a crowd descriptor are JUDGMENT
|
|
2990
2990
|
// inputs — the seat reasons over them, it never manufactures a verdict from a label.
|
|
2991
2991
|
export const PLAN_AUDIT_CLASSES =
|
|
2992
|
-
`THE FOUR CLASSES, GRADED: (1) a slice listed MISSING NEVER RAN — nothing resting on it may be stated as searched-clean, and nothing may describe what such a search would have shown; (2) a crowd-gated SKIPPED fringe is SANCTIONED (
|
|
2992
|
+
`THE FOUR CLASSES, GRADED: (1) a slice listed MISSING NEVER RAN — nothing resting on it may be stated as searched-clean, and nothing may describe what such a search would have shown; (2) a crowd-gated SKIPPED fringe is SANCTIONED (its parent proved intractable): the parent crowd is dilution context, never a searched-clean slice; (3) a CROWD/INCOMPLETE descriptor is a signal FOR JUDGMENT and never a verdict input — the lawyer's materiality reasoning over it STANDS (off-field, dilution evidence), and a state label never manufactures a CONDITIONAL by itself; (4) a waiting family nobody asked (ruling 204) is in one of two states. AWAITING JUDGMENT while the reading turn can still ask it: a question still open to you. WITHHELD BY JUDGMENT once the reading turn chose not to ask it and recorded why: a settled judgment, not an open question. Either way it has no parent crowd, says nothing about the field, and nothing resting on it may be stated as searched-clean.`;
|
|
2993
2993
|
|
|
2994
2994
|
export function deriveCoverageSkeleton(plan, join) {
|
|
2995
2995
|
const missing = new Set(join.missing);
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
// 3. NO JUDGMENT IS ADDED by code. The fields are what the register said: mark, owner, status, classes, territory, and
|
|
14
14
|
// the record's own address.
|
|
15
15
|
|
|
16
|
-
import { readFileSync } from "node:fs";
|
|
17
16
|
import { join } from "node:path";
|
|
18
17
|
|
|
19
18
|
import { recordOriginsFor } from "./record-origins.mjs"; // — provider-derived, never CLEAROTRON_DATABASE
|
|
20
19
|
import { recordGoods, rowGoods, untaggedIsEnglish } from "./record-goods.mjs";
|
|
20
|
+
import { readJson } from "./run-record.mjs";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Was this listing made by the reading step? Its sentences say what that step did. A listing written before it keeps the
|
|
@@ -320,7 +320,7 @@ export function fixtureLister(dir) {
|
|
|
320
320
|
return async (term, question = {}) => {
|
|
321
321
|
const file = join(dir, fixtureFileName(term, question));
|
|
322
322
|
let doc;
|
|
323
|
-
try { doc =
|
|
323
|
+
try { doc = readJson(file); }
|
|
324
324
|
catch (e) { return { ok: false, records: null, reason: `record fixture missing for ${term}: ${e.message}` }; }
|
|
325
325
|
if (!Array.isArray(doc?.records)) return { ok: false, records: null, reason: `record fixture for ${term} carries no records[]` };
|
|
326
326
|
return { ok: true, records: doc.records, total: Number.isFinite(doc.total) ? doc.total : doc.records.length };
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
import { readFileSync, existsSync, readdirSync } from "node:fs";
|
|
45
45
|
|
|
46
|
-
import { driverDir } from "
|
|
46
|
+
import { driverDir, paths, readJson } from "./run-record.mjs";
|
|
47
47
|
|
|
48
48
|
export const TAINT_FAIL_RE = /^timeout$|^status_timeout$/;
|
|
49
49
|
|
|
@@ -134,9 +134,9 @@ export function readUnacknowledgedTaintAxes(runDir) {
|
|
|
134
134
|
|
|
135
135
|
function readTaintReceipt(runDir) {
|
|
136
136
|
try {
|
|
137
|
-
const p =
|
|
137
|
+
const p = paths(runDir).registerTaint;
|
|
138
138
|
if (!existsSync(p)) return null;
|
|
139
|
-
const rec =
|
|
139
|
+
const rec = readJson(p);
|
|
140
140
|
return rec && typeof rec === "object" ? rec : null;
|
|
141
141
|
} catch { return null; }
|
|
142
142
|
}
|