Phase 5: Extract Execution Environment + Runner + Scheduler #117

Closed
opened 2026-10-27 13:35:01 +00:00 by sam · 0 comments
Owner

Fifth extraction in the resolved order -- the heaviest and most
store-coupled phase, deliberately placed after the facade (Gateway) and
the data seam (State Store) are already proven.

Scope, per the PRD's target-services table:

  • Execution Environment: internal/domain/workflow's dispatch paths
    become the execution-dispatch contract, consuming State Store's
    WorkflowStore contract (Phase 2).
  • Runner: internal/container, internal/agentexec, internal/worktree
    become the isolated worktree/container execution service, consuming
    the existing container contract.
  • Scheduler: internal/domain/scheduling + internal/infrastructure/
    cronstore become the cron/ticker contract service.

Depends on Phase 4 (Messaging extraction) per the resolved extraction
order.

Note: internal/storerpc's NATS path to the archie-agent container is
explicitly flagged in question #4's research as an Execution-track
question ("Migration of the storerpc NATS path... under the PRD the
Execution/Runner processes are peers too, so the agent's store access
should eventually use the same contract") -- this phase owns deciding
when that moves, not the State Store phase.

Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1
(Phase 5 section).

Acceptance criteria

  • Execution Environment, Runner, and Scheduler stood up as separable
    services (or a documented decision to combine any of them into one
    binary, if scoping during implementation finds no benefit to a full
    three-way split -- but the contracts must be independently
    addressable).
  • Execution Environment consumes State Store's WorkflowStore contract
    over gRPC rather than importing internal/store directly.
  • The archie-agent container's storerpc NATS access path is either
    migrated onto the same contract-based access or an explicit documented
    decision is recorded for why it stays on NATS for this phase.
  • internal/channels/telegram and other invariants unaffected by this
    phase (container pull policy, NATS JetStream work-queue semantics from
    AGENTS.md remain intact).
  • task check passes; a full task lifecycle (intake -> dispatch -> worktree
    execution -> completion) is exercised end-to-end against the extracted
    services.

Close reason

Not planned: scheduling and container execution are the daemon's dispatch responsibility, one service under 'services own contracts'. Agent containers already use the State Store gRPC contract. Reopen only for a concrete scaling, HA or separate-host need.


Imported from beads archie-core-8cda.7 · GitHub #744 · type task · priority P3 · created 2026-09-05 · closed 2026-10-03

Fifth extraction in the resolved order -- the heaviest and most store-coupled phase, deliberately placed after the facade (Gateway) and the data seam (State Store) are already proven. Scope, per the PRD's target-services table: - Execution Environment: internal/domain/workflow's dispatch paths become the execution-dispatch contract, consuming State Store's WorkflowStore contract (Phase 2). - Runner: internal/container, internal/agentexec, internal/worktree become the isolated worktree/container execution service, consuming the existing container contract. - Scheduler: internal/domain/scheduling + internal/infrastructure/ cronstore become the cron/ticker contract service. Depends on Phase 4 (Messaging extraction) per the resolved extraction order. Note: internal/storerpc's NATS path to the archie-agent container is explicitly flagged in question #4's research as an Execution-track question ("Migration of the storerpc NATS path... under the PRD the Execution/Runner processes are peers too, so the agent's store access should eventually use the same contract") -- this phase owns deciding when that moves, not the State Store phase. Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1 (Phase 5 section). ### Acceptance criteria - Execution Environment, Runner, and Scheduler stood up as separable services (or a documented decision to combine any of them into one binary, if scoping during implementation finds no benefit to a full three-way split -- but the contracts must be independently addressable). - Execution Environment consumes State Store's WorkflowStore contract over gRPC rather than importing internal/store directly. - The archie-agent container's storerpc NATS access path is either migrated onto the same contract-based access or an explicit documented decision is recorded for why it stays on NATS for this phase. - internal/channels/telegram and other invariants unaffected by this phase (container pull policy, NATS JetStream work-queue semantics from AGENTS.md remain intact). - task check passes; a full task lifecycle (intake -> dispatch -> worktree execution -> completion) is exercised end-to-end against the extracted services. ### Close reason Not planned: scheduling and container execution are the daemon's dispatch responsibility, one service under 'services own contracts'. Agent containers already use the State Store gRPC contract. Reopen only for a concrete scaling, HA or separate-host need. --- _Imported from beads `archie-core-8cda.7` · GitHub #744 · type task · priority P3 · created 2026-09-05 · closed 2026-10-03_
sam added the lowtask labels 2026-10-27 13:35:01 +00:00
sam self-assigned this 2026-10-27 13:35:01 +00:00
sam closed this issue 2026-10-27 13:35:01 +00:00
sam added a new dependency 2026-10-27 13:41:44 +00:00
sam added a new dependency 2026-10-27 13:41:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#117