Skip to content

Detect an index of another line at load time, and guard the rebase reset on its expected head #2382

Open

Description

@bplatz

#2296 closes the known ways a branch ends up serving an index of a line a rebase replaced:

  • the rebase resets the index;
  • the incremental build refuses a base of another line;
  • the commit-CID fast path checks linkage;
  • warm caches reload on a line change;
  • the orchestrator refuses to publish a build of a replaced head.

Two narrow windows remain:

  1. Check-then-publish. The orchestrator's line check and the index publish are two nameservice operations. A rebase landing between them still publishes the stale build. Any other publisher that skips the check (Raft, embedders calling publish_index directly) has no protection at all.
  2. Unguarded reset. Since fix: a rebased branch reads its new line, and builds never extend an index of a replaced line #2296 the rebase writes its head and index in one reset_head, so no reader sees the new head over the old index. The reset is not guarded on the head it expects, though: a commit another process publishes while the rebase is staged is overwritten. Closing that needs a compare-and-set reset across the nameservice backends.

Load-time detection. A load already walks from the head down to the index's t for novelty. Checking the oldest walked commit's parent (or the head itself, when the walk is empty) against the index would tell a load its index is of another line. That is the same check the incremental build makes. What the load should do then is the open question: dropping the index means replaying all of history. Detection that triggers a rebuild seems the likely shape.

More broadly, this is a recurring class: a pointer derived from a line and trusted after a rewrite moved the line. Reasoning-index generations already carry their basis commit and check it against the view's line, which may be the structural direction for index roots too.

Activity

  1. added
    bug
    P3
    area:storage
    on Nov 13, 2026
  2. changed the title [-]Detect an index of another line at load time, and make the rebase's head+index reset one guarded write[/-] [+]Detect an index of another line at load time, and guard the rebase reset on its expected head[/+] on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:storagebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions