From 976994624d26593cf6ba18487d6d447ae0f435bc Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 08:42:23 +0000 Subject: [PATCH 1/3] ci: add the proven umbrella gate, sweep 1 tests and coverage manifest Adds the proven.yml caller (job id proven, required check proven / verdict), the stamped proven-lock-gate.yml, .proven.toml and .proven/coverage.tsv. Sweep 1 maps UT, P2P, SMK and BLD to real tests: tests/proven_smoke.rs and tests/proven_build.rs are new, each with negative controls. Every other taxonomy id is listed as planned for sweeps 2 to 4, never dropped. Languages without an umbrella runner carry a written reason. Existing workflows are left in place; retiring them is a separate PR. --- .github/workflows/proven-lock-gate.yml | 121 +++++++++++++++++++++++++ .github/workflows/proven.yml | 31 +++++++ .proven.toml | 41 +++++++++ .proven/coverage.tsv | 43 +++++++++ tests/proven_build.rs | 46 ++++++++++ tests/proven_smoke.rs | 69 ++++++++++++++ 6 files changed, 351 insertions(+) create mode 100644 .github/workflows/proven-lock-gate.yml create mode 100644 .github/workflows/proven.yml create mode 100644 .proven.toml create mode 100644 .proven/coverage.tsv create mode 100644 tests/proven_build.rs create mode 100644 tests/proven_smoke.rs diff --git a/.github/workflows/proven-lock-gate.yml b/.github/workflows/proven-lock-gate.yml new file mode 100644 index 0000000..2da566e --- /dev/null +++ b/.github/workflows/proven-lock-gate.yml @@ -0,0 +1,121 @@ +# SPDX-License-Identifier: MPL-2.0 +# proven-cicd: proven-lock-gate@0.3.3 sha256:870340e4ad1ce67b9b9f7080d9c99782abf800aeb2a14b0410d0a60eb4a4f547 +# Stamped copy of hyperpolymath/proven-cicd-and-workflows templates/proven-lock-gate.yml. +# Do not edit by hand. A changed body fails this gate as drift. The applier +# moves the pinned suite SHA. The line after each `proven-cicd:local-next` +# marker is local and outside the stamp's hash. +# +# The gate judges this repository's actions.lock against its workflows with the +# proven lock kernel. It exits 0 for consistent, 1 for a defect or drift, and 2 +# when it could not run. A run that could not run fails this job: it is never +# skipped and never continue-on-error, so a required check cannot pass without +# a verdict. Every way the gate can fail before its verdict has its own class: +# not_run:pin PROVEN_SHA is not a 40-hex commit +# not_run:identity the suite repository is not the one this gate pins +# (repository id 1326697643 owned by account id 6759885, +# hyperpolymath, after following a rename), it moved to +# another owner, or the name no longer exists: refer, +# never re-run +# not_run:identity-unreadable the repository or owner id could not be read +# (API outage or rate limit): a re-run +# not_run:fetch-missing the pinned commit does not exist in the suite (persistent) +# not_run:fetch the suite could not be fetched after retries (transient) +# not_run:checkout the fetched commit could not be checked out +# not_run:suite-behind the pinned suite is older than this copy: its manifest +# lists an earlier proven-lock-gate (or none). Fix: move +# PROVEN_SHA to a commit whose proven/manifest.json lists +# at least this copy's version +# not_run:suite the checkout is not the pinned commit, is modified, or +# lacks a file or directory the gate runs +# and the suite's own script adds drift, toolchain, build, selftest, extract and +# verdict. The Idris2 RefC runtime is vendored in the suite (dist/), so the build +# needs no network and has no class of its own for a third-party host. +name: Proven lock gate +on: + pull_request: + merge_group: + push: + branches: [main] +permissions: + contents: read +jobs: + proven-lock: + name: Proven lock gate + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + # proven-cicd:local-next + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Judge actions.lock with the proven suite at its pinned commit + env: + # proven-cicd:local-next + PROVEN_SHA: "9009d1dbc49301d098aa3c921f685de4d2ee8e85" + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + fail() { echo "PROVEN_LOCK_CLASS=not_run:$1"; [[ -z ${2:-} ]] || echo "$2" >&2; exit 2; } + [[ $PROVEN_SHA =~ ^[0-9a-f]{40}$ ]] || fail pin + repo=hyperpolymath/proven-cicd-and-workflows + # The suite is pinned by commit; the id pins the repository itself, so a + # recreated repository under the same name is refused. A transfer keeps + # the repository id and GitHub redirects the old name to it, so the + # owner id is pinned as well: a transferred repository is refused, and a + # rename within the owner (same repository id, same owner id) passes. + # Two classes: an id that cannot be read is an availability failure (a + # re-run); an id that differs is a different repository (refer). + # A rename answers 301: follow it (-L) and judge the id it leads to. + # The request and every redirect are HTTPS only (--proto, --proto-redir), + # so a redirect cannot carry the token over plain HTTP. A name that no + # longer exists (404, 410) is permanent, so it is identity; any other + # non-200 (403, 429, 5xx) is availability, a re-run. + code=$(curl -sS -L --proto '=https' --proto-redir '=https' --retry 3 -o "$RUNNER_TEMP/proven-repo.json" -w '%{http_code}' \ + -H "Authorization: Bearer $GH_TOKEN" "https://api.github.com/repos/$repo") || + fail identity-unreadable "could not reach the API for $repo" + case $code in + 200) ;; + 404|410) fail identity "$repo does not exist (HTTP $code)" ;; + *) fail identity-unreadable "the API answered HTTP $code for $repo" ;; + esac + id=$(jq -r '.id // empty' "$RUNNER_TEMP/proven-repo.json" 2>/dev/null) || fail identity-unreadable "the reply for $repo is not JSON" + [[ $id =~ ^[0-9]+$ ]] || fail identity-unreadable "the reply for $repo has no id" + [[ $id == 1326697643 ]] || fail identity "$repo has id '$id', not 1326697643" + owner=$(jq -r '.owner.id // empty' "$RUNNER_TEMP/proven-repo.json" 2>/dev/null) || fail identity-unreadable "the reply for $repo has a malformed owner" + [[ $owner =~ ^[0-9]+$ ]] || fail identity-unreadable "the reply for $repo has no owner id" + [[ $owner == 6759885 ]] || + fail identity "$repo (id $id) is owned by account $owner ($(jq -r '.owner.login // "?"' "$RUNNER_TEMP/proven-repo.json" 2>/dev/null)), not 6759885 (hyperpolymath): a transfer" + suite="$RUNNER_TEMP/proven-suite" + git init -q "$suite" + git -C "$suite" remote add origin "https://github.com/$repo.git" + git -C "$suite" config core.sparseCheckout true + printf '%s\n' dist/ scripts/ tests/fixtures/proven-lock/ /proven/manifest.json > "$suite/.git/info/sparse-checkout" + fetched=0 + for delay in 0 10 30; do + sleep "$delay" + if git -C "$suite" fetch -q --depth=1 origin "$PROVEN_SHA" 2>"$RUNNER_TEMP/proven-fetch.err"; then fetched=1; break; fi + # A commit the server does not have will not appear on a retry. + if grep -qiE "not our ref|couldn't find remote ref|unadvertised object|no such remote ref" "$RUNNER_TEMP/proven-fetch.err"; then + fail fetch-missing "$(cat "$RUNNER_TEMP/proven-fetch.err")" + fi + done + [[ $fetched == 1 ]] || fail fetch "$(cat "$RUNNER_TEMP/proven-fetch.err")" + git -C "$suite" checkout -q --detach FETCH_HEAD || fail checkout + [[ $(git -C "$suite" rev-parse HEAD) == "$PROVEN_SHA" ]] || fail suite "checked out $(git -C "$suite" rev-parse HEAD), not $PROVEN_SHA" + [[ -z $(git -C "$suite" status --porcelain) ]] || fail suite "the suite checkout is modified" + # This copy needs a suite at least as new as itself (0.3.0 needs the + # vendored runtime): a pin older than the copy is its own class, so the + # fix is plain (move the pin), not a generic refusal. + mine=$(sed -n '1,2s/^# proven-cicd: proven-lock-gate@\([0-9]*\.[0-9]*\.[0-9]*\) .*/\1/p' "$GITHUB_WORKSPACE/.github/workflows/proven-lock-gate.yml") + [[ -n $mine ]] || fail suite "this copy has no proven-lock-gate stamp" + theirs=$(jq -r '[.artifacts[] | select(.artifact == "proven-lock-gate") | .version][0] // empty' "$suite/proven/manifest.json" 2>/dev/null || true) + [[ -n $theirs && $(printf '%s\n' "$theirs" "$mine" | sort -V | head -n 1) == "$mine" ]] || + fail suite-behind "the suite at $PROVEN_SHA lists proven-lock-gate ${theirs:-nothing}, older than this copy's $mine; move PROVEN_SHA" + for f in scripts/proven-lock-gate.sh scripts/proven-stamp.sh scripts/build-proven-lock.sh \ + scripts/extract-lock-facts.sh dist/proven-lock/proven-lock-verdict.c; do + [[ -f $suite/$f ]] || fail suite "the suite at $PROVEN_SHA lacks $f" + done + for d in dist/proven-lock/runtime/refc dist/proven-lock/runtime/c tests/fixtures/proven-lock; do + [[ -d $suite/$d ]] || fail suite "the suite at $PROVEN_SHA lacks $d/" + done + bash "$suite/scripts/proven-lock-gate.sh" "$GITHUB_WORKSPACE" .github/workflows/proven-lock-gate.yml diff --git a/.github/workflows/proven.yml b/.github/workflows/proven.yml new file mode 100644 index 0000000..4e4971f --- /dev/null +++ b/.github/workflows/proven.yml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: MPL-2.0 +# The estate's umbrella gate: ONE caller, ONE required check (`proven / verdict`). +# Do not copy runner jobs in here: a copy freezes and never receives a fix. +# New categories, aspects and checks reach this repository when Dependabot +# (github-actions ecosystem) bumps the pin below. Repo-local content is the +# repo's own tests and fixtures plus .proven.toml (schema proven/manifest/v1). +# +# The job id MUST be `proven` and the job MUST NOT carry `if:` or +# `continue-on-error` (a skipped gate is void, ER-A8). The pin is a full SHA +# with its release tag in the comment; never a branch or a bare tag. +name: Proven + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] # labeled: bench-approved re-runs the gate + merge_group: + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + actions: read + pull-requests: read # bench-approved label lookup + +jobs: + proven: + uses: hyperpolymath/proven-cicd-and-workflows/.github/workflows/proven.yml@9009d1dbc49301d098aa3c921f685de4d2ee8e85 # v0.1.2 (tag pending) diff --git a/.proven.toml b/.proven.toml new file mode 100644 index 0000000..949713a --- /dev/null +++ b/.proven.toml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: MPL-2.0 +# Manifest for the proven umbrella gate (schema proven/manifest/v1). +# Release 0.1.x of the umbrella enforces sweep 1 (unit, smoke, build, p2p) and +# ships runners for rust, elixir, go, node, python, zig and shell only. +schema = "proven/manifest/v1" + +# The Rust suite carries sweep 1: the library and integration tests plus +# tests/proven_*.rs, mapped in .proven/coverage.tsv. + +# UT: the whole Rust suite, the same command as `just test`. Spelled out here +# because the umbrella runner image has no `just`. +[categories.unit.rust] +command = "cargo test --locked" + +# SMK: the built binary starts, answers and exits cleanly. +[categories.smoke.rust] +command = "cargo test --locked --test proven_smoke" + +# P2P: property-based invariants (proptest). +[categories.p2p.rust] +command = "cargo test --locked --test property_tests" + +# BLD: binary artefact exists and the lockfile resolves offline. +[categories.build.rust] +command = "cargo test --locked --test proven_build" + +# Languages the umbrella has no runner for yet. Each is accounted for with a +# reason, never dropped silently, and each reason goes when the umbrella ships +# that toolchain. +[languages.ignore.idris2] +reason = "no umbrella toolchain in 0.1.x; src/abi is type-checked by the idris-abi job in proven-tests.yml" +[languages.ignore.chapel] +reason = "optional parallel layer; built and tested by chapel-ci.yml, no umbrella toolchain in 0.1.x" +[languages.ignore.zig] +reason = "two files; exercised through the Rust build and chapel-ci.yml until the umbrella's zig runner covers them" +[languages.ignore.nickel] +reason = "configuration and manifest export templates; the manifest subcommand output is asserted in tests/manifest_cli.rs" +[languages.ignore.tla] +reason = "a single TLA+ specification; no umbrella toolchain in 0.1.x" +[languages.ignore.shell] +reason = "build and CI glue plus tests/verisimdb_e2e.sh; the shell scripts are exercised by e2e.yml and rust-ci.yml" diff --git a/.proven/coverage.tsv b/.proven/coverage.tsv new file mode 100644 index 0000000..53ef6d7 --- /dev/null +++ b/.proven/coverage.tsv @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: MPL-2.0 +# Coverage manifest for the proven umbrella (kit/check-coverage.sh). Sweep 1 only: ids not listed are not yet swept. +# id status language ref +UT covered rust tests/analyzer_tests.rs +UT covered rust tests/regression_tests.rs +P2P covered rust tests/property_tests.rs +SMK covered rust tests/proven_smoke.rs +BLD covered rust tests/proven_build.rs +E2E planned - s2 panic-attack sweep 2 (rest of CRG C) +EXE planned - s2 panic-attack sweep 2 (rest of CRG C) +REF planned - s2 panic-attack sweep 2 (rest of CRG C) +LCY planned - s2 panic-attack sweep 2 (rest of CRG C) +REG planned - s2 panic-attack sweep 2 (rest of CRG C) +CTR planned - s2 panic-attack sweep 2 (rest of CRG C) +PRF planned - s2 panic-attack sweep 2 (rest of CRG C) +TSF planned - s2 panic-attack sweep 2 (rest of CRG C) +CDF planned - s2 panic-attack sweep 2 (rest of CRG C) +PBT planned - s3 panic-attack sweep 3 (B grade) +MUT planned - s3 panic-attack sweep 3 (B grade) +FUZ planned - s3 panic-attack sweep 3 (B grade) +CMP planned - s3 panic-attack sweep 3 (B grade) +CHS planned - s3 panic-attack sweep 3 (B grade) +DEP planned - s4 panic-attack sweep 4 (all 18 plus extras) +SEC planned - s4 panic-attack sweep 4 (all 18 plus extras) +USA planned - s4 panic-attack sweep 4 (all 18 plus extras) +IOP planned - s4 panic-attack sweep 4 (all 18 plus extras) +SAF planned - s4 panic-attack sweep 4 (all 18 plus extras) +PER planned - s4 panic-attack sweep 4 (all 18 plus extras) +FUN planned - s4 panic-attack sweep 4 (all 18 plus extras) +VER planned - s4 panic-attack sweep 4 (all 18 plus extras) +ACC planned - s4 panic-attack sweep 4 (all 18 plus extras) +MNT planned - s4 panic-attack sweep 4 (all 18 plus extras) +PRI planned - s4 panic-attack sweep 4 (all 18 plus extras) +OBS planned - s4 panic-attack sweep 4 (all 18 plus extras) +RPR planned - s4 panic-attack sweep 4 (all 18 plus extras) +PRT planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-LAT planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-THR planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-MEM planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-STA planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-BLD planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-ENG planned - s4 panic-attack sweep 4 (all 18 plus extras) +B-FFI planned - s4 panic-attack sweep 4 (all 18 plus extras) diff --git a/tests/proven_build.rs b/tests/proven_build.rs new file mode 100644 index 0000000..2d4f428 --- /dev/null +++ b/tests/proven_build.rs @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MPL-2.0 +//! BLD (taxonomy category 4): the `panic-attack` binary artefact exists and is +//! non-empty, and the committed lockfile is current (`cargo update --locked` +//! fails if it would change and, unlike full metadata resolution, needs no +//! registry download). The warnings-denied clean build and its timing run in +//! CI through the umbrella; the cheap form here must not rebuild the tree. +use std::path::Path; +use std::process::Command; + +#[test] +fn the_binary_artifact_exists_and_is_nonempty() { + let p = Path::new(env!("CARGO_BIN_EXE_panic-attack")); + assert!(p.is_file(), "{} is not a file", p.display()); + assert!(p.metadata().unwrap().len() > 0, "{} is empty", p.display()); +} + +#[test] +fn the_lockfile_resolves_without_network() { + let out = Command::new(env!("CARGO")) + .args(["update", "--workspace", "--locked", "--offline"]) + .current_dir(env!("CARGO_MANIFEST_DIR")) + .output() + .expect("spawn cargo"); + assert!( + out.status.success(), + "{}", + String::from_utf8_lossy(&out.stderr) + ); +} + +// Negative control: a lockfile check must be able to fail. +#[test] +fn a_bogus_manifest_path_is_rejected() { + let out = Command::new(env!("CARGO")) + .args([ + "update", + "--workspace", + "--locked", + "--offline", + "--manifest-path", + "/nonexistent/Cargo.toml", + ]) + .output() + .expect("spawn cargo"); + assert!(!out.status.success()); +} diff --git a/tests/proven_smoke.rs b/tests/proven_smoke.rs new file mode 100644 index 0000000..1779364 --- /dev/null +++ b/tests/proven_smoke.rs @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: MPL-2.0 +//! SMK (taxonomy category 8): the built `panic-attack` binary starts, answers +//! and exits cleanly. Nothing here needs network or an external tool, so none +//! of these tests can pass by skipping; each asserts on real output and has a +//! negative control. +use std::process::Command; + +fn bin() -> Command { + Command::new(env!("CARGO_BIN_EXE_panic-attack")) +} + +#[test] +fn version_prints_the_package_version() { + let out = bin().arg("--version").output().expect("spawn panic-attack"); + assert!(out.status.success(), "exit: {:?}", out.status); + let stdout = String::from_utf8_lossy(&out.stdout); + assert!( + stdout.contains(env!("CARGO_PKG_VERSION")), + "version output {stdout:?} lacks {}", + env!("CARGO_PKG_VERSION") + ); +} + +#[test] +fn help_lists_the_core_subcommands() { + let out = bin().arg("--help").output().expect("spawn panic-attack"); + assert!(out.status.success()); + let stdout = String::from_utf8_lossy(&out.stdout); + for sub in ["assail", "assault", "adjudicate", "aggregate", "describe-contract"] { + assert!(stdout.contains(sub), "--help does not mention `{sub}`"); + } +} + +#[test] +fn describe_contract_emits_json_carrying_the_cli_version() { + let out = bin() + .arg("describe-contract") + .output() + .expect("spawn panic-attack"); + assert!( + out.status.success(), + "stderr: {}", + String::from_utf8_lossy(&out.stderr) + ); + let stdout = String::from_utf8_lossy(&out.stdout); + assert!( + stdout.contains(&format!("\"cli_version\": \"{}\"", env!("CARGO_PKG_VERSION"))), + "contract lacks the cli_version:\n{stdout}" + ); +} + +// Negative controls: a smoke test that cannot fail proves nothing. +#[test] +fn unknown_subcommand_exits_nonzero() { + let out = bin() + .arg("no-such-subcommand") + .output() + .expect("spawn panic-attack"); + assert!(!out.status.success()); +} + +#[test] +fn assailing_a_missing_target_exits_nonzero() { + let out = bin() + .args(["assail", "/nonexistent/proven-smoke-target"]) + .output() + .expect("spawn panic-attack"); + assert!(!out.status.success()); +} From 6da3cb09a1fc979835f6545396ced2d334868248 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 08:43:48 +0000 Subject: [PATCH 2/3] ci: account for the Julia stress script in the proven manifest The first umbrella run detected julia (scripts/blackbox_stress.jl) and failed closed with missing-runner for smoke and p2p. Record the language with a written reason instead of leaving it unaccounted. --- .proven.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.proven.toml b/.proven.toml index 949713a..923a07c 100644 --- a/.proven.toml +++ b/.proven.toml @@ -39,3 +39,5 @@ reason = "configuration and manifest export templates; the manifest subcommand o reason = "a single TLA+ specification; no umbrella toolchain in 0.1.x" [languages.ignore.shell] reason = "build and CI glue plus tests/verisimdb_e2e.sh; the shell scripts are exercised by e2e.yml and rust-ci.yml" +[languages.ignore.julia] +reason = "one operator script (scripts/blackbox_stress.jl) that drives repeated assail/assault runs for manual stress sessions; no umbrella toolchain in 0.1.x and it is not part of the shipped binary" From 956731746c135e6db3dd1cc59e2796869b004696 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 08:53:15 +0000 Subject: [PATCH 3/3] fix(proven): state the real reason Zig is excluded from coverage --- .proven.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.proven.toml b/.proven.toml index 923a07c..444c4df 100644 --- a/.proven.toml +++ b/.proven.toml @@ -32,7 +32,7 @@ reason = "no umbrella toolchain in 0.1.x; src/abi is type-checked by the idris-a [languages.ignore.chapel] reason = "optional parallel layer; built and tested by chapel-ci.yml, no umbrella toolchain in 0.1.x" [languages.ignore.zig] -reason = "two files; exercised through the Rust build and chapel-ci.yml until the umbrella's zig runner covers them" +reason = "two files under ffi/zig/ (FFI shim); no current CI job compiles them and Cargo.toml has no Zig build integration, so they are uncovered. Deferred: a zig build step is tracked for a later sweep, not claimed as covered" [languages.ignore.nickel] reason = "configuration and manifest export templates; the manifest subcommand output is asserted in tests/manifest_cli.rs" [languages.ignore.tla]