feat(core): hot reload for directory skill sources#17
Draft
shoootyou wants to merge 10 commits into
Draft
Conversation
…nomalyco#31245) Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Subscribe to Watcher.Event.Updated in SkillV2.layer to invalidate the cache for DirectorySource entries when files change. Extend Watcher.Interface with watch() to register per-directory subscriptions on first load. - Cache entry cleared on file change under a DirectorySource path - UrlSource and EmbeddedSource unaffected (no watch registration) - Race safety via `invalidated` Set: concurrent loads discard stale results - watcher.watch() is fire-and-forget via forkDetach — never blocks list() - EventV2.Service and Watcher.Service are optional (Effect.serviceOption) so existing layers without them continue to work Co-authored-by: yui-soul <yui-soul@users.noreply.github.com>
- Deduplicate watcher.watch() calls via Set to prevent O(N) subscription growth on repeated cache invalidations - Subscribe watcher after Effect execution (not at construction time) - Add catchCause logging to invalidation fiber for silent failure detection - Declare EventV2 dep relationship in watcher locationLayer - Fix race mid-load: reload once more when invalidated during load - Add tests for path-prefix collision and absent Watcher.Service - Fix @spec-handoff: document watch() as required, not optional Co-authored-by: yui-soul <yui-soul@users.noreply.github.com>
- Exclude Cause.interrupt from hot-reload fiber error logging (clean shutdown) - Document that Watcher.watch() is not idempotent; caller owns dedup - Add assertion in T2: watch() called exactly once across invalidation cycles - Add comment explaining double-load race safety heuristic - Add T9: list() does not throw or interrupt caller during cache invalidation Co-authored-by: yui-soul <yui-soul@users.noreply.github.com>
Co-authored-by: yui-soul <yui-soul@users.noreply.github.com>
DirectorySource skills now reload automatically on file change without requiring a process restart. Co-authored-by: yui-soul <yui-soul@users.noreply.github.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.
Under construction
This branch contains the hot reload implementation for directory-based skill sources. The feature watches the filesystem for changes in skill directories and reloads them automatically without requiring a restart.
Status