Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/release-portability-proof.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release Portability Proof

# Docker proof is explicitly dispatched; ordinary PRs run the existing Rust gates.
on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: release-portability-${{ github.ref }}
cancel-in-progress: false

jobs:
immutable-release-runtime:
name: v0.1.0 runtime matrix
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
with:
toolchain: 1.95.0
- name: Build the Rust proof controller
run: cargo build --locked --package xtask
- name: Retain the same-source resolver controller
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: release-portability-controller-${{ github.sha }}
path: target/debug/xtask
if-no-files-found: error
retention-days: 7
- name: Prove immutable release portability
env:
GH_TOKEN: ${{ github.token }}
run: target/debug/xtask release-portability run --out target/release-portability
- name: Retain runtime proof and failures
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ub-review-v0.1.0-release-portability
path: target/release-portability
if-no-files-found: error
retention-days: 30

strict-release-no-fallback:
name: strict release rejects missing asset
needs: immutable-release-runtime
runs-on: ubuntu-24.04
timeout-minutes: 10
container: ubuntu:24.04
defaults:
run:
shell: bash
steps:
- name: Prepare the resolver container
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends ca-certificates curl git
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: release-portability-controller-${{ github.sha }}
path: ${{ runner.temp }}/portability-controller
- name: Prove the clean resolver baseline
run: |
chmod +x "$RUNNER_TEMP/portability-controller/xtask"
"$RUNNER_TEMP/portability-controller/xtask" release-portability resolver-before --out target/release-portability-resolver
- name: Reject missing release asset without fallback
id: missing_release
continue-on-error: true
uses: ./
with:
setup-rust: 'false'
install-tools: 'false'
install-mode: release
release-version: v0.1.0
release-asset: ub-review-missing-x86_64-unknown-linux-gnu.tar.gz
posting: artifact-only
model-mode: off
- name: Validate the resolver result
if: always() && steps.missing_release.outcome != 'skipped'
env:
STEP_OUTCOME: ${{ steps.missing_release.outcome }}
run: >
"$RUNNER_TEMP/portability-controller/xtask" release-portability resolver-after
--out target/release-portability-resolver --step-outcome "$STEP_OUTCOME"
- name: Retain resolver proof and failures
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ub-review-v0.1.0-resolver-no-fallback
path: target/release-portability-resolver
if-no-files-found: error
retention-days: 30
85 changes: 85 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions docs/RELEASE_PORTABILITY_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# PR #1265: immutable v0.1.0 portability proof

Status: Rust replacement implemented. Exact-head validation, dispatched runtime
and resolver receipts, and remaining gate/review blockers are recorded in
PR #1265; the prior runs below retain their historical source identity.

## Authority and retained evidence

