MCP Mastery
About
c-03-hitl-approval

HITL Approval Gate

Draft, interrupt with a payload, resume with a human decision — the boring backbone of safe automation.

mid
python
~40 min

README

# c-03-hitl-approval

Simulate draft → human interrupt → resume. The validator is pedantic about stage names and trace ordering — lean into it.

## Validator

From repo root:

```bash
npm run challenge -- hitl-approval --track langchain
```

Or from this package directory:

```bash
cd challenges/langchain/c-03-hitl-approval
uv run python tests/validate.py
```

Hints

  • Stages are spelled `draft`, `awaiting_human`, `final` — typos are your own boss fight.
  • `interrupt_payload` must append `interrupt:human_review` to `trace` after the check passes.
  • Rejections should land in `final` too; stalled graphs are a support ticket factory.

Acceptance

  • `npm run challenge -- hitl-approval --track langchain` exits 0
  • Approved resumes append `node:finalize` and `APPROVED` to the draft
  • Rejected resumes mark `human_decision` false and refuse to pretend nothing happened