You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: an unreadable file must not read as an absent one
`Path.exists()` returns False when the OS denies access — macOS TCC, unix
permissions, an unmounted share. Used as a guard before a read, it turns
"I may not read this" into "this does not exist" and the caller falls back
to defaults with nothing in the output to say so.
Found in the field on 2026-07-20: a sibling deployment reported an empty
review folder while nine finished videos sat in it, because the folder scan
was guarded by `exists()` and the process had lost Documents access. The
number 0 was indistinguishable from a real empty folder. Acting on it would
have meant reporting "nothing to schedule" against a full queue.
The same guard sits in front of this repo's own state: plan.json, the damping
ledger, the performance store and config.json. An unreadable plan looks like
no plan, so the scheduler books against built-in defaults; an unreadable store
looks like no history, so the damped planner sees an empty record. Both give
confident, wrong output.
Adds postpeer_pilot/safe_read.py: a read either returns content, returns None
because the file genuinely is absent, or raises Unreadable. Callers that want
a default now choose it explicitly, so the fallback is a decision in the code
rather than an accident of the filesystem.
Applied to plan.active, plan.series_slots, plan.ledger_entries,
plan.captions_by_post, perf.latest, perf meta-token lookup, config.load and
config.api_key. Regression tests cover absent, present and chmod-000 paths,
including that an unreadable plan or config raises instead of defaulting.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments