Repository navigation
feat(budget): make the turns a do step may spend a budget field - #154
YellowSnnowmann wants to merge 1 commit into
Conversation
A `do` step failed after eight turns, a constant no caller could change. On a cluttered page a planned step often needs more moves than that, and the whole run is already capped by `max_actions`, so the per-step limit mostly decided how early a long step was given up on. `max_step_turns` now travels with the budget: `TaskBudget.max_step_turns` on `StartTask` (8 when unset; a cap on each `do` step the task runs, not a pool it spends, so every run of the task gets it whole) and `RunFlowRequest.max_step_turns` on `RunFlow` (default 8, clamped to 1..=120, `MAX_STEP_TURNS`, the run's own action ceiling). The `do` loop reads the run's value where it read `DO_TURNS`; the failure note keeps naming the number the step was given. Contract 2.26 -> 2.27, an optional field. The pinned version tests, the `Describe` schema, the skill's `start_task.schema.json` and the docs follow.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
Tiny Sweeper reviewVerdict: Incomplete · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): feat(budget): make the turns a do step may spend a budget field. Tiny Sweeper completed its review; deterministic results follow. Unreviewed paths
Partial review reasons
Review snapshot
Completeness: Incomplete Features
Tests
FindingsNo active actionable findings. Before merge
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Summary
A
dostep fails after eight turns, a constant (DO_TURNS) no caller could change. On a cluttered shop page (location prompts, banners, a search, a results list to scroll) a planned step often needs more moves than that, and every run of such a task ends innot accomplished after 8 turns, then burns its rescues on re-planning the same step. The whole run is already capped bymax_actions, so the per-step limit mostly decides how early a long step is given up on.This makes the limit a budget field,
max_step_turns, with the default unchanged:TaskBudget.max_step_turns: Option<u32>onStartTask: 8 when unset. It caps eachdostep the task runs (a planned step's, a recipe's, a rescue's) rather than being spent down likemax_actions, so every run of the task gets it whole.RunFlowRequest.max_step_turns: u32onRunFlow: default 8, clamped by the engine to1..=120(MAX_STEP_TURNS, the run's own action ceiling, since a turn makes at most a move or two). A step always gets at least one turn.doloop reads the run's value where it readDO_TURNS; the failure note keeps naming the number the step was given.Contract
2.26→2.27(an optional field), with the pinned version tests, theDescribeschema, the skill'sstart_task.schema.jsonand the docs updated.Related issue
None. Found running free-form purchases (Blinkit, Zepto, Flipkart) through the in-process engine, where every long step stopped at eight turns.
API or behavior changes
budget.max_step_turnsonStartTaskandmax_step_turnsonRunFlow, both defaulting to 8, the limit that was hard-coded. A caller that sends nothing sees no change.(2, 27): a 2.27 host no longer binds a 2.26 module, which would ignore the field and give every step eight turns.DO_TURNSis gone from the engine (it was private);MAX_STEP_TURNS = MAX_ACTIONStakes its place as the ceiling.Not breaking.
Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check: cleancargo clippy -p tinycomputer-bus -p tinycomputer-engine -p tinycomputer-skills --all-targets --all-features -- -D warnings: clean. The full--all-targets --all-featuresrun on this Mac stops intinycomputer-accessibilityon four lints in macOS-only code (focus.rs,paste.rs,permissions.rs, untouched here; the same onmain, which the Linux CI never compiles)cargo test -p tinycomputer-engine --all-features --lib: 555 passed, 0 failedcargo test -p tinycomputer-bus --all-features(unit and doc tests): 246 + 34 passed;cargo test -p tinycomputer --all-features --test public_api_tests: 10 passed;cargo test -p tinycomputer-skills --all-features: 4 passedcargo test -p tinycomputer-bus: 280 passed;cargo test -p tinycomputer-engine --lib -- budget_tests do_loop_tests::a_do_step approval_tests describe_tests start_tests: 27 passedRUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps: cleancargo build --all-targets --all-featuresand the wholecargo test --all-features(examples, e2e, feature lanes): not run here; this PR's CI runs themTests
tinycomputer-bus:step_turns_pin_their_wire_form(set, unset, and serialized), theRunFlowRequestdefault now pinsmax_step_turns: 8, and the contract version tests pin(2, 27)and refuse(2, 26).tinycomputer-engine, flow:a_do_step_spends_the_turns_the_request_gives_itruns a settled step with 3, 12 and 0 turns asked and checks the turns spent (3, 12, 1) and the failure note;a_step_gets_the_turns_asked_for_within_the_action_ceilingchecks the clamp (8 → 8, 0 → 1, 1000 → 120).tinycomputer-engine, task: the start test pins the request's default (8); the approval-resume test setsmax_step_turns: 20and checks every run of the task gets 20 (it is a cap per step, not spent); theDescribeschema test covers the new field.tinycomputer: the public API test pins(2, 27).Documentation
docs/technical/specs/desktop-module-contract.md(2.27),docs/crates/tinycomputer-bus/{versioning,flows,agent-and-tasks}.md,docs/crates/tinycomputer-engine/{tasks.md,flow/budgets-and-switches.md,flow/the-do-loop.md},docs/crates/tinycomputer-skills/walking-the-schemas.md,docs/giving-it-a-task.md,docs/technical/{tasks,decision-loops,decision-thresholds}.md, the bus README and the flow module README.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description