fix(cnpg-drill): refuse a drill manifest the archive trap cannot read #151
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/drill-trap-fail-closed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
assert_no_archive_destinationis the only assertion standing between a restore drill and the production archive lineage. A drill cluster that archives writes into that lineage on a forked timeline and corrupts it.It failed open:
grep reports two different things through that one
|| true. Exit 1 means no lines survived — a real answer, since a manifest of nothing but comments declares no archive destination. Exit 2 or higher means grep never read the file. Both landed on the same branch, so an unreadable manifest produced an empty body, matched no pattern, and passed the trap.The function's own comment claimed the opposite: "Fails closed: any occurrence at all, including one it cannot interpret, is a refusal."
Demonstrated before the fix:
Red: the trap accepted a path that was never written.
Green: statuses above 1 refuse; a comment-only manifest still passes.
Found while diagnosing seanfarm gate run
seanfarm-fb74d162d05b-..., which failed this guard on thespace before the coloncase while the same commit passed locally, and while trunk passed the identical test nine minutes earlier. I confirmed the trap regex itself is sound under GNU grep 3.11 (all spellings match), so the regex is not the defect. A transient read of the case file is consistent with the flake — and either way an unread manifest must never count as a clean one.https://claude.ai/code/session_01LeVatedQ4sCA1u6LHjo7B5
assert_no_archive_destination is the only assertion standing between a restore drill and the PRODUCTION archive lineage: a drill cluster that archives writes into that lineage on a forked timeline and corrupts it. The assertion failed OPEN. It stripped comments with body="$(grep -v '^[[:space:]]*#' "$manifest" || true)" and grep reports two different things through that one `|| true`. Exit 1 means no lines survived, which is a real answer: a manifest of nothing but comments declares no archive destination. Exit 2 or higher means grep never read the file. Both landed on the same branch, so an unreadable manifest produced an empty body, matched no pattern, and passed the trap. The function's own comment claimed the opposite: "Fails closed: any occurrence at all, including one it cannot interpret, is a refusal." Red: the trap accepted a path that was never written. Green: statuses above 1 refuse, and a comment-only manifest still passes. Found while diagnosing a seanfarm gate run that failed this guard on one case and passed it locally on the same commit. A transient read of the case file is consistent with that, and either way an unread manifest must never count as a clean one. Claude-Session: https://claude.ai/code/session_01LeVatedQ4sCA1u6LHjo7B5