Skip to content

fix(release): bind publication to authorized candidate bytes before exposure #1300

Closed

Description

@EffortlessSteven

Parent and selected seam

#805 / #816 / #817 — the publication-byte prerequisite for the next release. Release-specific execution index: #1339.
Discovered while reconciling release source truth in #1293 / PR #1299.

PR-sized builder graph — 2026-10-09

This issue remains the integration/acceptance owner. Split implementation into two bounded leaves without weakening any acceptance below:

#1343 -> #1344 -> #1300 acceptance
-> #816 final candidate freeze
-> separate exact authorization and publication in #817

The planned implementation promotes the exact prepared bytes. Record the durable design choice here before production integration; a justified reproducible-rebuild alternative must preserve independently authorized digest comparison before exposure. Do not create a third parallel implementation of the same validator/workflow. Preserve existing release/portability owners and #945 shared-file sequencing.

Problem and current source

At main 33f4271a8e2bf507d387aac7b409a5fc20578512, release-binary.yml independently builds/packages a branch-dispatch candidate and the eventual tag-push archive. The install/tar steps retain fresh filesystem timestamps. Identical source SHA therefore does not establish identical archive bytes, and a normal delayed tag run can differ from the digest authorized from the candidate packet.

The publish job verifies only the tag run's newly generated manifest/checksum, then creates or overwrites release assets. It neither promotes the authorized candidate artifact nor compares against the earlier authorized digest before exposure. #817 requires published identities/digests to match that packet. Post-publication comparison discovers the mismatch too late.

Integrated outcome

Implement and prove a production publication boundary that accepts only the exact previously authorized archive/checksum for the exact authorized candidate source and tag, before any GitHub Release create/upload is permitted.

Supported design choices after durable review:

  • promote the exact retained candidate archive/checksum through a trusted artifact-identity path; or
  • normalize and prove reproducible packaging, then verify rebuilt bytes against the independently supplied authorized digests before exposure.

Do not change #817's immutable-byte acceptance into a weaker source-SHA-only promise to accommodate the current rebuild. Candidate metadata cannot authorize itself; a trusted external authorization record must bind the exact packet and intended side effects.

Likely surfaces and source truth

Acceptance

  • The authorized packet binds full candidate SHA, actual source ref, proposed unused tag, workflow/run/attempt identity, exact artifact/asset identity, archive and checksum digests, and relevant toolchain/packaging provenance.
  • A branch-dispatch receipt retains its actual ref/tag fields; no cosmetic relabeling produces tag evidence.
  • Publication resolves the authorized inputs independently of the tag run's newly generated claims and validates identity/digests before any external create/upload.
  • Candidate archive, checksum, or metadata tampering; wrong SHA/ref/tag/run/artifact; absent/expired artifacts; replay from another candidate; and malformed/duplicate fields fail closed before exposure.
  • A matching positive fixture crosses exactly one publication boundary; the invocation captures the verified bytes, not a path that can be replaced after validation.
  • If rebuilding, fixed-source artifacts are byte reproducible across separated builds with controlled tar/gzip metadata and pinned packaging inputs, and mismatch to the authorized digest is rejected before exposure.
  • Existing tag/release collisions stop; no automatic historical-tag reuse or --clobber path replaces an already published asset.
  • Partial external state is retained; retry does not silently overwrite, delete or resume beyond its authorization.
  • Candidate preparation remains non-publishing. PR tests and negative controls use fake publication adapters and cannot tag, publish, request release credentials, or upload public assets.
  • Candidate code cannot execute with publishing credentials or supply its own approval.
  • The workflow/code change does not itself authorize a release, tag, marketplace action, or destructive recovery.
  • Receipts preserve actual verification and publication outcomes. Docs state implemented behavior, remaining limitations, and retention requirements.
  • Both release(bytes): validate an independently authorized candidate archive before publication #1343 and release(publish): promote verified candidate bytes and reject rebuild, replay, or asset overwrite #1344 are merged through ordinary protected review/checks and the real production boundary has retained non-publishing integration proof; leaf issue closure alone is insufficient.

Proof

Cheapest local fixtures first, hosted non-publishing proof only when appropriate:

  • Deterministic positive and tampered/mismatched/replayed/missing candidate fixtures with a recording publication adapter.
  • Delayed two-build byte-identity proof if the reproducible-build approach is selected.
  • Assert zero publication calls on every identity/digest/authorization failure.
  • Existing cargo test --bin ub-review --locked release_binary_workflow contract tests, plus focused tests for the chosen validator.
  • cargo fmt --all -- --check, relevant locked check/Clippy, cargo run --locked --package xtask -- policy-check, actionlint .github/workflows/release-binary.yml, and git diff --check.
  • Reviewed non-publishing workflow fixture/dispatch receipt binding exact candidate source, workflow, artifacts, and verified digest; no real publication is needed to merge the repair.
  • Independent exact-head review of workflow permissions, credential isolation, controlled-file receipts, and absence of candidate-controlled publication authority.

