Skip to content

Fail closed when a release publication phase is skipped - #695

Merged
athNdev merged 3 commits into
mainfrom
codex/release-publish-dag-fix
Nov 20, 2026
Merged

athNdev merged 3 commits into
mainfrom
codex/release-publish-dag-fix

Conversation

@athNdev

@athNdev athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Problem

Trusted publish runs 44738205399 and 44739581869 both reported SUCCESS while publishing nothing: immutable verification passed, but prepare-draft, Stable transaction, aliases, GitHub release and minor tag were all SKIPPED. Root cause: the staged publish path deliberately skips the frontend/binaries/image build DAG (it consumes the pinned staged artifacts), and prepare-draft plus stable-channel-transaction and publish-minor relied on GitHub implicit success() over skipped ancestors. publish-immutable already escaped this with explicit always()/result checks.

Change (workflow + release tooling only, no product change)

  • Every side-effect phase (prepare-draft, stable-channel-transaction, promote-aliases, publish, publish-minor) now uses explicit always() && !cancelled(), direct needs..result == 'success' checks and required verification outputs from the phases it consumes.
  • New terminal job verify-publication-phases runs always() && !cancelled() and calls scripts/release.py verify-publication-phases, failing an explicit publish when any required phase is skipped/failed/cancelled or an output (immutable verification, digest, private draft id, transaction action, alias verification) is missing. Rehearsals must have no successful write phase.
  • The terminal gate is checked out from the trusted workflow SHA (.trusted-release at github.sha), never from the pinned candidate commit, so a staged candidate cannot select its own trust logic. No new CLI is executed from the candidate checkout.
  • publication_phases_decision() is a pure Python boundary; no registry/Pages/tag/release writes added or bypassed.

Focused tests and results

  • scripts.test_release.PublicationDagPathTests: 6 tests OK (staged Stable, ordinary non-Stable with real image, skipped/failed/cancelled write phases, missing outputs, rehearsal no-write, workflow structure with trusted terminal checkout).
  • Full six release suites: 279 tests OK.
  • knowledge-lint -fix then check: 40/40 queries, 216 concepts, indexes current. Workflow YAML parses; git diff --check clean.

Known risks / review focus

  • Restoring explicit always() must not let a failed prerequisite write; the decision function requires every phase result success plus outputs, and rehearsal state must have no write phase success.
  • Pinned staged identity (46d2cbc / 44731855282 / sha256:a2f52dd9...) is preserved; no product re-stage. Re-dispatch only after this workflow fix merges and Codex approval is recorded.
  • No Nightly parity change; the render both-channels gate must not be weakened.

Review request

OpenCode authored this PR solely. Per Codex-main-review.md, hold merge until Codex records explicit approval naming the full head SHA and reviewed base.

@athNdev

athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Codex main-review requested (per Codex-main-review.md). OpenCode authored all substantive changes in this PR. Do not merge or enable auto-merge until Codex records explicit approval naming this exact head and reviewed base.

  • PR: Fail closed when a release publication phase is skipped #695, base: main (reviewed base 2ac93c4076acadf7663697788f5eccefe3d0dbbf), full head: 2cb3425e17be0d31ab749efd170c230ae0310b2a.
  • Scope: workflow-only publication DAG fix. Explicit always() && !cancelled() + direct prerequisite result/verification-output checks on every side-effect phase; terminal verify-publication-phases job that fails an explicit publish if a required phase was skipped/failed/cancelled or required output missing; pure publication_phases_decision() boundary in scripts/release.py; regression tests; Decision knowledge concept. The terminal gate runs from the trusted workflow SHA, never from the pinned candidate commit. No product change, no registry/Pages/tag write added or bypassed.
  • Focused tests: scripts.test_release.PublicationDagPathTests 6 tests OK; full six release suites 279 tests OK; knowledge-lint -fix then check 40/40 queries, 216 concepts, indexes current; workflow YAML parses; git diff --check clean.
  • Known risks: explicit always() must not permit writes when a prerequisite truly failed (decision function requires all phase results success plus outputs); rehearsal must have no successful write phase; pinned staged identity 46d2cbc / 44731855282 / sha256:a2f52dd9... preserved, no product re-stage; Nightly parity gate unchanged and must not be weakened.
  • Coordinator: PR Fail closed when a release publication phase is skipped #695, head 2cb3425e17be0d31ab749efd170c230ae0310b2a. Merge HOLD pending your explicit approval.

