Skip to content

Resume preview: a Load now rewind's anchor without lastPrompt cuts the chain (P5 O3-F residual B) - #292

Merged
SSFSKIM merged 2 commits into
masterfrom
fix-rewind-resume-preview
Oct 28, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
fix-rewind-resume-preview

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Fixes P5 O3-F's residual B (spikes/protocol-probe/findings-p5-o3-rewind-resume.txt; P5 Decision Log 103). After a "Load now" rewind, the resume chooser's preview showed the rewound turn as the session's latest until the next prompt was sent.

Cause. A resumed process that has taken no prompt writes its rewind anchor without lastPrompt (the pre-release fixture's line 61: {"type":"last-prompt","leafUuid":…,"explicit":true,"rewound":true}). LastPromptAnchorSchema required the field, so both readers of the anchor skipped it: leafUuidOf in recent-turns.ts, which picks the preview's leaf, and withResponseGroups' replay, which recovers a parallel response's blocks. The release then appends a plain anchor that still names the rewound prompt (line 62), which neither reader treats as a cut. The chain follower parses anchors leniently and was already right.

Fix. lastPrompt is optional. Nothing on the preview's path reads it: the preview takes its prompts from the chain's records. Once the anchor parses, the preview's leaf is the anchor's target, and the replay cuts there as the follower does. Terminal-started sessions (lane A) and MAWS-launched ones (lane B) both reach session.recentTurns → readRecentTurns → recentTurnsOf, so this one change covers both.

What the preview shows (pre-release arm, recentTurnsOf over the recorded transcript):

through line before after
60, before the rewind T1, T2 T1, T2
61, the Load now anchor T1, T2 T1
62–66, after the release T1, T2 T1
89, after T3 T1, T3 T1, T3

Rerunning the spike's MAWS-side replay (p5-o3-rewind-resume-maws.ts) on this tree changes exactly four recorded snapshots: pre-release after the rewind, pre-release after the release, and the kill-after-rewind-200ms and -1s arms after the kill. In each of them the preview now equals the chain follower's (T1). Every other value in p5-o3-rewind-resume-maws.json is unchanged. The spike's recording and its probe test describe the defect as of the spike, so they are left as they are.

Tests (each fails on master):

  • recent-turns.test.ts: the pre-release fixture, cut at each of the points in the table above.
  • transcript.test.ts: withResponseGroups recovers a parallel response under a Load now anchor and matches the real ChainFollower's chain. The schema test now accepts the anchor's recorded shape; it used to reject {type: 'last-prompt'}.

Second commit: master was red. #289 added probe journals under fixtures/p5/ under a probes-only gate. replay-fixtures.test.ts seeds every probe journal and expected only p4/, so unit failed on master (run 40696896340, this branch's first commit on aece60f). The test now expects p5/ too, following the precedent of dbd5876.

Gate. Class 1a green on the head 3c8536a (tree f6106b5e): run 40697815990. ci-gate flagged no e2e group as reached through spec imports.

Review. One round of reviewer-medium; no findings.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…t, cuts the chain (P5 O3-F residual B; LastPromptAnchorSchema's lastPrompt optional, so recentTurnsOf's leaf and withResponseGroups' replay honour it as the chain follower does)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…r fixtures/p5 (master red since #289, whose gate ran probes only)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T13:41:37.048188Z 3c8536a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit 8e1ada2 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…nchor (#292); master's unit suite red from #289 until it; the currentChain row takes the index summary

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…ixtures #289, CI #288 and #290; wire minor stays 5)

replay-fixtures.test.ts: master's p4/p5 listing, which already reads O2's Stop-hook probe
journals under fixtures/p5; its comment names both P5 sets. Master's wire is still 4, and
the regenerated manifest is unchanged.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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