Skip to content

Add CI for standalone StrataPython repo#1

Merged
shigoel merged 4 commits into
mainfrom
jhx/ci
Jun 9, 2026
Merged

Add CI for standalone StrataPython repo#1
shigoel merged 4 commits into
mainfrom
jhx/ci

Conversation

@joehendrix

@joehendrix joehendrix commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Port the Python-specific CI from the Strata monorepo into this standalone repository, adapted for its layout (StrataPython is the repo root).

Dependency fix

The lakefile required Strata at path = "..", which doesn't exist in the standalone repo. Changed it to a git require so lake clones Strata; the manifest pins the current Strata SHA. Verified lake build StrataPython succeeds against the cloned dependency.

Workflows

  • ci.yml — four jobs, paths collapsed (no StrataPython/ prefix):
    • build_and_test_lean — build StrataPython + compile-time tests, then pyInterpret / pyAnalyze-SARIF / pyAnalyze golden-file / regex-differential tests.
    • check_pending_pythonrun_py_analyze.sh --check-pending.
    • lint_checks — copyright headers, whitespace, bare import Lean, net-new panic!.
    • build_python — 3.11–3.14 matrix: PySpec/dispatch tests + CPython differential tests.
    • cbmc — reusable workflow.
  • cbmc.yml — build CBMC from source with the in-repo cbmc-string-support.patch plus the Laurel/regex/quantifier patches from the cloned Strata package, then run the Python CBMC pipeline tests only.

Dropped non-Python steps (.NET/BoogieToStrata, Java codegen, docs, examples, C_Simp/Laurel CBMC).

Removing the StrataCLI dependency

The old CPython differential test (run_test.sh) used the Lean strata CLI only for an Ion round-trip check (toIon + diff). Rather than build a separate StrataCLI package in the standalone repo, that work moved into a new Lean test, StrataPythonTestExtra/CpythonDiffTest.lean, which does the round-trip in-process via the Strata library (Program.fromIon → re-serialize → re-read → compare commands).

run_cpython_tests.sh keeps the orchestration (clone CPython, pick the version, compute expected failures) and drives the Lean test via env vars (CPYTHON_DIR, CPYTHON_EXPECTED_FAILURES plaintext list, CPYTHON_FAIL_FAST). run_test.sh is removed.

Scaffolding

Ported the composite actions (install-cvc5/z3, lint actions, lake cache) and lint scripts, plus CODEOWNERS, dependabot, and a PR template.

joehendrix and others added 2 commits June 8, 2026 23:45
Port the Python-specific CI from the Strata monorepo into this standalone
repository, adapted for its layout (StrataPython is the repo root).

Fix the Strata dependency: the lakefile required `Strata` at `..`, which
does not exist in the standalone repo. Change it to a git require so lake
clones Strata; the manifest pins the current Strata SHA.

Workflows:
- ci.yml: build_and_test_lean (Python steps), check_pending_python,
  lint_checks, and the build_python matrix (3.11-3.14).
- cbmc.yml: build CBMC from source with the in-repo string-support patch
  plus the Laurel/regex/quantifier patches from the cloned Strata package,
  then run the Python CBMC pipeline tests.

Port the composite actions (install-cvc5/z3, lint actions, lake cache) and
lint scripts, plus CODEOWNERS, dependabot, and a PR template.

Remove the StrataCLI dependency from the CPython differential test: the old
run_test.sh used the `strata` CLI only for an Ion round-trip check. Move
that work into a new Lean test, StrataPythonTestExtra/CpythonDiffTest, which
does the round-trip in-process via the Strata library. run_cpython_tests.sh
keeps the orchestration (clone CPython, pick the version, compute expected
failures) and drives the Lean test; run_test.sh is removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cache key included hashFiles('**/*.st'), which is empty at restore
(downstream jobs run before .lake exists) but non-empty at save (the
build_and_test_lean job populates .lake, and the cloned Strata git
dependency brings .st files under it). The mismatched keys made every
downstream job fail at restore with fail-on-cache-miss.

Drop the **/*.st component from both restore-lake-cache and
save-lake-cache. This repo has no committed .st files, and the cloned
dependency is already pinned by the lake-manifest.json hash in the key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@joehendrix joehendrix marked this pull request as ready for review June 9, 2026 17:17
Comment thread lake-manifest.json
Comment thread .github/workflows/ci.yml Outdated

@atomb atomb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This mostly looks good, but I think the actions could be simplified.

Comment thread .github/actions/check-copyright-headers/action.yml Outdated
Comment thread lake-manifest.json
Comment thread StrataPythonTestExtra/CpythonDiffTest.lean
Comment thread Tools/strata-python/scripts/run_cpython_tests.sh Outdated
- build_python: replace the hand-rolled z3 install (pip + pinned 4.13.4
  wget fallback) with the install-z3 action (install-to: system),
  matching the cvc5 step and removing version drift. Only the z3 binary
  is needed; nothing imports the z3 Python module.
- run_cpython_tests.sh: use mise's lowercase `python@<ver>` tool name so
  it resolves for local dev (CI is unaffected; mise isn't installed
  there and it falls back to python3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@joehendrix joehendrix requested a review from a team June 9, 2026 21:11
Replace the vendored composite actions (install-cvc5, install-z3,
check-copyright-headers, lint-whitespace, check-lean-import,
check-no-panic) with strata-org/Strata/.github/actions/<name>@main
references, and delete the local copies and their backing scripts. This
removes the duplication called out in review.

lint-whitespace gets an explicit `directory: .` since its Strata default
is `Strata`, which does not exist in this repo's layout.

Keep restore-lake-cache and save-lake-cache local: the Strata versions
hash `**/*.st` in the cache key, which is unstable here because the
cloned Strata dependency drops .st files under .lake between restore and
save, breaking fail-on-cache-miss.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shigoel shigoel added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit ed25c0a Jun 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants