Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

K2: --help broken on 4 subcommands (manual arg parser treats it as filename) #34

@noahgift

Description

@noahgift

Kaizen Surface Gate K2 Failure (4 defects)

--help is not recognized on file-taking subcommands:

  • simular run --help → "Error: Failed to read experiment file" (exit 1)
  • simular verify --help → "Error: Failed to read experiment file" (exit 1)
  • simular emc-check --help → "Error: Failed to read experiment file" (exit 1)
  • simular emc-validate --help → "Error: Failed to read experiment file" (exit 1)

The manual arg parser consumes the next positional arg as a filename without first checking for --help/-h.

Five-Whys

  1. Why does --help fail? The string "--help" is passed as the filename argument
  2. Why is it treated as a filename? Manual arg parsing takes next positional arg without flag check
  3. Why manual arg parsing? simular uses custom dispatch instead of clap
  4. Why no --help check? The flag check only exists at the top level, not per-subcommand
  5. Why not caught? No K2 surface gate testing in CI

Fix

Add --help/-h flag detection before consuming positional args in each subcommand handler. Alternatively, migrate to clap for consistent arg parsing.

Found via kaizen surface gate sweep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions