The Cargo-Cult Detector — Find the Code Nobody Understands
Audit a codebase for patterns copy-pasted without comprehension. Rank by danger. Trace the worst one to its origin essay.
What this is
A cinematic excavation of a fictional repository containing five copied patterns. A real in-browser lexical analyzer strips comments, canonicalizes renamed identifiers, fingerprints token shingles, and draws the resulting clone lineage. Change each pattern's operating assumption to watch silent invariant violations, impact, and copy spread determine its danger rank. Then dig through fictional commits to the most probable origin, with every claim tied to an exact file and line range.
Why this is mind-blowing
The worst fossil looks healthy right up to the moment it charges a customer twice. A retry helper born around idempotent catalog reads was copied into payment capture; when an acknowledgement arrives after the commit, it retries the successful write, records a second ledger charge, and leaves every ordinary health indicator green. The demo turns that invisible inherited assumption into a visible evidence trail, then ships the complete 1,500-word dossier beneath the spectacle.
Prompt
Audit this codebase. Find every pattern that's been copy-pasted without
anyone understanding why — the "just works" code nobody can explain.
Rank by danger: how likely is it to fail silently when assumptions
shift? Pick the worst one and write a 1500-word essay tracing where
it probably came from — the Stack Overflow answer, the blog post, the
framework idiom that drifted out of context.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Most production bugs are inherited assumptions wearing the costume of intentional design.
- "It works on prod" is not the same as "it is correct" — it just means the failure mode hasn't been triggered yet.
- Code archaeology is a real engineering skill, and LLMs are the first tool that makes it cheap enough to do on a Tuesday.