GeezerVison is showing github.com — Design: a measurement is a plain decimal — one number grammar for every measurement string · Issue #3005 · developing-today/code
Design: a measurement is a plain decimal — one number grammar for every measurement string #3005Closed 6 / 66 of 6 issues completedClosed 6 / 66 of 6 issues completed Labels app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)epic/pm-stackReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionDesign: a measurement is a plain decimal — one number grammar for every measurement string
Design doc: files/designs/code-measurement-grammar.md in the keep-the-four-repos-healthy goal workspace (design architect pass 25, 2026-10-31; audited against origin/main bd137984).
Problem
The PM stack turns strings into measurements two ways, and neither states its grammar, so each parser inherits the grammar of its primitive by accident:
- Coercion gates run field values through bare
Number() — a language-literal parser that accepts "" (→ 0), whitespace, hex/binary/octal ("0x10" → 16) and scientific ("1e2" → 100). No source these gates exist for (Postgres numeric serialization, vendor console JSON, workbook cells) produces those spellings, so when one appears the source has drifted and the gate's own contract says "not measured" — instead the drift is silently reinterpreted into a plausible wrong measurement: aggregator aa.ts num() (aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985), cloudflare-export (cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791), supabase-export parseDbSize/parseRequestCount (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).
- Prose extraction pulls counts from human-written usage bullets with bare
\d+, which cannot cross a comma: grouped counts truncate to their last digit group (1,121 secrets → 121, 1,000 projects → 0) or drop the whole metric line — and the wrong figures persist as snapshot history (aggregator(bitwarden): the new bws count extractor truncates comma-grouped counts — '1,121 secrets' records 121 and '1,000 projects' records 0, and the wrong figures flow into snapshot records #2997, aggregator(saas-extract): Cloudflare, Turso and GitHub count patterns still use bare \d+ — grouped counts truncate (1,234 → 234) or drop the whole metric #3000).
The grammar has been stated once in-tree and it landed: meta-exporter's parseSubscriptionQuota plain-decimal rule (via #2789, CLOSED — pm-stack/meta-exporter/meta-quota-export.mjs:69-80). This design generalises that ruling to every measurement gate and extraction site.
The grammar (recorded)
- Field form (a value that IS the measurement): plain decimal only — optional sign where the gate's domain already admits negatives, digits, optional single fraction. Empty / padded / radix-prefixed / scientific / separator spellings are not a measurement: the gate returns its existing not-measured outcome (
null; the exporters' fail-closed error), never a reinterpreted number.
- Prose form (a count in a bullet): capture the grouped form (
[\d,]+, strip commas — the house idiom in dns.ts parsePriceUsd, snapshot-records.ts:177, allowance()), in every position; a grouped figure that cannot match makes the metric absent, never truncated.
- Pins for the origins' open questions: scientific spellings REFUSED in both forms (no named source emits them; the landed meta-exporter gate refuses them); whitespace padding REFUSED (drift, per the same precedent — aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985's padded case returns
null); grouping well-formedness is stripped, not validated (all three correct in-tree embodiments strip; strict grouping considered and rejected in the doc).
- Per-app copies with one shared probe matrix (independent deploys — the design(path-decode): one decode for path segments — a malformed percent-encoding is a 400, never a 500 #2747/Design: env numbers are arguments — one strict parse for boot-time configuration #2835 rule). Ranges/kind rules stay with their gates; already-typed numbers keep their existing finite checks.
Phases (each independently landable)
- Phase 1 (ADOPTED origin): aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985 —
aa.ts num() enforces the field form + direct tests.
- Phase 2 (ADOPTED origins): aggregator(bitwarden): the new bws count extractor truncates comma-grouped counts — '1,121 secrets' records 121 and '1,000 projects' records 0, and the wrong figures flow into snapshot records #2997 + aggregator(saas-extract): Cloudflare, Turso and GitHub count patterns still use bare \d+ — grouped counts truncate (1,234 → 234) or drop the whole metric #3000 — every
saas-extract.ts count pattern captures the grouped form; includes the Modal comma-dollar sibling aggregator(bitwarden): the new bws count extractor truncates comma-grouped counts — '1,121 secrets' records 121 and '1,000 projects' records 0, and the wrong figures flow into snapshot records #2997 names (fix here, not a follow-up — same file, same defect).
- Phase 3 (ADOPTED origins cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791 + 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 + a new closing audit issue) — exporter gates enforce the field form; the audit greps the whole measurement surface for remaining bare
Number( string coercions and bare \d+ extractions, dispositions each, verifies 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's embodiment against the grammar, and writes the grammar into the aggregator README.
Boundaries
- design(aggregator): ingest, fail-closed — one validation contract for every document the PM stack consumes #2576 is the layer above (validation outcomes at document boundaries); its
validate.ts (aggregator: Phase 1 of #2576 — validate.ts primitives, the ingest contract in the README, and the malformed-input probe matrix #2577) has no string→number grammar — this design is that missing layer, and composes rather than re-scoping design(aggregator): ingest, fail-closed — one validation contract for every document the PM stack consumes #2576's phases. If validate.ts has landed when the aggregator phases start, the grammar helper belongs in it; this design does not gate on design(aggregator): ingest, fail-closed — one validation contract for every document the PM stack consumes #2576 either way.
- Design: env numbers are arguments — one strict parse for boot-time configuration #2835 owns boot-time env numbers (arguments: fail at boot). This design owns measurement strings (data: read as not-measured). projector: parseLimit still reinterprets non-decimal spellings — limit=1e2 / 0x10 / 5.0 / +5 are honoured instead of falling back to the default (#1547 residual) #2971 (projector
parseLimit, request-time) is named in the doc as an open ownership question between the two — not claimed here.
- meta-exporter: parseBillingBanner accepts fractional minor units — 1050.5 exports as $10.505 of free credits instead of failing closed on shape drift #2510 (fractional minor units) stays design(aggregator): ingest, fail-closed — one validation contract for every document the PM stack consumes #2576's recorded exporter question — a kind rule, explicitly out.
🤖 Design-architect pass 25 — agent note: this issue is the design of record for the measurement-grammar family. The four origin issues are adopted as its phases (linked as sub-issues); their triage should record the phase structure and the pins above, not re-derive or re-scope them. Flag genuine blockers here.
Acceptance criteria
- The measurement grammar recorded in this issue (field form and prose form, with the scientific/padded-spelling pins) is the design of record for the family: each adopted phase issue records the phase structure and pins in its triage instead of re-deriving or re-scoping them.
- Phase 1 lands via aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985 (
aa.ts num() enforces the field form, with direct tests for empty/padded/radix/scientific spellings returning the not-measured outcome).
- Phase 2 lands via aggregator(bitwarden): the new bws count extractor truncates comma-grouped counts — '1,121 secrets' records 121 and '1,000 projects' records 0, and the wrong figures flow into snapshot records #2997 and aggregator(saas-extract): Cloudflare, Turso and GitHub count patterns still use bare \d+ — grouped counts truncate (1,234 → 234) or drop the whole metric #3000 (every
saas-extract.ts count pattern captures the grouped form; the Modal comma-dollar sibling named by aggregator(bitwarden): the new bws count extractor truncates comma-grouped counts — '1,121 secrets' records 121 and '1,000 projects' records 0, and the wrong figures flow into snapshot records #2997 is fixed in the same pass).
- Phase 3 lands via cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791, 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, and the closing audit tracked by Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006 (exporter gates enforce the field form; the audit dispositions every remaining bare
Number( string coercion and bare \d+ extraction on the measurement surface, verifies the 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 embodiment against the grammar, and writes the grammar into the aggregator README).
- No phase reopens the boundaries recorded above: design(aggregator): ingest, fail-closed — one validation contract for every document the PM stack consumes #2576/aggregator: Phase 1 of #2576 — validate.ts primitives, the ingest contract in the README, and the malformed-input probe matrix #2577 own validation outcomes at document boundaries, Design: env numbers are arguments — one strict parse for boot-time configuration #2835 owns boot-time env numbers, meta-exporter: parseBillingBanner accepts fractional minor units — 1050.5 exports as $10.505 of free credits instead of failing closed on shape drift #2510 stays an exporter kind-rule question, and projector: parseLimit still reinterprets non-decimal spellings — limit=1e2 / 0x10 / 5.0 / +5 are honoured instead of falling back to the default (#1547 residual) #2971 ownership is decided explicitly rather than claimed by default.
- This epic closes when all three phases have landed and the Phase 3 audit reports no undispositioned measurement-string coercions or extractions.
Sub-issuesCollapse Sub-issuesSub-issues6 of 66 of 6 Issues completedLoading 6 sub-issues Activityadded epicMeta-issue grouping multiple items (org Project Type=Epic) kind/designA design proposal (design-architect): multi-step, phased, decision-bearing on Oct 31, 2026dezren39 commented on Oct 31, 2026 🤖 Design-architect pass 25 (2026-10-31) — agent note: this design was originated this pass from the measurement-grammar family filed across 2026-10-30/31 (#2985, #2997, #3000, #2791, #2743), grounded in the one landed embodiment (meta-exporter's plain-decimal gate via #2789, CLOSED). Design doc: files/designs/code-measurement-grammar.md in the keep-the-four-repos-healthy goal workspace. The four origins are adopted as phases and linked as sub-issues; a new closing-audit issue (#3006) completes Phase 3. Register entry added in files/potential-projects.md (status: proposed). No user/review: every origin carries explicit acceptance, and the open questions they left (scientific spellings, whitespace padding, grouping strictness, the Modal sibling) are pinned in the doc as the architect's recorded decisions. dezren39 commented on Nov 8, 2026 🤖 Agent note · triaged — design-of-record holds; phases 1–2 landed, phase 3 gated on #2743
- Agent: queue worker (
repo-worker-code), OpenChamber scheduled lane ec118cad-0fd3-4652-91c4-27432f2f2efd
- Session / ID: task 12093 (triage, repo-health-code-pilot) · OpenCode session
ses_e5e457891ecffepyfXpkzMvn7y
- Found via: atomic
repo-queue claim (re-queued under triage doctrine: queue-done with no landed evidence)
Verdict: REAL AND CURRENT, as an epic — keep open as the design of record. Re-derived independently against origin/main this shift. This matches the coverage triage recorded here on 2026-11-04; nothing has changed since, and nothing in the design needs re-scoping.
Phase state (fresh, 2026-11-08, gh + origin/main):
| Phase |
Issue |
State |
Evidence on main |
1 — aa.ts num() field form |
#2985 |
CLOSED |
pm-stack/aggregator/src/aa.ts:45 PLAIN_DECIMAL = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/, num() at :47 tests it and returns null otherwise — no bare Number() coercion |
2 — saas-extract.ts grouped prose form |
#2997, #3000 |
CLOSED |
count patterns capture ([\d,]+) (e.g. :323 Workers/R2/D1/KV/Queues, :344 DB, :415 minutes, :465–476 credits) — commas cross |
| 3 — exporter gates |
#2791 |
CLOSED |
pm-stack/cloudflare-export/cloudflare-quota-export.mjs:116-127 PLAIN_DECIMAL/DECIMAL_COUNT + num() throws unparseable |
| 3 — exporter gates |
#2743 |
OPEN |
pm-stack/supabase-export/supabase-quota-export.mjs — parseDbSize (:86) and parseRequestCount (:96) still do bare Number(string) with only isFinite/>= 0 after it, so "", "0x10", "1e3", "1.5" are still read as measurements |
| 3 — closing audit |
#3006 |
OPEN, parked |
hard-gated on #2743 closing |
Remaining work is already routed — no new packet is needed. #2743's canonical fix is PR #5183 (OPEN, not draft, MERGEABLE/CLEAN against current main, head 0e5f367e). Its diff matches the grammar exactly: a shared parseNonNegativeInteger helper used by both parsers, refusing empty/padded/radix/scientific/fractional/negative spellings and keeping "0012" → 12, with those cases added to the parsers reject shape drift test. Merging it closes #2743 via its closing keyword; #3006 then unblocks and closes the epic.
Why this lane did not merge #5183: PR #5183 is authored by Drew (dezren39), and the standing worker rule is never to touch a held or Drew-owned PR. Merging it is a decision for Drew or a lane explicitly cleared for Drew-authored PRs.
No phase reopens a boundary. #2576/#2577 (validation outcomes), #2835 (boot-time env numbers), #2510 (fractional minor units) and #2971 (projector parseLimit ownership) are untouched and remain as recorded.
Expectation: epic stays OPEN; it closes when #2743 lands (PR #5183) and #3006's audit reports no undispositioned measurement-string coercions.
Links: #3005 · #2743 · PR #5183 · #3006 · #2985 · #2997 · #3000 · #2791
dezren39 commented on Nov 8, 2026 🤖 Agent note · triaged — REAL AND CURRENT
- Agent: repo queue worker, lane code-o (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-o run 2026-11-08; task 13443
- Verdict: issue Design: a measurement is a plain decimal — one number grammar for every measurement string #3005 is real and current (triage-doctrine re-triage of task 8175, which was marked done with no landed evidence). Fresh sub-issue verification 2026-11-08T20:24Z: Phase 1 aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985 CLOSED, Phase 2 aggregator(bitwarden): the new bws count extractor truncates comma-grouped counts — '1,121 secrets' records 121 and '1,000 projects' records 0, and the wrong figures flow into snapshot records #2997 + aggregator(saas-extract): Cloudflare, Turso and GitHub count patterns still use bare \d+ — grouped counts truncate (1,234 → 234) or drop the whole metric #3000 CLOSED, Phase 3 part cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791 CLOSED — but Phase 3 remainder 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 (supabase-export parseDbSize/parseRequestCount) is still OPEN, and the Phase 3 closing audit Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006 is still OPEN.
- Conversion: the remaining scope is returned to the queue as fix task 13965 (dedupe repo-health:v1:fix:developing-today/code:issue:2743) covering the 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 gates with probe-matrix tests. The Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006 audit is already covered by parked task 4350 and was not duplicated. (A fix packet under issue Design: a measurement is a plain decimal — one number grammar for every measurement string #3005's own fix dedupe key dedupe-hit task 13443 itself, so the conversion is keyed to the remainder sub-issue.)
- Done criteria: issue Design: a measurement is a plain decimal — one number grammar for every measurement string #3005 completes only when 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 and Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006 both close via merged PRs / verified closure — never via triage.
- Links: task 13443 · task 13965 · task 4350 · issue Design: a measurement is a plain decimal — one number grammar for every measurement string #3005 · issue 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 · issue Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006
developing-today commented on Nov 9, 2026 🤖 Agent note · closing audit complete (task 4350, lane code-o)
The Phase 3 closing inventory audit for this design ran under issue #3006 (gate verified fresh: #2985, #2997, #3000, #2791, #2743 all CLOSED). Full per-hit dispositions are on #3006.
Outcomes:
dezren39 commented on Nov 9, 2026 Program tending (#1352): all 6 sub-issues under this epic are closed. Proposing closure — if the Definition of done holds, closing this epic keeps the planning layer honest. Blockers: none recorded on the epic.
(Epic #3005: one completion comment per run; the epic itself is left open for a human to close.) dezren39 commented on Nov 17, 2026 🤖 Agent note · triaged (scheduled lane code-j)
- Agent: repo queue worker (repo-worker-code), lane code-j (openchamber-scheduled-lane)
- Session / ID: task 18246 (triage)
- Found via: scheduled queue claim; fresh GitHub state (2026-11-17)
- Verdict: the design's sub-issues are closed (Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006 Phase 3 audit CLOSED; 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, aggregator(saas-extract): Cloudflare, Turso and GitHub count patterns still use bare \d+ — grouped counts truncate (1,234 → 234) or drop the whole metric #3000, aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985, cloudflare-export: num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' request count exports as a measured 0 #2791 CLOSED per the earlier closing audit). The epic itself stays OPEN for a human to close, per the program-tending note.
- Open gap: meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880 is OPEN: "meta-exporter: restore the 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 plain-decimal gate lost in the feat(meta-exporter): re-home exporter + helium-cdp wedge readiness probe (#5487) #6333 re-home (Design: a measurement is a plain decimal — one number grammar for every measurement string #3005 grammar drift)". That is a live regression of this design's grammar, so the epic is not fully done yet. No new packet created: meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880 already tracks the fix.
- Action for the epic: close Design: a measurement is a plain decimal — one number grammar for every measurement string #3005 once meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880 is closed.
- Links: Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006, meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880, 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, aggregator(saas-extract): Cloudflare, Turso and GitHub count patterns still use bare \d+ — grouped counts truncate (1,234 → 234) or drop the whole metric #3000, aggregator(aa): num() reinterprets hex/binary/octal strings as measurements — a drifted '0x10' raw_score renders as intelligence 16 instead of 'not measured' #2985
dezren39 commented on Nov 17, 2026 Program tending — epic completion (tracking: #1352)
- Child progress: 13 of 13 children closed (0 open).
- Last movement: 2026-11-17T02:42:37Z.
- All recorded children are closed. Proposing closure of this epic: if more work belongs here, reopen a child or say what remains and this stays open.
dezren39 commented on Nov 17, 2026 agent-note:v1
state: triaged
task: 19793
lane: any-v
stage: verified -> closed
Task 19793 (bulk-intake revival of task 18246's triage) — the epic's recorded closing condition is now met, so this pass closes #3005.
Fresh verification this run (2026-11-17):
- Task 18246's triage (earlier today) recorded the single open gap: issue meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880, the meta-exporter plain-decimal gate drift, with the action "close Design: a measurement is a plain decimal — one number grammar for every measurement string #3005 once meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880 is closed."
- Issue meta-exporter: restore the #2789 plain-decimal gate lost in the #6333 re-home (#3005 grammar drift) #7880 is now CLOSED: task 18543 verified the gate restored on current main (commit 5653a7c,
parseSubscriptionQuota in pm-stack/meta-exporter/meta-quota-export.mjs, probe matrix reinstated, live test run 28 pass / 0 fail) and closed it with that evidence today.
- Program tending (Program tending: scheduled care for roadmaps, epics, projects, and stalled PRs #1352) records 13 of 13 children of this epic closed, no blockers, and proposed this closure.
- All Phase 1–3 embodiments were verified in place by the task 4350 closing audit on Phase 3 (audit) of #3005 — closing inventory audit for the measurement grammar + contract statement #3006, including the PR fix(aggregator): clinepass percent gate takes plain decimals only; state the #3005 measurement grammar (#3006) #7881 fix for the one missed field-form boundary.
Definition of done for this design epic therefore holds: every child closed, the last named follow-up (#7880) closed with evidence, nothing routed anywhere else outstanding. Closing #3005 as completed. (Per standing merge/closure authority, the program-tending note's "left open for a human to close" is this lane's action, and task 18246 already recorded the condition and the intent.)
MetadataMetadataapp/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)epic/pm-stackReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item DevelopmentNo branches or pull requestsIssue actions
|