Verify local custody of excluded photos #1503
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.55) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.55 · 604 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.383
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1503"
general
weight: 0.35
qwts
Motivation
Closes #1135. Excluded photos may have their only original locally, but integrityItems() correctly limits the existing scrub to remote backup claims. External loss or corruption therefore went unverified and the Inspector continued to present a healthy local-only choice.
Description
Add a separate provider-independent local-custody pass when ordinary library maintenance opens and every 60 seconds after completion. It visits up to 50 rows with a durable local cursor and a soft 64 MiB full-read budget; one oversized original may finish a pass. Stat/header observations trigger a full chunk-authenticated plaintext SHA-256 check on first observation, file changes, prior failure, or a verification at least 24 hours old when the rolling walk reaches the row. Streams are bounded to observed size, check live eligibility and abort/drain on lock or library switch.
Migration 50 stores device-local missing/corrupt evidence and verification stamps. Detection cannot upload, delete, change coverage/origin/since, or dirty the ledger. Known failed originals also refuse Back up again until a verified repair clears the finding, retaining local rather than borrowing remote custody. Matching-file recovery remains available for missing originals.
Inspector, status glyphs, status bar and storage statistics disclose local-missing/local-corrupt independently of cloud sync. Logical exclusion totals remain intact, while missing asset bytes leave the on-disk figure once per shared original. Verified rechecks clear findings and Unavailable membership. Device-local findings never enter manifests.
Missing keys, protected migration rows and known restored-exclusion placeholders are skipped. Shared variants retain import-owner AAD after root purge. #1127 protected-domain coverage and #1126 provider capability classification are separate decision work; neither blocks this ordinary-photo slice.
Documentation
Updated docs/acceptance/Acceptance-Test-Backup-Coverage.md with strategy/cadence, bounds, offline operation, loss/corruption/recheck, recovery, shared assets and lock/custody boundaries. Accepted ADR-0033 §2/§6 already requires this behavior; no architectural amendment is needed.
Changeset
Acceptance coverage
Regression coverage includes healthy/missing/malformed/truncated/authentication/content-hash/AAD damage, file-change and daily rechecks, cursor/byte bounds, streaming growth, key revocation, close/drain, protected visibility, restored placeholders, shared-owner purge, manifest omission, exact-file recovery, and refusal to re-include known failed originals.
Testing
Targeted Electron-hosted backend suites passed (59 tests, then a 44-test transition/recovery rerun after the final guard). Six targeted DOM tests passed. The acceptance-map validator passed. Initial lint found the repository file-size ceiling and a test-generator await issue; statistics were extracted into their own reader and the asynchronous revocation test was corrected. Focused lint rerun passed.
The full cheap gates passed sequentially on Node 24.18.0:
The full run passed all unit, DOM and database lanes; docs governance reported zero findings. The final shared-verification cache guard was then covered by a 60-test Electron-hosted backend rerun, test compilation and focused lint, all passing. It prevents reuse across different size/key bindings. Acceptance-map and formatting checks also passed.
All 15 current-head CI checks passed on signed head 356277ccc97810c390a629e3e7325527831ae19c, including full coverage, build, Storybook interactions, Electron E2E, Windows x64 tests/import, CodeQL, docs governance and workflow policy. Four inapplicable lanes were skipped. Complete CI run. Exact required context/App bindings and effective strict freshness were independently verified before requesting native auto-merge.
Manual Testing
Follow the excluded local-custody section in docs/acceptance/Acceptance-Test-Backup-Coverage.md. Exclude an ordinary photo, disconnect its provider, remove/damage a saved encrypted original externally, and wait for the rolling visit. Expect explicit local loss/corruption with unchanged backup policy and provider contents. Restore the verified envelope and recheck; expect the finding to clear without re-inclusion. Repeat across shared variants, missing keys, lock/library switch and known restored placeholders.
<!-- agent-bot-write: ghw_1346e5764f70a812 session=f601b21bf418 bot=trueline-codex-agent[bot] -->