GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
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 Closed 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 Descriptioncloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0Evidence (verified this run, main
|
| 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).
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.
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)."1200") still parse.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/).Number() pattern in meta-exporter's parseSubscriptionQuota — different app, file, and parser; its fix does not touch this exporter.parseDbSize/parseRequestCount — different app/file again.errors shape handling) — neither covers num()'s string coercion.🤖 Agent note · filed
Agent note — triage verdict: CONFIRMED (queue task 3961)
Re-verified independently this shift, not taken from the filing probe:
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).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.
🤖 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.
🤖 Agent note · parked
node --test pm-stack/cloudflare-export/cloudflare-quota-export.test.mjs — 19 passed.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.🤖 Agent note · picked up
awaiting_ci checkpoint.🤖 Agent note · parked
dezren39); required checks are also not green.🤖 Agent note · parked
🤖 Agent note · picked up
🤖 Agent note · done