Skip to content

fix(covgate,covratchet): progress is the single canonical table#33

Merged
ben-miru merged 2 commits into
mainfrom
fix/covgate-progress-alignment
May 18, 2026
Merged

fix(covgate,covratchet): progress is the single canonical table#33
ben-miru merged 2 commits into
mainfrom
fix/covgate-progress-alignment

Conversation

@ben-miru

@ben-miru ben-miru commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #32. The live progress block and the alphabetical recap table carried the exact same per-package rows, doubling output without adding information — the user reported "the spacing is off" and then "the first and second table give exact same information, please only show first table".

Now, when --parallelism=0:

  • The streamed progress block (with the new leading COUNT column under [N/total]) is the single canonical table.
  • Per-package rows print only once, in completion order.
  • The second STATUS header and reprinted rows are removed.
  • FAIL detail (multi-line raw test output for testErr cases) still prints after the stream — that's not duplicated data.
  • --exclude SKIPPED rows still print, indented under the COUNT column so they align with the progress table's STATUS column.

Non-progress mode (--parallelism>0) is unchanged: a single alphabetical table, no progress stream.

Before (current main)

Running 27 packages with parallelism=22; progress will appear as packages finish:
STATUS   COVERAGE  REQUIRED      TIME  PACKAGE
-------  --------  --------  --------  -------
[8/27] PASS  internal/pkg/openapi/server  0.8s            <- columns don't align
...
PASS         0.0%      0.0%      0.8s  internal/pkg/openapi/server   <- same data again
...

After

Running 27 packages with parallelism=22; progress:
COUNT    STATUS   COVERAGE  REQUIRED      TIME  PACKAGE
-------  -------  --------  --------  --------  -------
[ 8/27]  PASS         0.0%      0.0%      0.8s  internal/pkg/openapi/server
[21/27]  PASS         0.0%      0.0%      1.1s  internal/pkg/server/response
...
[27/27]  PASS         0.3s  ...

Total time: 5.4s
All packages meet minimum coverage requirement

With --exclude, SKIPPED rows appear indented under the COUNT column:

[ 1/10]  PASS        62.7%     62.3%      0.3s  internal/commands
[10/10]  PASS         0.0%      0.0%      0.3s  internal/testutil
         SKIPPED       ---       ---       ---  internal/services/lint
         SKIPPED       ---       ---       ---  internal/services/lint/linter
         ...

Total time: 0.3s
All packages meet minimum coverage requirement

Notes

  • progressColWidth(total) scales the COUNT column with package count: [ 8/27] is 7 chars for 27 packages, [ 88/100] is 9 for 100.
  • Extracted writeRunHeader in both packages to keep run() under the 50-line funclen limit after the bracketing/header logic was added.
  • restOfOutput is the dual of firstLine — used in progress mode to print only the trailing FAIL detail of checkResult.output, not the row that was already streamed.
  • Test assertions updated: STATUS header appears exactly once (progress IS the table); a COUNT header is present in progress mode and absent otherwise; progress lines must carry full row data.

Test plan

  • go test ./internal/services/covgate/... ./internal/services/covratchet/... passes
  • ./scripts/preflight.sh ends with === All checks passed ===
  • Smoke-tested go run ./cmd/miru covgate --packages="./internal/..." --src-prefix=internal --parallelism=0 — single table, no duplicate
  • Smoke-tested same with --exclude=./internal/services/lint/... — SKIPPED rows render indented under COUNT

🤖 Generated with Claude Code

ben-miru and others added 2 commits May 17, 2026 19:58
Stream live progress rows in the same column layout as the final
table, with a new leading COUNT column ([N/total]) above STATUS,
COVERAGE, REQUIRED, TIME, PACKAGE. The previous compact format
("[i/N] STATUS pkg time") didn't share column widths with the
sorted recap, making the two blocks visually inconsistent.

The final table still prints unchanged after the progress block:
in completion order live, then alphabetical recap once everything
finishes. The leading announcement is also shortened to
"Running N packages with parallelism=P; progress:" since the COUNT
header now self-documents what follows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The streamed progress block and the alphabetical recap carried the
exact same per-package rows, doubling the output without adding
information. Now there is one table: the live progress stream.

Behavior changes when --parallelism=0:
- Per-package rows print only once (in completion order, as part
  of the progress stream).
- The second STATUS header and reprinted rows are gone.
- FAIL detail (multi-line raw test output for testErr cases) still
  prints after the stream — that's not duplicated data.
- --exclude SKIPPED rows still print, indented under the COUNT
  column so they align with the progress table's STATUS column.

Non-progress mode (--parallelism>0) is unchanged: a single
alphabetical table, no progress stream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ben-miru ben-miru changed the title fix(covgate,covratchet): align live progress lines with table columns fix(covgate,covratchet): progress is the single canonical table May 18, 2026
@ben-miru ben-miru merged commit b44801f into main May 18, 2026
3 checks passed
@ben-miru ben-miru deleted the fix/covgate-progress-alignment branch May 18, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant