Skip to content

feat!: stop exporting the module name CTLie (CTLie 0.3, hygienic @Lie) - #981

Open
ocots wants to merge 3 commits into
mainfrom
966-unexport-ctlie
Open

ocots wants to merge 3 commits into
mainfrom
966-unexport-ctlie

Conversation

@ocots

@ocots ocots commented Oct 13, 2026

Copy link
Copy Markdown
Member

Closes #966.

Summary

using OptimalControl no longer brings the module name CTLie into scope. CTLie 0.3.0 (released 2026-10-10, in General) made the @Lie expansion hygienic (control-toolbox/CTLie.jl#40): the generated code holds the modules, not their names. The export was there only for that.

The issue's checklist

  1. Compat: CTLie = "0.3" in Project.toml, docs/Project.toml and its snapshot docs/src/assets/Project.toml (copied by docs/make.jl).
  2. Export removed: @reexport import CTLie: CTLie and its comment are gone from src/imports/ctlie.jl, replaced by a one-line note. OptimalControl still binds CTLie internally (using CTLie: CTLie in src/OptimalControl.jl), so OptimalControl.CTLie works and test_ctflows.jl's OptimalControl.CTLie is unchanged.
  3. Re-export test test/suite/reexport/test_ctlie.jl: the testset "Generated Code Prefix" becomes "Module name not exported" (!is_exported(OptimalControl, :CTLie)).
  4. Hygiene test: two top-level modules in the test file, LieImportOnly (import OptimalControl only) and LieMacroOnly (using OptimalControl: @Lie only). They call @Lie [X, Y], @Lie [X, Y] is_autonomous = false and @Lie {H1, H2}. The test asserts that neither module has CTLie or CTBase in scope, and that the results are correct.
  5. Docs: the section "using OptimalControl is needed" of the page "The @Lie macro" is dropped, with its hidden check (which asserted the old failure and would now fail).

Choices made

  • Compat "0.3" only, not "0.2, 0.3". Without the hygienic expansion, removing the export breaks @Lie for users, so 0.2 must be excluded. Nothing else in the dependency graph depends on CTLie (checked in General: CTFlows, CTDirect, CTSolvers, CTModels, CTParser and CTBase have no CTLie dep), so the bump resolves. This supersedes CompatHelper's CompatHelper: bump compat for CTLie to 0.3, (keep existing compat) #973 and CompatHelper: bump compat for CTLie to 0.3 for package docs, (keep existing compat) #974, which can be closed after merge.
  • Also removed import CTLie: CTLie / import CTBase: CTBase in test/suite/indirect/test_shooting_sweep.jl. They were there only because @Lie needed them (comment said so). The Goddard @Lie now runs without them, which is an extra real-world hygiene check.
  • Documented as breaking, under a new [Unreleased] / "Breaking changes (unreleased)" section of CHANGELOG.md and BREAKING.md, with a migration snippet (using CTLie: CTLie or OptimalControl.CTLie.…). I did not bump version in Project.toml: the release number (2.3.0-beta or other) is the release PR's call.
  • CTLie 0.3's own breaking change is relayed in BREAKING.md. Guard errors of ad/Lift/∂ₜ on HVF / in-place fields are now IncorrectArgument instead of NotImplemented, and OptimalControl users see them through the re-exported functions. Nothing in OptimalControl's tests or docs relied on NotImplemented there.
  • docs/src/assets/Manifest.toml not regenerated: docs/make.jl overwrites it on the next docs build. Only the Project snapshot was updated by hand, to stay consistent with docs/Project.toml.
  • CTBase stays exported (out of scope, as the issue says); the other module re-exports are Remove the re-exports of CTModels and ExaModels once @def is hygienic #967, blocked on CTParser#356.

Checks

Ran locally (resolved env: CTLie v0.3.0): suite/reexport/*, suite/environment/*, suite/extensions/* and suite/indirect/* give 861/861 passing, including the Goddard shooting sweep that uses @Lie. Full suite and docs build not run locally.

🤖 Generated with Claude Code

ocots and others added 2 commits October 13, 2026 15:42
CTLie 0.3 made the @lie expansion hygienic (CTLie#40), so the module no longer
has to be in scope at the call site. Tests check that @lie works after
'import OptimalControl' and 'using OptimalControl: @lie' only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…page; BREAKING + CHANGELOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ocots ocots added the run ci github-runner Trigger the CI workflow on GitHub-hosted runners label Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run ci github-runner Trigger the CI workflow on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop exporting the module name CTLie once @Lie is hygienic

1 participant