Split internal/domain/workflow's contract from its engine: a contract type drags agentexec #1383

Open
opened 2026-10-27 13:40:10 +00:00 by sam · 0 comments
Owner

Surfaced by the archie-core-1ng1 design doc (docs/architecture/migration-decisions.md, dated decision under section 2).

THE FINDING
internal/domain/workflow's ExecutionSettings is a CONTRACT type, but the package also contains the engine, and agent.go sits beside it. So importing the package for a contract type links internal/agentexec as well. That is why the controlplane client cannot move as one package: WatchWorkflowExecutionSettings calls decodeSettings, which returns and validates workflow.ExecutionSettings, so whatever package holds that watch links the engine and therefore agentexec.

RELATIONSHIP TO 1ng1
Independent. 1ng1 severs the MESSAGING SERVICE's import graph by splitting the client by resource family, which is sufficient for its gate. This is the OTHER half of the PRD's workflow-engine ban: the ban exists because a contract type should not drag an engine.

WHY IT MATTERS SEPARATELY
Until the contract is separable from the engine, any consumer that only needs a workflow contract type still links the engine - so the same shape of severance hole can reappear at the next extraction (8cda.7 extracts Execution Environment + Runner + Scheduler, which will meet it).

WHAT TO DO
Split the contract types out of internal/domain/workflow so a contract import does not reach the engine, then re-measure go list -deps for every consumer that only wanted types. Sequence after 1ng1 so the two refactors do not collide.


Imported from beads archie-core-inh6 · GitHub #1165 · type chore · priority P3 · created 2026-09-21

Surfaced by the archie-core-1ng1 design doc (docs/architecture/migration-decisions.md, dated decision under section 2). THE FINDING internal/domain/workflow's ExecutionSettings is a CONTRACT type, but the package also contains the engine, and agent.go sits beside it. So importing the package for a contract type links internal/agentexec as well. That is why the controlplane client cannot move as one package: WatchWorkflowExecutionSettings calls decodeSettings, which returns and validates workflow.ExecutionSettings, so whatever package holds that watch links the engine and therefore agentexec. RELATIONSHIP TO 1ng1 Independent. 1ng1 severs the MESSAGING SERVICE's import graph by splitting the client by resource family, which is sufficient for its gate. This is the OTHER half of the PRD's workflow-engine ban: the ban exists because a contract type should not drag an engine. WHY IT MATTERS SEPARATELY Until the contract is separable from the engine, any consumer that only needs a workflow contract type still links the engine - so the same shape of severance hole can reappear at the next extraction (8cda.7 extracts Execution Environment + Runner + Scheduler, which will meet it). WHAT TO DO Split the contract types out of internal/domain/workflow so a contract import does not reach the engine, then re-measure go list -deps for every consumer that only wanted types. Sequence after 1ng1 so the two refactors do not collide. --- _Imported from beads `archie-core-inh6` · GitHub #1165 · type chore · priority P3 · created 2026-09-21_
sam added the lowchore labels 2026-10-27 13:40:10 +00:00
sam self-assigned this 2026-10-27 13:40:10 +00:00
sam added the deferred label 2026-11-15 17:26:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1383