Repository navigation
fix: harden fail-closed backup safety - #139
Conversation
Validate remote upload results before deleting local artifacts. Require complete encryption output and clean partial files on failure. Abort on container stop failures and retry required restarts. Persist cancellation as a failed backup while preserving cancellation. Fixes #134
Persist explicit failures for missing remote results, defer cancellation until archive workers finish, and redact hook arguments and output.
|
Independent review found one blocking fail-closed gap.
Please initialize a fail-closed result for every required ID before fallible setup/upload work and persist those failures even when setup or the archive sync call raises. Add focused tests for an initialization exception and an archive Local verification otherwise passed: 48 focused tests, 126 full backend tests, Ruff check, Ruff format check, and |
Independent review findingBlocking: remote setup or archive-sync exceptions do not persist a result for every configured storage.
Focused remediation: handle initialization per storage ID and synthesize Local verification otherwise passed: focused backup engine suite 48 passed; complete backend suite 126 passed with 38.69% coverage; Ruff check and format verification passed; |
Independent review summaryVerdict: No blocking findings Verified
GitHub does not allow the PR author account to formally approve its own PR, so this is recorded as the independent review result instead. |
Summary
Fail-closed guarantees
Test evidence
RED against pre-remediation commit
3bfddb6:The failures covered the missing executor helper, early archive cancellation, restore restart before worker completion, absent remote sync rows, an incorrectly completed missing key result, and hook marker leakage in exceptions and logs.
GREEN focused suite:
Full CI-equivalent backend suite:
Hygiene:
Remaining risk
The backend suite still emits four pre-existing warnings: three Starlette HTTP 422 deprecation warnings and one existing AsyncMock coroutine warning in
test_create_backup. No real remote storage or live container cancellation was exercised; deterministic synchronized worker tests cover the ordering contract.Closes #138