refactor(mcp): route workflow controls through services - #361
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
VERDICT: CHANGES REQUESTED
crates/orchestrator-cli/src/services/operations/ops_workflow/phases.rs:approve_manual_phase—approved_by: lifecycle_actor.as_ref().map(|actor| actor.user_id.clone()).unwrap_or_else(|| protocol::ACTOR_CLI.to_string())records the workflow owner as the approver, even when the documented local-operator path approves an actor-owned workflow. That makes the approval audit claim Alice approved her own gate when a global CLI operator actually did it. REQUIRED CHANGE: keep the persistedlifecycle_actorexclusively for continuation and task-projection partitioning, and pass the actual approving principal intoapprove_manual_phasefromworkflow_phase_approve_application; writeapproved_byfrom the authenticated caller when present andprotocol::ACTOR_CLIfor the actor-less local CLI path. Verify with tests that (a) an actor-bound approval records the authenticated owner'suser_id, and (b) a local actor-less approval of an actor-owned workflow recordsACTOR_CLIwhile the continuation request and task projection still retain the persisted workflow actor.
The typed in-process routing, pre-mutation owner concealment, persisted-actor rehydration for detached continuations, and focused cross-user/cross-tenant tests are otherwise well structured and directly advance TASK-971. CI is currently still pending, with completed checks green so far.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
These lifecycle tools still crossed a child-CLI/argv boundary and could not safely be exposed to a user-scoped Portal application host. Workflow continuations also needed to retain their original user and tenant instead of falling back to global scope.
Impact
The Portal can control an authenticated user's workflows in process without identity downgrade. Cross-user, cross-tenant, unowned, and unknown workflow IDs remain concealed as
not_found.Validation
cargo clippy --workspace --all-targets --locked -- -D warningscargo animus-lintcargo test -p orchestrator-cli --locked -- --test-threads=1(1,428 unit tests plus binary/integration targets)git diff --check