Skip to content

JSON_MODE_SPEC.md is referenced 18 times but is not in the repository #29

Description

@lefoulkrod

The --json flag's own help text points at JSON_MODE_SPEC.md, and the file is referenced 18 times across cmd/, including as the authority for the closed error-code set and the streaming shape. The file does not exist in the repository.

$ grep -rn "JSON_MODE_SPEC" --include=*.go . | wc -l
18
$ ls JSON_MODE_SPEC.md docs/JSON_MODE_SPEC.md
ls: cannot access 'JSON_MODE_SPEC.md': No such file or directory
ls: cannot access 'docs/JSON_MODE_SPEC.md': No such file or directory

For an interface aimed at scripting, that document is the product surface — someone told to read it by the help output has nowhere to go.

Two things it should pin down, both of which are surprising and neither of which is discoverable from the output alone:

  1. Success is not the exit status. It is the absence of an error key. status --json emits a complete, valid status payload and still exits non-zero whenever the instance is not running.
  2. Streaming versus single-object commands. Which commands emit NDJSON stage events ({stage, state, detail, error, result}) and which emit one object, and that the terminal event of a stream is stage: "complete".

Worth also documenting jsonContract and what a consumer should do when it does not match the value it was built against.

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions