Skip to content

deploy(deploy.py): arguments after list are silently ignored and a duplicate --registry silently overrides the first — the typo-flag class, in the parser the activation slices will build on #6376

Closed

Description

@dezren39

Problem

pkgs/deploy/deploy.py (the deployment-architecture CLI, #5766 slice 1) silently ignores two classes of malformed arguments in main() (deploy.py:168-186):

  1. Anything after list is ignored. After the --registry extraction loop (deploy.py:172-178), main() checks only args[0] != "list" (deploy.py:186) and never inspects the rest. deploy --registry A list extra-junk and deploy --registry A list --dry-rnu both print the list and exit 0.
  2. A duplicate --registry silently overrides the first. The while "--registry" in args loop (deploy.py:172) assigns registry_path unconditionally on each pass, so the last occurrence wins with no error — the operator can be shown (and, in later slices, act on) a different registry than the one they named first.

Evidence (verified this run, laptop @ origin/main 03d1a21, probe ~/git/fleet/probe-deploy-argv)

Two one-service registries: A = svc-a (target laptop), B = svc-b (target sandbox).

  • Control python3 deploy.py --registry regA.json list → lists svc-a, exit 0.
  • ... list extra-junk → lists svc-a, exit 0 (stray argument ignored).
  • ... list --dry-rnu → lists svc-a, exit 0 (typo'd flag ignored).
  • --registry regA.json --registry regB.json list → lists svc-b, exit 0; reversed order → lists svc-a, exit 0 (last --registry wins, silently, either way).
  • Controls that do fail: unknown subcommand → exit 2; --registry=regA.json list (equals form) → exit 2 with the misleading message that --registry=regA.json "is not implemented in slice 1", because the token is treated as the subcommand name.

Why it matters

Slice 1 is read-only, so today the harm is a wrong-registry listing believed to be the requested one. But this parser is the foundation the later #5766 slices build on — the usage line already reserves deploy <target> [rollback|status] [--dry-run] — and this repo's standing lesson from that exact grammar is that silently ignored flags become dangerous the moment the verb gains effects: #3278 (claimant install: a typo'd --dry-rnu performed a real install) and #3287 (github-backup deploy: a typo'd flag performed a real deploy) were both this shape. The fleet CLI family has the same rule for its own parsers (#6139 duplicate scalar flags, #6134 argv ignored entirely). Fixing the parser now, while list is its only verb, is the cheap moment.

Acceptance criteria

  • deploy ... list <anything> exits 2 with a usage error naming the unexpected argument (after --registry extraction, list accepts no further arguments).
  • A second --registry occurrence exits 2 with an error naming the duplication, instead of last-wins.
  • The documented forms keep working: --registry before or after the subcommand, $DEPLOY_REGISTRY fallback, unknown subcommand still exit 2.
  • Tests pin all of the above (there is currently no test file for deploy.py; add one where the flake/other CLI suites keep theirs, or note the chosen home in the PR).
  • Nice-to-have, triage's call: --registry=PATH either works or its error stops calling the token a subcommand.

Activity

  1. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-05 14:50 CST
    • Found via: filed this run
    • Task: Filed after verifying on the laptop @ origin/main 03d1a21 (probe ~/git/fleet/probe-deploy-argv): arguments after list are silently ignored and a duplicate --registry silently overrides the first in pkgs/deploy/deploy.py's parser.
    • Expectation: effort s — triage confirms the fix shape (reject trailing args after list; reject duplicate --registry), then route the small parser fix.
    • Links: queue packet packet-6376-triage.json (repo-health-code-pilot)
  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. 75 remaining items

  7. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  8. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · parked

  9. added a commit that references this issue on Nov 8, 2026
  10. dezren39 commented on Nov 9, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (already done)

  11. 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 9, 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/deployPackage/app: deploy (pkgs/ or apps/ in this repo)kind/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/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions