← Back to Pull requests

test(promote): fail if releases stop waiting for the image build #761

Closed
unknown closed this pull request without merging on Nov 22, 2026 02:04 UTC
View on GitHub
unknown unknown commented on Nov 21, 2026 17:25 UTC
Author

Summary: Yesterday's fix made finpilot wait for its image build to finish before it starts preparing a release, instead of starting at the same moment and sometimes checking an old image (#753, fixed by #754). That wait works by naming the build job exactly, so renaming the build job later would quietly switch release preparation off, with no error anywhere. This adds tests that fail if that link breaks, if the old "start immediately" behaviour comes back, or if a failed build could still start a release.

---

Test Improvement

Two new cases in tests/contract/promote-main-to-stable_test.bats, which just test-unit and unit-tests.yml already run:

  • fires after the image build, not on the push itself: reads the name: of build-image.yml and requires promote-main-to-stable.yml to list exactly that name under workflow_run.workflows, with types: [completed] and branches: [main]. It also requires that there is no push: trigger and that schedule and workflow_dispatch are still present. GitHub gives no error when a workflow_run names a workflow that does not exist; it just never fires.

  • a failed or cancelled build never starts a promotion: requires the promote job's if to pass non-workflow_run events and to require workflow_run.conclusion == 'success'. Then it checks each job whose needs begins with promote separately and requires that its if includes needs.promote.result == 'success'.
  • Why: #754 changed only the workflow and added no test, and both of these failure modes are silent. Promotion either stops happening or opens a PR for a red build, and neither one leaves a failed run behind.

    Evidence


  • bats tests/contract/promote-main-to-stable_test.bats: 10/10 pass at main d92f01c. Full just test-unit: 0 failures.

  • Mutation-checked, each one reverted afterwards:

  • - renamed build-image.yml to name: Build Image: case 1 fails
    - put the push: trigger back: case 1 fails
    - types: [requested]: case 1 fails
    - removed the conclusion check from promote.if: case 2 fails
    - repair-promotion-branch if: always(): case 2 fails
    - removed the promote gate from locate-promotion-pr: case 2 fails
  • Only test files change. No workflow or production code is touched.
  • Refs #753 (already closed by #754; this PR only adds the regression guard, so nothing is left to track)

    ---
    Filed by quality agent (ACMM L4/L6 - full mode)

    -- hive: agent=quality backend=claude model=claude-opus-5-5 claude=2.1.327

    Diff: 313 lines (+234 / -79) across 3 files Reviewer: Danathar Review duration: 519m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 313 lines diff across 3 files
    0.40
    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.344
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #761"
    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: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    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: 15.9% · Safe to merge
    15.9%