Skip to content

docs: shellTransform commands must print a JSON response from rift#1589 (Mountebank's contract) - #352

Merged
EtaCassiopeia merged 1 commit into
masterfrom
docs/rift-339-shelltransform-contract
Oct 28, 2026
Merged

EtaCassiopeia merged 1 commit into
masterfrom
docs/rift-339-shelltransform-contract

Conversation

@EtaCassiopeia

Copy link
Copy Markdown
Collaborator

Closes #339

Why

From rift 0.24.0 (rift#1589), shellTransform follows Mountebank's contract:

  • the command receives the request and response JSON as two shell arguments, also exported as MB_REQUEST and MB_RESPONSE;
  • its stdout must be a JSON response object.

A command that prints a plain body now produces an error instead of a body. The SDK passes commands through verbatim, so no code changes, but nothing documented this contract.

What

  • BehaviorChain.shellTransform javadoc: the contract, the # idiom (printf '{"body":"hello"}' #), and what changed from earlier engines.
  • docs/design/sdk-api.md: a short note in the behavior-chain block.
  • ShellTransformReadBackIT: a new live case (SPAWN only, since injection is a spawn-CLI flag). The documented example serves hello on engine v0.24.0.

Audit: no other example or test in the repo runs a plain-body shellTransform.

Tests

  • Local full verify (SPAWN, engine v0.24.0) passed; ShellTransformReadBackIT ran 2 tests, 0 failures.
  • javadoc:javadoc on rift-java-core passed.

🤖 Generated with Claude Code

…s under

rift#1589 adopted Mountebank's contract: a command gets the request and
response JSON as two shell arguments (and MB_REQUEST/MB_RESPONSE) and must
print a JSON response object. A command that printed a plain body now
breaks the response, and nothing in the SDK said so. The javadoc and the
design doc now do, with the ' #' idiom, and a live check pins the
documented example to the engine.

Closes #339
@EtaCassiopeia
EtaCassiopeia merged commit edcf7bf into master Oct 28, 2026
18 checks passed
@EtaCassiopeia
EtaCassiopeia deleted the docs/rift-339-shelltransform-contract branch October 28, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: shellTransform commands must print a JSON response from rift#1589 (Mountebank's contract)

1 participant