Repository navigation
send_input: drop the screen cross-check; cut tests_forged.rs to parser robustness - #73
Conversation
… to parser robustness Pane programs are inside the trust boundary (docs/adr/trust-model.md), so a status that says idle or done is no longer checked against the screen. Removes the cross-check in send_text_within and screen_shows_permission_dialog, the extra scripted read step in the tool flows, and the tests of the removed check. tests_forged.rs keeps the OSC 7501 parser robustness tests (split, huge, alternate screen). refuse_when_blocked is unchanged. Verified on macmini and p1: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (483 unit tests plus integration tests incl. tool_schema_snapshot, snapshot unchanged): all pass.
|
Important CHANGES REQUESTED What This PR Does
How It Works
Findings
Finding Details🟡 F1: #62 is reopened with no recorded decision on genuine racesAfter this PR, a pane whose status is The ADR's own decision test (keep a mitigation if it stops "a real field bug ... backed by a measurement") supports removal as long as no such race has been measured. We could not find a measurement either way. The #69 tests forged the OSC output and do not show a genuine-agent race. Requested change (any one is enough):
Optional: add a neutral test that pins the new behavior (status 🟡 F2: Deleted tests cover parser behavior, not only forgeryMost of the removed tests check the OSC 7501 parser and pane-state accounting, which still apply under the trust model. Removed with no replacement:
Elsewhere in the tree, only Requested change: restore these tests under neutral names in a parser-focused file. Suggested names: 🟢 F3: Blocked-state guard intact
🟢 F4: Smaller hot path, clean removalEvery Baseline Check
What's Good (🟢)
5. Three Reasons We Might Not Need This PR
|
Summary
send_inputno longer reads the screen. The check that refused a send when a pane reported idle or done while a permission dialog was on screen is removed, together withscreen_shows_permission_dialog. Pane programs are inside the trust boundary (seedocs/adr/trust-model.md), and status forgery is not a security boundary.refuse_when_blockedand its tests are unchanged.read_okstep is removed from the tool flows, and the tests of the removed check are deleted.src/native/tests_forged.rsgoes from 628 to about 80 lines and keeps the OSC 7501 parser robustness tests: split at every byte, huge or unterminated body with bounded memory, and alternate screen.Diff
git diff --shortstat origin/main...HEAD: 3 files changed, 30 insertions(+), 733 deletions(-)Test record
On both macmini and p1:
cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo testall pass (483 unit tests plus integration tests).tool_schema_snapshotis green and its snapshot is unchanged.