Skip to content

Model data pipeline: workbook-free append-only event log + agent interpretation #1248

Open

Description

@dezren39

What

Replace the Drive-workbook → Postgres import for model/benchmark data with a workbook-free, append-only event log in the muse-dev Supabase (alongside the existing ainventory schema), plus an agent interpretation pass whenever new data lands.

Full design: ~/workspace/goals/supabase-muse-dev-platform-backups/files/aa-event-log-design-2026-10-26.md (Drew's brief, 2026-10-26).

Core requirements

  • Append-only: measurement and price data are INSERT-only event rows with full provenance (source kind: aa / modelsdev / firstparty / thirdparty / probe / provider-doc; source URL; source date; ingest timestamp). Never edit an existing measurement. "Current" is a view: newest per (model × effort × benchmark × benchmark version), so a model's history across weeks and benchmark versions stays comparable.
  • Notes as data: dated notes/anecdotes attach to models and ingest batches, attributed by kind — first-party claims (e.g. vendor launch claims), third-party reports, agent observations. Multiple per model; never collapsed into a single summary.
  • Dimensional pricing: price rows carry a context band (min/max tokens — Luna/Haiku charge differently ≤100k vs >100k) and a time window (flat / peak / off-peak with hours). Cost per task is computed per band and per window.
  • Provider pricing policy: a versioned table recording, per provider (and model/family scope), whether that provider passes windowed pricing (DeepSeek peak/off-peak) through or charges flat — seat valuation depends on it.
  • Gather + interpret loop: a scheduled gatherer pulls AA + models.dev + provider catalogs, diffs against the current views, inserts only new observations, and dispatches an agent to interpret each non-empty batch (batch note + follow-up research). New-model detection is part of the diff.

Migration path

  1. New tables/views land beside ainventory (archive stays readable).
  2. Backfill current values from ainventory as first events (source kind workbook-import, dates preserved).
  3. Explorer collector (fleet feed aa section) switches to the new views at parity.
  4. Retire the workbook leg of coding-plan-watch-daily after a clean week.

Open questions (from the design doc)

  • AA structured access vs page scraping for the gatherer.
  • DeepSeek peak/off-peak exact windows/multipliers (verify from the official pricing page — do not encode from memory), and which of our DeepSeek doors pass the window through vs charge flat.
  • Context-band edges per provider stay in data, not code.

Acceptance criteria

  • Measurement and price data are INSERT-only event rows in muse-dev Supabase with full provenance (source kind, source URL, source date, ingest timestamp); no code path updates or deletes an existing measurement.
  • A 'current' view returns the newest row per (model × effort × benchmark × benchmark version), and a model's history across weeks/benchmark versions remains queryable.
  • Price rows carry a context band (min/max tokens) and a time window (flat / peak / off-peak with hours), and cost-per-task is computed per band and per window.
  • A versioned provider-pricing-policy table records per provider (and model/family scope) whether windowed pricing is passed through or charged flat.
  • The scheduled gatherer (AA + models.dev + provider catalogs) inserts only new observations, detects new models, and dispatches an agent interpretation pass for each non-empty batch (batch note + follow-up research filed).

Activity

  1. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  2. added
    effort/l
    meta/enriched
    priority/normal
    status/needs-triage
    on Oct 27, 2026
  3. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: #1249 (Terra follow-up data hunt — its findings are an early consumer of this pipeline), design: ~/workspace/goals/supabase-muse-dev-platform-backups/files/aa-event-log-design-2026-10-26.md.

    Notes: This replaces the Drive-workbook → Postgres import. The design doc is the spec; the body already enumerates the core requirements, which this pass restated as testable acceptance criteria.

    Risks: Schema work in muse-dev touches the same project as the repo queue (agent schema) — keep the new schema separate (alongside ainventory) and additive-only, per the queue pilot's migration discipline. Benchmark-version comparability is the subtle part: never let a 'current' view silently mix benchmark versions.

    Suggested approach: Build in slices: event tables + current view first (import one AA snapshot by hand), then notes, pricing dimensions, policy table, and the gather+interpret loop last.

  4. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Phase 1 complete — event log live beside the workbook era, parity proven, gatherer dry-run working

    1. Schema (migration 0013_aa_event_log.sql, applied to ainventory)

    New tables, all additive beside the untouched workbook-era tables, RLS on with no policies (same posture as existing tables):

    • measurement_events — INSERT-only: model (+ variant key, run key), effort, benchmark + benchmark_version split out, metric, value, intelligence index, TTFT s, output t/s, output tokens/task, cost/task, task time, source kind/ref, source_date (the source's own date), ingested_at, ingest_batch_id, raw jsonb.
    • price_events — INSERT-only, dimensional: $/1M in/out/cached/cache-write × context band (context_min/max_tokens) × time window (flat|peak|offpeak + hours/TZ), provider (null = list price).
    • provider_policies — versioned by new rows: per provider/scope, window behavior pass_through|flat|unknown.
    • notes — kind-checked (first_party_claim|third_party_report|agent_note|anecdote), attachable to a model and/or an ingest batch.
    • ingest_batches — one row per gather run.
    • Views v_current_measurements / v_current_prices — DISTINCT ON the natural key, newest source date → newest ingest → highest id.

    Append-only is enforced, not just conventional: BEFORE UPDATE/DELETE triggers raise on the three event/policy tables (proven live: an UPDATE fails with ainventory.measurement_events is append-only (issue #1248)), and UPDATE/DELETE grants are revoked from all API roles.

    2. Backfill (ainventory-import/backfill_event_log.sql, counts read back from the DB)

    • 779 measurement_events: 642 from benchmark_results + 137 from the latest batch's Rankings rows. The 10 ingest_batches rows reuse the original workbook import_batch uuids; ingested_at is each row's original import time; source_date preserves AA snapshot dates (2026-09-28 / 2026-10-16 in Rankings keys, per-row raw dates in benchmark_results). model_id resolved for 656/779 (84%).
    • 4 price_events — all the per-token price history that exists (ModelsDev_Raw_Selected sheet).
    • 4 provider_policies seeds — the DeepSeek doors (direct, OpenCode Go, ClinePass, OpenDesign) recorded as unknown: the design's instruction was to verify pass-through vs flat from sources, not encode a guess.
    • 4 source rows deliberately excluded: 3 benchmark_results rows + 1 Rankings row carried an Excel #VALUE! / blank score — no AA measurement existed, so no event was fabricated. Accounted for in a batch agent_note.

    3. Parity vs v_rankings — PASS (report: goals/supabase-muse-dev-platform-backups/files/aa-event-log-parity-2026-10-27.md)

    For every (variant key × effort), the current view was compared against v_rankings' newest-snapshot row: 107 distinct keys both sides, 0 missing, intelligence 107/107 exact, cost 107/107 within the workbook's own 2-dp rounding, speed 106/107 within rounding. Spot-checked field-by-field: GPT-6 Luna max (38 / $0.07 / 122.1), GPT-6.1 Sol max (52 / $0.72 / 57.1), Claude Haiku 5.5 max (43 / $0.21 / 238.4), DeepSeek V4.1 Flash max (39 / $0.27 / 217), DeepSeek V4 Pro 0813 max (36 / $0.674 / 89.03).

    The single divergence is instructive: V4 Pro speed — the workbook carries 93 t/s, AA's own page says 89.03, and the view prefers the AA-direct event. The old pipeline hid exactly this class of discrepancy by overwriting. Two Phase-2 data-quality notes from the report: variant keys were renamed between snapshots (reasoning → yes segment), creating parallel series for a few models; and TTFT exists nowhere in the backfill (it lived only in Test_Runs) — it starts with the live gatherer.

    4. Gatherer dry-run (ainventory-import/gather_events.py, diff at ainventory-import/dry_runs/gather_diff_2026-10-27.json)

    AA has no open structured endpoint (the v1 API 404s without a key), but the /models page embeds a full per-variant JSON payload — the gatherer parses that, plus models.dev/api.json, and diffs against the current views. Zero writes (event counts verified unchanged after the run). Would-insert diff for 2026-10-27:

    • AA measurements: 15 (live II is decimal-precise vs the workbook's rounded ints, e.g. GPT-6 Astra 52.67 vs stored 53; plus new observations like Muse Spark Open xhigh) — 1 unchanged.
    • Prices: 15 from AA + 53 from models.dev, the latter with context bands split correctly (GPT-6.1 Sol: $2/$10 up to 272k context, $4/$15 above it — the dimensional model working as designed).
    • New models flagged: 17 — including GPT-6.1 Terra (released 2026-10-26) and Reflection Beam 1.0, the two models invisible to the workbook pipeline today. A few flags are identity near-misses the interpretation pass should adjudicate (Mistral Large 4 vs our …-preview key; models.dev's deepseek-v4-flash vs AA's v4.1 checkpoint naming).

    Phase 2 (remaining — this issue stays open)

    1. Live gatherer: flip gather_events.py from dry-run to insert mode (one ingest_batches row per run; events only for the diff), on the schedule that replaces the workbook leg of coding-plan-watch-daily.
    2. Interpretation dispatch: each non-empty batch dispatches an agent that writes the batch note (what changed, pool implications, research follow-ups) and files the research trail for each genuinely new model (Terra-style follow-up), adjudicating identity near-misses.
    3. Canonical identity resolution: merge parallel series (snapshot key renames, AA vs models.dev naming) into the models dimension with alias mapping, so new-model detection stops flagging renames.
    4. Explorer switch: point the fleet-feed AA collector at v_current_measurements / v_current_prices (parity above is the gate — it passes).
    5. Price/window verification: DeepSeek peak/off-peak windows + multipliers from the official pricing page, and per-door pass-through vs flat — fills the provider_policies seeds and windowed price_events.
    6. Workbook retirement: after the live gatherer runs clean for a week, retire the workbook import leg of coding-plan-watch-daily (archive tables stay readable).
  5. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Pointer (2026-10-27): a permanent findings event store now exists at files/findings-event-store.md in the keep-the-four-repos-healthy goal workspace — append-only, structured entries (subject, finding, evidence, significance, action), written by pool-intelligence, pool-composition-review, and the steward for all pool/model findings, qualitative and quantitative. When this issue's workbook-free event-log pipeline lands, it should consume/subsum the findings store rather than start a parallel one; the store's entry format is documented in its header.

  6. added
    work/assigned
    queue/claimed
    status/in-progress
    and removed
    status/needs-triage
    on Nov 1, 2026
  7. 33 remaining items

  8. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Phase 2 slice 2 (#10040) implementation is in PR #11439: #11439. It adds append-only interpretation-run/findings tables and the gatherer-only awaiting view, plus a CLI for recording batch notes/follow-ups/findings and importing structured findings exports. Migration 0026 was applied to muse-dev2 during execution. Live verification: six batch interpretation runs and six findings; the awaiting queue is empty. The canonical Markdown findings-store file/design doc named in the issue was not available on this host, so the importer accepts JSON exports rather than assuming a Markdown grammar.

  9. removed their assignment
    on Nov 20, 2026
  10. dezren39 commented on Nov 21, 2026

    @dezren39
    MemberAuthor

    agent-note:v1

    #1248 Phase 2 slice 4 (Explorer switch, task 16924) is implemented in PR #12221: #12221. Latest configs/cai payloads use the current-measurements projection; historical batches preserve workbook-import AS-OF scope. Focused tests pass (3 SQL, 24 batches/cache), and live collector/fingerprint query results match exactly (133 configs, 27 CAI rows). Latest-snapshot parity: 109 common keys of 110, scores 109/109 exact, costs 109/109 within rounding, speeds 108/109 within rounding; one absent key and the known DeepSeek speed divergence are noted in the PR. Typecheck could not run because the worktree lacks Bun type definitions. CI pending.

  11. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Phase 2 slice 3 (identity resolution, #10041) is implemented in PR #12271: #12271. AA measurements and AA/models.dev price rows now resolve to unambiguous canonical ainventory.models rows (name + model_id); ambiguous and unknown spellings are not merged. Focused gatherer tests pass (12), with no schema or live DB writes. Awaiting PR CI/review.

  12. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Slice 3 (#10041) merged in PR #12271 (merge commit b55741493708d0968b0e4f08d7296a5beb8a1949). The identity-resolution change landed with the focused 12-test suite passing. #10041 is closed; downstream #10042 can proceed against the canonical AA/model identity behavior.

  13. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Second-pass verdict (openchamber lane oc-code-03, queue task 21738, 2026-11-24)

    Fresh state: #1248 OPEN, task/triage, effort/l, epic/pm-stack. Slice 3 landed (PR #12271) and the identity-resolution change is recorded above. The remaining slices carry their own follow-on, so no new packet is routed from this pass.

  14. dezren39 commented on Nov 26, 2026

    @dezren39
    MemberAuthor

    Triage (queue task 24959, lane 11, 2026-11-26): keep open. Every Phase 2 slice but one has landed, and the last one waits on its calendar gate.

    No new packet. The remaining slice already has its own issue and gate, and this parent can close when #10044 does.


    Generated by Claude Code

  15. dezren39 commented on Nov 27, 2026

    @dezren39
    MemberAuthor

    Triage confirmation (queue task 25453, xaltha, 2026-11-26): keep #1248 open — confirms lane 11's task-24959 verdict from earlier today, re-verified independently.

  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (lane CEN-C01) — body + all 22 comments re-read; concurs with the 2026-11-26 triages (tasks 24959, 25453):

  17. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): full re-read (body, labels, all comments, edges) in the CODE-6 recovery pass, concurring with the parallel census note (lane CEN) already on this thread, whose claims I verified against live state in this pass. STRENGTHS: phase-2 accounting is exact — slices #9999/#10040/#10041/#10042/#10043 all CLOSED. PRIORITY VALIDATION: priority/normal, single, correct. FIXES I APPLIED: none needed. REMAINS: sole remainder is #10044 (workbook retirement), parked on its calendar gate — one clean week of the live gatherer (#9999) plus the recorded Excel-retirement checks; no Drewry decision needed.

  18. added
    status/triaged
    app/pm-stack
    on Nov 29, 2026
  19. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: No status/* or lifecycle label and no app/*/area/* label. Added status/triaged and app/pm-stack (the pipeline feeds the PM stack's model/route data). An ## Acceptance criteria section is present.

    Strengths: The design choice is stated up front (workbook-free, append-only event log + agent interpretation) — the anti-pattern it replaces is named in the title, so the rationale survives.

    Note: lane CEN-C01 also posted a census comment on this issue earlier today (analysis only, no edits). This pass re-verified the live state and applied the metadata fixes below, so the two comments complement rather than duplicate each other.

    Actions taken by this census: Labels added: status/triaged, app/pm-stack.

  20. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Phase 2 slice 6 update — 2026-11-29 (task 16926, lane code-h)

    Slice 6 (#10044, workbook retirement) was rechecked after its clean-week date. #9999 is CLOSED (2026-11-25); #10040 is CLOSED (2026-11-23); #10042 is closed/in-review and Explorer PR #12221 merged 2026-11-22T18:02:11Z. Calendar time has elapsed, but no available run logs prove one clean live week for both slices 1 and 4, or that the event-log path covered every daily run without a gap. The laptop cron workspace/design/run logs were not readable from this seat. No retirement performed; #10044 is parked until that evidence is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackeffort/lepic/pm-stackkind/enhancementmeta/enrichedpriority/normalsource/creatorstatus/triagedtask/triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions