Clojure->Python CUTOVER: Step 4 — remove the Clojure tree; move the Python math engine to math/ - #2689
Draft
jucor wants to merge 1 commit into
Draft
Clojure->Python CUTOVER: Step 4 — remove the Clojure tree; move the Python math engine to math/#2689jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 28, 2026
Draft
Draft
Draft
Draft
Draft
Draft
This was referenced Jul 28, 2026
Draft
Draft
python-math #43: docs(delphi): s7 goal state + journal — mode collapse executed, battery 20/20
#2672
Draft
Draft
Draft
Draft
…ython math engine to math/ The final tidy-up, and a pure file reorganization (no behavior change): the retired Clojure source is deleted, and the Python math engine moves out of `delphi/` into the now-free top-level `math/` directory as its own Python package. `delphi/` keeps the UMAP/narrative service and ALL the math tests and datasets, and uses the engine as a library — one shared environment, `cd delphi && uv sync` exactly as before, `import polismath` unchanged everywhere. ## What's in this PR - **Deleted:** the Clojure source (60 files) and its CI workflow. It stays in git history — and that matters, because it is the ORACLE: the reference implementation the Python engine was certified bit-for-bit against. `math/README.md` documents a safe way to restore it temporarily if the engine ever changes and needs re-certification (and warns against `git checkout` in this jj-managed repo). - **Moved:** `delphi/polismath` -> `math/polismath`, with its own `math/pyproject.toml` declaring only the ~10 scientific/database dependencies — no LLM/GPU stack. The poller service now starts as `python -m polismath.poller`. - **Paths:** eight modules used to locate the datasets/tests directory by counting parent directories up from their own file — after the move that arithmetic silently points at the wrong tree. All cross-tree path knowledge now lives in one module (`polismath/paths.py`); everything else refers to it, and tests can still substitute paths exactly as before. - **Certification** still works without the Clojure source present: previously recorded reference outputs are used as-is from cache; only actually RE-RUNNING the Clojure side asks for the restored tree, with a clear error explaining how. - **Docker:** the delphi image build now pulls the engine source from a second directory (an "additional build context") — this requires docker compose v2.17+ with BuildKit on every machine that builds; see the merge gate. The test image also asserts after installing that the LOCAL polismath is what got installed — there is an unrelated "polismath" name on PyPI that must never be picked up. - **CI:** the python workflow now watches `math/**` too; a dead copy-and-coverage step for `run_math_pipeline` removed (it is an ordinary module of the package now, already covered). ## Testing 1211 passed / 29 skipped (baseline 1171/22, plus 44 new tests from the flip PR and this one, minus 5 that now skip because the Clojure tree is absent — by design). ## Merge gate (after Step 3 has soaked) - [ ] every prod host's docker-compose is v2.17+ with BuildKit — the deploy script parses the compose file on EVERY host type, so one old binary would break all deploys, not just the math host - [ ] python CI green on this branch - [ ] one successful `docker compose build delphi math-python` on a BuildKit machine ## Known and accepted 10 pre-existing type-checker complaints in `certify.py` / `test_certify.py` (identical code existed before the move — left alone to keep this PR purely a move); some docs still say `delphi/polismath` in historical narrative (docs pass queued). ## Rollback Revert this PR. Nothing in the database or in the flip/decommission steps depends on it, and the built image contains the same installed code either way. Series: Step 0 = #2685. Nothing merges without Julien's explicit go. commit-id:45664936
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The final tidy-up, and a pure file reorganization (no behavior change): the retired Clojure source is deleted, and the Python math engine moves out of
delphi/into the now-free top-levelmath/directory as its own Python package.delphi/keeps the UMAP/narrative service and ALL the math tests and datasets, and uses the engine as a library — one shared environment,cd delphi && uv syncexactly as before,import polismathunchanged everywhere.What's in this PR
math/README.mddocuments a safe way to restore it temporarily if the engine ever changes and needs re-certification (and warns againstgit checkoutin this jj-managed repo).delphi/polismath->math/polismath, with its ownmath/pyproject.tomldeclaring only the ~10 scientific/database dependencies — no LLM/GPU stack. The poller service now starts aspython -m polismath.poller.polismath/paths.py); everything else refers to it, and tests can still substitute paths exactly as before.math/**too; a dead copy-and-coverage step forrun_math_pipelineremoved (it is an ordinary module of the package now, already covered).Testing
1211 passed / 29 skipped (baseline 1171/22, plus 44 new tests from the flip PR and this one, minus 5 that now skip because the Clojure tree is absent — by design).
Merge gate (after Step 3 has soaked)
docker compose build delphi math-pythonon a BuildKit machineKnown and accepted
10 pre-existing type-checker complaints in
certify.py/test_certify.py(identical code existed before the move — left alone to keep this PR purely a move); some docs still saydelphi/polismathin historical narrative (docs pass queued).Rollback
Revert this PR. Nothing in the database or in the flip/decommission steps depends on it, and the built image contains the same installed code either way.
Series: Step 0 = #2685. Nothing merges without Julien's explicit go.
commit-id:45664936
Stack: