Repository navigation
ci(agents): accept common controller condition stamping and generalize shared-mock check - #868
Merged
Merged
Conversation
…lize shared-mock check Handlers run under the common controller set conditions built by common/pkg/condition; the controller stamps ObservedGeneration and writes the status only when it changed, so the observed-generation check of 02-no-reconcile-loops now passes them. Adds a sourced allowed example. The duplicates-shared-mock check of 15-prefer-shared-mocks names the kinds of shared mocks generically instead of listing specific ones. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lukas016
approved these changes
Nov 17, 2026
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.
Summary
02-no-reconcile-loops/observed-generation: Handlers that implementhandler.Handler[T]run under the common controller (common/pkg/controller). The controller setsObservedGenerationon every condition before it writes the status, and writes the status only when it changed. The check now accepts that. A handler that sets acommon/pkg/conditioncondition throughSetCondition, and does not write the status itself, no longer gets a CRITICALUNCLEAR. The rule gains an allowed example taken fromadmin/internal/handler/environment/handler.go:20.15-prefer-shared-mocks/duplicates-shared-mock: The check now describes the kinds of shared mocks in general terms instead of listing specific ones.Why
The audit of #816 blocked on
route.SetCondition(condition.NewReadyCondition(...))in the gateway route handler, a line #816 doesn't touch. The judge couldn't see that the common controller setsObservedGeneration. The15-prefer-shared-mockswording change was also only in #816 and belongs with the rule changes.Tests
validate_rules.py: 16 rules OK.selftest_rules.py --static: passes.selftest_rules.py --plan --samples 3 --rule 02-no-reconcile-loops→--score: accuracy 15/15, flake rate 0%.41ab66a6b68c78bd.