From 26e6c379bad0ac0e5bb3c2dc4ac6049ed77d7da9 Mon Sep 17 00:00:00 2001 From: iceteaSA <171169159+iceteaSA@users.noreply.github.com> Date: Fri, 18 Sep 2026 07:49:10 +0200 Subject: [PATCH] gate: correct the ratchet's own rationale to match its message #48 fixed the refusal message and left the doc comment above the function asserting the mechanism the message now refutes. A reader debugging a gate failure got two mutually exclusive explanations of the same hazard from one function -- which is worse than the original error, because the contradiction reads as one of them being a subtlety rather than a mistake. The comment claimed a branch forked before a raise "carries the OLD number forward in this file and merges green". Constructed on a scratch clone: squash stale(610) onto master(616) -> floor 616, gate.sh not even staged fork-before-raise, edits the floor -> UU scripts/gate.sh, conflict marker A squash applies the diff rather than the branch's file contents, so master's raise survives a branch that never touched the line; a branch that does touch it conflicts and cannot merge. Neither path is the one this guard catches. It catches a human resolving that conflict with --ours -- which happened on this repo an hour before the ratchet landed -- and a plain hand-edit downward. Both are invisible in review for the same reason: the gate passes either way. Comment only. Gate green, workspace floor 621 >= origin/master 621 at e97bc73. --- scripts/gate.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/gate.sh b/scripts/gate.sh index 81cd801..4f97f4f 100755 --- a/scripts/gate.sh +++ b/scripts/gate.sh @@ -255,13 +255,24 @@ stream and pass the arm without ever seeing it skip." # A FLOOR IS A LOWER BOUND, AND LOWER BOUNDS DO NOT COMPLAIN ABOUT BEING LOWERED. # -# A branch forked before a floor raise carries the OLD number forward in this file and -# merges green, silently reverting the raise. Nothing goes red: the count still clears -# the (now smaller) minimum, so the gate passes on both sides of the defect. Worse, the -# branch need not touch this file at all -- it inherits the value -- so the hazard is -# invisible in the diff and no marker catches it, because "the gate passes" is true -# either way. Live instance: an open PR sat on a pre-raise master carrying 578 while -# master was at 610, which would have handed back 32 tests' worth of protection. +# A floor that falls hands back protection with nothing going red: the count still clears +# the (now smaller) minimum, so the gate passes on both sides of the defect. +# +# THE MECHANISM IS NOT THE OBVIOUS ONE, and this comment asserted the obvious one until +# 2026-09-17. A branch forked before a raise does NOT carry its stale floor onto master. +# Constructed, rather than reasoned about: +# +# squash stale(610) onto master(616) -> floor 616, gate.sh not even staged +# fork-before-raise, edits the floor -> UU scripts/gate.sh, conflict marker +# +# A squash applies the DIFF, not the branch's file contents, so master's raise survives a +# branch that never touched this line; and a branch that does touch it conflicts loudly +# and cannot merge. Both paths are safe, and neither is what this guard catches. +# +# What it catches is a HUMAN RESOLVING THAT CONFLICT by keeping their own side -- which +# happened on this repo an hour before the ratchet landed, resolved by hand -- and a plain +# hand-edit downward, on a branch or on master. Both are invisible in review for the same +# reason: the gate passes either way, so there is no red to notice. # # So the floor is RATCHETED: it may rise, and it may not fall below the merge target's. # The comparison is against the TARGET's value rather than this file's own, because a