Refactor: compile Gateway and ListenerSet listeners into one effective-listener model #614
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 239 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.328
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #614"
general
weight: 0.35
justinsb
This implements step 1 of the plan in docs/incremental-state.md: compiling Gateway and ListenerSet listeners into a unified effective-listener model in
pkg/statewithout behaviour change.Summary of Changes
1. Effective Listener Model (
pkg/state/compiled.go):- Combines Gateway listeners and allowed ListenerSet listeners in precedence order into
[]*EffectiveListeneron eachCompiledGateway.- Records listener owner (kind Gateway or ListenerSet, namespace, name), parent Gateway, and spec.
- Consolidates listener validation (supported protocols, route kinds, TLS secret validation, and cross-namespace
ReferenceGrantchecks) into a single pureValidateListenerfunction.2. Unified Route Binding:
- Single route-binding pass (
bindRouteParentRef) resolves parent (Gateway or ListenerSet -> parent Gateway) and binds routes againstEffectiveListenercandidates.- Computes route
Acceptedcondition, increments listenerAttachedRoutes, and populatesInternalRouterules.3. Certificate Extraction:
-
ExtractCertificatesextracts TLS certificates once across all effective listeners with owner-awareReferenceGrantvalidation and Gateway-only default certificate fallback.4. Pure Status Computation:
- Added pure status computation functions (
ComputeDesiredGatewayStatus,ComputeDesiredListenerSetStatus,ComputeDesiredHTTPRouteStatus).- Controllers (
GatewayReconciler,ListenerSetReconciler,HTTPRouteReconciler) andupdateProxycall these functions and write status only when changed.5. Testing & Documentation:
- Table-driven unit tests for the compiled model in
pkg/state/compiled_test.go.- All unit tests (
ap test), linter (ap lint), and full e2e/conformance suite (ap e2e) pass.- Updated conformance skill journal in
.agents/skills/implement-conformance-test/journal/listenerset.md.Fixes #611