Repository navigation
Description
Leg of epic #1149 (quota-plane Stage 2). Filed at Drew's direction, 2026-10-29: "there was supposed to be a unification in the 3 quota read methods." There wasn't — three independent quota readers exist today, they resolve credentials three different ways, and they disagree. This issue is the unification leg of #1149; it cross-links the legs it absorbs or depends on rather than replacing them.
The three readers
- OpenChamber web server
/api/quota/*— resolves credentials through the running OpenCode server'sGET /api/credentialprojection (openchamberserver/index.js:1647; projectionserver/lib/opencode/auth.js:91, 203-230, active rows only). openchamber quotaCLI — server-first, with a direct credential-store fallback (openCodeLocalCredentialSource, readingopencode.dbread-only). Built 2026-10-27 under fix(quota-plane): opencode-serve boot verification + quota CLI per-provider resilience (no wholesale transport failure) #1251, which deliberately switches to the store ONLY on transport failure and stamps each rowcredentialSource: server|local.- PM-stack aggregator gatherer (
pm-stack/aggregator/scripts/gather-quota.ts:10-19, 116-149) — readsopencode.dbdirectly, by design, because the server-API path is known to diverge (fix(quota-plane): opencode-serve boot verification + quota CLI per-provider resilience (no wholesale transport failure) #1251), replicates the server's projection itself, and additionally ingests bespoke per-provider file exporters (Meta:pm-stack/meta-exporter/meta-quota-export.mjs). Writesquota-current.jsonon a ~15-minute systemd tick.
Divergence evidence (2026-10-29, same evening, same pools)
- Antigravity: the hub (reader 3) reads the pool fine — state ok, Gemini weekly 4%, Claude weekly 57% @ 2026-10-30T00:15Z. Reader 1 returns
{"ok":false,"configured":false,"error":"Not configured"}. Root cause, pinned in fix(quota): /api/quota/antigravity reports 'Not configured' while the aggregator hub reads the pool fine — dispatcher gate treats a primary pool as unavailable developing-today-forks/openchamber#858: the server credential projection drops the refresh token that openchamber's antigravity resolver requires (providers/antigravity/auth.js:69-94), while the sibling google provider accepts the same entry with an access token alone — google answeredok:trueon the same server in the same pull. Compounding: the resolver swallows credential-store errors (providers/antigravity/index.js:36-38), so a failed read is indistinguishable from "no login exists." - Meta: the route is verified healthy (opencode#818 closed/completed), but reader 3's private exporter has failed every tick since its last ok tick at 2026-10-29T16:15Z with
subscription-quota: field windowReset not a finite number— one null reset from an inactive window fail-closes the whole export (diagnosed on feat(quota-plane): Meta adapter Phase 1 — laptop-side quota exporter (subscription-quota API, 15-min file export) #1301). The hub's file-export entry reads "unparseable" and its openchamber meta entry carries null percentages on both windows: a primary pool unreadable for 8+ consecutive steward runs. - OpenDesign: absent from the hub entirely until its provider deployed to the laptop instance (Deploy + verify: Open Design quota provider live on the laptop instance (running build predates #497/#520; credential import still owed) developing-today-forks/openchamber#536; deploy landed 2026-10-29, credential import still owed).
Meanwhile #2135 unified only the consumers — the steward went snapshot-first onto quota-current.json — but the dispatcher still live-probes reader 1, so consumers still disagree about the same pool at the same moment.
Why it matters
The fleet measurement gate forbids placement on a pool without a fresh read ≤60 min old. Every reader disagreement therefore closes a primary pool: Antigravity is the Gemini Flash pool's ONLY source and carries the Claude seats' clean read; Meta is a primary pool. The cost is burn-by-expiry — Antigravity's weekly (4% used on the Gemini tiers) resets Sat Oct 31 8:11 AM CDT largely unspent while OpenCode Go's monthly sits at ~96%. Three readers also means three places for the same bug family to recur (cf. the exporter's sibling defects #2460/#2461/#2470).
Proposed target state
One canonical read module: the direct credential-store read (the semantics reader 3 already implements and reader 2 falls back to) plus the shared provider fetchers, consumed by:
- the OpenChamber server endpoint (no more server-projection-only resolution),
- the CLI (no server-first/store-fallback split — one path, one provenance),
- the gatherer, which keeps its 15-minute tick and file-export ingestion but imports the same read module instead of carrying its own projection logic.
Exception providers fold into the same path where their integration plans allow (#1167/#1301 for Meta, #1169 for Google/Antigravity — this issue absorbs #1169's read-path half; the login/token-capture half stays with #1169). Per-provider error states stay distinct end-to-end: not-configured vs store-read-failure vs provider-error are different facts and must never collapse into one another.
Acceptance criteria
- All three surfaces (server endpoint, CLI, gatherer/hub) return identical windows for the same pool in the same tick, demonstrated on Antigravity, Meta, and one ordinary pool (e.g. ClinePass or OpenCode Go).
- No surface can report
not-configuredfor a credential the direct store read resolves. - Dispatcher, steward, babysitter, and the /quota UI consume one source with identical semantics (the Pool quota steward: consume the compiled hub numbers — probe only stale pools, follow-ups daily #2135 snapshot-first rule extends to the dispatcher's gate).
- A credential-store read failure surfaces as its own error state on every surface, distinct from
not-configured(the fix(id-world): manifest plan leaves omitted grants/ceiling/schedules/profile alone (#817) #858 resolver swallow is gone or subsumed). - The Meta exporter path either folds into the shared module or its parser contract is enforced by the same validation the shared path uses — a single bad field can no longer poison a whole pool's export.
Related
- Epic: epic(quota-plane): Stage 2 — 15-minute quota gathering in the PM stack, token adapters, automated pool decisions #1149 (this issue is its read-path unification leg)
- fix(quota-plane): opencode-serve boot verification + quota CLI per-provider resilience (no wholesale transport failure) #1251 — quota-plane resilience; origin of the known server-vs-store divergence and the CLI fallback
- plan(quota-plane): exception integration — Google/Antigravity (login, token capture, panel API) #1169 — Google/Antigravity exception integration (read-path half absorbed here by reference; token capture stays there)
- plan(quota-plane): exception integration — Meta (login, token capture, console API) #1167 + feat(quota-plane): Meta adapter Phase 1 — laptop-side quota exporter (subscription-quota API, 15-min file export) #1301 — Meta exception integration + exporter (fix expedited 2026-10-29 at priority 90; its parser fix is a down payment on the last acceptance criterion, not a substitute for this issue)
- feat(quota-plane): split gatherer rows per pool — OpenCode Go per-workspace + Antigravity pool grouping for the /quota overlay #1331 — gatherer per-pool row split (the gatherer's row shape this unification must preserve)
- fix(quota): /api/quota/antigravity reports 'Not configured' while the aggregator hub reads the pool fine — dispatcher gate treats a primary pool as unavailable developing-today-forks/openchamber#858 — the endpoint symptom (Antigravity "Not configured")
- Deploy + verify: Open Design quota provider live on the laptop instance (running build predates #497/#520; credential import still owed) developing-today-forks/openchamber#536 — OpenDesign deploy/import state
Activity
developing-today commentedon Oct 30, 2026
CODE-1270
dezren39 commentedon Oct 30, 2026
agent-note:v1
Agent: quota-unification-filer
State: filed
Found via: Drew, 2026-10-29 — "there was supposed to be a unification in the 3 quota read methods"
Filed at Drew's explicit direction (2026-10-29 ~20:19 CDT). This is the read-path unification leg of epic #1149: the OpenChamber /api/quota endpoint, the
openchamber quotaCLI, and the pm-stack aggregator gatherer each resolve credentials differently and disagree about live pools — Antigravity blind via the server projection (developing-today-forks/openchamber#858), Meta poisoned in its private exporter (#1301), OpenDesign absent until deployed (developing-today-forks/openchamber#536).Enqueued as a triage task on repo-health-code-pilot. Triage should confirm the shared-module shape (direct credential-store read as canonical, per pm-stack/aggregator/scripts/gather-quota.ts), rule on how #1169's read-path half folds in, and route the phased fix packets. Nothing self-assigned.
dezren39 commentedon Nov 1, 2026
Scope extension + fresh evidence — 2026-11-01 (Drew: "unify 1 quota path for all")
Drew re-issued the unification order tonight after the Command Code meter dispute. #2490 already covers the three readers; tonight's failures show the unification must also cover the consumer side, or the readers can agree and the surfaces still disagree:
pm-stack/aggregator/src/quota-extract.tsregex-parses dated prose out of the stewardship quota view and renders it as current pool state. On 2026-11-01 it presented a week-old Command Code read as current (defect filed separately as Quota reads: Command Code reports plan windows, not the top-up balance (extractor renders stale read) #3410). Under the unified design, the aggregator consumes the canonical record (quota-current.json/ its successor) only; prose extraction is retired as a data path — the view stays a human log.quota-current.json, while the fleet feed's pool mapping shows 84%/87%. One canonical record, one mapping — consumers never re-derive percentages.packages/web/server/lib/quota/providers/command-code.jsbuilds its monthly figure from/alpha/billing/creditsas a balance window (usedPercent: null); only 5h/weekly come fromwindowLimitsas real plan windows. The canonical module needs a plan monthly window for Command Code (console-format: monthly limit % of the $10 included credits).Acceptance addition: with the unified path live, one timestamped read per pool exists at any moment, and the dashboard, feed, steward view, and quota-check all show the same figures for the same pool at the same time (spot-check Command Code + both Go workspaces).
dezren39 commentedon Nov 1, 2026
Drew prioritized this in main chat 2026-11-01 (~02:01 CST) after tonight's Command Code / Go mapping disputes. Queue task 3721 moved from priority 90 (the last band — lower claims first) to priority 10, verified head of repo-health-code-pilot. The 2026-11-01 scope-extension comment above (consumer-side unification, plan-not-balance invariant, #3410) is part of the job.
85 remaining items
dezren39 commentedon Nov 14, 2026
agent-note:v1
state: triaged
Concurrence note (2026-11-14): this issue was triaged fresh earlier today by lane any-d (task 15235, note 2026-11-14T11:53Z); this lane re-verified the routing rather than re-triaging.
commands-quota.jsfallback composition) and server leg (routes.jsinjected providers) still split from the direct credential-store read; parity/error-state verification never demonstrated.Task 16785 completes as triaged (concurring), naming task 16782.
dezren39 commentedon Nov 16, 2026
Same-tick parity + error-state verification (2026-11-16T14:22:06–14:22:22Z, this machine)
Surfaces compared in one tick:
openchamber quota --json antigravity meta codex— direct credential-store source.registerQuotaRoutes(app)with no injection — providers resolved fromlib/quota/index.js), direct credential-store source wired.openchamber quota, which reached the same store through its fallback leg (credentialSource: localon every result — no server answered).opencode quota --json antigravity meta codex, plus its last real tick'squota-current.json(generated 2026-11-16T14:15:02Z, sourceopencode-quota).Results:
_openaiids)Antigravity is the error-state case: the credential store holds no
googleOAuth row (only google.* API keys) and no antigravity accounts file exists, so "Not configured" is the store's true answer, and the three openchamber surfaces agree on it exactly. The gatherer's deployedopencodebinary still answers Antigravity from its own pre-unification reader (it finds a candidate the store does not hold and fails refreshing it). That divergence lives in the deployed binary, not in any reading path this PR controls: it converges when the opencode binary is next built from the unified quota source, and the gatherer's mapping consumes the subcommand JSON unchanged either way. Meta and Codex — the configured pools — are in exact parity across all four surfaces, including per-credential rows.Deliberate reporting change recorded per the acceptance criteria: with the direct store read as the only source,
servedBy()collapses — every CLI result is stampedcredentialSource: 'local', and the stderr "server unreachable → local store" note is removed (there is no server read left to mistake it for; the help text names the single source). An unreadable store now fails the CLI run with the store's error instead of being masked by a fallback (pinned by a new test).Implemented in PR #2318: CLI composition removed,
routes.jsresolves providers from the quota module directly (injection kept only as a test pass-through),openCodeLocalCredentialSourcereportsusesLocalStore() === true. Quota test tree: 951 tests passing.dezren39 commentedon Nov 17, 2026
agent-note:v1
state: triaged (queue task 18230, openchamber scheduled lane code-f)
Fresh check 2026-11-17: issue open, kind/design, epic/pm-stack. Already triaged on 2026-11-14 (tasks 15235, 16785), and the 2026-11-16 same-tick parity comment records the unified direct credential-store read in an in-flight PR. Remaining work is that PR's merge plus the opencode-binary rebuild noted there. No new routing is needed; this pass creates no competing PR and enqueues no follow-up.
Found via: queue triage task 18230
dezren39 commentedon Nov 17, 2026
Agent note — task 19765 triaged (bulk-intake concurrence with state update, lane code-c, 2026-11-17)
Triage of record stands (tasks 15235/16785, 2026-11-14; concurrence task 18230 today), with one material state change since those verdicts, verified fresh this shift:
Verdict: no new routing, no competing PR, no follow-on packet. Issue #2490 stays open as the epic #1149 tracking record until the rebuilt opencode binary is deployed; task 19765 completes as triaged with the merged-PR evidence above.
dezren39 commentedon Nov 23, 2026
Picked up — shortlist rank 3, lane archer (Lane ED), 2026-11-22.
Fresh same-tick verification this pass (laptop, 2026-11-23T04:15Z tick):
quota-current.json, sourceopencode-quota): Antigravity state ok, real windows (weekly 1.64% on the claude-gpt and gemini groups).configured:false, "Not configured"in the same tick.configured:true, "Failed to refresh Antigravity token".Root cause of the remaining divergence: the canonical module's Antigravity candidate set (accounts file + credential-store
googleOAuth) never adopted the agy keyring credential (Secret Service servicegemini, usernameantigravity) — the login the fork's antigravity-auth bridge actually uses (Drew-sanctioned, code#8086) and the one the gatherer reads the pool through today. The unified surfaces therefore report a working primary pool as not configured — criterion 1 still fails on Antigravity, in the opposite direction from 2026-10-29.Slice being landed (one PR, developing-today-forks/openchamber): add the keyring candidate to the canonical Antigravity resolution — same in-place Secret Service read the fork performs (read-only, never written back), candidate order keyring → file → store mirroring the fork, wrong-client classification unchanged (keyring is Antigravity-issued by construction, like the accounts file) — with tests. Deploy leg (Nix packaging of the new module dependency) and the fork-side refresh-outcome classification gap are named remainders, recorded here when the PR lands.
dezren39 commentedon Nov 23, 2026
Slice landed — lane archer (Lane ED), 2026-11-22. The canonical module now resolves the agy keyring login; Antigravity reads identical across surfaces at the code level.
Landed: developing-today-forks/openchamber#2513, merged
49f96df6ee(head63c750ba7):secret-service.ts(new) — the fork's in-process Secret Service read, ported faithfully (bus-address synthesis incl. the fork's review loop PoC (Stage A): pr-diff-review records shadow verdicts, report distribution (design #2025 §8) #2313/feat(mcpx): inline CLI without the self-socket — in-process RoundTripper (#1868 point 1) #2473 lessons; read-only, never written back).auth.ts—parseAntigravityKeyringCredential/resolveAntigravityKeyringAuth(+configure…Sourcestest seam, the codebase idiom).index.ts— candidate order keyring → file → store mirroring the fork, same refresh-token dedupe; wrong-client reclassification stays store-only (keyring is Antigravity-issued by construction, like the accounts file).isConfiguredincludes the keyring and is async; the registry widens its type and the configured listing awaits it.transforms.ts— float percents instead of integer quantization at both sites (the fork's mcpx docs: build the site in CI and deploy to GitHub Pages #1941 rule).packages/webgains@napi-rs/keyring2.1.2 (the fork's pin); bun.lock updated minimally (hoisted 2.1.2; vsce's 1.3.0 re-scoped).Verification:
@openchamber/sdkbaseline).ok: truewith the Gemini weekly at 1.6407999999999987% used — bit-identical to the gatherer'squota-current.jsonfor the same pool (state ok, sourceopencode-quota) — where the deployed unified build reportedconfigured: false, "Not configured"minutes earlier in the same tick.Criterion state: (1) Antigravity parity now demonstrated at the read level for all three surfaces once deployed; Meta + Codex parity stood from 2026-11-16. (2) No surface can report not-configured for the keyring login the fleet actually uses. (4) Error states stay distinct — keyring read failures add no candidate and manufacture no error; store-read failure keeps its own state. (3) and (5) unchanged from the 2026-11-16/17 records.
Remainders (named next steps):
@napi-rs/keyring) before the endpoint/CLI surfaces run this in production; unify(quota-plane): one quota read path — server endpoint, CLI, and aggregator gatherer must share the direct credential-store read #2490 stays open as the epic epic(quota-plane): Stage 2 — 15-minute quota gathering in the PM stack, token adapters, automated pool decisions #1149 tracking record until the deployed surfaces show the parity live.dezren39 commentedon Nov 23, 2026
Picked up — shortlist rank 3, lane archer (Lane HO), 2026-11-23.
Taking the named remainder #1 from Lane ED's landing record: the deploy leg — the Nix packaging of the openchamber build must pick up the new native dependency (
@napi-rs/keyring, added by openchamber PR #2513) before the endpoint/CLI surfaces run the unified read in production. Premise re-verified fresh: #2490 open, no live claim (ED's slice landed and released), deploy remainder still named open.Plan: inspect the openchamber package in this repo, determine what the new native dep needs (vendoring / fetch / build input), land the packaging fix in one PR with a build or targeted check as the oracle, and record the result here.
dezren39 commentedon Nov 23, 2026
Deploy leg — prepared, then held at a platform execution-risk flag (Lane HO, 2026-11-23).
Progress before the hold:
88ca37a75) already re-baked all three systems'nix/hashes.jsonnode_modules hashes for ready-for-agent: install.sh never restarts the service — a pinned-version upgrade or unit change silently leaves the old process serving while the install reports success #2513's bun.lock (commitfb3ff9dce, each verified with--rebuild).438f7ad38ba),nix flake update openchamberbumped the pin683121ce→88ca37a75— flake.lock diff is exactly the openchamber node (3 lines). Not committed or pushed.Hold: while verifying the fork package build from that worktree, the tooling returned a platform execution-risk flag on the worktree content. Per that notice I stopped — no further git/build/test commands inside the flagged content, and the prepared lock bump was not committed, pushed, or PR'd. A background
nix build .#openchamberstarted before the flag was left as-is (build only; nothing deployed).To finish, Drew needs to say in plain words that working in these worktrees is approved despite the flag (or route the landing to an unflagged venue). Remaining steps once approved: commit + PR + merge the flake.lock bump in code, evaluate the amd config against the new pin, build the package, live-check the built CLI's Antigravity read against the gatherer, then record parity here. The final nixos switch stays a primary-seat deploy step.