feat(runtimes): add first-class TLA+/TLC runtime support#1223
feat(runtimes): add first-class TLA+/TLC runtime support#1223jamesadevine with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
@copilot we should be using JavaToolInstall from the compiler IR. Hook it up to the TLA frontmatter. |
…tion
Replace the manual bash curl/tar JRE download from Eclipse Temurin (Adoptium)
with the JavaToolInstaller@0 ADO task from the compiler IR (pre-installed mode),
mirroring the pattern used by node/python/dotnet runtimes.
- TlaExtension.declarations() now emits two prepare steps:
1. Step::Task(JavaToolInstaller@0, PreInstalled) — selects the pre-installed
JDK matching runtimes.tla.jdk and sets JAVA_HOME
2. Step::Bash — downloads tla2tools.jar and creates tlc/pluscal/sany shims
that delegate to `java` from PATH (set by the preceding task)
- Removes the `java` network host (no Adoptium download needed)
- Adds $(JAVA_HOME) to AWF mounts and $(JAVA_HOME)/bin to AWF path prepends
so `java` is accessible inside the AWF chroot
- Replaces TLA_JAVA_HOME pipeline variable with standard JAVA_HOME
- Renames generate_tla_install -> generate_tla_tools_install
- Updates docs and prompt snippets accordingly
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Done in the latest commit.
The manual Adoptium curl/tar download is removed. Since |
|
/rust-review |
1 similar comment
|
/rust-review |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Looks good overall — the structure mirrors existing runtimes faithfully. Two real issues found (one security, one functional bug), plus a stale doc comment. Findings🐛 Bugs / Logic Issues
|
Adds
runtimes: tla:— a first-class TLA+/TLC runtime mirroring the existinglean,python,node, anddotnetruntimes. Closes the gap for agentic workflows that want to run formal model checking (TLC is the counterpart to Lean: it discovers liveness/safety violations exhaustively rather than proving a fixed design).What
runtimes: tla:doesJavaToolInstaller@0(pre-installed mode) — selects the JDK matchingruntimes.tla.jdkand setsJAVA_HOMEtla2tools.jarfrom TLA+ GitHub releases →$HOME/.tla/tlc(tlc2.TLC),pluscal(pcal.trans),sany(tla2sany.SANY) in$HOME/.tla/bin/— shims delegate tojavafrom PATH$HOME/.tlaand$(JAVA_HOME)read-only into the AWF sandbox$HOME/.tla/binand$(JAVA_HOME)/bininside the AWF chrootjava,tlc,pluscal,sanyTLA_JARpipeline variable;JAVA_HOMEis set byJavaToolInstaller@0Changes
src/runtimes/tla/— new module:TlaRuntimeConfig/TlaOptionsconfig types,generate_tla_tools_install()bash script builder (tla2tools.jar + shims only),TlaExtensionimplementingCompilerExtensionwith two prepare steps:Step::Task(JavaToolInstaller@0)+Step::Bashsrc/runtimes/mod.rs—pub mod tlasrc/compile/types.rs—tlafield inRuntimesConfigsrc/compile/extensions/mod.rs—Tla(TlaExtension)variant, re-export,collect_extensionswiringsrc/compile/common.rs+standalone.rs—tla: Nonein existing testRuntimesConfigstruct literalsdocs/runtimes.md— full TLA+ section: field reference, shim table, env vars, example model-checking workflowprompts/create-ado-agentic-workflow.md—tla:snippet; updated runtime notesTest plan
cargo test— all 2292 tests pass. TLA+ unit tests cover: default JDK task step (JavaToolInstaller@0versionSpec"21"), pinned versions, latest jar URL, injection rejection forversion:andjdk:, and the bash-disabled warning.