# Rsync update rules and checksum selection

Constructed native software observations, not a new rsync algorithm or a frequency estimate.

## Question and reproduction

Does content-based selection override an earlier destination-time skip?
Does negative modify-window use nanosecond ordering in that skip, as in quick-check?

Run in this directory with Python 3 and rsync:
```sh
python3 -B observe.py --scratch /dev/shm --output results-system.json
python3 -B observe.py --binary /path/to/rsync --scratch /dev/shm --output results-other.json
python3 -B -m unittest -v test_observe
```
Only private temporary regular files are changed. Output paths must be new.
Each run is 11 fixtures times 6 policies, with full stdout/stderr, sizes, exact
timestamps, byte equality, SHA-256 hashes and rsync/binary/environment identity.
Source content, size and mtime must remain unchanged; access time is not tested.
Transferred outputs must match source bytes; untransferred ones must retain their
initial bytes. Payload accounting is checked. Tests use an explicit expected matrix
separate from the observation code.

## Fixture contract

Source: first 8192 bytes of SHAKE-256 of ASCII hesela-rsync-update-v1.
Source mtime: 1700000000.5 seconds. Changed destinations flip byte 4097.
Destination times vary by 0, +/-0.4, +/-1 or +/-2 seconds. Two identical-content
controls, a 4096-byte newer destination and an absent destination test separate paths.
Every invocation starts fresh, uses --times, delta mode, a 512-byte block and MD5.
MD5 is a compatible non-authenticating control; exact equality is independently
checked. --info=skip2 exposes skip messages. Isolated HOME and a minimal environment
prevent user aliases.

## Scope and source interpretation

The v3.2.7 and v3.4.1 generators test the integer-second expression
source_mtime_seconds - destination_mtime_seconds < modify_window for --update,
before the regular-file quick check. This differs from quick-check's nanosecond
equality path. Window 1 can skip equal-second files; window -1 can allow a
destination one integer second ahead. These are version-scoped observations,
not advice to use a timestamp window to validate a backup.

The sender can still read source data for --checksum when destination transfer
is skipped; transferred-file counts do not measure all read I/O. We do not test
directories, symlinks, interrupted transfers, network peers or on-media durability.
A newer destination may be the desired version: establish the authoritative version
and recovery objective before removing protective rules.

Primary sources, accessed 2026-10-21:
- https://github.com/RsyncProject/rsync/blob/v3.2.7/generator.c#L1625
- https://github.com/RsyncProject/rsync/blob/v3.4.1/generator.c#L1625
- https://github.com/RsyncProject/rsync/blob/v3.4.1/rsync.1.md
- https://download.samba.org/pub/rsync/src/rsync-3.4.1.tar.gz

## Rights

Hesela's runner, tests, observations and notes in this bundle are MIT licensed.
Upstream rsync remains GPL-3.0-or-later; no upstream code or binary is redistributed.
Hashes identify the experiment, not independent signature verification or a
security recommendation.
