Skip to content

land: atomic-save-test-evidence - #620

Merged
ualtinok merged 4 commits into
mainfrom
land/atomic-save-test-evidence
Oct 20, 2026
Merged

ualtinok merged 4 commits into
mainfrom
land/atomic-save-test-evidence

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Fixes a flaky atomic-save watcher test on macOS CI. Each poll asks call_tree then callers; when FSEvents delivered the save between the two requests, the old loop held the earlier call_tree answer to evidence from callers and failed a correct run. Answers are now judged against what the daemon knew when each was requested, and learned from before the next request.

  • Adds test-timing-hooks-only seams (AFT_TEST_WATCHER_INTAKE_GATE_FILE plus a .flush-hold variant) that hold watcher intake and flush while gate files exist, logging each path taken in; the flush hold applies only while paths are pending so idle ticks never stop the thread before intake.
  • Adds a test that releases the save exactly between the two questions of one poll and asserts the round straddled the delivery, reproducing the flake deterministically.
  • Refactors polling so call_tree and callers are each checked and learned from independently.
  • Includes the harness slice descriptor for search benchmarks.

Written for commit bbfe90c. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

This PR fixes how the atomic-save test judges answers received around a watcher event.

  • Atomic-save tests judge each answer using only what they knew then.

Both earlier unnumbered findings are addressed: flush stays held until the answers arrive, and idle watcher ticks skip the flush hold.

Reviews (4) · Last reviewed commit: "Skip the test flush hold on idle ticks" · Reviewed by Greptile

Comment thread crates/aft/tests/watcher_integration/callgraph_atomic_save_test.rs
Comment thread crates/aft/src/watcher_filter.rs Outdated
@ualtinok
ualtinok added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026
ualtinok and others added 4 commits October 20, 2026 06:38
…ach request

The views-off atomic-save watcher test flaked on macOS CI with
"call_tree still shows the pre-save edge after the watcher delivered the
save, but does not say the answer is incomplete" (complete: Null).

The cause was the test's evidence ordering, not a product window. Each poll
asks call_tree and then callers. The old loop set event_seen from either
answer's complete:false and then asserted on BOTH answers. When FSEvents
delivered the save between the two requests, call_tree had been answered
before the daemon knew about the edit (honest: old edge, no complete field),
callers was marked through the flush-window set, and the test then held the
earlier tree answer to the later evidence. The log matches: the failure was in
the first poll, about 115 ms after the save. That is inside the 250 ms watcher
flush window, so the trigram index could not have seen the edit yet, and the
evidence came from callers.

Each answer is now judged against what was known when it was requested, and
it is learned from before the next request. Every stale answer the daemon gave
after it provably had the save must still carry complete:false with a gap
naming the file or pending watcher work. Every marked stale answer is still
checked for its gap and counted. The assertion is unchanged; only answers
requested before the daemon could know are no longer held to later evidence.

A test-timing-hooks-only seam (AFT_TEST_WATCHER_INTAKE_GATE_FILE) holds the
watcher thread's intake while the gate file exists. It logs each path taken in
to <gate>.taken. The new test uses it to release the save exactly between the
two questions of one round. With the old judging order that test fails with
the CI panic (same line, left: Null right: false); with the new order it
passes. It also asserts the round really straddled the delivery: call_tree
unmarked with the old edge, callers marked naming src/probe.ts.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
…ence

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The pinned-moment atomic-save test released the watcher intake, waited for
the save to be taken in, then asked callers. If the test paused there, the
daemon could flush and refresh first and callers would return the fresh
edge, failing a correct run. A second test seam holds the flush while
<gate>.flush-hold exists; the test holds it across the round. With the hold
removed and a 1.5 s pause added, the test fails as described.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The watcher calls the flush path on idle ticks too. Holding there could stop
the thread before it took in the save the test was waiting for, so the hold
now applies only when taken-in paths are waiting to be flushed.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok force-pushed the land/atomic-save-test-evidence branch from af60c6b to bbfe90c Compare October 20, 2026 04:43
@ualtinok
ualtinok added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 05f1406 Oct 20, 2026
50 checks passed
jacobocasado pushed a commit to starredjaco/aft that referenced this pull request Oct 20, 2026
Rebase the release prep onto origin/main 3faaded and extend
.alfonso/release-notes/v0.61.0.md to cover the merges after cortexkit#590:
cortexkit#578, cortexkit#596, cortexkit#600, cortexkit#601, cortexkit#612, cortexkit#613, cortexkit#614, cortexkit#616, cortexkit#617, cortexkit#618, cortexkit#619, cortexkit#620,
cortexkit#622 and cortexkit#623. Fold and delete the 27 next/ fragments those merges added.
Credit cortexkit#465 (@null-axiom) and cortexkit#564 (@iceteaSA), and extend the cortexkit#577 line
with the shell timeout task-id fix.

Refresh ANNOUNCEMENT_FEATURES in both plugins. Pi leaves out the
OpenCode 2 permission line, which does not apply to Pi users.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.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