Skip to content

fix(quota-plane): preserve fresh Turso storage and rows-read measurements #6227

Closed

Description

@dezren39

Why

Follow-up to #5468. The Atlas writer and the cleanup/remediation are already identified there, but the quota feed no longer provides a fresh storage or rows-read window, so the 5 GB storage state and the over-limit monthly rows-read state cannot be verified.

This is a quota-measurement fix only. It does not authorize deleting or rewriting Atlas data, changing a Turso plan, or spending money.

Evidence at triage

  • Laptop quota-current.json at 2026-11-05T13:00:15.401Z: the Turso row is state=ok, source=opencode-quota, but contains only databases (44/100), rows-written (1,672,071/10,000,000), and sync (0/3 GB). Storage and rows-read are absent.
  • pm-stack/aggregator/src/quota-gather-map.ts defines entryFromTurso() to map storage_bytes and rows_read, but repository search found no runtime call site; the gatherer currently maps provider results with entryFromResult().
  • pm-stack/aggregator/src/quota-current.ts:432-468 overlays the latest fresh Turso entry by replacing the card's metrics with the windows present in that entry. A partial fresh entry can therefore hide previously dated storage/read metrics.
  • The earlier 2026-11-05 00:27Z measurement recorded 7.358009 GB storage and 821,437,321 rows-read; the 02:15Z read still recorded ~165.6% rows-read but omitted storage and rows-read windows. Those over-limit measurements are not evidence of present recovery.
  • Related: fix(quota-plane): quota-gatherer failing every tick since 2026-11-04T18:45Z — auth.openCodeLocalCredentialSource is not a function #5638 records the gatherer import outage and a successful recovery at 02:21Z; the current 13:00Z sample confirms the feed is ticking but still partial.

Acceptance

  • The live quota path provides authoritative Turso storage and rows-read measurements when the service response carries them, with source and measured-at timestamps preserved.
  • Missing metrics are represented as missing/stale, never as zero or as proof the issue recovered; a partial fresh Turso row does not silently erase the last dated storage/read values.
  • Add targeted fixtures/tests for complete, partial, and error Turso reads and the SaaS-card overlay behavior.
  • Keep credentials runtime-resolved and out of source, logs, packets, and comments. No plan changes, purchases, or Atlas data mutations.

Scope

Include the quota gatherer/provider wiring and its mapping/overlay tests under pm-stack/aggregator/.

Exclude changes to the Atlas producer or mirrored data, other providers, and plan/billing changes. Validate the Turso API/credential integration against the existing runtime resolution pattern before implementation.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. added
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/highImportant and time-sensitive
    queue/queuedHas a queued task in the Supabase agent queue
    effort/sSmall: expected under 2 hours of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · queued

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  6. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    🤖 Agent note · picked up

  7. added a commit that references this issue on Nov 5, 2026
  8. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions