Skip to content

T1a: Preserve keyed timeline segments during reconciliation - #40

Merged
VolkerChristian merged 1 commit into
masterfrom
codex/t1a-keyed-segment-reconciliation
Aug 22, 2026
Merged

T1a: Preserve keyed timeline segments during reconciliation#40
VolkerChristian merged 1 commit into
masterfrom
codex/t1a-keyed-segment-reconciliation

Conversation

@VolkerChristian

Copy link
Copy Markdown
Member

Reproduction gate

The test was written and run before the fix against merged master 3679e38.

  • Live activity-bucket growth retained its segment ID and passed as the control.
  • Inserting a new segment between two existing segments reproduced the defect: both unchanged-widget identity and final layout order failed.

Change

Replace the prefix-alignment/whole-turn teardown with an exhaustive keyed reconciliation over the desired segment order:

  • remove and destroy only genuinely absent segment widgets;
  • move surviving widgets to their desired layout indices without reparenting or rebuilding them;
  • create only genuinely new or presentation-incompatible widgets;
  • purge activity-row lookup state synchronously when its segment disappears;
  • preserve the pending viewport anchor across survivor moves and unrelated removal, clearing it only when its widget is destroyed.

Turn-level compatibility, render() call structure, and the exact-content fast path are unchanged.

Runtime proof

CodexUIConversationLayoutTest now covers:

  • a live activity bucket gaining a row while retaining its QWidget*;
  • middle insertion with identity preservation and correct order;
  • arbitrary regroup/reorder with all 20 unchanged keys retaining their original QWidget*;
  • genuine removal leaving the keyed lookup immediately and becoming a null QPointer after deferred deletion;
  • anchor survival across reorder and unrelated removal, plus clearing on destruction of the anchor widget.

Validation

  • Canonical incremental build root: /home/voc/projects/drafts/.codex-builds/codexui-final-verify-20260822
  • Focused CodexUIConversationLayoutTest: passed
  • Full CodexUI suite: 7/7 passed
  • Source deletion census: 86 removed lines, all from replacing the prefix/whole-layout teardown and its superseded positioning calls.
  • No golden hash or protocol fingerprint changed.

Replace prefix-only segment compatibility with an exhaustive keyed diff so unchanged presentation keys retain their QWidget identity across insertion and reorder. Remove only absent segments and keep viewport anchors attached to surviving widgets.

Call-site audit: the single segment reconciliation site changes; turn-level compatibility, render call structure, and the exact-content fast path are deliberately unchanged.

Deletion census: 86 lines removed under src/. The removed block was the prefix-alignment and whole-turn teardown algorithm (longer than five lines), replaced by keyed removal and indexed survivor reuse; the remaining removed layout calls are superseded by indexed insertion.

Runtime proof covers live activity growth, middle insertion, exhaustive reorder identity, selective lookup removal plus deferred destruction, and viewport-anchor lifetime. No golden hash or protocol fingerprint changed.
@VolkerChristian
VolkerChristian merged commit 3cd6952 into master Aug 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant