← Back to Blog
Building in Public

From Chaos to Cathedral

christian crumlish•
A robot surveying a structured space emerging from disorder, methodical thinking made visible.
“Now that’s more like it.”

November 17 to 18

Alpha readiness isn’t about heroics. It’s about systematic thinking. That’s what Monday taught us — twice, in two very different contexts. First, repository archaeology revealed three months of forgotten work that needed careful integration. Then, alpha testing revealed a moment of truth: we could either keep patching reactively or stop and think systematically.

We chose systematic. Every time.

Repository archaeology

I started at 6:06 PM with my Cursor agent beginning repository maintenance. The mission was simple: merge unmerged branches, investigate stale work, clean the repository. Discovery came immediately: five branches with unmerged work.

Some merges were clean. The UX Quick Wins documentation branch added 574 lines of technical reference material, updated README for alpha users, refined agent briefings. No conflicts, clean merge.

But Branch #4 (PM-033d Core Coordination) had conflicts. Directory renames between dev/ and docs/. Five development documents from August — RAG analysis, Enhanced Autonomy Phase 5 session logs — that needed proper homes. Cursor resolved it methodically: moved session logs to dev/2025/08/15/, kept development docs in docs/development/. Manual conflict resolution, then merge. All tests passing.

Branch #5 (PM-033d Testing UI) had more complex conflicts: directory renames plus code conflicts in test utilities. Three session logs, methodology breakthrough documentation, and test infrastructure from three months ago. The tests on main had evolved. The branch had evolved differently. Now they had to merge.

Cursor created hybrid mock implementations — kept the main branch base, added PM-033d wrapper classes as extensions. Added the missing quick_performance_test() helper function. Found test_agent_coordinator.py broken and abandoned three months ago — deleted it. Merged. All 63 tests passing.

Then came Branch #2: CI Health Check. Four commits from October 12. Cursor investigated: Python 3.11 requirements, venv exclusions, formatting fixes. Verdict: all meaningful changes already on main branch through other work. The branch had been superseded by parallel progress. Archived locally, deleted from origin.

Branch #3 was the archaeological discovery. Sprint Creation System: 385 commits, diverged 1,037 commits ago. This branch represented an entire alternate timeline from very early in the project — a complete parallel evolution of Piper Morgan that had split off months ago and never merged back.

The divergence point: commit 5d6c4131, unmergeable. The alternate timeline contained experiments that succeeded in different ways than main branch. But hidden inside those 385 commits were two valuable artifacts: sprint planning templates, agent role templates, sprint README structures.

Cursor extracted the templates, documented them in dev/2025/11/17/ARCHIVED-BRANCHES-ANALYSIS.md, and archived the branch. Not merged — memorialized. The work wasn’t lost, but the alternate timeline couldn’t be reconciled with the cathedral we’d built.

By 6:35 PM, three branches were merged (9 commits), two were archived (documented), ~1,500 lines of documentation added, seven conflicts resolved, all tests passing. Then came file cleanup: 37 uncommitted files scattered across the working tree. Session logs from November 14–17. UX audit documentation. Beads/Serena methodology notes. Working documents.

Cursor committed the valuable work, deleted duplicates (View 2 variants, markdown copies), discarded runtime artifacts safely (logs, 536MB of binaries — DMG files, PNGs, DOCXs that had no business in git). Repository hardening: added binary types to .gitignore.

The archaeology complete, repository clean, forgotten work integrated or memorialized, tests passing.

The alpha testing moment

The next day I started at 10:26 AM with validation. I was testing the Quick Start guide on a fresh laptop — not my primary development machine, a genuine new user experience. Fresh directory, clean environment, following the documentation exactly as an alpha tester would.

Immediate issues: pip install failing (Python version mismatch). Documentation regressions. Unclear instructions. The wizard had bugs I hadn’t seen in my heavily customized development environment.

My Code Agent spent the morning documenting issues systematically, fixing the port check TIME_WAIT bug, auditing the Quick Start guide. By 12:10 PM, we had a list of problems.

Then at 1:45 PM came the critical moment. I gave feedback: “Stop piecemeal fixes, need systematic plan.”

We’d been patching reactively — see bug, fix bug, push fix. But alpha testing was revealing patterns, not isolated issues. Database migrations weren’t visible. Keychain checks had no progress feedback. Username reclaim from incomplete setup was broken. Status command had three distinct bugs. Documentation links were broken.

This pattern of noticing piecemeal fixes and stepping back dates to some of my earliest “vibe coding” learnings.

This is the discipline moment. We could keep fixing things reactively and ship faster. Or we could stop, group related issues, create a systematic plan, and fix things properly. The Excellence Flywheel, the Inchworm Protocol, all our methodology — they all say the same thing: systematic over reactive, even when the deadline pressure is “alpha testers are coming.”

The systematic approach

By 5:05 PM, the Code Agent had created a comprehensive 5-phase fix plan:

Phase 1: Database Migrations (alembic visibility)
Phase 2: Keychain Check Visibility
Phase 3: Username Reclaim from Incomplete Setup
Phase 4: Status Command Bugs (three issues)
Phase 5: Polish (imports, doc links)

I approved the plan. The Claude Code agent executed all five phases systematically over 115 minutes.

Phase 1 (15 minutes): Fixed database migrations visibility. Alembic now runs with proper working directory parameter. Migrations execute automatically during wizard startup. Visible progress messages. The user_api_keys.user_id migration (VARCHAR → UUID) now happens cleanly with user feedback.

Phase 2 (30 minutes): Added keychain check visibility for all three providers (OpenAI, Anthropic, GitHub). Messages: “Checking keychain for existing key…” Shows “✓ Using existing key” or “ℹ️ No existing key found”. Visible exception handling with error types. Progress feedback transforms silent operations into understandable steps.

Phase 3 (20 minutes): Username reclaim from incomplete setup. If a previous setup attempt failed midway, user can reclaim that username. Asks: “Resume setup for [username]? (y/n)” If no, deletes incomplete account with visible progress. Graceful error handling. No orphaned usernames.

Phase 4 (30 minutes): Fixed three status command bugs. Issue #16: ‘dict’ object has no attribute ‘is_active’ — changed key.is_active → key[“is_active”] (proper dict access). Added “id” field to list_user_keys() return dict. Fixed _calculate_key_age() to parse ISO timestamps correctly. Issues #15 & #17: Duplicate logging — initialize services once at start, reuse instances instead of creating new ones. Clean logs.

Phase 5 (20 minutes): Polish. Added SQLAlchemy import guard with helpful error message. Fixed five broken doc links in ALPHA_QUICKSTART.md. All unit tests passing (45 passed, 8 skipped). Pre-push validation passed. Pushed to origin/main successfully. All Beads issues closed.

By 6:45 PM, the wizard was functional. Alpha user successfully created: alfrick at dinp.xyz. Setup wizard fully operational. I continued end-to-end testing with all fixes deployed.

The systematic approach took longer than reactive patching would have — 115 minutes for five phases versus maybe 30 minutes of quick fixes. But it was complete. Every related issue addressed. All tests passing. Documentation updated. Clean commits. No technical debt.

The infrastructure hardening

Tuesday evening brought one more discovery. At 6:43 PM, my Cursor agent began creating a rigorous E2E bug investigation protocol to prevent future reactive patching. The protocol had three phases:

Phase 1: Bug Capture & Categorization (PM)
Phase 2: Investigation-Only Assignment (Agents) — NO FIXES ALLOWED
Phase 3: Strategic Fix Planning (PM Review)

Phase 2 was critical: investigation only. Root cause analysis, pattern recognition across multiple bugs, domain model verification, comprehensive investigation report. Then stop. No implementing fixes during investigation. Investigation and implementation are separate disciplines requiring different mindsets.

Six documentation files created establishing this protocol. GitHub issue template. Session log template for tracking bugs. Investigation report template. PM review process guide. Fix execution protocol. CLAUDE.md updated with Phase 2 investigation-only requirements.

Then at 7:15 PM, Cursor discovered something troubling: the wrong GitHub URL appeared in docs/README.md. Not my repository — someone else’s username (Codewarrior1988). Root cause investigation revealed: LLM hallucination in Weekly Ship #002. An agent had hallucinated a plausible-looking GitHub URL. That hallucinated URL spread like a virus — agents copied from Ship #002, propagating the error across 18 files.

This is the kind of bug that’s both trivial and serious. Trivial because it’s just a URL. Serious because it was in clone instructions, GitHub issues links, PR approval scripts (functional bug!), and seven historical logs.

Cursor eradicated the hallucinated URL from 18 files systematically. Added [CORRECTED 2025–11–18] notes to historical logs for audit trail. Then implemented defense-in-depth prevention:

Layer 1: Canonical source in docs/briefing/PROJECT.md
Layer 2: Repository URL section in CLAUDE.md
Layer 3: Repository URL in .cursor/rules/programmer-briefing.mdc
Layer 4: Pre-commit hook blocking hallucinated URLs

Four layers of protection. If an agent hallucinates the URL again, three briefing documents provide the correct one. If they ignore the briefings, the pre-commit hook blocks the commit. Defense in depth against LLM hallucination.

Additional hardening: fixed GitHub Pages Jekyll build (removed audit files with Liquid syntax from docs/), reduced logo size on pmorgan.tech homepage, updated documentation navigation.

By 6:59 PM, the infrastructure was hardened. E2E bug protocol established. URL hallucination eradicated and prevented. GitHub Pages building successfully. Documentation clean.

What systematic thinking costs and buys

The reactive approach would have been faster Tuesday morning. See bug, fix bug, push fix, move on. Maybe 30 minutes total. Ship the fixes, get back to features.

The systematic approach took four hours. Stop and analyze. Group related issues. Create comprehensive plan. Execute phases methodically. Add prevention layers. Document protocols.

Four hours versus 30 minutes. That’s the cost.

The benefit: completeness. Every related issue addressed, not just the visible symptoms. No partial fixes creating technical debt. Clear protocols preventing future reactive cycles. Infrastructure hardened against an entire class of bugs (LLM hallucinations). Clean commits with clear rationale.

This is cathedral building. You don’t fix one stone and move on. You build systems that prevent entire categories of problems. You establish protocols that scale beyond your personal oversight. You harden infrastructure against known failure modes.

Monday’s repository archaeology showed the cost of divergent timelines — 385 commits of parallel evolution that couldn’t merge. The systematic approach to branch integration, conflict resolution, and artifact extraction preserved valuable work while acknowledging what couldn’t be reconciled.

Tuesday’s pivot from reactive patching to systematic fixing showed what alpha readiness actually requires: not heroics, not speed, but systematic thinking under pressure. The discipline to stop, analyze patterns, create comprehensive plans, and execute completely.

The wizard works now. The repository is clean. The infrastructure is hardened. The protocols are documented. Alpha testing continues.

We built cathedrals, not shortcuts. That’s how you get to alpha-ready: systematic thinking, every time.

← Back to BlogAlso available on Medium