9 phase shifts from story to proof.
A side-by-side comparison showing how the same task gets handled with old vs new thinking. Every shift closes an open loop.
The Before & After
Same task: "Fix the email duplicate bug." Two completely different approaches.
I've fixed the email duplicate bug by:
1. Adding email normalization in the signup handler
2. Adding email normalization in the login handler
3. Both now call toLowerCase() and trim()
This should prevent duplicate accounts from being created
with different email capitalizations.
The change looks correct and follows our patterns.
Let me know if you'd like any adjustments!
WHAT'S WRONG:
- "should prevent" = unverified claim
- "looks correct" = vibes, not proof
- No test, no verification command, no evidence
- If it breaks, we won't know until production
## Plan
Goal: Prevent duplicate accounts from email case variations
Non-goals: Not changing auth flow, not migrating existing data
Approach: Single normalizeEmail() at ingress boundary
Proof plan: npm run verify + new regression test
## Changes
- src/utils/email.ts: Added normalizeEmail(email: string)
- src/handlers/auth.ts: Call normalizeEmail at signup/login ingress
- tests/email.test.ts: Added case-sensitivity regression test
## Proof
$ npm run verify
✓ format (0.2s)
✓ lint (1.1s)
✓ typecheck (2.3s)
✓ unit tests (4.7s)
✓ email.test.ts
✓ normalizeEmail trims whitespace
✓ normalizeEmail lowercases
✓ Foo@Bar.com then foo@bar.com returns same user (REGRESSION)
## Risks & Mitigations
- Existing duplicate accounts: Not addressed (out of scope, needs data migration)
- Performance: normalizeEmail is O(n) on string length, negligible
WHAT'S DIFFERENT:
- Every claim has executable evidence
- Regression test proves the specific bug class is caught
npm run verifyoutput is pasted, not described- Risks are explicit, not hidden
The Transformation
From open loop to closed loop. From narrative to executable.
The 9 Shifts
Each shift as a diff. Old thinking on the left, new thinking on the right.
Division of Labor → Division of Verification
"Oracles, not org charts."
Documentation → Verification
"Proof over prose."
Planning → Control Theory
"Sensors before actuators."
One-Shot Fixes → Loop Discipline
"Propose → Patch → Prove → Pack."
Bugs → Interface Gaps
"Interfaces are physics."
Implied Confidence → Explicit Uncertainty
"Certainty from tests, not vibes."
Human QA → Oracle Specialists
"Specialists as tools, not people."
Pre-Deploy Testing → Pre-Generation Truth
"Verify at the speed of thought."
Team Practices → Portable Invariants
"Tests, not tribal knowledge."
The Ultimate Test
Ask yourself these three questions.
If a new AI agent (or human) cloned this repo tomorrow with zero context, could they run one command and know if the codebase is healthy?
Could they make a change and know immediately if they broke something?
Could they trust the system without trusting any individual's narrative?
Summary: All 9 Shifts
The complete transformation at a glance.
| OLD THINKING | NEW THINKING | REMEMBER |
|---|---|---|
| Roles divide work | Constraints define truth | Oracles, not org charts |
| Document it well | Prove it runs | Proof over prose |
| Plan carefully | Control feedback loops | Sensors before actuators |
| Fix the bug | Close the loop | Propose → Patch → Prove → Pack |
| Code has bugs | Interface has gaps | Interfaces are physics |
| I think this works | Here's the proof | Certainty from tests |
| QA reviews code | Oracles judge diffs | Specialists as tools |
| Test before deploy | Truth at generation | Verify at speed of thought |
| Follow practices | Verify invariants | Tests, not tribal knowledge |
Back to MainThe shift: Stop asking "Does this look right?"
Start asking "What command proves this works?"