Skip to content

fix(release): defer prerelease tag until publication - #70

Merged
slashdevcorpse merged 4 commits into
mainfrom
automation/publish-weekly-releases
Jul 22, 2026
Merged

fix(release): defer prerelease tag until publication#70
slashdevcorpse merged 4 commits into
mainfrom
automation/publish-weekly-releases

Conversation

@slashdevcorpse

@slashdevcorpse slashdevcorpse commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep Windows and macOS prerelease builds bound to the exact protected-main source without requiring the immutable tag before publication
  • enforce the tagless pre-publication provenance contract independently in preflight and both native build lanes
  • preserve the post-publication requirement for the exact immutable tag

Why

Release run 29876040712 failed safely before packaging because the Windows lane required super-v0.5.5-super.9 even though the workflow intentionally creates that tag only during the final atomic draft publication.

Verification

  • bun run --cwd scripts test lib/super-synara-workflow-contract.test.ts lib/super-synara-release-state.test.ts
  • node scripts/verify-workflow-contracts.ts
  • git diff --check

Summary by cubic

Defer the prerelease tag until atomic draft publication so preflight, Windows, and macOS builds validate against the exact protected-main commit without the immutable tag. Post-publication builds still require the exact immutable tag.

  • Bug Fixes
    • Rename native lane step to “Revalidate protected-main source provenance” and pass github-unsigned-prerelease false in preflight, windows_x64, and macos_arm64.
    • Allow an exact owned draft before publication with or without a preexisting tag in release-state tests.
    • Enforce the exact tagless provenance command, step names, and bound VERSION/TAG/SOURCE_COMMIT env vars before publication; pin the shell to bash; reject conditional or error-ignored runs; normalize continued shell commands.

Written for commit 33c6beb. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Updated prerelease provenance re-verification in Windows x64 and macOS arm64 to validate protected-main source provenance.
    • Adjusted workflow step naming to reflect the new provenance revalidation behavior.
  • Quality Improvements
    • Broadened release-state checks for “before publish” to support both default and explicitly specified tag details.
    • Strengthened workflow contract validation to keep source/provenance steps tagless until atomic draft publication and to fail closed on misconfiguration.
  • Tests
    • Updated and expanded release-state and workflow contract tests to match the new validation rules.

Greptile Summary

This PR fixes a real release failure (run 29876040712) by deferring the prerelease tag requirement from the build phase until atomic draft publication. Windows and macOS builds now validate against the protected-main source commit without needing the immutable tag pre-created; the tag is only required after publication.

  • Workflow change (super-synara-prerelease.yml): renames both native-lane steps to "Revalidate protected-main source provenance" and flips github-unsigned-prerelease from truefalse, matching the new tagless contract.
  • Contract validator (super-synara-workflow-contract.ts): adds verifyPrereleaseSourceProvenanceSteps which enforces the exact step name, shell: bash, env bindings, normalized run command (handling line continuations), no if condition, and no continue-on-error for all three pre-publication lanes.
  • Tests: new test "keeps every source check tagless until atomic draft publication" exhaustively mutates each lane's command and env bindings; release-state test now explicitly covers the before-publish phase without a preexisting tag.

Confidence Score: 5/5

Safe to merge — the change corrects the pre-publication provenance step in both native lanes and backs it with exhaustive contract checks and mutation tests.

