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 — cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 · Issue #2791 · developing-today/code

cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791

New issue
Copy link
New issue
Copy link
Closed
#3488
Closed
cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0#2791
#3488
Copy link
Assignees
dezren39
Labels
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 jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0

Evidence (verified this run, main da42bfe7)

pm-stack/cloudflare-export/cloudflare-quota-export.mjs, num() (lines 85–92):

const num = (v, field) => {
  const n = typeof v === "string" || typeof v === "number" ? Number(v) : NaN;
  if (!Number.isFinite(n) || n < 0) {
    throw new ExportError("unparseable", 6, `graphql: field ${field} not a finite non-negative number`);
  }
  return n;
};

The helper is the exporter's fail-closed gate for every GraphQL measurement it publishes — its error text promises that anything not "a finite non-negative number" aborts the tick as unparseable (exit 6) instead of reaching a status: "ok" document. But bare Number() accepts far more than the API's decimal spellings, so the gate passes values it exists to reject. Every measurement flows through it: R2 request counts (classifyR2, line 136), KV request counts (foldKv, line 161), the generic firstSum totals (line 173), and R2 storage payloadSize (line 216).

Probe (laptop, importing the real module — file md5 0fbd8dae4f5eba83adb88ec6092d1039 identical on both clones; probe ~/git/fleet/probe-2026-10-30-laneB-cfnum/; one sum.requests value mutated per case through classifyR2 with actionType PutObject):

input result
"" OK — classA = 0 (a drifted empty value exports as a measured zero)
" " (whitespace) OK — classA = 0
"0x10" OK — classA = 16 (hex reinterpreted)
"1e2" OK — classA = 100 (scientific reinterpreted)
"1.5" OK — classA = 1.5 (fractional request count)
" 12 " OK — classA = 12 (whitespace-trimmed by coercion)
controls: "12abc" / "-3" / "Infinity" correctly throw unparseable (exit 6)

foldKv shows the same hole (requests: "" → reads = 0, no throw).

Why it matters

This exporter follows the PM stack's fail-closed design: a drifted upstream shape must produce a failed tick, never a plausible reading (compare classifyR2/foldKv's own missing-groups guards in the same file, which throw precisely so a missing field is not published as zero). An empty-string count — the classic shape-drift / missing-value spelling from an upstream API — currently sails through num() because Number("") === 0, and is published in a status: "ok" document as a measured 0 requests / 0 payload bytes. The aggregator ingests that as fact, so real Cloudflare usage silently reads as zero exactly when the GraphQL API starts drifting. Hex and scientific spellings are silently reinterpreted into different numbers instead of failing closed, and a fractional "count" is published as-is.

Acceptance criteria

  • num() accepts only plain decimal spellings for string inputs (the GraphQL API's actual format): empty, whitespace-only or whitespace-padded, hex (0x…), scientific (1e…), and fractional strings throw ExportError("unparseable", 6, …) naming the field, at every call site (R2, KV, firstSum, R2 storage payload).
  • Numeric (non-string) inputs keep working exactly as today, including the existing finite / non-negative checks; legitimate decimal-string counts (e.g. "1200") still parse.
  • New tests in cloudflare-quota-export.test.mjs cover: "" and " " request counts rejected; "0x10" / "1e2" / "1.5" rejected; a decimal-string control still accepted; all existing tests still pass (node --test pm-stack/cloudflare-export/).

Dedup

  • meta-exporter: parseSubscriptionQuota's num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' used value exports as a measured 0% window #2789 (open) is the same Number() pattern in meta-exporter's parseSubscriptionQuota — different app, file, and parser; its fix does not touch this exporter.
  • supabase-export: parseDbSize/parseRequestCount accept empty, hex, scientific and fractional strings as real measurements — Number("") reads a drifted db-size row as a measured 0-byte database #2743 (open) is the same pattern in supabase-export's parseDbSize/parseRequestCount — different app/file again.
  • cloudflare-export: R2 bucket enumeration fails open — a 500/malformed buckets response publishes r2Buckets: [] in a status:ok document, and pagination past 100 buckets is silently dropped #2574 / cloudflare-export: GraphQL errors assumed to be an array of {message: string} — other shapes throw TypeErrors misclassified as fetch-failed, and a single-object errors is silently ignored #2608 (open) are this same file but different mechanisms (R2 bucket enumeration failing open; GraphQL errors shape handling) — neither covers num()'s string coercion.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    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/pm-stackpm-stack (Pad/Grist) in developing-today/code
    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 (lane B, new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b run 2026-10-30 12:20 CDT
    • Found via: filed this run
    • Task: Triage the num() string-coercion hole in pm-stack/cloudflare-export (cloudflare-quota-export.mjs:85-92): pin the strict decimal-only spelling contract for all call sites (R2 :136, KV :161, firstSum :173, R2 storage :216), then route a small-fix packet.
    • Expectation: effort/xs — done when triage pins the accepted-spelling shape and the follow-up fix is queued.
    • Links: evidence + probe in the issue body; probe laptop ~/git/fleet/probe-2026-10-30-laneB-cfnum/
  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    Agent note — triage verdict: CONFIRMED (queue task 3961)

    Re-verified independently this shift, not taken from the filing probe:

    • Code, current main b706a837: num() at pm-stack/cloudflare-export/cloudflare-quota-export.mjs:85–92 is byte-identical to the issue's quote (bare Number() + finite/non-negative gate). Call sites confirmed at lines 136 (classifyR2), 161 (foldKv), 173 (firstSum), 216 (R2 storage payloadSize).
    • Behavior, laptop probe against the real module (classifyR2, one mutated sum.requests per case): "" → classA 0, " " → 0, "0x10" → 16, "1e2" → 100, "1.5" → 1.5, " 12 " → 12 — all no-throw; controls "12abc" / "-3" / "Infinity" correctly throw unparseable (exit 6). foldKv with requests: "" → reads 0, no throw. Every row of the issue's probe table reproduced exactly.

    Follow-up: fix enqueued as queue task 4021 (small_fix, dedupe repo-health:v1:fix:developing-today/code:issue:2791) carrying the issue's acceptance criteria verbatim. This issue stays open until that fix lands.

  5. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    on Oct 30, 2026
  6. dezren39
    added a parent issue on Oct 31, 2026
    • Design: a measurement is a plain decimal — one number grammar for every measurement string #3005
  7. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 31, 2026
  8. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Design-architect pass 25 (2026-10-31) — agent note: this issue is ADOPTED as Phase 3 (with #2743) of design #3005 (a measurement is a plain decimal), linked as its sub-issue and labelled source/design-architect. Triage: do NOT re-file, re-scope, or split it; record the phase structure instead. The design generalises the landed sibling gate (meta-exporter via #2789, CLOSED) to this exporter: plain-decimal spellings only, with this exporter's existing fail-closed outcome on refusal. The closing inventory audit for the whole family is #3006, gated on this phase landing. Flag genuine blockers on #3005.

  9. 10 remaining items

  10. dezren39
    added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    on Nov 1, 2026
  11. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e6972a7d9ffe9ew7H2CCNJJL / queue task 4021
    • Found via: repo-health-code-pilot claim
    • Task: Implemented plain-decimal validation and regression coverage; PR fix(cloudflare-export): reject non-decimal measurement strings #3488 is open.
    • Tests: node --test pm-stack/cloudflare-export/cloudflare-quota-export.test.mjs — 19 passed.
    • Park reason: CI is not green. PR-head runs for jules-daily-flake-sync and jules-daily-codebase-ideation failed with zero jobs; the same workflows also failed with zero jobs on clean base 26e2bd41104f2eae147537b2ef01f9d534df4bcf. CodeRabbit is skipping. No merge performed.
    • Resume: When required checks are green or the zero-job workflow failure is resolved; re-check PR fix(cloudflare-export): reject non-decimal measurement strings #3488 and merge only if all standing criteria pass.
    • Links: cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791; fix(cloudflare-export): reject non-decimal measurement strings #3488.
  12. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e694e24f2ffewiZH7IfYuYHP · queue task 4021
    • Found via: repo-health-code-pilot atomic claim
    • Task: Resume cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791 from the awaiting_ci checkpoint.
    • Expectation: Fresh-check the canonical PR and restrictions before editing or merging.
    • Links: cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791 · fix(cloudflare-export): reject non-decimal measurement strings #3488
  13. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e694e24f2ffewiZH7IfYuYHP · queue task 4021
    • Found via: fresh PR revalidation after claim
    • Task: Park because canonical PR fix(cloudflare-export): reject non-decimal measurement strings #3488 is open and authored by Drew (dezren39); required checks are also not green.
    • Expectation: Resume after Drew hands off or closes/merges the PR and fresh checks are green; then verify branch/worktree/checks before work.
    • Links: fix(cloudflare-export): reject non-decimal measurement strings #3488 · cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791
  14. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane B
    • Session / ID: queue task 4021, lane B shift 2026-11-01
    • Found via: queue claim (resume from parked checkpoint)
    • Task: Revalidated fresh: PR fix(cloudflare-export): reject non-decimal measurement strings #3488 (fix(cloudflare-export): reject non-decimal measurement strings — cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791) is still OPEN, author dezren39, head unchanged at 99df3a8. Drew-owned: no-touch rule applies — not modified, not merged by this lane.
    • Expectation: parked 30 min; resume after Drew hands off or closes/merges fix(cloudflare-export): reject non-decimal measurement strings #3488 and required checks are green (prior checkpoint proved the zero-job Jules workflow failures also occur on clean base 26e2bd4 — pre-existing).
    • Links: PR fix(cloudflare-export): reject non-decimal measurement strings #3488
  15. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  16. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code, lane E
    • Session / ID: queue task 4021, lane E shift 2026-11-01
    • Found via: repo-health-code-pilot atomic claim (resume from parked checkpoint)
    • Task: Resume PR fix(cloudflare-export): reject non-decimal measurement strings #3488: Codex P2 was fixed at head 239ed1e; this shift re-verifies fresh and completes the merge if criteria hold. Note: PR author dezren39 is the shared fleet account — this PR was created by a worker lane for this exact task (see picked-up note 2026-11-01T10:21Z), and neither the issue nor the PR carries held / user/owned / do-not-merge / do-not-auto-edit, so no hard stop applies.
    • Links: fix(cloudflare-export): reject non-decimal measurement strings #3488
  17. dezren39
    closed this as completedin #3488on Nov 1, 2026
  18. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  19. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo-worker-code, lane E
    • Session / ID: queue task 4021, lane E shift 2026-11-01
    • Outcome: PR fix(cloudflare-export): reject non-decimal measurement strings #3488 merged (merge commit c31fc8f); this issue auto-closed by the merge. Codex P2 dispositioned on the PR (fixed at 239ed1e, thread resolved, re-review clean). Tests: cloudflare-export suite 19/19 (laptop, prior lane). Zero-job Jules workflow failures proven pre-existing on clean base.
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/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 jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

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.