← Back to Pull requests

CNTRLPLANE-4798: Add Go validation for test plans and reports #10

Closed
unknown closed this pull request without merging on Nov 16, 2026 14:02 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 14:16 UTC
Author

Summary

A plan can have every required heading while omitting preconditions, steps, or expected results. Reports can point to missing evidence or claim totals that disagree with their results. This PR adds verify-artifacts so contributors and CI can check these requirements with the same implementation.

make lint
├── lint-go          Go code and formatting
└── lint-artifacts   Plan/report checks and pinned Gitleaks scan

New and materially rewritten plans require the IEEE 829 content profile. The validator checks each case's objective, preconditions, execution instructions, and expected results. It also checks acceptance mappings, unique case IDs, identifier and environment details, references, risk mitigations, and approval records. Active plans need a named reviewer and approval date. Placeholder-only sections fail.

Reports may be standalone Markdown or HTML bundles. Within an HTML bundle, the HTML remains authoritative and any derived Markdown summary is optional. Reports with failed or conditional results can pass artifact validation.

Scope and historical content

Artifact validation scans the whole checkout, including unchanged files and cross-file references. Go tests and lint cover cmd/ and internal/. Report scripts and embedded JavaScript remain data.

Historical format gaps require explicit, reviewed exceptions. Two published plans omit nine precondition declarations. A third plan merged before enforcement uses narrative layouts that produce 33 specific format findings. Their text remains unchanged. Each content exception names the exact diagnostic rule, body line, and message it may waive. Additional findings still fail. Metadata waivers also pin the full file. Exceptions cannot waive security, broken references, undefined mapped cases, or active-plan approval.

Review order

1. Plan and report contracts and tests.
2. References, sanitization, and exceptions.
3. CLI diagnostics and secret scanning.
4. Local test, lint, and build commands.
5. GitHub Actions validation.
6. ARC runner configuration and operating procedure.
7. Contributor documentation.
8. Required IEEE plan content checks and regressions.
9. Content-check documentation and migration notes.

Validation and rollout

  • make test lint build and go vet pass locally.

  • The original TBD-only plan now fails. Offline validator and CLI tests cover required content, supported layouts, reference errors, approval states, and diagnostic locations.

  • Offline regressions cover plan layouts, placeholder instructions, references, diagnostic locations, and CLI errors.

  • Exception tests apply reviewed waivers and require unrelated errors to remain.

  • The existing report bundles pass unchanged. The three proposed legacy exceptions require review with this PR.
  • Reviewers assess technical correctness, evidence authenticity, and sensitive information the scanner misses. The workflow uses the repository-scoped ARM64 pool and does not apply runner manifests. After a successful post-merge main run, an administrator must enable the required check while preserving existing protections and fork-workflow approvals.

    CNTRLPLANE-4798

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added a command-line validator for test plans and reports, checking required content, metadata, relationships, links, and report totals.
    Added secret scanning and safeguards to keep sensitive values out of validation output.
    Added automated test, lint, and build checks, with configuration for shared ARM64 runners.
    Added reviewed exceptions for specified gaps in historical artifacts, tied to the reviewed content.

    Documentation
    Updated plan and report requirements, local validation instructions, and guidance for preserving incomplete historical content.
    Added runner setup and deployment guidance.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 511 lines (+383 / -128) across 6 files Reviewer: mgencur Review duration: 38866m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 511 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.373
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.6% (MEDIUM) · Higher = larger blast radius
    47.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.8% · Safe to merge
    18.8%