Skip to content

feat(cli): --parent-dir scoped sync and query#136

Open
benbaarber wants to merge 13 commits into
ben/sync-3-query-autosyncfrom
ben/sync-4-parent-dir
Open

feat(cli): --parent-dir scoped sync and query#136
benbaarber wants to merge 13 commits into
ben/sync-3-query-autosyncfrom
ben/sync-4-parent-dir

Conversation

@benbaarber

@benbaarber benbaarber commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Top of the stack. --parent-dir <dir> / -d on p cache sync and path query restricts 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 ArtifactSource trait grows its two scoping hooks here: peek_dir (defaulted to None) and in_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 warnings clean; 478 tests pass; the full branch also passed the whole workspace suite (1,837 tests) and workspace clippy.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with 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.

--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.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://9579c6a5.toolpath.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants