Skip to content

feat(runtimes): add first-class TLA+/TLC runtime support#1223

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/feature-tla-plus-runtime-support
Draft

feat(runtimes): add first-class TLA+/TLC runtime support#1223
Copilot wants to merge 3 commits into
mainfrom
copilot/feature-tla-plus-runtime-support

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Adds runtimes: tla: — a first-class TLA+/TLC runtime mirroring the existing lean, python, node, and dotnet runtimes. 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: does

runtimes:
  tla: true          # latest tla2tools.jar, JDK 21

  # or pin versions:
  tla:
    version: "1.8.0" # tla2tools.jar GitHub release tag
    jdk: "21"        # JDK major version for JavaToolInstaller@0 (default: 21)
  • Installs JDK via JavaToolInstaller@0 (pre-installed mode) — selects the JDK matching runtimes.tla.jdk and sets JAVA_HOME
  • Installs tla2tools.jar from TLA+ GitHub releases → $HOME/.tla/
  • Creates shims tlc (tlc2.TLC), pluscal (pcal.trans), sany (tla2sany.SANY) in $HOME/.tla/bin/ — shims delegate to java from PATH
  • Network: GitHub is already in the built-in allowlist; the JDK is pre-installed so no additional network entries needed
  • AWF mounts: $HOME/.tla and $(JAVA_HOME) read-only into the AWF sandbox
  • AWF PATH: prepends $HOME/.tla/bin and $(JAVA_HOME)/bin inside the AWF chroot
  • Bash allow-list: auto-adds java, tlc, pluscal, sany
  • Env vars: sets TLA_JAR pipeline variable; JAVA_HOME is set by JavaToolInstaller@0
  • Prompt supplement: informs the agent of available commands and invocation patterns

Changes

  • src/runtimes/tla/ — new module: TlaRuntimeConfig/TlaOptions config types, generate_tla_tools_install() bash script builder (tla2tools.jar + shims only), TlaExtension implementing CompilerExtension with two prepare steps: Step::Task(JavaToolInstaller@0) + Step::Bash
  • src/runtimes/mod.rspub mod tla
  • src/compile/types.rstla field in RuntimesConfig
  • src/compile/extensions/mod.rsTla(TlaExtension) variant, re-export, collect_extensions wiring
  • src/compile/common.rs + standalone.rstla: None in existing test RuntimesConfig struct literals
  • docs/runtimes.md — full TLA+ section: field reference, shim table, env vars, example model-checking workflow
  • prompts/create-ado-agentic-workflow.mdtla: snippet; updated runtime notes

Test plan

cargo test — all 2292 tests pass. TLA+ unit tests cover: default JDK task step (JavaToolInstaller@0 versionSpec "21"), pinned versions, latest jar URL, injection rejection for version: and jdk:, and the bash-disabled warning.

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot AI changed the title [WIP] Add TLA+ / TLC runtime support to ado-aw feat(runtimes): add first-class TLA+/TLC runtime support Jun 26, 2026
Copilot AI requested a review from jamesadevine June 26, 2026 16:01
@jamesadevine

Copy link
Copy Markdown
Collaborator

@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>

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot we should be using JavaToolInstall from the compiler IR. Hook it up to the TLA frontmatter.

Done in the latest commit. TlaExtension.declarations() now emits two steps in order:

  1. Step::Task(JavaToolInstaller@0, PreInstalled) — selects the pre-installed JDK matching runtimes.tla.jdk (default "21") and sets JAVA_HOME
  2. Step::Bash — downloads tla2tools.jar and creates the tlc/pluscal/sany shims that delegate to java from PATH

The manual Adoptium curl/tar download is removed. Since JavaToolInstaller@0 uses the pre-installed JDK, the java network host entry is no longer needed. The $(JAVA_HOME) ADO macro is added to both the AWF mounts and path prepends so java is accessible inside the AWF chroot.

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.

2 participants