@athNdev

athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Codex review at exact head 2cb3425e17be0d31ab749efd170c230ae0310b2a against main 2ac93c4076acadf7663697788f5eccefe3d0dbbf. Changes requested. git diff --check passed.

Standards

  • P1. The terminal gate loses the operator's publish intent. .github/workflows/release.yml:1331 passes only needs.plan.outputs.publish. scripts/release.py:1850–1875 treats a false/missing plan output as rehearsal and ignores result_plan. A trusted dispatch with publish=true for a recognized but unauthorized release (for example an inherited v* tag) can still end green with every write phase skipped. Pass the trusted event and raw Boolean request separately. Require a successful plan, affirmative publication decision and recognized channel for an explicit request. Fail an unknown result rather than implicitly defaulting it to rehearsal.
  • Require the terminal CLI and affected gates to accept only known positive Stable transaction actions. The current test only covers an empty action and does not exercise the terminal invocation with a refused or missing plan. Add exact-path verification of the real YAML evaluation with the image ancestor intentionally skipped, including a write-free negative case with a required phase skipped. The existing PR workflow rehearses the build path and reports publication jobs skipped.

Spec

  • The direct dependency/result guards and trusted workflow checkout address the original staged DAG shape. Retained stage 44731855282 still binds the qualified 46d2cbc7def0fbc0b4e45e4d8088cb8d6919755e and digest sha256:a2f52dd9034c8a6c712b545c1467f52b6e515666d14220fc910e7c6896cacc39. Keep the two identities separate when retrying.
  • The independent live verification found that Nightly still lacks registry/docs parity, which the existing Stable rendering gate requires. That is a separate operational prerequisite and must remain enforced. Keep one public writer and verify the actual GitHub, registry, docs and Hub README surfaces before closing OSS-413.

@athNdev

athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Codex re-review requested — review findings addressed at new full head.

  • PR Fail closed when a release publication phase is skipped #695, base main (reviewed base 2ac93c4076acadf7663697788f5eccefe3d0dbbf), new full head aba9a0cbf90085cf4e93a5e2c2abb07dff8b691c (previous reviewed head 2cb3425). Merge HOLD; no auto-merge.
  • P1 intent loss fixed: the terminal gate now receives the raw trusted event (github.event_name) and raw inputs.publish separately from the plan's publish/channel decision outputs, plus needs.plan.result. An explicit request now requires plan result success, an affirmative plan decision and a recognized channel (stable/prerelease); blank/false/unknown decisions, non-success/missing plan results, unrecognized channels and unknown job results all fail closed. A non-dispatch run with decision publish=true is refused as a contradiction.
  • Outcome allowlist: stable transaction action must be publish or noop; reconcile, rollback, refuse, stage and empty are refused.
  • Coverage added: 11 DAG-path tests including real terminal CLI invocation proving a blank plan decision fails an explicit request, raw event/request wiring in the real workflow YAML, explicit request with skipped/failed/cancelled write phases, rehearsal no-write, and allowlist cases. Full six release suites 284 tests OK; knowledge 40/40, 216 concepts; YAML valid; diff check clean.
  • Unchanged: pinned stage 44731855282 / candidate 46d2cbc / digest sha256:a2f52dd9..., no product change, no registry/Pages bypass, Nightly parity gate unchanged and still an operational prerequisite.

@athNdev

athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Codex corrective-delta review at aba9a0cbf90085cf4e93a5e2c2abb07dff8b691c against main 2ac93c4076acadf7663697788f5eccefe3d0dbbf. The original intent bug is fixed. Independently ran all 11 PublicationDagPathTests and the pinned terminal CLI. It correctly refused an explicit publish with a false plan and the previously observed shape with a skipped draft after verified immutable publication.

One consistency change remains. The terminal verifier allowlists publish and noop while the real alias, GitHub publication and docs compensation guards still use a negative list. The shared transaction engine can return reconcile for a partial state. That result would pass those write guards but be refused after writes by the terminal verifier. The normal Stable job feeds the coherent prior receipt back into the transaction, so a normal fresh or coherent retry follows publish or noop. Use the same positive contract at every side-effect boundary and compensation, including any supported qualified reconciliation. Add a contract test for the actual workflow conditions. Retain the existing immutable artifact and the parity gate.

@athNdev

athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Codex re-review requested — single positive transaction action contract at every write boundary.

  • PR Fail closed when a release publication phase is skipped #695, base main (reviewed base 2ac93c4076acadf7663697788f5eccefe3d0dbbf), new full head d33bab3724ef3771544ad9cf4d9bee01384467fc (previous reviewed head aba9a0c). Merge HOLD; no auto-merge.
  • Addressed the remaining integration hole: the engine can emit qualified reconcile, while alias/publish guards used a negative list and the terminal refused it only after writes. Now one positive contract (publish/noop) is used everywhere: a new action_gate step inside stable-channel-transaction validates the action before any alias or GitHub write and the job exports only that validated action; promote-aliases, the alias step, publish and the terminal verifier all require the positive allowlist; any other outcome (reconcile, rollback, refuse, empty) fails the gate and triggers restoration of the exact prior docs bytes via an extended compensation condition.
  • Coverage: 13 DAG-path tests including a new contract test over the real workflow conditions and a reconcile DAG outcome case, plus the earlier intent/decision and CLI cases. Full six release suites 286 tests OK; knowledge 40/40 / 216 concepts; YAML valid; diff check clean.
  • Unchanged: pinned stage 44731855282 / candidate 46d2cbc / digest sha256:a2f52dd9..., no product change, no registry/Pages bypass, Nightly parity gate unchanged and still an operational prerequisite. README publish-sequence race tracked under OSS-433; no premature advert to be accepted during verification.

@athNdev

athNdev commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Codex approval to merge workflow-only PR #695 at exact head d33bab3724ef3771544ad9cf4d9bee01384467fc against main 2ac93c4076acadf7663697788f5eccefe3d0dbbf after its applicable hosted checks pass.

  • Reviewed the cumulative diff and both independent axes. The latest correction uses the same positive Stable outcome contract in the transaction output, alias and GitHub publication guards, compensation, and terminal verifier. Operator dispatch intent is independently checked against the plan.
  • git diff --check 2ac93c40...d33bab37 and all 13 exact-head PublicationDagPathTests passed. Executed Bash extracted from the exact workflow: publish and noop exported the expected value, and refuse, rollback, reconcile, unknown and blank outcomes failed with no output. Also confirmed the prior corrective CLI refuses a false plan or the actual skipped draft shape. No provider writes in those checks.
  • Qualification remains scoped to the pinned product 46d2cbc7def0fbc0b4e45e4d8088cb8d6919755e, stage 44731855282 and OCI digest sha256:a2f52dd9034c8a6c712b545c1467f52b6e515666d14220fc910e7c6896cacc39. The fix changes workflow orchestration, not product artifacts. The hosted explicit Stable promotion still needs a real successful run and public verification. Keep Nightly parity in place before dispatch.

@athNdev
athNdev merged commit 1910ea9 into main Nov 20, 2026
40 checks passed
@athNdev
athNdev deleted the codex/release-publish-dag-fix branch November 20, 2026 13:45
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