8000 fix(base): verify pane submission before success by simon-inkie · Pull Request #43 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content

fix(base): verify pane submission before success - #43

Merged
simon-inkie merged 4 commits into
mainfrom
fix/verified-submission
Oct 4, 2026
Merged

simon-inkie merged 4 commits into
mainfrom
fix/verified-submission

Conversation

@simon-inkie
Copy link
Copy Markdown
Owner

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.

  • Before sending, the composer must be proven safe: a bare prompt, or a Codex dim-hint placeholder. A real staged draft is never overwritten.
  • After Enter, the pane is re-captured. The send reports submitted only when the composer has demonstrably cleared or the turn has visibly started.
  • At most ONE extra Enter, and only while the composer still holds exactly the payload we sent. That is the swallowed-Enter case, where the text is sitting in the prompt, so a second Enter is safe and a blind one is not.
  • The result is a tri-state (submitted / not-attempted / not-submitted with 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.ts is the policy and knows nothing about tmux, sessions or storage. tmux.server.ts is the adapter: argv builders, window validation, and the SendKeysDriver seam.
  • The one behaviour change to an existing export: sendKeysToWindow and pushMessageToIdleAgent now return the tri-state. pushMessageToIdleAgent's boolean pushed is gone; the only caller is fire-and-forget.
  • A wrong outcome here says "delivered" when it was not, which is the failure the policy exists to prevent. The suite pins swallowed Enter, delayed submit, duplicate prevention, composer-change, exhaustion, word-wrapped identity, and the unsafe-composer no-op.

Review legs

  • Remote CodeRabbit unavailable (subscription, 2 Oct). Not treated as a clean review.
  • Peer reviewer: pending, cross-lane.
  • Independent model-diverse check: pending. The send path touches live panes, so this one wants a careful second read.
  • Suites: deck 2098 passed / 11 skipped (96 files), typecheck clean, check:leaks clean (387 files, 30 rules), check:dashes clean, lib-version-gate clean. The verification suite is 17/17.

Not tested

  • No live tmux server; the driver seam is exercised through a fake driver, exactly as the policy intends. The argv builders are unit-pinned separately.
  • No e2e browser run.

OSS-clean

Public repo. Internal names in the fixtures were replaced with neutral ones; the leak gate is clean on this branch.

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.
@simon-inkie
Copy link
Copy Markdown
Owner Author

Review, Sol 6.1, 2026-10-02

Reviewed c77eaca.

  • Major — packages/deck/app/lib/tmux.server.ts:602: Composer parsing selects the last line containing ❯ or ›, including payload continuation lines. Reproduced a non-empty draft ending with ❯ being classified clean. This permits sending into an existing draft and falsely confirms submission afterwards. A continuation containing ❯ <payload> can also hide preceding text from the identity check, authorising an unsafe extra Enter. Add adversarial glyph fixtures.

  • Major — packages/deck/app/lib/tmux.server.ts:247: The live “raw” capture uses buildVerifiedSendCaptureArgs, which lacks -e. ANSI dim styling therefore disappears, so normal Codex placeholder composers are classified staged and sends are refused. The fake driver supplies ANSI independently and masks this regression. Preserve styling and test the live argv.

  • Major — packages/deck/app/lib/tmux-submit.ts:111: Any clean post-Enter snapshot proves “composer-cleared”, although the payload was never observed in the composer. Reproduced clean → successful transport calls → clean returning submitted without an activity transition. A TUI that ignores or delays input is indistinguishable from delivery. Require evidence tied to the payload; the current clean → clean test enshrines this false positive.

  • Major — packages/deck/app/lib/tmux-submit.ts:163: Post-send uncertainty returns not-attempted after text and one or two Enters have already been sent. Reproduced this with a busy composer still holding the payload. This contradicts the tri-state contract and can encourage duplicate sends by callers treating that status as untouched. Reserve it for failures before sending; represent attempted-but-unverified outcomes explicitly.

Validation: read-only, in-memory reproductions against PR sources and git diff --check. Did not run Vitest, the full suite, or live tmux/TUI integration. No new public-information leaks or unrelated scope expansion found.

@simon-inkie
Copy link
Copy Markdown
Owner Author

Review, Sonnet, 2026-10-03

PR 43, fix(base): verify pane submission before success
Head SHA reviewed: c77eaca
Verdict: NEEDS CHANGES (1 Critical, 1 Major)

Summary

The policy module (tmux-submit.ts) is well structured: baseline must be proven safe, at most one extra Enter, only while the composer positively holds our payload, fail-closed on unrecognised framing. The tri-state is a good idea. The defect is in the adapter: the live driver does not capture what the classifier needs, so the real tmux path diverges from the fake-driver tests that exercise the policy.

Critical

C1. Live driver captures the wrong things: Codex hint panes are never "safe", and the -J capture is effectively unused

packages/deck/app/lib/tmux.server.ts:244-250 (LIVE_SEND_KEYS_DRIVER), :266-269 (captureSendSnapshot), :385-387 (buildVerifiedSendCaptureArgs), :455-461 (composerLineIsDimHint).

captureSendSnapshot calls driver.captureViewport(session, window, false) for plain and (…, true) for raw, then classifyPaneSnapshot(plain, raw). The live driver maps raw === true to buildVerifiedSendCaptureArgs, which is capture-pane -p -J with NO -e, and maps raw === false to the ordinary buildCaptureViewportArgs (-p, no -J). Consequences:

  1. composerLineIsDimHint(raw) looks for the ANSI dim SGR (\x1b[2m). A capture without -e contains no escapes, so a Codex dim-hint placeholder is never recognised as a ghost. The composer classifies as staged (the hint text), the baseline check returns not-attempted / unsafe-composer, and nothing is ever sent to an idle Codex pane. This silently disables live wake and manual send for Codex, the common case, since the pre-gate paneAcceptsSendLive (which uses the real -e capture) passes and then the second gate rejects.
  2. The classifier decodes the composer from plain, which is not the -J capture, so soft-wrap joining and right-padding preservation (rightPadded) never take effect on the live path. The identity check then runs with rightPadded always false, which weakens the "app-drawn row boundary versus real whitespace" reasoning the module comment depends on.

The tests miss this because fakeDriver returns a hand-written raw string containing \x1b[2m regardless of what argv the live driver would produce, and buildVerifiedSendCaptureArgs is only pinned as a pure function, not as the thing the driver uses.

Fix: give the driver two honest captures and use the same -J shape for both:

export function buildVerifiedSendCaptureArgs(s: string, w: string): string[] {
  return ["capture-pane", "-t", `=${s}:=${w}`, "-p", "-J"];
}
export function buildVerifiedSendRawCaptureArgs(s: string, w: string): string[] {
  return ["capture-pane", "-t", `=${s}:=${w}`, "-p", "-J", "-e"];
}
// driver:
captureViewport: (s, w, raw) =>
  runTmux(raw ? buildVerifiedSendRawCaptureArgs(s, w) : buildVerifiedSendCaptureArgs(s, w)),

Add a test that drives LIVE_SEND_KEYS_DRIVER.captureViewport through an injectable runTmux and asserts -e is present for the raw call and -J for both. Also move the comment added above buildCaptureViewportArgs (lines 355-358, which describes -J on a function that does not use it) onto the new builder.

Major

M1. Unverified sends are reported to the operator as failures although the text was typed and Enter pressed

tmux-submit.ts:152-164 (unconfirmedResult), api.tmux-send.tsx (the new mapping), tmux.server.ts wakeIdleAgent.

verification-unavailable, busy-queue-pending and composer-changed are returned as status: "not-attempted" after the text AND an Enter have already been sent (enterAttempts: 1). The route collapses everything but submitted to { ok: false, error }, so the UI says the send failed while the message is probably sitting in a busy Claude pane's queue or already submitted. The operator resends and the agent gets a duplicate; this is the same class of wrong "delivered / not delivered" answer the PR exists to remove, just in the other direction. not-attempted is also a misnomer for these.

Fix: make the type say what happened. Either a fourth status unverified (text and Enter sent, outcome unknown) reserved for those three reasons, or keep not-submitted, and have the route return { ok: false, unverified: true, error } so the client can word it as "sent, could not confirm". Reserve not-attempted for unsafe-composer (nothing typed).

Minor

  1. Behaviour change in the manual send route: api.tmux-send used to send to any live window; it now refuses unless the composer is clean or a ghost. Intended per the PR ("a real staged draft is never overwritten"), but it also blocks deliberate sends to a shell pane. State it in the route comment and the operator-facing error text.
  2. evaluatePostEnter treats clean as proof of submission. If sendText succeeded at the tmux layer but the keys were dropped by the app, the composer is still clean and the send reports submitted. Cheap hardening: require the first Enter to be preceded by a capture showing the payload staged (it is already decoded, so a pre-Enter check costs one more capture), or accept the residual risk in the docs.
  3. No per-window serialisation. The baseline check makes a second concurrent push refuse safely if the first is staged, but two pushes can both pass baseline within the same 250 ms before either types. A small per-window in-process mutex (Map<string, Promise<void>>) removes the interleave.
  4. classifyPaneSnapshot returns unknown when the composer framing does not match (for example Codex multi-line wrapping with a different continuation indent). After Enter, unknown plus active is accepted as turn-started, which can confirm a send whose text is still staged in a layout we cannot decode. Prefer treating unknown composer as unverified unless baseline was idle and the payload text is gone from the composer region.
  5. Request latency: the route now awaits up to roughly 250 + 750 ms plus a second round on retry, with execFileSync capture calls. Fine for now; note it blocks the event loop per capture.
  6. If PR 41 also lands, findPromptLineIndex / composerTextFromViewport inherit its includes(">") weakness (see PR 41 M1, M2); sequence the merges.

Nit

  • Pre-existing comments in the touched file name internal people and merge requests (for example "Robin's is off", "Quill's call", "!42"). Out of scope for this diff but present in a public repo.
  • Stray blank line after the moved comment at buildCaptureViewportArgs.

Security

execFileSync with an argv array, window validated by WINDOW_NAME_RE and a live allowlist, send-keys -l -- for payload. No injection path found. Retry Enter is gated on exact payload identity and fails closed for paste placeholders.

Tests would fail without the change

The 17 policy tests would, since the module is new. They do not exercise the live driver (see C1), so a green suite says nothing about the real tmux path.

Public-repo hygiene

Diff is clean (fixtures use agent-a). No /home paths, secrets or plan mentions.

Did not check

  • No live tmux session; claims about Claude queueing behaviour while busy and Codex rendering are taken from the code comments.
  • Did not run the suite or typecheck.
  • Did not read every case in tmux-send-verification.test.ts line by line; I read the driver wiring and the Codex dim-hint case.

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).
@simon-inkie
Copy link
Copy Markdown
Owner Author

Fixes pushed: all four findings addressed (head now 19c6a46)

C1 (Critical, live driver captured the wrong things) - fixed. The raw verified capture had no -e, so ANSI dim styling was gone and a Codex hint placeholder read as real staged text: idle Codex panes were refused. Both verified-send captures now use the -J join/padding shape, and the raw one adds -e via a new buildVerifiedSendRawCaptureArgs; the driver uses them for the plain and raw calls. The fake driver had masked this because it supplied ANSI independently of the argv; the builders are now pinned directly (raw has -e and -J, plain has -J and no -e).

M1 (unverified sends reported as not-attempted) - fixed. Added a fourth status unverified for verification-unavailable, busy-queue-pending and composer-changed (text and Enter already sent). not-attempted is now reserved for unsafe-composer (nothing typed). The route returns { ok: false, unverified: true, error } and the compose UI words it "sent, could not confirm", keeping the text in the box so the operator checks rather than blind-resends.

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. composerIsClean fails closed when the last glyph line is not a composer open. Adversarial fixtures added (draft ending in an indented glyph; a continuation row hiding the payload), both of which must not read clean and must not authorise a retry Enter.

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 unverified instead of submitted. Added tests: clean to clean unverified; clean to staged(payload) to clean still submitted; idle to active still submitted.

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; pnpm typecheck clean; leak-gate.mjs clean (387 files); lib-version-gate.mjs clean. Revert-to-red verified: 6 of the new/updated cases fail on the pre-fix head (C1 raw builder, M-a continuation-hides-payload, M-b clean-to-clean, plus the three unverified-status assertions).

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.

@simon-inkie
Copy link
Copy Markdown
Owner Author

Fix review, Sonnet, 2026-10-03

PR 43, head 19c6a46 (fixes on top of c77eaca). Earlier review: pr-43-review-sonnet.md.
Verdict: NEEDS CHANGES (1 Major, 2 Minor)

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

Finding Status
C1 live capture shape Fixed in code. LIVE_SEND_KEYS_DRIVER now maps raw to -p -J -e and plain to -p -J (tmux.server.ts, captureViewport in the driver, buildVerifiedSendRawCaptureArgs). Test only pins the pure builders, see Minor 1.
M1 unverified status Fixed. New unverified status for verification-unavailable, busy-queue-pending and composer-changed; not-attempted is now only unsafe-composer. Route returns {ok:false, unverified:true, error}; TmuxPane word it as "may still submit".
Ma composer open at column 0 Fixed. Probe: a draft one then a continuation row ❯ now classifies staged with text one\n❯ (it read clean before). composerIsClean requires the last glyph line to equal the column-0 open line.
Mb clean-to-clean Fixed in the narrow sense (clean, clean, clean now gives unverified), but it introduced Major 1.

Major

1. A genuine submission on a pane whose composer stays visible reports unverified

packages/deck/app/lib/tmux-submit.ts, evaluatePostEnter, the clean || ghost branch (about lines 146-153 at 19c6a46).

The branch returns confirmed only if payloadSeen, otherwise unavailable, and returns early. The idle -> active check (turn-started) sits below it and is therefore reachable only when the composer is unknown. The comment ("or that a turn visibly started (handled below)") is wrong for the clean and ghost cases.

Real Claude and Codex panes keep the composer drawn while a turn runs, so the usual success is: Enter submits instantly, the composer is clean, a spinner is above it. Probe at 19c6a46: baseline ❯ idle, then Working... (2s · 10 tokens) above ❯ repeatedly, result {"status":"unverified","reason":"verification-unavailable"}. The only way to reach submitted on the live path is for a poll to catch the payload staged after Enter, or for the spinner frame to have no glyph line at all.

Effects: the operator is told "may still submit" for almost every good send; pushMessageToIdleAgent callers get unverified for delivered messages; callers that treat non-submitted as a reason to resend or alert will duplicate. This is the false-negative mirror of the original bug, and it is on the common path.

The test "still confirms via an idle -> active turn transition" does not catch it: its frame (Working... (2s ...)) has no prompt glyph, so the composer is unknown, which is not what a live pane looks like.

Fix: in the clean/ghost branch, return confirmed / turn-started when !baselineWasActive && snapshot.activity === "active", before the payloadSeen test. Add a test with a spinner above a still-visible clean ❯ composer (and a Codex ghost variant).

Minor

  1. The C1 tests pin buildVerifiedSendCaptureArgs and buildVerifiedSendRawCaptureArgs as pure functions only. Nothing fails if the driver is rewired back to the wrong builder, which is exactly how C1 happened. The earlier review asked for a test that drives the driver's captureViewport through an injectable runner; not done. (The Codex dim-hint classification test is sound but uses a hand-written raw string.)
  2. composerLineIsDimHint still uses findPromptLineIndex (glyph anywhere) on the raw capture, not the column-0 open line. Probe: plain ❯ my draft, border, statusline ctx › foo with the › wrapped in dim SGR in the raw capture classifies as ghost, so a real draft can read as a safe ghost and be typed over. Pre-existing, needs a dim glyph in a line below the composer, but it is the same class as Ma and the fix did not extend to the raw path. Also, a statusline line starting at column 0 with a glyph becomes the "open" line (› model below a clean composer classified staged, text model); that fails closed, which is acceptable.
  3. Ma test 1 ("a draft ending in an indented glyph is NOT clean") passes on the pre-fix head (the row line two ❯ fails the bare-prompt regex anyway), so it does not pin the fix. The real hole is a continuation row that is only the glyph ( ❯); test 2 does fail pre-fix, but it asserts composerHoldsPayload, not the clean/ghost classification. Add the bare ❯ row as a classify assertion.

Nit

  • findComposerOpenIndex doc says "first non-space token"; the code requires column 0 (the in-body comment is right). Align the doc.
  • composerTextFromViewport still locates the glyph with includes, fine given the open index, but startsWith would read clearer.

Tests against the pre-fix head

Ran the new test file against c77eaca app code: 6 fail (busy-pane, multiline identity, tri-state, C1 argv, Ma test 2, Mb clean-clean). They discriminate except as noted in Minor 3. The unverified-status expectation changes are exercised by the failing tri-state test.

New false-success paths

None found: submitted now requires payload seen staged or a turn-started on an unknown composer. The defect is the opposite direction (Major 1). The retry Enter path is unchanged and still gated on payload identity.

Public-repo hygiene

Diff has no absolute home-directory paths or agent names (fixtures use agent-a).

Did not check

  • No live tmux session; Claude and Codex real rendering is assumed from code comments and fixtures.
  • Did not run the typecheck or lint, only vitest.
  • Did not re-read the unchanged parts of the PR (route gating, ROSTER allowlist) beyond the diff.
  • Did not test TmuxPane in a browser.

@simon-inkie
Copy link
Copy Markdown
Owner Author

Deck PR 43 Fix Review (Aggy - Independent Review Leg)

  • Target: inkie-deck (origin/d2fix/verified-submission)
  • Commit: 19c6a4608ea8b20001e2ab2292892d4f379cdbf2 (vs previous head c77eacafea8075a530349b4b0bfb32eb81eb4375)
  • Review File: pr-43-fix-review-aggy.md
  • Verdict: PASS

1. Scope & Objective

Audit follow-up fixes in PR 43 (fix(base): capture honest evidence for verified send):

  1. C1: Verify the live driver captures honest arguments with -e for raw and -J for both plain and raw captures.
  2. M1: Verify unverified sends are reported as a distinct unverified status rather than not-attempted / generic failure.
  3. Sol Major 1 (Composer-Open Last-Line Rule): Verify continuation rows containing prompt glyphs cannot cause dirty drafts to read as clean.
  4. Sol Major 2 (Clean-to-Clean No Longer Proof): Verify clean composer state after Enter is only accepted with positive evidence that the payload was staged or turn started.
  5. Hygiene: No internal paths in the public repository diff or review file.

2. Findings (Ranked)

[Observation / Good Practice] Honest Distinction Between Not-Attempted and Unverified

  • Location: packages/deck/app/lib/tmux-submit.ts:38-55,187, packages/deck/app/routes/api.tmux-send.tsx:28-35
  • Detail:
    • not-attempted is now strictly reserved for reason: "unsafe-composer" (where nothing was typed).
    • When text and Enter were dispatched but delivery could not be confirmed (verification-unavailable, busy-queue-pending, composer-changed), the result reports status: "unverified".
    • The API route translates this to { ok: false, unverified: true, error }, and TmuxPane.tsx displays "sent, could not confirm".
  • Assessment: Eliminates operator confusion and duplicate resends.

[Observation / Good Practice] Positive Evidence Tracking Across Verification Cycles

  • Location: packages/deck/app/lib/tmux-submit.ts:119-156
  • Detail: The VerificationEvidence = { payloadSeen: boolean } structure tracks whether the exact payload was observed staged in the composer. If a pane silently drops keys, leaving the composer clean throughout, evaluatePostEnter refuses to classify it as composer-cleared.
  • Assessment: Eliminates false-positive confirmations on dropped keystrokes.

3. Detailed Verification

1. C1 - Live Driver Capture Arguments

  • Files: packages/deck/app/lib/tmux.server.ts:245-250,385-397
  • buildVerifiedSendCaptureArgs passes ["capture-pane", "-t", ..., "-p", "-J"].
  • buildVerifiedSendRawCaptureArgs passes ["capture-pane", "-t", ..., "-p", "-J", "-e"].
  • LIVE_SEND_KEYS_DRIVER.captureViewport now uses buildVerifiedSendRawCaptureArgs when raw === true and buildVerifiedSendCaptureArgs when raw === false.
  • Both captures benefit from -J (soft-wrap joining and right-padding preservation), and the raw capture preserves ANSI styling (\x1b[2m dim SGR), ensuring Codex hints evaluate as ghost rather than staged.
  • Verified in packages/deck/test/tmux-send-verification.test.ts:353-376.

2. M1 - Unverified Outcome Handling

  • Files: packages/deck/app/lib/tmux-submit.ts, packages/deck/app/routes/api.tmux-send.tsx, packages/deck/app/components/TmuxPane.tsx
  • The type definition for SendKeysResult cleanly partitions:
    • status: "submitted"
    • status: "not-submitted"
    • status: "not-attempted" (reason: unsafe-composer)
    • status: "unverified" (reasons: verification-unavailable, busy-queue-pending, composer-changed)
  • Verified in packages/deck/test/tmux-send-verification.test.ts:180-196,335-348.

3. Sol Major 1 - Composer-Open Last-Line Rule

  • Files: packages/deck/app/lib/tmux.server.ts:461-487,526
  • findComposerOpenIndex requires the prompt glyph to be at column 0 (line.startsWith(g)).
  • composerIsClean guards if (promptIndex !== findComposerOpenIndex(lines)) return false;.
  • If an agent's multi-line draft ends with an indented line that contains a prompt glyph (e.g. line two ❯), findPromptLineIndex and findComposerOpenIndex disagree, and composerIsClean fails closed.
  • Verified in packages/deck/test/tmux-send-verification.test.ts:378-414.

4. Sol Major 2 - Clean-to-Clean Rejection

  • Files: packages/deck/app/lib/tmux-submit.ts:119-156
  • When snapshot.composer === "clean" || snapshot.composer === "ghost", evaluatePostEnter checks evidence.payloadSeen.
  • If the payload was never seen staged, it returns { kind: "unavailable" }, yielding { status: "unverified", reason: "verification-unavailable" }.
  • Verified in packages/deck/test/tmux-send-verification.test.ts:416-443.

4. Test Suite & Public Hygiene

  • Unit tests in packages/deck/test/tmux-send-verification.test.ts cover all 4 findings with explicit assertions (including negative cases).
  • Public-repo hygiene: Zero internal paths, credentials, or private identifiers in commit diff or review documentation.

Simon added 2 commits October 4, 2026 14:46
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
@simon-inkie
simon-inkie merged commit 146b224 into main Oct 4, 2026
4 checks 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

0