Skip to content

Commit 44d7cd4

Browse files
committed
docs: address PR #694 round-27 (Claude R27)
Claude R27 verdict on `e7b0c132`: "design is ready to merge as PR-A after these 2 fixes". Both items addressed: - §9 Q2 PR sequencing note (lines 835-840) directly contradicted the round-26 §7 PR-B fix. Said "PR-B's RegisterRoute only pre-creates labeled siblings when --keyvizLabelsEnabled=true" — opposite of round-26's "unconditionally legacy-slot-only regardless of the flag". Updated to match: "With the round-23 array form, AllLabels is non-empty from PR-B onward, AND with the round-26 unconditional model, PR-B's RegisterRoute always pre-creates only the legacy slot regardless of the flag — the flag-honoring loop is simply not present in PR-B (lands in PR-C+D+E). PR-B remains behavior-neutral unconditionally, not via flag default or empty slice." The flag is introduced in PR-B for Opts plumbing only; its read-site doesn't exist in PR-B so its value has no observable effect. - §4.1.1 dual `slotsPerRoute :=` in single Go code block (lines 285-291) is a Go compile error — two `:=` declarations in the same scope ("no new variables on left side of :="). Split into two separate code blocks: PR-B body (unconditional `slotsPerRoute := 1`) and PR-C+D+E body (replaces the PR-B body with the flag-gated conditional). Added explicit narrative: "PR-C+D+E replaces the literal 1 with the flag-gated conditional".
1 parent e7b0c13 commit 44d7cd4

1 file changed

Lines changed: 31 additions & 16 deletions

File tree

docs/design/2026_04_28_proposed_keyviz_adapter_labels.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,21 @@ slotsPerRoute` (i.e. `MaxTrackedRoutes × (len(AllLabels) + 1)`
275275
when labels are enabled, `MaxTrackedRoutes × 1` when off), which
276276
we document but never count against the cap.
277277

278+
PR-B body (unconditional, no flag check — Codex round-26 P2):
279+
278280
```go
279-
// keyviz/sampler.go:416
280-
//
281-
// PR-B body: slotsPerRoute is the literal `1`; the
282-
// flag-honoring branch lands in PR-C+D+E (Codex round-26 P2 —
283-
// PR-B is unconditionally legacy-slot-only regardless of the
284-
// flag).
285-
slotsPerRoute := 1 // PR-B body stops here
286-
287-
// PR-C+D+E extends to (Codex round-15-4th-pass P1):
281+
// keyviz/sampler.go:416 — PR-B body
282+
slotsPerRoute := 1 // legacy slot only; unconditional in PR-B
283+
if len(next.slots) / slotsPerRoute < s.opts.MaxTrackedRoutes {
284+
// ... pre-create slot(s) for this route
285+
}
286+
```
287+
288+
PR-C+D+E replaces the literal `1` with the flag-gated
289+
conditional (Codex round-15-4th-pass P1):
290+
291+
```go
292+
// keyviz/sampler.go:416 — PR-C+D+E body (replaces PR-B body above)
288293
slotsPerRoute := 1 // legacy slot only (when flag off)
289294
if s.opts.KeyVizLabelsEnabled {
290295
slotsPerRoute = len(AllLabels) + 1 // 6 with flag on (in-package, no keyviz. qualifier)
@@ -294,6 +299,11 @@ if len(next.slots) / slotsPerRoute < s.opts.MaxTrackedRoutes {
294299
}
295300
```
296301

302+
(Two separate code blocks — the dual `slotsPerRoute :=` form
303+
in a single Go scope is a compile error, "no new variables on
304+
left side of `:=`"; Claude round-27 minor caught the
305+
single-block presentation.)
306+
297307
The alternative (Option B: `MaxTrackedRoutes` redefined as
298308
"slots") would silently halve the route capacity at PR-C
299309
rollout — an operator setting 1024 today would suddenly track
@@ -831,13 +841,18 @@ atomic deploy. (Reviewer notes from PR #694: Claude bot critical
831841
**PR sequencing note**: §7 PR-B previously declared `AllLabels`
832842
as a *deliberately-empty slice* (`var AllLabels []Label{}`) to
833843
make the pre-creation loop a no-op until PR-C populated it.
834-
With the round-23 array form, AllLabels is non-empty from PR-B
835-
onward — but the round-17 flag-gating means PR-B's
836-
`RegisterRoute` only pre-creates labeled siblings when
837-
`--keyvizLabelsEnabled=true`, which defaults to false. So
838-
PR-B remains behavior-neutral via the flag, not via an empty
839-
slice. The §7 PR-B row already mentions the flag default; this
840-
is the same mechanism reused.
844+
With the round-23 array form, `AllLabels` is non-empty from PR-B
845+
onward, AND with the round-26 unconditional model, PR-B's
846+
`RegisterRoute` always pre-creates only the legacy slot
847+
regardless of the flag — the flag-honoring pre-creation loop
848+
is simply not present in PR-B (it lands in PR-C+D+E along with
849+
the adapter wiring and wire-format changes). So PR-B remains
850+
behavior-neutral **unconditionally**, not via a flag default
851+
or an empty slice. The flag is introduced in PR-B for option
852+
plumbing only (`KeyVizLabelsEnabled bool` on `Opts`), so
853+
PR-C+D+E can read it without an Opts-API change in PR-C+D+E
854+
itself; in PR-B the flag's read-site doesn't exist yet, so its
855+
value has no observable effect. (Codex round-25 P2 + round-26 P2.)
841856

842857
**Why a typed `Label` rather than plain `string`** (Codex round-9):
843858
slot pre-creation iterates `AllLabels`, and `Observe` drops slot

0 commit comments

Comments
 (0)