Skip to content

fix(code-index): preserve cancellation epoch after neutral wake #866

Description

@ScriptedAlchemy

Problem

At central SHA 65a2610393ac11ca3d2f7dc6452248a49f529109, request_background_reconcile_with_change marks the scheduler dirty for a neutral wake. If the source mutates before the queued reconcile drains, the observed-change wake then sees newly_dirty == false and does not advance the cancellation epoch. The already-running reconcile can consequently publish stale output even though a real source change was observed.

Deterministic reproduction

  1. Queue a neutral background reconcile wake.
  2. Mutate the source before the queued work drains.
  3. Request background reconcile with the observed source change.
  4. Assert that the cancellation epoch advances and stale work is cancelled.

Expected

A neutral wake may coalesce scheduling, but it must not consume the transition that records a real observed change. The observed-change request must advance cancellation independently of whether work is already dirty.

Acceptance

  • Add a deterministic scheduler test for neutral wake -> source mutation -> observed-change wake before drain.
  • Advance cancellation for the observed source change without adding a second authority or changing time/memory budgets.
  • Run focused non-vacuous tests and strict relevant clippy.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions