promptdojo_

Write add_to_ratchet(log, failure) that appends a new entry to a ratchet log and returns a NEW list (don't mutate the input).

Rules:

  • log is a list of dicts, each with keys: date (YYYY-MM-DD), failure, rule, remove_when.
  • failure is a dict with the same four keys.
  • Return a new list with the new entry inserted, sorted by date ascending.
  • Do NOT mutate the original log.

Two failures appended in sequence. Expected output:

After first add:
2026-02-20: use Tailwind, never inline styles
2026-03-15: never skip failing tests
2026-04-02: no force push to main
After second add:
2026-02-20: use Tailwind, never inline styles
2026-03-15: never skip failing tests
2026-04-02: no force push to main
2026-05-01: use structlog, not stdlib logging

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.