Skip to content

fix(0.2): adopter-facing polish caught running the binary cold#166

Merged
pmclSF merged 1 commit intomainfrom
fix/0.2-polish-pre-release
May 5, 2026
Merged

fix(0.2): adopter-facing polish caught running the binary cold#166
pmclSF merged 1 commit intomainfrom
fix/0.2-polish-pre-release

Conversation

@pmclSF
Copy link
Copy Markdown
Owner

@pmclSF pmclSF commented May 5, 2026

Five user-visible issues caught by actually running terrain analyze and terrain report pr against a fresh repo + this repo before cutting 0.2.0. None of the existing tests caught these — they're shape-of-output issues that only surface to a human reading the output.

  1. Help text leads with pitch, not legacy tagline. terrain --help opened with the old "test system intelligence platform" framing.
  2. Pluralization — fresh-repo analyze said "1 test files across 1 frameworks".
  3. Empty repo lied — said "Your test suite looks healthy: 0 test files". Calling zero tests "healthy" is wrong.
  4. Sub-1% percentages floored to 0% — "7 of 796 (0% of suite)" reads as "nothing selected".
  5. "Exported function X" misnomer for vars/types/methods — adopters with an exported var saw it labeled a "function".

Pure polish, no behavior or schema changes.

Test plan

  • go test ./... clean
  • make voice-lint / docs-verify / docs-linkcheck / truth-verify clean
  • manual smoke: fresh-repo + this-repo render correctly

Plan tracker

This is the kind of quality-bar work the parity plan calls 'first-user smoke gate' work — caught by reading output, not by asserting on goldens. With this in, the release reads honestly to a new adopter.

Five user-visible issues caught by running 'terrain analyze' and
'terrain report pr' against a fresh repo and against this repo's
own diff before tagging 0.2.0. None of the existing tests caught
these — they're shape-of-output issues that only surface when a
human reads the output.

