Repository navigation
fix(base): verify pane submission before success - #43
Conversation
A send reported success whenever the text and Enter calls returned without error. A swallowed Enter is exactly that: the text sits staged in the composer, the call succeeds, and the operator is told the message was delivered while it waits to be submitted by hand. Add a reusable verified-submit policy and drive it from the tmux adapter: - Before sending, the composer must be proven safe (bare prompt, or a Codex dim-hint placeholder). A real staged draft is never overwritten. - After Enter, the pane is re-captured and the send only reports submitted when the composer has demonstrably cleared or the turn has visibly started. - At most ONE extra Enter is allowed, and only while the composer still holds exactly the payload we sent. Payload identity compares the framed display rows, so a word-wrapped composer row is recognised as ours. - The result is a tri-state (submitted / not-attempted / not-submitted with a reason) instead of a boolean, and is propagated through the wake and push paths. Text that cannot be verified is reported, never assumed delivered.
Review, Sol 6.1, 2026-10-02Reviewed c77eaca.
Validation: read-only, in-memory reproductions against PR sources and |
Review, Sonnet, 2026-10-03PR 43, fix(base): verify pane submission before success SummaryThe policy module ( CriticalC1. Live driver captures the wrong things: Codex hint panes are never "safe", and the
|
Addresses the review findings on the verified-submission change.
The live driver captured the raw viewport without ANSI (-e), so a Codex
hint placeholder arrived unstyled, classified as real staged text and
refused the send: idle Codex panes were never woken. Both verified-send
captures now use the -J join/padding shape, and the raw one adds -e
(buildVerifiedSendRawCaptureArgs). The fake-driver tests could not see
this because they supplied ANSI independently of the argv.
Composer framing: the last glyph line could be a continuation row that
merely contained a glyph, so a non-empty draft ending in a glyph read as
clean and a retry Enter could be authorised. The composer open is now the
last line whose glyph is at column 0; ambiguous framing fails closed.
Submission proof: a clean composer after Enter no longer counts as proof
on its own. It is accepted only once the payload has been observed staged
or the pane moved from idle to a working turn, so a pane that silently
dropped our keys no longer reports success.
Unverified outcomes (text and Enter sent, delivery unconfirmed) move from
not-attempted to a distinct unverified status, surfaced by the route as
{ ok: false, unverified: true } so the operator is told sent, could not
confirm rather than failed. not-attempted is reserved for unsafe-composer.
Regression tests fail on the pre-fix head (6 of them).
Fixes pushed: all four findings addressed (head now 19c6a46)C1 (Critical, live driver captured the wrong things) - fixed. The raw verified capture had no M1 (unverified sends reported as not-attempted) - fixed. Added a fourth status Sol M-a (composer parsing can read a non-empty draft as clean) - fixed. The composer open is now the last line whose glyph is at column 0; continuation rows are indented, so a draft ending in a glyph is never treated as a fresh open. Sol M-b (clean to clean accepted as submitted) - fixed. A clean composer after Enter now counts as proof only once the payload has been observed staged, or the pane moved from idle to a working turn. Clean to clean with no payload evidence returns Not taken (with reason): the Minors on per-window serialisation (that is the coordinator lock in PR 44, which is the right place), request latency, and the pre-existing "Robin's"/"Quill's" comment lines in the touched file (present before this PR, out of scope for a fix commit; I can raise them separately as a repo-hygiene PR if you want). Evidence on 19c6a46: deck suite 2106 passed / 11 skipped / 96 files; Not tested: no live tmux or live Codex pane was exercised; the Codex hint shape is taken from the existing capture fixtures. A live Codex hint pane would be a good end-to-end check before merge. Review legs on this head: Sonnet + Aggy are being run by Io; a Sol leg on the new head would be welcome. |
Fix review, Sonnet, 2026-10-03PR 43, head 19c6a46 (fixes on top of c77eaca). Earlier review: pr-43-review-sonnet.md. Method: read the diff c77eaca..19c6a46, ran the suites in a throwaway worktree (all 110 verification and tmux tests pass at 19c6a46), then ran the new test file against the c77eaca app code, and wrote ad-hoc probe tests (not committed) for the paths below. Status of the earlier findings
Major1. A genuine submission on a pane whose composer stays visible reports
|
Deck PR 43 Fix Review (Aggy - Independent Review Leg)
1. Scope & ObjectiveAudit follow-up fixes in PR 43 (
2. Findings (Ranked)[Observation / Good Practice] Honest Distinction Between Not-Attempted and Unverified
[Observation / Good Practice] Positive Evidence Tracking Across Verification Cycles
3. Detailed Verification1. C1 - Live Driver Capture Arguments
2. M1 - Unverified Outcome Handling
3. Sol Major 1 - Composer-Open Last-Line Rule
4. Sol Major 2 - Clean-to-Clean Rejection
4. Test Suite & Public Hygiene
|
evaluatePostEnter returned unavailable for a clean or ghost composer before it reached the idle-to-active check, so a real send (Enter submits, composer stays clean with the spinner above) reported unverified. The clean/ghost branch now checks the turn-start signal first, then falls back to payload evidence. Adds a regression pin for the M-a framing case: a draft ending in an indented glyph row must not read as an idle composer, so a send is refused. That case fails on the pre-fix base.
…sion # Conflicts: # packages/deck/app/lib/tmux.server.ts
What
A send reported success whenever the text call and the Enter call both returned without error. A swallowed Enter is exactly that case: the text is staged in the composer, both calls succeed, and the operator is told the message was delivered while it waits for someone to press Enter by hand. For a fire-and-forget push there is nobody to notice.
This PR ports the verified-submit policy and drives it from the tmux adapter.
submittedonly when the composer has demonstrably cleared or the turn has visibly started.submitted/not-attempted/not-submittedwith a reason) rather than a boolean, propagated through the wake and push paths and the send route.Payload identity compares the framed display rows rather than raw text, so a composer row that word-wrapped at the pane edge is still recognised as ours. The verified capture uses
-J(join soft-wraps, keep right padding); the read path's capture shape is untouched.Reviewer notes
packages/deck/app/lib/tmux-submit.tsis the policy and knows nothing about tmux, sessions or storage.tmux.server.tsis the adapter: argv builders, window validation, and theSendKeysDriverseam.sendKeysToWindowandpushMessageToIdleAgentnow return the tri-state.pushMessageToIdleAgent's booleanpushedis gone; the only caller is fire-and-forget.Review legs
check:leaksclean (387 files, 30 rules),check:dashesclean,lib-version-gateclean. The verification suite is 17/17.Not tested
OSS-clean
Public repo. Internal names in the fixtures were replaced with neutral ones; the leak gate is clean on this branch.