Repository navigation
fix(flow): gate post/transfer/checkout/logout/sign and refuse Return before a stop - #155
Conversation
…refuse Return before a stop A flow's click gate only knew a 12-word substring list, so "Post", "Transfer $500", "Checkout", "Log out" and "Sign" were pressed inside an ordinary step with no approval. They are now matched as whole words, with "Sign in" carved out. The confirm shortcut pressed Return on a window even when the flow stops before an irreversible step; in a composer Return sends. It is now refused outside a search box whenever the flow declares a stop_before.
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix(flow): gate post/transfer/checkout/logout/sign and refuse Return before a stop. The pull request gates previously pressable committing controls ("Post", "Transfer $500", "Checkout", "Check out", "Log out", "Sign", "Sign up") by adding a whole-word `COMMITTING_WORDS` list to `destructive_label`, with "Sign in" carved out, and adds a Return-refusal guard in the shortcut branch when a flow declares a `stop_before`. Two regression tests accompany the change. The latest-push delta is unavailable, so no push-delta claims are made. Review snapshot
Completeness: Complete What changed`destructive_label` in `crates/tinycomputer-engine/src/agentic/flow/view/mod.rs` now normalizes the label into space-delimited whole words and consults a new `COMMITTING_WORDS` list (post, transfer, checkout, check out, log out, logout, sign), removing the " sign in " substring before matching, while retaining the pre-existing substring terms for delete/remove/send/purchase/buy/pay/submit/confirm/overwrite/quit without saving/empty trash/sign out. In `crates/tinycomputer-engine/src/agentic/flow/act/moves.rs`, the shortcut branch skips a "return" press with a history entry whenever the flow has a non-empty `stop_before` and the surface is not a search box. The `SHORTCUTS` doc comment in `crates/tinycomputer-engine/src/agentic/flow/act/mod.rs` describes the new refusal. Two regression tests were added: `posting_transferring_checking_out_paying_deleting_logging_out_and_signing_are_destructive` in `crates/tinycomputer-engine/src/agentic/flow/view/view_tests.rs` and `return_is_not_pressed_when_the_flow_stops_before_sending` in `crates/tinycomputer-engine/src/agentic/flow/flow_tests/do_loop_tests.rs`. No API change is claimed. Features
Tests
FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
Summary
A flow decides whether a control is too risky to press inside an ordinary step with a private 12-term substring list. "Post", "Transfer $500", "Checkout", "Check out", "Log out", "Sign" and "Sign up" are on no list, so a
dostep pressed them with no approval. Separately, theconfirmshortcut pressed Return on awindowsurface even when the flow declares it stops before an irreversible step; in a mail or chat composer, Return sends.Fix:
destructive_labelalso matches a fixed set of whole words: post, transfer, checkout / check out, log out / logout, and sign. "Sign in" is carved out. Pay and delete were already covered. Whole-word matching keeps "Postcode", "Design" and "Logo" pressable.stop_before, so the flow has to press a visible control, which goes through the gate. The existing search-box exemption is unchanged.This is the agreed set only. Core
consequence()'s wider Irreversible list (share, publish, invite, replace, discard, …) is deliberately not unioned in.Related issue
None.
API or behavior changes
No API change. Behaviour:
dostep now fail with "refused to press … use stop_before". These controls also drop out of obstacle-clearing, opener, choose, list and suggestion pools.stop_beforeno longer use Return to commit text outside a search box; they press a control instead.Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check— rustfmt run on the touched files only; CI runs the full checkcargo clippy --all-targets --all-features -- -D warnings— left to CIcargo build --all-targets --all-features— left to CIcargo test --all-features— only the two regression tests were run locally (below); CI runs the suiteCARGO_INCREMENTAL=0 cargo test -p tinycomputer-engine --lib -- posting_transferring return_is_not_pressed_when_the_flow_stops0 passed; 2 failed—pressed with no approval: ["Post", "Transfer $500", "Checkout", "Check out", "Log out", "Sign", "Sign up"]and["return"]2 passed; 0 failedTests
view_tests::posting_transferring_checking_out_paying_deleting_logging_out_and_signing_are_destructive: every label in the set is gated; "Sign in", "Sign-in with Google", "Postcode", "Design" and "Logo" are not.do_loop_tests::return_is_not_pressed_when_the_flow_stops_before_sending: a Mail flow that stops before sending never presses Return through the confirm shortcut.Untested edge: the simulator does not model "Return sends", so the second test proves only that Return is not pressed.
Documentation
The
SHORTCUTSdoc comment now describes the new Return refusal. No other docs needed.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description