Repository navigation
Description
Summary
The antigravity quota provider (packages/ai/src/quota/providers/antigravity.ts, 461 lines — the largest quota provider) keys every bucket window by a label derived from substring matching, defaults any unrecognized window string to "5h", and lets later buckets silently overwrite earlier ones with the same label. Its transforms (parseBucket, transformSummary, transformModels) are module-private, and packages/ai/test/quota.test.ts has zero antigravity coverage while sibling parsers were pinned in #1725 / #1750 (PR #1766).
Evidence (verified this run, main 4b9febf)
Probe on the laptop (~/git/fleet/probe-2026-11-05-antigravity-quota/, byte-identical copy of the source with only an export line appended — diff-verified identical) driving transformSummary / parseBucket:
- An unrecognized bucket overwrites the genuine 5h window with wrong data. Group buckets
[{window:"FIVE_HOUR", remainingFraction:0.5}, {window:"MONTHLY", remainingFraction:0.9}]produce a single"5h"window withusedPercent: 10,windowSeconds: 18000, and the monthly bucket's reset time (Dec 1).parseBucket(antigravity.ts:283-296) defaultslabel = "5h"/FIVE_HOUR_WINDOW_SECONDSwhen the window string matches neither week nor day keywords, andtransformSummary(antigravity.ts:326) doeswindows[parsed.label] = parsed.window— last wins, no trace of the dropped bucket. - Same-label collisions drop windows. Buckets
[{window:"WEEKLY", remainingFraction:0.25}, {window:"7D", remainingFraction:0.75}]both derive label"weekly"; the published window is the second one (25% used) and the first is silently gone.bucket5h/bucketWeeklyare overwritten the same way (antigravity.ts:327-328). This is the defect class fixed for opendesign in test(ai): quota suite pins none of claude / meta-billing / opendesign's pure parsers — billing banner rejects numeric strings, claude transform drops legacy windows when limits is non-empty, coding-plan publishes a zero-limit window #1750 ("duplicate durations keep the first entry instead of silently overwriting") and filed for codex in fix(ai): codex quota windows keyed only by derived duration label — a missing or shared limit_window_seconds silently drops one window, and an empty window object mints a phantom all-null window #1762 — antigravity has neither the fix nor the pins. - A missing
remainingFractionis treated as fully remaining for ordering.parseBucketreturnsremainingFraction: remainingFraction ?? 1(antigravity.ts:295) whileusedPercentis honestlynull. That invented1feedstransformModels' weekly-constrained comparison (antigravity.ts:355-358), so window ordering is decided by data the wire never sent.
Why it matters
Quota output drives pool-rotation decisions in this fork. A monthly (or any future/unrecognized) bucket silently relabelled as the 5h window publishes a confident, wrong used-percent with a mismatched reset time — worse than an honest absence (the groq provider's no-quota-surface precedent). Because the transforms are unexported, no test can pin any of this today.
Acceptance criteria
- Buckets whose window string is not recognized are not published under a fabricated
"5h"label (skip them, or surface them under a distinct, honest label) — disposition chosen and recorded in the fix. - Same-label bucket collisions follow the test(ai): quota suite pins none of claude / meta-billing / opendesign's pure parsers — billing banner rejects numeric strings, claude transform drops legacy windows when limits is non-empty, coding-plan publishes a zero-limit window #1750 convention (keep the first entry) for
windows,bucket5h, andbucketWeekly, instead of silent last-wins overwrite. - A bucket with no
remainingFractiondoes not participate in weekly-constrained ordering as if fully remaining (null/unknown propagates, or the comparison requires both fractions present). -
parseBucket/transformSummary/transformModelsare exported and pinned inpackages/ai/test/quota.test.ts: happy path per label, unrecognized window string, duplicate labels, missingremainingFraction, matching the probe cases above. - Existing quota suite stays green; gate state not regressed (the three quota-era gates already red on main belong to fix(ci): three gates red on main — PR #1722's quota subcommand landed 16 undispositioned sites, and turso bypasses the PR's own bounded reader #1724 — do not conflate).
Activity
dezren39 commentedon Nov 5, 2026
🤖 Agent note · filed
8 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off — task 10763 (queue repo-health-opencode-pilot, lane opencode-a)
opencode— the laptop claimant launches the bound opencode session, which drives this task to its terminal state. This worker did not create a worktree or start the fix.dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off — task 10763 (queue repo-health-opencode-pilot, lane opencode-a)
handed_off; the laptop claimant (opencode-claimant) launches the bound opencode session that drives this task to its terminal state.dezren39 commentedon Nov 6, 2026
🤖 Agent note · adopted as phase 2 of design #1794 (one window contract for the provider quota parsers; doc:
files/designs/opencode-quota-window-contract.md, keep-the-four-repos-healthy goal workspace). This issue is the contract's antigravity application: rule 6 (unknown kinds skipped, not renamed"5h"), rule 2 (duplicates keep the first), rule 3 (a missingremainingFractionis null, never 1). Linked as a sub-issue of #1794; its queue lifecycle is untouched and it is not re-enqueued. When it lands, design phase 1's inventory row for antigravity flips from known-lossy to conforming and its matrix cases join the asserted set.dezren39 commentedon Nov 6, 2026
🤖 Agent note · parked — task 10763 (queue repo-health-opencode-pilot, lane opencode-a)
bun test test/quota.test.tsin packages/ai — 83 pass, 0 fail (6 new fix(ai): antigravity quota buckets keyed only by derived label — an unrecognized bucket overwrites the real 5h window, same-label buckets silently drop, missing remainingFraction counts as fully remaining #1768 cases);bun run typecheck(both tsgo passes) clean.Merge pull request #1837 from developing-today-forks/queue/10763-1768…
dezren39 commentedon Nov 6, 2026
agent-note:v1 — state: completed via PR #1837 merged 2026-11-06; task 10763 complete. No Codex findings on #1837; mergeable clean; no gh CI checks reported for this repo — merge rested on diff vs acceptance + PR-recorded quota.test.ts 83 pass / typecheck clean.