Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
ec7defb
docs: specify bound effects and centralized recovery
bordumb Oct 28, 2026
43832ad
docs(gateway): define AP074 ownership and acceptance ledger
bordumb Oct 28, 2026
005dfd4
feat(gateway): bind native mutation compilation and exact approval
bordumb Oct 28, 2026
ca40764
test(gateway): freeze native bound-effect approval fixture
bordumb Oct 28, 2026
464f0b2
feat(gateway): revalidate original effect authority and approval policy
bordumb Oct 28, 2026
5750356
feat(gateway): render private review from the sealed bound effect
bordumb Oct 28, 2026
c75e16b
docs(gateway): harden AP074 deployment and composition contracts
bordumb Oct 28, 2026
7c79532
feat(gateway): require operator-installed effect approval policy
bordumb Oct 28, 2026
cd3a344
feat(gateway)!: require exact bound-effect approval for submission
bordumb Oct 28, 2026
f7bf938
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
96e4780
feat(gateway)!: persist exact effects under scoped operation keys
bordumb Oct 28, 2026
4e0f435
feat(stores): add bounded gateway writer fences
bordumb Oct 28, 2026
8dbd993
feat(gateway)!: fence shared installation and revocation memory
bordumb Oct 28, 2026
558a68e
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
3cbe3ad
fix(stores): report the active PostgreSQL schema version
bordumb Oct 28, 2026
fd8803c
feat(gateway)!: require fenced durable grants for provider entry
bordumb Oct 28, 2026
8201545
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
6d38bb1
feat(gateway)!: resume reservations with fresh audited grants
bordumb Oct 28, 2026
a4d4bb0
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
ed90797
feat(gateway)!: require complete native effect review contracts
bordumb Oct 28, 2026
eb3c31f
feat(gateway)!: return journal state without replay I/O
bordumb Oct 28, 2026
31a825d
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
964764f
feat(gateway)!: compile independently authorized recovery reads
bordumb Oct 28, 2026
3ca2c36
feat(gateway)!: journal and fence bounded recovery acquisitions
bordumb Oct 28, 2026
1322d18
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
9f717d3
feat(gateway)!: link recovery evidence and replace operator reads
bordumb Oct 28, 2026
119d1f7
feat(gateway)!: require independent acquisition after mutation responses
bordumb Oct 28, 2026
7c7ff71
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
66cb1e4
feat(gateway)!: bind prerequisite acquisition plans to exact approval
bordumb Oct 28, 2026
8ef39b9
feat(gateway)!: enforce durable prerequisite read grants
bordumb Oct 28, 2026
c31031a
fix(gateway): validate prerequisite evidence under entry fence
bordumb Oct 28, 2026
e6e29bb
fix(gateway): fence initial admission and capacity charges
bordumb Oct 28, 2026
2eb6d73
feat(gateway)!: require approved application recovery reads
bordumb Oct 28, 2026
ae5a286
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
aa96674
feat(gateway)!: enforce managed recovery read budgets
bordumb Oct 28, 2026
15b3cad
feat(gateway)!: bind recovery credential prerequisites
bordumb Oct 28, 2026
f0a364f
feat(gateway)!: bind candidate credential check plans
bordumb Oct 28, 2026
57332c5
feat(gateway)!: journal candidate credential acquisitions
bordumb Oct 28, 2026
03ca6b0
feat(gateway): fence candidate credential publication
bordumb Oct 28, 2026
861271a
feat(gateway): persist exact private credential proposals
bordumb Oct 28, 2026
1c23ca3
feat(gateway)!: stage approved credential rotations
bordumb Oct 28, 2026
67506ad
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
ed557da
feat(gateway)!: stage first installs for approved credential checks
bordumb Oct 28, 2026
cac8c75
test(gateway): exercise approved candidate process journeys
bordumb Oct 28, 2026
72fe870
feat(gateway): authenticate exact disclosure acknowledgements
bordumb Oct 28, 2026
5b9d9ec
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
eafd6a2
feat(gateway): compile explicit bounded content acquisitions
bordumb Oct 28, 2026
71fd4f7
feat(gateway): journal approved content acquisitions through sealed t…
bordumb Oct 28, 2026
10a548e
feat(gateway)!: retain protected content with acquisition responses
bordumb Oct 28, 2026
622a58f
chore(formal): regenerate qualification artifacts
github-actions[bot] Oct 28, 2026
93f4915
feat(gateway): compile separately authorized retained-content disclos…
bordumb Oct 28, 2026
15d0bb8
refactor(gateway): share bounded source allocation mechanics
bordumb Oct 28, 2026
3f23e5f
feat(gateway)!: journal disclosure reservations and historical acknow…
bordumb Oct 28, 2026
d5cfeb9
feat(gateway)!: fence authenticated one-use Unix disclosures
bordumb Oct 28, 2026
189bb1e
feat(gateway): expose native content and disclosure application controls
bordumb Oct 28, 2026
c80902a
feat(gateway): author native content calls and exercise process recovery
bordumb Oct 28, 2026
cfaa859
feat(gateway)!: support content-only recipe installations
bordumb Oct 28, 2026
9c93903
fix(ci): refresh AP074 inventories and preserve Python 3.9 runners
bordumb Oct 28, 2026
1ccfc09
fix(release): refresh AP074 semantic freeze identities
bordumb Oct 28, 2026
fb5c5a0
refactor(demo): freeze concrete Drive metadata reference
bordumb Oct 28, 2026
4bbff15
fix(gateway): exercise native approvals and explicit recovery in CI h…
bordumb Oct 28, 2026
4066222
refactor(test): isolate chain trust setup from recovery assertions
bordumb Oct 28, 2026
32eaafe
chore(gateway): refresh semantic closure after CI harness cutover
bordumb Oct 28, 2026
7def09e
docs(spec): retain AP070 as an independent application reference
bordumb Oct 28, 2026
6009de2
fix(release): bind integrated CI consumer contracts in semantic freeze
bordumb Oct 28, 2026
7369926
test(gateway): race independent daemons for final read allocation
bordumb Oct 28, 2026
715bd79
test(gateway): exercise native process capacity on both durable adapters
bordumb Oct 29, 2026
08f0064
fix(gateway): preserve pending prerequisite ownership and align CI co…
bordumb Oct 29, 2026
4408f59
fix(demos): require native approvals and explicit recovery reads
bordumb Oct 29, 2026
8ab0136
fix(examples): authorize native candidate and recovery effects across…
bordumb Oct 29, 2026
af01d37
test(gateway): exercise native acquisition crash boundaries on both s…
bordumb Oct 29, 2026
050fa21
fix(ci): resolve security gates and preserve producer artifacts on re…
bordumb Oct 29, 2026
a64eacd
test(gateway): prove native dependency and expiry ordering on both st…
bordumb Oct 29, 2026
edb122e
test(gateway): prove native fixed-window acquisition capacity across …
bordumb Oct 29, 2026
0a26acb
test(gateway): inject native file transaction and acknowledgement faults
bordumb Oct 29, 2026
0c3494b
test(gateway): prove PostgreSQL admission rollback at every inserted row
bordumb Oct 29, 2026
884b5bd
fix(formal): align gateway proofs with durable entry and late evidence
bordumb Oct 29, 2026
ab36e4b
chore(assurance): record integrated AP074 fault and formal evidence
bordumb Oct 29, 2026
b0d2ab4
test(gateway): exercise real PostgreSQL commit reply loss over TLS
bordumb Oct 29, 2026
d7eea27
test(gateway): restore native approval controls across CLI checks
bordumb Oct 29, 2026
bc77833
chore(assurance): refresh canonical CLI controls and source attribution
bordumb Oct 29, 2026
9ae2e2c
fix(gateway): preserve retained facts independently of current authority
bordumb Oct 29, 2026
9913d4c
fix(gateway): preserve native checks across replay and crash recovery
bordumb Oct 29, 2026
a81943a
test(gateway): exercise disclosure crashes and late acknowledgements
bordumb Oct 29, 2026
ce9d6cf
docs(gateway): retain qualified AP074 hosted evidence
bordumb Oct 29, 2026
0e20c5f
test(gateway): pin threshold evidence after writer-fence waits
bordumb Oct 29, 2026
5eb761d
test(gateway): verify independent recovery after writer withdrawal
bordumb Oct 29, 2026
37a218c
feat(demo): require authenticated owner consent for native effects
bordumb Oct 29, 2026
cb1ee6d
docs(gateway): retain terminal formal and runner-capacity evidence
bordumb Oct 29, 2026
91552fa
test(gateway): compare bound mutations with independent references
bordumb Oct 29, 2026
f5f3a8c
test(gateway): compare independent read and release state histories
bordumb Oct 29, 2026
5744894
test(gateway): isolate valid response byte-limit boundaries
bordumb Oct 29, 2026
d9618a5
test(demo): verify the rendered native recovery contract
bordumb Oct 29, 2026
f6ef54a
test(demo): verify the rendered native recovery contract
bordumb Oct 29, 2026
fc59891
chore(git): reconcile the published CI repair
bordumb Oct 29, 2026
76d008a
fix(gateway): bound expiry sweeps and preserve native replay state
bordumb Oct 29, 2026
49a5c0f
fix(ci): repair differential worker lifetime and strict lint
bordumb Oct 29, 2026
74ce9f7
fix(gateway): bound file journal inventory queries
bordumb Oct 29, 2026
41763d5
fix(gateway): fence epoch activation across stale hosts
bordumb Oct 29, 2026
ab980d1
feat(demo): compose the managed owner read and disclosure journey
bordumb Oct 29, 2026
25c9370
fix(demo): complete installed managed owner journey
bordumb Oct 29, 2026
87554f7
test(gateway): prove native capacity races and retained reservations
bordumb Oct 29, 2026
e19e85e
fix(gateway): reject foreign recipe provenance and scope substitutions
bordumb Oct 29, 2026
0609ff2
fix(ci): format PostgreSQL test documentation
bordumb Oct 29, 2026
dedef2b
test(gateway): prove mutation entry ordering and wait-time expiry
bordumb Oct 29, 2026
70bd0ec
test(gateway): prove disclosure entry ordering and zero-byte refusal
bordumb Oct 29, 2026
0957021
test(gateway): cover selected evidence changes at mutation and releas…
bordumb Oct 30, 2026
7bf36be
test(gateway): prove atomic mutation and disclosure admission batches
bordumb Oct 30, 2026
2ab072a
test(gateway): cover lost mutation and disclosure commit replies
bordumb Oct 30, 2026
a212959
test(gateway): place entry evidence imports before statements
bordumb Oct 30, 2026
d9cea91
test(gateway): exercise mutation and disclosure file persistence errors
bordumb Oct 30, 2026
a3835fa
test(gateway): satisfy strict lint in durability evidence helpers
bordumb Oct 30, 2026
1085b8f
feat(gateway): report retained recovery budgets and escalation
bordumb Oct 30, 2026
0d774a0
fix(gateway): retain recovery history after reader withdrawal
bordumb Oct 30, 2026
bb68a37
fix(gateway): harden admin frames and inventory managed interfaces
bordumb Oct 30, 2026
09838a1
fix(ci): preserve managed interface isolation controls
bordumb Oct 30, 2026
1769057
feat(gateway)!: hide public mutation evidence commitments
bordumb Oct 30, 2026
6c48f0d
fix(ci): align demo evidence checks with private commitments
bordumb Oct 30, 2026
3cb2caa
fix(gateway): preserve redacted diagnostics at pause checkpoint
bordumb Oct 30, 2026
7807d04
feat(gateway)!: separate public history from private audit evidence
bordumb Nov 4, 2026
6c93e93
test(gateway): measure native path and recovery inventory costs
bordumb Nov 4, 2026
49cfcec
fix(gateway): align all public result decoder boundaries
bordumb Nov 4, 2026
14cdc0f
fix(ci): preserve private audit journeys and refresh pinned evidence
bordumb Nov 4, 2026
46989b7
chore(gateway): refresh integrated source and repair evidence
bordumb Nov 4, 2026
aa7cfc7
test(gateway): generate concurrent durable replay histories
bordumb Nov 4, 2026
5acd62b
fix(ci): retain measured artifacts and private audit defaults
bordumb Nov 4, 2026
01109d3
test(gateway): bind changed review meaning to fresh approval
bordumb Nov 4, 2026
977ae61
fix(gateway): close crash and journal assurance gaps
bordumb Nov 4, 2026
909193d
fix(gateway): enforce the declared operation event limit
bordumb Nov 4, 2026
08b972f
fix(ci): repair final gateway evidence producers
bordumb Nov 4, 2026
ee7975b
chore(formal): regenerate qualification artifacts
github-actions[bot] Nov 4, 2026
f5e9be6
perf(ci): reuse verified clean Lean evidence for unchanged inputs
bordumb Nov 4, 2026
20b7610
fix(ci): scope Lean producer discovery before bounding runs
bordumb Nov 4, 2026
eb44d8f
fix(ci): bind Lean provenance to immutable producer revisions
bordumb Nov 4, 2026
91b397e
docs(ap074): reconcile executed acceptance and final verification gates
bordumb Nov 4, 2026
8ddba7e
fix(gateway): generate fuzz seeds through current native schemas
bordumb Nov 4, 2026
b54ed09
docs(ap074): record verified cold Lean producer and final gate boundary
bordumb Nov 4, 2026
28ecb46
fix(ci): initialize pinned Lean dependencies before reuse
bordumb Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 60 additions & 0 deletions .github/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,63 @@ When adding a path, package, domain workflow, or phase:
3. run `cargo run --locked -p auths-ci-plan -- check`;
4. add a planner test proving unrelated domains remain excluded;
5. keep scheduled fuzz targets synchronized with `cargo xtask fuzz-inventory`.

### Reusing clean Lean evidence across follow-up commits

The base-relative planner still schedules required formal gates. Both the early
feedback job and authoritative Lean job may avoid recompilation by independently
locating a successful **clean** authoritative Lean producer on the same repository,
workflow and pull request. This reuses a completed proof attestation, never cached
`.olean` outputs. Main/release/scheduled or forked executions remain cold.

`.github/scripts/reuse-formal-lean.py` checks bounded GitHub metadata, the exact
successful job attempt, source revision, repository/PR identity, artifact identity
and the API-reported ZIP SHA-256. It accepts only one bounded `lean.json` member.
The native `cargo xtask ci formal-lean-reuse` owner separately requires matching
proof, toolchain, execution-policy, translation-source and toolchain-lock hashes,
plus a complete `proof_inputs_sha256` from the original clean run. Reused records
cannot seed another reuse chain. Missing, expired, malformed, oversized, failed,
untrusted or different-input evidence selects the existing full fresh build.

The complete hash includes all tracked authored/generated Lean, Lake manifests,
imports, assurance/axiom policies and vectors; root Cargo/config/toolchain inputs;
workflow/setup/reuse controllers; the full xtask/control-plane packages; and every
local package and data file transitively reachable from `auths-formal-refinement`
according to locked Cargo metadata. The separate validated production closure
binds all translated Rust roots and their dependencies. New local dependencies
are traversed rather than selected by a fixed crate allowlist. Unrelated native
gateway/tests, demos and repository documentation do not enter this proof hash;
proof/compiler/generated/import/toolchain/assurance/controller changes do.
Conservative Cargo or controller changes may cause an additional cold run.

A hit still validates the current Rust toolchain, source closure, algebra/bridges,
translation inventory/reports, workflow and warning policies, runs current
`auths-formal-refinement` tests and checks the current Kani harness inventory.
Input hashes are checked again after these current-head checks. It then emits a
new current-head/current-run phase record linked to the original run, attempt,
job, source revision, artifact ID and ZIP digest. The final aggregator still
requires successful translation, Lean and Kani phases with exact current input
bindings. The feedback job's hit remains feedback, not independent qualification.
Kani remains a separate current-head gate; it is not skipped by Lean reuse.

Legacy records lack the complete-input field and are intentionally ineligible.
The initial rollout therefore requires fresh verification. Later unchanged-input
follow-ups can use that successful producer. The search is bounded to ten of the
latest fifty same-branch PR runs of this exact CI workflow (other workflows do
not consume that bound) and one hundred artifacts/jobs per candidate;
no eligible retained producer means another fresh run. This availability limit
never converts missing proof evidence into a passing skipped gate.

GitHub's run-associated PR object contains a mutable current head snapshot. It
establishes PR/repository membership, not the historical source SHA. The immutable
run, exact-attempt successful job, artifact metadata and phase record must all
agree on the producer source; changing any one remains a cold miss.

Both Lean jobs prepare the pinned toolchain and Lake dependency checkout before
attempting reuse. The current-head validator audits the actual Aeneas package
commit, clean worktree and reviewed warning inventory; a fresh checkout cannot
perform those checks before dependency setup. Setup/cache restoration is not
proof qualification. Only the expensive repository proof compilation remains
conditional on a successful independently validated reuse result. Missing or
invalid packages still fail closed, and the native workflow guard requires this
unconditional order in both jobs.
206 changes: 206 additions & 0 deletions .github/scripts/reuse-formal-lean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
#!/usr/bin/env python3
"""Bounded same-repository/same-PR clean Lean evidence discovery.

A miss is an optimization miss: the workflow must execute the existing fresh
Lean gate. This script never accepts cached build outputs as proof evidence.
"""
from __future__ import annotations

