Completing a Booking Before the Night — and Without the Money
The venue could mark the show done before it happened, and before the deposit and rent were paid
Published Nov 5, 2026
Executive Summary
The completeBooking decision checked only the actor and the status. Nothing verified that the night had actually ended, and nothing verified that the deposit and rent were paid — so a venue could complete a booking hours early or with money outstanding, which unlocked ratings and counted the night toward the filmmaker's record with no record of the shortfall. The fix adds a time gate and a payment gate, with an explicit acknowledgement path for unpaid completions.
The Prompt
“Add a completeBooking callable so a venue can mark a confirmed screening as completed.”
The Flaw
The only checks were actor and status. Nothing verified that the night had actually ended, and nothing verified that the deposit and rent were paid. A venue could complete a booking the moment it was confirmed — hours before the showtime — or with money outstanding. Completion unlocked ratings and counted the night toward the filmmaker's record while the platform held no record of what was owed. The agent implemented the happy path and skipped the forbidden states.
Risk & Impact
[Correctness] A venue could close a booking with the deposit and rent unpaid; the platform recorded the night as completed and opened ratings without ever flagging the outstanding money.
Cost: Unpaid bookings close silently — the filmmaker's record and ratings update while money is owed, with no warning and no record of the shortfall.
Code Comparison
❌ Vulnerable (AI generated)
❌ Vulnerable (AI generated)
✅ Hardened (production ready)
The Fix
Gate completion on two conditions: the last night of the run must have ended, and the deposit + rent must be paid — or the venue explicitly acknowledges the shortfall, which is then recorded and surfaced.
Prevention
- [manual] For every state-changing action, list the forbidden transitions (time, payment, authorization) alongside the happy path.
- [ci] Unit tests must assert every refusal code for a business action, not just the success case.
Why This Happened
Root cause: the prompt omitted Rule 2 — the guardrails that would have caught this. See the full guide →
