Commit 772a7da
committed
feat(keyviz): address PR #822 round-1 (Gemini HIGH ×2 + Codex P2 + Gemini MEDIUM)
Three review items, four bot comments (two duplicates):
- Gemini HIGH (line 650) + Gemini HIGH (line 679) + Codex P2
(line 654) — all the same regression: addWrite called
updateFallbackState(value) without passing the contributor's
(group, term), so resolveWrite's fallback path always
returned (0, 0) for the identity slot even when a
known-term source supplied the winning max value
(e.g. known=100 + legacy=50 returned RaftGroupIDs=[0]).
This regressed the PR-3b per-cell identity contract for
mixed-version cells. Fixed: updateFallbackState now takes
(value, group, term) and stamps lastGroup/lastTerm when
value >= fallbackMax (last-touched tie-break matching
addRead). When the known-term contributor wins, its
identity propagates to the merged cell as expected;
when the legacy contributor wins, identity correctly
resets to (0, 0) (TestMergeKeyVizMatrices...OnUnknownTerm
pins this case).
- Gemini MEDIUM (line 780) — hasConflict loop over
termConflict was wasteful. recordTermContribution only
ever stores `true` (entries are never reset), so
`len(c.termConflict) > 0` is equivalent and clearer.
Caller audit (per loop instruction, updateFallbackState
signature change is a semantic shift on its parameter
list):
- updateFallbackState: internal helper, only caller is
addWrite (same file, updated). No external consumer.
- hasConflict: behavior unchanged (length check is a pure
optimization of the previous loop), no caller impact.
New test:
TestMergeKeyVizMatricesFallbackPreservesKnownTermWinnerIdentity
mirrors the existing fallback test but flips who wins —
modern (100, group=7, term=42) + legacy (50, no arrays) →
fallback returns value=100 with identity=(7, 42). The prior
PR-3c diff would have emitted (0, 0) and silently dropped
the modern source's per-cell identity in mixed-version
clusters.1 parent c1aa23b commit 772a7da
2 files changed
Lines changed: 58 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
650 | | - | |
| 650 | + | |
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
667 | | - | |
668 | | - | |
669 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
670 | 677 | | |
| 678 | + | |
| 679 | + | |
671 | 680 | | |
672 | 681 | | |
673 | 682 | | |
| |||
767 | 776 | | |
768 | 777 | | |
769 | 778 | | |
770 | | - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
771 | 783 | | |
772 | 784 | | |
773 | 785 | | |
774 | 786 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
| 787 | + | |
781 | 788 | | |
782 | 789 | | |
783 | 790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
239 | 279 | | |
240 | 280 | | |
241 | 281 | | |
| |||
0 commit comments