GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100 · Issue #2571 · developing-today/code

aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100 #2571

New issue
Copy link
New issue
Copy link
Closed
#4218
Closed
aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100#2571
#4218
Copy link
Assignees
dezren39
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 30, 2026
Issue body actions

Problem

pm-stack/aggregator/src/quota-gather-map.ts's shared scalar gate is finite-only, and neither quota-current mapper range-checks the percent it publishes:

  • num() (quota-gather-map.ts:38) is typeof v === "number" && Number.isFinite(v) — no range.
  • entryFromResult's pushWindow (:197-211) copies num(raw?.usedPercent) verbatim into both value and pctOfLimit, with the entry stamped state: "ok" for a healthy provider result.
  • entryFromFileExport (:137-151) does the same with num(w.usedPct) for the Meta file-export document, and its labelWindow (:154-168) accepts any finite USD amount, rendering a negative freeCreditsUsd as the label "$-42.50".

Downstream, nothing range-checks the percent either:

  • recordsFromEntries (quota-gather-map.ts:268+) takes any non-null pctOfLimit as a pct snapshot record stamped limit: 100 — and its pool-level collapse keeps the max pct per key, so one glitched 1e9 reading beats every sane credential's reading for that tick.
  • isSnapshotRecord (snapshots.ts:295-310) is finite-only for numeric values, so the out-of-range records pass the store gate and enter the append-only snapshot store, where rollup min/max preserves the extremum.
  • parseQuotaCurrent (quota-current.ts:90-96) is also finite-only, converting pctOfLimit into the pool window's used/percent served on /quota.

Evidence (verified this run, main 627cbc9)

Laptop Bun probe importing the real quota-gather-map.ts + snapshots.ts (file md5 86fa3547e81f325f9211dfe1c4577894, identical in the sandbox clone at 627cbc9 and the laptop clone; probe at ~/git/fleet/probe-2026-10-30-laneA-gatherpct/):

  • entryFromResult with usedPercent: -20 → entry state:"ok", window value:-20, pctOfLimit:-20; recordsFromEntries emits a pct record value:-20, limit:100 and isSnapshotRecord returns true.
  • Same for usedPercent: 150 → record value:150; and usedPercent: 1e9 → record value:1000000000, gate true.
  • entryFromFileExport with windows usedPct: 150 / usedPct: -20 and freeCreditsUsd: -42.5 → entry state:"ok", both out-of-range windows published, plus a free_credits label window valueLabel:"$-42.50"; recordsFromEntries emits pct records 150 and -20, both passing the store gate.
  • Control: usedPercent: 42 → window and record 42, as expected.

No existing test pins the out-of-range acceptance (no range cases in test/quota-gather-map.test.ts).

Why it matters

These two mappers are the gatherer's front door for every provider-module result and every laptop file-export: one glitched or drifting upstream read (a provider returning a fraction instead of a percent, a scaled value, a negative placeholder) is published as live, measured, ok quota data, mis-states pool headroom/wall decisions on /quota, and is then permanently appended to the snapshot history as a pct point against limit:100 — the same poisoned-history failure already filed for the sibling writers (#2553 Turso, #2568 provider-usage), through a different, uncovered pair of entry points.

Dedup

  • aggregator(quota-gather-map): entryFromTurso never range-checks usage — negative counts publish as live ok data and append negative snapshot records #2553 covers entryFromTurso's native-unit counts only; aggregator(snapshot-records): recordsFromProviderUsage never range-checks used_percent — a Codex window at -20% or 1e9% is appended as measured pct history against its own limit:100 #2568 covers recordsFromProviderUsage in snapshot-records.ts only (its packet explicitly scopes out other writers); aggregator(quota-gather-map): entryFromResult throws RangeError on an out-of-range fetchedAt — one bad provider stamp discards the provider's whole tick #2332 is entryFromResult's fetchedAt RangeError, not its percent range; aggregator(quota-current): parseQuotaCurrent never checks windows entries — one null entry crashes the whole gatherer overlay and provenance still claims it applied #2416 is parseQuotaCurrent's null-window crash. None covers usedPercent/usedPct range in entryFromResult/entryFromFileExport.

Acceptance criteria

  • Triage pins the treatment for an out-of-[0,100] percent in both mappers (skip that window is the file's own pattern for unusable windows — entryFromFileExport already skips a window whose pct is null — but pin it explicitly), and pins whether a negative freeCreditsUsd/paygBalanceUsd label is skipped or the entry degrades.
  • After the fix: entryFromResult and entryFromFileExport never publish a window with pctOfLimit outside [0,100] as state:"ok" measured data, and recordsFromEntries therefore cannot append an out-of-range pct record from these entries.
  • test/quota-gather-map.test.ts covers negative, >100, and absurd (1e9) usedPercent and usedPct cases, with the sibling in-range windows of the same result/document unaffected, plus the negative-USD label case per the pinned treatment.
  • Existing quota-gather-map / quota-current tests stay green.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 30, 2026
  2. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A, new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-10-30T05:15Z
    • Found via: filed this run
    • Task: Triage the percent range gap in entryFromResult/entryFromFileExport (quota-gather-map.ts) — pin the [0,100] treatment for both mappers and the negative-USD label, then route a small_fix packet
    • Expectation: effort/xs — done when triage confirms the gate shape and a fix packet exists
    • Links: evidence in the issue body; probe on the laptop at ~/git/fleet/probe-2026-10-30-laneA-gatherpct/
  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  5. 14 remaining items

  6. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  7. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: task 5386
    • Found via: queue claim
    • Task: Resume task 5386 for issue aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100 #2571 from awaiting_ci — recheck CI and Codex on PR fix(aggregator): validate quota percentage ranges (#2571) #4218 head 5bc3d58; merge if the standing criteria hold.
    • Expectation: effort xs; done = PR fix(aggregator): validate quota percentage ranges (#2571) #4218 merged and issue aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100 #2571 closed, or task 5386 parked again with the CI state recorded.
    • Links: PR fix(aggregator): validate quota percentage ranges (#2571) #4218; branch queue/5386-2571-quota-percent-range
  8. dezren39
    added a commit that references this issue on Nov 2, 2026

    Merge pull request #4218 from developing-today/queue/5386-2571-quota-…

    12ea94d
  9. dezren39
    closed this as completedin #4218on Nov 2, 2026
  10. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  11. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: task 5386
    • Found via: queue claim
    • Task: Done — task 5386 completed as fixed_merged. PR fix(aggregator): validate quota percentage ranges (#2571) #4218 merged (merge commit 12ea94d) and issue aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100 #2571 closed. Resume check found Codex clean on head 5bc3d58 (has_any_findings=false, no inline threads), diff verified against the packet scope (quota-gather-map.ts + quota-gather-map.test.ts), recorded tests 35 + 35 pass with diff check pass; the single test check was still QUEUED (run queued since 2026-11-02T06:05Z, fleet runner backlog) and the merge followed the standing merge-authority pattern.
    • Expectation: No further action; CI on main covers the merged change.
    • Links: PR fix(aggregator): validate quota percentage ranges (#2571) #4218; branch queue/5386-2571-quota-percent-range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.