Skip to content

fix(test): lower SET_GATE_ALLOWLIST to the counts in the tree - #22235

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/lower-set-gate-allowlist
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/lower-set-gate-allowlist

Conversation

@rnoack1

@rnoack1 rnoack1 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

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 on main in
test/test_backend_cards_advertised.py::test_no_new_runtime_site_gates_a_field_backed_line_on_a_set:

AssertionError: lower SET_GATE_ALLOWLIST to the new counts: {
  ('providers/acp_cli_overlay.py',   'ACP_BACKENDS_KIRO_SLASH_COMMANDS'): 1,
  ('providers/acp_model_effort.py',  'ACP_BACKENDS_KIRO_SLASH_COMMANDS'): 3,
  ('subagent_parts/model_choice.py', 'ACP_BACKENDS_KIRO_SLASH_COMMANDS'): 1,
}

SET_GATE_ALLOWLIST is shrink-only by its own comment: "convert a site to read the field, then
lower 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:

Each was green alone. Only the merged tree is red.

Why it matters

A red shard on main is red on every pull request built against it, and this one is not the
contributor's. Coverage Gate then fails closed on it, so one stale ratchet reds two checks.

Not a goal

  • Changing the ratchet's rules or its shrink-only contract. It is correct and it caught a real drift.
  • Touching any runtime site. #21376's reduction is the improvement the ratchet exists to record;
    this only writes down the new floor.
  • The other three breakages on main right now (the x-capture allowlist entry, the three claude
    capture 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:

entry was now
providers/acp_cli_overlay.py 1 removed
providers/acp_model_effort.py 3 2
subagent_parts/model_choice.py 1 removed

The two that reached zero are removed rather than written as 0, because an entry means "sites
that gate a field-backed line today" and zero such sites is no entry. Removing them does not
weaken the guard: the grown arm reads allow.get(key, 0), so a new site at a removed key still
trips it.

1 insertion, 3 deletions, one file. No source file is touched.

Tests

  • Negative control first. In a fresh worktree at main,
    pytest test/test_backend_cards_advertised.py reproduces the failure: 1 failed, 1 passed.
  • After the fix: 2 passed.
  • The new numbers are measured, not guessed. They come from calling the gate's own _set_gates()
    and printing allowlist -> found per 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 back
    allowlist == found (client_class.py at 2, 3 and 2), so the reader agrees with the gate rather
    than reimplementing it.
  • After the fix the allowlist holds 19 entries against 19 found pairs, with grown empty and
    shrunk empty.
  • The regrowth guard still bites, measured both ways. Under-declaring a surviving count
    (acp_model_effort as 1 against a found 2) makes grown fire naming that entry; and a simulated
    new site at the removed acp_cli_overlay key is also caught, because the missing key reads as 0.
    So the two deletions did not blind the check.
  • SET_GATE_ALLOWLIST has 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 main within fourteen minutes, which is what makes it a class rather
than an accident. The x-capture allowlist in scripts/check_harness_parity.py broke 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.

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.
@rnoack1
rnoack1 requested review from a team and KiroCrewCaptain as code owners October 19, 2026 17:01
@rnoack1
rnoack1 requested a review from dodgeblaster October 19, 2026 17:01
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 19, 2026
@rnoack1 rnoack1 closed this Oct 19, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 19, 2026
@rnoack1
rnoack1 deleted the fix/lower-set-gate-allowlist branch November 10, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant