Skip to content

feat(cli): path query syncs its scope before reading - #135

Merged
benbaarber merged 14 commits into
mainfrom
ben/sync-3-query-autosync
Jul 27, 2026
Merged

feat(cli): path query syncs its scope before reading#135
benbaarber merged 14 commits into
mainfrom
ben/sync-3-query-autosync

Conversation

@benbaarber

@benbaarber benbaarber commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Third in the stack (on top of the p cache sync PR). path query now freshens the slice of the cache it will read, before reading it — this is the piece that makes the cache an implementation detail: a new user runs path query with no setup and gets their sessions.

Scoping follows the query's own flags: --source claude syncs only claude, --id prefixes narrow to their types, a bare cache-wide query syncs every type, and --input-only queries never touch the cache. Output stays quiet unless something was actually ingested (synced claude: 3 new, 1 updated); a sync failure degrades to querying the cache as-is; --no-sync opts out.

The import no-op check from the previous PR now covers the implicit path too: importing an artifact the query-sync already cached reports "already up to date" instead of an exists-error.

Tests: cargo clippy -D warnings clean; 471 tests pass at this point in the stack.


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.

path query now freshens the slice of the cache it will read before
reading it: --source narrows the sync to one type, --id prefixes narrow
likewise, a bare cache-wide query syncs every type, and --input-only
queries never touch the cache. Quiet unless something was ingested; a
sync failure degrades to querying the cache as-is; --no-sync opts out.
Importing an artifact the implicit sync already cached is a friendly
no-op instead of an exists-error.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://078f87c9.toolpath.pages.dev

@akesling akesling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread crates/path-cli/src/cmd_import.rs Outdated
// re-importing an artifact whose record is still fresh is
// a no-op, not an exists-error.
// The implicit sync in `path query` fills the cache under
// these same ids; re-importing an artifact whose record is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/id/ID/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Base automatically changed from ben/sync-2-cache-sync to main July 27, 2026 18:09
@akesling akesling assigned benbaarber and unassigned akesling Jul 27, 2026
@benbaarber
benbaarber merged commit fe308b3 into main Jul 27, 2026
2 checks passed
@benbaarber
benbaarber deleted the ben/sync-3-query-autosync branch July 30, 2026 20:35
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