feat: v3 improvements — analysis, detection, CLI, release, and reproducibility#100
Merged
feat: v3 improvements — analysis, detection, CLI, release, and reproducibility#100
Conversation
[RISK] Terrain — Merge with cautionHigh-severity gaps found in changed code.
New Risks (directly changed)
Pre-existing issues on changed files (5)
Recommended Tests139 test(s) with exact coverage of 200 impacted unit(s). 210 impacted unit(s) have no covering tests in the selected set.
Owners: pmclachlansf Terrain — Targeted Test ResultsTerrain selected 139 test(s) instead of the full suite.
|
…cture Analysis layer: - Tiered inference architecture with structural > semantic > pattern > content - AST-enhanced prompt detection with multi-framework patterns (Vercel AI SDK, DSPy, Mirascope, Marvin, Instructor) - Structured RAG pipeline parser with 9-component detection and config extraction - Content-based AI context inference beyond naming conventions - Tool schema and output contract detection - Bracket-aware structural parser for prompt/context detection - Source-to-source import graph with real dependency edges - Capability inference from surfaces (9 canonical AI capabilities) Models: - DetectionEvidence schema with tier, confidence, and basis metadata - 44 DetectorID constants and tier utilities - 9 canonical AICapability constants - RAGPipelineSurface model with 9 component kinds - Expanded AI surface taxonomy (4 new surface kinds + Context kind) - 14 AI-native signal types with scenario-aware classification Dependency graph: - AI graph nodes and capability layer - Deterministic map iteration in graph construction Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signals & governance: - 6 RAG failure mode signals with classifier support - AI CI policy with blocking, warning, and coverage rules - AI-specific protection gaps for uncovered AI surfaces Impact & changescope: - Surface-kind-aware AI scenario impact with descriptive reasons - First-class AI validation section in PR summaries - 3-way finding classification and triage-oriented PR comments - Finding deduplication in insights, impact, and changescope CLI & explain: - Rich AI scenario explain with surface breakdown and signals - AI inventory view with capabilities and gap analysis - Complete terrain ai run as CI entry point for AI validation - Replay and determinism support for AI validation artifacts Fixtures: - 3 AI benchmark fixtures with ground truth (ai-mixed-traditional, ai-prompt-only, ai-rag-pipeline) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI refactor: - Split main.go (3400+ lines) into 9 focused command files - Structured logging via log/slog with --log-level quiet|debug - Pipeline diagnostics migrated from fmt.Fprintf(os.Stderr) to slog Analysis infrastructure: - FileCache: thread-safe content + Go AST cache with PrewarmSourceFiles - Context cancellation throughout analysis layer (AnalyzeContext, walkDirCtx) - Fixture detection across JS/Python/Go/Java with depgraph integration - Environment matrix parsing (GitHub Actions, GitLab CI, CircleCI, Buildkite) - Symbol-level coverage via Go AST, JS imports, Python from-imports - Consolidated 4 pairs of duplicated export extractors Engine safety: - DefaultRegistry returns (*Registry, error) instead of panicking - MustRegister deprecated in detector and measurement registries - Artifact auto-discovery across 29 known paths - Guided init workflow with config generation - Key Findings in analyze output replacing single TopInsight - Confidence calibration via CalibrateFromFixtures Quality: - Static skip detection for test files - Plugin architecture with 4 extension points - Schema versioning for all artifact types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Release pipeline: - SBOM generation via GoReleaser + syft (CycloneDX + SPDX per archive) - Sigstore cosign signing hooks for keyless checksum signing - Makefile targets: make sbom, make release-dry-run - Supply-chain documentation with verification instructions CLI naming deconfliction: - Go binary: terrain (primary) - npm binary: terrain-convert (primary), terrain (compat shim with warning) Docs: - Product excellence scorecard and gap audit - Story-to-implementation traceability matrix - Feature and persona matrices Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Production dependencies pinned to exact versions (5 packages): - chalk 5.6.2, commander 14.0.3, fast-glob 3.3.3, pixelmatch 7.1.0, pngjs 7.0.0 - Dev dependencies retain caret ranges (Dependabot manages weekly) Reproducibility enforcement: - .npmrc: save-exact=true for future additions - CI: lockfile sync verification step after npm ci - Dependabot: versioning-strategy "increase" with grouped PRs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
554547b to
8061ede
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive v3 feature branch delivering analysis depth, engine robustness, CLI polish, and enterprise-ready release infrastructure.
Analysis Layer
Detection Model & Engine
CLI
--log-level quiet|debugterrain, npm binary:terrain-convertRelease Pipeline
npm Reproducibility
.npmrcwithsave-exact=truefor future additionsincreasewith grouped PRsTest plan
go test ./internal/... ./cmd/...)goreleaser check)npm ciworks cleanly with updated lockfile🤖 Generated with Claude Code