Keep polling after watched files are deleted - #17
Merged
Conversation
Context: The polling backend registered literal files as scan roots. Deleting one made notify report a missing scan root on every poll, and the runtime propagated the first report as a fatal watcher error. Decision: Register the immediate parent for polled literal files, and treat only PathNotFound and IO NotFound watcher reports as transient. Keep other watcher errors fatal. Exercise deletion, continued supervision, recreation, and a later workflow in one process-level regression test. Alternatives considered: Ignoring every watcher error would keep the loop alive, but it would conceal permission failures and broken watcher backends. Ignoring NotFound without changing registration would also leave the deleted file as a noisy scan root. Tradeoffs: Polling a parent can inspect unrelated siblings, but event classification still runs workflows only for configured paths. The parent registration removes the permanent missing-root condition and preserves recreation events. Architectural impact: The watcher adapter now owns recovery for transient filesystem disappearance; the runtime still fails on non-transient watcher faults. This is a SemVer patch fix recorded under Unreleased; this commit does not bump the package version or create a dated release section.
Context: Parent-directory polling keeps deleted literal files observable, but a broad missing-path exception could hide permanent native-watch loss, and scanning a parent could make an unrelated sibling's failure fatal. Decision: Limit transient missing-path recovery to the polling backend. Ignore a polling error only when every reported path is disjoint from configured watch targets; keep target, parent, pathless, and native watcher errors fatal. Alternatives considered: Treating every NotFound report as recoverable was simpler but unsafe for native registrations. Treating every parent-scan error as fatal coupled configured files to unrelated siblings introduced by the adapter's broader scan root. Tradeoffs: The overlap test depends on notify supplying paths for sibling-specific errors. Pathless errors remain fatal because devloop cannot prove that they are safe. Architectural impact: Recovery now follows the watcher backend and configured-target boundary. The runtime remains strict whenever the adapter cannot demonstrate that an error is both polling-specific and outside the user's watch surface. Changelog release mode moves the fix into 0.10.5 and aligns Cargo.toml, Cargo.lock, release-note input, and intended tag v0.10.5.
Context: The polling recovery guard accepted every NotFound report before checking its path. A pathless error or missing registered parent could therefore leave the runtime alive without an effective watcher. Decision: Recover only when notify reports configured literal files or disappearing children beneath recursive targets. Keep pathless reports, recursive target roots, parent registration roots, and native watcher errors fatal. Alternatives considered: Applying the existing overlap test after the NotFound guard would still treat a configured recursive root as transient. The dedicated target-shape predicate distinguishes recoverable children from registration roots explicitly. Tradeoffs: Recovery requires notify to report the affected path. Pathless errors fail the session because devloop cannot prove that observation can continue safely. Architectural impact: The polling adapter's recovery contract now matches its documented boundary: leaf disappearance is recoverable, while loss of the observation root is not. The 0.10.5 version and dated changelog remain consistent.
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.
Summary
Validation
cargo fmt --checkcargo test— 174 main-unit tests plus all integration suites passedcargo clippy --all-targets --all-features -- -D warningsRUST_LOG=info bash scripts/ci-smoke.shtarget/debug/devloop --version—devloop 0.10.5bash scripts/release-notes-from-changelog.sh 0.10.5 pasunboneleve/devloopReview
Kata:
3cqj