import hashlib
import io
import json
import os
from pathlib import Path
import re
import subprocess
import zipfile
from urllib.parse import urlencode

LIMIT = 1_048_576
WORKFLOW = ".github/workflows/ci.yml"
JOB = "formal Lean authoritative"


def positive(value):
return type(value) is int and value > 0


def hexadecimal(value, length):
return isinstance(value, str) and re.fullmatch(r"[0-9a-f]{%d}" % length, value) is not None


def unique_object(pairs):
value = {}
for key, item in pairs:
if key in value:
raise ValueError("duplicate JSON member")
value[key] = item
return value


def decode_json(data):
return json.loads(data, object_pairs_hook=unique_object)


def gh(path, archive=False):
result = subprocess.run(["gh", "api", path], check=True, capture_output=True, timeout=60)
if len(result.stdout) > (LIMIT if archive else 8 * LIMIT):
raise ValueError("GitHub response exceeds finite bound")
return result.stdout if archive else decode_json(result.stdout)


def trusted_run(run, current, number):
repo = current["repository"]
return (
positive(run["id"])
and run["id"] != current["id"]
and positive(run["run_attempt"])
and run["workflow_id"] == current["workflow_id"]
and run["path"] == WORKFLOW
and run["event"] == "pull_request"
and run["repository"]["id"] == repo["id"]
and run["repository"]["full_name"] == repo["full_name"]
and run["head_repository"]["id"] == repo["id"]
and run["head_repository"]["full_name"] == repo["full_name"]
and run["head_branch"] == current["head_branch"]
and hexadecimal(run["head_sha"], 40)
# GitHub keeps this PR association but updates its head snapshot.
# Historical source identity comes from the run/job/artifact/phase.
and any(
pr["number"] == number
and pr["base"]["repo"]["id"] == repo["id"]
and pr["head"]["repo"]["id"] == repo["id"]
for pr in run["pull_requests"]
)
)


def read_phase(archive, artifact, run, attempt, environment):
digest = artifact.get("digest", "")
if not isinstance(digest, str) or not digest.startswith("sha256:"):
raise ValueError("artifact has no authenticated SHA-256 metadata")
if not hexadecimal(digest[7:], 64) or hashlib.sha256(archive).hexdigest() != digest[7:]:
raise ValueError("artifact archive digest mismatch")
if len(archive) > LIMIT:
raise ValueError("archive exceeds bound")
with zipfile.ZipFile(io.BytesIO(archive)) as zipped:
entries = zipped.infolist()
if len(entries) != 1 or entries[0].filename != "lean.json":
raise ValueError("unexpected artifact inventory")
if not 0 < entries[0].file_size <= LIMIT or entries[0].flag_bits & 1:
raise ValueError("invalid phase member")
raw = zipped.read(entries[0])
phase = decode_json(raw)
if not isinstance(phase, dict):
raise ValueError("phase must be an object")
expected = {
"schema": "auths-proof-formal-phase-result/v1",
"phase": "lean",
"head_sha": run["head_sha"],
"run_id": str(run["id"]),
"run_attempt": str(attempt),
"execution": "executed-clean",
"reproduction_count": 0,
"planned_closure_sha256": environment["AUTHS_FORMAL_PHASE_CLOSURE_SHA256"],
"toolchain_closure_sha256": environment["AUTHS_FORMAL_TOOLCHAIN_CLOSURE_SHA256"],
"evidence_closure_sha256": environment["AUTHS_FORMAL_EVIDENCE_CLOSURE_SHA256"],
}
if any(phase.get(key) != value for key, value in expected.items()):
raise ValueError("phase does not match the successful producer/current closures")
if phase.get("reused_from") is not None:
raise ValueError("reuse chains are ineligible")
for key in ["proof_inputs_sha256", "source_closure_sha256", "toolchain_lock_sha256"]:
if not hexadecimal(phase.get(key), 64):
raise ValueError("complete proof input attestation is absent or malformed")
return raw


