Repository navigation
fix(context_for_task): ask each file's sensitivity once per call (live packs lost their affected tests) - #663
Merged
Merged
Conversation
The walk asks whether every node it reaches sits in a sensitive file: 641 to 2,023 times per pack over 109 to 242 files on arm R's real requests. The daemon's decision (connSession.changeSensitive) resolves the path's project on disk each time (historyRootFor -> workspacePool.Detect -> filepath.Glob for markers), so on the live daemon a pack overran its 2 s graph deadline even on a warm, fully resolved index and lost its affected-tests section and run-first line (PLAN-462 arm R v2: 3 of 4 Go packs). The in-process replays that cleared #651 wired no sensitive decision, so they could not see it. The answer is now remembered per path for the one call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Plumb-Session: warm-cobra
… withheld under the memo Review S1 (scarlet-badger): a memo returning the wrong remembered answer leaked only the second and later nodes of a file, which the control did not check. The test now requires every cart/cart.go node withheld (at least 2 reached) and none of its body text in the pack. The sensitiveFor comment says which asks bypass the memo (review NIT). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Plumb-Session: warm-cobra
atlas-from-plumb
approved these changes
Oct 14, 2026
atlas-from-plumb
left a comment
Collaborator
There was a problem hiding this comment.
Approved under the owner's standing delegation. The bar is met on head 61dc7a3:
- Independent review (scarlet-badger): round 1 asked for a stronger test (S1); after the fix, PASS.
- Mutation: 3/3 killed. The leak mutant (a remembered answer becomes not-sensitive) is caught by the every-node-withheld check; memo-never-stores and memo-outlives-the-call are also killed.
- CI 9/9 on 61dc7a3.
make verify-full-container: exit 0, 64 ok, no FAIL, at most 1 daemon, Revision 61dc7a3.- Up to date with main fd3d991.
atlas-from-plumb
added a commit
that referenced
this pull request
Oct 14, 2026
…665) * fix(context_for_task): detect each directory's project once per call (PLAN-548) After #663's per-file memo, a pack still asked the daemon's sensitive-path decision about each of its 100-250 distinct files, and each ask resolved the file's project with workspacePool.Detect, globbing for markers on disk. On the live daemon the slowest arm R pack ran at 1.6-1.9 s of its 2 s graph deadline, and another was cut in 2 of 5 reps. Collect now attaches a tools.CallMemo to the call's context. historyRootFor reads it and detects each directory once for that call. The memo is fresh per call, so a marker created between two calls is seen by the second, and writes, which never carry one, detect on every ask as before. changeSensitive stays the one decision; workspaceFromArgs is split into detectStartDir and detectedRoot with identical behaviour. Tests: - one memo per call, and a fresh one for the next call; - a marker created mid-call is not re-detected, but the next call and an ask outside a call both see it; - changeSensitive gives the same verdict with and without the memo, including a source in another project that is sensitive only by that project's glob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Plumb-Session: scarlet-badger * docs(tools): CallMemo holds directory → project-root answers only Review NIT on #665: a second kind of lookup through the same memo would share its key space with directories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Plumb-Session: scarlet-badger --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
context_for_taskasks the daemon whether every node it reaches is in a sensitive file. On arm R's real requests that is 641–2,023 questions per pack, over only 109–242 distinct files. The daemon answers each one throughconnSession.changeSensitive→historyRootFor→workspacePool.Detect, which globs for language markers up the directory tree on disk.On the live daemon, a pack therefore overran its 2 s graph deadline even on a warm, fully resolved index. It lost its affected-tests section and the run-first line from #647, in 3 of 4 Go tasks of PLAN-462 arm R v2.
Fix: the collector remembers each path's answer for the one call. A path's sensitivity cannot change within a call. Withholding is unchanged.
Why #651's replay missed it
#651 replayed the same requests in-process, without wiring a sensitive decision. They took 0.23–0.36 s there. On the live daemon, a free probe found:
sampleof the daemon during that call: the on-CPU frames arefilepath.Match/globand filesystem syscalls underchangeSensitive→historyRootFor→workspacePool.Detect.Counting sensitive calls in the replay gives 641/109 (R01), 1,132/194 (R03), 2,023/242 (R05) and 1,294/203 (R08), as calls over distinct paths.
Tests
TestContextForTask_AsksEachPathItsSensitivityOnce:cart/cart.gois asked 4 times in one call.After merge
Install, then replay the arm R requests on the live daemon, not in-process. Success means the run-first line is present in R-599, R-601 and R-600, with the pack well under the deadline.
🤖 Generated with Claude Code