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(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope · Issue #3419 · developing-today/code

aggregator(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope #3419

New issue
Copy link
New issue
Copy link
Closed
#4205
Closed
aggregator(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope#3419
#4205
Copy link
Assignees
dezren39
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/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

aggregator(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope

Evidence (verified this run, main f1eac95)

pm-stack/aggregator/scripts/collect-github-billing.ts:

  • :42-45 — argValue(flag) returns process.argv[i + 1] unchecked: a flag token is accepted as the previous flag's value, and a trailing flag yields undefined.
  • :72-74 — year/month are Number(argValue(...)) with no integer/range check; user is the raw string. All three are interpolated straight into the API path at :52 (users/${user}/settings/billing/usage?year=${year}&month=${month}).
  • :58-61 — on any gh failure the script's error says a 404 "usually means the scope, not a missing user", so a self-inflicted bad URL is reported as a token-scope problem.

Probe (laptop, ~/git/fleet/probe-2026-11-01-laneB-ghbilling/; real script + src/, sha256 of the script 5f8d8100… matched to main; gh stubbed to log its argv and return {"usageItems":[]}):

Invocation API call issued Result
--year 2026 --month 10 --print (control) users/dezren39/settings/billing/usage?year=2026&month=10 exit 0, correct
--month banana …?year=2026&month=NaN exit 0, prints 2026-NaN
--month 13 …&month=13 exit 0
--month 0 …&month=0 exit 0
--year 2026.5 --month 2.5 …?year=2026.5&month=2.5 exit 0
--month --print …&month=NaN (the flag token is consumed as the value, and --print still takes effect) exit 0
--user --print users/--print/settings/billing/usage?… exit 0
--print --user (trailing) user silently falls back to the default dezren39 exit 0

Against the real endpoint every malformed case 404s, and the script then misreports it as a missing user scope on the gh token — the exact misdiagnosis the error text at :58-61 was written to prevent, pointed the wrong way.

Why it matters

This is the daily GitHub billing collector (#1051): its records feed the usage snapshot store. A typo'd month in a manual or scheduled invocation either fails with a misleading scope error (sending the operator to re-auth gh instead of fixing the argument) or, for a trailing flag, silently collects a different month/user than the one named. Every sibling script that validates its period args locally fails fast with a usage error; this one validates nothing.

Acceptance criteria

  • --year must be an integer in a sane range (e.g. 2000–2100) and --month an integer 1–12; anything else (non-numeric, fractional, out of range) exits non-zero with a usage error naming the bad value, before any gh call.
  • A value-taking flag that is last, or whose next token is another flag, is a usage error — never silently replaced by the default and never consumed as a value.
  • --user must be a non-empty, non-flag value.
  • The gh-failure error keeps its scope hint only for calls whose arguments passed validation.
  • Tests pin: the control case, banana, 13, 0, 2.5, flag-as-value, and trailing-flag cases.

Distinct from #2493 (billing items never validated — response side; this is the request/CLI side) and from the per-script flag-token filings for other scripts (#3295, #3330, #3333, #3415 — different files). Family: #3352/#3353 argument-contract inventory.

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
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    developing-todayBot
    on Nov 1, 2026 – with developing.today
    Contributor
    More actions

    CODE-1307

  3. dezren39
    added
    effort/sSmall: expected under 2 hours of work
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 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-11-01 02:20 CST
    • Found via: filed this run
    • Task: Filed after verifying with the real script on the laptop (stubbed gh): argValue() (collect-github-billing.ts:42-45) + Number() at :72-74 pass NaN, month 13/0, fractional and flag-token values straight into the billing API URL, all exit 0; a trailing value flag silently falls back to the default (probe ~/git/fleet/probe-2026-11-01-laneB-ghbilling/, main f1eac95, script sha256 5f8d8100). Against real gh the 404 is then blamed on the token scope (:58-61). Enqueued as a triage packet for the queue worker.
    • Expectation: effort/s — triage confirms on current main and routes the fix (validate year/month/user locally, usage error before any gh call).
    • Links: packet packets/packet-3419-triage.json (hidden_files of the keep-the-four-repos-healthy goal)
  5. github-actions
    assigned
    dezren39
    on Nov 1, 2026
  6. dezren39
    added
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  7. 21 remaining items

  8. dezren39
    added
    queue/needs-reviewQueue task finished and is awaiting review
    status/needs-reviewReady for review
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/needs-reviewReady for review
    queue/needs-reviewQueue task finished and is awaiting review
    on Nov 2, 2026
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane C shift
    • Session / ID: task 6077
    • Found via: queue claim
    • Task: PR fix(aggregator): validate collect-github-billing CLI arguments (#3419) #4205 opened with the aggregator(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope #3419 fix (validation + stub-gh tests, targeted tests pass on laptop: 3 pass / 0 fail). Parked on CI: the test check is QUEUED (fleet runner backlog) and the Codex review is still running with no findings posted yet.
    • Expectation: on resume — checks green + Codex findings dispositioned → merge PR fix(aggregator): validate collect-github-billing CLI arguments (#3419) #4205; issue aggregator(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope #3419 closes with it.
    • Links: PR fix(aggregator): validate collect-github-billing CLI arguments (#3419) #4205 · branch queue/6077-3419-billing-cli-validation · worktree ~/git/fleet/task-6077 (laptop)
  10. dezren39
    added a commit that references this issue on Nov 2, 2026

    Merge pull request #4205 from developing-today/queue/6077-3419-billin…

    591bde9
  11. dezren39
    closed this as completedin #4205on Nov 2, 2026
  12. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane C shift
    • Session / ID: task 6077
    • Found via: queue claim (resume after CI park)
    • Task: PR fix(aggregator): validate collect-github-billing CLI arguments (#3419) #4205 MERGED (merge commit 591bde9); issue aggregator(collect-github-billing): --year/--month/--user values are never validated — NaN, month 13, month 0, fractional and flag-token values go straight into the billing API URL, and the failure is blamed on the gh token scope #3419 closed by the PR. Verification: Codex review completed with no findings; the new stub-gh suite passed 3/3 on the laptop this shift; the PR test check was still QUEUED at merge time (fleet runner backlog) — merged under Drew's standing merge authority (PRs do not wait for CI when the change itself is verified), with CI on main as the backstop.
    • Expectation: done. If main CI surfaces a failure from this change, it gets a follow-up fix per standing practice.
    • Links: PR fix(aggregator): validate collect-github-billing CLI arguments (#3419) #4205
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/sSmall: expected under 2 hours 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/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.