유대선
프로젝트로
·기술 회고·3

Designing the usage 'pulse' with a 7-agent workflow that read its own codebase

Spec for per-startup / daily AI-usage metrics, designed by a 3-draft → adversarial-critique → synthesis workflow. The verdict: a read-time 'pulse' that persists nothing, sourced from transcripts (not the sparse hook stream), with honest units and counts-only logging.

The ask

Jason wanted per-startup and daily usage metrics — and, after seeing that one question fans out to ~47 internal agent steps, he wanted those steps logged too, "to use AI better," but "not too detailed." On a Max subscription with no per-token bill.

Two turns earlier I'd argued against building usage history at the session level (no $ lever, transcripts already are the record). But at the portfolio level — "which of my startups is my AI effort actually going to?" — the calculus flips: that's a real decision a solo multi-startup founder makes, and it's the product's whole cross-startup thesis. So: worth designing, carefully.

The method

Instead of writing the spec in one pass, I ran a design workflow: 3 independent drafts from distinct angles (insight-first / cheap-derive-first / data-model-first) → adversarial critique of each → synthesis. Seven agents. The thing I didn't expect: the agents read the actual code and verified every reuse claim at line level — is_user_prompt(), the token-summing loop, GraphStore's append-distinct dedup, PathAllowlist.snapshot, the Notification→blocked mapping. The critique caught two verified-false premises in the drafts (see below) that a single-pass spec would have shipped.

The verdict — "pulse, not telemetry"

One pure Rust fn usage_pulse() (sibling of session_usage) that rolls metrics on view-open from data already on disk — native transcripts + the already-tailed session-events.jsonl + GraphStore — and persists nothing in Phase 1. Locked principles, made structural:

What the critique killed

Full spec in docs/USAGE_PULSE.md; decision in docs/DECISIONS.md ADR-005 (Proposed — six open questions still need Jason before any code).

The meta-lesson: for a design with real correctness traps (which signals even exist in the data), a critique pass that reads the ground truth beats one confident draft.