doctor: route the vault hygiene sweeps in as advisory findings - #58
Merged
Conversation
jit doctor now runs the auth-free half of the vault cleanup surface on every full sweep and routes each finding to the command that acts on it, keeping its two standing guarantees: it never decrypts (so never prompts) and it reports, never deletes. Four pieces: - The orphan sweep always runs. By default it collapses to one [orphan] count line routing to `jit vault orphans`; --orphans now selects the per-path listing instead of switching the sweep on. The run where you'd learn you have eleven orphans was exactly the run that hid them. - A registered mount whose manifest is GONE (project deleted without `jit unmount`) is split out of [mount] into [mount: stale], routes to `jit vault orphans --prune`, and no longer sets parseFailed — a missing file names no references, so skipping it cannot make the orphan sweep under-count. Same distinction vault orphans drew in v0.93.0 (GAPS.md #67); doctor still suppressed the count in exactly the cleanup that state calls for. - [duplicates]: groups that look like the same file stored twice, on the same name-level evidence as `jit vault list`'s nudge — the clustering is extracted into duplicateGroupClusters and shared, so the two surfaces cannot drift. The action routes to `jit vault duplicates`; name evidence never nominates a copy to delete, since a surviving copy can lack a key the retired one held. - [origin gone]: a secret a profile still references whose recorded Origin file no longer exists on disk (stat only; os.IsNotExist only, a permission error is not evidence of absence). The unreferenced half of that state needs no kind of its own — it is the orphan definition, and the count already carries it. All four are warnings: ok and the default exit are untouched, they gate only under --strict, and the JSON change is additive (no schema bump). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ugtBevcdhHM42LCTNCEFb
countWord prepends the number to whatever noun it is given, so handing it "the stale mount registration" rendered "clears 1 the stale mount registration". The article belongs to the sentence, the count to the noun: singular keeps "the stale mount registration", plural becomes "the N stale mount registrations". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ugtBevcdhHM42LCTNCEFb
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.
jit doctornow runs the auth-free half of the vault cleanup surface on every full sweep and routes each finding to the command that acts on it, keeping both of doctor's standing guarantees: it never decrypts (so it never prompts) and it reports, never deletes. The scan/migrate-style report/act boundary stays intact —jit vault orphansandjit vault duplicatesremain the acting halves.What changed
[orphan]count on by default. The orphan sweep always runs; without--orphansit collapses to one count line routing tojit vault orphans.--orphansnow selects the per-path listing instead of switching the sweep on — the run where you'd learn you have eleven orphans was exactly the run that hid them. Applied to text and JSON alike.[mount: stale]split out of[mount]. A registered mount whose manifest is GONE (project deleted withoutjit unmount) routes tojit vault orphans --pruneand no longer setsparseFailed: a missing file names no references, so skipping it cannot make the orphan sweep under-count. Same distinctionjit vault orphansdrew in v0.93.0 (GAPS.md #67); doctor still suppressed the orphan count in exactly the cleanup that state calls for. A manifest that exists but won't parse keeps today's behavior.[duplicates]hint. Groups that look like the same file stored twice, on the same name-level evidence asjit vault list's nudge — the clustering is extracted into a sharedduplicateGroupClustersso the two surfaces can never drift. The action routes tojit vault duplicates; name evidence never nominates a copy to delete, since a surviving copy can lack a key the retired one held.[origin gone]. A secret a profile still references whose recorded Origin file no longer exists on disk. Stat only, and onlyos.IsNotExistcounts as gone — a permission error is not evidence of absence. The unreferenced half of that state needs no kind of its own: it is the orphan definition, and the count already carries it. No action line (kindShadowed's reasoning: a deliberately deleted source file and a half-deleted project look identical from here).All four are warnings:
okand the default exit are untouched, they gate only under--strict, and the JSON change is additive (no schema bump). Also fixes a pre-existing wording glitch injit vault orphans("clears 1 the stale mount registration").Verified on a real machine
The dev VM genuinely had the stale-mount state plus 9 orphaned secrets. Installed v0.90.0 rendered the stale mount as a raw "no such file or directory"
[mount]warning with the action "fix the manifest" (of a deleted project) and showed nothing about the orphans; this branch renders[mount: stale]with the prune route plus the 9-orphan count, in exact agreement withjit vault orphans. No auth prompt at any point.🤖 Generated with Claude Code
https://claude.ai/code/session_015ugtBevcdhHM42LCTNCEFb