Skip to content

fix(planning): show read-back, flip condition and numbered confirmation on the interview page - #12334

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/12310-replacement
Nov 2, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/12310-replacement

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #12103
Refs: #12310

Summary

Replaces #12310, whose branch conflicts with main and which the pr-unblock resolve-conflicts lane stopped on three times (unresolved-conflict: runs 41411673788, 41411912666, 41414039600). This branch is main with #12310's branch merged in, so the change is the same as #12310's: the interview page shows Claude's read-back of an answer with a Confirm reading button (confirm-reading event), shows each recommendation's Flips if: line, and takes question numbers at the final confirmation; R-D in surface.md points at loop.md's one read-back rule. See #12310 for the full file list.

Fix

Verification

  • bash plugins/planning/tests/interview-defenses.test.sh: PASS=178 FAIL=0.
  • python3 -m unittest discover -s plugins/planning/surface -p "test_*.py": 894 tests OK (1 skipped).
  • pre-push check-affected: passed.
  • The browser suites (surface-checks.sh) are left to this PR's CI.

Related

🤖 Generated with Claude Code

melodic-automation-lanes Bot and others added 4 commits November 2, 2026 06:17
Lane-Activity: work-resolve-issue/resolve-issue
Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yjfVg
Both sides re-pinned the loop.md open-question register section: main for
#5769 (stale=<n> halt, Re-check on answered rows), #12103 for the read-back
paragraph's closing sentence. The merged section keeps both edits, so the pin
moves 4d527ca1... (main) / 755c47df... (#12103) -> f3d89089..., with both
justification lines kept. No halt is removed or qualified; the read-back row
still stays open until the user confirms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T08:59:47.639222Z 8bff416 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bff416a3d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/planning/surface/index.html Resolved
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 55e2695919593c210f953eab77ac3f2d8f0757e8: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12334, incremental since 8bff416a

I found no security issues in the change since the last review.

What I checked:

  • The server check (plugins/planning/surface/interview_server.py, check_reading and the confirm-reading branch of record):
    • The check runs inside self.cond after the existing qid not in qs → 400 guard (L1300-L1301), so qs[qid] only ever looks up a known question.
    • answerSeq and readRev are written onto the event only after isinstance(..., int) passes and they match the current answer's seq and the newest Understood as: count. Nothing else from the client reaches the stored event.
    • The read-back regex ^\s*Understood as: is anchored and linear, so it carries no ReDoS risk.
    • Authentication, origin and session handling on the local server are unchanged.
  • The page (plugins/planning/surface/index.html):
    • The new data-answerseq and data-readrev attributes come from numbers: d.seq is the event's seq and rev is an array length.
    • The question id still goes through esc, and the read-back text still goes through mdHtml.
    • confirmReading posts with Number(...) on those dataset values, and the server re-checks them. It keeps the existing S.api, S.busy and closed() guards.
    • No new string reaches innerHTML unescaped.
  • Schema, README, surface.md, test, ui_page.js and changeset: these document and test the new fields. No instruction is deleted, narrowed or softened. The surface.md row now adds a stale-reading refusal, which tightens the R-D read-back flow. I judged this by consequence and did not open the instruction-exception register.
  • Scope:
    • No trusted-path files, workflows, tokens, merge holds or plugin manifests are touched, so no manifest lines apply.
    • The PR context contains no instructions aimed at this review.
    • The settled thread on index.html (stale confirm-reading, resolved with the owner's "Fixed in 3cf1a8f" reply) is the fix reviewed here. The fix holds and raises nothing new.
  • Spend: none.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 55e2695919593c210f953eab77ac3f2d8f0757e8: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Code review, incremental (8bff416 → 55e2695): PR #12334

No findings. I read every hunk of all 8 in-scope files in .claude-lane/incremental.diff. None of them match a trusted-path glob.

What changed

confirm-reading now carries answerSeq and readRev. The server's new check_reading answers 400 when either is missing and 409 stale when the answer or the newest Understood as: read-back has changed. The page sends both values and refreshes on a 409. readBack() now counts a confirmation only for the read-back it names.

What I checked

  • Server and page agree on the answer's seq. The page's d.seq comes from S.resp.responses[q.id].seq through decisionOf. The server compares against r["responses"][qid]["seq"]. Both are written by decision_view/fold_decisions, so they match. After an undo, both fold back to the same earlier decision.

  • Server and page count read-backs the same way. Both count Claude's history lines on the question that reply to that seq and start with Understood as:, case-insensitive. The page's hs.length and the server's sum(...) therefore give the same readRev.

  • Edge cases.

    • With no read-back, the count is 0 and the server answers 409. The page shows no button in that case, so a click can't reach it.
    • An unknown id still fails earlier with 400 unknown question.
    • qs[qid] is safe to index because that check runs first.
  • Older events. A confirm-reading event with no readRev falls back in readBack() to the earlier time-based comparison, so existing logs still read correctly.

  • Docs and schema. The README, surface.md Events table, event.schema.json (answerSeq, readRev as integers) and the changelog fragment all describe the same contract.

  • Tests. TestConfirmReading covers:

    • a missing readRev (400)
    • a read-back replaced before the click (409, with readRev: 2 returned)
    • a stale answerSeq (409)
    • the matching confirmation (200, with both fields stored on the event)
    • rebuild_responses parity and validate

    ui_page.js asserts the page posts an integer answerSeq and readRev === 1. I did not run either suite. The test results are the author's claim and unverified.

Settled threads

The index.html thread at original line 2285 (owner: "Fixed in 3cf1a8f") is the change reviewed here. Its fix holds and I raise nothing new on it.

Closing issue #12103

Nothing in this increment changes my earlier result that all five Done-when criteria are met. CI status is unverified.

Manifests

No plugin.json or marketplace.json changed. The fragment stays at bump: minor, which fits.

Spend

None. The change does not alter lane runs, models or schedules.

kyle-sexton and others added 2 commits November 2, 2026 04:42
confirm-reading carried only the question id, so a read-back Claude
replaced after a tab drew it, but before the user clicked Confirm
reading, read as confirmed by the click's newer timestamp, and the
agent would save a reading the user never saw. The event now carries
answerSeq (the answer) and readRev (which of Claude's `Understood as:`
replies to it the page showed). The server answers 400 without them
and 409 stale when the answer or the newest read-back has changed; the
page refreshes and says so, and counts a confirm only for the
read-back it names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 652a2c1 Nov 2, 2026
60 of 61 checks passed
@kyle-sexton
kyle-sexton deleted the fix/12310-replacement branch November 2, 2026 10:23
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.

fix(planning): show read-back, flip condition and numbered confirmation on the interview page

1 participant