fix(backup): recover grown legacy source snapshots - #4513
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 084145247f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| payload, error = _current_raw_payload_bytes( | ||
| resolved, | ||
| source_index, | ||
| raw_id=str(row.get("ref_id") or "") or None, | ||
| blob_hash=blob_hash, | ||
| source_bytes_cache=source_bytes_cache, | ||
| decoded_payload_cache=decoded_payload_cache, | ||
| ) |
There was a problem hiding this comment.
Preserve the prefix-mismatch failure after fallback
When a full/unknown row with source_index=0 has a mismatching historical prefix and the source file has grown, this retry cannot recover it: for non-container paths _current_raw_payload_bytes only returns the entire path.read_bytes() (blob_integrity.py:1482-1488), rather than decoding by source index. Since that return has error=None, the later hash check replaces the specific historical_snapshot:prefix_mismatch with generic hash_mismatch; the new test conceals this by monkeypatching the helper to behavior its production implementation does not provide. Retain the prefix error when the fallback does not hash-match, or implement the intended decoder path.
AGENTS.md reference: AGENTS.md:L109-L111
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 215e167 - Preserve the prefix-mismatch verdict when real fallback bytes fail the expected hash. [review-fix lane]
0841452 to
215e167
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary `.lane/body.md` and `.lane/title` leave the index; `.gitignore` already lists `.lane/`. ## Problem Every merged lane PR rewrote the two tracked files, so every other open lane branch conflicted with master on them (#4509 rebased four times tonight, #4513/#4515/#4516/#4520/#4522 all cycled through the rebase reaction for this alone). The harvest reads the publication text from the worktree, not from the commit. ## Solution Untrack the two files. Lane branches that still carry them conflict once more (delete versus modify) and then never again. ## Verification ``` devtools verify --quick # exit 0 ``` ## Residual risk A lane that force-adds `.lane/` reintroduces the churn for itself only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz Receipt: session-01YGi8wLWGR2HYBh8p8fXFXz Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Summary
Widen historical full-file prefix proofs to all origins and retain decoder fallback after a prefix mismatch.
Problem
Pre-revision-envelope
unknownrows from origins such ashermes-sessionwere excluded from prefix proofs, causing intact grown source files to be reported as hash mismatches. A prefix mismatch also prevented the normal raw-payload recovery path from being attempted.Solution
Historical prefix eligibility now covers
fullandunknownrows withsource_index=0. When an eligible prefix attempt fails, recovery retries_current_raw_payload_bytes; successful fallback proofs are recorded as direct file proofs. Regression tests cover a grown Hermes unknown row and a decoder success after a mismatching prefix.Verification
nix develop --accept-flake-config --command python -m devtools test tests/unit/daemon/test_backup.py: 61 passed, 1 existing pytest rewrite warning.git fetch origin && git rebase origin/master: up to date; autostash applied for lane scratch.nix develop --accept-flake-config --command python -m devtools verify --quick: green.Residual risk: the complete corpus and live daemon were not run; this change only affects source recoverability proofs.
Receipt: harvest-fbe7b07caa86329eb9befc05dde97e26
Bead: polylogue-0cm7m