diff --git a/docs/release-readiness/11_BACKUP_RESTORE_ROLLBACK.md b/docs/release-readiness/11_BACKUP_RESTORE_ROLLBACK.md index 535051d2..64a82d89 100644 --- a/docs/release-readiness/11_BACKUP_RESTORE_ROLLBACK.md +++ b/docs/release-readiness/11_BACKUP_RESTORE_ROLLBACK.md @@ -1,5 +1,19 @@ # Recovery implementation review and rehearsal plan +## RR-15 SQLite archive member check + +16 November 2026. Bounded source `4c6c22074a9a097412f63d0d25399d5d1a20424f`, branch `codex/release-rollback-health`, based on `4019569a`. Existing SQLite archive validation accepted any listing containing the substring `jobtracker.db`. Real synthetic gzip/tar archives containing only `jobtracker.db-wal`, `old-jobtracker.db` or `jobtracker.db.backup` each passed format verification and reached the next mocked deploy gate. + +The one-line predicate now requires the exact basename at the end of the member path. Exact `jobtracker.db`, `./jobtracker.db` and `data/jobtracker.db` remain accepted. The existing managed deployment flow, volume inspection, archive creation, permission, retention, upload and failure handling are unchanged; no recovery files were removed outside disposable test fixtures. + +- RED: two test methods, three failed negative subtests and three passing positive scenarios in the control method. +- GREEN:21 backup test methods passed, including the two new methods/six archive-name scenarios. The previous19 overlap21; do not add them. +- Bash syntax and whitespace check PASSED. Syntax receipt records the actual process exit0 and source hash. AST graph refresh PASSED18,551 nodes/46,011 edges. +- Tests use real local tar/gzip archives and execute the actual container tar/grep command through a fake Docker function that substitutes only the mount prefix. Docker, volumes, permissions, remote storage, databases and full deployment are NOT EXECUTED. Data bytes are synthetic, not a SQLite database. This proves only member-name selection, not usable SQLite contents, archive regular-file/link safety, full tar error handling, consistency, decryptability, restore or RPO/RTO. +- Rollback handler source is unchanged; earlier six rollback methods are historical and were not rerun for this predicate. Actual recovery, operational security and release gates remain open. This release-branch fix is not yet integrated into the A3 branch. + +Source/native/canonical evidence: [backup-database-member/SOURCE_RECEIPTS.json](evidence/backup-database-member/SOURCE_RECEIPTS.json). + 2026-11-02; source `5cb903b989742b7a96cb22ddf4c0e24993b18980`. Read-only discovery. The entire 765-line `deploy/deploy.sh` was inspected, never executed or sourced. No operational keys, credentials, environment files, databases, containers or remote storage were accessed. ## Distinct recovery mechanisms diff --git a/docs/release-readiness/13_REMEDIATION_REGISTER.md b/docs/release-readiness/13_REMEDIATION_REGISTER.md index c2e0dad2..d98a6562 100644 --- a/docs/release-readiness/13_REMEDIATION_REGISTER.md +++ b/docs/release-readiness/13_REMEDIATION_REGISTER.md @@ -18,5 +18,6 @@ Discovery only, 2026-11-02. These are qualification gaps unless a concrete defec | RR-12 | Previous handler omitted post-rollback health checks; schema/data/AI recovery remains separate | Health probes FIXED in `a39ac847` and six offline handler methods passed, including failed endpoints and diagnostics. See [health follow-up](11_BACKUP_RESTORE_ROLLBACK.md#rr-12-post-rollback-core-health-checks). Actual image identity, startup timing and recovery after migration/writes still require isolated rehearsal | | RR-13 | Off-host encryption and recovery-set consistency need independent proof. Failed transfer, partial monthly copy and retention errors previously let deployment continue | Transfer/marker gates and explicit daily prune, monthly enumeration/sort and removal failure propagation FIXED AND OFFLINE-TESTED. Retention suite16/16 preceded permission protection follow-up1c8761b1; final backup suite19/19 methods. Four retention failure assertions and two permission failure subtests reproduced first. See [retention follow-up](11_BACKUP_RESTORE_ROLLBACK.md#rr-13-retention-failure-propagation). See also [permission follow-up](11_BACKUP_RESTORE_ROLLBACK.md#rr-13-backup-permission-gate). Actual encryption, retrieval/decryption and database/files/key/tombstone consistency require approved isolation | | RR-14 | July first-deploy runbook inferred rollback safety from its no-op migration baseline, while current migration Up methods add schema | Historical scope and current qualification links clarified. `AddJobRevision` adds Version and `AddUserOperationEvents` creates a table/indexes. Exact old/new image compatibility after migration/writes remains an isolated rehearsal gate | +| RR-15 | SQLite backup listing accepted a WAL or similarly named file without the database member | FIXED AND OFFLINE-TESTED at `4c6c2207`: exact member basename required; three false-positive archives reproduced first,21 backup methods/syntax passed. [Bounded evidence](11_BACKUP_RESTORE_ROLLBACK.md#rr-15-sqlite-archive-member-check). Real SQLite contents, regular-file/link safety, tar errors, restore and recovery-set consistency remain unqualified | Continue evidence work against the [source endpoint and environment census](03_ENDPOINT_ENVIRONMENT_CENSUS.md). Actual qualification requires an accepted candidate and isolated environment. Every fix needs minimal scope, targeted verification and the applicable stage approval. diff --git a/docs/release-readiness/evidence/backup-database-member/SOURCE_RECEIPTS.json b/docs/release-readiness/evidence/backup-database-member/SOURCE_RECEIPTS.json new file mode 100644 index 00000000..3ef0f460 --- /dev/null +++ b/docs/release-readiness/evidence/backup-database-member/SOURCE_RECEIPTS.json @@ -0,0 +1,39 @@ +{ + "sourceCommit": "4c6c22074a9a097412f63d0d25399d5d1a20424f", + "sourcesLfSha256": { + "deploy/deploy.sh": "f83f0849ac2ef9dc4930ef28c78e9c002ffeec68d4670fc52c6890b43cce59a8", + "scripts/test-deploy-backup.py": "4fd83765d7bd97873648a8bdf91bc69d69ef304708b53ecbd322c99b7063c9c1" + }, + "evidenceLfSha256": { + "backup-member-red.txt": "0a4c1bfb7df8781015f98f68f551f2a2f39460e46003cc6ae8edbae247a8a7b6", + "backup-member-green.txt": "69cf80e4b729fe4f88a258f2e8b7155fe63d0ebd9cd0fdb8d74c413b2ab54ba3", + "backup-member-syntax.json": "1aba597fa7781a75566d67f8e1bea43b1d4c17e325e39d0671404183d7115310", + "backup-member-graph.txt": "d138893351d58f3ff37dd0790673b8e3e50ac84929ff4b278dc5cc9f2d1928fd" + }, + "nativeReceipts": [ + { + "path": "backup-member-red.txt", + "gzipPath": "backup-member-red.txt.gz", + "rawSha256": "3424c1dbaef2b8b2530b02f38d6e0fe0276656089c5e964606b85628b7cae81a", + "gzipSha256": "aa60b0113383770e81e2016ecefd585855279939bb0b7ef229930f82bc888f88" + }, + { + "path": "backup-member-green.txt", + "gzipPath": "backup-member-green.txt.gz", + "rawSha256": "2de7d8de7364e7363ef509fb3e077c6460ef5430b2a2bfc73e7babdb0834cc17", + "gzipSha256": "7e34f56c3e20dbec324ced65e3693a46eda607625694ad622e2ca3e4a28531fe" + }, + { + "path": "backup-member-syntax.json", + "gzipPath": "backup-member-syntax.json.gz", + "rawSha256": "c17f21f8e836becc1a9b8577cf95428ae4fe07569991d69c6a25b76d9fe7355b", + "gzipSha256": "34e9b815f50c4a95c31887608ce1f5e96828c146034217aaa2e255790c3ef439" + }, + { + "path": "backup-member-graph.txt", + "gzipPath": "backup-member-graph.txt.gz", + "rawSha256": "dc01d7a59065a45f499e7e0769e714cc606d02f92358abb5ceb3ee22bd490993", + "gzipSha256": "03c71e330e26ff30451b075e024dfa2aec733ede4317369deedc69451bd1f804" + } + ] +} diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-graph.txt b/docs/release-readiness/evidence/backup-database-member/backup-member-graph.txt new file mode 100644 index 00000000..f192d372 --- /dev/null +++ b/docs/release-readiness/evidence/backup-database-member/backup-member-graph.txt @@ -0,0 +1,18 @@ +Re-extracting code files in . (no LLM needed)... +[graphify watch] 326 file(s) not classified (no supported extension or shebang), skipped: .dockerignore, .env.example, .git, .gitattributes, .gitignore, App.css (+320 more) + AST cache: 1934/2345 files served from cache (82%); 411 to extract + AST extraction: 100/411 uncached files (24%) [16 workers] + AST extraction: 200/411 uncached files (48%) [16 workers] + AST extraction: 300/411 uncached files (72%) [16 workers] + AST extraction: 400/411 uncached files (97%) [16 workers] + AST extraction: 411/411 uncached files (100%) [16 workers] + warning: 8 .sql file(s) contributed nothing to the graph because a dependency is missing: tree_sitter_sql not installed. Install it with: pip install "graphifyy[sql]" (#1745) + warning: 139 code file(s) yielded no symbols (0.13 MB) — a data file, or source this extractor models no symbols for: JobTrackerApi.Tests/PdfBrowserStub/Program.cs, JobTrackerApi/Program.cs, JobTrackerApi/Properties/AssemblyInfo.cs, browser-extension/tests/capture-url.test.mjs, docs/audits/2026-09-07/validation/evidence/b05-excel-probe.ps1 (+134 more) +[graphify watch] community set changed since labeling (0 saved labels, 1056 communities now; renamed 150 community(ies) by their hub). Run `graphify label` to refresh names with the LLM. +Graph has 18551 nodes (above 5000 limit). Building aggregated community view... +graph.html written (aggregated: 1056 community nodes, 3099 cross-community edges) +Tip: run with --obsidian for full node-level detail. +[graphify watch] Rebuilt: 18551 nodes, 46011 edges, 1056 communities +[graphify watch] graph.json, graph.html and GRAPH_REPORT.md updated in graphify-out +Code graph updated. For doc/paper/image changes run /graphify --update in your AI assistant. +Tip: set GEMINI_API_KEY or GOOGLE_API_KEY to use Gemini for semantic extraction. diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-graph.txt.gz b/docs/release-readiness/evidence/backup-database-member/backup-member-graph.txt.gz new file mode 100644 index 00000000..c2ab5f55 Binary files /dev/null and b/docs/release-readiness/evidence/backup-database-member/backup-member-graph.txt.gz differ diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-green.txt b/docs/release-readiness/evidence/backup-database-member/backup-member-green.txt new file mode 100644 index 00000000..d54ca005 --- /dev/null +++ b/docs/release-readiness/evidence/backup-database-member/backup-member-green.txt @@ -0,0 +1,26 @@ +test_empty_password_is_preserved (__main__.BackupConnectionTests.test_empty_password_is_preserved) ... ok +test_invalid_or_ambiguous_input_never_invokes_dump_or_exposes_input (__main__.BackupConnectionTests.test_invalid_or_ambiguous_input_never_invokes_dump_or_exposes_input) ... ok +test_quoted_separators_and_shell_characters_remain_data (__main__.BackupConnectionTests.test_quoted_separators_and_shell_characters_remain_data) ... ok +test_single_quoted_unicode_password_and_database_alias_are_preserved (__main__.BackupConnectionTests.test_single_quoted_unicode_password_and_database_alias_are_preserved) ... ok +test_supported_host_alias_and_case_reach_dump_unchanged (__main__.BackupConnectionTests.test_supported_host_alias_and_case_reach_dump_unchanged) ... ok +test_exact_database_member_at_root_or_in_a_directory_is_accepted (__main__.BackupDatabaseMemberTests.test_exact_database_member_at_root_or_in_a_directory_is_accepted) ... ok +test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) ... ok +test_both_permission_failures_block_verification_and_next_gate (__main__.BackupPermissionTests.test_both_permission_failures_block_verification_and_next_gate) ... ok +test_fallback_permission_success_preserves_verification (__main__.BackupPermissionTests.test_fallback_permission_success_preserves_verification) ... ok +test_host_permission_success_does_not_need_fallback (__main__.BackupPermissionTests.test_host_permission_success_does_not_need_fallback) ... ok +test_completed_monthly_snapshot_contains_both_artifacts_and_stamp (__main__.BackupRetentionTests.test_completed_monthly_snapshot_contains_both_artifacts_and_stamp) ... ok +test_daily_prune_failure_blocks_monthly_pruning_upload_and_deploy (__main__.BackupRetentionTests.test_daily_prune_failure_blocks_monthly_pruning_upload_and_deploy) ... ok +test_empty_monthly_enumeration_does_not_request_removal (__main__.BackupRetentionTests.test_empty_monthly_enumeration_does_not_request_removal) ... ok +test_marker_publish_failure_does_not_expose_complete_marker_or_proceed (__main__.BackupRetentionTests.test_marker_publish_failure_does_not_expose_complete_marker_or_proceed) ... ok +test_monthly_enumeration_failure_blocks_pruning_upload_and_deploy (__main__.BackupRetentionTests.test_monthly_enumeration_failure_blocks_pruning_upload_and_deploy) ... ok +test_monthly_prune_failure_stops_before_remaining_months_upload_and_deploy (__main__.BackupRetentionTests.test_monthly_prune_failure_stops_before_remaining_months_upload_and_deploy) ... ok +test_partial_monthly_copy_cannot_mark_snapshot_complete_or_proceed (__main__.BackupRetentionTests.test_partial_monthly_copy_cannot_mark_snapshot_complete_or_proceed) ... ok +test_preserves_the_existing_completed_monthly_snapshot (__main__.BackupRetentionTests.test_preserves_the_existing_completed_monthly_snapshot) ... ok +test_daily_copy_failure_stops_before_remaining_files_and_monthly_copy (__main__.BackupUploadTests.test_daily_copy_failure_stops_before_remaining_files_and_monthly_copy) ... ok +test_monthly_copy_failure_blocks_deploy (__main__.BackupUploadTests.test_monthly_copy_failure_blocks_deploy) ... ok +test_uploads_only_current_daily_files_then_monthly_snapshot (__main__.BackupUploadTests.test_uploads_only_current_daily_files_then_monthly_snapshot) ... ok + +---------------------------------------------------------------------- +Ran 21 tests in 10.094s + +OK diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-green.txt.gz b/docs/release-readiness/evidence/backup-database-member/backup-member-green.txt.gz new file mode 100644 index 00000000..4a323309 Binary files /dev/null and b/docs/release-readiness/evidence/backup-database-member/backup-member-green.txt.gz differ diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-red.txt b/docs/release-readiness/evidence/backup-database-member/backup-member-red.txt new file mode 100644 index 00000000..7b112a01 --- /dev/null +++ b/docs/release-readiness/evidence/backup-database-member/backup-member-red.txt @@ -0,0 +1,40 @@ +test_exact_database_member_at_root_or_in_a_directory_is_accepted (__main__.BackupDatabaseMemberTests.test_exact_database_member_at_root_or_in_a_directory_is_accepted) ... ok +test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) ... + test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) (member='jobtracker.db-wal') ... FAIL + test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) (member='old-jobtracker.db') ... FAIL + test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) (member='jobtracker.db.backup') ... FAIL + +====================================================================== +FAIL: test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) (member='jobtracker.db-wal') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "C:\Users\Connor\.codex\worktrees\release-readiness-discovery\Job tracker\scripts\test-deploy-backup.py", line 397, in test_sidecar_or_similar_name_is_not_the_database_member + self.assertNotEqual(0, result.returncode, result.stdout + result.stderr) +AssertionError: 0 == 0 : FORMAT VERIFIED +NEXT DEPLOY GATE WOULD START + + +====================================================================== +FAIL: test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) (member='old-jobtracker.db') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "C:\Users\Connor\.codex\worktrees\release-readiness-discovery\Job tracker\scripts\test-deploy-backup.py", line 397, in test_sidecar_or_similar_name_is_not_the_database_member + self.assertNotEqual(0, result.returncode, result.stdout + result.stderr) +AssertionError: 0 == 0 : FORMAT VERIFIED +NEXT DEPLOY GATE WOULD START + + +====================================================================== +FAIL: test_sidecar_or_similar_name_is_not_the_database_member (__main__.BackupDatabaseMemberTests.test_sidecar_or_similar_name_is_not_the_database_member) (member='jobtracker.db.backup') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "C:\Users\Connor\.codex\worktrees\release-readiness-discovery\Job tracker\scripts\test-deploy-backup.py", line 397, in test_sidecar_or_similar_name_is_not_the_database_member + self.assertNotEqual(0, result.returncode, result.stdout + result.stderr) +AssertionError: 0 == 0 : FORMAT VERIFIED +NEXT DEPLOY GATE WOULD START + + +---------------------------------------------------------------------- +Ran 2 tests in 1.486s + +FAILED (failures=3) diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-red.txt.gz b/docs/release-readiness/evidence/backup-database-member/backup-member-red.txt.gz new file mode 100644 index 00000000..ccf1bc1d Binary files /dev/null and b/docs/release-readiness/evidence/backup-database-member/backup-member-red.txt.gz differ diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-syntax.json b/docs/release-readiness/evidence/backup-database-member/backup-member-syntax.json new file mode 100644 index 00000000..56938a75 --- /dev/null +++ b/docs/release-readiness/evidence/backup-database-member/backup-member-syntax.json @@ -0,0 +1,11 @@ +{ + "command": [ + "bash", + "-n", + "deploy/deploy.sh" + ], + "exitCode": 0, + "stdout": "", + "stderr": "", + "sourceLfSha256": "f83f0849ac2ef9dc4930ef28c78e9c002ffeec68d4670fc52c6890b43cce59a8" +} diff --git a/docs/release-readiness/evidence/backup-database-member/backup-member-syntax.json.gz b/docs/release-readiness/evidence/backup-database-member/backup-member-syntax.json.gz new file mode 100644 index 00000000..315be6be Binary files /dev/null and b/docs/release-readiness/evidence/backup-database-member/backup-member-syntax.json.gz differ