From e69a4112113fd5bb047ab78686776da8440c2ef9 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 1 Nov 2026 10:59:38 -0600 Subject: [PATCH 1/2] fix(quota): give the alternate ChatGPT account its own pool (openai.alternate) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The quota gatherer has been measuring the openai.alternate credential (popesdrew) all along — quota-current.json carries a fresh, healthy entry with 5h + weekly windows — but overlayQuotaCurrent only overlays entries onto pools that already exist, and no pool existed for it, so /quota silently dropped the account: zero mentions of the alternate account anywhere on the page Drew reads for pool state. - POOL_SPECS gains openai.alternate (OpenAI — ChatGPT (Alternate — popesdrew)) with a fail-soft dated-read extractor for a future "### ChatGPT (Alternate)" stewardship section; until then it renders as a shell and the gatherer overlay supplies live windows. - poolFor in collect-fleet-feed attributes sessions burned through the openai.alternate door to the new pool (previously unattributed). - Tests: the pool exists as its own pool (never merged into openai:codex) and gatherer windows land on it, not on the main pool. The two ChatGPT accounts are separate pools with separate allowances and are never combined; the pool map comment now records that next to the existing one-Meta-pool rule. --- .../aggregator/scripts/collect-fleet-feed.ts | 2 ++ pm-stack/aggregator/src/quota-extract.ts | 36 +++++++++++++++++++ .../aggregator/test/quota-current.test.ts | 27 ++++++++++++++ pm-stack/aggregator/test/quota.test.ts | 11 ++++++ 4 files changed, 76 insertions(+) diff --git a/pm-stack/aggregator/scripts/collect-fleet-feed.ts b/pm-stack/aggregator/scripts/collect-fleet-feed.ts index 4304306b18..c585da0a31 100644 --- a/pm-stack/aggregator/scripts/collect-fleet-feed.ts +++ b/pm-stack/aggregator/scripts/collect-fleet-feed.ts @@ -153,6 +153,8 @@ function poolFor(provider: string, model: string): string | null { case "openai-codex": case "chatgpt": return "openai:codex"; + case "openai.alternate": + return "openai.alternate"; case "cline-pass": return "cline-pass:cline-pass"; case "opendesign": diff --git a/pm-stack/aggregator/src/quota-extract.ts b/pm-stack/aggregator/src/quota-extract.ts index 2caea61f69..de4a6f1a9a 100644 --- a/pm-stack/aggregator/src/quota-extract.ts +++ b/pm-stack/aggregator/src/quota-extract.ts @@ -11,6 +11,11 @@ // via the `meta` provider. There is no "muse plan" pool and the // assistant's Power subscription is never a pool, so no extractor here // emits either. +// exactly TWO ChatGPT pools — the main account (drewrypope) reached +// through the `codex` gatherer door (pool openai:codex) and the +// alternate account (popesdrew) through the `openai.alternate` door +// (pool openai.alternate). Separate accounts, separate allowances: +// never collapse them into one pool. import { poolState } from "./derive.ts"; import type { QuotaPool, QuotaWindow } from "./model.ts"; @@ -112,6 +117,28 @@ const extractCodex: Extractor = (s, now) => { }; }; +/** + * The alternate ChatGPT account (popesdrew). It has no dated-read + * section in the stewardship view yet — its live windows arrive + * through the quota gatherer (the openai.alternate credential) and + * are overlaid onto this pool by overlayQuotaCurrent. The extractor + * exists so a future "### ChatGPT (Alternate)" section is picked up + * like every other pool's dated read; until then it fail-softs to + * the shell, like any extractor whose pattern stops matching. + */ +const extractChatGptAlternate: Extractor = (s) => { + const fiveHour = first(s, /5-hour\s+(\d+(?:\.\d+)?)%\s+used/i); + const weekly = first(s, /7-day\s+(\d+(?:\.\d+)?)%\s+used/i); + if (!fiveHour && !weekly) return null; + const windows: QuotaWindow[] = []; + if (fiveHour) windows.push(pctWindow("5-hour", Number(fiveHour[1]), null)); + if (weekly) windows.push(pctWindow("7-day", Number(weekly[1]), null)); + return { + windows, + note: "Alternate ChatGPT account (popesdrew) — a separate pool from the main account; the two are never combined.", + }; +}; + const extractMeta: Extractor = (s, now) => { // A dated billing-blocked read (402 billing_not_configured — the // billing-verification wall) outranks every window/reset read: the @@ -343,6 +370,15 @@ export const POOL_SPECS: PoolSpec[] = [ extract: extractCodex, shellNote: "No current read. OpenAI is the fleet's final reserve pool.", }, + { + id: "openai.alternate", + provider: "OpenAI", + plan: "ChatGPT (Alternate — popesdrew)", + heading: /^### ChatGPT \(Alternate\)/, + extract: extractChatGptAlternate, + shellNote: + "No dated read. The fleet's second ChatGPT account (popesdrew), measured live by the quota gatherer through the openai.alternate credential — a separate pool from the main account (openai:codex); the two are never combined.", + }, { id: "opencode-go:personal", provider: "OpenCode Go", diff --git a/pm-stack/aggregator/test/quota-current.test.ts b/pm-stack/aggregator/test/quota-current.test.ts index 86252bac5c..4a48ee697e 100644 --- a/pm-stack/aggregator/test/quota-current.test.ts +++ b/pm-stack/aggregator/test/quota-current.test.ts @@ -596,3 +596,30 @@ describe("stale-path newest pick is finite-gated (#2253)", () => { expect(parseQuotaCurrent(JSON.parse(JSON.stringify(doc)))).not.toBeNull(); }); }); + +describe("overlay: alternate ChatGPT pool (openai.alternate)", () => { + test("gatherer windows land on the alternate pool, never on the main pool", () => { + const view = baseView(); + view.pools.push(pool("openai.alternate", [])); + const out = overlayQuotaCurrent( + view, + file([ + entry({ + providerId: "openai.alternate", + serviceId: "openai.alternate", + credentialLabel: "OpenAI Alternate (Student - popesdrew)", + windows: [win("5h", 100, iso(5 * 60_000)), win("weekly", 42, iso(5 * 60_000))], + }), + ]), + NOW, + ); + const alt = out.pools.find((p) => p.id === "openai.alternate")!; + expect(alt.windows.map((w) => [w.name, w.percent])).toEqual([ + ["5-hour", 100], + ["weekly", 42], + ]); + // The main account's pool keeps its own read, untouched. + const main = out.pools.find((p) => p.id === "openai:codex")!; + expect(main.windows[0].percent).toBe(11); + }); +}); diff --git a/pm-stack/aggregator/test/quota.test.ts b/pm-stack/aggregator/test/quota.test.ts index 8c6ff7e09d..a04c8f0f20 100644 --- a/pm-stack/aggregator/test/quota.test.ts +++ b/pm-stack/aggregator/test/quota.test.ts @@ -50,6 +50,17 @@ describe("quota extractors", () => { expect(p.windows[0].resetsAt).toBe("2026-10-30T18:01:00.000Z"); }); + test("alternate ChatGPT account is its own pool — never merged into the main pool", () => { + const p = byId.get("openai.alternate")!; + expect(p).toBeDefined(); + expect(p.provider).toBe("OpenAI"); + // This view has no "### ChatGPT (Alternate)" dated-read section, so + // the pool renders as a shell; the gatherer overlay supplies the + // live windows (see quota-current.test.ts). + expect(p.windows).toEqual([]); + expect(poolProviderId("openai.alternate")).toBe("openai.alternate"); + }); + test("meta is walled until the weekly reset — and it is the only Meta pool", () => { const p = byId.get("meta:high-usage")!; expect(p.state).toBe("walled"); From f90ab84d7eb9b7d8aa7e76ea764e45aadb12c51b Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 1 Nov 2026 10:59:38 -0600 Subject: [PATCH 2/2] chore(aggregator): gitignore the generated coverage-snapshot.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The aggregator writes coverage-snapshot.json into its working directory by default; pm-git-sync refuses to pull into a dirty tree, so this generated file can silently stall dashboard deploys (it did on 2026-11-01 — the tree only stayed clean via a local info/exclude). --- pm-stack/aggregator/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pm-stack/aggregator/.gitignore diff --git a/pm-stack/aggregator/.gitignore b/pm-stack/aggregator/.gitignore new file mode 100644 index 0000000000..58f55ad22b --- /dev/null +++ b/pm-stack/aggregator/.gitignore @@ -0,0 +1,4 @@ +# Generated by the aggregator at runtime (PM_AGG_COVERAGE_SNAPSHOT_FILE +# default). The pm-git-sync deploy pipeline refuses to pull into a +# dirty tree, so this must never appear as untracked dirt. +coverage-snapshot.json