Repository navigation
fix(security): fail-closed dispatch for isolated consume final/consume execution - #696
pomazanbohdan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 909f9fc5a0
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| && !dispatch_enabled | ||
| && !allow_external_state_final_blocked_payload | ||
| { | ||
| if consume_dispatch_is_disabled(consume_subcommand, dispatch_enabled) { |
There was a problem hiding this comment.
Preserve read-only consume-final modes when dispatch is disabled
When VIDA_STATE_DIR points to an isolated state root, taskflow_dispatch_enabled_for_state_root always returns false, so this guard now rejects consume final --preview and --validate-only before their arguments are parsed. Those modes are explicitly read-only and skip packet writes, receipt persistence, and dispatch execution, and the removed exception previously allowed them in this exact isolated-root scenario. Restrict the disabled-dispatch guard to execute mode so operators can still inspect and validate a handoff without enabling execution.
Useful? React with 👍 / 👎.
Motivation
vida taskflow consume finalbypass the dispatch-disabled guard when an external (isolated)VIDA_STATE_DIRwas supplied and the current working directory resolved as a project, which could lead to executing a project-configured backend despitetaskflow.dispatch.enabled: false.Description
consume_dispatch_is_disabled(subcommand, dispatch_enabled)that enforces fail-closed semantics for execution-capable subcommands (final,continue,advance).dispatch_runtime_disabledpayload before any state mutation, packet write, or dispatch execution when dispatch is not enabled for the selected state root.crates/vida/src/taskflow_consume.rs(predicate + guard + test) and do not alter other runtime execution paths.Testing
rustfmt --edition 2021 --check crates/vida/src/taskflow_consume.rsand formatting check passed for the modified file. (Passed)cargo test -p vida --bin vida execution_capable_consume_subcommands_fail_closed_when_dispatch_is_disabled -- --nocaptureandcargo test -p vida --bin vida dispatch_defaults_to_management_only_and_requires_boolean_true -- --nocapture, both tests passed. (Passed)cargo check -p vida --bin vidaandgit diff --checkto validate compilation and diff hygiene; these checks succeeded though unrelated compiler warnings exist in other crates. (Passed with unrelated warnings)consume finalpath.Codex Task