promptdojo_

The policy pack — banned promises and fresh citations, as data — step 8 of 8

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Checkpoint: the full draft gate — the check every suggested reply passes before it goes out under your name.

Write draft_gate(draft, pack) returning (verdict, reasons):

  • Banned phrases first: every phrase from pack["banned"] found in the draft text (case-insensitive substring), in banned-list order, goes into reasons.
  • Then the citation, exactly one of:
    • cites is None → append "no citation"
    • the id isn't in pack["kb"] → append "unknown article"
    • its last-verified date is before pack["stale_before"] → append "stale article"
    • otherwise the citation is fine — append nothing.
  • verdict is "SEND" if reasons is empty, else "HOLD".

Four drafts run through the report loop (provided). Expected output:

T-901: SEND
T-902: HOLD — stale article
T-903: HOLD — we guarantee; arrive by
T-904: HOLD — no citation

full-screen editor opens — close anytime to keep reading.