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(generate-digest): a trailing --kind silently archives a daily digest — the one unguarded arg() copy left among the aggregator scripts · Issue #6926 · developing-today/code

aggregator(generate-digest): a trailing --kind silently archives a daily digest — the one unguarded arg() copy left among the aggregator scripts #6926

New issue
Copy link
New issue
Copy link
Closed
#6927
Closed
aggregator(generate-digest): a trailing --kind silently archives a daily digest — the one unguarded arg() copy left among the aggregator scripts#6926
#6927
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:done

Description

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

aggregator(generate-digest): a trailing --kind silently archives a daily digest — the one unguarded arg() copy left among the aggregator scripts

Summary

pm-stack/aggregator/scripts/generate-digest.ts reads --kind through a
local arg() helper (:22-25) that returns process.argv[i + 1] verbatim —
or undefined when the flag is last. In main() (:29) that result is
combined with a default:

const kind = (arg("kind") ?? "daily") as DigestKind;

So a --kind that is present but missing its value is indistinguishable
from a flag that was never passed: the run archives (and, without
--no-deliver, push-delivers) a daily digest and exits 0. This is the
exact failure the house already settled in #3723 for post-alert.ts ("a
trailing --severity silently fell back to the critical default") — and
every sibling script now guards its value-taking flags the same way:
post-alert.ts arg(), collect-github-billing.ts explicitArg (#3419),
record-claude-launch.ts (#3415), backfill-usage-snapshots.ts --dir,
append-usage-snapshots.ts --by (#3295), compact-usage-snapshots.ts
--months. generate-digest's arg() is the unguarded copy left behind.

The flag-token case is also mishandled: --kind --no-deliver treats the
next flag as the value and exits 2 with a message that blames the value
("must be daily|weekly, got --no-deliver") instead of naming the missing
value — and the swallowed --no-deliver token never takes effect as a
flag.

Evidence (verified this run, laptop main 61f7fed)

Probe ~/git/fleet/probe-digest-kind/ — the real script, Bun, fixture
source (PM_AGG_SOURCE=fixtures), PM_AGG_DIGESTS_DIR pointed at the
probe dir, --no-deliver on every run:

Case Result
control: --kind weekly exit 0; archived weekly-2026-11-07.json ("PM weekly digest … window 168h")
control: --kind daily exit 0; archived daily-2026-11-07.json ("window 24h")
trailing: --kind (last token, no value) exit 0; archived daily-2026-11-07.json — a daily digest produced by an invocation that named --kind and supplied nothing; no error, no warning
flag-as-value: --kind --no-deliver exit 2; `generate-digest: --kind must be daily

Production callers are the systemd units
pm-stack/aggregator/systemd/digest-daily.service /
digest-weekly.service, which pass --kind daily|weekly; the script is
also the documented manual path (header Usage). A value lost to a unit
edit, a wrapper, or a hand run converts the weekly digest into a daily
one silently — the archive file and the delivered push both say "daily",
so nothing downstream can tell the weekly run ever misfired.

Why it matters

The digest archive is rendered verbatim at /digest/<date> and the push
payload announces the kind; a silently-downgraded weekly run produces a
24h-window digest where subscribers expect the 168h one, with a success
exit and a normal-looking log line. Silent default-substitution on a
present-but-valueless flag is precisely the failure mode #3723 removed
from the alert throat; the same latent copy should not survive in the
digest path.

Acceptance criteria

  • --kind with no following value, or with a following token that starts
    with --, prints a usage error naming --kind and its missing value
    to stderr and exits 2 — no digest is archived and nothing is delivered.
  • --kind daily and --kind weekly behave exactly as today (same
    archive file, same summary line); omitting --kind entirely still
    defaults to daily.
  • A regression test covers the trailing-flag and flag-as-value cases
    (script-level harness case, as in the sibling scripts' suites).

Distinct from #3333 (produce-charge-candidates --start/--end/--out,
same unchecked-argv family, different script and different silent-write
target) and from #3723 (post-alert, already fixed — this is its residual
sibling copy).

Activity

  1. developing-today commented on Nov 7, 2026

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

    CODE-2179

  2. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: new-issue-creator-code-a (issue creator, lane A)
    • Session / ID: cron new-issue-creator-code-a run 2026-11-07 11:05 CST
    • Found via: filed this run
    • Task: self-solving the trivial --kind guard fix on a laptop worktree (creator-a/6926-digest-kind-guard), targeted probe + digest test suite, PR + merge when verified
    • Expectation: effort xs; done = --kind with a missing/flag-like value exits 2 with a usage error naming the flag, valid --kind daily|weekly and the no-flag default unchanged, regression cases green
    • Links: probe ~/git/fleet/probe-digest-kind (laptop)
  3. dezren39
    added
    work/self-assignedAn agent grabbed this item directly, outside the queue
    status/in-progressQueue worker lifecycle state
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Nov 7, 2026
  4. dezren39
    added a commit that references this issue on Nov 7, 2026

    Merge pull request #6927 from developing-today/creator-a/6926-digest-…

    1fabdbc
  5. dezren39
    closed this as completedin #6927on Nov 7, 2026
  6. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: new-issue-creator-code-a (issue creator, lane A)
    • Session / ID: cron new-issue-creator-code-a run 2026-11-07 11:05 CST
    • Found via: filed this run
    • Task: self-solved — PR fix(aggregator): generate-digest --kind with a missing/flag-like value is a usage error, not a silent daily digest (#6926) #6927 merged (merge commit 1fabdbc): arg() in generate-digest.ts now follows the post-alert.ts aggregator(post-alert): the alert-intake CLI's arg() takes the next flag as a value — '--title --body x' posts a critical incident literally titled '--body' #3723 guard; a missing/empty/flag-like --kind value is a usage error (exit 2) before any archive or delivery
    • Expectation: met — new regression suite test/generate-digest-kind-6926.test.ts 4/4 on the branch and re-verified 4/4 on merged main at 1fabdbc; existing digest.test.ts green alongside (16/16 combined on the branch)
    • Links: PR fix(aggregator): generate-digest --kind with a missing/flag-like value is a usage error, not a silent daily digest (#6926) #6927 (merged); probe ~/git/fleet/probe-digest-kind (laptop)
  7. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 7, 2026
  8. developing-today
    added
    status:done
    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:done

    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.