Repository navigation
Description
Problem
The OpenCode Go quota extractor pairs each workspace with its monthly reset by global position in the section, not by the paragraph the reset appears in. One missing or one extra monthly reset … line silently shifts both workspaces' reset dates — each pool renders the other's reset, or a stale historical one, with no error anywhere.
pm-stack/aggregator/src/quota-extract.ts, goWorkspace (:152-176):
// Resets appear in the same paragraph order as the workspaces.
const resets = [...s.matchAll(/monthly reset (\w{3}) (\d{1,2}), (\d{2}:\d{2}) UTC/gi)];
const r = name === "Personal" ? resets[0] : resets[1];Both Go pools share the one ### OpenCode Go section (POOL_SPECS, :276/:284 — the same sectionOf text is passed to both extractors). The workspace percentages are matched per-workspace by name, but the resets are collected section-wide and indexed [0]/[1]. The pairing holds only while every workspace paragraph carries exactly one reset line and nothing else in the section mentions one — and the quota view this parses is a human document that, per this file's own header, "preserves dated observations", so extra dated reset mentions in the section are expected over time.
Evidence (verified on main be7cf62)
Probe on the laptop driving the real extractQuotaPools from quota-extract.ts (sha256 29729137…, identical in both clones; probe + log in the fleet bookkeeping probe-2026-10-28-laneA-goreset/, run twice with identical output), now = 2026-10-28T12:00:00Z:
- CTRL — Personal paragraph with
monthly reset Nov 3, 00:00 UTC, Lab paragraph withmonthly reset Nov 9, 00:00 UTC→ Personal resetsAt2026-11-03, Lab resetsAt2026-11-09. Correct. - BUG — Personal paragraph with no reset line, Lab paragraph with
monthly reset Nov 9, 00:00 UTC→ Personal resetsAt2026-11-09(Lab's reset), Lab resetsAtnull. Personal inherits the other workspace's reset; Lab loses its own. - BUG2 — a stray historical line
monthly reset Oct 5, 00:00 UTCearlier in the section, then the CTRL paragraphs → Personal resetsAt2026-10-05(the stale mention, rendered in the past), Lab resetsAt2026-11-03(Personal's reset). Both wrong, shifted by one.
monthDayTime (:37-45) compounds BUG2: its roll-forward only fires when the date is more than 30 days in the past, so the stale Oct 5 reset is served as a reset date three weeks in the past instead of being recognised as not-this-cycle.
Why it matters
The quota page is the fleet's spend-steering surface: the Go workspaces carry a rotation order ("burn before Lab per rotation order", :168-170) driven by these windows and their reset dates. A shifted pairing tells the operator Personal resets six days later than it does and that Lab never resets — or, in the BUG2 shape, that Personal's reset already passed. Nothing fails loudly: the extractor is fail-soft by design, so the wrong dates render as authoritative.
Acceptance criteria
- Each Go workspace's monthly reset is taken from its own paragraph (or an equivalently anchored match — e.g. the reset nearest/following that workspace's own percentage line), never by section-wide index.
- A workspace paragraph without a reset line yields
resetsAt: nullfor that workspace and does not consume another workspace's reset. - An extra
monthly resetmention elsewhere in the section (historical note, prose) does not shift either workspace's reset. - Regression tests cover all three shapes: the paired control, the missing-reset paragraph, and the stray-mention section (the probe fixtures in the fleet bookkeeping are directly reusable).
- Existing aggregator test suites still pass.
Activity
developing-today commentedon Oct 28, 2026
CODE-648
dezren39 commentedon Oct 28, 2026
🤖 Agent note · state: filed
25 remaining items
dezren39 commentedon Oct 28, 2026
🤖 Agent note · picked up
queue/1882-1626-go-reset-anchoraggregator: anchor OpenCode Go resets to each workspace paragraph (#1626
dezren39 commentedon Oct 28, 2026
🤖 Agent note · done