The workflow fix is a one-line flag flip in each lane, directly reproducing the documented failure mode. The new contract validator is precise — it checks step name, shell, every env binding, the normalized command, conditional flags, and continue-on-error — leaving no known bypass surface. The mutation test suite covers all three lanes and every env key individually. Post-publication tag enforcement is unchanged.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/super-synara-prerelease.yml Renames both native-lane provenance steps and flips github-unsigned-prerelease to false; directly addresses the root cause of the failed release run.
scripts/lib/super-synara-workflow-contract.ts Adds verifyPrereleaseSourceProvenanceSteps with strict env, command, shell, and conditional checks for all three pre-publication lanes; normalizeContinuedShellCommand correctly handles line-continuation backslashes before whitespace normalization.
scripts/lib/super-synara-workflow-contract.test.ts New test exhaustively mutates command and all env bindings for each lane; updated step-name string matches the renamed workflow step.
scripts/lib/super-synara-release-state.test.ts Adds coverage for before-publish phase without a preexisting tag, confirming the state validator correctly permits a tagless draft at that phase.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant RD as release-drafter
    participant DA as draft_admission
    participant PF as preflight
    participant WIN as windows_x64
    participant MAC as macos_arm64
    participant PUB as publish

    RD->>DA: dispatch (version, tag, source_sha, draft_id)
    DA->>DA: authenticate owner + validate draft
    DA->>PF: trigger (needs: draft_admission)
    PF->>PF: Validate source provenance (github-unsigned-prerelease false)
    PF-->>WIN: outputs (version, tag, source_commit)
    PF-->>MAC: outputs (version, tag, source_commit)
    WIN->>WIN: Revalidate protected-main source provenance (github-unsigned-prerelease false)
    WIN->>WIN: build + qualify installer
    MAC->>MAC: Revalidate protected-main source provenance (github-unsigned-prerelease false)
    MAC->>MAC: build + sign
    WIN-->>PUB: artifacts
    MAC-->>PUB: artifacts
    PUB->>PUB: adopt owned draft
    PUB->>PUB: gh api PATCH - atomic publish (creates immutable tag HERE)
    PUB->>PUB: verify after-publish state (requires immutable tag)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant RD as release-drafter
    participant DA as draft_admission
    participant PF as preflight
    participant WIN as windows_x64
    participant MAC as macos_arm64
    participant PUB as publish

    RD->>DA: dispatch (version, tag, source_sha, draft_id)
    DA->>DA: authenticate owner + validate draft
    DA->>PF: trigger (needs: draft_admission)
    PF->>PF: Validate source provenance (github-unsigned-prerelease false)
    PF-->>WIN: outputs (version, tag, source_commit)
    PF-->>MAC: outputs (version, tag, source_commit)
    WIN->>WIN: Revalidate protected-main source provenance (github-unsigned-prerelease false)
    WIN->>WIN: build + qualify installer
    MAC->>MAC: Revalidate protected-main source provenance (github-unsigned-prerelease false)
    MAC->>MAC: build + sign
    WIN-->>PUB: artifacts
    MAC-->>PUB: artifacts
    PUB->>PUB: adopt owned draft
    PUB->>PUB: gh api PATCH - atomic publish (creates immutable tag HERE)
    PUB->>PUB: verify after-publish state (requires immutable tag)
Loading

Reviews (3): Last reviewed commit: "fix(release): bind provenance gate envir..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The prerelease workflow now revalidates protected-main source provenance on Windows x64 and macOS arm64. Contract validation enforces exact fail-closed commands, while tests cover tagless pre-publication checks and broader before-publish state acceptance.

Changes

Prerelease provenance validation

Layer / File(s) Summary
Protected-main provenance contract
scripts/lib/super-synara-workflow-contract.ts
Normalizes continued shell commands and requires exact, unconditional provenance checks in the preflight, Windows x64, and macOS arm64 jobs.
Prerelease workflow commands
.github/workflows/super-synara-prerelease.yml
Updates Windows x64 and macOS arm64 revalidation steps to use protected-main provenance mode.
Workflow and release-state tests
scripts/lib/super-synara-workflow-contract.test.ts, scripts/lib/super-synara-release-state.test.ts
Tests tagless source checks before atomic publication, updated provenance step naming, and before-publish states without tag fields.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: deferring the prerelease tag until publication.
Description check ✅ Passed The description covers what changed, why, and verification, and is mostly complete despite not using the template headings exactly.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the ready-to-merge Approved for Mergify auto-merge after required checks pass label Jul 21, 2026
@slashdevcorpse
slashdevcorpse force-pushed the automation/publish-weekly-releases branch from 55d9c14 to 952d3f2 Compare July 21, 2026 23:37
@coderabbitai coderabbitai Bot removed the ready-to-merge Approved for Mergify auto-merge after required checks pass label Jul 21, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/lib/super-synara-workflow-contract.ts
Comment thread scripts/lib/super-synara-workflow-contract.ts
Comment thread scripts/lib/super-synara-workflow-contract.ts
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
scripts/lib/super-synara-workflow-contract.ts 92.30% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@slashdevcorpse
slashdevcorpse merged commit dcee283 into main Jul 22, 2026
17 checks passed
@slashdevcorpse
slashdevcorpse deleted the automation/publish-weekly-releases branch July 22, 2026 01:10
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