{"id":"ops/kpi-evidence","relativePath":"ops/kpi-evidence.md","title":"SOTA §26 KPI Evidence Input","markdown":"# SOTA §26 KPI Evidence Input\n\nThis runbook defines the optional aggregate KPI evidence file consumed by `pnpm monitoring:telemetry:sync`.\n\n## Purpose\n\n`monitoring/kpis.json` stays auto-generated. When `monitoring/kpi-evidence.json` is present, telemetry sync uses it for production-like SOTA §26 inputs that cannot be inferred reliably from local seed records:\n\n- record enrichment share (`dataQualityEnrichedShare`)\n- reconciliation auto-approval rate (`reconciliationAutoApproveRate`)\n- reviewed reconciliation precision (`reconciliationPrecisionReviewed`)\n\nIf the evidence file is missing or invalid, telemetry sync falls back to record-state heuristics and does **not** manufacture passing values.\n\nThe generated file also includes `diagnostics` and `acceptanceRows`.\nDiagnostics preview the three KPI metric values against the Era C thresholds,\nname the next evidence needed for any gaps, and include a production-only\n`capturePlan` with the exact fields and commands operators need for the next\nexport. The enrichment evidence needs also include a capped\n`sampleRecordGaps[]` repair sample with record IDs, labels, current unique\nrecognized authority reference counts, and remaining authority URI gaps. Full\nauthority URLs and compact IDs such as `aat:...`, `ulan:...`, and `tgn:...`\nare counted as references when they resolve to a recognized authority family.\n`diagnostics.handoffSummary`\ncondenses that packet into ready-row\ncounts, the remaining metric blocker count, and the next command/evidence pair\nan operator should run first. Acceptance rows do not replace the Era C KPI\nthreshold check; they only prove that the aggregate KPI inputs are\nproduction-shaped enough to hand to telemetry. Strict readiness still requires\n`pnpm era-c:exit-gate:public` to consume the export and pass the configured\nthresholds.\n\n## Default Path\n\n- Default: `monitoring/kpi-evidence.json`\n- Override: `METAMUSEUM_KPI_EVIDENCE_PATH`\n\n## JSON Shape\n\n```json\n{\n  \"version\": 1,\n  \"updatedAt\": \"2026-06-10T00:00:00.000Z\",\n  \"records\": {\n    \"totalRecords\": 10000,\n    \"enrichedRecords\": 8300,\n    \"source\": \"warehouse materialized records\"\n  },\n  \"reconciliation\": {\n    \"scoreDistribution\": {\n      \"autoLink\": 920,\n      \"weeklyDigest\": 50,\n      \"humanReview\": 30,\n      \"dropCandidate\": 80\n    },\n    \"reviewedAutoLinkedCandidates\": 200,\n    \"acceptedAutoLinkedCandidates\": 190,\n    \"reviewedPrecisionSource\": \"production curator review export\",\n    \"source\": \"production reconciliation export\"\n  },\n  \"diagnostics\": {\n    \"metricsPreview\": {\n      \"dataQualityEnrichedShare\": 0.83,\n      \"reconciliationAutoApproveRate\": 0.92,\n      \"reconciliationPrecisionReviewed\": 0.95\n    },\n    \"evidenceNeeds\": {\n      \"enrichment\": {\n        \"requiredEnrichedRecords\": 8300,\n        \"remainingEnrichedRecords\": 0,\n        \"totalRecords\": 10000,\n        \"enrichedRecords\": 8300,\n        \"sampleRecordGaps\": []\n      }\n    },\n    \"blockers\": [],\n    \"capturePlan\": {\n      \"productionOnly\": true,\n      \"rows\": [\n        {\n          \"id\": \"record-enrichment-capture\",\n          \"status\": \"ready\"\n        },\n        {\n          \"id\": \"reconciliation-distribution-capture\",\n          \"status\": \"ready\"\n        },\n        {\n          \"id\": \"reviewed-precision-capture\",\n          \"status\": \"ready\"\n        },\n        {\n          \"id\": \"strict-era-c-refresh\",\n          \"status\": \"ready\"\n        }\n      ]\n    },\n    \"handoffSummary\": {\n      \"status\": \"ready-to-refresh\",\n      \"readyAcceptanceRows\": 5,\n      \"totalAcceptanceRows\": 5,\n      \"readyCaptureRows\": 4,\n      \"totalCaptureRows\": 4,\n      \"metricBlockerCount\": 0,\n      \"strictRefreshBlocked\": false,\n      \"nextCommand\": \"pnpm monitoring:telemetry:public && pnpm era-c:exit-gate:public\",\n      \"nextEvidenceNeeded\": \"Run public telemetry and Era C exit-gate evidence to consume the KPI export.\",\n      \"nextMetricCommand\": null,\n      \"nextMetricEvidenceNeeded\": null\n    }\n  },\n  \"acceptanceRows\": [\n    {\n      \"id\": \"production-record-export\",\n      \"status\": \"ready\"\n    },\n    {\n      \"id\": \"reviewed-precision-counts\",\n      \"status\": \"ready\"\n    }\n  ]\n}\n```\n\n## Validation Rules\n\n- `records.totalRecords` must be a positive integer.\n- `records.enrichedRecords` must be an integer from `0` to `totalRecords`.\n- Reconciliation considered candidates are `autoLink + weeklyDigest + humanReview`, or explicit `consideredCandidates`.\n- Auto-linked candidates are `scoreDistribution.autoLink`, `autoLinkedCandidates`, or `autoApprovedCandidates`.\n- Reviewed precision requires `acceptedAutoLinkedCandidates <= reviewedAutoLinkedCandidates <= autoLinkedCandidates`.\n- Invalid sections are ignored independently so one bad source cannot create false-green KPI evidence.\n- Strict KPI input acceptance requires production-labeled record and reconciliation sources, non-empty record and candidate denominators, and reviewed/accepted auto-link counts supplied together.\n- Diagnostics compare the previewed KPI values against Era C defaults: `dataQualityEnrichedShare >= 0.8`, `reconciliationAutoApproveRate >= 0.9`, and `reconciliationPrecisionReviewed >= 0.95`.\n\n## Acceptance Rows\n\n`pnpm monitoring:kpi-evidence:production` writes these handoff rows:\n\n- `production-record-export`: production record export source plus non-zero record count.\n- `record-enrichment-denominator`: non-zero denominator for `dataQualityEnrichedShare`.\n- `production-reconciliation-export`: production reconciliation source plus real candidate decisions.\n- `reviewed-precision-counts`: reviewed and accepted auto-linked candidate counts supplied together from real review evidence.\n- `strict-era-c-refresh`: ready only when the previous KPI input rows are production-shaped; the final pass/fail still happens in `pnpm era-c:exit-gate:public`.\n\n## Diagnostics\n\n`diagnostics.metricsPreview` mirrors the KPI values telemetry will derive from\nthe aggregate evidence file. `diagnostics.blockers[]` is empty only when those\npreviews meet the Era C KPI targets. Blockers currently use these IDs:\n\n- `record-enrichment-gap`: production records do not yet meet the 0.8 enriched-share target.\n- `reconciliation-decision-gap`: production reconciliation decisions are missing or below the 0.9 auto-approve target.\n- `reviewed-precision-gap`: reviewed/accepted auto-link counts are missing or below the 0.95 precision target.\n- `strict-era-c-refresh`: at least one KPI blocker remains before the public Era C refresh can pass.\n\n`diagnostics.capturePlan.rows[]` turns those gaps into a capture checklist:\n\n- `record-enrichment-capture`: production record id plus unique recognized authority URI/equivalent count export; current/local/demo/fixture/sample/test source labels do not count.\n- `reconciliation-distribution-capture`: production `auto-link`, `weekly-digest`, `human-review`, and `drop-candidate` counts; dropped candidates are tracked but excluded from the considered-candidate denominator.\n- `reviewed-precision-capture`: reviewed and accepted auto-link counts plus the production curator review source.\n- `strict-era-c-refresh`: refresh `monitoring/kpis.json` and `artifacts/exit-gate/era-c-exit-gate-latest.json` only after the capture rows are ready.\n\n`diagnostics.evidenceNeeds.enrichment.sampleRecordGaps[]` is a repair aid, not\na separate strict gate. It lists up to 10 under-enriched records sorted by the\nlargest remaining unique authority reference gap first. Regenerate it with\n`pnpm monitoring:kpi-evidence:production` before treating the rows as production\ncleanup evidence.\n\n`diagnostics.handoffSummary` is the compact operator entry point. Its\n`metricBlockerCount` counts only the KPI metric gaps, not the synthetic\n`strict-era-c-refresh` blocker, so the handoff can say exactly how many input\nrows still need real production evidence before the strict refresh can succeed.\nUse `nextCommand` and `nextEvidenceNeeded` as the first remediation step when\nthe summary status is `needs-production-evidence`. When production source shape\nand metric thresholds are different problems, `nextMetricCommand` and\n`nextMetricEvidenceNeeded` point at the first KPI threshold blocker directly\nwhile `nextCommand` remains the strict source-shape handoff.\n\n## Workflow\n\n1. Export aggregate counts from production record materialization and curator review systems.\n2. Write the aggregate JSON to `monitoring/kpi-evidence.json` or set `METAMUSEUM_KPI_EVIDENCE_PATH`.\n3. Inspect `diagnostics.handoffSummary`; if it says `needs-production-evidence`, run its `nextCommand` and attach the named `nextEvidenceNeeded` first. If `nextMetricCommand` is present, capture that metric evidence in the same production export whenever possible.\n4. Confirm every KPI `acceptanceRows[]` entry is `ready`.\n5. Confirm every `diagnostics.capturePlan.rows[]` entry is `ready` and `diagnostics.blockers[]` is empty.\n6. Run `pnpm monitoring:telemetry:public`.\n7. Run `pnpm era-c:exit-gate:public`.\n8. Inspect `monitoring/kpis.json` sources; evidence-backed sections cite the KPI evidence file and source label.\n\n`pnpm monitoring:kpi-evidence:production` loads the same repo `.env*` files as\nthe launch evidence scripts before enforcing Postgres storage. Set\n`METAMUSEUM_SKIP_ENV_FILES=1` only when supplying explicit shell/CI variables.\n","sections":[{"level":2,"heading":"Purpose","anchor":"purpose"},{"level":2,"heading":"Default Path","anchor":"default-path"},{"level":2,"heading":"JSON Shape","anchor":"json-shape"},{"level":2,"heading":"Validation Rules","anchor":"validation-rules"},{"level":2,"heading":"Acceptance Rows","anchor":"acceptance-rows"},{"level":2,"heading":"Diagnostics","anchor":"diagnostics"},{"level":2,"heading":"Workflow","anchor":"workflow"}],"html":"<h1 id=\"sota-26-kpi-evidence-input\">SOTA §26 KPI Evidence Input</h1>\n<p>This runbook defines the optional aggregate KPI evidence file consumed by `pnpm monitoring:telemetry:sync`.</p>\n<h2 id=\"purpose\">Purpose</h2>\n<p>`monitoring/kpis.json` stays auto-generated. When `monitoring/kpi-evidence.json` is present, telemetry sync uses it for production-like SOTA §26 inputs that cannot be inferred reliably from local seed records:</p>\n<ul><li>record enrichment share (`dataQualityEnrichedShare`)</li><li>reconciliation auto-approval rate (`reconciliationAutoApproveRate`)</li><li>reviewed reconciliation precision (`reconciliationPrecisionReviewed`)</li></ul>\n<p>If the evidence file is missing or invalid, telemetry sync falls back to record-state heuristics and does <strong>not</strong> manufacture passing values.</p>\n<p>The generated file also includes `diagnostics` and `acceptanceRows`.</p>\n<p>Diagnostics preview the three KPI metric values against the Era C thresholds,</p>\n<p>name the next evidence needed for any gaps, and include a production-only</p>\n<p>`capturePlan` with the exact fields and commands operators need for the next</p>\n<p>export. The enrichment evidence needs also include a capped</p>\n<p>`sampleRecordGaps[]` repair sample with record IDs, labels, current unique</p>\n<p>recognized authority reference counts, and remaining authority URI gaps. Full</p>\n<p>authority URLs and compact IDs such as `aat:...`, `ulan:...`, and `tgn:...`</p>\n<p>are counted as references when they resolve to a recognized authority family.</p>\n<p>`diagnostics.handoffSummary`</p>\n<p>condenses that packet into ready-row</p>\n<p>counts, the remaining metric blocker count, and the next command/evidence pair</p>\n<p>an operator should run first. Acceptance rows do not replace the Era C KPI</p>\n<p>threshold check; they only prove that the aggregate KPI inputs are</p>\n<p>production-shaped enough to hand to telemetry. Strict readiness still requires</p>\n<p>`pnpm era-c:exit-gate:public` to consume the export and pass the configured</p>\n<p>thresholds.</p>\n<h2 id=\"default-path\">Default Path</h2>\n<ul><li>Default: `monitoring/kpi-evidence.json`</li><li>Override: `METAMUSEUM_KPI_EVIDENCE_PATH`</li></ul>\n<h2 id=\"json-shape\">JSON Shape</h2>\n<pre><code>\n{\n  &quot;version&quot;: 1,\n  &quot;updatedAt&quot;: &quot;2026-06-10T00:00:00.000Z&quot;,\n  &quot;records&quot;: {\n    &quot;totalRecords&quot;: 10000,\n    &quot;enrichedRecords&quot;: 8300,\n    &quot;source&quot;: &quot;warehouse materialized records&quot;\n  },\n  &quot;reconciliation&quot;: {\n    &quot;scoreDistribution&quot;: {\n      &quot;autoLink&quot;: 920,\n      &quot;weeklyDigest&quot;: 50,\n      &quot;humanReview&quot;: 30,\n      &quot;dropCandidate&quot;: 80\n    },\n    &quot;reviewedAutoLinkedCandidates&quot;: 200,\n    &quot;acceptedAutoLinkedCandidates&quot;: 190,\n    &quot;reviewedPrecisionSource&quot;: &quot;production curator review export&quot;,\n    &quot;source&quot;: &quot;production reconciliation export&quot;\n  },\n  &quot;diagnostics&quot;: {\n    &quot;metricsPreview&quot;: {\n      &quot;dataQualityEnrichedShare&quot;: 0.83,\n      &quot;reconciliationAutoApproveRate&quot;: 0.92,\n      &quot;reconciliationPrecisionReviewed&quot;: 0.95\n    },\n    &quot;evidenceNeeds&quot;: {\n      &quot;enrichment&quot;: {\n        &quot;requiredEnrichedRecords&quot;: 8300,\n        &quot;remainingEnrichedRecords&quot;: 0,\n        &quot;totalRecords&quot;: 10000,\n        &quot;enrichedRecords&quot;: 8300,\n        &quot;sampleRecordGaps&quot;: []\n      }\n    },\n    &quot;blockers&quot;: [],\n    &quot;capturePlan&quot;: {\n      &quot;productionOnly&quot;: true,\n      &quot;rows&quot;: [\n        {\n          &quot;id&quot;: &quot;record-enrichment-capture&quot;,\n          &quot;status&quot;: &quot;ready&quot;\n        },\n        {\n          &quot;id&quot;: &quot;reconciliation-distribution-capture&quot;,\n          &quot;status&quot;: &quot;ready&quot;\n        },\n        {\n          &quot;id&quot;: &quot;reviewed-precision-capture&quot;,\n          &quot;status&quot;: &quot;ready&quot;\n        },\n        {\n          &quot;id&quot;: &quot;strict-era-c-refresh&quot;,\n          &quot;status&quot;: &quot;ready&quot;\n        }\n      ]\n    },\n    &quot;handoffSummary&quot;: {\n      &quot;status&quot;: &quot;ready-to-refresh&quot;,\n      &quot;readyAcceptanceRows&quot;: 5,\n      &quot;totalAcceptanceRows&quot;: 5,\n      &quot;readyCaptureRows&quot;: 4,\n      &quot;totalCaptureRows&quot;: 4,\n      &quot;metricBlockerCount&quot;: 0,\n      &quot;strictRefreshBlocked&quot;: false,\n      &quot;nextCommand&quot;: &quot;pnpm monitoring:telemetry:public &amp;&amp; pnpm era-c:exit-gate:public&quot;,\n      &quot;nextEvidenceNeeded&quot;: &quot;Run public telemetry and Era C exit-gate evidence to consume the KPI export.&quot;,\n      &quot;nextMetricCommand&quot;: null,\n      &quot;nextMetricEvidenceNeeded&quot;: null\n    }\n  },\n  &quot;acceptanceRows&quot;: [\n    {\n      &quot;id&quot;: &quot;production-record-export&quot;,\n      &quot;status&quot;: &quot;ready&quot;\n    },\n    {\n      &quot;id&quot;: &quot;reviewed-precision-counts&quot;,\n      &quot;status&quot;: &quot;ready&quot;\n    }\n  ]\n}\n</code></pre>\n<h2 id=\"validation-rules\">Validation Rules</h2>\n<ul><li>`records.totalRecords` must be a positive integer.</li><li>`records.enrichedRecords` must be an integer from `0` to `totalRecords`.</li><li>Reconciliation considered candidates are `autoLink + weeklyDigest + humanReview`, or explicit `consideredCandidates`.</li><li>Auto-linked candidates are `scoreDistribution.autoLink`, `autoLinkedCandidates`, or `autoApprovedCandidates`.</li><li>Reviewed precision requires `acceptedAutoLinkedCandidates &lt;= reviewedAutoLinkedCandidates &lt;= autoLinkedCandidates`.</li><li>Invalid sections are ignored independently so one bad source cannot create false-green KPI evidence.</li><li>Strict KPI input acceptance requires production-labeled record and reconciliation sources, non-empty record and candidate denominators, and reviewed/accepted auto-link counts supplied together.</li><li>Diagnostics compare the previewed KPI values against Era C defaults: `dataQualityEnrichedShare &gt;= 0.8`, `reconciliationAutoApproveRate &gt;= 0.9`, and `reconciliationPrecisionReviewed &gt;= 0.95`.</li></ul>\n<h2 id=\"acceptance-rows\">Acceptance Rows</h2>\n<p>`pnpm monitoring:kpi-evidence:production` writes these handoff rows:</p>\n<ul><li>`production-record-export`: production record export source plus non-zero record count.</li><li>`record-enrichment-denominator`: non-zero denominator for `dataQualityEnrichedShare`.</li><li>`production-reconciliation-export`: production reconciliation source plus real candidate decisions.</li><li>`reviewed-precision-counts`: reviewed and accepted auto-linked candidate counts supplied together from real review evidence.</li><li>`strict-era-c-refresh`: ready only when the previous KPI input rows are production-shaped; the final pass/fail still happens in `pnpm era-c:exit-gate:public`.</li></ul>\n<h2 id=\"diagnostics\">Diagnostics</h2>\n<p>`diagnostics.metricsPreview` mirrors the KPI values telemetry will derive from</p>\n<p>the aggregate evidence file. `diagnostics.blockers[]` is empty only when those</p>\n<p>previews meet the Era C KPI targets. Blockers currently use these IDs:</p>\n<ul><li>`record-enrichment-gap`: production records do not yet meet the 0.8 enriched-share target.</li><li>`reconciliation-decision-gap`: production reconciliation decisions are missing or below the 0.9 auto-approve target.</li><li>`reviewed-precision-gap`: reviewed/accepted auto-link counts are missing or below the 0.95 precision target.</li><li>`strict-era-c-refresh`: at least one KPI blocker remains before the public Era C refresh can pass.</li></ul>\n<p>`diagnostics.capturePlan.rows[]` turns those gaps into a capture checklist:</p>\n<ul><li>`record-enrichment-capture`: production record id plus unique recognized authority URI/equivalent count export; current/local/demo/fixture/sample/test source labels do not count.</li><li>`reconciliation-distribution-capture`: production `auto-link`, `weekly-digest`, `human-review`, and `drop-candidate` counts; dropped candidates are tracked but excluded from the considered-candidate denominator.</li><li>`reviewed-precision-capture`: reviewed and accepted auto-link counts plus the production curator review source.</li><li>`strict-era-c-refresh`: refresh `monitoring/kpis.json` and `artifacts/exit-gate/era-c-exit-gate-latest.json` only after the capture rows are ready.</li></ul>\n<p>`diagnostics.evidenceNeeds.enrichment.sampleRecordGaps[]` is a repair aid, not</p>\n<p>a separate strict gate. It lists up to 10 under-enriched records sorted by the</p>\n<p>largest remaining unique authority reference gap first. Regenerate it with</p>\n<p>`pnpm monitoring:kpi-evidence:production` before treating the rows as production</p>\n<p>cleanup evidence.</p>\n<p>`diagnostics.handoffSummary` is the compact operator entry point. Its</p>\n<p>`metricBlockerCount` counts only the KPI metric gaps, not the synthetic</p>\n<p>`strict-era-c-refresh` blocker, so the handoff can say exactly how many input</p>\n<p>rows still need real production evidence before the strict refresh can succeed.</p>\n<p>Use `nextCommand` and `nextEvidenceNeeded` as the first remediation step when</p>\n<p>the summary status is `needs-production-evidence`. When production source shape</p>\n<p>and metric thresholds are different problems, `nextMetricCommand` and</p>\n<p>`nextMetricEvidenceNeeded` point at the first KPI threshold blocker directly</p>\n<p>while `nextCommand` remains the strict source-shape handoff.</p>\n<h2 id=\"workflow\">Workflow</h2>\n<ol><li>Export aggregate counts from production record materialization and curator review systems.</li></ol>\n<ol><li>Write the aggregate JSON to `monitoring/kpi-evidence.json` or set `METAMUSEUM_KPI_EVIDENCE_PATH`.</li></ol>\n<ol><li>Inspect `diagnostics.handoffSummary`; if it says `needs-production-evidence`, run its `nextCommand` and attach the named `nextEvidenceNeeded` first. If `nextMetricCommand` is present, capture that metric evidence in the same production export whenever possible.</li></ol>\n<ol><li>Confirm every KPI `acceptanceRows[]` entry is `ready`.</li></ol>\n<ol><li>Confirm every `diagnostics.capturePlan.rows[]` entry is `ready` and `diagnostics.blockers[]` is empty.</li></ol>\n<ol><li>Run `pnpm monitoring:telemetry:public`.</li></ol>\n<ol><li>Run `pnpm era-c:exit-gate:public`.</li></ol>\n<ol><li>Inspect `monitoring/kpis.json` sources; evidence-backed sections cite the KPI evidence file and source label.</li></ol>\n<p>`pnpm monitoring:kpi-evidence:production` loads the same repo `.env*` files as</p>\n<p>the launch evidence scripts before enforcing Postgres storage. Set</p>\n<p>`METAMUSEUM_SKIP_ENV_FILES=1` only when supplying explicit shell/CI variables.</p>","updatedAt":"2018-10-20T01:46:40.000Z","checksum":"bc46be9b160e6f77d11a20f401cae2a8e5304f991c1e38ddddd515c6d54538f4","checksumPrefix":"bc46be9b160e","anchorCount":7,"lineCount":194,"rawUrl":"/api/docs/content?path=ops%2Fkpi-evidence.md","htmlUrl":"/docs?doc=ops%2Fkpi-evidence.md","apiUrl":"/api/docs/content?path=ops%2Fkpi-evidence.md"}