Implement run orchestration in df-agent-channel #5

Merged
prskr merged 1 commit from iter1/run-orchestration into main 2026-10-20 05:33:05 +00:00
Owner

New crate df-agent-channel (openspec iter1-run-orchestration): the
control-plane side of the agent protocol, mounted by dark-factory serve.

  • Agent port: mTLS via tokio-rustls with client certs bound to the run
    (URI SAN, peer IP via SandboxProvider::resolve_identity). TLS material
    is reloaded on rotation (checked at most every 10 s), handshakes are
    bounded in time and count.
  • Session: Hello/HelloAck, HarnessCredentials and Assign, batched
    persistence with cumulative acks, dedup and gap detection, transcript
    storage with blob extraction, prompt (re-)delivery and wall-clock Cancel
    counted from the runtime's first Hello. Effects of committed messages
    run even before a gap; tool calls and credentials are refused once the
    run ended.
  • Scheduler: SKIP LOCKED run start on task_message_queued and a 15 s
    tick, background provisioning, provider events, connect timeout and
    hard stop; continuation summary keeps the newest messages.
  • Factory tools with schema validation and at-most-once execution (the
    forge is called outside any transaction), PR lifecycle (draft on push,
    ready + completion summary on completion), Git credential grants.
  • Graceful shutdown: sessions drain in-flight tool calls, the scheduler
    drains provisioning, main waits SHUTDOWN_GRACE before aborting.
  • Migration: tasks.completion_summary, runs.connected_at.
  • Config: agent and harness sections deny unknown fields; ChannelConfig
    holds the df-core sections; Helm configmap sets agent.tls.
  • Placeholder provider, forge and secret store until
    iter1-sandbox-provisioning and iter1-integration-plugins land.
  • Bazel: production library without test-util, separate test-util
    variant for tests. Remote Bazel is blocked by a pre-existing toolchain
    issue (docs/bazel-remote-toolchain.md); verified locally.
  • Deferred review findings are tracked as TD-8 to TD-26 in
    docs/tech_debt.md.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

New crate df-agent-channel (openspec iter1-run-orchestration): the control-plane side of the agent protocol, mounted by `dark-factory serve`. - Agent port: mTLS via tokio-rustls with client certs bound to the run (URI SAN, peer IP via SandboxProvider::resolve_identity). TLS material is reloaded on rotation (checked at most every 10 s), handshakes are bounded in time and count. - Session: Hello/HelloAck, HarnessCredentials and Assign, batched persistence with cumulative acks, dedup and gap detection, transcript storage with blob extraction, prompt (re-)delivery and wall-clock Cancel counted from the runtime's first Hello. Effects of committed messages run even before a gap; tool calls and credentials are refused once the run ended. - Scheduler: SKIP LOCKED run start on task_message_queued and a 15 s tick, background provisioning, provider events, connect timeout and hard stop; continuation summary keeps the newest messages. - Factory tools with schema validation and at-most-once execution (the forge is called outside any transaction), PR lifecycle (draft on push, ready + completion summary on completion), Git credential grants. - Graceful shutdown: sessions drain in-flight tool calls, the scheduler drains provisioning, main waits SHUTDOWN_GRACE before aborting. - Migration: tasks.completion_summary, runs.connected_at. - Config: agent and harness sections deny unknown fields; ChannelConfig holds the df-core sections; Helm configmap sets agent.tls. - Placeholder provider, forge and secret store until iter1-sandbox-provisioning and iter1-integration-plugins land. - Bazel: production library without test-util, separate test-util variant for tests. Remote Bazel is blocked by a pre-existing toolchain issue (docs/bazel-remote-toolchain.md); verified locally. - Deferred review findings are tracked as TD-8 to TD-26 in docs/tech_debt.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New crate df-agent-channel (openspec iter1-run-orchestration): the
control-plane side of the agent protocol, mounted by `dark-factory serve`.

- Agent port: mTLS via tokio-rustls with client certs bound to the run
  (URI SAN, peer IP via SandboxProvider::resolve_identity). TLS material
  is reloaded on rotation (checked at most every 10 s), handshakes are
  bounded in time and count.
- Session: Hello/HelloAck, HarnessCredentials and Assign, batched
  persistence with cumulative acks, dedup and gap detection, transcript
  storage with blob extraction, prompt (re-)delivery and wall-clock Cancel
  counted from the runtime's first Hello. Effects of committed messages
  run even before a gap; tool calls and credentials are refused once the
  run ended.
- Scheduler: SKIP LOCKED run start on task_message_queued and a 15 s
  tick, background provisioning, provider events, connect timeout and
  hard stop; continuation summary keeps the newest messages.
- Factory tools with schema validation and at-most-once execution (the
  forge is called outside any transaction), PR lifecycle (draft on push,
  ready + completion summary on completion), Git credential grants.
- Graceful shutdown: sessions drain in-flight tool calls, the scheduler
  drains provisioning, main waits SHUTDOWN_GRACE before aborting.
- Migration: tasks.completion_summary, runs.connected_at.
- Config: agent and harness sections deny unknown fields; ChannelConfig
  holds the df-core sections; Helm configmap sets agent.tls.
- Placeholder provider, forge and secret store until
  iter1-sandbox-provisioning and iter1-integration-plugins land.
- Bazel: production library without test-util, separate test-util
  variant for tests. Remote Bazel is blocked by a pre-existing toolchain
  issue (docs/bazel-remote-toolchain.md); verified locally.
- Deferred review findings are tracked as TD-8 to TD-26 in
  docs/tech_debt.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prskr merged commit 85fa76cca1 into main 2026-10-20 05:33:05 +00:00
prskr deleted branch iter1/run-orchestration 2026-10-20 05:33:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prskr/dark-factory!5
No description provided.