Skip to content

ci: publish-image pushes, tags and attests the image for a member release tag (060 3.3, workflow) - #498

Merged
bartekus merged 1 commit into
mainfrom
impl/060-publish-image
Nov 4, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/060-publish-image

Conversation

@bartekus

@bartekus bartekus commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Spec 060 increment 4c (3.3, 3.4.2): the publish-image job and image verification in release.yml. Workflow-only (plus 060's record); stacked on #496 (tooling: image-tag, verify-image, tolerant workflow tests) on #494.

  • tag: a new step outputs image_member (release set names the image and the tag is not a candidate) and image (also a pushed release tag), and otherwise emits a notice naming why publish-image is skipped (absent from the release set / candidate / dry run).
  • manifest: also needs image-checks; with the image a member it downloads image-release-* (archives + sidecars) and copies the two image SBOMs from image-evidence, so run-manifest names the image. image-checks gates the manifest only then.
  • publish-image (new, after publish-npm): only job with packages: write (beside contents: read, id-token: write, attestations: write); runs only on needs.tag.outputs.image == 'true'. Installs oras 1.3.6 pinned by tarball SHA-256; checks each archive against its sidecar; rustev-release image-tag fails on a tag naming another index, skips the push when it already names the run's index; otherwise oras cp --from-oci-layout <archive>@<digest> <repo> per platform (no tag), then oras manifest push of the manifest's index bytes under X.Y.Z, then requires the tag to name that index. Attests the index (actions/attest-build-provenance v4.2.2) and each platform with its SBOM (actions/attest-sbom v4.1.0, pinned by commit), push-to-registry: true.
  • github-release follows publish-image whenever the run pushes the image.
  • verify-release: packages: read; when the run pushed the image, rustev-release verify-image and gh attestation verify oci://... (provenance on the index, CycloneDX SBOM on each platform) against the store.
  • No latest tag; nothing changes while the release set lists the image as absent.

Needs the owner's statecraft-review-exception approval (workflow change).

Limitation: the oras steps have not run against ghcr.io (no push is allowed here); a dry run skips publish-image. The first release with the image runs them.

Checks: actionlint passed; cargo test -p rustev-release --locked --test candidate --test release_workflow passed (including publish_image_runs_only_for_a_member_release_tag_after_npm, which now exercises this job); make gate passed.

Review notes (round 1):

  • $TAG in verify-release is defined: the job's env: (unchanged, outside the diff) sets REPO: ${{ github.repository }} and TAG: ${{ github.ref_name }}, which the existing attestation step already uses.
  • publish-image's if now also requires needs.approve.result == 'success'. It was implied before, since publish-npm needs publish-crates, which needs approve; now it is explicit.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff for bugs, security problems, and inconsistencies.

publish-image job: SBOM attestation paths

The manifest job copies the per-platform SBOMs into $RUNNER_TEMP/artifacts/sbom/:

for arch in amd64 arm64; do
  cp "$RUNNER_TEMP/image-evidence/rustev-serve-linux-$arch.oci.tar.cdx.json" "$RUNNER_TEMP/artifacts/sbom/"
done

After the release artifact is downloaded in publish-image to ${{ runner.temp }}/release, those files land at ${{ runner.temp }}/release/sbom/rustev-serve-linux-{amd64,arm64}.oci.tar.cdx.json. The two attest-sbom steps however reference:

sbom-path: ${{ runner.temp }}/release/rustev-serve-linux-amd64.oci.tar.cdx.json
sbom-path: ${{ runner.temp }}/release/rustev-serve-linux-arm64.oci.tar.cdx.json

The sbom/ subdirectory is absent from both paths. The files will not be found and the attestation steps will fail on any run that actually pushes the image.

Other checks passed

  • The tag job's image step logic is correct: candidate → not a member; non-push event → member but no push; push tag + .image present → member + push.
  • The manifest condition (needs.tag.outputs.image_member != 'true' || needs.image-checks.result == 'success') correctly makes image-checks gate the manifest only when the image is a member.
  • The github-release condition correctly requires publish-image.result == 'success' only when image == 'true'.
  • The oras download verifies the tarball SHA-256 before extracting. The --from-oci-layout archive.tar@digest syntax is valid for oras 1.3.6.
  • The needs.approve omission from publish-image's if is covered indirectly: needs.publish-npm.result == 'success' can only hold if approve passed, since publish-npm depends on it.
  • The spec.md narrative accurately describes the workflow behaviour being added.
{"head": "128e3ae9b8dd3cd356b5e804f412a90a7121cd7b", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 962, "summary": "Both attest-sbom steps reference the SBOM files at ${{ runner.temp }}/release/rustev-serve-linux-{amd64,arm64}.oci.tar.cdx.json, but the manifest job places them under $RUNNER_TEMP/artifacts/sbom/, so after the release artifact is downloaded they land at ${{ runner.temp }}/release/sbom/rustev-serve-linux-{amd64,arm64}.oci.tar.cdx.json; the missing 'sbom/' path segment means the files will not be found and attestation will fail on every image push."}]}

Subject: 4d1e758...128e3ae, diff digest b9629f54f0bfc2483984d67e957422594c458c6d46febe8cbafcdaf35164a155, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 22:18 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 128e3ae to fafa869 Compare November 3, 2026 22:28
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Looking at the two changed files, I'll review the workflow logic, path handling, and security properties of the new publish-image job.

Finding: $RUNNER_TEMP/index.json is never created

In publish-image, the OCI index file is referenced at $RUNNER_TEMP/index.json in two places:

# .github/workflows/release.yml, ~line 904
state=$(cargo run --quiet --locked -p rustev-release -- image-tag "$RUNNER_TEMP/release" "$RUNNER_TEMP/index.json")
# ~line 915
oras manifest push --media-type application/vnd.oci.image.index.v1+json "$IMAGE:$VERSION" "$RUNNER_TEMP/index.json"

No step in publish-image creates or downloads a file at $RUNNER_TEMP/index.json. The release artifact is downloaded to $RUNNER_TEMP/release/, and the image archives go to $RUNNER_TEMP/image/. If the OCI index JSON is expected to be part of the release artifact (assembled by the manifest job, which consumes the image-release-* archives), it would land at $RUNNER_TEMP/release/index.json, not at the temp-root path used here. When index.json is absent, rustev-release image-tag and oras manifest push will both fail, breaking every real release push of the image.

No other concrete defects found: the oras 1.3.6 tarball is verified by pinned SHA-256 before execution; all GitHub Actions are pinned to commit SHAs; printf '%s' "$GH_TOKEN" | avoids newline injection in both oras login and docker login; the manifest conditional correctly gates image-checks only when image_member == 'true'; the github-release guard correctly short-circuits on image != 'true' before checking publish-image.result; and the spec's ratification claim is consistent with the increment date recorded in the diff.

{"head": "fafa869f39ff189d082f91ed1b3beac41cdbaa3b", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 904, "summary": "publish-image references $RUNNER_TEMP/index.json in both `rustev-release image-tag` and `oras manifest push`, but no step creates or downloads a file at that path; the index likely lands at $RUNNER_TEMP/release/index.json inside the downloaded release artifact, so both uses will fail on every real image push."}]}

Subject: 4d1e758...fafa869, diff digest 36bef31e6aef8c5c88838cc99f4385759dd770083c92e55861f43440fcc88098, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 22:33 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the impl/060-image-verify branch from 4d1e758 to 6b77919 Compare November 3, 2026 22:34
@bartekus
bartekus force-pushed the impl/060-publish-image branch from fafa869 to 4b34bac Compare November 3, 2026 22:34
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files for concrete defects.

.github/workflows/release.yml

1. $TAG undefined in verify-release image attestation step

The new step ("The registry holds the manifest's image, and its attestations verify") uses --source-ref "refs/tags/$TAG" in both gh attestation verify calls, but TAG is not declared in the job-level env block (which shows only GH_TOKEN and REPO) and is not among the tag job's declared outputs (version, epoch, candidate, image_member, image). If no earlier step in verify-release sets TAG in its environment (none is visible in the diff context), the shell variable expands to the empty string, making --source-ref refs/tags/ an invalid or vacuous filter. That would either cause gh attestation verify to fail outright or to accept attestations without the required tag-scoped source-ref, defeating the provenance check.

2. approve and publish-crates absent from publish-image's if condition

publish-image lists approve and publish-crates in needs but its condition only checks manifest, image-checks, and publish-npm. With !cancelled(), if approve fails while publish-npm happens to succeed (possible if publish-npm does not itself gate on approve), the image would be pushed to the registry without required approval. The spec increment note says the job "follows manifest, approve, image-checks and publish-npm", making the omission of needs.approve.result == 'success' from the guard inconsistent with the stated ordering contract.

specs/060-the-service-image-in-the-release/spec.md

No defects found. The increment notes are internally consistent with the workflow changes.

{"head": "4b34bac11eb8fb1d7211e53d995a6f1b51003437", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 1049, "summary": "$TAG is not defined in the verify-release job env or in the tag job outputs, so --source-ref \"refs/tags/$TAG\" expands to an empty tag name in both gh attestation verify calls, invalidating the source-ref filter."},{"path": ".github/workflows/release.yml", "line": 856, "summary": "publish-image's if condition omits needs.approve.result == 'success', so the image can be pushed even if the approve job fails, contrary to the spec's stated ordering requirement."}]}

Subject: 6b77919...4b34bac, diff digest 59cfc8b70c8ec98b5b16380d8af601d89d80447924a2ef867df1d94fc5c5afd8, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 22:39 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 4b34bac to e16fcb3 Compare November 3, 2026 22:58
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff across .github/workflows/release.yml and specs/060-the-service-image-in-the-release/spec.md.

tag job – image output logic

The shell logic correctly sets member and push outputs for every branch (absent release-set entry, candidate, dry-run, release push). The printf write to $GITHUB_OUTPUT and the conditional notice look correct.

manifest job – image-checks gating

Adding image-checks to needs and the guard (needs.tag.outputs.image_member != 'true' || needs.image-checks.result == 'success') correctly makes image-checks a hard gate only when the image is in the release set. When image_member is false the OR short-circuits regardless of image-checks' result, so a skipped image-checks job does not block manifest.

publish-image job – prerequisite coverage

publish-crates appears in needs but not in the if condition; only publish-npm.result == 'success' is checked. If publish-npm genuinely depends on publish-crates upstream (the layer ordering implies this), the check is transitively correct. The same pattern pre-exists in github-release before this PR, so this is consistent with the existing convention.

oras install – integrity

curl downloads the tarball and immediately checks the hardcoded SHA-256 before tar -xzf. Only the oras binary is extracted. Path is added after verification. Standard and correct.

Push integrity checks

sha256sum -c verifies each OCI archive against its sidecar before any push. After pushing each platform digest, oras manifest fetch --descriptor confirms registry receipt. After pushing the index, image-tag is re-run to assert the tag resolves to the manifest's index – a correct idempotency/integrity postcondition.

SBOM attestation paths

The attest-sbom steps reference ${{ runner.temp }}/release/rustev-serve-linux-{arch}.oci.tar.cdx.json. The manifest job copies these files from image-evidence into the SBOM artifacts directory; those get included in the release artifact that publish-image downloads. The path is consistent with the assembly pattern used elsewhere in the manifest job.

github-release condition

The updated condition correctly gates on publish-image.result == 'success' only when image == 'true', preserving the candidate fast-path and the no-image fast-path.

verify-release additions

packages: read is added specifically for the registry verification step. The docker login before gh attestation verify oci://... is the correct authentication approach for GHCR. The two-loop structure (index provenance + per-platform SBOM) matches what publish-image attested.

Spec document

The increment 4c narrative is internally consistent with the workflow changes. The ratification note is an owner act enforced outside review; the text does not contradict any governance rule visible in the supplied authority documents.

No concrete defects found.

{"head": "e16fcb38d568e68e477b98497a9d26f509408e5f", "verdict": "no-findings", "findings": []}

Subject: 6b77919...e16fcb3, diff digest 387097d59b5c80a3b73571bcd301f99598e46f2370af6078ea75ca11f4f82442, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 23:06 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/060-image-verify branch from 6b77919 to c6f7307 Compare November 3, 2026 23:16
@bartekus
bartekus force-pushed the impl/060-publish-image branch from e16fcb3 to 73d45fb Compare November 3, 2026 23:16
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff for bugs, security issues, and inconsistencies.

publish-image job: publish-crates in needs but absent from if guard

The publish-image job lists publish-crates as a dependency:

needs: [tag, manifest, approve, image, image-checks, publish-crates, publish-npm]

But the if condition only requires publish-npm.result == 'success':

if: >-
  !cancelled() && needs.tag.outputs.image == 'true' && needs.manifest.result == 'success' &&
  needs.approve.result == 'success' && needs.image-checks.result == 'success' &&
  needs.publish-npm.result == 'success'

If publish-crates fails (e.g. a crate is rejected mid-publication) while publish-npm succeeds, publish-image runs anyway and pushes the OCI image, leaving the release in a state where the image is public but one or more crates are absent from crates.io. The layered model (spec 060 3.3: "layer 7 after layer 6") treats crates and npm publication as the same gate; the image should not advance until both succeed. publish-crates should be added to the if guard alongside publish-npm, or removed from needs with an explanation that it is not a gate.

No other concrete defects were found. The oras pinning (SHA-256 on the tarball), the state-based idempotency guard, the manifest's image-checks gate, and the github-release sequencing all look correct.

{"head": "73d45fbc054c0a4ebb5d20fbeb5ece020748f5e2", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 856, "summary": "`publish-image`'s `if` condition does not require `needs.publish-crates.result == 'success'`, so the image can be pushed to the registry even when crates publication has failed, leaving the release in a partially-published state that contradicts the layered release model."}]}

Subject: c6f7307...73d45fb, diff digest 397c41da78936754578be958e7da6048c695e7856757dc90aaef33db7a5c5751, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 23:28 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/060-image-verify branch from c6f7307 to 0b88a35 Compare November 4, 2026 00:31
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 73d45fb to c3e04ec Compare November 4, 2026 00:32
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files for bugs, security problems, and inconsistencies against the governance context.

.github/workflows/release.yml

The publish-image job lists publish-crates in needs but its result is absent from the if guard:

needs: [tag, manifest, approve, image, image-checks, publish-crates, publish-npm]
if: >-
  !cancelled() && needs.tag.outputs.image == 'true' && needs.manifest.result == 'success' &&
  needs.approve.result == 'success' && needs.image-checks.result == 'success' &&
  needs.publish-npm.result == 'success'

With !cancelled() as the base, a failed publish-crates does not block this job from running. The image would be pushed to ghcr.io and attested while crates remain unpublished on crates.io, leaving the release set in an inconsistent state. The existing github-release job applies the same pattern (gates on publish-npm but not publish-crates), but the consequence there is merely a GitHub Release page being created; here it is an irreversible write to the package registry that verify-release would then confirm as valid.

specs/060-the-service-image-in-the-release/spec.md

The increment 4c prose is internally consistent with the workflow changes and correctly describes the gating logic. No contradictions with the constitution or contract are present in the diff.

{"head": "c3e04ec95f5b8cee96e8e44162bad6524cccba12", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 855, "summary": "publish-image's `if` condition does not check needs.publish-crates.result, so a crates publication failure does not prevent the image from being pushed and attested, leaving the release in an inconsistent state."}]}

Subject: 0b88a35...c3e04ec, diff digest 397c41da78936754578be958e7da6048c695e7856757dc90aaef33db7a5c5751, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 4, 2026 00:49 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/060-image-verify branch from 0b88a35 to 4243807 Compare November 4, 2026 02:38
@bartekus
bartekus force-pushed the impl/060-publish-image branch from c3e04ec to 60367c9 Compare November 4, 2026 02:39
@bartekus
bartekus force-pushed the impl/060-image-verify branch from 4243807 to b0aa35d Compare November 4, 2026 02:44
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 60367c9 to 5984967 Compare November 4, 2026 02:44
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files for concrete defects.

.github/workflows/release.yml

The publish-image job's ordering of its registry-state check vs. its credential step is problematic.

The step "The tag is absent or already the run's index; another fails (060 3.3.3)" calls cargo run -p rustev-release -- image-tag to query whether $IMAGE:$VERSION exists in ghcr.io. Its evident purpose is to distinguish absent / present-matching / present-conflicting, which requires a registry round-trip. The oras login that provides OCI credentials only appears in the next step — and only when the state output is absent. The spec text in increment 4c explicitly states: "A new organization package on ghcr.io starts private; the owner decided on 2026-11-03 to make ghcr.io/statecrafting/rustev-serve public by hand after its first push." On the first (and only) run where publish-image can push, the package is private, oras login has not yet executed, and image-tag would receive a 401 from the registry rather than an 'absent' state. This breaks the first push.

The manifest job unconditionally adds image-checks to needs, meaning manifest always waits for image-checks even when image_member is false (image absent from the release set). This is a performance trade-off, not a correctness bug, and appears intentional given the conditional if gate.

The publish-image if condition omits needs.publish-crates.result == 'success' despite publish-crates appearing in needs. The spec text ("requires each of them [manifest, approve, image-checks, publish-npm] to have succeeded") confirms this is intentional.

The oras SHA-256 66fb0ad7206f3f6fa77ed5b552049d364ccf4b50b1684554f731f76302b52ca0 is 64 hex characters and correctly formatted.

No injection risks found in the shell scripts; GH_TOKEN is piped via printf '%s', jq outputs are used in comparisons, and all variables derive from trusted workflow context.

specs/060-the-service-image-in-the-release/spec.md

The increment 4c narrative matches the workflow changes. No inconsistencies between the spec text and the workflow found beyond the authentication ordering issue already noted.

{"head": "5984967c8ea4eb01f788bad769acce18f5f2e943", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 896, "summary": "The `image-tag` state check queries the private ghcr.io registry before any `oras login`; the credential step runs only conditionally in the next step (guarded by state == 'absent'), so on the first push—when the package is private per the spec—the state check will fail with 401 instead of returning 'absent', preventing the push from ever proceeding."}]}

Subject: b0aa35d...5984967, diff digest 397c41da78936754578be958e7da6048c695e7856757dc90aaef33db7a5c5751, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 4, 2026 03:05 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff for bugs, security issues, and inconsistencies.

publish-image condition gap

The new publish-image job lists both publish-crates and publish-npm in its needs array, but the if condition checks only needs.publish-npm.result == 'success':

needs: [tag, manifest, approve, image, image-checks, publish-crates, publish-npm]
if: >-
  !cancelled() && needs.tag.outputs.image == 'true' && needs.manifest.result == 'success' &&
  needs.approve.result == 'success' && needs.image-checks.result == 'success' &&
  needs.publish-npm.result == 'success'

needs.publish-crates.result is never evaluated. If publish-crates and publish-npm are independent (i.e., publish-npm does not itself depend on publish-crates), publish-image can proceed after a failed crates publication, violating the stated "layer 7 after layer 6" ordering. Even if publish-npm does depend on publish-crates in the existing workflow, the absence of an explicit guard is an inconsistency between the needs list and the if condition, and a future change to that dependency could silently break the invariant.

Everything else

  • The tag job's image-decision step correctly handles all four cases (absent from release set, candidate, dry run, release push) and sets both outputs before they are consumed downstream.
  • The manifest job's new if condition correctly makes image-checks a hard requirement only when image_member == 'true'.
  • The github-release condition is correctly updated to block on publish-image when image == 'true'.
  • oras 1.3.6 is downloaded over HTTPS and verified by an inline SHA-256 digest before extraction; this is correct.
  • The oras cp --from-oci-layout / oras manifest push / post-push assertion sequence correctly implements the idempotent push logic described by the spec.
  • The attest-build-provenance and two attest-sbom steps run unconditionally in publish-image (not gated on state == 'absent'), which matches the spec's "a rerun attests again, which only adds" intent.
  • The verify-release attestation loop uses jq -r without shell word-splitting hazards; gh attestation verify is correctly parameterised with --signer-workflow and --source-ref.
  • The spec increment text is internally consistent with the workflow changes.
{"head": "5984967c8ea4eb01f788bad769acce18f5f2e943", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 860, "summary": "publish-image's `if` condition checks `publish-npm.result` but omits `publish-crates.result`, leaving a gap where the image can be pushed after a failed crates publication if the two publication jobs are not strictly sequenced."}]}

Subject: b0aa35d...5984967, diff digest 397c41da78936754578be958e7da6048c695e7856757dc90aaef33db7a5c5751, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 4, 2026 04:38 — with GitHub Actions Error
Base automatically changed from impl/060-image-verify to main November 4, 2026 09:22
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 1470e89 to b25e8f4 Compare November 4, 2026 09:23
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files for concrete defects.

.github/workflows/release.yml — publish-image if-condition omits publish-crates

The publish-image job lists publish-crates in its needs array but never checks needs.publish-crates.result == 'success' in the if condition:

needs: [tag, manifest, approve, image, image-checks, publish-crates, publish-npm]
if: >-
  !cancelled() && needs.tag.outputs.image == 'true' && needs.manifest.result == 'success' &&
  needs.approve.result == 'success' && needs.image-checks.result == 'success' &&
  needs.publish-npm.result == 'success'

publish-npm is explicitly required; publish-crates is not. Because !cancelled() is the only failure-permitting guard, a failed publish-crates does not block the image push: the job would still satisfy the if expression and proceed to push the OCI image to the registry. The workflow header (line ~43) and the spec both describe publish-image as "layer 7 after layer 6" — where layer 6 is "idempotent publication … through crates.io and npm". Publishing the image while crates are unpublished contradicts that ordering and would leave a release in a partially-published state with no blocking signal.

No other concrete defects are supported by the evidence in the diff.

{"head": "b25e8f4bb26af97507c8127fe3e997677a8a4883", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 858, "summary": "publish-image lists publish-crates in needs but does not check needs.publish-crates.result == 'success' in the if condition, so a failed crates publication does not block the image push, violating the layer-7-after-layer-6 ordering."}]}

Subject: 294c40d...b25e8f4, diff digest 4f32275859c0c4f5f0b29b3fdc060f455f016ecbf6215102fbb7a2c81a321e68, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 4, 2026 09:27 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/060-publish-image branch 2 times, most recently from a29eceb to 07e58c4 Compare November 4, 2026 09:29
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files for bugs, security problems, and inconsistencies.

.github/workflows/release.yml — publish-image job and related additions

The new tag → image/image_member logic, the oras installation with SHA-256 pinning, the idempotency check via rustev-release image-tag, the OCI-layout copy-by-digest flow, and the manifest/publish-image/github-release condition chaining all look structurally correct.

verify-release — concrete defect found

The new step added to verify-release:

- name: The registry holds the manifest's image, and its attestations verify (060 3.4.2)
  if: needs.tag.outputs.image == 'true'

references needs.tag.outputs.image, but verify-release's needs list is unchanged and only contains [github-release]. In GitHub Actions, needs.<job>.outputs is only populated for jobs declared in the job's own needs array; referencing any other job ID yields an empty string rather than an error. As a result, needs.tag.outputs.image == 'true' permanently evaluates to '' == 'true' → false, and the step is silently skipped on every run — including real pushes where the image was actually published. The image-registry verification and all three gh attestation verify calls (index provenance + both platform SBOMs) are therefore never exercised, contrary to spec §3.4.2.

To fix: add tag to verify-release's needs list (and check that the resulting dependency ordering is still sound), or pipe the image flag through github-release's outputs and reference it as needs.github-release.outputs.image.

No other concrete defects were found. The spec prose in specs/060-the-service-image-in-the-release/spec.md accurately describes the workflow additions.

{"head": "07e58c4e1cbedff14047c5d95ca581ca4bbb8a85", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 1041, "summary": "The verify-release step conditioned on `needs.tag.outputs.image == 'true'` is permanently skipped because `tag` is not listed in verify-release's `needs` ([github-release] only), so the output resolves to an empty string and the image registry/attestation checks never run."}]}

Subject: 294c40d...07e58c4, diff digest 47a48475d6b68d593aea32c7e94b28db0dec0b7b5a79e324fcdc5949c9d99101, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 4, 2026 09:40 — with GitHub Actions Inactive
@bartekus

bartekus commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Review note on 07e58c4: the verify-release finding is a false positive. The job declares needs: [tag, github-release] (.github/workflows/release.yml line 989), so needs.tag.outputs.image resolves and the image check runs for a release whose set names the image. No change.

@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 4, 2026
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 07e58c4 to 8963aca Compare November 4, 2026 10:52
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files for bugs, security problems, and inconsistencies.

.github/workflows/release.yml

The publish-image job, manifest condition changes, and verify-release additions all look consistent with one another — with one concrete defect:

The new step added to verify-release guards itself with if: needs.tag.outputs.image == 'true'. However, verify-release's needs: list is not changed by this PR — the diff context shows it remains needs: [github-release], with tag absent. In GitHub Actions, needs context is only populated for jobs directly listed in needs; transitive outputs are not propagated. Therefore needs.tag.outputs.image evaluates to empty string, the condition is permanently false, and the image verification step (The registry holds the manifest's image, and its attestations verify (060 3.4.2)) can never execute.

The fix is to add tag to verify-release's needs list alongside github-release.

Everything else reviewed:

  • manifest if condition correctly gates image-checks only when image_member == 'true' (skipped jobs result in 'skipped', not 'success', so the guard is sound).
  • publish-image condition transitively covers image via the required image-checks.result == 'success'.
  • oras 1.3.6 is downloaded over HTTPS and its tarball verified against a pinned SHA-256 before extraction; only the oras binary is extracted from the archive.
  • The idempotency logic (state == 'absent' skips push; attestations always run and "only add") matches the spec.
  • All third-party action pins use full commit SHAs.
  • github-release condition correctly threads publish-image.result for the image-member case.

specs/060-the-service-image-in-the-release/spec.md

Increment 4c prose is consistent with the workflow changes, including the ratification note dated 2026-11-03 (A-76). The text matches what the workflow does, except it does not mention the verify-release needs-list omission described above.

{"head": "8963aca53bc749b2221539d00777690f0b511194", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 1040, "summary": "The new image-verification step in `verify-release` conditions on `needs.tag.outputs.image == 'true'`, but `tag` is not in `verify-release`'s `needs` list, so the output is inaccessible and the step is permanently skipped."}]}

Subject: 185713b...8963aca, diff digest 05e56ed1ea0fb84a4f9ca5dad567ec2a34fa47f7fff4e0f9852270936f616d60, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 4, 2026 11:01 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 8963aca to 8244bff Compare November 4, 2026 12:18
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files: release.yml (new publish-image job and related plumbing) and specs/060-the-service-image-in-the-release/spec.md (increment 4c narrative).

tag job — image step logic

