Repository navigation
Description
What happened
Priority: P2 reliability correction; candidate for v1.0.4.
Source review of published Python v1.0.3 found that Claude discovery and doctor read numeric JSON registry entries with unbounded Path.read_text() and then assume a JSON object. An abnormal local metadata entry can interrupt otherwise healthy discovery or make a filesystem read unbounded. Sender/reply discovery also calls the same discovery path.
This is a local metadata robustness finding, not a demonstrated remote vulnerability. This issue contains no live-agent reproduction or claim of a filesystem-wide timeout guarantee.
What you expected
Abnormal records should be skipped safely, healthy sessions should remain discoverable, and doctor should preserve useful permission diagnostics. Reads must have a defined byte budget and reject nonregular entries and non-object JSON before using record fields.
Fixed source evidence
- Python discover()
- Python diagnose_claude()
- Python sender discovery
- TS bounded reader precedent and isolated fixtures.
The Python paths are unchanged on main 817d92a. TS is a reference for stronger local read boundaries, not a requirement to copy its implementation or JSON shape.
Acceptance criteria
- Share a bounded reader between discovery and doctor. Define a byte limit (TS uses 1 MiB) with compatibility rationale.
- Reject symlinks and nonregular entries; on POSIX, avoid blocking opens if an entry is replaced by a FIFO. Check opened descriptor kind/identity and bound reads even when files grow. Close descriptors on all paths; document platform limitations.
- Reject malformed UTF-8/JSON and top-level null/arrays/scalars without traceback; retain healthy records and existing PID/start-time checks.
- Add isolated list, doctor, dry-run and sender-discovery fixtures for abnormal records, oversized/growing files, replacement, descriptor cleanup, and mixed healthy/bad entries. Do not send messages or weaken permissions.
- Preserve Python 3.9+ and Windows behavior; regenerate and verify standalone through the existing generator.
Scope and checked
- Existing issues searched; distinct from bug(windows): exited Claude sessions stay in discovery and make names ambiguous #173 (stale PID), fix(identity): pin list-to-send targets to a session generation and fail closed when stale #180 (generation pinning), and fix(delivery): retain unknown outcomes for incomplete SSH and Codex sends #263/fix(ssh): preserve successful discovery when the installed-version probe fails #265 (send outcomes/SSH discovery preservation).
- Sensitive information excluded.
- Source review only for this comparison; implementation, runtime tests, merge and release remain separate work.
Activity