Skip to content

impl(042): the image built, checked and scanned in the release workflow - #459

Merged
bartekus merged 1 commit into
mainfrom
impl/042-image-build
Nov 3, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/042-image-build

Conversation

@bartekus

@bartekus bartekus commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Builds the rustev-serve image of spec 042 3.16 in the release workflow, twice per platform, and checks, compares, describes and scans it, with no push. This closes 042's image acceptance item ("builds for linux/amd64 and linux/arm64 as non-root under spec 031's candidate workflow"). The owner decided on 2026-11-02 that 0.4.0 ships without the image, so it stays absent in the release set.

Change

  • tools/rustev-release/artifacts.sh gains four commands:
    • build-image <platform> <out> <epoch>: no cache, a fresh BuildKit builder pinned by digest (moby/buildkit:v0.34.0), the commit's source date with layer timestamps clamped to it, an OCI archive, then image/check.sh on the loaded image.
    • compare-image <a> <b>: the two archives of each platform must be identical. A difference lists every differing archive entry and fails.
    • sbom-image <dir> <epoch>: a CycloneDX 1.5 SBOM per platform archive (syft 1.54.1), plus the crate's own (cargo-cyclonedx 0.5.9).
    • scan-image <dir>: cargo deny 0.20.2 over rustev-serve with the release policy, and grype 0.120.1 over each platform SBOM.
      • Advisories, licenses and sources gate.
      • Bans (duplicate versions, version-less path dependencies) and grype findings are recorded and gate only once the release set makes the image a member. Bans belong to admitting the crate.
      • grype runs with an explicit config of its own and GRYPE_FAIL_ON_SEVERITY cleared, so no repository, home or XDG config can add a fail-on setting. A non-zero exit is a tool error, never a finding.
  • .github/workflows/release.yml:
    • image builds the release and rebuild archives on native runners (ubuntu-24.04, ubuntu-24.04-arm).
    • image-checks runs the comparison, the SBOMs and the scan, and uploads the evidence.
    • syft and grype are downloaded by version and checked against their published SHA-256.
    • No job gains a permission. Nothing is attested or pushed (058 3.3.4). No publication job needs these jobs, but a failure still fails the run.
    • qualify stays the last job (058 3.4.2, checked by tests/release_workflow.rs). It now also needs image-checks. Its if: reads only verify-release, so an image failure doesn't hold back qualification.
  • release-set.json: the image's absence reason now says why it is absent.
  • Specs 042 (increment 9) and 031 record the change. status: and implementation: are unchanged.

