Skip to content

fix(backup): recover grown legacy source snapshots - #4513

Merged
Sinity merged 2 commits into
masterfrom
feature/packet/polylogue-0cm7m
Sep 2, 2026
Merged

fix(backup): recover grown legacy source snapshots#4513
Sinity merged 2 commits into
masterfrom
feature/packet/polylogue-0cm7m

Conversation

@Sinity

@Sinity Sinity commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Widen historical full-file prefix proofs to all origins and retain decoder fallback after a prefix mismatch.

Problem

Pre-revision-envelope unknown rows from origins such as hermes-session were 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 full and unknown rows with source_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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T02:34:56.533227Z 215e167 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 05c67d33-cecb-400c-a4b8-df70af5ffa59


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread polylogue/daemon/backup.py Outdated
Comment on lines +906 to +913
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,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 215e167 - Preserve the prefix-mismatch verdict when real fallback bytes fail the expected hash. [review-fix lane]

@Sinity
Sinity force-pushed the feature/packet/polylogue-0cm7m branch from 0841452 to 215e167 Compare September 2, 2026 02:32
@Sinity

Sinity commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 215e167008

ℹ️ 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".

@Sinity
Sinity merged commit 75a0896 into master Sep 2, 2026
3 checks passed
@Sinity
Sinity deleted the feature/packet/polylogue-0cm7m branch September 2, 2026 02:40
Sinity added a commit that referenced this pull request Sep 2, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant