GeezerVison is showing github.com — aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool · Issue #3427 · developing-today/code
aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427Labels app/aggregatorPackage/app: aggregator (pm-stack in this repo)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/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionProblem
isQuotaWindow — the feed boundary guard behind sanitizeQuotaView / loadFeed (#2429) in pm-stack/aggregator/src/feed.ts:286-296 — checks only types, never values:
resetsAt passes as any string (feed.ts:293: v.resetsAt === null || typeof v.resetsAt === "string")
limit passes as any finite number, including negative (feed.ts:291)
used passes as any finite number, including negative (feed.ts:292)
percent passes as any finite number, including negative or ≫100 (feed.ts:294)
The sister boundary for the same fields already refuses exactly these shapes: isSnapshotRecord (src/snapshots.ts:313-316) requires isNonNegative(limit) and isIsoDate(resetsAt), with the comment that downstream code dereferences them (pct-of-limit, reset comparisons). The feed gate does not, and the shared strict primitive (isIsoDate / parseIsoDate, src/validate.ts) is already imported by feed.ts for other sections.
Evidence (verified this run, main 574c04a)
Laptop probe ~/git/fleet/probe-2026-11-01-laneA-feedquota/ (copies of the real src/ tree, feed.ts md5 e564f17aea918d5281fd37d433a01017, identical to main; run with bun 1.4.2 against the real isQuotaWindow, windowPercent, poolState, computeChoices, sanitizeQuotaView). Control: a well-formed window passes. Every malformed case below also passes (isQuotaWindow=true) and survives sanitizeQuotaView with droppedWindows=0:
| case |
result |
resetsAt: "2026-02-30T05:00:00Z" |
kept; Date.parse rolls it to 2026-03-02T05:00:00Z |
resetsAt: "banana" / resetsAt: "" |
kept verbatim |
percent: -50, limit: null |
windowPercent = -50, pool reads healthy |
percent: 15000, limit: null |
windowPercent = 15000, pool reads walled |
used: -500, limit: 1000 |
windowPercent = -50, pool reads healthy |
limit: -5, no percent |
windowPercent = 100 (the limit <= 0 fallback in derive.ts:156), pool reads walled with zero usage |
Guidance effect, same probe: a healthy pool whose only window carries resetsAt: "2026-02-30T05:00:00Z" is returned in computeChoices(...)'s burnBeforeReset list at 2026-03-01T12:00Z — a burn-it-before-reset recommendation clocked from a day that never existed (the Mar 2 rollover is 17h out, inside RESET_SOON_MS). quota-guidance.ts:18 (soonestReset) filters only non-finite Date.parse results, so impossible-but-parseable dates sail through, while derive.ts:839 prints resetsAt.slice(0, 10) verbatim in attention flags and render.ts fmtDate renders the rolled-over March date as the reset date.
Why it matters
The ingest contract (src/validate.ts header) is that every ingested document is validated once at its boundary — shape, element types, value ranges, and real calendar dates — before any consumer sees it. The quota section is the one section whose gate stops at types: a corrupt or buggy collector write (or a hand-edited feed) injects windows that flip pools between healthy and walled and fabricate reset timing in the guidance every session-placement decision reads, instead of being dropped-and-counted by the sanitizer like every other malformed element in the same view.
Acceptance criteria
Dedup
Distinct from #2470 (quota-extract emitting unvalidated resetsAt upstream — this is the feed-ingest gate that must refuse them regardless of source), #3365 (snapshot rollup guard re-admitting shapes), #2416 (parseQuotaCurrent window entries in the gatherer overlay), and #3396/#3393/#3379 (tier-items / actions / snapshot-records date gates). Searched open + closed for isQuotaWindow, "quota window resetsAt" before filing. Activitydeveloping-today commented on Nov 1, 2026 added task/triageQueue packet kind: verify, reproduce, and route this item kind/bugSomething isn't working (prefixed form of the classic bug label) effort/sSmall: expected under 2 hours of work on Nov 1, 2026dezren39 commented on Nov 1, 2026 🤖 Agent note · filed
- Agent: new-issue-creator (new-issue-creator-code-a)
- Session / ID: cron new-issue-creator-code-a, run 2026-11-01 02:35 CST
- Found via: filed this run
- Task: Triage the isQuotaWindow value-range/date gap in the feed quota gate and route the fix per the issue's acceptance criteria
- Expectation: effort/s — done looks like the malformed windows in the evidence table dropping in sanitizeQuotaView with drop counts, plus regression tests
- Links: laptop probe ~/git/fleet/probe-2026-11-01-laneA-feedquota/ (real feed.ts at main 574c04a)
dezren39 commented on Nov 1, 2026 Cross-link: sibling feed-gate gap filed in the same run — #3428 (isBurnSegment accepts negative tokens, non-date from/to and inverted ranges). dezren39 commented on Nov 2, 2026 Progress checkpoint (queue task 6079): tightened isQuotaWindow to require real ISO reset dates, non-negative finite limit/used, and percent in 0–100. Added regression coverage for Feb-30, negative usage/limit, -50 and 15000 percent, plus individual drop counts and valid-window preservation in sanitizeQuotaView. Running targeted aggregator feed tests now; no PR yet. dezren39 commented on Nov 2, 2026 Queue task 6079 done: implemented the guard fix, tests pass, PR opened.
- Changed
pm-stack/aggregator/src/feed.ts: isQuotaWindow now requires non-null resetsAt to satisfy isIsoDate, non-null limit/used to be non-negative finite, and percent (when present) within 0..100. Malformed windows drop individually in sanitizeQuotaView with droppedWindows counting them.
- Added regression tests in
pm-stack/aggregator/test/feed.test.ts: Feb-30 resetsAt dropped, negative used dropped, negative limit dropped, percent -50 dropped, percent 15000 dropped, valid windows untouched + droppedWindows count.
- Test results:
bun test test/feed.test.ts — 54 pass, 0 fail (run on laptop).
- PR: fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 (not merged, per task instructions).
dezren39 commented on Nov 2, 2026 🤖 Conductor binding · manual dispatch wave (Drew-ordered queue unblock) 2026-11-02
- Queue task: 6079 (repo-health-code-pilot,
small_fix — "Fix aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427: isQuotaWindow must refuse non-ISO resetsAt, negative limit/used, out-of-range percent") ↔ issue aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427
- Session:
ses_e5e6324c51bffeUEteFInQoIyr (laptop OpenChamber, agent build)
- Pool: Workhorse — requested
opencode-route/workhorse (route id only; pooled route, no single-plan direct seat). Gate: fresh laptop quota read this run ~09:09 CST — meta 5h 8% / weekly 2%, codex weekly 80%, openai.alternate 5h 0% / weekly 0% — Workhorse OPEN; plan quotas only, never PAYG.
- Worktree / branch:
~/git/fleet/6079-3427-quota-window-guard on the laptop, branch queue/6079-3427-quota-window-guard (from origin/main d1de7ee)
- Verified engaged: yes — 30 messages at first probe, 0 errors; tests passed, committing and pushing.
- The queue task itself remains
queued in the fleet queue (there is no targeted claim/binding verb yet — code#1337 / openchamber#1272); the dispatch is recorded in the task's progress. The owning lane reconciles/harvests from here, and the conductor shepherds the session.
dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026 🤖 Agent note · parked
- Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
- Session / ID: ses_e5e6302ccbdffexE7q1uopf1EH · task 6079
- Reason: Conflicting active work — Drew-authored PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 is open on the task branch, and the recorded dispatched session is its owner. No duplicate PR or branch edits were made.
- Resume condition: after 30 minutes, re-read PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 and the owning session state; proceed only if the conflict is resolved.
- Links: aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427 aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427 · PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423
dezren39 commented on Nov 2, 2026 🤖 Agent note · done — PR merged
- Agent: repo-worker-code (lane D)
- Session / ID: queue task 6079 (resumed claim; PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 opened by the prior claim at head
4547db65c)
- Verification by this claim: PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423's diff matches the pinned packet exactly —
isQuotaWindow now requires non-null resetsAt to satisfy isIsoDate, non-null limit/used to be isNonNegative (finite, >= 0), and percent to be within isPercentOf(100); the validators were read in src/validate.ts and have exactly those semantics. Regression tests cover every packet-named case (Feb-30 resetsAt, negative used, negative limit, percent -50, percent 15000, valid windows untouched, combined droppedWindows count).
- Tests: CI registered no workflow runs on the PR in over an hour (runner backlog), so per the packet's own fallback ("laptop if CI is backlogged") the targeted suite ran on the laptop at the PR head:
bun test test/feed.test.ts — 54 pass, 0 fail. Zero review threads on the PR; no Codex findings to disposition.
- Result: PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 MERGED 2026-11-02T16:46:41Z, merge commit
4843f2e21061d87df52f41c2973c2f40cd42e2d3; issue aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427 closed by the PR. Queue task 6079 completed fixed_merged.
- Links: issue aggregator(feed): isQuotaWindow accepts any string as resetsAt and any finite used/limit/percent — an impossible reset date is clocked as Mar 2 in guidance, a -50% window reads healthy and a 15000% window walls a pool #3427 · PR fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent #4423 · task 6079
MetadataMetadataapp/aggregatorPackage/app: aggregator (pm-stack in this repo)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/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DevelopmentNo branches or pull requestsIssue actions
|