Repository navigation
test(consequence): a host denial turns a service-level approval into a decline - #161
Conversation
…a decline Pins review_approval at the service: a task paused at NeedsApproval, approved over ContinueTask, is declined when the host's consequence review denies it; the host is asked once and no run is allowed to act.
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): test(consequence): a host denial turns a service-level approval into a decline. Test-only change that pins service-level behavior for host consequence review: when a task paused at `NeedsApproval` receives `ContinueTask { approve: true }` and the configured consequence host denies the action, the approval becomes a decline and the task ends `Cancelled`. The scripted `FlowRunResult` is constructed with an explicit empty `BTreeMap` for `vars`. The description notes that `RunFlow { allow_destructive: true }` and `RunGoal`'s approval path are intentionally untouched, leaving whether they should also be reviewed as an open owner decision. Review snapshot
Completeness: Complete What changedAdds a new test module `crates/tinycomputer/src/tinybus_module/tinybus_module_tests/consequence_review_tests.rs` and registers it via `mod consequence_review_tests;` in `crates/tinycomputer/src/tinybus_module/tinybus_module_tests.rs`. The test builds a real `DesktopService` with `with_consequence_review` and a deny-only `ConsequencePort`, injects a scripted `FlowRunner` that stops before the "Send" action, and drives `START_TASK` → `AWAIT_TASK` → `CONTINUE_TASK { approve: true }` → `AWAIT_TASK`. No production code is changed. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. 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 |
clippy::default_trait_access under -D warnings.
Summary
Test-only. When the host serves
ConsequenceHost,ContinueTaskasks it to review the action a task is paused on before an approval reaches the task, and a denial turns the approval into a decline (review_approval). The link itself is unit-tested, but nothing exercised it at the service, where the paused action is looked up from the task list. A regression there would let an approved irreversible action run with no host review.This adds a service-level test. A scripted flow runner stops before pressing "Send"; the task pauses at
NeedsApproval;ContinueTask { approve: true }goes through a host that denies. The test asserts the task endsCancelled, the host was asked exactly once about "Send", and no flow run was allowed to act (allow_destructivenever set).Not changed here:
RunFlow { allow_destructive: true }andRunGoal's approval path do not go through this review. Whether they should is an open owner decision, so this PR only pins theContinueTaskpath.Related issue
None.
API or behavior changes
None.
Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check: rustfmt run on the new file 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 new test was run locally (below); CI runs the suiteCARGO_INCREMENTAL=0 cargo test -p tinycomputer --lib -- a_host_denial_turns_an_approval_into_a_declineok. 1 passed; 0 failed.review_approvalmade to return before asking the host (a temporary local break, restored before commit):FAILED,left: Done { answer: "Finished all 2 steps." … } right: Cancelled.Tests
New
tinybus_module_tests/consequence_review_tests.rs::a_host_denial_turns_an_approval_into_a_decline.Documentation
Not needed.
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description