Evidence

  • Local, linux/arm64: two builds on independent builders gave byte-identical archives, and check.sh passed.
  • Dry run 41566109051, all image jobs green:
    • Every platform was built twice on separate runners with identical archives (amd64 ce15f7e2…, arm64 f9cbe36c…), and check.sh passed on both.
    • cargo deny: advisories, licenses and sources pass. Bans (2 duplicate versions, 5 wildcard path deps, first seen in run 41557841721) are recorded.
    • grype: 61 findings per platform, recorded.
  • grype over the pinned distroless/cc-debian12 base reports 61 findings on arm64 (libc6, libssl3, the gcc-12 runtime). These are recorded, not gating, while the image is absent. Before the image can be a member, two things are needed: a newer base digest, which clears the libssl3 fixes, and an owner-approved, expiry-bounded exception rule for the rest. Both go with draft spec 060 (spec(060): the service image in the release (amends 031 and 058) #458), which proposes the push for 0.4.1.

Approval

This edits .github/workflows/release.yml, so it needs the owner's approval of the statecraft-review-exception Environment once.

Checks

  • make gate
  • bash scripts/check-authored-content.sh
  • make code
  • sh -n tools/rustev-release/artifacts.sh

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (findings)

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

tools/rustev-release/artifacts.sh — scan-image case, first grype call

grype -q "sbom:$sbom" -o json --file "$dir/rustev-serve-linux-$arch.vulnerabilities.json"
grype -q "sbom:$sbom" -o table || true

Grype exits with a non-zero status code when it finds vulnerabilities above its default threshold, not only on errors. The second call suppresses this with || true (correctly), but the first — the one that writes the JSON file — does not. Without global set -eu in the script this is currently benign (grype still writes the file before exiting, and without errexit execution continues), but the inconsistency is a latent defect: if set -eu is ever added to artifacts.sh (a natural hardening step), the for loop body exits early on the first platform with any finding, the total count is not accumulated, and the step fails for the wrong reason rather than reporting findings and continuing per spec 031 3.9.2's stated intent.

tools/rustev-release/artifacts.sh — compare-image usage string vs. argument check

test "$#" = 3 || fail 'compare-image <release-dir> <rebuild-dir>'

The check and the invocation (sh artifacts.sh compare-image $a $b → $#=3) are consistent, but the error message names only two arguments while the correct invocation requires three positional parameters ($0 + two paths). This would mislead a caller who sees the error and supplies the correct two-argument form — they'd get the same error again. Minor but concrete.

Overall structure and security

The BuildKit image is pinned by digest; syft and grype are downloaded with version-pinned filenames and sha256sum-verified before extraction; the qualify job's conditional design (waits for image-checks without depending on its result) matches the stated spec 058 3.4.2 intent and is internally consistent. The spec text additions in 031 and 042 accurately describe the workflow implementation. No hash truncation or other digest issues observed.

{"head": "69a7cf5db11d313fd2ab3952acae67c50f0078c8", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "In scan-image, the first grype call (JSON output) lacks || true: grype exits non-zero when findings exist, so under set -e the loop aborts early and the total count is wrong, defeating the non-gating intent of 031 3.9.2."}, {"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "compare-image error message says two arguments but the correct invocation needs three positional parameters, misleading callers who see the usage string."}]}

Subject: 9fca258...69a7cf5, diff digest 70e37f44054ffc3296f23b5c649b8ce596abbed4d9e7e3c71ff0a69160980967, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 2, 2026 23:56 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch 3 times, most recently from b611674 to da015fc Compare November 3, 2026 00:41
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Looking at the diff, I'll focus on the shell script logic in artifacts.sh, the workflow configuration, and spec consistency.

tools/rustev-release/artifacts.sh — scan-image case

The grype call that writes the JSON output file does not suppress its exit code:

grype -q "sbom:$sbom" -o json --file "$dir/rustev-serve-linux-$arch.vulnerabilities.json"
grype -q "sbom:$sbom" -o table || true

grype exits non-zero (exit code 1) whenever it finds vulnerabilities, regardless of output format. The second invocation (table output) correctly uses || true to prevent aborting, but the first — the one that actually produces the file consumed by the Python count logic — does not. If set -e is active when the script runs (which is typical for release scripts and consistent with the set -eu used in the CI step that calls this), any vulnerability finding will abort the script before the count and the "not gating while absent" check can execute. This contradicts the stated and spec-documented intent (031 3.9.2, 042 increment 9): that findings are recorded without failing while the release set lists the image as absent. The || true was clearly intentional (the author applied it to the grype table call) but was placed on the wrong invocation.

No other concrete defects were found. The qualify job's if condition correctly reads only verify-release while listing image-checks in needs, which produces the stated behaviour (image failure fails the run without blocking qualification). The release-set.json member-detection logic and the tool download/hash-check are consistent with their spec descriptions.

{"head": "da015fc109077561762fb29b1a3b41526286f06e", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "In scan-image, the first grype invocation (writing the JSON file) lacks || true, so any vulnerability finding exits the script before the count and the 'not gating while absent' check run, defeating the 031 3.9.2 intent that findings are recorded without failing while the image is absent."}]}

Subject: 41b490d...da015fc, diff digest 970ca564d74545712a9c68648fd053db22bedadea575a0731aaec85b02f06496, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 00:54 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the impl/042-image-build branch from da015fc to 11b0847 Compare November 3, 2026 01:09
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reading through the diff carefully across all five changed paths.

.github/workflows/release.yml

The image matrix job is correct: run: [release, rebuild] × arch: [amd64, arm64] produces four jobs, each uploading to a distinct artifact name (image-$run-$arch). The image-checks step then downloads image-release-* → dist/image and image-rebuild-* → dist/image-rebuild with merge-multiple: true; since the two architectures produce differently-named files, there is no collision.

The qualify dependency ordering is consistent with the stated intent: qualify lists image-checks in needs but its if only checks needs.verify-release.result == 'success'. When image fails, image-checks is skipped (GitHub Actions skips dependents of failed jobs absent an explicit if); qualify still runs because !cancelled() is true for skipped dependents. The overall run is still marked failed from the image matrix job. This matches the spec description in both 031 and 042.

tools/rustev-release/artifacts.sh

  • build-image: argument count check ($# = 4) matches the four positional args. The epoch_check call is present in the existing code. BuildKit is pinned by digest. The trap ordering (create builder → set EXIT trap) is safe since trap is a builtin. The loaded image ID extracted via sed -n 's/^Loaded image ID: //p' is then passed to check.sh; a single Docker tar produces exactly one such line in practice.
  • compare-image: $# = 3 is correct (subcommand + 2 dirs). failed flag logic and arch loop look correct. eval "src=\$$side" is safe here because $a/$b are hardcoded workflow paths, not user-supplied input.
  • sbom-image: version checks match the pinned tool versions installed in the workflow step. cargo cyclonedx writes to integrations/rustev-serve/rustev-serve.cdx.json and is cp-ed for each arch; the two invocations run sequentially and overwrite the intermediate file before copying, which is correct.
  • scan-image: env -u GRYPE_FAIL_ON_SEVERITY prevents grype from gating; non-zero exit is treated as a tool error. The member-detection python one-liner correctly uses && so that if python exits 0 (image found in absent) member=no; if it exits 1 or errors, member stays yes (conservative). Gating logic for absent vs. member is sound and consistent with spec.

tools/rustev-release/release-set.json — reason string updated to reflect the new workflow reality; no structural change.

Spec changes — 031 and 042 narrative additions accurately describe the implementation (native runners per arch, two builds compared byte-for-byte, syft/grype pinned by version and hash, image absent from the release set, qualify waiting without gating on image result).

No concrete defects found.

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

Subject: 41b490d...11b0847, diff digest 8f60f73e248ea6f8732ffb9e77d476a43ad5cbdd9c7aac5c95c107ee3ddf44d0, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 01:39 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch from 11b0847 to 1fc0d96 Compare November 3, 2026 02:26
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the five changed paths for bugs, security issues, and inconsistencies.

.github/workflows/release.yml

The qualify job now has needs: [tag, verify-release, image-checks] with an if that only gates on needs.verify-release.result == 'success'. The !cancelled() guard means qualify will run even when image-checks fails, which is the documented intent (spec 031 §3.9, AGENTS.md "qualify waits for them without depending on their result"). The overall run fails independently because image-checks failed. Logic is correct.

Action pin versions: upload-artifact is pinned at a v7 SHA, while download-artifact is pinned at a v8 SHA. Cross-major-version upload/download is supported by GitHub but worth confirming these match what the rest of the file uses; the diff alone does not show surrounding jobs for comparison.

tools/rustev-release/artifacts.sh

In the compare-image subcommand, the loop that hashes both builds uses:

for side in a b; do
  mkdir -p "$scratch/$arch/$side"
  eval "src=\$$side"

$side is always the literal string "a" or "b" from the hardcoded loop, so the eval always expands to src=$a or src=$b. However, $a and $b are set directly from the caller's second and third arguments (a=$2 b=$3). If a path argument ever contains shell metacharacters such as $(…) or backticks, the eval will execute them. A safe, equivalent replacement is a case statement:

case "$side" in a) src=$a ;; b) src=$b ;; esac

