Station v0.71 Team Job can mark a workflow as successfully completed even though the workflow is still waiting for Team approval and no external effect has executed.
Confirmed execution path:
- workflow_engine.run_workflow() reaches the Team approval gate before the external module effect.
- When approval is pending, run_workflow() correctly returns:
ok: false
outcome: AWAITING_TEAM_APPROVAL
No external effect executes at this point.
- routes/dispatch_workflow.py then returns the HTTP DAG response with:
ok: true
unconditionally, instead of propagating res["ok"].
- routes/team.py consumes that HTTP response and interprets it as successful execution.
- primitives/team_jobs.py sees body.ok == true and transitions the Team Job to:
done
Actual result:
A Team Job can be recorded as done while the underlying workflow outcome is AWAITING_TEAM_APPROVAL and billing has not executed.
Expected result:
AWAITING_TEAM_APPROVAL must not be reported as successful completion.
The HTTP DAG response should preserve the workflow engine result, and the Team Job should remain in an appropriate waiting/pending state until approval is granted and execution actually continues.
Root cause:
The DAG HTTP route does not propagate the workflow engine's ok value.
The response currently reports ok:true even when run_workflow() returned ok:false.
Relevant execution path:
workflow_engine.py::run_workflow()
→ Team approval gate
→ AWAITING_TEAM_APPROVAL / ok:false
→ routes/dispatch_workflow.py
→ HTTP response ok:true
→ routes/team.py
→ primitives/team_jobs.py
→ job status done
Suggested fix:
Propagate the workflow result from the DAG route, e.g.:
"ok": res["ok"]
and ensure AWAITING_TEAM_APPROVAL / BLOCKED_BY_TEAM_APPROVAL are mapped to non-terminal Team Job states rather than done.
Impact:
Remote Team Jobs can present a false successful-completion state before the governed external action has occurred. A caller/operator may therefore believe a job completed successfully when it is actually waiting for approval and has performed no billing action.
Confirmed against Station v0.71 source and execution-path testing.