Repository navigation
fix(watch): stop spurious overflow for excluded and unselected paths - #724
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 27, 2026, 6:12 AM ET / 10:12 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch filters excluded and unselected watch activity, retains bounded event detail through slow scans, changes macOS stream selection and Windows buffer sizing, and adds tests, CI coverage, and documentation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 6 items remain Keep this PR open. Current main still has the reported overflow behavior, and this branch offers a distinct fix. Two previously reported macOS correctness gaps remain, and the user-visible fix still lacks the required Unreleased note. Priority: P2 Review scores
Verification
How this fits togetherThe watch API accepts paths and exclusions beneath an admitted filesystem Root. Operating-system events prompt guarded scans, which send bounded invalidations to subscribers. flowchart LR
A[Caller scopes and exclusions] --> C{Selected activity?}
B[Admitted Root] --> D[Guarded reconciliation]
E[OS watch events] --> C
E -->|backend loss| D
C -->|yes| D
C -->|no| F[Quiet subscription]
D --> G[Bounded invalidation]
G --> H[Subscriber callback]
Decision needed
Why: The patch changes an existing per-subscription resource cost sixteenfold; accepting that default requires a maintainer resource-budget judgment. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the scope-filtering fix while preserving exact-Root events and continuous macOS observation, use a measured Windows memory budget, and record the user-visible fix under Unreleased. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source retains the reported overflow and slow-scan rules, while the PR supplies real watcher scenarios and reports baseline failures; the two macOS merge blockers are source-reproducible but were not executed in this read-only review. Is this the best way to solve the issue? No. Filtering unselected activity and retaining bounded detail fit the existing watch contract, but exact-Root hints and events during macOS stream replacement still need coverage. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8b6ed73b4394. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
Excluded build output and unrelated siblings could trigger whole-scope watch overflow, repeatedly waking Config-style entry subscriptions. Retain excluded path/kind records, ignore guarded unselected hints, remove the 25 ms scan-duration rule, and retry bounded native callback batches. Genuine backend loss and exhausted detail budgets still invalidate every scope.
macOS uses guarded canonical selected anchors and up to eight shallow exclusion paths, with joined stream replacement followed by reconciliation. Windows uses 1 MiB buffers on confirmed local volumes and 64 KiB on network or unclassified volumes. Root identity checks, generation fencing, guarded-only detail, and identity-based alias admission remain intact.
The Config test also needed a correct setup boundary: FSEvents can deliver coalesced
ItemCreatedactivity afterready. Instrumented evidence captured flags0x19100forconfig.jsonwith equal before/after fingerprints and no selected writes during sibling churn. The test now observes a sentinel selected edit and drains trailing events before measurement; its assertion during churn remains strictly empty. Admitted hints remain conservative for ABA/metadata-preserving activity, as documented. Unseen, already-gone spellings do not establish a selected identity or a complete transient history.Final hosted counts at
d416a447dced837f83580d90867089f030516b48:ubuntu-latest)macos-15)macos-15-intel)windows-latest)Every A1 case had zero spurious overflow and resumed detailed delivery. A2 remained quiet during 3,072 sibling operations; A3 retained detail through deterministic 40 ms passes.
Validation:
--retry=0. A fresh Crabbox Tart VM independently passed 20 + 20; the development Mac also passed 20 + 20.readyin 11 runs, proving the old delay was not a queue-drain contract.No changelog edit: the release coordinator owns the 0.21.1 notes.