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 — pkgs/id(scripts): prod-lines-check.sh ignores unaccounted CLI arguments before running the scan · Issue #10518 · developing-today/code

pkgs/id(scripts): prod-lines-check.sh ignores unaccounted CLI arguments before running the scan #10518

New issue
Copy link
New issue
Copy link
Closed
#10546
Closed
pkgs/id(scripts): prod-lines-check.sh ignores unaccounted CLI arguments before running the scan#10518
#10546
Copy link
Assignees
dezren39
Labels
status:done

Description

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

Problem

pkgs/id/scripts/prod-lines-check.sh accepts and ignores unaccounted positional CLI arguments, then proceeds with its normal scan/work instead of failing fast with a usage error.

This violates the operator-script argument contract (#3352): every operator script must declare its whole command line and reject anything unaccounted for with a non-zero exit before any subprocess, network, file write, lock, or deploy step.

Evidence

  • Script: pkgs/id/scripts/prod-lines-check.sh (HEAD 87e0133). It documents env-var test seams (PROD_LINES_ROOT, PROD_LINES_LIMIT) but declares no positional arguments and has no $#/arg validation; it resolves paths and runs a full find/awk-based production-line scan over the tree.
  • Verified repro from pkgs/id on 87e0133:
    • bash scripts/prod-lines-check.sh extra-arg-test did not reject the extra argument. It performed the full scan and reported results (prod-lines-check: 330 production files scanned..., with existing over-limit findings in this checkout) before exiting 1 due to those violations — demonstrating that work ran despite the unaccounted argument instead of failing on argument validation before the scan.

Why it matters

Unaccounted arguments are silently accepted, so typos or misuse (e.g. a mistaken path passed positionally instead of via PROD_LINES_ROOT, or a stray flag) do not stop execution. That can hide operator error and makes the script's CLI contract ambiguous.

Acceptance criteria

  • pkgs/id/scripts/prod-lines-check.sh rejects any unaccounted positional arguments with a clear usage/error on stderr and a non-zero exit (exit 2, consistent with sibling pkgs/id scripts) before resolving/validating paths or scanning files.
  • Normal invocation with no positional arguments behaves as before, including existing env-var seams (PROD_LINES_ROOT, PROD_LINES_LIMIT).
  • --help/-h behavior, if added or already present, also rejects trailing unaccounted arguments per contract.
  • A regression test covers rejection of extra arguments (and preserves existing check behavior for valid invocations).

Suggested fix shape

  • Add an explicit argument contract (e.g. usage() + reject $# > 0, with optional --help handling that also rejects extra args) near the top, before computing pkg_dir/root or running find/awk.
  • Follow the strict pattern used by other covered pkgs/id operator scripts (e.g. build.sh, test-shard-sandbox.sh).

Activity

  1. developing-today commented on Nov 15, 2026

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

    CODE-3818

  2. dezren39
    added a commit that references this issue on Nov 15, 2026

    fix(id/scripts): reject unaccounted args in prod-lines-check

    This issue will close once commit 9b4f72e is merged into the 'main' branch.
    9b4f72e
  3. developing-today
    added
    status:in-review
    on Nov 15, 2026
  4. github-actions
    assigned
    dezren39
    on Nov 15, 2026
  5. dezren39
    closed this as completedin #10546on Nov 16, 2026
  6. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 16, 2026
  7. developing-today
    added
    status:in-review
    and removed
    status:done
    on Nov 23, 2026
  8. developing-today
    reopened this on Nov 23, 2026
  9. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Reconciliation — Lane KK (archer), 2026-11-23. This issue is already satisfied on current main; closing as completed with evidence.

    What landed: PR #10546 (merged 2026-11-16, merge commit 76a837c7e01f) — "fix(id/scripts): reject unaccounted args in prod-lines-check". Its body names this issue as the one it fixes; the auto-close evidently never fired.

    Verified fresh against current main this pass:

    • pkgs/id/scripts/prod-lines-check.sh now declares the argument contract at the top, before any path resolution or scan work: any positional argument prints unexpected argument: <arg> plus usage to stderr and exits 2. No-arg invocation and the PROD_LINES_ROOT / PROD_LINES_LIMIT seams are unchanged below that guard.
    • Regression coverage is on main in pkgs/id/scripts/prod-lines-check-test.sh: check_usage_fail 'extra positional argument' extra-arg-test asserts exit status 2 and the unexpected-argument message, alongside the preserved valid-invocation checks.

    Every acceptance criterion is met by that landed change, so no new code is needed. Closing as completed.

  10. dezren39
    closed this as completedon Nov 23, 2026
  11. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

status: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.