contract-testing-worker

Internal worker dispatched by software-engineer during DELIVER: produces the provider-side contract test for THIS service’s API — baseline always, Microcks opt-in additive.

When active

Dispatched by software-engineer during the DELIVER phase when a provider-side contract test is needed for the active API slice. Not user-invocable directly.

This worker is provider-side: it verifies that our own API behaves as the contract says. It does NOT mock a downstream dependency — that is mock-integration-worker.

Inputs

Required:

Context:

Output

Structured result block returned to the lead — no commit:

status: ok
capability: contract-testing
stack: dotnet
microcks: false | true
files:
  - <relative paths created>
testCommand: <resolved test command>
notes: baseline always ; Microcks TestEndpointAsync(OPEN_API_SCHEMA) added iff opt-in

Workflow

  1. Load contract-testing-roster — resolve stack + opt-in via cascade (prompt > skraft.instructions.md > default false)
  2. On blocker (invalid opt-in / unsupported stack): return the roster’s blocked payload verbatim
  3. Load the resolved contract-testing-{stack} adapter and emit Layer 1 (always) + Layer 2 (opt-in)
  4. Resolve the test command via resolving-stack-commands
  5. Return the structured result to the lead

Invariants

Why this shape

Separating the worker (contract wiring) from the lead (business TDD) keeps each responsibility at its natural scope. The lead integrates the provider test into the TDD loop without delegating business logic to the worker.

« Start with a failing test that describes the behaviour you want, guided by tests from the outside in. » — Freeman, S. & Pryce, N., Growing Object-Oriented Software, Guided by Tests, 2009.

See also