# OCFL recovery: a valid object can be the wrong target

Hesela research packet, 2 November 2026. Native validator observations on synthetic
local files, joined to the OCFL 1.1 specification. Not a newly discovered attack
or a failure-rate study. Review status: author-checked, awaiting independent review.

## Result

An intact historical OCFL snapshot passed full object validation but failed an
independently retained expectation for version 2. A second valid object with the
same object ID and head also failed that expectation. Neither case required a
hash collision. In contrast, full validation rejected a missing file, changed
file bytes, and an old root inventory left beside a later version directory.

The same native command validated every standalone inventory. Passing an
inventory path and passing an object directory answer different questions.

| Fixture | Inventory only | Full object | Exact v2 target |
| --- | --- | --- | --- |
| Intended v2 | Pass | Pass | Accept |
| Intact historical v1 | Pass | Pass | Reject |
| Old root inventory; v2 directory retained | Pass | Reject E046b | Reject |
| Latest payload missing | Pass | Reject E092b | Reject |
| Latest payload changed | Pass | Reject E092a | Reject |
| Same ID and v2 head; alternative content | Pass | Pass | Reject |
| Same inventory values; changed JSON formatting | Pass | Pass | Reject |

The last row is an intentional strict-policy rejection, not semantic data loss.
Exact inventory bytes differ although parsed JSON values and content agree.
A recovery workflow must choose whether it requires byte identity or semantic
equivalence. This packet implements only exact-inventory-byte acceptance.

## What the standard and code establish

OCFL 1.1 specifies an object at rest: consecutive version directories, inventory
state, a current head and matching content digests. Root and newest-version
inventories must agree. A surviving v1 object contains no evidence that a v2 ever
existed elsewhere. The specification already discusses keeping digests externally
to protect against coordinated replacement. [1, sections 3.3-3.7]

The implementation notes separate object-at-rest validation from transactional
updates and recovery. Prior-version immutability is an operating assumption, not
a detector that can reconstruct missing history from an old complete copy.
Their update example exposes intermediate invalid states. Our root-only rewind
is a deliberately constructed mismatch, not an observed crash outcome. [2,
sections 3.2.2 and 3.7]

The unchanged ocfl-py entry point dispatches a file path to inventory validation
and an object directory to object validation. Its content checks are enabled by
default; neither run used the bypass flag. The native error codes and full
stdout/stderr are retained. [3]

BagIt similarly separates completeness and checksum validity, and warns that
active replacement of payload and manifests is outside its protections. This is
a useful comparison of assurance boundaries, not a claim that the formats or
their validators are interchangeable. [4, sections 3 and 5.4]

## Original method

Seven designed fixtures; one pinned ocfl-py 2.1.0 source revision; two fresh
captures of two validation modes, totaling 28 native CLI invocations on one
Linux host with CPython 3.12.3. Repetitions agreed on verdicts, codes, target
acceptance and every fixture-file hash. Repetition checks repeatability only.

We construct a two-version OCFL object with a single logical report per version
and SHA-512 content addressing. Version timestamps are fixture inputs, not
measurements of real accession time. The v1 control is byte-identical to the
earlier snapshot. The fork is constructed separately with the same object ID
and head, and a different 13-byte v2 payload. No production repository, account,
device, network store or real archived material is modified.

Before validating candidates we retain the intended v2 object ID, head and SHA-512
of its exact root inventory bytes. The receipt is outside every candidate
directory. Acceptance requires BOTH full native object validation and equality
with those three receipt fields. The missing/changed-payload controls still match
the inventory receipt, demonstrating why that comparison cannot replace reading
the content. Selecting the independently retained v1 receipt accepts the intact
v1 snapshot: old data is not wrong when history is the intended recovery target.

A receipt's independence, authority and currency are explicit assumptions.
This script does not implement a trusted catalog, signature service, protected
audit log, atomic publication or anti-rollback storage. A stale or replaced
receipt can select the wrong target. No checker can infer a missing external
history merely from the same old input bytes.

## Contribution to the existing corpus

The existing checksum/identity article explains the abstract distinction between
integrity, identity and generation. The backup article covers BagIt and recovery
expectations. This packet adds an actual OCFL validator boundary and its
operational controls: path-selected validation scope, a complete old snapshot,
same-ID/same-head alternative content, and exact-byte versus semantic identity.

Integrate the short section in INTEGRATION.md into the existing backup article,
with a cross-link from the integrity article. Enrich the existing backup-manifest
record; do not create a duplicate generic checksum article. No new OCFL term is
required for this bounded result.

## Reproduce

Offline verification needs only Python 3.10+ standard library:

```sh
python3 verify.py run-1 run-2
python3 -m unittest -v test_evidence
python3 -O -m unittest -v test_evidence
```

It regenerates deterministic fixtures and checks retained native outcomes.
It DOES NOT rerun ocfl-py or authenticate these files against an independent
publication channel. Fourteen deliberate receipt mutations must be rejected.

Native replay additionally needs the pinned dependencies in requirements-native.txt:

```sh
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements-native.txt
.venv/bin/python experiment.py --validator vendor/ocfl-validate.py --output replay
python3 verify.py run-1 run-2 replay
```

Dependency installation may require network access; this ZIP is not an offline
dependency bundle. The unchanged MIT-licensed validator source is included,
with its license and per-file SHA-256 manifest. The harness verifies that manifest
before running the native validator and refuses an existing output directory.

Optional report generation uses ReportLab and installed DejaVu Sans/Mono fonts:
`python3 render_report.py /path/to/ocfl-recovery-boundary.pdf`.
The PDF table is generated from summary.json. Those rendering dependencies are
separate from the native experiment dependencies.

## Limits

Only one implementation, source revision, operating system and Python version were
tested natively. No other validator, complete conformance suite, cloud behavior,
concurrency, crash consistency, cryptographic adversary or repository-wide
object loss was tested. The strict receipt rejects harmless reserialization;
there is no generic OCFL JSON canonicalizer here. Confidence intervals and
percentages would be misleading for these deliberately chosen cases.

## Sources

1. OCFL editors. Specification 1.1, updated 7 November 2024.
   https://ocfl.io/1.1/spec/
2. OCFL editors. Implementation Notes 1.1, updated 7 November 2024.
   https://ocfl.io/1.1/implementation-notes/
3. Simeon Warner and contributors. ocfl-py 2.1.0, source commit
   a480226d54cf8d03d71ab8c56eb69ae8a78e231d. MIT.
   https://github.com/zimeon/ocfl-py/tree/a480226d54cf8d03d71ab8c56eb69ae8a78e231d
4. Kunze et al. RFC 8493, The BagIt File Packaging Format (V1.0), October 2018.
   https://www.rfc-editor.org/rfc/rfc8493.html
5. Existing Hesela context:
   https://hesela.com/analyses/backup-verification-is-not-a-restore-test/
   https://hesela.com/analyses/checksums-identity-and-lost-writes/

Source URLs, access times, page hashes, licenses and exact code file hashes are
retained in sources.json and validator-source.json. No DOI is invented.