This is a real code defect: eval is used where it is never needed and creates a code-execution surface from external input.

SHA-256 values for syft and grype in the image-checks job are each 64 hex characters and are verified with sha256sum -c - immediately after download. The download URL follows the pattern https://github.com/anchore/$name/releases/download/v$version/$file, which is the canonical release path. I cannot independently verify the digest values, but the verification mechanism is sound.

scan-image member-detection logic correctly sets member=no when the release-set lists the image kind as absent, and the gating logic for bans and scan findings flows consistently from that flag. No logical error found.

Spec changes in 031 and 042 accurately describe the implemented workflow steps. The version numbers, tool names, and behavioral descriptions match what is coded.

tools/rustev-release/release-set.json — clean reason-string update, no structural change.

{"head": "1fc0d961f80e60e9583b406a3001677bc1e6d930", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "compare-image uses eval to dereference $a/$b from caller-supplied path arguments; if those paths contain shell metacharacters the eval will execute them — replace with a case statement."}]}

Subject: 41b490d...1fc0d96, diff digest 0473dd9129f128802404bebf4170f5eb3e37ab195ad90ac7c8f0ea8dbac8d04f, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 02:33 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch from 1fc0d96 to 8f77883 Compare November 3, 2026 02:40
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reading the diff carefully for bugs, security issues, and inconsistencies against the governance context and spec documentation.

