/report-regeneration:report-fidelity-harnessfrom report-regeneration
Verifies regenerated reports with 6 deterministic checks (value accuracy, frozen-complement diff, re-inference isomorphism, taint egress, render referee, manifest coverage) plus period-coherence. Proves no old-client data leaked and nothing changed outside bound anchors.
Ships in report-regeneration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The load-bearing wall of report-regeneration. No off-the-shelf verifier exists, so the
harness is composed of six independent legs plus a period-coherence check, each a runnable
deterministic checker that emits one entry in a structured-output fidelity-receipt
(../../knowledge/fidelity-receipt.schema.json).
It inherits the W5 discipline verbatim: PROBE_ERROR ≠ pass (a parse/harness crash never
reads as "fidelity OK"), any not_captured ⇒ overall PARTIAL, never PASS, receipts are
TTL'd and environment-fingerprinted, and each leg is labeled proven (deterministic) vs
judged (behavioral).
Design authority: ../../knowledge/core-architecture-spec.md
§5 (the leg matrix), §4 (the node taxonomy), §6 (the security posture). If this skill and the spec
ever disagree, the spec wins.
| Leg | Question | ML-free? | Tier |
|---|---|---|---|
| V1 value accuracy | did value V land at region R? | recompute (2nd path) + anchor partly; set-membership + cross-slot ML-free | proven, blocking |
| V2 frozen-complement diff | did anything change outside the bound anchors? | fully ML-free | proven, blocking |
| V3 re-inference isomorphism | is the output's structure the template's? | coarse count cross-check ML-free; fine isomorphism inference-adjacent | proven, blocking |
| V4 taint egress | did any old-client data survive? | fully ML-free | proven, BLOCKING |
| V5 render referee | does it render / lay out? | rendering engine ≠ authoring path | judged; not_captured when no renderer |
| V6 manifest coverage | is the partition itself correct? | fully ML-free | proven, blocking |
| period-coherence | does the label match the value's period? | fully ML-free | proven, blocking |
--new-data (a genuine second execution
path, distinct from the binding's inference path), then (a) locates it at the binding's anchor
and (b) verifies it appears somewhere via position-agnostic set-membership (catches a
mis-anchored value as "appears nowhere"), plus a cross-slot check (a KPI and the table it
summarizes must agree).surgical/regenerate anchors → must be empty. Comments are excluded (purged
pre-emit, spec §6.6); the DOCTYPE and every other node are compared.script/style CDATA + base64/data-URI blobs — against a taint dictionary of the old
artifact's distinct values + identity strings, normalized to typed value-space so a
reformat/round/locale survival still matches.not_captured (never a fake pass) when Playwright/LibreOffice is absent.surgical/regenerate that the output presents as frozen/unbound while still carrying a
dataset value is a coverage failure (silent staleness); a value-shaped literal in a
frozen region force-demotes to advisory needs-review (the §4 hard rule).python3 harness.py \
--template ../../../../tests/fixtures/report-regeneration/sample-report.html \
--output <regenerated-output.html> \
--manifest fixtures/clean-manifest.json \
--new-data fixtures/clean-new-data.json \
--format json
Optional flags:
--taint taint.json — override the taint dictionary (default: derive the old-artifact literals
from the template's documented TAINT DICTIONARY block).--disable-leg V4 (repeatable) — neuter a leg. This is the test-only must-fail mutant
knob: it is refused (exit 2) unless RR_HARNESS_ENABLE_DISABLE_LEG=1 is set, and the Python
API ignores it without that flag. A disabled leg reports verdict disabled, never pass, and
forces the overall gate off PASS (a blocking disabled leg makes it FAIL), so a test can prove
the enabled leg has real teeth without the mutant ever green-lighting a delivery.--ttl <seconds> / --pretty.Exit codes: 0 = PASS or PARTIAL (no blocking failure), 1 = FAIL (a blocking leg fired),
2 = usage / path-guard error. The authoritative verdict is the receipt's overall_gate.
The Python API mirrors the CLI: harness.run_harness(template, output, manifest, new_data, taint=None, disabled_legs=(), ttl_seconds=3600) -> receipt_dict (already schema-validated).
overall_gate is PASS only when every leg verdict is pass; FAIL if any blocking leg
fails or PROBE_ERRORs; PARTIAL otherwise (e.g. V5 not_captured). A missing Tier-B leg
yields PARTIAL, never PASS. The harness fail-closes: it validates its own receipt against the
frozen schema before emitting and refuses to emit an invalid one.
tests/test_harness.py is the acceptance suite. It injects each defect from
../../scripts/seed_defects.py (the D1–D14 oracle) and asserts:
not_captured → gate PARTIAL, honest).inference_independent.python3 tests/test_harness.py # standalone (no pytest needed)
Stdlib-only (html.parser / re / json / base64 / hashlib / difflib-free node-diff),
runs on Python 3.9.6, from __future__ import annotations, no X|Y/match, no pip installs, no
network, read-only + path-guarded. V4 and V6 are genuinely ML-free; the harness codes to the RSG /
binding-manifest / fidelity-receipt schemas so the infer and rebind stages can run in parallel.
fixtures/clean-manifest.json (opens in a new tab)fixtures/clean-new-data.json (opens in a new tab)fixtures/clean-output.html (opens in a new tab)harness.py (opens in a new tab)render_referee.py (opens in a new tab)tests/test_harness.py (opens in a new tab)tests/test_harness_office.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/infer-officeStage 1 of the report-regeneration OFFICE (docx) pipeline. Parses a Word .docx template into a schema-valid Report Structure Graph (RSG) via stdlib zipfile + xml.etree over word/document.xml: per-node OOXML body-walk anchor, role, rebind class, confidence, provenance, plus the deterministic data-shaped-literal detector reused from the HTML lane. Stdlib-only, Python 3.9; python-docx optional./infer-report-structureStage 1 of the report-regeneration HTML pipeline. Parses an HTML template into a schema-valid Report Structure Graph (RSG): per-node stable anchor, role, rebind class, confidence, provenance, plus the deterministic non-inference data-shaped-literal detector that drives the earned-frozen rule. Stdlib-only, runs on Python 3.9./powerbi-ingestPipeline-facing Power BI ingestion adapter, wrapping scripts/powerbi_probe.py for two modes: `data` runs every dax-kind Binding Manifest binding via REST executeQueries (service-principal/token from ENV ONLY), returning a data.json-shaped fragment keyed by data_query.expression with source_period stamped -- a genuinely independent V1 recompute source for a PBI-sourced value. `shot` captures a fresh report image via ExportToFile (Playwright fallback), packaging it as the embedded image for a regenerate-class PBI node with source_period stamped so period-coherence can catch a stale screenshot. Fail-closed throughout: no creds/route/period => not_captured + the named fallback (manual-figure-labeled-unverified for data, user-provided-image for shot), never a fabricated value or period. Token never logged. Reach for this to turn a Binding Manifest's PBI-sourced bindings into pipeline artifacts. NOT for manifest construction (rebind-manifest) or running the fidelity harness itself (report-fidelity-harness)./rebind-htmlPipeline stage 3 (the HTML surgical output engine) for report-regeneration. Applies a Binding Manifest to a COPY of an HTML report template and emits the regenerated HTML: frozen nodes stay byte-identical, surgical/regenerate nodes are rebuilt under the zero-literal construction rule (strip the old value, THEN write the new one), needs-review nodes are left untouched but visibly flagged + logged. Stdlib-only (re/html.parser/json), jinja2 optional acceleration, runs on Python 3.9.6. NOT for structure inference (that's an earlier pipeline stage) or the fidelity harness (a separate downstream track) or Office/docx output (a later release lane)./rebind-manifestPipeline stage 2 of report-regeneration (detect -> strip -> rebind): turn an RSG + the OLD template + the new dataset into a schema-valid Binding Manifest and a taint dictionary. Enforces the earned-frozen rule (a data-shaped literal / old-taint / new-dataset value demotes a candidate-frozen node to needs-review), forces raster/embedded-cache nodes to regenerate, and proposes each node's data_query. Reach for this when building or amending a Binding Manifest./rebind-officePipeline stage 3 (the Office/docx surgical output engine) for report-regeneration — the Office analogue of rebind-html. Applies a Binding Manifest to a COPY of a Word .docx template and emits the regenerated .docx: frozen OPC parts + nodes stay byte-identical, surgical/regenerate nodes are rebuilt under the zero-literal construction rule (strip the old value, THEN write the new), rasters are re-captured (never transplanted), needs-review nodes are left untouched but visibly marked + logged. Stdlib-only (zipfile/xml.etree), edits via the shared rr_anchor OOXML resolver, python-docx/docxtpl optional, runs on Python 3.9. NOT for structure inference (infer-office, an earlier stage), the fidelity harness (a separate downstream track), or HTML output (the rebind-html lane).npx claudepluginhub mcorbett51090/ravenclaude --plugin report-regeneration