Skip to content

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

Description

@dezren39

Summary

Three more saas-extract.ts extractors parse counts with bare \d+, so a comma-grouped figure is either silently truncated to its last digit group or drops the metric(s) entirely. This is the same defect class as #2997 (bitwarden), in extractors that issue does not name: Cloudflare counts, the Turso database count, and the GitHub comped-minutes pair. The wrong used values flow into durable snapshot records the same way #2997 describes (recordsFromSaasServices, snapshot-records.ts:85).

Evidence (main 1c6d5174)

pm-stack/aggregator/src/saas-extract.ts:

  • :308 (Cloudflare) — /(\d+) Workers, (\d+) R2 buckets[^;]*; (\d+) D1, (\d+) KV, (\d+) Queues/. \d+ cannot cross a comma. When the first count is grouped, the engine slides and records only the last group. When a later count is grouped, the pinned literal separators (, , ; ) leave nowhere to slide, so the whole match fails and all five count metrics vanish.
  • :324 (Turso) — /(\d+) DB/ records the last group of a grouped database count.
  • :395 (GitHub) — /(\d[\d,]*) Linux \+ (\d+) macOS minutes/: the Linux group already accepts commas (and strips them at :426), but the macOS group is bare \d+ pinned by the Linux + literal, so a grouped macOS figure makes the whole comped-minutes metric disappear instead of being recorded.

Verified this run on the laptop with the real extractSaasServices (saas-extract.ts md5 2b540acdb7924e834941a63b0416cf44 on both clones; probe ~/git/fleet/probe-2026-10-31-laneA-saascounts/):

CF grouped-first  "1,234 Workers, 56 R2 buckets ~2 GB; 7 D1, 8 KV, 9 Queues"
  -> workers-count=234 (want 1234), r2=56, d1=7, kv=8, queues=9
CF grouped-later  "3 Workers, 2 R2 buckets ~2 GB; 2 D1, 1,234 KV, 2 Queues"
  -> {} — all five count metrics missing (want kv=1234, rest present)
CF control        "3 Workers, 2 R2 buckets ~2 GB; 2 D1, 2 KV, 2 Queues" -> 3/2/2/2/2
Turso grouped     "1,234 DB total" -> databases=234 (want 1234); control "12 DB" -> 12
GitHub grouped    "5,000 Linux + 1,234 macOS minutes" -> actions-comped-minutes missing
                  (want 6234); control "5,000 Linux + 234 macOS minutes" -> 5234

Why it matters

  • The truncated figures are indistinguishable from true reads (234 could be a real Workers count), and they persist as snapshot history — silent corruption, not a display glitch.
  • The drop modes are worse in a different way: one grouped figure in the wrong position erases the whole Cloudflare footprint line or the comped-minutes metric, so the hub reports "not measured" for data that was recorded in the view.
  • The house pattern already exists in the same file: allowance() captures [\d,.]+, dns.ts parsePriceUsd and snapshot-records.ts:177 use [\d,]+ + strip-commas, and the GitHub extractor's own Linux group does it — these three sites are the outliers. Existing fixtures only exercise ungrouped counts (3 Workers, 2 R2 buckets…, 1 DB), so the suite cannot see the gap.

Acceptance criteria

  • Cloudflare counts parse comma-grouped figures at face value in every position: 1,234 Workers, … → 1234, and …, 1,234 KV, … → kv-count 1234 with the other four counts still present.
  • Turso databases parses 1,234 DB → 1234.
  • GitHub comped minutes parse 5,000 Linux + 1,234 macOS minutes → 6234.
  • Regression tests in pm-stack/aggregator/test/usage.test.ts cover grouped figures for all three extractors alongside the existing ungrouped fixtures; ungrouped reads are unchanged and a bullet with no counts still yields no count metrics.

Dedup

Searched open and closed issues 2026-10-31 for cloudflare counts comma, turso comma, macOS minutes, saas-extract grouped counts, and the counts-line text: the only hit is #2997, which is scoped to the bitwarden extractor (landed in PR #2987) and names only the Modal comma-dollar patterns as a sibling for triage ruling. The Cloudflare, Turso, and GitHub sites predate that commit and are not mentioned there. #2985/#2791 concern num() reinterpretation of non-decimal strings in different functions, not grouped-decimal truncation/dropping.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-a
    • Session / ID: cron job new-issue-creator-code-a, run 2026-10-31 04:05 CDT
    • Found via: filed this run
    • Task: Filed this issue: saas-extract Cloudflare counts (saas-extract.ts:308), Turso DB count (:324) and GitHub macOS comped minutes (:395) still use bare \d+ — comma-grouped counts truncate to the last digit group (1,234 → 234) or drop the whole metric.
    • Expectation: effort/s — done when the acceptance criteria on this issue pass, including grouped-count regression tests in pm-stack/aggregator/test/usage.test.ts.
    • Links: evidence in the issue body; laptop probe at ~/git/fleet/probe-2026-10-31-laneA-saascounts/ (real extractSaasServices, main 1c6d517, saas-extract.ts md5 2b540acdb7924e834941a63b0416cf44).
  3. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Design-architect pass 25 (2026-10-31) — agent note: this issue is ADOPTED as Phase 2 (with #2997) 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 records the prose form of the grammar: count extractions capture the grouped form ([\d,]+, strip commas) in EVERY position — a grouped figure that cannot match makes the metric absent, never truncated and never a whole-line drop. Flag genuine blockers on #3005.

  4. added
    work/assignedQueue worker lifecycle state
    and removed on Nov 1, 2026
  5. 17 remaining items

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

    @dezren39
    MemberAuthor

    🤖 Agent note · parked — CI pending on PR #4290

  8. added
    queue/claimedQueue 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 2, 2026
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up (resume)

  10. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: repo-worker-code (Lane A cron shift)
    • Session / ID: Lane A shift 2026-11-02 03:24 CST; queue task 5513 (small_fix) — DONE (fixed_merged)
    • What landed: PR fix(aggregator): parse grouped SaaS counts (#3000) #4290 merged as 980aea2 — grouped-count capture [\d,]+ + comma-strip at all three saas-extract sites (Cloudflare counts ×5, Turso DB, GitHub comped Linux+macOS including the macOS sum group), plus 4 regression tests in usage.test.ts (grouped-first CF, grouped-KV CF, Turso 1,234 DB, GH 5,000+1,234 minutes = 6234). Closing this issue manually: the PR body carried no closing keyword.
    • Verification (fresh this shift, laptop worktree ~/git/fleet/5513 @4a2f49636): bun test test/usage.test.ts 43/43; full aggregator bun test 1019 pass / 0 fail (matches the prior lane's run; one intermediate 3-fail run during a concurrent bun install did not reproduce). Codex review on PR fix(aggregator): parse grouped SaaS counts (#3000) #4290 completed with no findings. PR CI was still queued at merge (runner backlog); merged under standing merge authority on laptop-verified tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours 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 jobsource/design-architectFiled by the repo design architect 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