Skip to content

fix(aggregator): generate-digest rejects unknown/duplicate arguments (#7097) - #7099

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/7097-digest-unknown-args
Nov 8, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/7097-digest-unknown-args

Conversation

@dezren39

@dezren39 dezren39 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Fixes #7097

generate-digest.ts probed argv token-by-token (indexOf/includes) and never rejected a token it did not recognize:

  • --knd weekly silently archived a daily digest, exit 0
  • --bogus was ignored, exit 0
  • --no-delivre made the delivery-suppression check false and the delivery path ran anyway (a sent Web Push cannot be unsent)
  • duplicate --kind silently first-won

Fix: rejectUnknownArgs() runs before any config load, archive write, or delivery attempt — mirroring append-usage-snapshots.ts (#6961) / compact-usage-snapshots.ts (#6967). Unknown, stray, or duplicated tokens are a usage error (message + USAGE, exit 2).

Verification (laptop, real script via subprocess, fixture source):

  • Probe ~/git/fleet/probe-digest-unknown-args: pre-fix all five cases exit 0 with the wrong/no-suppression behavior; post-fix typo/unknown/duplicate cases exit 2 with nothing archived, control still archives weekly.
  • New test/generate-digest-unknown-args-7097.test.ts: 6/6 on the branch; 5/6 fail pre-fix (control passes).
  • Existing test/generate-digest-kind-6926.test.ts: 4/4 still pass.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 8, 2026 04:15
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b8a0b4b8-0b37-476f-9264-9099f4f6602c
Commits

Reviewing files that changed from the base of the PR and between bfa5cae and b5e3cfa.

Files selected for processing: 2

  • pm-stack/aggregator/scripts/generate-digest.ts
  • pm-stack/aggregator/test/generate-digest-unknown-args-7097.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) task/small-fix Queue packet kind: bounded fix with reproduction and targeted tests source/creator Filed by the new-issue-creator job priority/normal Ordinary priority (the default) effort/xs Trivial: expected under 30 minutes of work app/aggregator Package/app: aggregator (pm-stack in this repo) labels Nov 8, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T04:16:31.103009Z b5e3cfa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app/aggregator Package/app: aggregator (pm-stack in this repo) effort/xs Trivial: expected under 30 minutes of work kind/bug Something isn't working (prefixed form of the classic bug label) priority/normal Ordinary priority (the default) source/creator Filed by the new-issue-creator job task/small-fix Queue packet kind: bounded fix with reproduction and targeted tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aggregator(generate-digest): unknown/misspelled flags silently ignored — typo --knd archives a daily digest, typo --no-delivre delivers anyway

1 participant