Skip to content

[TK-013] Missing *required* flags still exit 2, while malformed flags exit 3 #31

Description

@chaoz23

Follow-up to #30, filing an inconsistency that PR knowingly left rather than over-reaching.

#30 moved malformed calls onto exit 3 via UsageError:

call exit
unknown command 3
unknown flag 3
duplicate flag (--chunks 1 --chunks 2) 3
flag missing its value (--chunks) 3

But a missing required flag still exits 2:

tablekit signal --seat rowan            # no --kind  -> exit 2
tablekit signal --seat rowan --kind pacing   # no --quote -> exit 2
tablekit park                            # -> exit 2

Those are malformed invocations in exactly the same sense — the caller should fix the call and retry, not escalate to a human. Under FAMILY.md clause 1 they belong on 3.

They were left alone deliberately. They are raised as plain ConfigError from many scattered sites, mixed in with genuine refusals that correctly exit 2 (init: file exists; consumed: id not open; report: insufficient data; symlinked ledger). Sweeping them without auditing each site risked moving a real verdict onto the usage-error code, which would break the honest lane rather than sharpen it — the opposite of the intent.

What this needs: an audit of every ConfigError raise site, classifying each as malformed call (→ UsageError, exit 3) or verdict (→ stays exit 2), then the same regression-test treatment #30 got in both directions.

Not currently caught by the conformance gate — its probe uses an unknown flag, which is already fixed. So this is invisible to CI and will stay invisible until someone does the sweep. Filing so it is not rediscovered from scratch.

Related: chaoz23/srdcheck#77 is the same class in srdcheck (exit-2 semantics stated more narrowly than the CLI behaves).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions