Distributed work-runner contract types
State: open/verified · Kind: module · Audience: system
Summary
Section titled “Summary”- Domain-blind contract types for a distributed work runner: work orders, the compiled DAG format, run records, leases, the coordination and work-order-source ports, and the stdio step protocol, projected to TypeScript by ontogen at build time.
- The type layer of D-VSLI-distributed-work-runner-architecture for product PR-FRMN-foreman. No scheduler binding, supervisor loop or CLI lives here yet.
Statement
Section titled “Statement”foreman defines the wire vocabulary a scheduler, supervisor and runner agree on: a minimal
WorkOrder (goal, acceptance, kind routing key), a versioned DagDef with nodes and edges kept
separate, a tagged StepDef for what a node runs (built-in handler, shell command, child process,
or an agent through the agent-driver port), a symmetric stdio StepMessage protocol, an append-only
RunHeader event journal, and TTL-and-fencing Lease types over a compare-and-swap Coordination
port.
The crate is domain-blind by build constraint: no SDLC entity, task or corpus schema may enter it.
Every type is projected to generated/bindings.ts and generated/client.ts so TypeScript consumers
bind to the same definitions. NodeStatus and TriggerRule are re-exported from C-PPXU’s
graph-scheduler crate.
What it provides
Section titled “What it provides”WorkOrderand itsWorkOrderSourceport (work_order.rs,source.rs).DagDef: the compiled, versioned workflow format with trigger rules (dag.rs).StepDef: tagged step implementations (step.rs).StepMessage: the stdio JSON-RPC step protocol between engine, runner and step (protocol.rs).RunHeaderand its sequence-ordered event journal (run.rs).Leasewith TTL and fencing over theCoordinationCAS port (lease.rs,coordination.rs).- The read-only status read model and
api::v1::statusservice functions (status.rs,api/). - A committed TypeScript projection emitted by
build.rs, drift-checked bytests/codegen_sync.rs.
Underlying implementation
Section titled “Underlying implementation”packages/rust/foreman/src/:work_order.rs,dag.rs,step.rs,protocol.rs,run.rs,lease.rs,coordination.rs,source.rs,status.rs,api/mod.rs.packages/rust/foreman/build.rsandgenerated/{bindings,client}.ts; tests intests/codegen_sync.rsandtests/round_trip.rs.
Locations
Section titled “Locations”packages/rust/foreman/packages/rust/foreman/src/lib.rs