.github/workflows/release.yml

The image matrix uses distinct artifact names per {run, arch} combination, so no upload collision. The qualify condition correctly uses !cancelled() rather than !failure() so it runs when image-checks fails (failing the run overall) but is skipped if the run is cancelled — matching the documented intent.

tools/rustev-release/artifacts.sh — build-image

The docker load output is parsed with sed -n 's/^Loaded image ID: //p'. If the image has a repository/tag embedded in the Docker-format archive, docker load would print Loaded image: name:tag rather than Loaded image ID: sha256:…, leaving id empty and failing the check. This is a fragility but unlikely to bite because the buildx --output type=docker invocation carries no --tag, so the archive is tag-less. Not flagging as a concrete defect given the controlled build context.

tools/rustev-release/artifacts.sh — scan-image

Concrete defect: the bans failure message references the wrong spec. The comment above the bans check explicitly attributes it to 031 3.1 (admission to the family) and 031 3.9.2 (scan policy). The informational path also prints 031 3.9.2. But the gating failure message says '021 3.6: rustev-serve fails the bans policy' — the same spec reference used for the generic advisories licenses sources audit, which is not what governs bans here.

if ! deny bans; then
  test "$member" = no || fail '021 3.6: rustev-serve fails the bans policy'   # ← should be 031 3.9.2
  echo '031 3.9.2: rustev-serve fails the bans policy; recorded, not gating ...'
fi

tools/rustev-release/artifacts.sh — compare-image

find . -type f | sort | xargs sha256sum is safe for OCI archive contents (paths like blobs/sha256/<hex>, manifest.json, index.json) and the sequential cp-then-overwrite of the crate SBOM in sbom-image is correct.

tools/rustev-release/release-set.json

Updated reason is consistent with the new workflow behavior (image is built and scanned but not published). No defect.

Spec edits

Both spec increments accurately narrate the workflow changes and the membership/gating logic. No contradiction with the governance documents.

{"head": "8f77883710b54ec0de1601f7bdfb0380c5a8b4eb", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "In scan-image, the bans-failure error message cites '021 3.6' but the code comment and spec 031 3.9.2 govern this check; the informational path on the same branch correctly cites '031 3.9.2', making the gating-path message reference the wrong spec."}]}

Subject: 41b490d...8f77883, diff digest c626a48f458c2187a83d8050443795ea1d3d4d17df7bb4c4f8f51a8629d5dfcc, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 02:49 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch from 8f77883 to a9bd5be Compare November 3, 2026 03:11
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff across all five changed files.

tools/rustev-release/artifacts.sh — build-image

The cleanup trap is registered after docker buildx create:

check_dir=$(mktemp -d ...)
docker buildx create --name "$builder" ... >/dev/null   # ← may fail with set -e
trap 'docker buildx rm "$builder" ...; rm -rf "$check_dir"' 0   # ← trap set here

If docker buildx create fails and set -e is active (the workflow step uses set -eu), the script exits before the trap is installed and $check_dir leaks. On ephemeral CI runners this is harmless, but swapping the lines so the trap is armed before create is the correct ordering.

release.yml — qualify if vs needs

The design (qualify waits for image-checks via needs but its if only checks verify-release.result) is explicitly documented in the inline comment and matches the spec text ("qualify waits for them without depending on their result"). !cancelled() is true on a failed dependency, so qualify still runs when image-checks fails, while the overall run is still marked failed. This is intentional.

release.yml — image matrix / artifact naming

Both release and rebuild runs write to dist/image on separate runners (each fresh), upload to image-$run-$arch, and image-checks uses merge-multiple: true to reconstruct both archs into dist/image and dist/image-rebuild before the byte-for-byte comparison. Artifact naming and download patterns are consistent.

artifacts.sh — compare-image argument check

test "$#" = 3 with two positional arguments (plus $1 the command name) is consistent with every other case in the script. The usage string compare-image <release-dir> <rebuild-dir> correctly describes the caller's perspective.

artifacts.sh — scan-image member detection

The Python one-liner reads absent[].kind == "image" from release-set.json (now updated to list the image as absent) and sets member=no, correctly making bans and scan findings non-gating while the image is absent.

SHA-256 lengths — both syft (64 hex chars) and grype (64 hex chars) hashes are correctly formed. The env -u GRYPE_FAIL_ON_SEVERITY unset before both grype invocations prevents env-variable injection from affecting exit-code semantics.

Spec text — 031 and 042 increments are consistent with each other and with the workflow: build-twice-per-platform, byte-comparison, SBOM, scan, no attestation/push while the image is absent.

One concrete defect:

{"head": "a9bd5be5664a5b53e944a190312fcaab09939c97", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": 212, "summary": "In build-image, the check_dir temp directory is created before docker buildx create but the EXIT trap that cleans it up is registered only after; if docker buildx create fails under set -e the temp directory leaks."}]}

Subject: 6660985...a9bd5be, diff digest d346e24a0f256fbadbef42a4f9c7c7702caaaa7918665174b464ea5d08e152c7, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 03:19 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch 2 times, most recently from 764ea2c to a54c83a Compare November 3, 2026 03:46
@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.

tools/rustev-release/artifacts.sh — scan-image: incomplete grype config check

The function guards against a repository-level grype config altering the scan:

for config in .grype.yaml .grype.yml .grype/config.yaml; do
  test ! -e "$config" || fail "a grype configuration ($config) would change the scan; remove it"
done

Grype also loads ~/.grype.yaml and ~/.config/grype/config.yaml (and $XDG_CONFIG_HOME/grype/config.yaml). None of these user-level locations are checked. The comment immediately below explains why this matters in practice:

# Without a fail-on setting grype exits 0 whatever it finds, so a
# non-zero status is a tool error, never a finding; findings are
# counted from the JSON report below.
env -u GRYPE_FAIL_ON_SEVERITY grype -q "sbom:$sbom" -o json ...

GRYPE_FAIL_ON_SEVERITY is unset from the environment, but a fail-on-severity key in a user-level config file is not cleared by env -u. If such a config exists on the runner, grype exits non-zero on any finding, the || fail "grype could not scan $sbom" branch fires, and the run is treated as a tool error rather than a counted finding. The member/non-member gate logic is bypassed entirely: the scan neither counts findings nor records them.

Everything else looks consistent: action pins carry commit digests, the BuildKit image is pinned by digest, the syft/grype tarballs are verified against hardcoded SHA-256s before extraction, the qualify condition deliberately reads only verify-release.result so an image-checks failure fails the run without blocking qualification (as documented), and the release-set.json reason update doesn't touch the kind field the Python membership check relies on.

{"head": "a54c83a75d2ff0ad18f059ef858fa739e9fde424", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "scan-image checks only repo-level grype config paths (.grype.yaml, .grype.yml, .grype/config.yaml) but not user-level ones (~/.grype.yaml, ~/.config/grype/config.yaml); a runner config with fail-on-severity would cause grype to exit non-zero on findings, which the script treats as a tool error rather than counting findings, bypassing the member/non-member gate."}]}

