Failure Fixtures
Use the starter app’s bug modes for real debugging practice.
Fixture 1: Empty Title Accepted
Section titled “Fixture 1: Empty Title Accepted”Start:
cd starter-projects/support-desk-miniVEDYA_BUG_MODE=accept_empty_title python3 app.pyReproduce:
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.
Fixture 2: Approval Bypass
Section titled “Fixture 2: Approval Bypass”Start:
VEDYA_BUG_MODE=approval_bypass python3 app.pyReproduce:
- Create a ticket.
- Create a draft.
- 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.
Fixture 3: Duplicate Idempotency
Section titled “Fixture 3: Duplicate Idempotency”Start:
VEDYA_BUG_MODE=duplicate_idempotency python3 app.pyReproduce:
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.
Required Debugging Output
Section titled “Required Debugging Output”For each fixture, create:
- Reproduction command.
- Expected behavior.
- Actual behavior.
- Failing boundary.
- Root cause.
- Test or verification evidence.
- Prevention note.