Non-goals

No release cut, tag mutation, asset replacement, public support expansion, provider/portability/stable-tool acceptance, stable coordinator, or branch-protection change. No new general artifact service. Historical #1265 portability work is not general candidate acceptance; retain #815/#1071 ownership and verify current status before reuse.

Rollback and completion

If the new boundary cannot establish identity, keep publication disabled and preserve failing receipts; do not restore unchecked rebuild-and-clobber behavior. Revert only lane-owned code/docs if needed. Destructive public release recovery remains separately authorized.

Close only after the exact authorized-byte boundary is implemented and its failure controls pass before exposure. #816/#817 stay blocked on this prerequisite until then and retain their other unmet acceptance.

Activity

  1. added
    bug
    on Sep 8, 2026
  2. added
    epic
    on Sep 8, 2026
  3. added
    enhancement
    on Oct 9, 2026
  4. EffortlessSteven commented on Oct 11, 2026

    @EffortlessSteven
    MemberAuthor

    Pure authorized-byte leaf #1343 is delivered as draft PR #1379 at 9b223f1 (base main411d68f). New strict authorized_release.v1 contract leaves existing release_candidate.v1 producer/workflows unchanged and returns captured immutable verified archive/checksum bytes. Nine adversarial/golden/real-GNU-fixture tests and seven exact-commit local baseline checks pass; independent Luna review has no remaining validator blocker. Hosted required-gate proof and reviewed merge remain pending. Handoff to #1344 is exact prepared-byte promotion: authenticate external authority/API facts independently, consume only verified slices after trusted-time expiry recheck, and freshly reject tag/release collisions before side effects. Point-in-time absence is not a reservation. No publication adapter, workflow wiring, merge or release was performed; this source-only leaf does not close #1300/#816/#817 acceptance.

  5. EffortlessSteven commented on Nov 5, 2026

    @EffortlessSteven
    MemberAuthor

    Handoff: both leaves delivered (2026-11-04)

    Per the builder graph this issue owns, both leaves are now merged on main and the production boundary this issue demands is implemented end to end:

    Retained proof packet (PR #1647 body + tests): the issue's full 10-item acceptance matrix is covered by named discriminating tests — authorized_candidate_produces_exactly_one_byte_identical_publication (12/12), every_negative_admission_produces_zero_create_calls (21 named negatives, each asserting zero create/upload calls), captured_bytes_cannot_change_after_validation, partial_publication_requires_explicit_recovery_and_never_clobbers, publish_path_never_rebuilds_or_overwrites, plus the hosted gate + independent-baseline both green on the reviewed head 9320b7e1 and the re-run green gate on the rebased head c55219ba.

    Authorization-field mapping (for #816 freeze and #817's maintainer record): the trusted packet = run id + attempt, both immutable artifact ids, exact packet digest, proposed tag, record/verifier/expiry — mapped 1:1 onto authorized_release.v1's admission inputs (see xtask/src/release_bytes.rs and release_publish.rs on main).

    Known residuals (fail-stop, documented in the review): a draft release beyond the 1000-release survey budget with no tag ref, and a verify_tag→create_release re-point by a repo-write-capable concurrent actor — both strictly smaller than the closed survey→create TOCTOU, both stop rather than overwrite.

    #816 can now freeze a real candidate through this path; #817 remains gated on the separate maintainer authorization. Design deviation retained for review: release_bytes.rs retained_until compares observed artifact-expiry horizon against the packet claim (the producer cannot observe GitHub's computed expiry seconds at packet-write time), with its own dedicated test.

  6. EffortlessSteven commented on Nov 5, 2026

    @EffortlessSteven
    MemberAuthor

    Closing as completed — the production-boundary proof this issue requires is on main.

    Both leaves of the builder graph landed and are green on hosted required checks:

    Proof retained: the 10-item acceptance matrix is covered by named discriminating tests (zero create/upload calls on all 21 named negatives; exactly one byte-identical call on the positive; tamper/collision/outage/partial-replay stop states), hosted gate + independent-baseline green on the reviewed head 9320b7e1, gate re-green on the rebased head c55219ba, and the composition re-verified on merged main. The full handoff (revisions, design, authorization-field mapping for #816/#817) is in the 2026-11-04 handoff comment above.

    Residuals are fail-stop and documented (draft-release survey budget; verify-tag re-point by a repo-write-capable actor) — strictly smaller than the closed survey→create TOCTOU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcodexenhancementepic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions