Repository navigation
ci: add the stamped proven-lock-gate (swap PR) #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
43f92d0
0c78ea4
60fe10b
87d8159
c25324e
e863c4b
dd26d4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # proven-cicd: proven-lock-gate@0.3.2 sha256:07266ed730561719a7a1f6ac8859b49d1d126d45bcd8390cfaecc9f289789069 | ||
| # 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: | ||
| 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@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: "50a443f01b1b85e4957b893a6f1a0ed2e8a52459" | ||
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # Manifest for the proven umbrella gate (schema proven/manifest/v1), drafted against | ||
| # proven-cicd-and-workflows#168. Repo-local content only: reasons, waivers, commands. | ||
| schema = "proven/manifest/v1" | ||
|
|
||
| # Rust: `just test` / `just build` cover robot-repo-automaton (the Justfile recipes); | ||
| # the other crates (shared-context, bots/*) are on the later list for the umbrella's | ||
| # multi-root support and are not claimed here. | ||
|
|
||
| # Shell sweep 1 (tests/sweep1/*.sweep1.test.sh) needs the proven-tests kit (PTB_LIB, pinned in | ||
| # .proven/KIT_PIN). The umbrella does not provide the kit yet, so these are visible, expiring | ||
| # waivers, not N/A and not a pass. | ||
| [categories.smoke.shell.waiver] | ||
| reason = "tests/sweep1 needs the proven-tests kit at .proven/KIT_PIN; the umbrella does not fetch it yet" | ||
| until = "2026-12-10" | ||
| [categories.p2p.shell.waiver] | ||
| reason = "as smoke: tests/sweep1 needs the kit; the umbrella does not fetch it yet" | ||
| until = "2026-12-10" | ||
|
|
||
| # Rust smoke and P2P: no smoke/p2p test targets exist under the default root (dashboard); the | ||
| # P2P tests live in shared-context/tests/property_tests.rs (another root). Visible waivers. | ||
| [categories.smoke.rust.waiver] | ||
| reason = "no cargo smoke target at the default root; smoke is shell (tests/sweep1) and is waived above" | ||
| until = "2026-12-10" | ||
| [categories.p2p.rust.waiver] | ||
| reason = "P2P tests are shared-context/tests/property_tests.rs, a second Rust root the manifest cannot yet address" | ||
| until = "2026-12-10" | ||
|
|
||
| # Shell unit: tests/*-test.sh have not been validated one by one on a runner; none is claimed yet. | ||
| [categories.unit.shell.waiver] | ||
| reason = "tests/*-test.sh not yet validated on a runner; a Rust unit job covers robot-repo-automaton" | ||
| until = "2026-12-10" | ||
|
|
||
| # Shell build: syntax-check every script (a real check; the shell tests carry a negative control). | ||
| [categories.build.shell] | ||
| command = "bash -n fleet-coordinator.sh && find scripts tests -name '*.sh' -print0 | xargs -0 -n1 bash -n" | ||
|
|
||
| [languages.ignore.agda] | ||
| reason = "bots/echidnabot/proofs/agda are echidnabot prover fixtures (inputs the bot checks), not a project of this repo" | ||
| [languages.ignore.coq] | ||
| reason = "bots/echidnabot/proofs/coq and theory/rocq are echidnabot prover fixtures, including deliberate Admitted stubs, not a project of this repo" | ||
| [languages.ignore.lean] | ||
| reason = "bots/echidnabot/proofs/lean are echidnabot prover fixtures, including a deliberate sorry stub, not a project of this repo" | ||
| [languages.ignore.idris2] | ||
| reason = "Idris2 files are bots/echidnabot ABI sources and idris-dependents fixtures; the umbrella cannot provision idris2 in release 0.1" | ||
| [languages.ignore.ruby] | ||
| reason = "scripts/check-scanner-caller.rb is being ported to Rust in #713; it is one standalone script" | ||
| [languages.ignore.elixir] | ||
| reason = "scripts/sync-all-parallel.exs is a single standalone script, not a mix project" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # Consumer kit pin: hyperpolymath/proven-tests-and-benches, kit/ (PR #121, draft). | ||
| # Full SHA, never a branch. Tests find the kit through PTB_LIB (kit/lib); nothing is vendored. | ||
| 4d849e992c9d19a86a860a511a175315dddaf83d |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # Coverage manifest (kit/README.adoc). Sweep 1 only: rows exist for ids a real test covers. Ids with no row are | ||
| # missing, not N/A: kit/check-coverage.sh fails closed on them until sweeps 2-4 add rows or written N/A reasons. | ||
| # id status language ref | ||
| UT covered bash tests/sweep1/fleet-coordinator.sweep1.test.sh | ||
| UT covered rust robot-repo-automaton/tests/fixer_tests.rs | ||
| SMK covered bash tests/sweep1/fleet-coordinator.sweep1.test.sh | ||
| BLD covered bash tests/sweep1/fleet-coordinator.sweep1.test.sh | ||
| P2P covered bash tests/sweep1/fleet-coordinator.sweep1.test.sh | ||
| P2P covered rust shared-context/tests/property_tests.rs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // SPDX-License-Identifier: CC-BY-SA-4.0 | ||
| = Estate master schedule | ||
| The canonical, continuously updated schedule is `docs/ESTATE-MASTER-SCHEDULE.adoc` in https://github.com/hyperpolymath/proven-cicd-and-workflows/blob/f2/proven-umbrella-v0/docs/ESTATE-MASTER-SCHEDULE.adoc[proven-cicd-and-workflows] (on branch `f2/proven-umbrella-v0` until #168 merges; maintained there by F2; see proven-cicd-and-workflows#168). This repository keeps no copy. | ||
|
hyperpolymath marked this conversation as resolved.
Resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # Sweep 1 (UT, SMK, BLD, P2P) for fleet-coordinator.sh, on the proven-tests kit. | ||
| # PTB_LIB must point at kit/lib of proven-tests-and-benches at the SHA in .proven/KIT_PIN. | ||
| # Exit 0 pass, 1 fail, 2 nothing ran (no kit, no assertions): absence is not a pass. | ||
| here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| root="$(cd "$here/../.." && pwd)" | ||
| lib="${PTB_LIB:-}" | ||
| [[ -n "$lib" && -f "$lib/ptb.sh" && -x "$lib/smoke.sh" ]] || { | ||
| echo "NO CHECK PERFORMED: set PTB_LIB to kit/lib (see .proven/KIT_PIN)" >&2; exit 2; } | ||
| . "$lib/ptb.sh" | ||
|
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| fc="$root/fleet-coordinator.sh" | ||
|
|
||
| # UT: each public entry, each error branch | ||
| ptb_ok UT-help-exits-0 bash "$fc" --help | ||
| ptb_eq UT-help-banner "Gitbot Fleet Coordinator" "$(bash "$fc" --help | sed -n 1p | cut -d' ' -f1-3)" | ||
| ptb_fails UT-unknown-command-fails bash "$fc" --no-such-command | ||
| ptb_eq UT-unknown-command-names-it 1 "$(bash "$fc" --no-such-command 2>&1 | grep -c 'Unknown command: --no-such-command')" | ||
| for c in run-scan scan-supervised process-findings status deploy-bots; do | ||
| ptb_eq "UT-help-lists-$c" 1 "$(bash "$fc" --help | grep -c "^ $c ")" | ||
|
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When dispatch or behavior for Useful? React with 👍 / 👎. |
||
| done | ||
|
|
||
| # SMK: the entry point starts, answers, exits cleanly | ||
| ptb_ok SMK-help "$lib/smoke.sh" --expect '^Gitbot Fleet Coordinator v[0-9]' -- bash "$fc" --help | ||
| ptb_ok SMK-status "$lib/smoke.sh" --expect 'Fleet Status' -- bash "$fc" status | ||
|
|
||
| # BLD: a shell entry point builds as syntax-clean and executable-by-bash; negative control included | ||
| ptb_ok BLD-syntax-fleet-coordinator bash -n "$fc" | ||
| ptb_ok BLD-syntax-all-scripts bash -c 'for f in "$0"/scripts/*.sh; do bash -n "$f" || exit 1; done' "$root" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a syntax error is introduced under existing nested locations such as Useful? React with 👍 / 👎. |
||
| ptb_fails BLD-negative-control bash -n <(echo 'if then fi') | ||
|
|
||
| # P2P: producer | consumer across one seam (help text -> command inventory), far end real | ||
| inv="$(bash "$fc" --help | awk '/^COMMANDS:/{f=1;next} /^$/{f=0} f{print $1}')" | ||
| ptb_eq P2P-help-inventory-nonempty 1 "$([[ -n "$inv" ]] && echo 1 || echo 0)" | ||
| ptb_eq P2P-inventory-has-status 1 "$(printf '%s\n' "$inv" | grep -cx status)" | ||
| ptb_done | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a syntax regression lands in another tracked shell entry point such as
run-fleet.sh,hooks/*.sh,deploy/*.sh,bots/**/*.sh, or the extensionlessscripts/container-build, this build category still exits successfully becausefindis restricted toscriptsandtestsand then to*.sh. That contradicts the stated “every script” coverage and leaves the umbrella gate false-green for substantial executable shell code, so enumerate all tracked shell entry points rather than relying on this directory/extension allowlist.Useful? React with 👍 / 👎.