Skip to content

feat(0.2): truth-verify gate — feature-status doc ⊆ signal manifest (Track 9.7)#156

Open
pmclSF wants to merge 1 commit intomainfrom
feat/0.2-track9-truth-verify
Open

feat(0.2): truth-verify gate — feature-status doc ⊆ signal manifest (Track 9.7)#156
pmclSF wants to merge 1 commit intomainfrom
feat/0.2-track9-truth-verify

Conversation

@pmclSF
Copy link
Copy Markdown
Owner

@pmclSF pmclSF commented May 3, 2026

Summary

Adds make truth-verify — the Track 9.7 release-readiness gate
that cross-checks docs/release/feature-status.md against the
canonical signal manifest. Drift between the curated doc and the
shipping engine is the failure mode adopters notice when they
evaluate the binary against the marketing claim.

  • New cmd/terrain-truth-verify/main.go walks the doc, extracts
    every backtick-delimited camelCase signal reference between the
    detector-section and Planned-section anchors, verifies each
    resolves to a real manifest entry
  • New make truth-verify Makefile target
  • Caught + fixed 1 real broken reference (duplicateCluster was
    listed as a stable signal but isn't a Signal type — surfaces
    via DuplicateClusters in the analyze report instead)

What changed

New code:

  • cmd/terrain-truth-verify/main.go — verifier (~180 lines, depends
    only on internal/signals + internal/models)
  • cmd/terrain-truth-verify/main_test.go — 5 unit tests

New Makefile target: truth-verify

Fixed doc drift: docs/release/feature-status.md
duplicateCluster row reframed to clarify it's surfaced via
DuplicateClusters not via the signal mechanism

Drift posture

  • Hard failure (exit 1): signal name in doc with no manifest
    entry. Real broken promise.
  • Advisory warning (exit 0): stable manifest signal not
    surfaced in the curated doc. Acceptable today since the doc is
    explicitly a "curated view" with the manifest as the source of
    truth. Pass --strict-orphans to escalate.

Out of scope (documented in the package comment)

  • README command list ⊆ dispatcher: needs Track 9.6 registry
    refactor first
  • CHANGELOG promotion-claim cross-check: per-signal status is
    already manifest-driven, so make docs-verify catches it
  • CI matrix ⊆ compatibility tier doc: distinct failure mode in
    workflow YAML rather than markdown

Test plan

  • go build ./... clean
  • go test ./cmd/terrain-truth-verify/... — 5 new tests
    (happy path, no-anchor, planned-subsection exclusion,
    all-lowercase-token rejection regression guard, engine-
    diagnostic classifier)
  • make truth-verify exits 0 on current docs
  • make docs-verify clean

Plan tracker

Closes Track 9.7. Track 9 remaining: 9.2 (panic recovery
completion), 9.5 (pipeline architectural separation), 9.6
(registry refactor). All explicitly post-0.2.0-blocking.

🤖 Generated with Claude Code

…Track 9.7)

Adds the Track 9.7 release-readiness gate: cross-checks
docs/release/feature-status.md against the canonical signal
manifest. Drift between what the curated doc promises and what the
engine actually ships is the failure mode adopters notice when they
evaluate the binary against the marketing claim.

The gate

- New `cmd/terrain-truth-verify/main.go` walks
  docs/release/feature-status.md, extracts every backtick-delimited
  camelCase signal reference between the "Detectors / signal
  types" anchor and the "Planned" subsection, and verifies each
  resolves to a real entry in internal/signals/manifest.go.
- Camel-case constraint (lowercase start + at least one mid-word
  uppercase) excludes CLI verbs (`report`, `eval`, `policy`) and
  English filler words from false-positive matches.
- Planned subsection excluded by design — references there name
  signals that *don't* yet have a code-side implementation;
  flagging them would invert the signal.
- Engine self-diagnostic signals (detectorPanic,
  detectorBudgetExceeded, detectorMissingInput, suppressionExpired)
  excluded from the orphan check — they're documented inline
  alongside the mechanisms that emit them, not in the curated
  signal table.

Wired into Makefile as `make truth-verify`. Same posture as
`make docs-verify` and `make pillar-parity` — fails with
`::error::N broken signal reference(s)` + per-signal output
suitable for CI annotation.

What it caught

Initial run on the current docs surfaced one real broken
reference: `duplicateCluster` was listed as a "stable signal" in
the table but isn't a `Signal` type at all — duplicate-cluster
analysis surfaces via `DuplicateClusters` in the analyze report
rather than through the signal mechanism. Doc updated to clarify
the distinction.

Plus 15 advisory orphans (stable signals in the manifest that the
curated doc doesn't mention by name). The doc explicitly says it's
a "curated view" with the manifest as the source of truth, so
these are acceptable today; --strict-orphans escalates them to
hard failures for adopters who want full coverage.

Out of scope today (per the package comment)

  - README command list ⊆ dispatcher: needs Track 9.6 registry
    refactor first
  - CHANGELOG promotion-claim cross-check: per-signal status is
    already manifest-driven, so docs-verify catches it
  - CI matrix ⊆ compatibility tier doc: distinct failure mode in
    workflow YAML rather than markdown

Coverage

5 new unit tests in main_test.go: happy-path extraction, no-anchor
returns empty, planned subsection excluded, all-lowercase tokens
rejected (regression guard against the false-positive class that
caught report / eval / policy on the first run), engine-diagnostic
classifier.

Verification: full Go test suite green; make truth-verify exits 0
on the current docs surface; make docs-verify 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 4 (1 source · 1 test)
Impacted units 1
Protection gaps 1
Tests selected 1 of 773 (0% of suite)

Coverage gaps in changed code

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

Recommended tests

1 test(s) with exact coverage of 0 impacted unit(s). 1 impacted unit(s) have no covering tests in the selected set.

Test Confidence Why
cmd/terrain-truth-verify/main_test.go exact test file directly changed

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.

  • Go tests: passed

@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