feat(cli): --parent-dir scoped sync and query#136
Open
benbaarber wants to merge 13 commits into
Open
Conversation
--parent-dir <dir> / -d on p cache sync and path query restricts ingestion (and the query's reads) to artifacts under a directory. The stat gate always runs first; only artifacts that would cost a derive get the scope check, with one-line cwd peeks for codex/copilot memoized into the manifest record. Claude and pi compare in their lossy encoded key spaces. Out-of-scope artifacts are recorded as known-but-uncached and tallied separately, never touching a materialized record's stamp.
This was referenced Jul 17, 2026
|
🔍 Preview deployed: https://9579c6a5.toolpath.pages.dev |
# Conflicts: # CLAUDE.md # crates/path-cli/src/cmd_cache.rs # crates/path-cli/src/cmd_query.rs
# Conflicts: # CLAUDE.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CLAUDE.md
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.
Top of the stack.
--parent-dir <dir>/-donp cache syncandpath queryrestricts ingestion — and the query's reads — to artifacts under a directory (subtree match).The stat gate always runs first: unchanged+cached artifacts skip before any scope check, so only artifacts that would cost a derive pay for the constraint. Providers whose cwd lives inside the session file (codex, copilot) get a one-line bounded peek, memoized into the manifest record so it happens at most once per artifact — and a later derive never clobbers the memoized cwd. Claude and pi compare in their lossy encoded key spaces (claude in slug space where
//_/.all became-; pi in its dir-encoded space so hyphenated paths match). Out-of-scope artifacts are recorded as known-but-uncached, tallied separately (N out of scope), and never touch a materialized record's stamp — so staleness is never masked from the next in-scope sync.The
ArtifactSourcetrait grows its two scoping hooks here:peek_dir(defaulted toNone) andin_scope(defaulted to real-path subtree matching), overridden only by the providers that need them.With this PR the stack's tree is identical to
ben/cache-sync(#131) apart from the CHANGELOG retelling, so the series fully supersedes it. Tests:cargo clippy -D warningsclean; 478 tests pass; the full branch also passed the whole workspace suite (1,837 tests) and workspace clippy.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Stack (review bottom-up): #133 types/imports → #134 cache sync → #135 query auto-sync → #136 parent-dir. Supersedes #131.