Skip to content

(feat) local Lean4 engine with Docker-based execution#105

Merged
leoveanv merged 2 commits into
mainfrom
dev
Apr 2, 2026
Merged

(feat) local Lean4 engine with Docker-based execution#105
leoveanv merged 2 commits into
mainfrom
dev

Conversation

@leoveanv

@leoveanv leoveanv commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace old SSH-based Lean4 engine with HTTP client/server architecture (FastAPI + docker exec)
  • Strip dead SSH artifacts from Dockerfile (openssh-server, sshd config, hardcoded root password), change CMD to sleep infinity
  • Delete unused docker-compose.yml (SSH-only config)
  • Narrow 6 broad except Exception clauses to specific types (docker.errors.DockerException, docker.errors.APIError, OSError, subprocess.SubprocessError)
  • Unify port-finding logic via atomic socket.bind(("", 0)) replacing O(n) port scan with TOCTOU race
  • Fix UserMessage("Server stopped!") warning → success style for all symserver KeyboardInterrupt handlers
  • Use Argument type instead of Any on engine forward()/prepare() signatures

Test plan

  • Tests are running
  • ruff check passes on all changed files

Comment thread symai/backend/engines/formal/engine_lean4_local.py Fixed
Comment thread symai/server/lean4_fastapi.py Fixed
Comment thread symai/server/lean4_server.py Fixed
Comment thread symai/server/lean4_fastapi.py Fixed
Comment thread symai/server/lean4_fastapi.py Fixed
Replace the old SSH-based Lean4 engine with a clean HTTP client/server
architecture using FastAPI + docker exec. Strip dead SSH artifacts from
Dockerfile, narrow broad except clauses to specific types, unify port
finding via atomic bind(0), and fix server-stop message style.

(fix) address CodeQL and code-quality findings

Bind ephemeral port-finding sockets to 127.0.0.1 instead of all
interfaces, sanitize Docker error details from /health response,
and annotate intentional NotFound except-pass blocks.
@leoveanv
leoveanv merged commit d8f6a17 into main Apr 2, 2026
6 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.

2 participants