Skip to content

fix(tooling): coverage.yml prints per-layer FILE COUNTS beside real percentages, and pipes prose into GITHUB_OUTPUT #39

Description

@koniz-dev

Context

Two small pieces of confusion in coverage.yml. Neither breaks the gate - the
per-layer thresholds are computed and enforced correctly (see the closing comment
on #25) - but the first one directly cost a bogus P2 issue, so it is worth
removing.

1. The metrics step prints file counts that read like coverage

📊 Coverage Metrics:
  Overall: 89.8%
  Domain files: 15
  Data files: 12
  Presentation files: 11
  Core files: 70

15 is a count of SF: records, not a percentage, sitting directly under a real
percentage under a heading that says "Coverage Metrics". The real per-layer
figures are produced by a different step (layer_coverage) and printed
elsewhere. I read this block, concluded the thresholds were not enforced, and
filed #25 on that basis. It is a trap for the next reader too.

2. calculate_layer_coverage.sh emits prose into $GITHUB_OUTPUT

The script prints label lines between its key=value pairs:

Output values with % suffix for display
domain_display=100.0%
...
Output numeric values for comparison
domain=100.0
...
Summary of coverage by layer
Domain Layer: 100.0%

The workflow appends every line to $GITHUB_OUTPUT with
while IFS='=' read -r key value, so a line with no = becomes
Output values with % suffix for display=. Harmless today, but it is writing
junk keys into a step output and would silently break if a label ever contained
=.

Acceptance criteria

  1. Calculate coverage metrics no longer prints per-layer file counts under a
    "Coverage Metrics" heading. Either it reports the real per-layer percentages
    (reusing steps.layer_coverage.outputs.*) or it drops the per-layer lines and
    reports overall only.
  2. Anything still emitting a file count says so unambiguously in its label
    (e.g. "files measured", not "Domain files" under "Coverage Metrics").
  3. scripts/test/calculate_layer_coverage.sh separates machine-readable output
    from human output: only key=value lines reach $GITHUB_OUTPUT. A
    --github-output flag, or sending prose to stderr, both work.
  4. $GITHUB_OUTPUT contains no keys with spaces after the change. Show the
    step's parsed output.
  5. The Enforce coverage thresholds step still gates on the same five numbers
    and still passes on main: a workflow_dispatch run concludes success with
    the five lines. Record the run id.
  6. ./scripts/dev/audit_template.sh exits 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:tooling-ci.github/workflows, scripts/, tool/, bricks/, git hookspriority:P3Nice to have: cosmetic, speculative, or long tailstatus:blockedCannot proceed: needs a decision, credential, or upstream fixtype:taskChore, refactor, docs, or tooling work with no new capability

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions