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(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0 · Issue #6961 · developing-today/code

aggregator(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0 #6961

New issue
Copy link
New issue
Copy link
Closed
#6962
Closed
aggregator(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0#6961
#6962
Copy link
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/xsTrivial: expected under 30 minutes 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 jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

aggregator(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0

Summary

pm-stack/aggregator/scripts/append-usage-snapshots.ts never validates its argv. The mode is selected with a substring-style membership test and every other token is ignored:

  • :71 — const fromProviderUsage = process.argv.includes("--from-provider-usage");
  • :56-59 — resolveObservedBy looks up only the exact --by token (its value was hardened in aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295; the flag set itself was not).

So any misspelled or unknown flag is silently dropped:

  1. A typo'd mode flag changes what data is written. --from-provider-usag does not match, so the script silently runs the default mode (derive records from quota-view.md + the provider registry) instead of the requested --from-provider-usage mode (derive from the keeper's provider-usage snapshot). The intended source file is never even opened, the intended records never reach the outbox, and the run exits 0. In the stewardship flow (the script's documented caller, header :8-16) the log line reports a normal run, so the loss is invisible.
  2. Any unknown flag is silently ignored. --bogus-flag alongside a valid invocation changes nothing and exits 0.
  3. A typo'd --byy alice silently discards the attribution. resolveObservedBy never sees --by, so every appended record carries the default observedBy (check-usage / stewardship-cycle) instead of the requested name — provenance is silently wrong, not missing.

This is the remaining unguarded surface of the script whose --by value #3295 hardened, and the same class the strict-argument-contract design #3352 tracks; sibling scripts got per-script filings and fixes (#3723, #6926, #6939, #6941).

Evidence (verified this run, laptop @ e238c85, probe ~/git/fleet/probe-append-argv)

Real script run with all four paths redirected to fixtures (provider-usage.json = {"generated_at":"2026-11-07T00:00:00Z","sessions":[{},{}]}; empty quota-view/registry fixtures):

Invocation Result
--from-provider-usage (control) exit 0, appended 1 record(s) — {"serviceId":"opencode-server","metricId":"sessions-listed","value":2,"observedBy":"check-usage",...}
--from-provider-usag (typo) exit 0, no records derived; outbox untouched — default mode ran; the provider-usage records were silently lost
--from-provider-usage --bogus-flag exit 0, record appended — unknown flag silently ignored
--from-provider-usage --byy alice exit 0, record appended with observedBy:"check-usage" — requested attribution silently dropped

Mode-switch proof: with provider-usage.json deleted, the typo invocation still exits 0 (no records derived), while the correctly spelled invocation fails with exit 1 (ENOENT) — the typo'd run never opens the file it was asked to read.

Why it matters

This script is a writer in the usage-snapshot pipeline (hub design §4): stewardship runs it unattended right after a quota-view refresh, and hand runs use --from-provider-usage. A one-character typo in either caller silently swaps or loses a whole run's records while reporting success — the exact failure #3295's comment warns about for --by ("a silent loss of the whole run"), one flag over. Wrong observedBy attribution additionally corrupts the provenance the snapshot store's consumers rely on.

Acceptance criteria

  • Any argv token that is not --from-provider-usage, --by, or the value consumed by --by is a usage error: exit 2, a message naming the offending token, and no file read or written (the same before-any-I/O discipline as resolveObservedBy / aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295).
  • The existing aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295 behavior is unchanged: malformed --by (missing / empty / flag-like value) still exits 2 with its specific message (the token consumed as --by's value is not re-interpreted as a flag by the new check), and the pinning test test/append-usage-snapshots-by-3295.test.ts still passes.
  • Valid invocations are unchanged: no args, --from-provider-usage, --by <name>, and their combination derive and append exactly as today.
  • New regression tests in the style of the aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295 pinning test cover: a misspelled mode flag, an unknown flag, and a misspelled --byy, each asserting exit 2 and an untouched outbox.

Related

  • aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295 (closed) — the --by value guard in this same script.
  • Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 (open, design) — one strict argument contract for the repo's operator scripts.
  • pm-stack(aggregator): recordsFromProviderUsage accepts impossible/non-ISO generated_at — Date.parse-only gate yields records isSnapshotRecord refuses, so the append CLI silently drops the whole provider-usage snapshot #5140 (open) — a different silent-drop axis in the same pipeline (recordsFromProviderUsage date gate).

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

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

    CODE-2204

  3. dezren39
    added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/in-progressQueue worker lifecycle state
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    effort/xsTrivial: expected under 30 minutes of work
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Nov 7, 2026
  4. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (lane B, new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-07 15:50 CST
    • Found via: filed this run
    • Task: append-usage-snapshots.ts silently ignores unknown/misspelled flags — a typo'd --from-provider-usage runs the wrong derivation mode and exits 0 (verified with the real script on laptop @ e238c85, probe ~/git/fleet/probe-append-argv)
    • Expectation: effort/xs — reject unknown argv tokens with exit 2 before any file I/O, preserving the aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295 --by behavior; taking this as a guarded self-solve this run (see pickup note)
    • Links: probe ~/git/fleet/probe-append-argv (laptop); related issue aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295, issue Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352
  5. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: new-issue-creator (lane B, new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-07 15:50 CST
    • Found via: self-assigned during new-issue-creator-code-b run
    • Task: implementing the argv validation for issue aggregator(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0 #6961 on branch creator-b/6961-append-snapshots-argv (laptop worktree): reject any token that is not --from-provider-usage, --by, or --by's consumed value — exit 2 naming the token, before any file is read or written; add regression tests in the aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295 pinning style
    • Expectation: effort/xs — done = targeted aggregator tests green on the laptop, PR opened and merged, issue closed
    • Links: branch creator-b/6961-append-snapshots-argv
  6. dezren39
    added a commit that references this issue on Nov 7, 2026

    Merge pull request #6962 from developing-today/creator-b/6961-append-…

    073b320
  7. dezren39
    closed this as completedin #6962on Nov 7, 2026
  8. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: new-issue-creator (lane B, new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-07 15:50 CST
    • Found via: self-assigned during new-issue-creator-code-b run
    • Task: implemented the argv validation — rejectUnknownArgs() runs first in main(), before any file is read or written; the token --by consumes is judged by resolveObservedBy (aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295) and never re-interpreted as a flag
    • Expectation: met — PR fix(aggregator): reject unknown arguments in append-usage-snapshots (#6961) #6962 merged as 073b320; new pinning suite + the aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' #3295 suite are 4/4 green on the branch and on merged main; the new regression test fails pre-fix (verified by stash); the issue probe now exits 2 naming the typo'd token while the control run appends the identical record
    • Links: PR fix(aggregator): reject unknown arguments in append-usage-snapshots (#6961) #6962 (merged); probe ~/git/fleet/probe-append-argv (laptop)
  9. dezren39
    added
    status:done
    and removed
    status/in-progressQueue worker lifecycle state
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/xsTrivial: expected under 30 minutes 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 jobstatus:donetask/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.