GeezerVison is showing github.com — aggregator(feed): isBurnSegment accepts negative tokens, non-date from/to and inverted ranges — garbage burn rows survive sanitizeQuotaView and render as measured history · Issue #3428 · developing-today/code
aggregator(feed): isBurnSegment accepts negative tokens, non-date from/to and inverted ranges — garbage burn rows survive sanitizeQuotaView and render as measured history #3428Labels 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
isBurnSegment — the element guard for the quota view's burn history, used by sanitizeQuotaView in pm-stack/aggregator/src/feed.ts:322-331 — checks only types:
typeof v.provider === "string" &&
typeof v.pool === "string" &&
typeof v.from === "string" &&
typeof v.to === "string" &&
isFiniteNumber(v.tokens)
So a segment with a negative token count, a non-date from/to, an impossible calendar date, or an inverted range (from after to) passes the gate, is counted as well-formed, and renders in the "Burn between resets" table (src/render.ts:1994-1999) as measured history: fmtDate returns a garbage string verbatim when it does not parse, and negative tokens print with toLocaleString() as a negative burn.
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; bun 1.4.2, real isBurnSegment). Control: a well-formed segment passes. Also passing (isBurnSegment=true):
tokens: -12345
from: "banana"
to: "2026-02-30T01:00:00Z" (a day that never existed; Date.parse rolls it to Mar 2)
from: "2026-10-02T00:00:00Z", to: "2026-10-01T01:00:00Z" (inverted range)
The shared strict primitives already exist in the same package — isIsoDate and isNonNegative in src/validate.ts, whose header states the ingest contract: shape, element types, value ranges, and real calendar dates, validated once at the boundary. The sibling guards in the same file follow it (isSnapshotRecord at src/snapshots.ts:313-316 refuses a negative limit and an impossible resetsAt); the burn guard does not.
Why it matters
Burn segments are the historical record the quota page presents as measured throughput between resets. A corrupt collector write that lands here is not dropped-and-counted like every other malformed element in sanitizeQuotaView — it is presented as fact (negative burn, a reset interval that runs backwards, a February 30th boundary), and because sanitizeQuotaView only counts what its guards refuse, the corruption is invisible in the dropped counts that are supposed to surface exactly this kind of loss.
Acceptance criteria
Dedup
Distinct from the quota-window gate gap filed alongside this one (different guard, different consumers — pool state/guidance vs the burn-history table; cross-linked there), #3365 (snapshot rollup guard), #2470 (quota-extract resetsAt emission), and #3364 (coverage census guard). Searched open + closed for isBurnSegment 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 dezren39 commented on Nov 2, 2026 🤖 Agent note · parked
- Agent: queue worker (repo-worker-code), lane F shift
- Session / ID: task 6081
- Found via: queue claim
- Task:
isBurnSegment value validation for issue aggregator(feed): isBurnSegment accepts negative tokens, non-date from/to and inverted ranges — garbage burn rows survive sanitizeQuotaView and render as measured history #3428 — implemented and opened as PR fix(aggregator): validate burn segment values in isBurnSegment (#3428) #4179.
- Expectation: effort/s; done = PR fix(aggregator): validate burn segment values in isBurnSegment (#3428) #4179 merged and issue aggregator(feed): isBurnSegment accepts negative tokens, non-date from/to and inverted ranges — garbage burn rows survive sanitizeQuotaView and render as measured history #3428 closed.
- Links: PR fix(aggregator): validate burn segment values in isBurnSegment (#3428) #4179 (branch
queue/6081-3428-burn-segment, head a7126b0)
- State: PR fix(aggregator): validate burn segment values in isBurnSegment (#3428) #4179 is MERGEABLE;
bun test test/feed.test.ts passes 38/38 including the new value-malformation regression test. Parked 20 minutes for one reason only: the Codex review of PR fix(aggregator): validate burn segment values in isBurnSegment (#3428) #4179 has not landed yet, and an undispositioned Codex finding blocks merge under the fleet gate. Resume: read PR fix(aggregator): validate burn segment values in isBurnSegment (#3428) #4179's Codex findings, disposition each (fix or reply), merge, close issue aggregator(feed): isBurnSegment accepts negative tokens, non-date from/to and inverted ranges — garbage burn rows survive sanitizeQuotaView and render as measured history #3428, complete task 6081.
dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026
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
|