Skip to content

sminos: bound a raised request's input so one frame can't close the session lane (#149) - #424

Merged
SSFSKIM merged 4 commits into
mainfrom
sminos-raised-bound
Oct 28, 2026
Merged

SSFSKIM merged 4 commits into
mainfrom
sminos-raised-bound

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What

A pending request's tool input went up whole, in DX4's raised and in the complete pending {project, raised} set. The session lane closes once more than 16 MiB is queued unsent (SEND_QUEUE_MAX), on DX2's uplink and on RL10's socket alike. So one Write or Edit of a huge file awaiting approval took the machine's whole session lane down, and the complete set sent at the next connect took it down again.

The daemon now bounds the input where it builds the frame. requests.shown_input is called by raised_draft, which both carriers use (sealed on DX2, a draft on RL10). It reuses the mod's resync rule and marker:

  • A permission's input past RAISED_INPUT_MAX (256 KiB of UTF-8 JSON) has each string held to RESYNC_INPUT_CAP (1,024 UTF-16 units, never splitting a surrogate pair), and the request is marked truncated: true.
  • If the input is still past the bound (many short strings), it goes as {}, marked.
  • A question's input stays whole, as the resync keeps it: its answers are matched against its questions.
  • 256 KiB keeps a string the mod already capped at its TEXT_CAP (65,536 UTF-16 units, at most 192 KiB) whole. 64 such raises in one complete set still fit a lane.

The digest: what it covers, and why that's safe

The card draws a decision's digest {session, request, tool, input_sha256} from the input it was shown: inputSha256(raised.input) in desk-web, with "the input shown was capped" for truncated. The endpoint passes it through unchanged on lane A (link.ts checks only that requestDigest equals args.digest). The one place it is checked is sminos's check_digest, on both carriers, against the request the bridge child holds (GET /requests/<id>, the input its raise carried).

So the digest covers what the viewer was shown, and this keeps that. check_digest now accepts input_sha256 when it is the SHA-256 of the canonical form of either of these:

  1. shown_input(held): the cut form, recomputed from the held request by the same deterministic rule. That is byte for byte what the frame carried, so a legitimate remote answer drawn from a cut input still works.
  2. The held input whole: what went up while it was within the bound, and what a drawer that saw everything can name.

Session, request and tool must still match. Why a viewer shown a cut input can approve only the call the bridge will run:

  • The request id pins one pending call in the session, and the bridge decides by that id.
  • A permission's decision can't carry updatedInput (_check_decision refuses it), so a viewer can never substitute an input.
  • Two held inputs that cut to the same form would have to sit at the same request id. That is one engine tool call, whose input doesn't change. The viewer was told the input was cut, as with the mod's own TEXT_CAP cap today.
  • Accepting the whole input's hash adds no capability: it needs knowledge of the whole input, which is a stronger binding than the cut one.
  • Neither the bridge nor the engine ever sees the cut input. What runs is the engine's own call.

Tests

  • test_policy_requests Requests:
    • A Write past the bound goes cut and marked, sealed (the code verifies) and as an RL10 draft, in its raise and in the complete set. The child holds it whole.
    • check_digest takes the shown form's digest and the whole input's, and refuses another.
    • An input within the bound goes whole; a question past it goes whole; many short strings go as {}.
  • test_rpcs Uplink (DX2 end to end, hub stand-in): two 17 MiB Writes reach the hub cut on the stream they were raised on. One is decided by a remote decide whose digest is drawn from what the hub got, the other by a local sminos decide. The stream never drops.
  • test_rl10 Raised (RL10 end to end, endpoint stand-in): the same over the socket, the remote decide fenced to the bridge's launch.
  • Both end-to-end tests fail on the unfixed daemon: the raise never arrives.
  • Full run-sminos-tests.sh locally: 2568 assertions passed.

Review

One round of doperpowers:reviewer-high, on 218579d..c7d6f5d, reported two findings:

  • [P1] Bind the cut preview to the whole pending input. Dismissed: it contradicts the design intent, for the reasons in the digest section above. The reviewer reproduced it by re-raising one request id with a different input past the cut, and an old card's digest still passed. That needs the held input to change under one request id while it is pending, and the real mod never does that. An id is one engine call (tool_use_id, or the mod's minted request-<ts>-<n>), whose input the engine fixes. The decision applies to that call, never to the held copy. The {} fallback aliases only within that one call. The ticket names "covers what the viewer was shown" as the rule to keep, and that is the rule the decision path already used: the held copy was capped at the mod's TEXT_CAP before this change too. A commitment to the whole input alongside the preview would need a raised field the card hashes, a protocol change on MAWS's side (desk-web, the endpoint's lane A). It is proposed as a follow-up below.
  • [P2] A complete pending set can still pass the lane's bound. Real; logged as residue. The set carries every request pending in a project, so some sixty requests at the bound at once still pass 16 MiB. The comment that claimed otherwise is corrected (57726e3). A real bound on the set needs a set that can go in parts or by reference, which is a protocol change.

Residue (not fixed)

  • A project's complete pending set is bounded only by its count of pending requests × 256 KiB (P2 above).
  • Hardening, proposed as a ticket: carry a commitment to the whole held input in raised, and have the card's digest name it, so that a held input changing under one request id is caught even past the cut (P1 above). This is MAWS's side and a protocol change.

sminos 1.27.2 (after #152's 1.27.1).

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

… carriers

A pending request's tool input went up whole in DX4's `raised` and in the
complete `pending` set. The session lane ends when more than 16 MiB is
queued unsent, on DX2's uplink and on RL10's socket alike, so one Write
of a huge file awaiting approval took the machine's whole session lane
down, and the complete set sent at the next connect took it down again.

The daemon now bounds the input where it builds the frame
(`requests.shown_input`, used by `raised_draft` for both carriers): a
permission's input past RAISED_INPUT_MAX (256 KiB of UTF-8 JSON) is cut
by the mod's resync rule, each string held to RESYNC_INPUT_CAP (1,024
UTF-16 units, never splitting a pair), and marked `truncated`. If it is
still past the bound (many short strings), it goes as {}. A question's
input stays whole, as the resync keeps it, because its answers are
matched against its questions.

The decision's digest is drawn by the card from the input it was shown,
so `check_digest` now accepts the SHA-256 of that shown input,
recomputed from the request the bridge holds by the same deterministic
rule, or of the whole input. Session, request and tool must still match,
a permission's decision carries no updatedInput, and the bridge decides
by request id. So a viewer shown a cut input can approve only that
pending call, whose shown form is what it saw.

Tests: test_policy_requests (the frame, the set, sealed and as a draft,
the digests); test_rpcs Uplink (DX2 through the hub stand-in, decided
remotely and by `sminos decide`, no reconnect); test_rl10 Raised (RL10
through the endpoint stand-in, the same). Both end-to-end tests fail on
the unfixed daemon: the raise never arrives.

sminos 1.27.1.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers 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-28T09:20:11.418532Z c7d6f5d 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.

Review: the bound holds one raise; a project's complete pending set
carries every request pending in it, so it can still pass a lane's
16 MiB with some sixty requests at the bound at once. The comment no
longer claims otherwise.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 71371af into main Oct 28, 2026
9 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