Skip to content

aggregator(quota): main ChatGPT pool heading /^### ChatGPT/ also matches the Alternate section — an Alternate dated-read section placed first makes openai.main read popesdrew's windows (#3837) #8005

Closed

Description

@dezren39

Finding

PR #3837 added the openai.alternate quota pool so the alternate ChatGPT account (popesdrew) is never merged into the main account's pool. Its dated-read extractor is explicitly built for a future ### ChatGPT (Alternate) section in the stewardship quota view. But the main pool's heading pattern also matches that future heading, so the moment such a section is added — if it appears before the main ### ChatGPT section, which is the natural order if sections are ever alphabetised or the main section is renamed — the main pool silently reads the alternate account's windows. That is exactly the cross-account misattribution #3837 set out to prevent.

Evidence

  • Source PR: fix(quota): surface the alternate ChatGPT account as its own pool on /quota #3837 (fix(quota): surface the alternate ChatGPT account as its own pool on /quota #3837), commits e69a41121, f90ab84d7; merged 2026-11-01T17:00:07Z.
  • Current main a7404a879c60f942359314a45d612c398379528f, pm-stack/aggregator/src/quota-extract.ts:
    • :557 — main pool (openai.main) spec: heading: /^### ChatGPT/ — unanchored, so it matches ### ChatGPT (Alternate) as well as ### ChatGPT. (Compare :549, Claude's anchored /^### Claude$/.)
    • :565 — alternate pool spec: heading: /^### ChatGPT \(Alternate\)/.
    • :203 — sectionOf(doc, pattern) returns the FIRST section whose heading matches the pattern.
    • :256 — extractChatGptAlternate, whose comment states it "exists so a future ### ChatGPT (Alternate) section is picked up".
  • Probe (verbatim quota-extract.ts from current main; only the type-only/poolState/parseIsoDate imports stubbed), run twice with identical results — probe files: hidden_files/pr-review-b-evidence/code-3837-heading-probe/ in the goal workspace:
    • View with the Alternate section first (7-day 42% used) and the main section second (7-day 11% used): openai.main windows = [{7-day, 42}] — the alternate account's read on the main pool. openai.alternate correctly = [{5-hour, 33}, {7-day, 42}].
    • Control, main section first: openai.main = [{7-day, 11}], openai.alternate correct. So the misattribution is purely heading-order dependent.
  • The tests added by fix(quota): surface the alternate ChatGPT account as its own pool on /quota #3837 (pm-stack/aggregator/test/quota.test.ts, quota-current.test.ts) cover the alternate pool only in the no-dated-section case (shell + gatherer overlay); no test exercises a quota view that actually contains a ### ChatGPT (Alternate) section, in either order.

Not a duplicate of #1626 (closed; OpenCode Go reset pairing by section position) or #7813 (open; page substituting fallback windows for a fresh read) — different mechanism.

Why it matters

/quota is the fleet's pool-attribution surface: routing and burn decisions are made from these windows, and the two ChatGPT accounts have separate allowances. A dated Alternate section is the documented next step for this pool; adding it in the wrong order would silently swap the main pool's displayed usage to the other account's, with no error anywhere.

Acceptance criteria

  • The main ChatGPT pool's heading pattern can no longer match the ### ChatGPT (Alternate) heading (e.g. anchored/negative match, or section selection that excludes the alternate heading).
  • A regression test feeds extractQuotaPools a quota view containing BOTH a ### ChatGPT section and a ### ChatGPT (Alternate) section, in both orders, and asserts each pool carries only its own windows.
  • Existing quota tests still pass (bun test for pm-stack/aggregator/test/quota.test.ts and quota-current.test.ts).

Activity

  1. developing-today commented on Nov 9, 2026

    @developing-today
    Contributor
  2. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    effort/sSmall: expected under 2 hours of work
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 9, 2026
  3. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged

    • Agent: triage-step
    • State: triaged
    • Verdict: work kind task/small-fix · priority/normal · effort/s
    • Priority why: priority/normal — brief line 5: everything else by usefulness; a latent cross-account quota misattribution is worth fixing before the Alternate section exists, but nothing is misread today.
    • First step: Anchor the main ChatGPT pool's heading pattern in the pm-stack aggregator's dated-read extractor so /^### ChatGPT/ cannot match '### ChatGPT (Alternate)', and add a regression test with the Alternate section placed first.
    • Acceptance: With a '### ChatGPT (Alternate)' section placed before the main section, openai.main still reads the main account's windows and openai.alternate reads popesdrew's — the cross-account misattribution fix(quota): surface the alternate ChatGPT account as its own pool on /quota #3837 set out to prevent cannot occur.
    • Fix packet: repo-health:v1:fix:developing-today/code:issue:8005 → queue repo-health-code-pilot. Enqueue result: dedupe hit: existing task 14348 (queue repo-health-code-pilot, status queued, created 2026-11-09T07:31:45Z)
  4. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked (awaiting CI)

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed on Nov 10, 2026
  6. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    Lane code-k picked up task 14348 (issue #8005) — parked, awaiting CI.

  7. added a commit that references this issue on Nov 10, 2026
  8. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  9. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions