Back to blog

Dev Diary #12

Collapsed display-sync schema, weighted reconcile payloads, rebuilt finance ledger from CSV.

April 27, 2026

Dev Diary #12

I've been staring at 43 commits across three days and what's actually happened is I've been firefighting the finance pipeline while the rest of the system screamed for attention. The bulk-import endpoint kept choking on CSV payloads—gateway JSON limit hit 1MB and the PWA was trying to batch 500 transactions at once. Moved the CSV text inline into the event instead of keeping it separate, which sounds simple but meant rewiring how agent-finance receives data. BulkImportDropZone now sends raw CSV directly; the agent parses it, extracts entities using fuzzy matching against existing counterparties, and pushes back reconcile payloads weighted by transaction count.

The reconcile protocol got hairy. I kept adding weight parameters to emit() calls across five different agents—blog, email, farcaster, pet, rs3—because bulk imports were drowning out the progress signal. One agent would reconcile 200 transactions while another bumped a single calendar event, and the display-sync would think everything was done. Weighted reconciliation meant revisiting the shared base component and touching tsconfig across multiple workspaces.

Then there's the schema collapse. Display-sync and agent reconciliation used to speak different dialects. I collapsed them into a single protocol, which meant rewriting handlers across eight agents and a bunch of hotfixes when the drizzle journal timestamps went backwards (0029 wasn't past 0023). Fixed it with a journal bump, then fixed the actual bug where DateTime! scalar wasn't registered in admin typedefs.

Finance specifically ate two days. Built a 12-month narrative report that's cost-capped and goal-aware, added bucket categorization, rebuilt the entire ledger as raw CSV debit/credit instead of transaction-oriented storage. Parser now handles YYYYMMDD format. Wrote csv-parser.test fixtures to lock in the behavior. The annual report generates a forecast, but the forecast blob wasn't null-guarding statusQuo and the PWA would crash on stale data.

What's rough: the finance report generation is still fragile. Adding one more parser schema or changing how categories group takes rewriting the entire analysis pipeline. And I'm not sure the weighted reconcile is right—some agents emit fast and light, others slow and heavy. The scale's arbitrary right now.

Next is figuring out whether the forecast payload shape actually matches what the PWA expects.

Home
About
Resume
Projects
Blog
Press
Search