Subject: ae717a1...a54c83a, diff digest ee9479cd3958a5b58f81cd534a195a45d549204141c672ca90503aa0795902fe, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 03:51 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch 2 times, most recently from 02f6f05 to d5a4707 Compare November 3, 2026 11:14
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

Reading through the diff, I'll check the shell script logic, CI workflow structure, and spec consistency.

tools/rustev-release/artifacts.sh — wrong spec citation in scan-image

Every other failure message inside scan-image cites 031 3.9.2:

test "$member" = no || fail '031 3.9.2: rustev-serve fails the bans policy'
…
test "$member" = no || fail "031 3.9.2: $total image finding(s) and no exception rule …"

But the advisories licenses sources failure message was copied verbatim from the existing audit command and still carries the wrong spec number:

deny advisories licenses sources ||
  fail '021 3.6: dependency audit of rustev-serve failed; policy changes require separate review'

021 3.6 governs the main-workspace audit; the image audit step is defined under 031 3.9.2. A failure here would send the investigator to the wrong spec section.

Everything else checked:

  • Argument-count guards (test "$#" = N) are consistent across all four new sub-commands.
  • The qualify condition (needs: [tag, verify-release, image-checks] but if only gating on verify-release.result) is consistent with the stated design: image-check failure fails the run but does not block qualification while the image is absent.
  • The compare-image logic (tar-extract both sides, sha256sum, sort, diff) is correct.
  • The member detection via python3 correctly sets member=no when the release set lists "kind":"image" under absent, and defaults to yes otherwise.
  • The grype config (fail-on-severity: "" + env -u GRYPE_FAIL_ON_SEVERITY) is consistent with the comment's claim; findings are gated via the counted JSON output, not grype's exit code.
  • Pinned SHA-256 digests for syft and grype are verified with sha256sum -c before use.
  • Action digests are pinned by commit SHA in the workflow.
{"head": "d5a47075eb57d00b9e85fab47a2a8be1ec09b59e", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "The `scan-image` command's failure message for `deny advisories licenses sources` incorrectly cites spec `021 3.6` (the main-workspace audit spec) instead of `031 3.9.2`, which is the governing section for this step; every other failure message in the same function correctly cites `031 3.9.2`."}]}

Subject: 3dca8fd...d5a4707, diff digest f467e5f2002aa5e602fdcbfda3d0880a2b3cef07ece1ac1efd00ac021f7842ad, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 11:19 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/042-image-build branch from d5a4707 to 3dd4656 Compare November 3, 2026 11:20
@bartekus
bartekus enabled auto-merge November 3, 2026 11:25
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (findings)

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

release.yml — image / image-checks jobs

The design is internally consistent with the stated intent: qualify adds image-checks to needs but its if only checks needs.verify-release.result, so a failing image-checks still fails the run without blocking qualification. fail-fast: false on the matrix is correct. The hardcoded linux_amd64 binary downloads in image-checks match the ubuntu-24.04 runner. The GRYPE_FAIL_ON_SEVERITY unset + empty config key combination is the correct way to make grype exit 0 on findings.

artifacts.sh — sbom-image case

The syft -q and cargo cyclonedx invocations inside the for arch loop carry no || fail guard:

syft -q "oci-archive:$dir/$name" -o "[email protected]=$dir/$name.cdx.json"
…
cargo cyclonedx --manifest-path integrations/rustev-serve/Cargo.toml --format json --spec-version 1.5 --all --target "$target"
cp integrations/rustev-serve/rustev-serve.cdx.json "$dir/$name.crate.cdx.json"

Contrast with scan-image, where every grype_scan call has || fail "grype could not scan $sbom". The script uses explicit error checking throughout (the surrounding code predates set -e). If cargo cyclonedx fails, cp attempts to copy a nonexistent source; without set -e the loop continues to the next arch and the crate SBOM is silently absent. scan-image only checks for *.oci.tar.cdx.json (image SBOMs), never *.oci.tar.crate.cdx.json (crate SBOMs), and the artifact upload step uses if-no-files-found: ignore, so the absence goes undetected. A syft failure is deferred (scan will fail on the missing *.cdx.json), but the cargo cyclonedx / cp failure path has no catch.

