Prompt·Architecture and hidden complexity·A06
Code that relies on lucky timing
Finds code that only works because things usually happen in the right order.
Prompt
Identify asynchronous operations whose correctness depends on events happening in a particular order without an explicit guarantee. Trace the scheduling, retries, cancellation, and conflicting writes; reproduce the highest-risk cases and propose the smallest enforceable contract.
- What it returns
- The assumed order, what can reorder it (retry, webhook, slow network), and a reproduction for the worst case.
- Skip it when
- Scripts that do one step at a time with nothing running side by side.
- Changes
- Adds a test that shows it
- Sessions
- Look first, then fix in a new session
- Tools
- Repository; a way to run the code locally to reproduce the problem.
- Also called
- Implicit ordering contracts
Skills it uses
Related prompts
- Updates that overwrite each otherPromptFinds updates that overwrite newer data because two things wrote at once.
- Status hidden in a pile of flagsPromptFinds features whose real status is spread across a pile of yes/no flags, so combinations that should be impossible can happen.
- When an outside service goes downPromptAsks what happens to the app when Google, the AI Gateway or a service that sends it updates goes down.
More in Architecture and hidden complexity.