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
{{ message }}
Repository navigation
doctor.sh's store-size check asks the machine clock, not config.timezone, so it can invent an alarm the pipeline would not raise #357
Found by the release audit of v0.20.0..HEAD before tagging 0.21.0. Ranked misreports: non-blocking, filed rather than held.
The divergence
scripts/doctor.sh:421 gets today's date from the machine:
_DOCTOR_TODAY=$(date '+%Y-%m-%d')
The block's own header at scripts/doctor.sh:363-366 states the contract it is meant to hold — "The number being checked is the one the pipeline actually enforces... So this measures the same three parts against the same cap." It does not measure the same three parts.
The pipeline reaches today through config.timezone -> REMEMBER_TZ (scripts/log.sh:366) -> pipeline/_tz.py:34-36today_str(), which is what _eligible_staging (pipeline/shell.py:393) excludes today by. doctor.sh deliberately does not source log.sh, and REMEMBER_TZ appears nowhere in it — one grep over the file returns line 421 and nothing else.
So with timezone set to a zone whose current date is ahead of the machine's, doctor excludes today-D.md (which the pipeline counts) and counts today-(D+1).md (which the pipeline excludes). A divergence in both directions at once.
Why that is worse than it sounds
The comment at scripts/doctor.sh:419-420 claims only one direction:
under-counting is the safe direction for a diagnostic — it cannot invent an alarm.
It can. When the D+1 file is the larger of the two, _STAGING_BYTES can cross _CONSOLIDATE_MAX_BYTES on a store the pipeline is about to rotate happily — producing the FAIL ... cannot heal itself arm (scripts/doctor.sh:451) and VERDICT: problem (:568). That is the arm added in #348 for the store rotation genuinely cannot fix, shown to a user whose store is fine.
The guard is nominally on and effectively off
tests/test_doctor_oversized_store_348.py:321test_todays_staging_is_not_counted_against_the_cap obtains its date by running date +%Y-%m-%d in a subprocess (line 334) — the same clock as the code under test. Its own docstring names the direction it cannot detect ("the false-positive direction, and the expensive one"). It passes whether or not the code honours REMEMBER_TZ.
What settles it
Run doctor.sh against a store holding a large today-<tomorrow>.md with timezone set to a zone a day ahead, and compare its _STAGING_BYTES against _eligible_staging()'s sum.
Shape of a fix
Read .timezone the way _CONSOLIDATE_MAX_BYTES is already read at scripts/doctor.sh:377 and pass it to date, or use the same grep-then-TZ shape. The test needs a fixed date injected rather than one asked of the same clock, or it will keep passing through the fix.
Activity
release 0.21.0 — a store that could not get out of its own way
doctor.sh: read config.timezone, treat a 0 consolidate cap as disable…