1 reporting.generation_posthoc
reporting.generation_posthoc
Publish detached, tamper-evident generation post-hoc reports.
This module is deliberately downstream of scientific reduction. It accepts a completed GenerationPosthocEvidence, draws only values already present in its tables, and never opens rollout stores, fits a model, bootstraps rows, or chooses a nomination.
The output directory has the following closed generation-posthoc-report-v1 layout::
manifest.json
evidence.json
report.html
tables/<table-name>.json
figures/<figure-id>.svg
manifest.json declares the SHA-256 and media type of every other regular file. The reader rejects missing, extra, changed, symlinked, special, or non-canonical JSON files and returns bytes captured during that validation.
1.1 Classes
| Name | Description |
|---|---|
| GenerationPosthocAsset | One cold-verified report file. |
| GenerationPosthocReport | Detached cold-read product for a generation post-hoc report. |
1.1.1 GenerationPosthocAsset
reporting.generation_posthoc.GenerationPosthocAsset(
relative_path,
media_type,
sha256,
payload,
)One cold-verified report file.
1.1.1.1 Attributes
| Name | Type | Description |
|---|---|---|
| relative_path | str | Canonical bundle-relative POSIX path. |
| media_type | str | Manifest-declared media type. |
| sha256 | str | Digest of payload. |
| payload | bytes | Exact file bytes captured during report verification. |
1.1.2 GenerationPosthocReport
reporting.generation_posthoc.GenerationPosthocReport(
payload,
tables,
assets,
manifest_sha256,
)Detached cold-read product for a generation post-hoc report.
payload and tables are recursively detached JSON values. assets contains every manifest-declared file, so consumers never need the original rollout stores or an unverified second filesystem read.
1.1.2.1 Attributes
| Name | Description |
|---|---|
| payload | Validated evidence payload detached from source and caller objects. |
| tables | Validated table rows keyed by their stable table name. |
| assets | All declared report files in lexical path order. |
| manifest_sha256 | SHA-256 of the exact canonical manifest.json bytes. |
1.2 Functions
| Name | Description |
|---|---|
| read_generation_posthoc_report | Cold-read and verify a sealed generation post-hoc report directory. |
| write_generation_posthoc_report | Write one fresh, sealed HTML/table/SVG product. |
1.2.1 read_generation_posthoc_report
reporting.generation_posthoc.read_generation_posthoc_report(path)Cold-read and verify a sealed generation post-hoc report directory.
1.2.2 write_generation_posthoc_report
reporting.generation_posthoc.write_generation_posthoc_report(evidence, output)Write one fresh, sealed HTML/table/SVG product.
1.2.2.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| evidence | GenerationPosthocEvidence | Completed domain result. Its canonical payload_json is the only scientific input consumed here. |
required |
| output | Path | New report directory. Existing paths are rejected rather than refreshed in place. | required |
1.2.2.2 Returns
| Name | Type | Description |
|---|---|---|
| Path | output / "report.html" after a successful cold-read verification. |
1.2.2.3 Raises
| Name | Type | Description |
|---|---|---|
| FileExistsError | If output already exists. |
|
| ValueError | If the evidence or a generated report contract is invalid. |