Skip to content

feat(release): add guarded Action tag recovery - #175

Merged
mbeacom merged 7 commits into
mainfrom
mbeacom-action-tag-recovery
Aug 27, 2026
Merged

feat(release): add guarded Action tag recovery#175
mbeacom merged 7 commits into
mainfrom
mbeacom-action-tag-recovery

Conversation

@mbeacom

@mbeacom mbeacom commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a least-privilege workflow_dispatch recovery path that runs only from main, accepts only an existing successful stable lockstep release, peels the annotated version tag to its commit, and verifies both committed Action bundles
  • serialize recovery with normal release promotion and replace unconditional force pushes with a lease against the observed remote tag object
  • preserve monotonic forward releases while requiring explicit --recover for backward movement; record forward and recovery movement in workflow summaries
  • document containment, already-edited comment restoration, consumer reruns, immutable pins, the manual fallback, and the separate npm recovery model

Recovery semantics

Moving v0 stops new jobs from resolving a bad release. It does not change jobs that already resolved the old SHA and does not restore comments already edited by completed runs; those require GitHub edit history or a known-good rerun. The guarded workflow uses only actions: read and contents: write, validates the exact successful release-run SHA, and fails rather than overwriting a concurrent tag move.

Validation

  • bun run typecheck
  • bun run lint
  • bun test (2,649 passed, 1 skipped)
  • actionlint .github/workflows/action-tag-recovery.yml .github/workflows/release.yml
  • live read-only guard probe: v0.10.0 accepted; v0.8.0 rejected because its exact Release run did not succeed
  • live no-op probe confirmed remote v0 remains at v0.11.0

Closes #136
Closes #122

Related: #104 was separately verified fixed in v0.11.0 and closed.

Add a least-privilege manual recovery workflow, lease-protected tag movement, annotated-release guards, operational documentation, and targeted contracts for the moving major Action tag.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Mark Beacom <m@beacom.dev>
Copilot AI balanced review requested due to automatic review settings August 26, 2026 21:33
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

Decisions governing this change

  • 0007 — Isolate integrations as optional adapters and build only against public surfaces
    • via path: .github/workflows/**
  • 0010 — Use Bun as the package manager and test runner while publishing Node-targeted artifacts
    • via path: .github/workflows/**
  • 0031 — Publish a narrow consumer SDK as the contract, and document the CLI JSON as its sibling
    • via path: docs/RELEASING.md
  • 0032 — Publish one lockstep OCI image after the coordinated release succeeds
    • via path: docs/RELEASING.md
  • 0035 — Execute the gates that certify a pull request from the default branch
    • via path: .github/workflows/**
    • via path: scripts/**

Copilot AI 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.

🟡 Changes recommended

The manual fallback omits bundle guards, and lease race behavior lacks a regression test.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds guarded recovery for the moving major Action tag.

Changes:

  • Adds lease-protected forward and recovery tag movement.
  • Adds a least-privilege recovery workflow and tests.
  • Documents recovery and containment procedures.
File summaries
File Description
.github/workflows/action-tag-recovery.yml Adds guarded recovery workflow.
.github/workflows/release.yml Records tag promotion summaries.
scripts/update-action-tag.ts Adds recovery and lease protection.
scripts/update-action-tag.test.ts Tests backward recovery.
scripts/action-tag-recovery-contract.test.ts Verifies workflow contracts.
docs/RELEASING.md Adds recovery runbook.
docs/DISTRIBUTION.md Documents distribution recovery.
AGENTS.md Records recovery constraints.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/update-action-tag.ts Outdated
[
'git',
'push',
`--force-with-lease=refs/tags/${majorTag}:${remoteRefSha ?? ''}`,
Comment thread docs/RELEASING.md
Comment on lines +455 to +457
test "$(git cat-file -t "refs/tags/$target")" = tag
target_commit=$(git rev-parse "$target^{commit}")
git merge-base --is-ancestor "$target_commit" origin/main
mbeacom and others added 6 commits August 26, 2026 18:11
Add a durable withdrawal marker, preserve the observed remote lease during recovery, and reject withdrawn reruns before publication. Bring manual recovery checks and negative coverage in line with the guarded workflow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Mark Beacom <m@beacom.dev>
Fail closed on withdrawal-marker lookup errors and bind successful Release runs to the requested lockstep tag. Extend the manual fallback and collision regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com
Signed-off-by: Mark Beacom <m@beacom.dev>
Make marker creation safe under signed-tag defaults and preserve explicit empty remote leases for absent v0 creation. Add executable regressions for CAS races and recovery validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Mark Beacom <m@beacom.dev>
Ensure the manual fallback enables fail-fast mode before marker creation and test the extracted fallback block instead of matching the preferred workflow example.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com
Signed-off-by: Mark Beacom <m@beacom.dev>
Anchor manual recovery coverage to the complete marker creation and push sequence, rejecting missing, masked, or post-recovery pushes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Mark Beacom <m@beacom.dev>
@mbeacom mbeacom added the gate-change-acknowledged A maintainer has seen and accepted this PR's change to the CI gate surface (ADR-0035) label Aug 27, 2026
@mbeacom mbeacom self-assigned this Aug 27, 2026
@mbeacom
mbeacom merged commit b769a09 into main Aug 27, 2026
14 of 15 checks passed
@mbeacom
mbeacom deleted the mbeacom-action-tag-recovery branch August 27, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate-change-acknowledged A maintainer has seen and accepted this PR's change to the CI gate surface (ADR-0035)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The moving v0 Action tag has no documented rollback path docs(releasing): no rollback procedure for the moving v0 Action tag

2 participants