Skip to content

feat(orchestration): record the workflow phase a swarm was started from - #213

Merged
trvon merged 1 commit into
feat/orchestration-item-rowsfrom
feat/orchestration-workflow-phase-link
Nov 20, 2026
Merged

trvon merged 1 commit into
feat/orchestration-item-rowsfrom
feat/orchestration-workflow-phase-link

Conversation

@trvon

@trvon trvon commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Classification

Feature expectation. Phased fan-out is a workflow whose states each run a swarm; nothing tied a swarm to the phase it was started from.

Contract

  • A batch created while its session holds a live claim on exactly one active workflow records phase: workflow id, execution id and state name. The execution id distinguishes visits to a state re-entered on rework.
  • The create result adds Phase: workflow #N · state.
  • No claim, another session's claim, an expired claim, a paused workflow, or more than one claim: the batch is unlinked.
  • No new tool parameter and no schema or guidance text.

Invariants

  • The link is display metadata: a linked batch equals the unlinked one in every other field (K3), and the workflow entry is unchanged by linking (K1).
  • A snapshot without phase still loads; a malformed link is rejected as corrupt (K3).
  • AGENTS.md and docs/REFERENCE.md state that the link never affects dispatch, admission or transitions.

Evidence

Red on unchanged source: K1 and K3 failed (expected undefined to deeply equal { workflowId: '4', … }); the K2 controls passed.

Green: npm run lint, npm run typecheck, npm test (1619 passed), npm run build, npm run test:package, git diff --check, all by exit code.

Limitations

  • A workflow claim lasts 30 minutes and is renewed only by WorkflowClaim. A second swarm started in the same phase after the claim lapses is not linked.
  • An unrelated swarm started while the session holds one workflow claim is linked to that phase. The effect is display grouping only.

Phased work is a workflow whose states each run a swarm, but nothing
tied a swarm to its phase, so progress views showed two unrelated
controllers. A batch created while its session holds a live claim on
exactly one active workflow now records that workflow, execution and
state, and the create result names it.

The link is display metadata. No claim, an expired claim, a paused
workflow or several claims leave the batch unlinked, and the link is
never consulted for dispatch, admission or transitions.
@trvon
trvon added this pull request to stack #210 November 20, 2026 00:24
@trvon
trvon marked this pull request as ready for review November 20, 2026 03:22
@trvon
trvon merged commit 9fb2a55 into master Nov 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant