The Sonar Chronicles
in the style of Dan Brown
Chapter 3 of 8
35%
Chapters
I · The Blueprint
scaffold project · Mar 15
II · The Extraction
add extractor · Mar 16
III · The Mind
add analyzer · Mar 17
IV · The Voice
add narrator · Mar 18
V · The Wiring
wire CLI · Mar 19
VI · The Proof
verify build · Mar 20
VII · The Specimen
sample outputs · Mar 21
VIII · The Codex
code snippets · Mar 21
Previously: The extractor learned to parse raw commit data — counting files, detecting languages, and pulling function signatures from diffs. The system could see, but it couldn't yet understand.
Chapter III
The Mind

The diff was sixty-three lines long, but its true weight couldn't be measured in lines of code. Dr. Sarah Chen stared at the terminal, knowing that what she was about to build would give the system something no parser could provide — intent.

She opened the analyzer module and began typing. The architecture was elegant in its simplicity: take the raw diff, combine it with the extractor's hard facts, and ask an intelligence far greater than any linter to find the meaning.

async function analyze(diff: string, facts: Facts): Promise<IR> { const response = await claude.messages.create({ model: "claude-sonnet-4-20250514", messages: [{ role: "user", content: buildPrompt(diff, facts) }] }); return parseIR(response); }

The function was deceptively simple. But inside that buildPrompt call lay the real architecture — a carefully constructed prompt that would teach the LLM to see what humans see when they read code.

The prompt didn't ask "what changed?" — any diff tool could answer that. It asked "why did it change?" and "what decision does this reveal?" The IR it produced would capture intent, architecture decisions, and narrative hooks — the raw material a storyteller needs.

interface IR { intent: string; // What the developer was trying to achieve architecture: string[]; // Structural decisions revealed decisions: Decision[]; // Why this approach over alternatives narrative_hooks: string[]; // What makes this commit interesting }

Sarah ran the analyzer against the test commit. The terminal filled with structured JSON — not a story yet, but the skeleton of one. The mind could think. Now it needed a voice.