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 — scripts(worker-preflight): reject unaccounted CLI arguments per operator-script contract · Issue #10431 · developing-today/code

scripts(worker-preflight): reject unaccounted CLI arguments per operator-script contract #10431

New issue
Copy link
New issue
Copy link
Closed
#10438
Closed
scripts(worker-preflight): reject unaccounted CLI arguments per operator-script contract#10431
#10438
Copy link
Assignees
dezren39
Labels
status:done

Description

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

Summary

scripts/worker-preflight.sh is an operator script invoked at the start of worker tasks (see root AGENTS.md, "Worker Git preflight"). It takes no arguments, but it does not declare or enforce that contract: extra positional arguments are silently ignored and the script proceeds as if invoked correctly.

Evidence

On origin/main (e77ed212644298222326837e36c5771d3a05d0e2 at time of check), in /home/user/git/code:

$ bash scripts/worker-preflight.sh extra-arg
worker-preflight: clean (/home/user/git/code; no local refs/heads/origin/main)
$ echo $?
0

scripts/worker-preflight.sh (24 lines) performs its checks and exits 0/1/2 based on repo state, but never validates $#. Any stray or misspelled argument is accepted without notice.

Why it matters

doc/agents/operator-script-argument-contract.md and root AGENTS.md ("Operator script argument contract #3352") require every operator script to declare its whole command line and parse strictly against that declaration before any subprocess, network, file write, lock, or deploy step; anything unaccounted for is a usage error with a non-zero exit. Worker preflight is a guardrail script workers run before relying on Git names — silently accepting unexpected arguments weakens that contract and can hide invocation mistakes.

Suggested fix / acceptance criteria

  • Reject any unaccounted argument(s) with a clear usage error on stderr and exit code 2 (usage error), before performing preflight checks or emitting the success/clean message.
  • Document the accepted command line in the script header comment (no arguments).
  • Preserve existing behavior and exit codes for valid invocations: exit 0 when clean, exit 1 when refs/heads/origin/main shadows the remote-tracking ref, exit 2 when not in a Git worktree or ref verification cannot be completed.
  • Add/adjust a small regression check (shell test or existing test harness convention for scripts/worker-preflight.sh, if present) asserting that an extra argument is rejected with non-zero/usage status and does not print the clean success message.

References

  • scripts/worker-preflight.sh
  • AGENTS.md — "Worker Git preflight", "Operator script argument contract (Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352)"
  • doc/agents/operator-script-argument-contract.md

Activity

  1. developing-today commented on Nov 15, 2026

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

    CODE-3776

  2. developing-today
    added
    status:in-review
    on Nov 15, 2026
  3. github-actions
    assigned
    dezren39
    on Nov 15, 2026
  4. dezren39
    closed this as completedin 5223595on Nov 16, 2026
  5. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 16, 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.