Skip to content

fix(roadmap): brain sync rewrites stale near lists of unchanged neighbours - #7629

Merged
dan-petty merged 1 commit into
mainfrom
fix/7506-brain-sync-stale-near-lists
Nov 28, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/7506-brain-sync-stale-near-lists

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Rewrites stale near lists on unchanged items in src/devops_cli/roadmap/brain_sync.py whenever a changed item's tool or check timestamp changes so read_digest stays consistent with stored tools.

Closes #7506

Summary

  • Read each changed item's existing entry from BrainIndex before overwriting so _copy_unit learns its previous tool_id.
  • Rewrite stored entries in both the previous tool (before updating the changed item) and current tool whenever their stored near list differs from checks.related(...).
  • Deduplicate neighbour writes per round (written_neighbours, repaired_tools, and skip_numbers) so each affected item is written at most once per round.
  • Keep _changed_batch bound on changed issues with check entries rather than neighbour writes, leaving the watermark behind any incomplete unit if Valkey fails.
  • Add regression tests in tests/roadmap/test_brain_sync.py covering old/new tool near lists, check-time ordering, read_digest consistency, deduplicated writes, issue-count limits, and store failure recovery.

Verification

  • uv run devops ci test tests/roadmap/test_brain_sync.py tests/roadmap/test_brain_digest.py tests/roadmap/test_brain_index.py (57 passed)
  • uv run devops ci fail-to-pass --base origin/main (5 new tests fail on origin/main and pass on head)
  • uv run devops ci --check --no-cache --skip test,outdated (27/27 checks passed)

Change: openspec/changes/archive/2026-11-28-7506-brain-sync-stale-near-lists/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 28, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 28, 2026 20:08
@dan-petty
dan-petty merged commit ac36afe into main Nov 28, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/7506-brain-sync-stale-near-lists branch November 28, 2026 20:47
dan-petty-release Bot added a commit that referenced this pull request Nov 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.240.1](v0.240.0...v0.240.1)
(2026-11-28)


### Bug Fixes

* **docs:** fix stale statements found by the content census
([#7632](#7632))
([7eed4ac](7eed4ac))
* **infra:** render infra.repos in ConfigMap and drift exit
([#7631](#7631))
([24d2193](24d2193))
* **k8s:** delete late-bound move volume by claim UID
([#7633](#7633))
([abeebd8](abeebd8))
* **roadmap:** brain sync rewrites stale near lists of unchanged
neighbours
([#7629](#7629))
([ac36afe](ac36afe))


### Performance Improvements

* **tests:** keep 4 heaviest invariant files under 15 s
([#7630](#7630))
([724426f](724426f)),
closes [#4890](#4890)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): brain sync leaves near lists of unchanged items stale

1 participant