Skip to content

verify shouts INVARIANT VIOLATED when the user simply passed too few --scope flags #40

Description

@jordonpeterson

Severity: low, but flagged independently by three of five user tests. Pre-existing.

verify with no --scope means "assert nothing changed", and with too-narrow scopes means "you didn't declare this one". Both print the tool's loudest possible string:

cot verify --before before.json --after after.json --scope '/docs/'
INVARIANT VIOLATED: 2 path(s) changed outside the declared scope     # exit 2

Nothing was violated — the operator passed one flag where they needed three. --scope is documented as repeatable, so this is wording, not a doc gap. Reports:

  • a platform engineer re-read README twice before checking --help;
  • a repo owner running the documented post-merge proof recipe called it "a scary word for a routine query";
  • a reorg manager got a false one from --scope * unquoted, where the shell expanded the glob.

Suggested fix

Say what happened — e.g. 2 path(s) changed that no --scope declared (--scope is repeatable; pass one per intended scope) — and reserve "INVARIANT VIOLATED" for a genuine out-of-scope movement in a run that did declare scopes.

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