Mock-workers schema
Reference for the mock-workers configuration schema.
This is a reference for the mock-workers configuration schema. The config stands in for real workers during a run: which workers are mocked, what each one does when it is dispatched, and what happens to a dispatch that matches nothing.
Core configuration
The root object of a mock-workers configuration file. Every field below is declared directly on it; the definitions that follow describe the objects it references.
You mock-worker configuration
objectThe strict mock-worker dispatch configuration accepted by ParseMockWorkersConfig. mockWorkers[] entries are matched in array order and the first matching entry wins. Unmatched dispatches follow unmatchedDispatchPolicy.
- additionalProperties
false (closed)
Fields
Ordered mock-worker entries. First-match selection applies; there is no multi-step response-sequence authoring surface.
- unmatchedDispatchPolicyOptional
Controls dispatches that do not match any mockWorkers[] entry. Omitted values behave as accept.
Default"accept"- enum
"accept" | "passthrough"
- enum
Examples
- Minimal accept matchAuthored examplejson
{ "mockWorkers": [ { "id": "reviewer-accepts", "workerName": "reviewer", "runType": "accept" } ] } - Reject with unmatched policyAuthored examplejson
{ "mockWorkers": [ { "id": "reviewer-rejects", "workerName": "reviewer", "runType": "reject", "rejectConfig": { "exitCode": 42, "stderr": "mock reject" } } ], "unmatchedDispatchPolicy": "passthrough" }
Definitions
The objects a mock-worker entry references — run-type configuration, the work it matches, and the field contracts it is validated against.
fieldContract
object- additionalProperties
false (closed)
Fields
- defaultEmptyBehaviorRequiredstring
- minLength
1
- minLength
- documentationRequireddocumentation.schema.json(unresolved)Unresolved $ref: /https://schemas.portpowered.com/you/contracts/common/documentation.schema.json is not in the schema catalog.
- inventoryIdRequiredstring
- minLength
1
- minLength
- jsonPathRequiredstring
- minLength
1
- minLength
- lifecycleRequireddeprecations.schema.json(unresolved)Unresolved $ref: /https://schemas.portpowered.com/you/contracts/common/deprecations.schema.json is not in the schema catalog.
- notesOptionalstring
- validationOwnerRequiredstring
- enum
"decode" | "validate"
- enum
mockWorker
objectSelects a worker dispatch and declares the deterministic behavior to apply at the execution boundary.
- additionalProperties
false (closed)
Fields
- idOptionalstring
- runTypeRequired
Required run-type union selecting accept, script, or reject behavior.
- enum
"accept" | "script" | "reject"
- enum
- workerNameOptionalstring
- workstationNameOptionalstring
rejectConfig
objectOptional observable output for a rejected mock result when runType is reject.
- additionalProperties
false (closed)
Fields
- exitCodeOptionalinteger
Optional rejected exit code between 1 and 255.
- minimum
1 - maximum
255
- minimum
- stderrOptionalstring
- stdoutOptionalstring
scriptConfig
objectDeclares the local script a script mock executes through the shared command-runner boundary.
- additionalProperties
false (closed)
Fields
- argsOptionalarray
- commandRequiredstring
Required non-empty command when runType is script.
- minLength
1
- minLength
- envOptionalobject
- additionalProperties
true (open)
- additionalProperties
- stdinOptionalstring
- timeoutOptionalstring
Optional local script execution time bound (for example 30s). Not a dispatch delay or timing field.
- workingDirectoryOptionalstring
workInput
objectNarrows a mock-worker match by consumed work input. Omitted selector fields do not constrain that dimension.
- additionalProperties
false (closed)
Fields
- channelOptionalstring
- inputNameOptionalstring
- payloadHashOptionalstring
- stateOptionalstring
- traceIdOptionalstring
- workIdOptionalstring
- workTypeOptionalstring