Skip to content

feat(0.2): docs-linkcheck binary + schema field tiers (Tracks 9.8/9.12)#151

Open
pmclSF wants to merge 1 commit intomainfrom
feat/0.2-track9-docs-linkcheck-field-tiers
Open

feat(0.2): docs-linkcheck binary + schema field tiers (Tracks 9.8/9.12)#151
pmclSF wants to merge 1 commit intomainfrom
feat/0.2-track9-docs-linkcheck-field-tiers

Conversation

@pmclSF
Copy link
Copy Markdown
Owner

@pmclSF pmclSF commented May 3, 2026

Summary

Two release-readiness deliverables that lift the contract Terrain
makes with adopters:

  • Track 9.8 — Make docs-linkcheck. New
    cmd/terrain-docs-linkcheck binary + make docs-linkcheck
    Makefile target. Walks docs/ and verifies every intra-repo
    markdown link resolves. Caught + fixed 3 broken links in the
    public docs surface.
  • Track 9.12 — Schema field stability tiers. New
    docs/schema/FIELD_TIERS.md defines Stable / Beta / Internal
    tiers per JSON field, with concrete examples and a promotion
    path. Linked from docs/schema/README.md.

What changed

New code:

  • cmd/terrain-docs-linkcheck/main.go — link checker (~210 lines,
    zero deps)

New docs:

  • docs/schema/FIELD_TIERS.md — three-tier contract per JSON field

Edited:

  • Makefiledocs-linkcheck target wired
  • docs/README.md — fixed legacy/ → legacy/legacy-notes.md
  • docs/quickstart.md — fixed examples/ → examples/analyze-report.md
  • docs/release/release-notes.md — fixed ../architecture/ → 00-overview.md
  • docs/schema/README.md — added pointer to FIELD_TIERS.md

Why these together

Both close release-readiness gaps the parity plan flagged: 9.8
gives CI a way to catch link rot before adopters do; 9.12 gives
adopters a clear contract for what they can build long-lived
tooling against. Both are docs/infra additions with no behavior
change.

Test plan

  • go build ./... clean
  • make docs-linkcheck passes — all public-surface links
    resolve
  • make docs-verify clean — manifest unchanged
  • go test ./... clean — no test impact

What's NOT covered (intentional)

  • Anchor verification (#section-name) — out of scope today;
    would need slug-aware heading parsing per markdown flavor
  • External link reachability (http/https) — out of scope;
    adds CI-time network dependency for diminishing returns
  • docs/internal/ + docs/legacy/ link cleanup — 39 inherited
    broken links there are skipped by default; cleanup is its own
    PR. Run make docs-linkcheck with -include-internal (via
    the binary directly) to see them.

Plan tracker

Closes Track 9.8 + 9.12 from the parity plan. Track 9 remaining:
9.1-9.6 + 9.7 (truth-verify) + 9.10 (memory bench). All
explicitly post-0.2.0-blocking but safe to land in either window.

🤖 Generated with Claude Code

Two release-readiness deliverables that lift the contract Terrain
makes with adopters: links in user-facing docs go where they say
they go, and JSON fields carry an explicit stability promise.

Track 9.8 — Make docs-linkcheck
  New `cmd/terrain-docs-linkcheck/main.go` walks docs/ and verifies
  that every `[label](relative.md)` link resolves to a real file.
  Skips external (http/https/mailto), same-page anchors (#foo),
  and — by default — the docs/internal/ + docs/legacy/ subtrees
  whose link discipline is inherited debt (run with
  `-include-internal` to scan them anyway).

  Resolves directory links to <dir>/README.md when present;
  reports "directory link with no README.md" otherwise.

  Wired into the Makefile as `make docs-linkcheck`. Same posture
  as `make docs-verify` — fails with `::error::N broken links`
  + per-link source:line:target output suitable for CI annotation.

  Initial run on the public docs surface caught 3 real broken
  links (README.md → legacy/, quickstart.md → examples/,
  release-notes.md → ../architecture/) — all fixed in this PR by
  pointing at concrete files. The remaining 39 links inside
  docs/internal/planning/ are pre-0.2 inherited debt, deliberately
  skipped pending a separate cleanup PR.

Track 9.12 — Schema field stability tiers
  New `docs/schema/FIELD_TIERS.md` documents the three-tier
  contract Terrain commits to per JSON field:

    Stable  — name + type + semantics won't change without a
              major schema bump; safe for long-lived tooling
    Beta    — name + type stable for the next minor; semantics
              may evolve as calibration corpora arrive
    Internal — diagnostic / debug fields; treat as scratch space

  Spells out concrete examples per tier (snapshotMeta.schemaVersion
  is stable; signals[].confidence is beta; metadata.diagnostics.*
  is internal); names the precedence order for telling a field's
  tier (name pattern → x-terrain-tier annotation → this page);
  defines the promotion path internal → beta → stable.

  Adopter guidance section: pin the schemaVersion, defensively
  read beta fields with fallbacks, never branch on internal.

  `docs/schema/README.md` linked from the new page so adopters
  reach the contract via the canonical schema entry point.

Verification: `make docs-linkcheck` passes; `make docs-verify`
clean; `go build ./cmd/terrain-docs-linkcheck/` clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

[INFO] Terrain — Informational only

Insufficient data to assess change risk confidently.

Metric Value
Changed files 7 (1 source · 0 test)
Impacted units 1
Protection gaps 1
Tests selected 1 of 772 (0% of suite)

Coverage gaps in changed code

  • cmd/terrain-docs-linkcheck/main.go [LOW] — main.go has no observed test coverage.
    → Add unit tests for main.go.

Recommended tests

1 test(s) selected via structural heuristics. 1 unit(s) remain uncovered. 1 impacted unit(s) have no covering tests in the selected set.

Test Confidence Why
docs/examples/e2e/login.spec.js inferred inferred structural relationship

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 1 test(s) instead of the full suite.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Terrain AI Risk Review

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

Decision: PASS — AI surfaces are covered.

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