Specs 031 / 042

The increment descriptions, owner-decision dates, and cross-references (3.9.1–3.9.3, 3.16, 058 3.3.4, 058 3.4.2) are self-consistent between the two spec edits and the workflow / release-set changes.

release-set.json

The reason update correctly describes the new state (build + check without publish).

{"head": "3dd4656cf5acd9f34563053a54da7a849c9c8d1f", "verdict": "findings", "findings": [{"path": "tools/rustev-release/artifacts.sh", "line": null, "summary": "In sbom-image, the syft and cargo-cyclonedx invocations inside the arch loop have no || fail guard; if cargo-cyclonedx fails without set -e active, cp silently fails, the crate SBOM is absent, and the omission goes undetected because scan-image checks only image SBOMs and the artifact upload uses if-no-files-found: ignore."}]}

Subject: 3dca8fd...3dd4656, diff digest 7ab44c733afb133aeece1ba7dcdf42e8dba40528e02d575826c2ff9dcbe96332, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 3, 2026 11:27 — with GitHub Actions Error
The release workflow builds spec 042 3.16's rustev-serve image for
linux/amd64 and linux/arm64 twice each on native runners, runs check.sh,
requires identical OCI archives per platform, writes CycloneDX SBOMs and
scans the crate with cargo deny and the base layers with grype (031 3.9).
Nothing is attested or pushed: 058 3.3.4 allows no packages: write, and
0.4.0 ships without the image, so it stays absent in the release set and
its scan findings are recorded without gating. qualify waits for the
image jobs without depending on their result. Specs 042 (increment 9)
and 031 record the change.
@bartekus
bartekus force-pushed the impl/042-image-build branch from 3dd4656 to 972b23d Compare November 3, 2026 11:28
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (no-findings)

I reviewed all five changed files against the governance context and the PR diff. Here is a summary of what I checked.

.github/workflows/release.yml -- The image matrix correctly expands to four jobs (release/rebuild × amd64/arm64), each on its own native runner. Artifact names are unique (image-{run}-{arch}). image-checks downloads with merge-multiple: true into separate directories and passes both to compare-image. The qualify if condition intentionally omits image-checks.result: because !cancelled() is used rather than always(), a failed image-checks does not cancel the workflow, so qualify can still run when verify-release succeeds, while the failed image-checks job itself marks the overall run as failed. This is the stated design and is correct.

tools/rustev-release/artifacts.sh -- Argument counts match the workflow invocations for all four new subcommands. Cleanup traps are registered before the operations they guard. The grype isolation (explicit -c file with fail-on-severity: "" plus env -u GRYPE_FAIL_ON_SEVERITY) prevents any project or home config from causing unintended exits. The member flag is derived from release-set.json; a parse failure keeps member=yes, which is the safe default. The scan-image double-invocation of grype (JSON then table) is redundant but not incorrect. Syft and grype are downloaded with pinned version strings and SHA-256 verification.

tools/rustev-release/release-set.json -- Only the reason string is updated; the absent entry structure is preserved, keeping the member=no logic intact.

Spec files -- The increment paragraphs are additive prose, consistent with the workflow behavior described in the diff. The SHA-256 values quoted for the dry-run archives are internal evidence; I cannot independently verify them but have no contrary evidence.

No concrete defect found.

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

Subject: 3dca8fd...972b23d, diff digest 3aa0222db9e52eabfcc2f6d502d3d6f3b7adf1061ef814bffa5addcb968edb61, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 11:34 — with GitHub Actions Inactive
@bartekus
bartekus added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 1485f17 Nov 3, 2026
63 of 64 checks passed
@bartekus
bartekus deleted the impl/042-image-build branch November 3, 2026 12:22

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 972b23d1 Deployed Nov 3, 2026 by bartekus via review-exception #3099
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