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

object

The 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.

  • additionalPropertiesfalse (closed)

Fields

  • mockWorkersRequiredmockWorker[]

    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"

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
  • additionalPropertiesfalse (closed)

Fields

  • defaultEmptyBehaviorRequiredstring
    • minLength1
  • documentationRequireddocumentation.schema.json(unresolved)Unresolved $ref: /https://schemas.portpowered.com/you/contracts/common/documentation.schema.json is not in the schema catalog.
  • inventoryIdRequiredstring
    • minLength1
  • jsonPathRequiredstring
    • minLength1
  • 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"

mockWorker

object

Selects a worker dispatch and declares the deterministic behavior to apply at the execution boundary.

  • additionalPropertiesfalse (closed)

Fields

  • idOptionalstring
  • rejectConfigOptionalrejectConfig
  • runTypeRequired

    Required run-type union selecting accept, script, or reject behavior.

    • enum"accept" | "script" | "reject"
  • scriptConfigOptionalscriptConfig
  • workInputsOptionalworkInput[]
  • workerNameOptionalstring
  • workstationNameOptionalstring

rejectConfig

object

Optional observable output for a rejected mock result when runType is reject.

  • additionalPropertiesfalse (closed)

Fields

  • exitCodeOptionalinteger

    Optional rejected exit code between 1 and 255.

    • minimum1
    • maximum255
  • stderrOptionalstring
  • stdoutOptionalstring

scriptConfig

object

Declares the local script a script mock executes through the shared command-runner boundary.

  • additionalPropertiesfalse (closed)

Fields

  • argsOptionalarray
  • commandRequiredstring

    Required non-empty command when runType is script.

    • minLength1
  • envOptionalobject
    • additionalPropertiestrue (open)
  • stdinOptionalstring
  • timeoutOptionalstring

    Optional local script execution time bound (for example 30s). Not a dispatch delay or timing field.

  • workingDirectoryOptionalstring

workInput

object

Narrows a mock-worker match by consumed work input. Omitted selector fields do not constrain that dimension.

  • additionalPropertiesfalse (closed)

Fields

  • channelOptionalstring
  • inputNameOptionalstring
  • payloadHashOptionalstring
  • stateOptionalstring
  • traceIdOptionalstring
  • workIdOptionalstring
  • workTypeOptionalstring