Skip to content

package-coverage-check: NDJSON errors, usage exit 2, TTY refusal and a JSON summary #2762

Closed

Description

@josecelano-bot

Part of EPIC #2758. Order 3 of 11, wave 1.

Goal

package-coverage-check follows the stdout-result-data contract for all three subcommands, and the coverage workflow consumes the new summary result.

Background

contrib/dev-tools/checks/package-coverage-check/src/main.rs writes plain-text errors to stderr (package-coverage-check: <error>), exits 1 for every failure including a usage error, does not refuse a TTY, and summary prints Markdown. ADR docs/adrs/20261106102632_scope_the_cli_output_contract_and_keep_exit_codes_to_zero_one_two.md (section 3) requires NDJSON errors, usage error exit 2, TTY refusal, and summary returning one JSON object that carries the Markdown (for example in a markdown field). .github/workflows/generate_coverage_pr.yaml calls matrix (output into $GITHUB_OUTPUT), compare (redirected to a file) and summary (appended to $GITHUB_STEP_SUMMARY, around lines 49-54 and 150-160); the summary step must extract the field.

The contract in short: see the ADRs docs/adrs/20260519000000_define_global_cli_output_contract.md and docs/adrs/20261106102632_scope_the_cli_output_contract_and_keep_exit_codes_to_zero_one_two.md.

In scope

  • NDJSON error records with a kind on stderr for every failure; empty stdout on failure.
  • Usage errors exit 2; runtime failures exit 1.
  • TTY refusal (exit 2, tty_refusal record) for all subcommands.
  • summary emits one JSON object with the Markdown in a markdown field; update generate_coverage_pr.yaml to extract it (for example jq -r .markdown).
  • Tests for the new shapes.

Out of scope

  • Changing the coverage computation or the matrix and compare result schemas beyond what the contract needs.
  • Editing the ADR.

Acceptance criteria

  • Every failure writes one JSON record with a kind to stderr and nothing to stdout.
  • A usage error exits 2; a runtime failure exits 1.
  • Running with stdout on a TTY exits 2 with a tty_refusal record.
  • summary prints one JSON object whose markdown field is the former report.
  • The workflow step summary shows the same Markdown as before.

The full specification (implementation plan, verification plan, files this issue may touch) is added by the spec PR under docs/issues/open/.

Activity

  1. added a commit that references this issue on Nov 9, 2026
  2. added 5 commits that reference this issue on Nov 10, 2026
  3. added 3 commits that reference this issue on Nov 11, 2026
  4. added a commit that references this issue on Nov 11, 2026
  5. added 2 commits that reference this issue on Nov 11, 2026
  6. added 2 commits that reference this issue on Nov 11, 2026
  7. added a commit that references this issue on Nov 19, 2026
  8. self-assigned this
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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