Skip to content

Session Handoff [auto-2285]: Every CLI Script Answers --help and Refuses Unknown Arguments, Rule and Gate Remaining for #2285 #2785

Closed

Description

@ptr727

Next steps, in priority order

  1. Finish Every CLI Script Answers --help and Refuses Unknown Arguments Before Writing #2285, whose configure.sh half already landed in Require configure.sh's Command and Refuse Unknown Arguments Before Any Read #2287 and was promoted in Promote develop to main: configure.sh Refuses Unknown Arguments Before Any Read #2288. Two parts of its proposal remain, and done is both merged to develop in one pull request carrying Closes on promotion: #2285:
    • The rule. State in CODESTYLE.md (General, and the Shell section) and in the shell-codestyle Skill source that every command-line script the hub ships either answers --help and -h by printing its usage and exiting 0 with nothing written, or refuses an argument it does not recognize, exiting non-zero before any read or write. A script that can write does both. No script falls back to a default mode or target on an unrecognized first argument, and a write mode is never the default. Rebuild the generated Skill copies with scripts/build_dist.py.
    • The gate. Add a test that runs every tracked command-line entry point with --help and with an unknown --bogus-flag, in a sandbox with no network or credentials, asserting the first exits 0 with usage text and the second exits non-zero, neither making an API call. tests/test_configure_usage.py already does this for configure.sh beside a recording gh stub, so reuse its shape rather than inventing a second one. The issue puts hooks under host-setup/agent-safety/claude/ out of scope, and nothing under host-setup/agent-safety/ is edited in this lane.

External blockers

None known at pick time. Where the gate finds an entry point that breaks the rule and fixing it would edit host-setup/agent-safety/, or the fix needs a choice the issue does not settle, park per the unattended-handoff Skill rather than guessing.

Internal dependencies

The rule lands before or with the gate, since the gate's assertions are the rule's mechanical form and a reviewer reads one against the other.

State

No branch, worktree, or pull request exists for this lane yet. Re-derive the entry-point set from the tree on develop rather than from the issue's survey, which dates from before #2287.

The parked decision queue

None.

What the last round did

The unattended-handoff picker created this lane for #2285. Nothing else.

What not to repeat

Do not redo the configure.sh changes. #2287 made its command required, refused unknown options and malformed targets before any read, and added -h/--help.

New learnings

None.

Activity

  1. added
    handoffA link in the session handoff chain, one open issue per track
    on Oct 11, 2026
  2. ptr727 commented on Oct 11, 2026

    @ptr727
    OwnerAuthor

    Parked: waiting on decision #2787

    Done, on branch feature/auto-2285, pushed at 55a2be09, two commits on develop at adc6c0c3:

    • CODESTYLE.md General gains "Command-Line Arguments": every command-line script answers --help and -h with its usage and exit 0, changing nothing, and refuses an unrecognized argument with a non-zero exit before any read or write, never taking an unrecognized first argument as a default mode or target. A hook its host runs is not a command-line script. The Shell section points at it, and shell-codestyle and python-codestyle carry it as a generated include. build_dist.py --check is clean.
    • tests/test_cli_usage.py discovers every tracked .sh, .ps1, and executable or __main__-guarded .py outside tests/ and .husky/, and runs each with --help, -h, and --bogus-flag beside recording stubs, no token, and a local proxy listener that counts connections. It asserts exit 0 with usage for help, a usage or named refusal for the flag, no stub call or connection, and an unchanged tree. It skips on Windows.
    • Fixed to meet the gate: spec/validate.py, spec/workflow_reuse.py, spec/fidelity_honesty.py, spec/resolve_description.py, and the python-directories action now parse with argparse. catalog/snippets/hub-fetch-run.py answers help and refuses an option before any fetch. install-tools.ps1 and setup-wsl.ps1 refuse a dash-prefixed positional before any read, and setup-wsl.ps1 refuses a distribution outside -Install.
    • Two local-strict-review passes are recorded, and the edit budget is spent.

    No pull request is open. The worktree is left standing at /home/pieter/repos/worktrees/ProjectTemplate-auto-2285, clean.

    Waits on decision #2787: whether the rule also says "a write mode is never the default", which would change the defaults of build_dist.py, skills_install.py, install-skills, and upgrade-host. The recommended answer, leaving it out, needs no edit.

    Remaining after the answer:

    1. Open the pull request with Closes on promotion: #2285 and drive it.
    2. List these in its body, each with its class. Adding git to the gate's stubs shows that spec/audit.py runs git config --get remote.origin.url at import, so canonical_review.py, spec/audit.py, fidelity_honesty.py, and workflow_reuse.py read before parsing. The rule says "before any read", so this is introduced. It is not fixed, since HUB_NAME is a module constant used about 30 times. The three agent-safety hooks that are also run by name are exempted in NOT_COMMAND_LINE, though the rule counts them as command-line scripts. That is introduced, and filed as Make the Agent-Safety Hooks Run by Name Answer --help and Refuse Unknown Arguments #2786 for an attended session. The --check sentence-length hits on CODESTYLE.md Shell paragraph sentences are pre-existing.

    Filed along the way: #2786, ordinary work and not part of this lane. No lesson issue.

    Observed: test_prose_lint.TestDiffScopeFloor.test_a_deliberately_narrowed_scan_is_not_told_the_narrowing_is_a_defect fails on unmodified develop on this host. The cause was not investigated.

  3. added
    blockedBlocked on another issue: one in another repository, or a decision issue here for a parked handoff
    on Oct 11, 2026
  4. ptr727 commented on Oct 11, 2026

    @ptr727
    OwnerAuthor

    Resumed in an attended session. The maintainer's answers:

    This session keeps blocked on this link while it works the lane.

  5. ptr727 commented on Oct 11, 2026

    @ptr727
    OwnerAuthor

    Lane closed out with no successor: #2285 is done and released in 2.0.970.

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

    blockedBlocked on another issue: one in another repository, or a decision issue here for a parked handoffhandoffA link in the session handoff chain, one open issue per track

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions