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.
98 remaining items
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.
dezren39 commentedon Nov 23, 2026
Progress: PR #13116 isolates malformed reset fields in the Meta quota exporter: a bad window is omitted while its healthy sibling remains available; both invalid windows still fail closed. Evidence:
node --test pm-stack/meta-exporter/meta-quota-export.test.mjs(32 passing).Next slice: after this PR,
node --test pm-stack/meta-exporter/meta-quota-export.test.mjsplus a fixture with malformed per-window usage/limit fields shows the healthy sibling window survives too; the current slice scopes reset validation only.Merge pull request #13130 from developing-today/lane-ho/2490-opencham…
dezren39 commentedon Nov 23, 2026
Deploy leg — LANDED (Lane IV, 2026-11-23, under Drew's plain-words approval of all eight held items, ~00:50 CST).
Landed: PR #13130 merged, merge commit
13f225c733e6d942eb9b240128f78ae78738d449, head7cc6564189e.flake.lockonly — the openchamber pin683121ce→88ca37a75(rev + lastModified + narHash, 3 lines), verified present on main post-merge. The prepared work was in~/wt-lane-ho-2490-code(branchlane-ho/2490-openchamber-pin); the sibling~/wt-lane-ho-2490is the fork checkout at88ca37a75.Verification of the bumped content (laptop):
nixosConfigurations.amdevaluates clean against the new pin (toplevel drv instantiated, exit 0).openchamber-node_modules-2.8.0fixed-output derivation — the artifact openchamber PR feat(mcpx): declared OpenAPI APIs are first-class servers (#2118) #2514 changed — builds in the amd graph:/nix/store/j7626qrw6jlwa4fy2c9ri6n7zf7r5i23-openchamber-node_modules-2.8.0.Build-check caveats (both outside this change):
TestProxyUpstreamTimeoutIsReachableFromTheEnvironment, thenTestAutostartPingTimeoutBoundsEachReadinessPing) with the laptop saturated by parallel lanes; every other mcpx package passed both runs. mcpx is code's own package at code's own source — the outcome is identical without this bump. Filed as mcpx: check phase e2e timing tests fail under parallel build load (two runs, two different tests) #13131. CI on main is the authoritative gate for the full graph.88ca37a75: its own opencode pin's (dfa989e) node_modules FOD hash mismatches (specifiedsha256-UOVs48Z4yO4TJv859cg89lsul54KB9StTSl/VSQJXmc=, gotsha256-iePuml/GCWr8uWs+ksNzpn5YGftqYlss21JR0nUCwkw=, measured on amd-6). Filed as opencode#2700. Code's graph is unaffected — openchamber's opencode input follows code's pin9acf714here.Remainder (named, not done here):
nixos switch— a primary-seat deploy step, as before. It will meet the same mcpx check wall (mcpx: check phase e2e timing tests fail under parallel build load (two runs, two different tests) #13131) until that suite passes on the laptop or the graph is built in CI.This issue stays open on those two remainder items; the pin bump itself is complete.
developing-today-fleet commentedon Nov 26, 2026
Triage re-verification · task 24901, lane code-g (2026-11-26): not closable, no new slice in this packet. Unification design is active implementation (effort/l, status/in-review); Meta exporter isolation slice landed with 32 passing tests; deploy leg PR #13130 MERGED (flake.lock pin bump verified on main). Remainder named on issue: final nixos switch (primary-seat deploy) + live CLI-vs-gatherer parity check, currently walled by mcpx check-phase timing (#13131) and fork FOD mismatch (opencode#2700). No packet in this triage.
developing-today-fleet commentedon Nov 27, 2026
Triage verdict — remainder is active, no new slice filed (task 25364, 2026-11-26)
Fresh recheck: #2490 remains OPEN and
status:in-review; no completion claim is warranted. The tracked work is currently an implementation/verification remainder rather than a new triage-lane fix packet.flake.locknow pins openchamber69dcd99fa56fe8f63ee87932759a9c2bdd203d1c(fresh checkout verification). This replaces the older pin discussed in the prior note.node --test pm-stack/meta-exporter/meta-quota-export.test.mjspasses (32 tests), including malformed-window isolation.pm-stack/aggregator/scripts/gather-quota.tsinvokesopencode quota --jsonand consumes the per-provider result set. This is the merged Direct providers: full-function completeness + quota single-source (opencode quota subcommand) #6125/quota: rewire gatherer to opencode quota subcommand as sole source #6127 path; no duplicate implementation is needed here.Remaining acceptance: finish the primary-seat NixOS switch/rebuild and demonstrate live CLI-vs-gatherer parity after the new pinned package is deployed. The recent lane note explicitly identifies these as the outstanding gates. Keep #2490 open until both are evidenced; no new fix packet or duplicate PR is appropriate in this triage. The issue does not have a code-only slice to complete in this lane.
dezren39 commentedon Nov 29, 2026
🤖 Agent note · census 2026-11-29 (lane CEN-C03)
Census verified: the three-reader divergence is documented with file/line evidence and reader 1's root cause is pinned (openchamber#858). Blocker: none found. Priority: high (unchanged); status in-review.
developing-today-fleet commentedon Nov 29, 2026
Census 2026-11-29 (Felix): full recheck of this issue (body, all 42 comments, labels, dependency edges).
STRENGTHS: The divergence is documented the way every unification issue should be: the three readers named with file:line pointers, same-evening divergence evidence (the hub reads the Antigravity pool fine while the server endpoint returns "Not configured"), and reader 1's root cause pinned to openchamber#858 (the server credential projection drops the refresh token the antigravity resolver requires). The issue cross-links the legs it absorbs rather than replacing them.
GAPS: None material in the record. Progress state, for a cold reader: the CLI/server unification landed (openchamber#2282 closed; its PR #2318 gave both the CLI and the server endpoint the direct credential-store source, with same-tick parity evidence recorded); the Meta exporter isolation slice landed (PR #13116, 32 tests passing); the deploy leg landed (PR #13130 merged — flake.lock openchamber pin bump, verified on main).
FIXES I APPLIED: None — priority/high fits (the quota plane feeds the owner's dashboard and the PM stack), kind/design matches the unification leg, status/in-review matches an active verification remainder. No blocker edges exist or are needed.
REMAINS: Two closing steps, both recorded on the issue: the final NixOS switch (a primary-seat deploy — it rides the laptop's next rebuild) and the live CLI-vs-gatherer parity check afterwards. Neither is a code slice; once the parity check is recorded here, this issue can close. Nothing new needs Drewry beyond the rebuild he already controls.
developing-today-fleet commentedon Nov 29, 2026
Issue census — 2026-11-29
Wave-2 census pass (group code-01409-03205): rechecked live state, body, labels and recent comments firsthand via
fleet ghimmediately before editing.Strengths: detailed body (6238 chars) with context a picker-up can start from; acceptance criteria present in the body; single taxonomy priority band (priority/high) — verified against live labels; kind label present (kind/design).
Gaps found: none material.
Actions taken this pass: labels: +['status/needs-review'] -['status:in-review'].
Priority: priority/high — checked against content, unchanged (no reprioritization). No closing keywords used; issue left open.
developing-today-fleet commentedon Nov 29, 2026
agent-note:v1 — lane 0640-AZ (worker felix), drawn via
fleet agent next(priority rung). Fresh re-verification of the remainder; standing down with the gate named precisely.Verified firsthand today (2026-11-29):
16aa7e514a73ba496e547f272ee708c1fec826a1, beyond both the PR chore(flake): bump openchamber pin 683121ce -> 88ca37a75 (#2490) #13130 pin (69dcd99f) and PR 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 merge (49f96df6ee). The pinned source the laptop would deploy already contains the unified read + keyring support.Sole remaining acceptance, unchanged from the 2026-11-26/27 triages and confirmed as the only gap: the primary-seat NixOS switch/rebuild on the laptop to a build from the current pin, then the live CLI-vs-gatherer same-tick parity demonstration on the deployed surfaces. That is a live machine activation on the primary seat — not a code slice and not lane work. No PR from this lane; manufacturing one would duplicate landed work.
Priority validation 2026-11-29 (Felix): priority/high confirmed, no change — Drew-filed and Drew-prioritized unification; its remainder rides the same laptop-rebuild gate as several other issues, at which point the parity demo closes this.
developing-today-fleet commentedon Nov 30, 2026
agent-note:v1 — lane 0640-NS (worker felix), drawn via
fleet agent next(priority rung). Premise check: concur with 0640-AZ's stand-down (7259847026, 2026-11-29). Every code-side leg is landed and the deploy pin has advanced past all of it; the sole remainder is the primary-seat NixOS switch/rebuild on the laptop plus the live CLI-vs-gatherer parity demo on deployed surfaces — a live machine activation, not a bounded seat-workable slice. Nothing on the issue has changed since AZ's note (it is still the newest comment). Standing down unclaimed; no PR.