Repository navigation
fix(pm-stack): quota exporters reject repeated value flags (#16724) - #16729
Merged
developing-today-fleet[bot] merged 1 commit intoNov 29, 2026
Merged
Conversation
parseArgs in cloudflare-quota-export.mjs and meta-quota-export.mjs assigned values[token] unconditionally, so a duplicated value flag silently retargeted the run to the last value (--out-dir a --out-dir b wrote to b). Both now raise a usage error (ExportError status usage, exit 2) naming the duplicated flag, before any directory creation, token resolution, API or CDP side effect -- the same contract the sibling strict parsers landed in PR #4475/#4476 and #8901. Tests: repeated-flag unit tests in each exporter suite (repeated --out-dir with two distinct paths, plus each other flag), and the #3469 property tests updated to the new grammar -- valid streams use each flag at most once, and the malformed generators gained a duplicate-flag violation kind. node --test on both suites: 93 pass.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
developing-today-fleet
Bot
deleted the
lane/0422e-16724-duplicate-flags
branch
November 29, 2026 10:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16724.
Problem
parseArgsin both quota exporters assignedvalues[token] = valueunconditionally, so a repeated value flag silently retargeted the run to the last value:--out-dir a --out-dir bwrote the export (and its failure document) tob;--cdp-port 19222 --cdp-port 9222silently probed the second port. Same defect class as #8899 (fixed for the sibling exporter by #8901); these two exporters were the inconsistent remainder of the #3352 strict-argument contract family.Change
pm-stack/cloudflare-export/cloudflare-quota-export.mjsandpm-stack/meta-exporter/meta-quota-export.mjs: a repeated value flag now raises a usage error (ExportErrorstatususage, exit 2) naming the duplicated flag, insideparseArgs— before any directory creation, token resolution, API, or CDP side effect, so no artifact is written to either conflicting destination.--out-dirwith two distinct paths, plus--account-id/--cdp-port/--team-id); single-use controls already present and unchanged. The pm-stack(quota-exporters): opt() in all three exporters takes a flag token as a value — '--out-dir --cdp-port 19222' writes the export into a directory named '--cdp-port', the flag token is consumed twice, and a non-numeric --cdp-port becomes a NaN CDP outage #3469 property tests are updated to the new grammar: valid streams use each flag at most once, and the malformed generators gained a duplicate-flag violation kind (oracle: the declared argv grammar, per the testing doctrine).Verification
node --test pm-stack/cloudflare-export/cloudflare-quota-export.test.mjs pm-stack/meta-exporter/meta-quota-export.test.mjson the laptop worktree: 93 pass, 0 fail. Previously valid single-use invocations (systemd/timer call sites pass each flag once) are unchanged.Lane 0422-E, delta PRESS work loop 2026-11-29.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T10:40:34Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.