- [Issue #1071](https://github.com/EffortlessMetrics/ub-review/issues/1071)
defines the clean-container portability obligation.
- [The September 5 repair direction](https://github.com/EffortlessMetrics/ub-review/pull/1265#issuecomment-5549425901)
requires Rust-owned validation, independent release identity, explicit CI
authorization, discriminating tests, and a fresh exact-head run.
- `policy/ci-budget.toml`, `policy/ci-risk-packs.toml`, and
`policy/ci-lanes.toml` govern cost and proof routing.
- Run `33166458366` and its runtime/resolver artifacts are historical evidence
from the superseded shell harness at `b1198e2`. They establish the observed
v0.1.0 Ubuntu 24.04/glibc 2.39 success and Ubuntu 22.04/glibc 2.35 loader
rejection. They do not validate the replacement harness.
- The v0.1.0 initializer's empty provider/impact defaults are immutable
historical behavior, fixed separately on main by #845. Preserve the exact
two expected policy failures and the separate explicit-config passing packet.

## Bounded design

Keep `xtask/src/main.rs` limited to the new command's dispatch/help. Put the
implementation in `xtask/src/release_portability/` with separate metadata,
archive, runtime, packet, and receipt responsibilities. Remove the large shell
harness; do not replace it with embedded script authority.

The host command resolves live GitHub release/tag/asset metadata before Docker
execution. Follow annotated tags to their commit with a bounded, cycle-checked
chain. Compare the observed tag commit, exact asset names, IDs, sizes, HTTPS
URLs, and API digests against the immutable v0.1.0 policy. Independently download
and verify both the archive and checksum bytes. Retain resolved metadata and
observed comparisons, rather than copying constants into claimed observations.

Use typed serde receipts, bounded decompression/archive inspection, and a
single validation path for both real and negative-control inputs. Reject
missing/duplicate assets, moved tags, digest/size drift, traversal, links,
duplicate/wrong-root archive members, and wrong product/version identity.

Run two explicitly named disposable Ubuntu containers. Only the verified
release executable and a minimal synthetic review fixture enter the runtime
containers; no host Rust tooling, repository source, credentials, or source
fallback enters either container. Invoke explicit OS commands from Rust and
perform assertions, JSON/NDJSON parsing, and receipt construction in Rust on the
host. Retain OS/architecture/libc/kernel observations, version/help, initializer,
doctor, both model-off packets, checksums, inventory, and all negative controls.

The workflow is `workflow_dispatch` only. Existing independent-baseline checks
cover ordinary PR unit proof. The dispatched jobs record their event, actor,
run ID, workflow SHA, and checked-out source SHA. A separate clean resolver
job exercises the local Action's strict missing-asset failure and invokes the
already-built xtask executable to validate and write its receipt; it installs
neither Cargo nor rustc. Workflow YAML carries orchestration, not receipt JSON.

## Acceptance and proof

- Typed accept/reject tests distinguish metadata parsing, annotated tag
dereference/cycles/movement, exact asset selection, duplicates/omissions,
checksum/size drift, hostile archives, wrong version, missing or conflicting
matrix rows, and deterministic receipts.
- Ubuntu 24.04/x86_64/glibc 2.39 must run the exact release and produce a valid
explicit-config model-off packet; Ubuntu 22.04/glibc 2.35 must reject it at
the loader specifically on `GLIBC_2.39`.
- Both runtime environments and the resolver control must prove absence of
Cargo, rustc, and source fallback. The two runtime containers also contain no
UB Review source checkout.
- Run `cargo fmt --all -- --check`, focused xtask tests, locked workspace
all-target/all-feature check, full locked workspace tests, strict locked
Clippy, `cargo run --locked -p xtask -- policy-check`, actionlint, and
`git diff --check`. Coordinate the shared Cargo proof slot before building.
- Keep #1265 open until a newly authorized exact-head portability dispatch and
normal gate are green. Respond to the three review threads with concrete
repair evidence, and resolve them only after the exact-head checks.

## Boundaries, rollback, and cleanup

No release, tag, asset, resolver default, branch protection, or public support
policy changes. No support extrapolation to other distributions/architectures,
and no current-product claim from immutable v0.1.0 behavior. Live metadata plus
the downloaded digest identifies the tested existing asset; this is not a new
signature, provenance, or release authorization claim.

The output directory must be new so stale receipts cannot satisfy a new run.
Retain failed-run diagnostics without a successful matrix. Remove only
containers and scratch artifacts created by this command. Keep the workflow
manual if reverted; historical receipts remain historical. Handle unrelated
release/install documentation drift in a separate builder-ready follow-up.
7 changes: 7 additions & 0 deletions policy/ci-lanes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ when = "release/label"
target_required = false
implemented = false
reason = "Release archive build + checksum verification without publishing; referenced by the release risk pack (#603)."

[[lane]]
id = "release-portability-proof"
when = "workflow_dispatch"
target_required = false
implemented = true
reason = "Explicitly dispatched immutable v0.1.0 execution and strict-resolver controls; two disposable runtime containers, no publishing or product source build, and authorization-bound receipts. Ordinary PRs use the existing Rust checks."
8 changes: 8 additions & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ publish = false
[dependencies]
anyhow = "1.0"
chrono = { version = "0.4", default-features = false }
flate2 = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = "0.10"
tar = "0.4"
toml = "0.9"
wait-timeout = "0.2"

[dev-dependencies]
tempfile = "3.12"

[lints.rust]
unsafe_code = "forbid"
Expand Down
Loading
Loading