# SQLite change observers

These are controlled, synthetic software schedules on the SQLite build recorded
in each JSON file, not production failure rates or a database defect report.

Download the [complete research bundle](sqlite-change-observers.zip) and extract it
into an empty directory. [manifest.json](manifest.json) lists file sizes and SHA-256
checksums. Keep the files together. Python 3.9+ and its standard sqlite3
module are required; no additional Python packages are needed.

```sh
python3 observe.py --work-root . --output rerun.json --table rerun-table.md
python3 lifetime.py --work-root . --output lifetime-rerun.json
python3 attachment.py --work-root . --output attachment-rerun.json
python3 -m unittest discover -s . -p 'test_*.py' -v
```

All three scripts refuse an existing output file and remove their disposable databases.
The lifetime script starts a child Python process which writes only its fixture.
Use disposable local storage. The tested runtime is not a current-patch recommendation.

The original record contains 33 fixtures: 11 journal-mode/schedule combinations,
each repeated three times. The follow-up contains 21 fixtures: reconnect in DELETE
and WAL, writes to main or aux in both modes, and a WAL reader with a separate
writer process, again three times each. Attached cases use two database files.

The attachment extension has 24 fixtures: four schedules in DELETE and WAL,
each repeated three times. A continuously attached write is the positive control;
reattaching an unchanged file is the negative control. The other two schedules
reattach a modified file or attach a different file under the same alias. One
physical observer stays open. The application-assigned attachment generation
changes after successful reattachment; it is not a SQLite data_version value.

Fresh native runs validate complete expected rows, schema scope and transaction
state. Tests also compare the retained observations, harness hashes and repeated
cases, reject altered evidence and exercise optimized Python. Exact token values
and no-op notification behavior are observations, not universal API constants.

Original row-counter/cache controls and lifetime controls are different experiments.
A successful integrity_check does not check the cache's freshness. The separate
writer is joined after COMMIT; this is not simultaneous-SQL stress testing or a
crash/power-loss test. No connection pool, custom VFS or shared cache was exercised.
Reconnecting is a model of replacing a physical handle, not a test of a pool product.

sources.json and source-receipts.json identify the original nine primary references.
publication-sources.json adds ATTACH and file-control documentation plus VLDB and
TxCache paper context;
publication-source-receipts.json records their retrieved identities. Full papers,
third-party figures and source bodies are not redistributed.

## Individual files

- [Original harness](observe.py) and [tests](test_observe.py).
- [Lifetime harness](lifetime.py) and [tests](test_lifetime.py).
- [Original results](results.json) and [generated table](results-table.md).
- [Lifetime results](lifetime-results.json).
- [Attachment harness](attachment.py), [tests](test_attachment.py) and [results](attachment-results.json).
- [Attachment sources](attachment-sources.json) and [receipts](attachment-source-receipts.json).
- [Original sources](sources.json) and [retrieval receipts](source-receipts.json).
- [Additional sources](publication-sources.json) and [retrieval receipts](publication-source-receipts.json).
