# GNU tar incremental recovery lineage

A nine-procedure synthetic experiment on GNU tar 1.35 shows that matching names,
sizes and exit status can coexist with stale restored contents when a required
intermediate archive is omitted. It also separates retrying with an advanced
change-selection cursor from retrying with the saved base cursor.

## Reproduce

Unpack the entire reproduction.zip into a new working directory and run:

```sh
python3 build_package.py --verify-only
python3 verify.py
python3 -m unittest discover -s . -p 'test_*.py' -v
python3 -O -m unittest discover -s . -p 'test_*.py' -v
python3 probe.py --output fresh-observation.json
```

Python's standard library and GNU tar are required. The output must not already
exist. The runner uses only its own temporary synthetic files and removes them.
Tests each perform a fresh native replay and compare all nine outcomes with
the retained captures. The exact archive bytes vary with timestamps/inodes;
semantic agreement is not a claim of byte-identical regenerated archives.
The publication validator additionally binds every command to the intended
archive, selection cursor and isolated destination, requires integer exit
statuses, and rejects duplicate JSON keys and non-finite numbers. The original
verify.py is preserved as historical research code; use build_package.py
--verify-only for these stricter publication checks. Both test suites are
included in the ZIP and run without a repository checkout.
The manifest binds the distributed files by byte length and SHA-256. A manifest
served beside the files is not a signature or independent authenticity anchor.

## Read the result

summary.json is generated from final-1.json and final-2.json, not manually entered.
Both captures include commands, binary identity, archive/snapshot bytes, hashes
and restored versus independently declared expected manifests.
Each capture contains seven creations, seven listings and nineteen extractions.
All 33 commands return zero. Nine deliberately designed procedures are not nine
random trials or an estimated failure rate.

The two retry cases target generation 1; the other seven target generation 2.
In missing-middle, revised.txt stays old despite correct filenames and sizes.
In retry-advanced, both revised.txt and recent.txt stay old. The complete ordered
chain, saved-cursor retry, base-relative fork and fresh-full controls match.

## Sources and interpretation

The [GNU manual](https://www.gnu.org/software/tar/manual/html_node/Incremental-Dumps.html)
documents change-selection snapshots and extraction from the actual archives.
[Dumpdir](https://www.gnu.org/software/tar/manual/html_node/Dumpdir.html)
explains the N entry for a present name whose unchanged payload was not archived.
The [TDB paper](https://static.usenix.org/event/osdi00/full_papers/maheshwari/maheshwari_html/)
(OSDI 2000, sections 6.2-6.3) separately checks predecessor identity and backup-set
completeness. Its historical cryptography is not a current recommendation.
sources.json distinguishes source facts, observations and engineering inference.

This publication review repeats the native experiment and checks the code and
source claims; it is not external peer review or an independent implementation.
The GNU manual was available through indexed retrieval; direct requests timed
out. No inspected upstream GNU C implementation is claimed.

## Retention and retry consequence

The tested base-plus-tail pair fails, while the base-plus-generation-2-fork pair
succeeds. Equal archive counts and readable files are not a substitute for
predecessor identity. As an engineering inference, retain the actual dependency
closure of each promised recovery point, and preserve the accepted selection
checkpoint until its replacement recovery generation has been accepted.
This does not require every incremental format to replay all earlier backups.

The successful saved-cursor retry uses the declared, unchanged generation-1
source. An old cursor is not a copy of old source contents. A real publication
protocol still needs durable association and concurrency control; no crash-safe
backup wrapper is implemented or validated here.

## Limits

One binary and host, quiescent short-name regular files. No compression,
rename/link/ACL/xattr coverage, concurrent writes, hostile archives, network
failure injection, crash or durability claim. The experiment withholds an
otherwise successful middle archive at restore time. It does not test snapshot
updates after a failed creation/upload or establish a backup product defect.
A saved cursor cannot recreate historical source bytes that no longer exist.
Never extract untrusted archives or test incremental deletion over live data.

The code and synthetic observations originate in Hesela research PR #2430.
The immutable research candidate's README/handoff describe its earlier state;
this guide describes the portable publication bundle. Presence of this guide
in a branch does not establish live deployment.

Analysis: https://hesela.com/analyses/compressed-archives-dictionary-dependencies/#tar-incremental-lineage
Definition: https://hesela.dev/terms/incremental-backup/
