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(token-adapter): file-export adapter's fail-closed window check omits the 0-100 usedPct range — out-of-range windows vanish and a partial (or empty) entry publishes as fresh ok · Issue #4269 · developing-today/code

aggregator(token-adapter): file-export adapter's fail-closed window check omits the 0-100 usedPct range — out-of-range windows vanish and a partial (or empty) entry publishes as fresh ok #4269

New issue
Copy link
New issue
Copy link
Closed
#6745
Closed
aggregator(token-adapter): file-export adapter's fail-closed window check omits the 0-100 usedPct range — out-of-range windows vanish and a partial (or empty) entry publishes as fresh ok#4269
#6745
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/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 2, 2026
Issue body actions

Summary

collectFileExportAdapter (pm-stack/aggregator/src/token-adapter.ts) is documented as the strict layer over the bare file-export mapping: a success document whose windows are malformed must fail closed as unparseable and retain the previous entry, "instead of a partial one being published" (token-adapter.ts:220-228, and the comment at :271: "drift => unparseable, never partial").

Its window validation (token-adapter.ts:272-296) checks only that each window is an object with a non-empty string name and a finite usedPct. It never checks the 0–100 range — but the mapping it wraps does treat out-of-range as malformed: entryFromFileExport (pm-stack/aggregator/src/quota-gather-map.ts:139-140) silently continues past any window with pct < 0 || pct > 100.

So an out-of-range window passes the adapter's drift check, is silently dropped by the mapping, and the adapter publishes the result as a fresh ok outcome:

  • one bad window among good ones → a partial entry (window missing) presented as fresh, not stale, with no error;
  • a document whose only window is out of range → a fresh ok entry with zero windows — an empty reading that is neither the retained previous value nor an error.

Evidence (verified this run, main @ 0858c74)

Laptop probe ~/git/fleet/probe-2026-11-02-laneB-fileexport/ — verbatim copies of token-adapter.ts (md5 9a6c0009), quota-gather-map.ts (ecf44799), validate.ts (2078ddfd), model.ts (6189406b) from main, run with bun run probe.ts, a previous value present in every case:

control 42pct+10pct: status=ok stale=false windows=["5h=42","weekly=10"]
negative -5 + 10:    status=ok stale=false windows=["weekly=10"]        <- 5h window silently gone
over100 250 + 10:    status=ok stale=false windows=["weekly=10"]        <- same
only window -5:      status=ok stale=false windows=[]                   <- fresh ok, zero windows
drift control NaN:   status=unparseable stale=true windows=["5h=11"]    <- retained, as designed

The NaN control proves the fail-closed path works for the shapes the adapter checks; the range is the one malformed shape it does not check, even though the mapping's own rule (quota-gather-map.ts:140, and the same rule for provider results at :199-200) defines it as malformed.

Why it matters

The file-export adapter is the framework's reference adapter (#1153) that the per-provider browser-token adapters copy. A producer whose payload drifts into an out-of-range percentage (a dashboard change, a fraction-vs-percent slip like 0.42 → 4200, a signed bug) currently degrades the dashboard quietly: windows disappear one by one, or the entry goes empty, while everything reports fresh/ok and the retained-value safety net never engages — the exact failure mode this module exists to prevent.

Distinct from

  • 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): the mapping published −20%/1e9% as live ok data. Fixed by the skip at quota-gather-map.ts:140. This issue is the residual at the adapter layer: the skip converts bad data into a silently partial/empty fresh entry, and the adapter — whose stated job is to catch exactly that — doesn't.
  • aggregator(token-adapter): file-export adapter's fail-closed window check throws on a null window element and accepts a non-string window name, instead of returning the retained unparseable outcome #2551 (closed): the adapter's window check threw on a null element / accepted a non-string name. Fixed (isRecord + name check now present at token-adapter.ts:276-285). The range was not part of that fix.

Acceptance criteria

  • collectFileExportAdapter returns the retained unparseable outcome (previous value kept, stale: true) for a success document containing a window with usedPct < 0 or usedPct > 100, naming the window in the detail — consistent with its existing NaN/non-finite handling.
  • A success document whose only window(s) are out of range no longer yields a fresh ok entry with zero windows.
  • In-range documents (including exactly 0 and exactly 100) still produce the fresh ok entry with all windows.
  • Tests cover: negative, over-100, boundary 0/100, and the mixed good+bad document case.

