Skip to content

Commit 48376d3

Browse files
committed
style(keyviz): drop PR-number attribution from PR-3c-introduced comments
Per the per-repo convention to keep the *why* and drop the *review-round suffix* in source comments. Four call sites I added during PR-3c work referenced "Gemini HIGH / Codex P2 / Claude bot Rn on PR #822" — those reduce to plain prose without losing the underlying reasoning. Pre-existing PR #N references (from earlier PRs like #686 / #692) and Phase 2-C+ / PR-3c milestone tags (project-phase designators that mirror "Phase 2-A", "Phase 2-B", … in the codebase) are kept. Specifically: - cellMergeAcc.lastGroup/lastTerm doc: dropped "matching the round-1/round-2 PR-3b documented", kept the read-merge rationale ("prev+incoming is a sum, so we pick whichever side contributed most recently"). - updateFallbackState doc: dropped "(Gemini HIGH + Codex P2 on PR #822)", kept the failure mode it prevents. - resolveWrite fallback comment: dropped "(round-1 fix on PR #822 — ...)", kept the behavior description. - hasConflict doc: dropped "(Gemini MEDIUM on PR #822)", kept the algorithmic invariant.
1 parent c42633a commit 48376d3

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

internal/admin/keyviz_fanout.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,11 @@ type cellMergeAcc struct {
544544
// Read path (sumMerge): running sum across all sources.
545545
sum uint64
546546
// Read path identity: last non-zero contributor's (group, term).
547-
// Best-effort, matching the round-1/round-2 PR-3b documented
548-
// "last-touched" semantics for reads. For writes the resolved
549-
// identity comes from `byTerm` largest value at resolve time.
547+
// Best-effort "last-touched" semantics for reads (the read
548+
// merge has no single owner — prev+incoming is a sum, so we
549+
// pick whichever side contributed most recently). For writes
550+
// the resolved identity comes from `byTerm` largest value at
551+
// resolve time.
550552
lastGroup, lastTerm uint64
551553

552554
// Write path (group-term dedupe + sum across terms):
@@ -670,8 +672,7 @@ func (c *cellMergeAcc) addWrite(value, group, term uint64) {
670672
// equal contributions keeps the most recently processed identity.
671673
// Without the identity tracking, a cell with one known-term source
672674
// + one unknown-term source would always fall back to (0, 0) even
673-
// when the known-term source supplied the winning max (Gemini HIGH
674-
// + Codex P2 on PR #822).
675+
// when the known-term source supplied the winning max.
675676
func (c *cellMergeAcc) updateFallbackState(value, group, term uint64) {
676677
if value >= c.fallbackMax {
677678
c.fallbackMax = value
@@ -755,12 +756,12 @@ func resolveRowMergeAcc(acc *rowMergeAcc, useGroupTermDedupe bool) KeyVizRow {
755756
func (c *cellMergeAcc) resolveWrite() (value, group, term uint64) {
756757
if c.hasUnknownTerm {
757758
// Fallback: max-merge across all contributions. Identity
758-
// is from the contributor that supplied fallbackMax (round-1
759-
// fix on PR #822 — updateFallbackState now stamps
760-
// lastGroup/lastTerm when value >= fallbackMax). Identity
761-
// is (0, 0) only when every contribution was unknown-term
762-
// or when an unknown-term source supplied the largest value.
763-
// Matches the legacy §4.2 / PR-3b behavior the sentinel
759+
// comes from the contributor that supplied fallbackMax
760+
// (updateFallbackState stamps lastGroup/lastTerm when
761+
// value >= fallbackMax). Identity is (0, 0) only when
762+
// every contribution was unknown-term or when an
763+
// unknown-term source supplied the largest value.
764+
// Matches the legacy §4.2 max-merge behavior the sentinel
764765
// was designed to preserve.
765766
return c.fallbackMax, c.lastGroup, c.lastTerm
766767
}
@@ -780,8 +781,8 @@ func (c *cellMergeAcc) resolveWrite() (value, group, term uint64) {
780781
// disagreement, or — under the fallback path — when ≥2 distinct
781782
// non-zero values were reported. recordTermContribution only ever
782783
// stores `true` in termConflict (entries are never reset), so a
783-
// length check is equivalent to scanning the map (Gemini MEDIUM
784-
// on PR #822).
784+
// length check is equivalent to scanning the map and avoids the
785+
// O(N) walk.
785786
func (c *cellMergeAcc) hasConflict() bool {
786787
if c.hasUnknownTerm {
787788
return c.fallbackNonZeroDistinct

0 commit comments

Comments
 (0)