The three-branch decision tree (member/push) is correct. When .image is absent from release-set.json, jq -e exits non-zero and the negation fires. The candidate branch uses [ "$CANDIDATE" = true ] which correctly treats an empty string (non-push event where the prior step didn't run) as false, so a workflow-dispatch falls through to the dry-run branch. No issue.

manifest job — new if: condition

Adding image-checks to needs without an if: guard would have caused manifest to be skipped whenever image-checks fails on runs where the image is absent. The explicit if: condition (needs.tag.outputs.image_member != 'true' || needs.image-checks.result == 'success') is both necessary and correct.

publish-image job

  • oras 1.3.6 downloaded over HTTPS and SHA-256 verified before execution (66fb0ad7...). Correct.
  • Archive integrity verified against sidecar before push (060 I-1 step). Correct.
  • image-tag state check gates the OCI push; re-runs only add attestations. Consistent with spec 058 3.5 / 060 3.3.3.
  • oras cp --from-oci-layout <archive>@<digest> pushes by content-address without an intermediate tag; then oras manifest push tags the index. Idempotency assertion follows. Correct.
  • attest-build-provenance on the index digest; attest-sbom on each platform digest. push-to-registry: true on all three. Correct.

github-release condition

For a non-candidate release the new condition requires both publish-npm and (when image == 'true') publish-image to have succeeded before the release is created. Correct.

verify-release additions

packages: read added for registry access. The image verification step is guarded by if: needs.tag.outputs.image == 'true'. For this guard to evaluate correctly, tag must be in verify-release's needs; the diff adds neither tag to that job's needs list nor any other step in verify-release that would fetch and re-export the output. If tag was already in verify-release's needs before this PR, the guard works; if not, needs.tag.outputs.image is always empty and the image verification step silently never executes, defeating 060 3.4.2.

The diff does not update verify-release's needs, and the original job's if: only references needs.github-release, making it unlikely that tag was already a direct dependency. This is the one concrete concern: the image verification in verify-release could be dead code on every push.

{"head": "8244bffd015140bc0dc6d80083696850efbfaf11", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 1042, "summary": "The verify-release job's new image-verification step conditions on needs.tag.outputs.image, but the diff does not add tag to verify-release's needs list; if tag is not a direct dependency, the output evaluates to empty string and the step never executes, silently skipping the 060 3.4.2 registry check on every image push."}]}

Subject: b8a8cd8...8244bff, diff digest b037351035d56310faa34b6d95f71a1b75a3089aa50546f754606c5f39fc701d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 4, 2026 12:24 — with GitHub Actions Inactive
@bartekus

bartekus commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Review note on the AI finding at .github/workflows/release.yml line 1042 (verify-release reading needs.tag.outputs.image).

Not a defect: verify-release declares needs: [tag, github-release] (line 991), so tag is a direct dependency and needs.tag.outputs.image resolves. The step runs whenever the tag job reports an image member.

@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 4, 2026
…sts it, only for a member release tag (060 3.3, 3.4.2, workflow)
@bartekus
bartekus force-pushed the impl/060-publish-image branch from 8244bff to 1aa9ad8 Compare November 4, 2026 18:59
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (findings)

Review of PR 1aa9ad8

This PR implements increment 4c of spec 060: wiring the publish-image job, the conditional image_member/image outputs on tag, and the corresponding verify-release additions.


Finding 1 — publish-image: $RUNNER_TEMP/index.json is never placed at that path

File: .github/workflows/release.yml
Lines: the state step (~line 905) and the push step (~line 919, 930)

The job downloads artifacts to two directories:

  • release → $RUNNER_TEMP/release/
  • image-release-* → $RUNNER_TEMP/image/

Both the rustev-release image-tag calls and the oras manifest push command reference $RUNNER_TEMP/index.json:

state=$(cargo run ... image-tag "$RUNNER_TEMP/release" "$RUNNER_TEMP/index.json")
...
oras manifest push ... "$IMAGE:$VERSION" "$RUNNER_TEMP/index.json"
test "$(cargo run ... image-tag "$RUNNER_TEMP/release" "$RUNNER_TEMP/index.json")" = present

Nothing downloads or generates a file at $RUNNER_TEMP/index.json. If the OCI index JSON is part of the release artifact (the most natural home given run-manifest produces it), it would land at $RUNNER_TEMP/release/index.json. Both the pre-push state check and the actual push would fail with file-not-found.


Finding 2 — publish-image: image SBOM files are not downloaded before attest-sbom

File: .github/workflows/release.yml
Lines: the two actions/attest-sbom steps in publish-image

The attestation steps expect:

sbom-path: ${{ runner.temp }}/release/rustev-serve-linux-amd64.oci.tar.cdx.json
sbom-path: ${{ runner.temp }}/release/rustev-serve-linux-arm64.oci.tar.cdx.json

In the manifest job the per-platform image SBOMs are sourced from the image-evidence artifact (downloaded to $RUNNER_TEMP/image-evidence/) and copied into $RUNNER_TEMP/artifacts/sbom/, which is uploaded as the sbom artifact — not the release artifact. publish-image downloads only release and image-release-*; it never downloads image-evidence or sbom. If run-manifest does not independently bundle these SBOM files into the release artifact, the attest-sbom steps fail with file-not-found, leaving the platforms unattested while the index provenance attestation has already been pushed.


No governance or spec-contract violations were found: the spec frontmatter is approved, the increment note is consistent with the workflow changes, and the lifecycle rules are respected.

{"head": "1aa9ad842d2648d32381931fbc4684af6d858eb6", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 905, "summary": "publish-image references $RUNNER_TEMP/index.json in both image-tag calls and oras manifest push, but no download step places a file at that path — the release artifact is downloaded to $RUNNER_TEMP/release/, making the correct path $RUNNER_TEMP/release/index.json."}, {"path": ".github/workflows/release.yml", "line": 960, "summary": "The attest-sbom steps expect per-platform image SBOMs under $RUNNER_TEMP/release/ but publish-image never downloads the image-evidence or sbom artifact where those files actually reside, so the attestation steps will fail with file-not-found unless run-manifest independently bundles them into the release artifact."}]}

Subject: 4ab94eb...1aa9ad8, diff digest 6a568e926ad3afd9d3ce03ca5cbea40e7d0e8a7adda8677705ec1d50f3fa9f99, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 4, 2026 19:03 — with GitHub Actions Inactive
@bartekus

bartekus commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Review note on the two AI findings at 1aa9ad8 (.github/workflows/release.yml lines 905 and 960).

  1. $RUNNER_TEMP/index.json is not downloaded; it is written. rustev-release image-tag <release-dir> <index-out> writes the manifest's index bytes to its second argument (image_tag_cmd, tools/rustev-release/src/main.rs 1151-1162) before comparing the registry tag, so the oras manifest push that follows reads the file the state step just wrote.
  2. The image SBOMs are in the release artifact. The manifest job copies both rustev-serve-linux-*.oci.tar.cdx.json into artifacts/sbom/ (line 684); run-manifest names them as manifest artifacts (family_artifacts.rs, the .oci.tar.cdx.json arm), and the release directory step copies every .artifacts[].name flat into dist/release, which is uploaded as release and downloaded by publish-image to $RUNNER_TEMP/release/.

The restack onto #501 left this workflow's diff byte-identical to the reviewed 8244bff.

@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit b4ff957 Nov 4, 2026
38 checks passed
@bartekus
bartekus deleted the impl/060-publish-image branch November 4, 2026 21:14
bartekus added a commit that referenced this pull request Nov 5, 2026
…0 3.1) [held for owner decision] (#499)

Spec 060 increment 5 (3.1): membership. DRAFT, DO NOT MERGE until the
owner decides 060 decision 2 and the other prerequisites below hold.

- `tools/rustev-release/release-set.json` names the image under `image`
(`ghcr.io/statecrafting/rustev-serve`, `linux/amd64`, `linux/arm64`) and
drops its `absent` entry. This is the switch that makes the next release
name the image in its manifest, gate its scan through
`image-exceptions.json`, push and attest it (`publish-image`), verify it
and qualify it.
- Tests that are not about the image (`tests/family.rs`,
`tests/tagged.rs` fixtures) set `image` to none; `tests/npm.rs` and
`tests/image.rs` no longer read an image absence from the committed set.

Prerequisites before merging:
1. The base move to `gcr.io/distroless/cc-debian13:nonroot` (#502),
decided by the owner on 2026-11-03.
2. The owner's ruling on each of the 44 findings on that base (one
decision row and one `image-exceptions.json` entry per (id, package), at
most 90 days). With the image a member, any uncovered finding fails
`image-checks`.
3. The image qualification of 060 3.4.3 as amended (#500 harness, #501
workflow).
4. Spec 042 is complete (#477), so 3.1.1's condition holds. The owner
makes the ghcr package public after the first push.

Stacked on #498 (on #496, #494).

Checks: `cargo test -p rustev-release --locked` passed (all binaries);
`make gate` passed.

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 1aa9ad84 Deployed Nov 4, 2026 by bartekus via review-exception #3357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

statecraft:stacked-ci Run the full CI matrix on a stacked pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant