Guides

AppTheory Release Process

AppTheory has one release train. The valid cycle is:

  1. Merge feature and fix PRs into staging.
  2. Promote staging to premain to create the next release candidate.
  3. Promote premain to main to create the stable release.
  4. Back-merge main into staging before any later staging work or promotion.

No branch may skip a leg of that cycle. premain only receives staging, main only receives premain, and the only release-branch PR into staging is the main back-merge after a stable release. Ordinary PRs targeting staging must contain the current main baseline before they are opened or merged.

Branch responsibilities

Branch Role Allowed incoming changes
staging Integration branch for all normal work. Feature/fix PRs that contain current main; main back-merges after stable releases.
premain Prerelease branch. Human staging promotion PRs and generated release-please--branches--premain RC PRs only.
main Stable release branch. Human premain promotion PRs and generated release-please--branches--main stable PRs only.

Release automation is driven by Conventional Commits. feat: and fix: entries ship; docs:, test:, chore:, and refactor: do not trigger a release by themselves. Generated release automation is never chore:-typed: both lane configs set pull-request-title-pattern to fix${scope}: release${component} ${version}, release-please uses that rendered title as the release-branch commit subject, and the artifact sync commit is fix(release): sync generated release artifacts. The release predicates do not classify generated commit subjects. Promotion eligibility compares commit subjects with release-please’s own conventional-commit rule over exactly the range the caller supplies: it does not consult local tag names, so a tagged commit inside an explicitly supplied promotion range is not silently removed by that verifier. The release-PR and publish no-op predicates measure from the recorded manifest tag or the immutable published tag. A human fix whose subject resembles a generated one is never exempted. A Release-As: footer on a prohibited subject is not an eligibility bypass. Version state must remain aligned across VERSION, TypeScript and CDK package manifests and lockfiles, Python metadata, and the active Release Please manifest for the release lane. Stable releases align both Release Please manifests to the stable version; prerelease branches keep .release-please-manifest.json on the last stable version while .release-please-manifest.premain.json tracks the RC version.

Upgrade policy is maintained separately from the generated changelog. When a minor line changes runtime behavior, deployment defaults, dependency floors, generated-artifact expectations, or deprecation posture, update UPGRADING.md in the same change or release-prep PR. The changelog lists commits; UPGRADING.md lists consumer action and per-line compatibility notes.

Release line versioning

A release line declares its own version; a candidate is never remembered. .github/release-lane.json holds the declaration both generation lanes read:

"releaseLines": {
  "premain": {
    "config": "release-please-config.premain.json",
    "manifest": ".release-please-manifest.premain.json",
    "maxBump": "minor"
  },
  "main": {
    "config": "release-please-config.json",
    "manifest": ".release-please-manifest.json",
    "maxBump": "minor"
  }
}

scripts/compute-release-line-version.sh turns that declaration plus local history into the version the lane cuts, and both generated release PR producers hand it to pinned release-please@17.11.2 as --release-as. The generated pull request, its notes and every version file are still rendered by release-please; only the version number is declared instead of recomputed.

The computed bump is release-please’s own bump, capped at the declared maxBump:

Commits since the recorded release release-please bump premain candidate with maxBump: minor
a ! marker or BREAKING CHANGE: footer major next minor (7.7.0 → 7.8.0-rc)
feat: minor next minor (7.7.0 → 7.8.0-rc)
anything else conventional patch next patch (7.7.0 → 7.7.1-rc)

A ! marker stays breaking intent: the generated release notes still record it, and the fixture-level regression still proves a contract change. It just never moves the major by itself, because the operator judges “breaking” against real consumers and this repository’s markers are permanent history — 7.5.0-rc.1, 7.6.0 and 7.7.0 each needed a hand-added Release-As: footer, and the candidate that did not carry one was generated as 8.0.0-rc (#1364) and re-broke the CDK artifact sync. No Release-As: footer is required any more, and none should be added to a release branch to steer a version.

The declaration is not a release-please-config*.json key because pinned 17.11.2 has no key that demotes a breaking marker above 1.0: its config schema is additionalProperties: false; bump-minor-pre-major and bump-patch-for-minor-pre-major apply only below 1.0.0; always-bump-minor ignores commits and preserves the existing prerelease, so a second RC in one cycle would re-bump the line instead of advancing the counter; and a repository-owned versioning name throws in build/src/factories/versioning-strategy-factory.js, which the publish workflows load too because they run googleapis/release-please-action over the same config file. The explicit version is the override that pinned release-please does support, and the stable lane already used it to promote the RC baseline.

Cycle rule: once the prerelease line has cut X.Y.Z-rc[.N], the line is declared for that cycle, so a further candidate only advances the counter (7.8.0-rc → 7.8.0-rc.1). The stable lane first promotes the prerelease RC baseline when premain leads main, and only then applies the capped bump. Neither lane reads VERSION or a manifest to decide a version; both are written by the generated release PR.

Cutting a deliberate major

A major is a declared decision, and the declaration is the only way to leave the line:

  1. Change releaseLines.premain.maxBump and releaseLines.main.maxBump to major in .github/release-lane.json on staging, in a feat(-typed commit so the change itself is release-visible, and state the reason, the consumer-visible break and the migration path in UPGRADING.md in the same change.
  2. Cut the major on the next promotion. While maxBump is major, a ! marker computes the major exactly as pinned release-please would, which is the declared behavior for that cycle.
  3. Restore maxBump to minor after the major ships, so the line goes back to never computing a major from a marker. Leaving major declared is the same standing accidental-major path this declaration removes.

A Go module major also moves the module’s semantic import version and the CDK/jsii major surface, so bundle those in the same major cycle. scripts/verify-release-workflows.sh verifies the declaration exists with a supported maxBump for both lanes, that both lanes pass the computed version to release-please, and runs scripts/test-release-line-version.sh, the offline regression over a recorded history containing released ! commits, on every staging pull request.

Release Please never regenerates a past release section, so a published release note is frozen at the shape it had when its tag was cut and a hand edit to it would be dropped or duplicated on the next generated release. Corrections to already-published release notes are therefore recorded in release-notes-corrections.md, which names the incomplete note, the omitted or wrong entry with its commit and pull request, and the consumer action. The correcting change lands as a release-visible fix: or feat: commit so the next generated release section carries the correction; a docs:-typed commit alone is not rendered. Published tags and release assets are immutable, so an edit to a published GitHub Release body is an operator action, recorded as such on that page.

The full rubric runs only for PRs targeting staging. Generated release PRs get their required release contexts from the code-owner review of the pull request, not from a dispatch. The standalone Verify deterministic builds CI job also runs only for PRs targeting staging; a generated release PR must not require or wait for that skipped context. The Examples (local harness) workflow also runs only for PRs targeting staging: premain and main derive from staging, so the harness has already run on the same tree before promotion and a second run there only repeats it. premain and main run release hygiene, branch version sync, release-branch provenance, package build, and publish postcondition checks; they must not run the full rubric or deterministic-build job on release publish paths.

Generated release PRs have one eligible CI event. Release Please version commits and generated-artifact sync commits carry [skip ci] in the commit body so their automation-originated pull_request opened and synchronize events do not create stale or duplicate CI runs. The producer keeps the pull request draft-locked while the artifact sync lands, verifies the generated head and its signature, and then marks the pull request ready for the code-owner review at that exact head; if the head moves while it marks ready, it restores the draft lock and fails. The skip marker does not bypass validation: it suppresses only automatic push/pull_request triggers, and the review run remains required and fails closed.

GitHub evaluates a required status check only when the run that reported it was triggered by push, pull_request, pull_request_review, pull_request_target, deployment or deployment_status. A workflow_dispatch run — a run the release lane dispatches itself — reports check runs that do not appear in the pull request’s checks section and do not satisfy a required status check, which is why a generated release PR can never be made mergeable by self-dispatch. That self-dispatch lane and its 20-minute recovery sweep were removed for exactly this reason, and no workflow in this repository runs on a schedule. The eligible run is the code-owner approval the premain/main ruleset already requires: ci.yml also runs on pull_request_review: [submitted] for both release branches, so approving a promotion or generated release PR runs the release checks against that reviewed pull request’s own base, head and head SHA. The generated-content Release delta validation smoke runs on that same review run for a generated release pull request, because a pull_request event from the built-in token never starts; its job condition admits the pull_request_review event, and a staging pull request still never matches it. A head that moves dismisses the stale approval, and the next approval runs the checks again.

.github/release-lane.json is the declaration the lane and its guard share: per release branch it names the required contexts (the same three the ruleset requires, plus the generated-content delta smoke), the workflow that reports each one and the job that carries the context name, and the generated release branches. Every reporting job reads the reviewed pull request from github.event.pull_request.*, because GitHub sets GITHUB_BASE_REF/GITHUB_HEAD_REF only for pull_request and pull_request_target runs. scripts/verify-release-pr-check-lane.sh --self-test proves that wiring and fails closed when the review trigger narrows, a reporting job stops reading the reviewed pull request or grows a dispatch-only path, a producer stops handing its draft to the review, or a workflow reintroduces a clock or a credential.

A generated release PR left checkless needs no human action and no clock. The producer marks the finished draft ready, and the code-owner review supplies the required contexts on the one event GitHub counts. If the head moves after an approval, the premain/main ruleset dismisses the stale approval and the next approval re-runs the same checks.

Skipped full-rubric and deterministic-build contexts are not release/security proof. The Release/security gates CI job is unconditional and branch-protection-compatible; it verifies release supply-chain wiring, release branch signature history, Release Please provenance self-tests, CI rubric enforcement, workflow invariants, and deterministic release-cycle fixtures even when the full rubric is intentionally skipped.

Generated release messages

Both lane configs set pull-request-title-pattern to fix${scope}: release${component} ${version}. Pinned release-please@17.11.2 uses that rendered title as the release PR title and as the release-branch commit message: build/src/manifest.js createOrUpdatePullRequest and build/src/github.js updatePullRequest both set message = releasePullRequest.title.toString(). The generated premain title/commit is therefore fix(premain): release X.Y.Z-rc and the generated main title/commit is fix(main): release X.Y.Z.

scripts/verify-release-pr-postcondition.sh re-renders the configured title from the lane config using the strict semver read from the release branch VERSION, requires the rendered title to be release-driving with the exact premain/main lane scope, requires the open PR title to match it exactly, and requires every release-branch commit headline to be that title or the generated artifact sync subject. It does not infer publication or provenance from a subject’s shape. A stale open release PR generated under an older policy fails that postcondition and must be refreshed or closed instead of merged.

scripts/verify-release-eligibility.sh and the no-op paths in the release-PR and publish postconditions do not classify generated commit subjects. Eligibility evaluates exactly the range it is given and does not consult local tag names, so a tagged commit inside an explicitly supplied promotion range is not silently removed by that verifier. The release-PR no-op starts from the recorded manifest tag, and the publish no-op starts from the immutable published tag; generated release and sync commits inside those baselines are already published. scripts/verify-release-generated-messages.sh re-checks the config binding, exact rendering and strict semver, the stable release-as selection, the workflow paths-ignore trigger, and the Release Please tag baseline.

A gate is not part of Release Please’s commit parser: these predicates run after generation. A merged release PR does not re-trigger generation because the push that merges it changes files listed in the generation workflow’s paths-ignore, and Release Please’s next run uses the tag created at that merged release PR head as its baseline. The generated release and sync commits are ancestors of that tag.

Release phase authority

Each release channel has exactly one publication-authoritative commit: the recorded merge of the generated release-please--branches--premain (into premain) or release-please--branches--main (into main) pull request. Every other push to that channel is generation phase: it may create or refresh the release PR, but it must not publish a release and must not be reported as a failed publish. The single authority for that decision is scripts/classify-release-phase.sh, which reads GitHub’s immutable commit-to-pull-request provenance and requires all of: the pull request is merged, its base is this channel, its head is the trusted release-please--branches-* branch in this repository, and its merge_commit_sha is exactly the pushed commit. Commit subjects, bot identities, labels, and the future head of a mutable branch are never authority. A missing, malformed, or ambiguous provenance response fails the phase job closed before release state is touched.

prerelease.yml and release.yml run that classifier first. A generation-phase push records the phase and skips the publisher. A publication-phase push must create exactly the intended release; its existing prepublish postcondition still fails when a recorded release-PR merge yields no release, a tag differs from the merge commit, or the immutable assets do not verify. A retry that finds the exact published release and no user-facing commit after its tag passes as already complete and performs no duplicate mutation.

workflow_dispatch remains a publication/recovery action. A dispatch without an existing-tag input runs only at a recorded release-PR merge; at any other head it fails closed with the recovery action. A release.yml dispatch with tag_name keeps the unchanged existing-tag asset-upload path. To recover a failed publisher, rerun that publisher run (or dispatch at its release-PR merge commit); do not create a manual tag or republish a different head.

Release credential boundary

Release Please credentials are environment-only secrets. They must never be placed in shell, npm, Node, or operating-system process arguments. scripts/run-release-please-pr.sh is the only supported Release Please CLI entry point. Its transport stages the pinned release-please@17.11.2 package in an npm process from which RELEASE_PLEASE_TOKEN, GH_TOKEN, and GITHUB_TOKEN have all been removed. Only after npm exits does the launcher provide RELEASE_PLEASE_TOKEN to the Release Please parser in-process; ambient GitHub credentials are removed from that process as well. The package staging step also disables lifecycle scripts and fails closed if any GitHub credential reaches the npm boundary.

Do not replace this path with npx, npm exec, or a direct release-please --token ... invocation. npm can log its command arguments, and operating-system process arguments are observable outside the invoking process. Run bash scripts/verify-release-please-token-safety.sh to exercise the sentinel regression test. The release workflow verifier runs that test automatically.

Transient GitHub failures during release PR generation

Release Please walks the target branch ten commits per GraphQL page, so a large promotion needs tens of clean pages: the 7.6.0 release-candidate line had 321 commits on premain since the previous RC tag, which is ~33 pages. GitHub answers a small fraction of those pages with its hard server timeout, so every walk has a real chance of meeting a 503 or 504. Pinned release-please@17.11.2 retries only err.status === 502 (build/src/github.js and build/src/github-api.js graphqlRequest) and rethrows every other status, which fails the entire run — and scripts/run-release-please-pr.sh cannot recover by finding an already-open draft release PR, because the PR was never created.

scripts/invoke-release-please-pr.mjs therefore installs a request-level retry on the pinned package’s own @octokit/request transport before release-please, Octokit, or @octokit/graphql load. The order is part of the contract: release-please walks history through @octokit/graphql’s module-level client, and that client captures the request transport when it loads, so a later patch would retry nothing. The policy is deliberately narrow:

  • Retried: 500, 502, 503, 504, and a request that produced no response at all (network timeout/reset codes), on GraphQL read documents and on GET/HEAD REST requests — the branch walk, the pull request sweep and the commit-file paging. One bad page retries that page; the walk is not restarted.
  • A GraphQL 502 is release-please’s to retry. Its own graphqlRequest loop retries that status, and only that status, six times per document while halving the batch size, so the launcher leaves it alone and owns 500/503/504/network; 502 stays on the launcher’s budget only for REST reads, where release-please has no loop of its own. Retrying a GraphQL 502 in both places multiplied the two budgets: a sustained 502 cost thirty requests for one history page.
  • A REST read is classified on its merged endpoint, not on its call arguments. Octokit endpoint methods bind their method and URL with octokit.request.defaults({method, url}) and the call carries only the route parameters, which is the shape release-please’s own GitHubApi.defaultBranch uses (octokit.repos.get({owner, repo})). A 504 on that read used to abort the lane before the first history page; it now retries like any other read, while an endpoint-method write stays single-attempt. For a binding shape neither the defaults nor the arguments expose, a transport error’s own resolved request supplies the method and path — only those two fields, never its headers or body — so an unclassifiable GET/HEAD is still replayable and an unclassifiable write is still single-attempt.
  • Never retried: any 4xx, a GraphQL response error (a real answer, not a transport failure), and any write — GraphQL mutations and non-GET REST calls. A 5xx that did reach GitHub still fails the lane instead of being applied twice.
  • Bounded: at most six requests for one page, whatever mix of statuses the page answers. The launcher allows five attempts with exponential backoff from 500 ms capped at 4 s, and release-please’s own GraphQL loop allows six but only for 502. One budget per loop was not a bound: a partial outage answers a mix, and each 504 restarted the launcher’s budget inside one of release-please’s attempts while each 502 handed the page back to release-please with a fresh six — an alternating 502/504 measured twelve wire requests on a single cursor, and four 504s before each 502 cost thirty. The launcher therefore counts wire attempts between successful responses, whichever loop is retrying, at the one seam every request passes through (@octokit/request), and stops the page when the sixth is spent. Because the count is taken at that seam and every request the walk makes passes through it, the ceiling does not depend on which loop retries. Wire counts from the transport gate, whose fake reproduces the pinned loop: a sustained 502 is six, a sustained 504 is five, and a mixed 502/504 page is six — each plus its healthy pages.
  • One budget per logical page, not one budget per process. The page’s identity is what a retry repeats: for a REST read its resolved endpoint, with route placeholders filled so the pinned config and manifest blob reads differ by blob SHA rather than sharing one GET /repos/{owner}/{repo}/git/blobs/{file_sha} template, and for a GraphQL page its history cursor plus a digest of the document, which is stable while release-please halves num. A single process-wide counter was not keyed to anything: pinned release-please loads the config and the manifest with Promise.all, so one brief blob-service outage answered both concurrent reads, spent the one budget on them, and suppressed both fourth attempts — failing a promotion that the looser earlier accounting recovered, while each read was still inside its own five-attempt allowance. Distinct concurrent reads now keep their own six, and repeated attempts at one cursor still add up to a single six. A call shape nothing classifies keeps one shared, fail-closed budget instead of running untracked, a page’s entry is dropped the moment that page answers, and the table refuses to grow past 256 pages rather than leaving one unbounded.
  • A spent page budget ends the request instead of starting another loop: the launcher raises it without a GitHub status, because release-please retries exactly err.status === 502 and would otherwise restart its own six. The line names the budget and the last answer, so the lane still fails, with the GitHub status in the message. Each retry logs the request label, the status or network code, and the attempt count; the credential, headers and request bodies are never logged.
  • A failure line carries the GitHub status or transport code, the error class, and the sanitized part of the error message — release-please’s own diagnostic, a GraphqlResponseError’s GitHub text, or a fail-closed setup error such as a missing pinned request transport. Without it the lane reported only a class name. Only message is read: a transport error’s request, headers and response bodies are never touched, and credential- or header-shaped text inside the message is redacted.

The retry is in memory only. No release-please source file is forked or patched on disk, the credential transport is unchanged, and both the premain (prerelease-pr.yml) and main (release-pr.yml) lanes reach it through the same wrapper. node scripts/test-release-please-transient-retry.mjs is the regression gate: it runs the real launcher against a fake pinned package and proves a retried page, the bounded budget, the mutation and 4xx exemptions, the load-order contract, and the per-page wire counts for a sustained 502 (one healthy page plus release-please’s own six attempts), a sustained 504 (one healthy page plus the launcher’s five) and a mixed 502/504 page (one healthy page plus the shared six).

A failed release-please run fails the lane. The wrapper’s inherited fallback accepted any open draft release PR, so an earlier PR masked a terminal failure — a persistent 5xx on the history walk, or a 404/422 configuration error — and the lane went green without refreshing it. The first repair credited a failed run with a release PR this run had created or refreshed, and that credit was still unprovable: release-please pushes the release branch and then creates or rewrites the pull request, so a moved release branch head is half a refresh with the title and body possibly stale, and gh cannot show that the metadata write landed.

The rule is therefore keyed on the mode, not on what the wrapper can see afterwards: a non-zero release-please exit fails the lane, with the failing status propagated and a diagnostic naming the pre-run baseline and the present state. Re-run the lane to recover — release-please is idempotent and refreshes the same release PR. A successful run passes and reports what it achieved: the release PR created, refreshed, already up to date, or not needed.

The pre-run read is three-way, because “there is no open release PR” and “the release PR list could not be read” are different facts; the inherited shape swallowed the read failure (|| true), so a transient 5xx on the pre-run gh pr list looked like an empty baseline. The baseline is now recorded as found, none, or unreadable, and an unreadable one credits nothing and prints a warning naming the unreadable read.

The wrapper’s own read-only gh calls are bounded-retried on a transient failure, because they are asked under set -e and one 5xx on them ended the lane: the pre-run draft-state read before release-please ever started, and the post-run one after a fully successful run, when only the reporting read was left. That is the same partial outage that 504s GraphQL pages answering these calls. The draft-state read (gh pr view --json isDraft) spends at most three attempts, 1 s doubling to a 4 s cap. The predicate is narrow — a 5xx or a transport that never produced a response is repeated, a 4xx never is, because an answer GitHub gave on purpose is not a load failure — and when the read genuinely cannot be answered the lane still fails closed, now saying “could not be read for its draft state” instead of dying silently. The draft-lock write itself stays single-attempt.

bash scripts/test-release-please-pr-lane.sh proves all of it against the real wrapper, a stub launcher, and a fake gh, with no network.

Generated release PR artifact sync commits on both release-please--branches--premain and release-please--branches--main are product release-automation commits. CI is not a signing key holder and no workflow-held private signing key exists. The sync workflow draft-locks the release PR, regenerates artifacts, proves the diff is limited to the generated release-artifact allowlist, and, when a commit is needed, creates exactly one GitHub GraphQL createCommitOnBranch commit with fix(release): sync generated release artifacts and expectedHeadOid set to the fetched release-branch head. GitHub signs that commit server-side, the workflow fetches the resulting head, and the release branch signature gate must accept it as GitHub verified-valid before the release PR is marked ready for the code-owner review. The workflow does not git push a CI-created artifact commit, import signing material, set git signing config, or use private signing secrets.

Release Please commits and generated artifact sync commits created by GitHub automation are GitHub-verified unless local evidence proves a stronger signer. Do not describe them as Aron/canonical-key signed merely because GitHub marks them verified. Delegate implementation commits for normal PRs remain locally signed by the steward/operator under the repository’s existing signing configuration; the GitHub-verified release automation commits are limited to generated release PR version/artifact synchronization.

The signed-history repair boundary is the repaired branch base c723c42c71d9220f49702db965d4deffff6183f1. Protected branch and release-please branch security gates reject commits in the repaired branch ranges unless the commit is either locally trusted-good (%G?=G) or GitHub-verified with verified=true and reason=valid. GitHub Actions runners may report SSH-signed commits as local_status=N when they lack the local gpg.ssh.allowedSignersFile; that state is accepted only with GitHub verified-valid evidence, and true unsigned commits still fail closed. Immutable v1.15.x release tags are an accepted residual exception: v1.15.0 contains two historical unsigned generated sync commits, v1.15.1 contains four, and v1.15.2 contains six. Those published tags, releases, notes, metadata, and assets must not be changed; recover forward through the normal staging → premain → main train.

Safe provenance claims are scoped: repaired branch tips from c723c42c71d9220f49702db965d4deffff6183f1 forward are guarded against commits that are neither locally trusted-good nor GitHub verified-valid, and GitHub API Release Please/generated artifact sync commits may be called GitHub-verified when the verification API reports verified=true and reason=valid. Unsafe claims are rejected: do not claim all released tag history is signed, do not claim GitHub-verified API commits are Aron/canonical-key signed without local evidence, and do not claim CI can sign generated sync commits by holding private signing material.

Full cycle checklist

1. Integrate on staging

  • Open the PR against staging.
  • Verify origin/main is an ancestor of the PR head before opening or merging:

    git fetch origin main staging premain
    git merge-base --is-ancestor origin/main HEAD
    
  • Run the normal validation for the change, at minimum make test and any issue-specific verifier.
  • Merge only after CI is green.

2. Promote staging to premain

  • Open a PR from staging into premain.
  • Do not retarget the PR from another branch.
  • CI must run the release train promotion gate and branch version sync checks.
  • The prerelease Release Please workflow must create or update the release-candidate PR. A Release Please no-op is a failed RC gate; annotated VERSION markers such as # x-release-please-version are ignored only after the leading RC semver is validated.
  • The promotion push itself is generation phase: it must not be treated as a due publication. The prerelease publisher skips it and only the generated RC PR merge publishes the vX.Y.Z-rc.N release.
  • The generated RC PR title and release-branch commit subject must be fix(premain): release X.Y.Z-rc; the postcondition requires the exact lane scope and a release-driving generated message, and rejects a stale chore-titled PR.
  • The release-candidate PR remains draft-locked while generated CDK artifacts are synchronized; it is released to the code-owner review once the sync lands, and that review run reports the required checks.
  • When the release includes a change to release-please-config*.json extra-files entries, watch the first generated release-please--branches--premain RC PR deliberately. Do not claim proof from static config alone: verify the generated PR actually rewrites every configured JSONPath/TOML/generic file, including example packages['../../../cdk'].version lockfile entries, and that scripts/verify-version-alignment.sh passes on the generated head. Record the RC PR URL and check output in the promotion notes.
  • Merge the release-candidate PR only after generated artifacts are in sync and all required checks are green.
  • The prerelease publisher creates immutable assets for the vX.Y.Z-rc.N GitHub Release.
  • For v2+, the same serialized publisher creates the root vX.Y.Z-rc.N tag and nested cdk-go/apptheorycdk/vX.Y.Z-rc.N Go module tag only when absent, proves both target the exact RC commit, and resolves both modules at the exact version through direct VCS lookup before the draft release becomes public.

3. Promote premain to main

  • Open a PR from premain into main.
  • CI must verify the promotion is premain → main and that release manifests are synchronized.
  • The stable Release Please workflow must create or update the stable release PR. A Release Please no-op is a failed stable gate.
  • The premain-to-main promotion push itself is generation phase: it must not be treated as a due publication. The stable publisher skips it and only the generated stable PR merge publishes the vX.Y.Z release.
  • The generated stable PR title and release-branch commit subject must be fix(main): release X.Y.Z; the postcondition requires the exact lane scope and a release-driving generated message.
  • The stable release PR must reset .release-please-manifest.premain.json to the stable version and include generated CDK artifact sync before it becomes ready.
  • Generated release-artifact sync commits are created automatically by the shared sync script as GitHub-verified product-automation commits. Do not add CI-held signing secrets; the workflow token creates the server-side signed fix(release): sync generated release artifacts commit through createCommitOnBranch, then verifies the new range before the PR can become ready.
  • Merge the stable release PR only after required checks pass.
  • The stable publisher creates immutable assets for the vX.Y.Z GitHub Release. main owns stable releases only; RC-shaped stable PR titles, versions, or tags are rejected.
  • For v2+, stable publication applies the same create-only two-tag transaction: vX.Y.Z and cdk-go/apptheorycdk/vX.Y.Z must target the exact same stable release commit. Any conflicting existing ref fails closed; neither tag is moved, deleted, or recreated.

4. Back-merge main to staging

  • Open a PR from main into staging immediately after the stable release.
  • Merge it before the next staging PR or promotion.
  • This keeps the stable Release Please manifest and the premain Release Please state synchronized for the next cycle. There is no post-release CI direct-push sync or automated protected-branch backmerge.

apptheory-init template/release pairing gate

apptheory-init scaffolds pin @theory-cloud/apptheory-cdk to the GitHub release asset for v + VERSION and declare their own aws-cdk-lib/constructs versions. npm installs both, so the template pins must pair with the peerDependencies declared by the CDK asset for that tag. When they drift, npm install fails ERESOLVE in every generated project.

scripts/verify-scaffold-examples.sh packs cdk/ from the working tree, so it only proves the templates match the tree the gate runs on. It cannot see release-process skew: a tree whose VERSION already names a published release with different peers, a template asset URL naming a different tag than VERSION substitutes, or a release packed at a version other than the one the templates point at.

scripts/verify-release-pairing.sh closes that class. It packs (or downloads) the CDK artifact, renders the templates with the real scaffolder, and fails closed unless every template names the release asset for the tag VERSION substitutes and its pins intersect that artifact’s declared peerDependencies. Range syntax it cannot decide is a failure, never a pass.

The checker decides ranges the way npm semver does, including the desugaring npm applies to a partial body under an operator: >2.269 means >=2.270.0 and <=2.269 means <2.270.0, neither of which is the 2.269.0 bound. It rejects the version syntax npm itself refuses (leading-zero components, components above Number.MAX_SAFE_INTEGER) and treats a pin no version can satisfy - any range whose ceiling falls below 0.0.0 - as empty. Shapes it declines to decide (prerelease ranges, unions, and x/* bodies under an operator) fail closed rather than passing, which is deliberate: for a handful of degenerate ranges npm’s own intersects disagrees with its minVersion/satisfies, and this gate follows the satisfiability answer, not the intersection artifact.

The gate is a blocker, not an advisory, in four places:

Where What it proves
ci.yml release-security-gates (runs on every PR, including generated release PRs) The generated RC/stable release-please PR head - the tree that will be tagged - pairs its templates with the packed candidate
prerelease-pr.yml / release-pr.yml, before generated artifact sync The branch about to generate a release PR has not drifted
scripts/verify-release-branch.sh, on every publish path in the tagged tree before assets are built The release-candidate tarball for the tag pairs with the shipped templates
scripts/verify-release-publish-postcondition.sh complete phase The release this run published pairs its immutable asset with the shipped templates

Run it locally with ./scripts/verify-release-pairing.sh (default), --self-test (both-directions proof), or --published (download and verify the published asset for the current VERSION). The download is bounded by a connect timeout and a maximum transfer time so a stalled release host fails the gate promptly, and a download failure reports the HTTP status or timeout rather than assuming the asset is missing.

The already-published v4.2.4 asset declares aws-cdk-lib 2.269.0 and cannot be changed. The gate exists so 4.2.5 and later either ship paired or fail before the release becomes public.

Forbidden recovery actions

Do not use any of these actions to recover a release lane:

  • Force-pushing main, premain, staging, release PR branches, or milestone branches.
  • Retagging, deleting, or recreating release tags.
  • Editing, deleting, or overwriting a published GitHub Release or its assets.
  • Publishing AppTheory to npm, PyPI, or any registry outside GitHub Releases.
  • Bypassing Release Please, generated artifact sync, version alignment, branch version sync, or the release train promotion gate.
  • Merging a stale Release Please PR after main has advanced.
  • Manually marking protected checks successful or weakening workflow permissions so a release PR can self-attest.
  • Running a stable release from staging or a prerelease from main.
  • Creating manual tags or GitHub Releases instead of letting the generated Release Please PR merge publish the expected tag.
  • Moving, deleting, force-updating, or manually repairing either the root release tag or the nested cdk-go/apptheorycdk/vX.Y.Z[-rc[.N]] Go module tag.
  • Adding CI-held private signing material so workflow runners can manufacture generated release-artifact sync commits.

Published GitHub Releases are immutable. If a published release is wrong, the recovery is a new version moving through the normal cycle, not mutation of the old release.

Safe operational recovery path

When the release lane is blocked, recover by preserving evidence and re-entering the same cycle:

  1. Diagnose without mutation.

    bash scripts/diagnose-release-state.sh --live
    bash scripts/verify-release-state.sh --live
    bash scripts/verify-release-workflows.sh
    bash scripts/verify-ci-rubric-enforced.sh
    bash scripts/verify-release-branch-signatures.sh --self-test
    
  2. Classify the blocker.
    • Draft GitHub Release with missing or partial assets: rerun the same publisher workflow; the publisher replaces draft assets safely and verifies branch provenance before publication.
    • Root or nested Go tag missing after a partial publisher run: rerun the same serialized publisher. It creates only the absent ref at the already-verified release commit, retains any same-commit ref, and then proves exact root/CDK module resolution.
    • Root or nested Go tag points at another commit: do not retag. Preserve the conflicting evidence and cut a new version through the normal train.
    • Published GitHub Release already exists: rerun the publisher only to verify immutable assets and both Go module refs match the source build; do not upload or edit assets.
    • Stale Release Please PR: regenerate or sync Release Please state from the current branch baseline; do not merge the stale PR.
    • Publisher reported a failed publish on an ordinary promotion or back-merge push: classify the head with bash scripts/classify-release-phase.sh --channel prerelease|stable --head <sha>. A generation-phase head is not a due publication; refresh or merge the generated release PR instead of forcing a publish. Do not treat this as a release failure and do not create a manual tag.
    • Ambiguous publisher provenance (API failure, rewritten merge shape, or multiple matching merged release PRs): the phase job fails closed. Inspect the commit-to-PR association for the exact head and rerun only when one recorded release-PR merge is unambiguous; never choose a publication authority by subject or branch tip.
    • Generated artifact sync pending: keep the release PR draft and rerun the release PR sync workflow so it can create the GitHub-verified generated artifact commit and prove the signature range. Use the local signed fallback below only when GitHub automation is unavailable and an operator deliberately performs the offline recovery. Do not configure workflow-held private signing material, do not rewrite existing released commits, and do not bypass signing.
    • Promotion drift: recreate the promotion PR from the valid branch heads in the cycle.
    • Back-merge drift: merge main back into staging before accepting further staging work.
  3. Re-run the deterministic release verifiers before retrying a merge or publisher workflow.

    bash scripts/verify-release-state.sh --self-test
    bash scripts/verify-release-train-promotion.sh --self-test
    bash scripts/publish-go-module-tags.sh --self-test
    bash scripts/verify-go-module-tags.sh --self-test
    bash scripts/verify-release-workflows.sh
    bash scripts/verify-ci-rubric-enforced.sh
    # Manual audits pass the exact new-commit range. Without --range the gate
    # bounds the scan by the current GitHub event's own base; with no event it
    # fails closed rather than sweeping whole ref histories.
    bash scripts/verify-release-branch-signatures.sh --range "<accepted-base>..<candidate-head>"
    make test
    
  4. If the framework cannot express the needed recovery, add a verifier-backed release-process change first. Do not create a one-off manual path around the train.

Emergency/offline local signed generated-artifact sync fallback

The primary path is automated: the release PR workflow creates the generated artifact sync commit as a GitHub-verified createCommitOnBranch product-automation commit and then marks the pull request ready for the code-owner review, which reports the required checks. Use this local path only as an emergency/offline fallback for generated release PR branches that are already open and draft-locked, for example when GitHub automation is unavailable and a human operator explicitly accepts the offline recovery. It is the same release train; it is not a direct push to premain or main.

git fetch origin
bash scripts/sync-release-pr-generated.sh --local-signed-sync release-please--branches--premain
# or:
bash scripts/sync-release-pr-generated.sh --local-signed-sync release-please--branches--main
git log --show-signature -1
git verify-commit HEAD

The script starts from a clean checkout, fetches the release PR branch, regenerates only release artifact files, stages only .release-please-manifest.premain.json, cdk/.jsii, cdk/lib, cdk-go/go.mod, cdk-go/go.sum, and cdk-go/apptheorycdk, then runs plain git commit -m "fix(release): sync generated release artifacts". It does not set user.signingkey, replace the signing program, import keys, or add passphrases. If the normal local signing configuration does not produce a locally trusted-good signature, the script fails before pushing and reports the signature status.

After the signed sync commit is pushed, the script waits for the release PR head to match the synced commit and leaves the pull request draft-locked. The next producer run verifies the generated head and its signature, marks the pull request ready for the code-owner review, and that review run reports the required checks.