Skip to content

Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352

Open
8 of 12 issues completed

Description

@dezren39

Design (design-architect pass 30, 2026-11-01). Full design doc: files/designs/code-operator-argument-contract.md in the keep-the-four-repos-healthy goal workspace. Audited at origin/main 5de8ee19. No user/review: every origin carries explicit acceptance with a verified laptop probe, and the judgment calls below are the architect's recorded decisions.

Summary

The repo's operator scripts parse their command lines by membership test — args.includes("--dry-run"), argv.indexOf("--store") — and are silent about everything else. Ten filings in three days are that silence, in two costumes plus a sibling:

The strict behaviour already exists in-tree (lib/bws-to-sops.sh:53 dies on unknown argument; scripts/stage-docs.sh:45; compact-usage-snapshots.ts:28-31 exits 2 naming a bad value). No operator script uses a strict platform parser (zero parseArgs hits). Sibling contracts: #2835 governs env numbers, #3005 measurement strings, dezren39/nix#1145 another repo's scripts — this repo's argv has no stated contract.

The contract (recorded decisions)

Every argument is accounted for before anything happens. A script declares its whole command line and parses strictly; anything unaccounted for is a usage error naming the offending argument, exit non-zero (2 where no usage code is established), before any subprocess / network / file write / lock / deploy step.

  1. Unknown means stop — unknown flag, stray positional, and typo'd flag are the same event.
  2. --opt=value either works identically to --opt value or is refused under (1) — never a silent fall-through to a different operation (per-tool pin in triage, stated in usage text).
  3. Present-but-valueless is not absent — trailing, flag-valued, or (where non-empty is required) empty values are usage errors naming the option; defaults apply only when the option was not given.
  4. A parsed safety flag (--dry-run, --status) is honoured on every path; tests cover the flag × path matrix.
  5. Per-tool strict parsing (tools deploy independently, three languages, no shared imports); the contract and one probe matrix are shared: unknown flag → zero stubbed side-effect calls; typo'd safety flag → same; value-option edge forms → pinned behaviour; previously valid invocations unchanged.

Phases (adopted origins — no parallel issues)

Open questions stay in the design doc (repeated value options; short-flag style; a mechanical net; leading-dash values).

Displacement note: this pass's standing candidate was the pkgs/id plain-output rendering family (#2839/#3111/#3089, pass 29). It is displaced by this cluster per pass 29's own watch condition (unknown-args "revisit at a third tool" — now six, plus four) and remains the standing candidate for pass 31.

Acceptance criteria

  • Every operator script in the audit scope either rejects unknown arguments with a non-zero exit and a named error, or is explicitly dispositioned as deliberately lenient with its reason recorded (per the design doc's contract statement).
  • Phases 1-3 (the origin issues named in the design) are filed as linked implementation issues and land or are dispositioned; the closing argv-parser inventory (Phase 3, Phase 3 (audit) of #3352 — closing argv-parser inventory + argument contract statement #3353) finds no un-dispositioned hand-rolled parser in scope.
  • A typo'd flag on a mutating script (e.g. --dry-rnu on a deploy script) provably performs no mutation — verified by probe on at least one script per family.

Activity

  1. added
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Nov 1, 2026
  2. added sub-issues on Nov 1, 2026
  3. 33 remaining items

  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  7. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/design-architectFiled by the repo design architect jobstatus/parkedDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions