Skip to content

Process

std/process@1. job starts one child per Call and publishes its ordered frames with the exit. service opens a resident child per Node instance on first input and reuses it. One exit ends that child, not each application request.

This declaration comes from examples/echo.rkg. Place the Connector in a Graph and wire its ports; the excerpt alone is not an App.

connector shell : Process {
mode = job ; command = "cat"
codec = lines
idempotent = true; behavior = deterministic
timeout = duration("5s")
}

The contract index explains shared settings, build features and the distinction between a Contract, a Lab model and an installed Driver.

Selector: mode defaults to job.

In job mode, Calls on one instance are serialized and queue time counts toward timeout; service uses a Session instead.

ModeDriver directionExchangeLab modelInstalled in this binary
joboutboundcalllab-callprocess-job
serviceinbound+outboundsessionlab-process-serviceprocess-service
ModePortDirectionType rule
job, serviceininputcodec = lines → string; codec = jsonl → variant; codec = bytes → array<byte>
job, serviceoutoutputcodec = lines → string; codec = jsonl → variant; codec = bytes → array<byte>
job, serviceerroutputerr_codec = lines → string; err_codec = bytes → array<byte>
job, serviceexitoutputProcessExit, below
ModeOutput cardinality
joberr: zero or more; out: zero or more; exactly one final exit per Call
serviceZero or more frames and writes; exactly one exit per Session
CasePayloadCall visibility
CaptureFailedEmptyoutcome_unknown
DecodeFailed{ line: string?, message: string }outcome_unknown
Exited{ exit_code: int, signal: int? }after_effect
OutcomeUnknownEmptyoutcome_unknown
OutputOverflow{ limit: ulong, reason: enum { Budget, Capacity } }outcome_unknown
SpawnFailed{ message: string }before_effect
TimeoutExpiredEmptyoutcome_unknown

With codec = jsonl, rastok check refuses a producer whose resolved type contains a value without a JSON form, using E-TYPE-INVALID. A variant producer is checked at execution instead; an unencodable request produces DecodeFailed before its frame is written. In service mode, an unencodable request closes the Session.

ModeSettingDomainPresence / defaultLatest phase
job, serviceargsarray<string>[]instance
job, servicebehaviordeterministic | probabilisticrequiredplan
job, servicecodecbytes | jsonl | linesrequiredplan
job, serviceerr_codecbytes | lineslinesplan
job, servicecommandstringrequiredinstance
job, servicecwdstringoptionalinstance
job, serviceenvmap<string,string>optionalinstance
jobidempotentboolfalseplan
jobtimeoutdurationoptionalinstance
jobmax_outputByteSize"8MiB"plan
jobon_timeoutkillkillplan
servicemax_frameByteSize"1MiB"plan

The shared catalogue lists framing choices for both modes; service validation further restricts codec to lines | jsonl and err_codec to lines. Service has no per-turn timeout or idempotence setting. Its mock supports input-driven match responses and an optional terminal; delayed/unsolicited mock frames, now() in Session mocks and system-close acknowledgements are not scripted. Physical unsolicited output is supported. Job mocks retain the ordinary Call timeout and terminal rules.

job: fixture crates/rastok/tests/conformance_process.rs. Cases without a portable forced fixture: CaptureFailed, OutcomeUnknown. Related tests: crates/rastok/tests/process_service.rs, crates/rastok/src/connector/drivers/process/mod.rs.

service: No dedicated full-Contract fixture is declared. Related tests: crates/rastok/tests/process_service.rs, crates/rastok/src/connector/drivers/process/mod.rs.

Diagram