feat(cli): --parent-dir scoped sync and query - #136
Merged
Conversation
This was referenced Jul 17, 2026
|
🔍 Preview deployed: https://494d88c3.toolpath.pages.dev |
akesling
reviewed
Aug 3, 2026
| pub project: Option<PathBuf>, | ||
| /// `--parent-dir`: keep only paths whose `base` lives under this | ||
| /// directory (subtree match). | ||
| pub parent_dir: Option<PathBuf>, |
Contributor
There was a problem hiding this comment.
Maybe "--project-under"? Unsure the right name, but "--parent-dir" freestanding doesn't seem clear enough. I don't know that users understand the implications of project director restriction like this and we need to communicate that in the flag name / documentation.
Collaborator
Author
There was a problem hiding this comment.
agree, now changed to --project-under
--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.
Review feedback on #136: "--parent-dir" names the argument, not the filter — it doesn't say what the directory is a parent *of*. "--project-under" reuses the established --project vocabulary (the session's recorded project/working directory) and reads as its subtree relaxation. The -d short goes away with it; help text now spells out that the match is on the session's project directory, not the files it touched.
ben-emp
force-pushed
the
ben/sync-4-parent-dir
branch
from
August 3, 2026 15:18
bd50b8a to
f42e398
Compare
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.