-
Notifications
You must be signed in to change notification settings - Fork 2
disk-hygiene: scan has no output-verbosity flag (~63,000 tokens of children_rollup in one run) #3352
Copy link
Copy link
Closed
Labels
agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.Fully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.Real value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.Triaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.A briefed fix or small feature; blast radius bounded by the brief, tests exist.
Description
Activity
Metadata
Metadata
Assignees
Labels
agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.Fully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.Real value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.Triaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.A briefed fix or small feature; blast radius bounded by the brief, tests exist.
plugins/disk-hygienev0.20.21. Split out of the audit umbrella. F7, medium.Problem
No subcommand has an output-verbosity flag. Every
scanemits its fullchildren_rollup— one row per immediate child, with every field — regardless of what the caller needs.A
--max-depth 1scan of a user home directory produced roughly 9,000 tokens of JSON (estimated from output size, not counted). The audited run performed seven such scans, so on the order of 63,000 tokens went into context to surface a frontier the caller then summarized in a paragraph.The pipe rejection is correct — do not relax it
The obvious workaround is to trim at the call site, and the Bash guard rejects it: pipes, redirects, and shell operators all fail closed. That rejection is load-bearing and should be kept. Shell expansions are exactly the surface a deny-by-default lane exists to close, and an exception for
| headis an exception for everything that can be spelled like| head.So the fix belongs in the engine, not the guard.
Suggested fix
Add
--quiet(or--summary) toscan, emitting the decision-relevant fields and omitting the per-child detail:status,target,entries,hinted_entries,unhinted_entriesempty_directory_counttarget_logical_bytes,target_reclaimable_local_bytestruncated_pathserrors,policy_sources,os_autocleanThe full
children_rollupstays available by default and in the snapshot file on disk, which is where a caller that needs per-child detail should read it — the snapshot is written regardless, so emitting it to stdout as well is pure duplication for the common case.Worth noting the same argument applies, less urgently, to
handoff-verify, whose note block is re-emitted verbatim on every single-path call. On a 17-path run that note was printed 17 times.Related
Umbrella: #3347. The per-path round-trip that multiplies this: the
--pathissue filed alongside this one.🤖 Generated with Claude Code