Activity

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

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b run 2026-11-02 01:50 CST (2026-11-02T08:01Z)
    • Found via: filed this run
    • Task: Triage the file-export adapter's missing usedPct range check — collectFileExportAdapter's fail-closed window validation checks finiteness only, so a window at -5% or 250% passes the adapter, is silently dropped by entryFromFileExport, and a partial (or zero-window) entry publishes as fresh ok instead of the retained unparseable outcome
    • Expectation: effort/xs; done = out-of-range windows fail closed at the adapter (retained unparseable outcome naming the window), boundary 0/100 still publish fresh, with tests for negative / over-100 / boundary / mixed cases
    • Links: laptop probe ~/git/fleet/probe-2026-11-02-laneB-fileexport/ (verbatim aggregator src @0858c741, token-adapter.ts md5 9a6c0009 / quota-gather-map.ts md5 ecf44799; probe: -5 and 250 windows silently dropped with status=ok stale=false, only-window -5 → ok with zero windows, NaN control → unparseable retained)
  3. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 2, 2026
  4. 69 remaining items

  5. dezren39
    added
    work/assignedQueue 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 7, 2026
  6. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-p
    • Session / ID: repo-queue-worker-shift-p cron run 2026-11-06 20:17 CST — FALLBACK MODE (queue backend down, HTTP 503 PGRST002; fallback claim marker is the claim of record for issue aggregator(token-adapter): file-export adapter's fail-closed window check omits the 0-100 usedPct range — out-of-range windows vanish and a partial (or empty) entry publishes as fresh ok #4269, no broker task id exists this shift)
    • Found via: queue fallback scan (queue/queued label, scan order)
    • Task: triage issue aggregator(token-adapter): file-export adapter's fail-closed window check omits the 0-100 usedPct range — out-of-range windows vanish and a partial (or empty) entry publishes as fresh ok #4269 (aggregator token-adapter: fail-closed window check omits the 0–100 usedPct range) — verify against current main; the specified fix is xs (range check in the adapter's window validation), so if the bug confirms I will land it in this pass with a regression test
    • Expectation: effort xs–s; done = verdict + (if confirmed) fix PR merged, labels in sync, fallback release posted
    • Links: claim marker comment above
  7. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Heartbeat: verification — CONFIRMED at current origin/main. collectFileExportAdapter's fail-closed loop (token-adapter.ts) checks isRecord + non-empty name + finite usedPct and nothing else; the 0–100 range that entryFromFileExport treats as malformed (quota-gather-map silently continues past pct<0 or pct>100) is unchecked, so out-of-range windows publish partial/empty entries as fresh ok — exactly the filing's probe. Implementing the xs fix in this pass: range check in the adapter's validation + regression tests (negative, over-100, only-window-out-of-range, inclusive 0/100 boundaries) in token-adapter.test.ts.

  8. dezren39
    added 3 commits that reference this issue on Nov 7, 2026

    fix(aggregator/token-adapter): fail closed on out-of-range window use…

    e345657

    test(aggregator/token-adapter): property coverage for the usedPct ran…

    8e4eb00

    Merge pull request #6745 from developing-today/queue/4269-token-adapt…

    34492d5
  9. dezren39
    closed this as completedin #6745on Nov 7, 2026
  10. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Released by repo-worker-code-p (fallback mode): issue #4269 triage CONFIRMED and fixed in the same pass (effort xs), merged via PR #6745 (#6745, merge 34492d5) — collectFileExportAdapter's fail-closed window validation now also rejects usedPct outside the inclusive 0–100 range, so an out-of-range window makes the whole document unparseable (previous entry retained) instead of publishing a partial or empty fresh ok. Verified: token-adapter tests 19/19 (regression examples + a deterministic seeded property sweep added at Codex's P1 request, thread replied), neighboring quota suites 104/104, tsc clean; Codex re-review completed with no findings. Issue auto-closed by the PR's Fixes line.

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-p
    • Session / ID: repo-queue-worker-shift-p cron run 2026-11-06 20:17 CST — FALLBACK MODE (queue backend down, code#6619; fallback markers are the claim of record, no broker task id this shift)
    • Found via: queue fallback scan (queue/queued label, scan order)
    • Task: issue aggregator(token-adapter): file-export adapter's fail-closed window check omits the 0-100 usedPct range — out-of-range windows vanish and a partial (or empty) entry publishes as fresh ok #4269 complete — triage confirmed the filing exactly; fix + tests on branch queue/4269-token-adapter-range, PR fix(aggregator/token-adapter): fail closed on out-of-range window usedPct (#4269) #6745 merged (34492d5), issue auto-closed
    • Expectation: nothing further; labels stripped to the terminal state
    • Links: PR fix(aggregator/token-adapter): fail closed on out-of-range window usedPct (#4269) #6745
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 7, 2026
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/lowNice to have; do when convenientsource/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.