Skip to content

aggregator: forecast per-pool quota exhaustion intervals #3983

Open

Description

@dezren39

Parent chain: #1184 → #1256 → this issue. GitHub currently caps #1184 at 100 direct sub-issues and rejects additional links (REST 422), so implementation slices are nested under #1256, already a native child of #1184; no existing parent links were changed.

Design context: #1256; doc/2026-11-01T21-07-00Z_design_pm-stack_forecasting/2026-11-01T21-07-00Z_design_pm-stack_forecasting.md (§2). Depends on the measured live-rate contract in #3933; do not duplicate its quota extraction or near-limit/wall threshold rules.

Goal

Add a time-to-exhaustion interval that composes live per-pool usage, observed rate, and reset time, complementing (not replacing) the existing point-pace and quota-wall derivations.

Acceptance criteria

  • Consume the live quota contract from aggregator: finish quota throughput data + record the design contract (#851) #3933: pool identity, remaining/limit, reset time, measured timestamped burn, source age/coverage, and explicit missing/estimated markers.
  • Where enough fresh rate observations exist, return an exhaustion interval and whether its P50/P80 falls before or after reset; expose the rate window and source.
  • If rate, remaining amount, or reset is missing/stale, or there is no measured burn history, return an explicit unknown state rather than “safe” or a fabricated date.
  • Reuse aggregator: finish quota throughput data + record the design contract (#851) #3933 existing near-limit/wall rules; do not add another threshold/attention path. Queued issues are not converted into token demand; any scheduled-work scenario must be separately labelled and use attributable measured inputs.
  • Tests cover reset boundaries, stale/missing rates, zero rate, limit already reached, and a measured exhaustion-before-reset case.

Activity

  1. added
    kind/featureNew feature or capability request
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 1, 2026
  2. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  3. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 3, 2026
  5. 105 remaining items

  6. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Picked up by repo-worker-code-f — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-f posts progress markers; after 30 minutes of silence any other worker may pick this up.)

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

    @developing-today
    Contributor

    Progress from repo-worker-code-f: triaged: CONFIRMED unbuilt on be7346d; dependency #3933 not landed (collector still burn: []); routing fix gated on #3933

  9. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    🤖 Agent note · triage done — CONFIRMED unbuilt; dependency #3933 NOT landed, fix routed gated on it

    • Agent: queue worker lane F (repo-worker-code-f), fallback claim (queue backend down, code#6619)
    • Verdict: Scope CONFIRMED against fresh origin/main be7346dadd6dbd305d7f64a19140df16c4f72b5a — no exhaustion-interval derivation exists yet — but the fix is gated: its named dependency, the measured live-rate contract in aggregator: finish quota throughput data + record the design contract (#851) #3933, has not landed.
    • Evidence (unbuilt): the only pace derivation is the point estimate projectPace in pm-stack/aggregator/src/derive.ts (projectedExhaustionAt / projectedPercentAtReset from a linear pct slope) and a point wall estimate in src/digest.ts:358-366 from burnTokensPerMin. No interval type, no P50/P80, no explicit unknown-state result for pools — the acceptance criteria are unmet and unstarted. (src/forecast.ts is the epic-ETA module from aggregator: derive epic ETA bands and explainable stall risk #3982, a different surface.)
    • Evidence (gate): aggregator: finish quota throughput data + record the design contract (#851) #3933 is OPEN (status/triaged), and its core gap persists on main: pm-stack/aggregator/scripts/collect-fleet-feed.ts:950 still emits burn: [] — measured burn history is not populated live — and the collector does not populate burnTokensPerMin (the field exists in src/model.ts/src/feed.ts and in fixtures only). An interval built today would have no measured burn history to consume, which is exactly the fabricated-forecast failure the acceptance criteria forbid ("explicit unknown state rather than a fabricated date" is the fallback for missing inputs, not a substitute for the contract).
    • Routing: this issue is now the fix task — task/fix + status/triaged + status/blocked + queue/queued, gated on aggregator: finish quota throughput data + record the design contract (#851) #3933 landing live burn segments + measured rate in the collector. On gate clear, the shape is: a pure interval derivation beside projectPace in derive.ts consuming aggregator: finish quota throughput data + record the design contract (#851) #3933's contract fields, reusing its near-limit/wall rules (no new threshold path), with the acceptance tests (reset boundaries, stale/missing rates, zero rate, limit reached, exhaustion-before-reset) in the aggregator suite via CI.
  10. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Released by repo-worker-code-f (outcome: done). Triage CONFIRMED unbuilt (only point pace in derive.ts; no interval/P50/P80); dependency #3933 OPEN and its collector gap persists (burn: [] at collect-fleet-feed.ts:950). Fix routed on #3983 gated on #3933: task/fix + status/triaged + status/blocked + queue/queued.

  11. added
    task/fixhas a fix task queued
    status/triagedTriaged and routed (see agent note)
    status/blockedQueue or user escalation state
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 7, 2026
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/mMedium: expected under 1 day of workkind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)queue/queuedHas a queued task in the Supabase agent queuesource/queue-workerFiled or worked by the queue/worker pilotstatus/blockedQueue or user escalation statestatus/triagedTriaged and routed (see agent note)task/fixhas a fix task queued

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions