4.6 KiB
RR-17: SQLite archive database member validation
Baseline2fb10f7b, isolated codex/recovery-archive-validation. The old name-only tar listing accepted symlinks/hardlinks/FIFO/device entries, empty or unrelated bytes named jobtracker.db, and database paths outside the archive root. Ten negative subtests freshly reproduced successful verification and continuation to the mocked next deployment gate.
The existing deployment verifier now calls a small Python standard-library streaming tar reader. Python3 is already required by the mandatory ingress validator. It checks each matching database basename for a safe relative path, regular-file type and the16-byte SQLite signature; it reads through the archive without extracting members. Root, dot-prefixed and nested supported database names remain accepted. Real SQLite test fixtures are created with stdlib sqlite3. No package, database/schema, production configuration or persistent data is changed by these tests.
- Final29/29 backup methods PASSED,0skips; includes earlier26 and three new methods/ten negative subtests. Bash syntax/whitespace PASSED. Existing dump/parser, upload, retention and permission checks remain. Real local gzip and Python tar/SQLite fixture creation were exercised; no Docker, actual backup, recovery or deployment.
- Initial red fixture had14 Windows cleanup errors because a context-managed sqlite connection had not been closed. After explicitly closing it, corrected red had10 failures and0errors; these are the valid application defect reproductions. Original draft errors are retained and are not product defects.
- First whole-suite green exposed three inherited permission-fixture failures: those tests mocked the old Docker validator over arbitrary bytes. Recovery permission fixtures now use a genuine gzip/tar with a format header and the real Python validator, preserving byte-equality/no-removal/next-gate assertions. Final29 rerun adds a Docker trap in member tests to prove no container validation occurs. Intermediate results overlap29.
- Exact native logs/gzip plus final source hashes: receipts. Original production baseline is bound. Red test fixture bytes were not frozen at execution; don't claim an immutable full red-test snapshot. Test helper changes after red and all intermediate failures are documented.
This checks format, not SQLite integrity or usefulness: a signature-only regular file satisfies this bounded predicate. It does not validate arbitrary other archive members, select an authoritative database among multiple compatible paths, prove WAL consistency, restore records, verify keys/tombstones/off-host encryption, qualify RPO/RTO or replace recovery rehearsal. MariaDB's dump path is unchanged. Actual Linux/container/host deployment remains NOT RUN. No release/security approval is granted.
Rollback restores verify_volume_backup and removes the helper/associated fixture changes on this isolated branch. No data rollback is required. Original release worktree and A3 application branch remain untouched by this package.
Host archive producer compatibility, 19 November 2026
The test at BackupDatabaseMemberTests.test_host_tar_producer_with_database_and_sidecar uses the deployment command's tar czf … -C data . arguments with a temporary synthetic volume. It creates a real SQLite database with one row and closes the connection. The host tar command archives it alongside an inert file named jobtracker.db-wal. The production Python validator accepts the archive, and a read-only comparison confirms the database member matches the source bytes. A second archive containing only the sidecar name is rejected.
| Windows producer | Verification | Result |
|---|---|---|
| Git for Windows GNU tar 1.35 | Full backup suite, Python 3.12.10 / SQLite 3.49.1 | 30 methods passed in 12.486 seconds |
| Windows bsdtar 3.8.9 / libarchive 3.8.9 | Focused producer method with the same positive and negative cases | Passed in 0.192 seconds |
The focused run overlaps the full suite. To repeat, put the desired tar directory first on PATH and run python scripts/test-deploy-backup.py BackupDatabaseMemberTests.test_host_tar_producer_with_database_and_sidecar -v. The test resolves the absolute producer path before invocation. Source baseline 5718d9521be0935e1c0364a775ed8ce7d0702f43. The validator and deployment script are unchanged.
Linux/Alpine producer qualification remains blocked on a pre-existing isolated Linux environment. WSL listed only a stopped Docker Desktop distribution. This fixture's sidecar exercises filename classification only. Live WAL consistency, restore, deployment, permissions, encryption and recovery-set completeness remain open.