# Restore acceptance includes metadata that must not remain

Research packet for Hesela issue [5747](https://github.com/hesela/hesela-seo/issues/5747).
Prepared on 16 November 2026 Warsaw time (captures on 15 November UTC).
Not deployed, independently reviewed, or a claim of a new software vulnerability.

## Reproduce

Requirements: Linux, a non-root account with zero effective capabilities, Python 3,
GNU tar with xattr support, rsync with xattr support, findmnt, and writable xattr-capable
test locations. The recorded builds were GNU tar 1.35, rsync 3.2.7, Python 3.12.3
and Linux 6.8.0-149-generic. Full distribution versions and binary hashes are in
SOURCES.json. These versions identify observations, not upgrade recommendations.

From this directory:

```sh
python3 -B verify.py
python3 -B test_probe.py
python3 -O -B test_probe.py
python3 -B probe.py --directory . --directory /dev/shm --repetitions 3 --output replay.json
```

The probe creates private temporary fixture trees inside each supplied parent.
It changes and deletes only its own fixtures, refuses root/effective capabilities,
uses no shell for tool invocations, does not follow supplied file targets, and refuses
an already existing output filename. It never sets security.*, system.* or trusted.*
attributes. Parent paths must already exist. No package install, mount, network
transfer, privilege change or production restore is involved.

The frozen validator checks the supplied two captures, their exact scenario grid,
known fixture hashes and recorded versions. It is deliberately not a universal
verdict for another machine. A new replay may have different inodes, timestamps,
archive ownership bytes or software behavior; preserve and investigate those differences.
A different archive hash alone is not evidence of payload corruption.

## Evidence and method

Eleven scenarios, two existing filesystem types (ext4 and tmpfs), three fresh
repetitions, two separate captures: 132 executions on ONE host. These are repeatability
controls, not independent systems, random samples, failure-rate estimates or confidence
intervals. Both captures agree on the derived outcomes. The 285-byte regular-file payload
and modes 0640 (file), 0750 (directory) match in every execution.

Each source file and directory has two user attributes: one binary value ending
in 00 ff and one defined empty value. Existing destinations start with different
values plus user.hesela.extra. A hard link outside the destination subtree retains
the original destination inode. Both names and complete visible user.* value maps
are captured before and after; values are hex, so absent, empty and non-text remain distinct.

All tar scenarios consume a pax archive created with --xattrs and user.* inclusion;
--same-permissions isolates xattr behavior from the process umask. Archive creation
removes volatile atime/ctime pax keys. File-content equality is checked both byte-for-byte
and by SHA-256. Rsync's unchanged-file controls deliberately match size and mtime; its
changed-payload control starts with a shorter file. The probe records nonzero restore
status and resulting state rather than treating errors as rollback.

Exploratory runs revealed two protocol needs: --unlink-first can fail after partial
effects, so exit status must be captured; default tar extraction applied the host's
umask, so final controls explicitly preserve modes. Exploratory data remain in the
shared artifact directory, outside the final evidence package. Final captures use
exactly the probe identified by their script_sha256.

## Files

- probe.py: native fixture runner.
- capture-1.json / capture-2.json: complete native observations and command receipts.
- verify.py: independent expected-map/identity checks and derived output generator.
- test_probe.py: 16 methods including forged-status, omitted-row, binary/empty-value,
  extra-key, alias, payload and provenance rejection controls.
- summary.json / table.md: generated 11-row result, checked byte-for-byte.
- SOURCES.json / claims.json: primary-source provenance, typed claims and corpus mapping.
- synthesis.md / article-insertion.md: editorial explanation and existing-article insertion.
- package.py: deterministic offline packet generator and exact member/hash checker.

Use `python3 -B verify.py --write` only to regenerate the derived table from the frozen
captures. No source code or source text is copied from upstream into this packet.

## Limits

The observed namespace is visible user.* under one account, not all system metadata.
No ACL translation, SELinux, capabilities, privileged xattrs, remote filesystem,
concurrent mutation, I/O failure injection, symlink traversal, crash or power-cut test.
Tmpfs is not persistent storage. The binary user values have no tested authorization
meaning; a stale attribute is not by itself proof of a security breach.
Equal selected xattrs are only one part of application recovery acceptance.
No recommendations to recursively delete destination attributes or to add
--unlink-first to real restore commands follow from this experiment.

Code is MIT-licensed (LICENSE); observation/derived JSON is CC0-1.0. Editorial text
uses the repository's publication terms. Third-party sources retain their own licenses.
