Skip to content

Harden workflow step output contracts#314

Draft
Christoffer91 wants to merge 4 commits intosnarktank:mainfrom
Christoffer91:feat/dr-phase1-contract
Draft

Harden workflow step output contracts#314
Christoffer91 wants to merge 4 commits intosnarktank:mainfrom
Christoffer91:feat/dr-phase1-contract

Conversation

@Christoffer91
Copy link

Summary

This hardens workflow step completion so step output is treated as a real runtime contract instead of best-effort text.

Changes in this PR:

  • require STATUS on step completion
  • only accept done, retry, or blocked
  • validate *_JSON payloads before merging output into run context
  • fail closed when expects is not satisfied
  • stop the pipeline on STATUS: blocked
  • prevent blocked runs from continuing to claim/advance steps
  • tighten deep-research handoffs so:
    • research expects RESEARCH_PACKET_JSON:
    • verify expects VERIFIED_PACKET_JSON:
    • write expects FINAL_REPORT:
  • add focused tests for contract validation and verifier fail-closed behavior

Closes #313.

Why

The main deep-research failure mode here was that malformed or incomplete verifier output could still flow downstream. This PR makes the runtime stricter so writer never runs on an invalid verified packet.

Validation

Ran:

  • npm run build
  • node --test dist/cli/ant.test.js dist/cli/cli.test.js dist/installer/step-ops.contract.test.js dist/lib/logger.test.js

Note: there is an existing unrelated failing test in dist/installer/status.test.js on the current base branch, so I did not claim a clean full-suite pass here.

@vercel
Copy link

vercel bot commented Mar 15, 2026

@Christoffer91 is attempting to deploy a commit to the Ryan Team on Vercel.

A member of the Team first needs to authorize it.

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.

Fail-closed runtime contract for workflow step outputs

1 participant