Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/actions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ workflows:
- 'actions/upload-artifact@v7.0.2'
- 'dtolnay/rust-toolchain@v1'
- 'swatinem/rust-cache@v2.9.3'
'.github/workflows/proven-lock-gate.yml':
- 'actions/checkout@v7.0.1'
'.github/workflows/push-email-notify.yml':
- 'hyperpolymath/smtp-notify-action@v0.5.1'
- 'step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a'
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/proven-lock-gate.yml
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
49 changes: 49 additions & 0 deletions .proven.toml
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include every shell entry point in the build command

When a syntax regression lands in another tracked shell entry point such as run-fleet.sh, hooks/*.sh, deploy/*.sh, bots/**/*.sh, or the extensionless scripts/container-build, this build category still exits successfully because find is restricted to scripts and tests and 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 👍 / 👎.


[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"
4 changes: 4 additions & 0 deletions .proven/KIT_PIN
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
10 changes: 10 additions & 0 deletions .proven/coverage.tsv
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
3 changes: 3 additions & 0 deletions docs/ESTATE-MASTER-SCHEDULE.adoc
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.
Comment thread
hyperpolymath marked this conversation as resolved.
Resolved
36 changes: 36 additions & 0 deletions tests/sweep1/fleet-coordinator.sweep1.test.sh
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify the test kit against KIT_PIN before sourcing it

When PTB_LIB points to a stale, branch-based, or otherwise different checkout, the sweep sources and trusts it as long as ptb.sh and smoke.sh exist; .proven/KIT_PIN is never read anywhere in the repository. This can produce pass evidence using different assertion semantics than the pinned kit despite the fail-closed comments, so verify the kit revision against the recorded SHA before sourcing it or have a trusted provisioner supply and attest the pinned checkout.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exercise public commands instead of only listing them

When dispatch or behavior for run-scan, scan-supervised, process-findings, or deploy-bots regresses, this purported UT sweep remains green because the loop only greps their names from help output; generate-rules is not checked at all, and only status is executed later as smoke. This does not support the stated “each public entry, each error branch” or the UT covered row in .proven/coverage.tsv, so invoke the public cases with controlled inputs and assert their expected results.

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recurse in the sweep's all-scripts assertion

When a syntax error is introduced under existing nested locations such as scripts/lib/ or scripts/tests/, BLD-syntax-all-scripts still passes because scripts/*.sh expands only immediate children and the assertion never examines tests/ either. Fresh evidence after the prior fix is that the manifest command now recurses, but this independently runnable sweep—cited as BLD coverage in .proven/coverage.tsv—retains the old nonrecursive glob; use the same recursive, NUL-safe enumeration here.

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
Loading