Repository navigation
Conversation
kirodotdev#21376 landed 75s after the ratchet in kirodotdev#22056 and reduced three of its counted sites, so the shrink-only arm fails on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Motivation
Goal: The runtime set-gate ratchet matches the tree again, so the backend shard that runs it stops failing.
Backend Tests (3.12, 7)fails onmainintest/test_backend_cards_advertised.py::test_no_new_runtime_site_gates_a_field_backed_line_on_a_set:SET_GATE_ALLOWLISTis shrink-only by its own comment: "convert a site to read the field, thenlower its count here." Three of its counts are now above what the tree holds, so the shrunk arm
fires. The failure is the ratchet working, not a defect in it.
Two commits 75 seconds apart, neither able to see the other:
79caee664fat 14:09:41Z (test: ratchet runtime set gates on lines backed by an advertised field #22056) added the ratchet and these entries, with counts true atthat moment.
f161e2734aat 14:10:56Z (fix(acp): stop the shared effort overlay seeding new KAS sessions #21376) reducedACP_BACKENDS_KIRO_SLASH_COMMANDSuse in all threefiles.
Each was green alone. Only the merged tree is red.
Why it matters
A red shard on
mainis red on every pull request built against it, and this one is not thecontributor's.
Coverage Gatethen fails closed on it, so one stale ratchet reds two checks.Not a goal
#21376's reduction is the improvement the ratchet exists to record;this only writes down the new floor.
mainright now (the x-capture allowlist entry, the three claudecapture headers, and the name_grant patch scan). Each has its own one-defect PR.
What changed
Lowered the allowlist to the counts the gate itself reports:
providers/acp_cli_overlay.pyproviders/acp_model_effort.pysubagent_parts/model_choice.pyThe two that reached zero are removed rather than written as
0, because an entry means "sitesthat gate a field-backed line today" and zero such sites is no entry. Removing them does not
weaken the guard: the
grownarm readsallow.get(key, 0), so a new site at a removed key stilltrips it.
1 insertion, 3 deletions, one file. No source file is touched.Tests
main,pytest test/test_backend_cards_advertised.pyreproduces the failure: 1 failed, 1 passed._set_gates()and printing
allowlist -> foundper entry:acp_cli_overlay 1 -> 0,acp_model_effort 3 -> 2,model_choice 1 -> 0. Positive control in the same run: three untouched entries read backallowlist == found(client_class.pyat 2, 3 and 2), so the reader agrees with the gate ratherthan reimplementing it.
grownempty andshrunkempty.(
acp_model_effortas 1 against a found 2) makesgrownfire naming that entry; and a simulatednew site at the removed
acp_cli_overlaykey is also caught, because the missing key reads as 0.So the two deletions did not blind the check.
SET_GATE_ALLOWLISThas exactly one reader, this module, so there is no second consumer to update.Pattern harvest
Rule candidate: review-prompt
Pattern: a shrink-only ratchet goes stale when the PR that shrinks its subject lands beside the PR that wrote its floor
This is the third instance on
mainwithin fourteen minutes, which is what makes it a class ratherthan an accident. The x-capture allowlist in
scripts/check_harness_parity.pybroke the same way(#22102 added an entry at 14:08:57Z, #21753 proved it 108 seconds later), and this ratchet broke 75
seconds after it was written. Both PRs are green alone and red only merged, so the cheap guard is at
merge time: a ratchet whose floor a sibling PR moves needs the queue to evaluate the pair, not each
side on its own.