Skip to content

Failure Fixtures

Use the starter app’s bug modes for real debugging practice.

Start:

Terminal window
cd starter-projects/support-desk-mini
VEDYA_BUG_MODE=accept_empty_title python3 app.py

Reproduce:

Terminal window
curl -i -X POST http://localhost:8080/tickets \
-H 'Content-Type: application/json' \
-H 'X-User-Id: user-1' \
-d '{"title":"","description":"No title should fail"}'

Expected correct behavior:

  • 400
  • No ticket row.

Bug behavior:

  • Ticket is created.

Learner task:

  • Identify validation boundary.
  • Write or point to failing test.
  • Explain why frontend validation is not enough.

Start:

Terminal window
VEDYA_BUG_MODE=approval_bypass python3 app.py

Reproduce:

  1. Create a ticket.
  2. Create a draft.
  3. Approve the draft with X-User-Role: user.

Expected correct behavior:

  • 403

Bug behavior:

  • Draft is sent.

Learner task:

  • Explain authorization versus authentication.
  • Identify the function that should enforce approval.
  • Write postmortem impact if this happened in production.

Start:

Terminal window
VEDYA_BUG_MODE=duplicate_idempotency python3 app.py

Reproduce:

Terminal window
curl -i -X POST http://localhost:8080/tickets \
-H 'Content-Type: application/json' \
-H 'X-User-Id: user-1' \
-H 'Idempotency-Key: duplicate-demo' \
-d '{"title":"Login broken","description":"Cannot access account"}'
curl -i -X POST http://localhost:8080/tickets \
-H 'Content-Type: application/json' \
-H 'X-User-Id: user-1' \
-H 'Idempotency-Key: duplicate-demo' \
-d '{"title":"Login broken","description":"Cannot access account"}'

Expected correct behavior:

  • One ticket row.

Bug behavior:

  • Duplicate rows or database conflict.

Learner task:

  • Explain idempotency.
  • Inspect the database.
  • Add or run the regression test.

For each fixture, create:

  • Reproduction command.
  • Expected behavior.
  • Actual behavior.
  • Failing boundary.
  • Root cause.
  • Test or verification evidence.
  • Prevention note.