fix(sessions): recover store from backup and tmp artifacts#79319
fix(sessions): recover store from backup and tmp artifacts#79319wAngByg wants to merge 1 commit into
Conversation
Test results
Changed files verified (4 only):
No status scan files modified. No historical changelog sections backfilled. |
|
Codex review: needs changes before merge. Summary Reproducibility: yes. By source inspection, writing a zero-byte or malformed Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep recovery at the session-loader boundary, trigger it only for an existing corrupt primary store, validate every recovery candidate before reading, reject fresh/in-flight temps, and cover the real fs-safe temp prefix. Do we have a high-confidence way to reproduce the issue? Yes. By source inspection, writing a zero-byte or malformed Is this the best way to solve the issue? No. The loader boundary is the right place, but this PR is not yet the best fix because it recovers outside proven corrupt-primary cases and trusts backup/fresh temp artifacts too broadly. Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7d00183d44b2. |
95a431d to
9f6bdd9
Compare
ebff03d to
24b08f1
Compare
- Adds best-effort recovery for Gateway session store from .bak and residual .tmp files. - Implements synchronous atomic writeback for self-healing. - Secures recovery scan against symlink attacks using lstatSync. - Addresses all ClawSweeper security and logic findings. - Includes 8 comprehensive recovery tests.
6dc1c0d to
f18014d
Compare
|
@clawsweeper re-review. Clean squash completed. Dead code and unused imports removed. Exactly 3 required files staged. |
|
@clawsweeper re-review. Clean squash completed. Dead code removed. Exactly 3 files changed. |
Summary
.bakand residual.tmp(including.fs-safe-replace) artifacts. Implemented synchronous atomic writeback and secured recovery against symlinks usinglstatSync.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
View Terminal Logs
Security Impact (required)
NoNoNoNoYesYes, explain risk + mitigation: Added recovery scan of sibling.tmpartifacts. Risk: Malicious symlink ingestion. Mitigation: Implemented strictlstatSync+!stats.isSymbolicLink()rejection before reading any recovery candidate.Repro + Verification
Environment
Steps
sessions.jsonto simulate OOM truncation..bakor.fs-safe-replaceartifact in the same directory.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
.bak, legacy.tmp, and modern.fs-safe-replaceartifacts.{}store).Review Conversations
Compatibility / Migration
YesNoNoRisks and Mitigations