1. Help text leads with the pitch, not the legacy tagline

   `terrain --help` opened with "Terrain — test system intelligence
   platform" — the framing the parity plan and #137 explicitly
   moved away from. Changed to the pitch ("the control plane for
   your test system") + the one-paragraph promise so the help
   text matches the README and vision doc.

2. Pluralization in the analyze headline

   Fresh-repo analyze said "1 test files across 1 frameworks".
   Now properly pluralizes singular and plural via the existing
   plural() helper.

3. Empty-repo headline lied about health

   A repo with zero test files used to render "Your test suite
   looks healthy: 0 test files across 0 frameworks." — calling
   absence of tests "healthy" is wrong on its face. Now renders
   "No test files detected. Add tests with your framework of
   choice, then re-run `terrain analyze`."

4. PR-comment percentage rounded sub-1% selections to 0%

   "Tests selected | 7 of 796 (0% of suite)" was technically
   integer-truncation but read as "selection ran and produced
   nothing". Now displays "<1%" for sub-1% fractions; the
   formatSuitePercent helper centralizes the formatting so other
   surfaces can adopt it.

5. "Exported function X" misnomer for non-functions

   The protection-gap message claimed every exported symbol was
   a "function", regardless of CodeUnitKind. Adopters with an
   exported var (like `cli.Default`) or type (`cli.Registry`)
   saw "Exported function Default has no observed test coverage."
   Now the kind is read from CodeUnit.Kind and rendered with the
   matching noun ("Exported method", "Exported class",
   "Exported module"), with "Exported symbol" as the neutral
   fallback for kinds the parser didn't classify.

How these were caught

I built the binary, ran `terrain analyze` and `terrain report pr`
on this repo and on a 1-file fresh fixture, and read the output
the way an adopter would. Each issue was a paper-cut that
existing tests don't assert on (the test goldens cover shape;
they don't catch wrong nouns or rounded percentages).

These are pure polish — no behavior changes, no new features,
no schema changes. Locks the existing experience to be honest
and accurate before tag.

Verification: full Go test suite green; all five release-readiness
gates pass (docs-verify, docs-linkcheck, truth-verify, voice-lint,
make build); manual smoke against a fresh-repo + this-repo
confirms the user-visible changes render as expected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pmclSF pmclSF merged commit 72827b1 into main May 5, 2026
@pmclSF pmclSF deleted the fix/0.2-polish-pre-release branch May 5, 2026 00:59
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

[RISK] Terrain — Merge with caution

High-severity gaps found in changed code.

Metric Value
Changed files 4 (4 source · 0 test)
Impacted units 11
Protection gaps 6
Tests selected 4 of 796 (<1% of suite)

Coverage gaps in changed code

  • cmd/terrain/main.go [LOW] — main.go has no observed test coverage.
    → Add unit tests for main.go.
  • internal/analyze/headline.go [LOW] — headline.go has no observed test coverage.
    → Add unit tests for headline.go.
  • internal/impact/analysis.go [MED] — Exported class CoverageTypeInfo has no observed test coverage.
    → Add unit tests for exported class CoverageTypeInfo — this is public API surface.
  • internal/impact/analysis.go [MED] — Exported class ProtectiveTestSet has no observed test coverage.
    → Add unit tests for exported class ProtectiveTestSet — this is public API surface.
  • internal/impact/analysis.go [MED] — Exported class SelectedTest has no observed test coverage.
    → Add unit tests for exported class SelectedTest — this is public API surface.
  • internal/impact/analysis.go [MED] — Exported class SelectionReason has no observed test coverage.
    → Add unit tests for exported class SelectionReason — this is public API surface.
4 pre-existing issues on changed files
  • cmd/terrain/main.go [HIGH] — [blastRadiusHotspot] Changes to this file propagate to 169 tests (169 direct, 0 indirect). High blast radius increases regression risk.
  • internal/analyze/headline.go [HIGH] — [blastRadiusHotspot] Changes to this file propagate to 378 tests (123 direct, 255 indirect). High blast radius increases regression risk.
  • internal/changescope/render.go [HIGH] — [blastRadiusHotspot] Changes to this file propagate to 219 tests (50 direct, 169 indirect). High blast radius increases regression risk.
  • internal/impact/analysis.go [HIGH] — [blastRadiusHotspot] Changes to this file propagate to 1031 tests (267 direct, 764 indirect). High blast radius increases regression risk.

Recommended tests

4 test(s) with exact coverage of 5 impacted unit(s). 6 impacted unit(s) have no covering tests in the selected set.

Test Confidence Why
internal/changescope/changescope_test.go exact exact coverage of RenderCIAnnotation, RenderPRCommentConcise
internal/changescope/dedup_test.go exact exact coverage of RenderChangeScopedReport, RenderPRSummaryMarkdown
internal/changescope/unified_render_test.go exact exact coverage of RenderPRSummaryMarkdown
internal/impact/impact_test.go exact exact coverage of IsAnalyzableSourceFile

Owners: PMCLSF

Limitations
  • No coverage artifacts provided; protection gaps reflect missing data, not measured absence. Provide --coverage to improve accuracy.
  • Mixed test cultures reduce cross-framework optimization confidence. Consider standardizing on fewer frameworks.

Generated by Terrain · terrain pr --json for machine-readable output

Targeted Test Results

Terrain selected 4 test(s) instead of the full suite.

  • Go tests: passed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Terrain AI Risk Review

Metric Value
AI surfaces 13
Eval scenarios 17
Impacted scenarios 0
Uncovered surfaces 13

Decision: PASS — AI surfaces are covered.

pmclSF added a commit that referenced this pull request May 9, 2026
Five user-visible issues caught by running 'terrain analyze' and
'terrain report pr' against a fresh repo and against this repo's
own diff before tagging 0.2.0. None of the existing tests caught
these — they're shape-of-output issues that only surface when a
human reads the output.

1. Help text leads with the pitch, not the legacy tagline

   `terrain --help` opened with "Terrain — test system intelligence
   platform" — the framing the parity plan and #137 explicitly
   moved away from. Changed to the pitch ("the control plane for
   your test system") + the one-paragraph promise so the help
   text matches the README and vision doc.

2. Pluralization in the analyze headline

   Fresh-repo analyze said "1 test files across 1 frameworks".
   Now properly pluralizes singular and plural via the existing
   plural() helper.

3. Empty-repo headline lied about health

   A repo with zero test files used to render "Your test suite
   looks healthy: 0 test files across 0 frameworks." — calling
   absence of tests "healthy" is wrong on its face. Now renders
   "No test files detected. Add tests with your framework of
   choice, then re-run `terrain analyze`."

4. PR-comment percentage rounded sub-1% selections to 0%

   "Tests selected | 7 of 796 (0% of suite)" was technically
   integer-truncation but read as "selection ran and produced
   nothing". Now displays "<1%" for sub-1% fractions; the
   formatSuitePercent helper centralizes the formatting so other
   surfaces can adopt it.

5. "Exported function X" misnomer for non-functions

   The protection-gap message claimed every exported symbol was
   a "function", regardless of CodeUnitKind. Adopters with an
   exported var (like `cli.Default`) or type (`cli.Registry`)
   saw "Exported function Default has no observed test coverage."
   Now the kind is read from CodeUnit.Kind and rendered with the
   matching noun ("Exported method", "Exported class",
   "Exported module"), with "Exported symbol" as the neutral
   fallback for kinds the parser didn't classify.

How these were caught

I built the binary, ran `terrain analyze` and `terrain report pr`
on this repo and on a 1-file fresh fixture, and read the output
the way an adopter would. Each issue was a paper-cut that
existing tests don't assert on (the test goldens cover shape;
they don't catch wrong nouns or rounded percentages).

These are pure polish — no behavior changes, no new features,
no schema changes. Locks the existing experience to be honest
and accurate before tag.

Verification: full Go test suite green; all five release-readiness
gates pass (docs-verify, docs-linkcheck, truth-verify, voice-lint,
make build); manual smoke against a fresh-repo + this-repo
confirms the user-visible changes render as expected.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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