Skip to content

feat(repair): --rebuild-since cutoff for rebuild mode - #127

Merged
antra-tess merged 2 commits into
mainfrom
feat/rebuild-since
Sep 26, 2026
Merged

antra-tess merged 2 commits into
mainfrom
feat/rebuild-since

Conversation

@antra-tess

@antra-tess antra-tess commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Rebuild mode re-summarizes the regions it dissolves. On stores whose older eras were repaired by hand (ownership surgery, refusal quarantines resolved by fallback, restored lineages), re-folding those eras would surface the same problems again and spend summarizer calls rediscovering them.

  • --rebuild-since <messageId|ISO date>: only crossed summaries whose span starts at or after the cutoff are dissolved for the ladder to re-fold; older ones get the compact treatment (adoption / re-homing, no model calls). An ISO date resolves to the first message at or after it. The plan reports where the cutoff landed and how the crossed set split (rebuildSince: {id, position, rebuilt, compacted}).
  • compact adopts hole owners downward: a root of any lower level that owns a hole is taken into the descendant one level above it whose span is adjacent (the crossed summary itself when the owner is one level down). Before, a hole owned by unmerged L1s two or more levels below could not be adopted, so the children were detached and, with no home, every ancestor unravelled — on one production store a 69-leaf hole took an L5 of 26k leaves apart (47k leaves lost a fold level). With downward adoption the same store repairs with 0 leaves losing depth and 2.9k under prose that never covered them.

Tests: cutoff by id and by date, unmatched cutoff throws; downward adoption closes a deep hole with no detachment. Suite 888/888. Dry-run on eleven production store copies: every plan reaches a clean store; depth loss under compact is now 0 on eight of them.

🤖 Generated with Claude Code

antra-tess and others added 2 commits September 25, 2026 22:14
Crossed summaries whose span starts at or after the cutoff (a message id,
or an ISO date resolved to the first message at or after it) are dissolved
for the ladder to re-fold; older ones get the compact treatment. Regions
that were repaired by hand are never re-summarized. The plan reports where
the cutoff landed and how the crossed set split.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A hole owned by a root two or more levels below the crossed summary could
not be adopted (adoption only knew one level down), so the summary's
children were detached and, when they had no home, every ancestor
unravelled — a 69-leaf hole took an L5 of 26k leaves apart. The owner is
now adopted into the descendant one level above it whose span is adjacent
(the crossed summary itself when the owner is one level down). Fleet dry
runs: depth loss under compact drops to 0 on most stores.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@antra-tess
antra-tess merged commit 7959602 into main Sep 26, 2026
5 checks passed
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