Repository navigation
tech-debt(guards): a floor comment accumulates negotiation history and conflicts on every rebase — decide the rule before writing a guard #17384
Description
Problem
A reach-floor pin carries a comment explaining its number. Two things get written there, and only
one of them is worth keeping:
- the current number's derivation — what the population was, what the growth allowance is, why
the value sits where it does. Valuable. Strip it and the next reader finds a bare integer nobody
dares touch. - the negotiation history — "this branch proposed 6800 and ADOPTS main's 6736; fix(provision): stop a long ansible line from replacing the failure it carries (#17317) #17318 landed
first and first-to-land wins". Written once per branch, by each branch that lost the race.
The second kind is what accumulates, and it accumulates in a file every concurrent branch touches.
repo_tests/hooks_path_override_15961_test.py conflicted four times in one day (counted by
another session working the same queue, 2026-09-24), every conflict prose-only, with the floor value
identical on every side. Zero semantic disagreement, four manual resolutions.
Measured, on merged main:
$ git grep -l -E "ADOPTS main's|this branch proposed|first-to-land|proposed [0-9]{3,}" origin/main -- 'repo_tests/*.py'
repo_tests/audio_extension_allowlist_test.py
repo_tests/hooks_path_override_15961_test.py
The part that makes this worth filing rather than fixing
Someone already tried to fix it, in the obvious way, and the fix did not survive. A rebase of #17342
resolved that comment into a generalised form — "several branches proposed 6800 and all adopted
6736; not naming them, because naming them grows a line per branch and conflicts every rebase" —
and a later commit on the same branch rewrote the file and overwrote the resolution. It is not in
main. The rebase-orphans-the-prose pattern ate the fix for the rebase-orphans-the-prose pattern.
So the file will keep conflicting, and nobody's note survives to explain why.
Why the naive guard is worse than the disease
- Forbid prose in floor files → false positives on exactly the explanations worth keeping. The
derivation is the reason the floor is auditable at all. - Pattern-match "proposed"/"adopted"/"first-to-land" → a keyword list. The fifth branch phrases
it differently and the guard reports clean, which is the did not look verdict wearing a
nothing found costume.
The rule this is really about, stated before any enforcement is designed
A floor comment states what the current number means and how it was derived. It says nothing
about which branch proposed what, or who landed first. The resolver owns the value; the sentence
owns the meaning.
Acceptance criteria
- The rule above (or a better wording of it) is written where floor pins live —
docs/developer/RATCHET_BASELINES.md— with one worked example of a comment that keeps its
derivation and drops its negotiation history. - The two files above are rewritten to match it, removing per-branch narrative and keeping the
derivation, so the convention has a demonstrated instance rather than only a description. - Open question, to be answered in this issue before any guard is written: is the rule
mechanically enforceable at all? A detector must separate "explains the number" from "records
who won a race" without a keyword list. If the honest answer is no, this closes as a
convention plus a review-checklist line, and that is a legitimate outcome — a guard that
cannot tell those apart should not be written just to have one. - If it is enforceable, the guard ships with a positive control that catches a planted
negotiation sentence and a negative control that leaves a derivation sentence alone.
Related
- tech-debt(guards): the hooks-path-override reach floor trips on ordinary PRs — re-pinned three times in one night #17142 — the same files, the other half of the problem: the floor value churning on ordinary
PRs. That issue is about the number moving; this one is about the prose beside it. A fix for
either alone leaves the other. docs/developer/RATCHET_BASELINES.md— where the rule belongs.
Activity
github-actions commentedon Sep 24, 2026
👋 Auto-triage could not confidently classify this issue (no confident signal). Could a maintainer add the appropriate labels (
frontend,backend,infrastructure,docs,testingandgood-first-issue,intermediate,advanced)?mrveiss commentedon Sep 24, 2026
The worked example, found in merged main, five layers deep — and one layer is mine
While rebasing two of my own PRs onto the 635 pin, I read the comment block above it in
repo_tests/import_hermeticity_test.pyonorigin/main. It is this issue's whole argument in oneplace, so quoting rather than describing it (elisions marked):
Four stacked "this branch" narratives, then a paragraph stating the rule that forbids them. The
rule is already written, in the same comment, directly beneath the four paragraphs that break it. It
was added going forward and never applied backwards, so the file simultaneously documents the
convention and violates it four times.
Every one of those "this branch" references now points at a branch that no longer exists, and
"main's 604" is stale in the file that is main. A reader cannot tell which paragraph describes the
current value — the honest answer is none of them; only
floor=635and the last paragraph are true.One of the four is mine. The
602 -> 604note is from my #17305/#17306 work earlier today. Iwrote a paragraph explaining a value that two re-pins later is wrong, in a file I knew was
conflict-prone, which is as good a demonstration as the issue needs that this is a structural
problem and not carelessness by one author.
What this sharpens
git grepfound:its narrative is the deepest, and it is the file that conflicts.
already exists as prose and was not retroactively applied, which suggests the gap is
"nobody rewrites the paragraphs above their own", not "nobody knows the rule". A review-time
checklist line ("if you re-pin a floor, delete the previous narrative rather than appending to
it") would have caught all four. That is cheaper than a detector that must tell a derivation from
a negotiation, and it fails in a visible place.
re-pin narrative. Counting paragraphs that begin "Re-pinned"/"pins N rather than" is a keyword
list — but counting how many distinct floor values a comment block mentions is not, and this
block mentions 601, 602, 604, 635 and 662/664 populations. One value in the comment, one value in
the declaration; anything else is history. Worth testing whether that formulation survives contact
with the legitimate cases before it becomes a guard.
mrveiss commentedon Sep 24, 2026
A mechanical rule that is decidable, with a measured baseline
The issue records that matching negotiation phrasings ("proposed", "adopted", "re-pinned") is a keyword list the next author phrases around. Agreed. But there is a countable property that does not need to read prose at all:
A floor comment should mention one floor value — the current one. Every other value in it is history.
Counting distinct numbers in comments is too crude on its own: it catches issue references, years, and legitimate arithmetic. Restricting to numbers in the floor's own magnitude and stripping
#NNNNrefs makes it a clean signal. Measured on mergedmain:repo_tests/hooks_path_override_15961_test.pyautobot-backend/security/prompt_injection_detector_strict_mode_test.pyrepo_tests/audio_extension_allowlist_test.pyrepo_tests/import_hermeticity_test.pyimport_hermeticity_test.pyin full:504 556 600 601 602 604 608 635 661 662 664. Eleven values, one of which is true.Method, so it can be re-derived rather than trusted:
Two known leaks, both small and fixable: years (
2025,2026) fall inside the range for the 3100 floor, and a comment doing legitimate arithmetic ("population 6952, slack 216") contributes operands. Neither changes the ranking, and both are narrower problems than reading prose.Why this is worth more than the count
The rule it enforces is checkable by a human in one glance and by a script in four lines: one value in the comment, one in the declaration. It does not need to distinguish a derivation from a negotiation, which is the distinction the issue correctly says cannot be drawn mechanically. It sidesteps that question entirely by noticing that both kinds of stale prose share one observable — they carry a number that is no longer the floor.
The worked example, verified
import_hermeticity_test.pyonmaincarries stacked per-branch narratives and, directly beneath them, the paragraph stating the rule that forbids them. The rule was written going forward and never applied backwards.That suggests the gap is "nobody rewrites the paragraphs above their own" rather than "nobody knows the rule" — which is worth knowing before choosing a remedy, because it means a review-checklist line would have caught every instance, and is cheaper than any detector.
mrveiss commentedon Sep 24, 2026
Correction to my own count, with the method this time
My comment above said the block carries "four stacked
this branchnarratives". That number is notreproducible as stated, which on this issue of all issues is the wrong way to write a figure. It
conflated the UNIT (narrative) with the PHRASE (
this branch), and it named no window.Measured, so it can be re-run:
So: four narrative blocks, five occurrences of the phrase, one window —
sed -n '100,182p', thecomment block above the declaration. A count of 2 is what my own elided quotation contains, not
what the file contains, and quoting with elisions and then counting the quote is how the second
number appears.
The disagreement is more useful than either figure. Two readers measured the same file, both
honestly, and got 2, 4 and 5 depending on the unit and the window — which is precisely why
the value-counting criterion is the better instrument than any count of prose. A floor
value is unambiguous: it either equals the declaration or it is history. There is no window to
choose and no unit to conflate.
Adopting the measurement from the comment below this one as the issue's own number, since it carries
its method: eleven in-range values in this file against a declared 635, and fifty-two in
hooks_path_override_15961_test.pyagainst 6736 — on the file that conflicted four times in a day.mrveiss commentedon Sep 24, 2026
Correcting my correction: it was CASE, not elision — and the bias runs one way
My comment above explained the disagreement as "one reader counted the elided quotation". That is
wrong, and I am replacing it rather than leaving it, because the real cause is a stronger argument
for this issue's instrument than the one I gave.
Both readers ran their count against the same file,
origin/main:repo_tests/import_hermeticity_test.py.Four methods, one file, one moment:
The entire 2.5x gap is the case flag. And the three matches a case-sensitive count misses are
capitalised —
This branch— because they start sentences:A narrative begins at a sentence start, so the capitalised occurrences are the openers. A
case-sensitive count is not merely differently calibrated — it is biased against the feature being
measured, and it would be wrong in the same direction on any file. That is the same defect class as
a scanner that reads one spelling of a thing spelled several ways, which is what three separate
guards were widened for this week.
Line 149 also happens to carry two occurrences, so
grep -c's line-counting would have reported 1where there are 2 — a second latent hazard on the same line, masked here because only one of the two
matched case-sensitively.
For completeness: my own
4was a third unit again —grep -c -i -E "^\s*#\s*(Re-pinned|#[0-9]+ pins)",narrative openers by their own pattern. It equals
grep -ciby coincidence on this file, not byagreement, and reading it as corroboration would be the third version of this mistake.
Why this strengthens the criterion
Three honest readers, one file, answers of 2, 4 and 5 — from three degrees of freedom: unit
(lines vs matches), window (whole file vs quoted excerpt vs comment block), and case, with
case silently correlated with what was being counted.
A floor value has none of them.
635has no plural, no capitalisation, no sentence position, nosynonym, and no window worth arguing about: it either equals the declaration or it is history. Every
degree of freedom that produced our three answers is absent from the thing this issue proposes
measuring, which is the argument for it — not that prose is hard to read, but that prose has
parameters and a number does not.
chore(guards): re-pin the tracked-file floor mid-window (#17126, #17090)
feat(agents): verify an issue's acceptance criteria against merged ma…
fix(ci): a skipped smoke-test must not satisfy the required context (#…