def verify_current(raw, producer, environment, directory):
directory.mkdir(parents=True, exist_ok=True)
phase = directory / "lean.json"
phase.write_bytes(raw)
env = dict(environment)
env.update(producer)
env["AUTHS_REUSED_LEAN_PHASE_RESULT"] = str(phase.resolve())
return subprocess.run(
["cargo", "xtask", "ci", "formal-lean-reuse"], env=env, timeout=1800
).returncode == 0


def discover(environment, api=gh, verify=verify_current):
repo = environment["GITHUB_REPOSITORY"]
current_id = int(environment["GITHUB_RUN_ID"])
number = int(environment["AUTHS_PR_NUMBER"])
current = api(f"repos/{repo}/actions/runs/{current_id}")
if (
current["id"] != current_id
or not positive(current["workflow_id"])
or current["event"] != "pull_request"
or current["path"] != WORKFLOW
or current["repository"]["full_name"] != repo
or current["head_repository"]["id"] != current["repository"]["id"]
or not any(pr["number"] == number for pr in current["pull_requests"])
):
return False
query = urlencode({"branch": current["head_branch"], "event": "pull_request", "per_page": 50})
runs = api(f"repos/{repo}/actions/workflows/{current['workflow_id']}/runs?{query}")["workflow_runs"]
for run in runs[:10]:
try:
if not trusted_run(run, current, number):
continue
artifacts = api(f"repos/{repo}/actions/runs/{run['id']}/artifacts?per_page=100")["artifacts"]
prefix = f"auths-formal-phase-lean-{run['id']}-"
for artifact in artifacts[:100]:
if not positive(artifact.get("id")) or artifact.get("expired") is not False:
continue
if not positive(artifact.get("size_in_bytes")) or artifact["size_in_bytes"] > LIMIT:
continue
name = artifact.get("name", "")
if not isinstance(name, str) or not name.startswith(prefix):
continue
suffix = name[len(prefix):]
if not re.fullmatch(r"[1-9][0-9]*", suffix):
continue
attempt = int(suffix)
if attempt > run["run_attempt"]:
continue
provenance = artifact["workflow_run"]
if provenance["id"] != run["id"] or provenance["head_sha"] != run["head_sha"]:
continue
if provenance["repository_id"] != current["repository"]["id"] or provenance["head_repository_id"] != current["repository"]["id"]:
continue
jobs = api(f"repos/{repo}/actions/runs/{run['id']}/attempts/{attempt}/jobs?per_page=100")["jobs"]
successes = [job for job in jobs if job["name"] == JOB and job["status"] == "completed" and job["conclusion"] == "success" and job["head_sha"] == run["head_sha"] and positive(job["id"])]
if len(successes) != 1:
continue
raw = read_phase(api(f"repos/{repo}/actions/artifacts/{artifact['id']}/zip", archive=True), artifact, run, attempt, environment)
producer = {
"AUTHS_REUSED_RUN_ID": str(run["id"]),
"AUTHS_REUSED_RUN_ATTEMPT": str(attempt),
"AUTHS_REUSED_HEAD_SHA": run["head_sha"],
"AUTHS_REUSED_JOB_ID": str(successes[0]["id"]),
"AUTHS_REUSED_ARTIFACT_ID": str(artifact["id"]),
"AUTHS_REUSED_ARTIFACT_SHA256": artifact["digest"][7:],
}
if verify(raw, producer, environment, Path("target/reused-formal/lean")):
print(f"Reused successful clean Lean run {run['id']} attempt {attempt}, job {successes[0]['id']}, artifact {artifact['id']}, head {run['head_sha']}")
return True
except (KeyError, TypeError, ValueError, OSError, RuntimeError, subprocess.SubprocessError, zipfile.BadZipFile):
continue
return False


def main():
reused = False
try:
reused = discover(os.environ)
except (KeyError, TypeError, ValueError, OSError, RuntimeError, subprocess.SubprocessError):
print("No validated same-PR Lean producer available; fresh verification is required.")
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
output.write(f"reused={'true' if reused else 'false'}\n")
if not reused:
print("Lean reuse miss: the existing fresh build and all qualification gates remain required.")


if __name__ == "__main__":
main()
Loading
Loading