simplify: one scoring path, bare AST formulas, localhost-only dev server

- move _score_raw into scorer.score_raw; Scorer delegates to it
- compile_formula returns ast.Expression directly (drop CompiledFormula)
- secret key from env or random; drop hand-rolled .env parsing/appending
- dev server binds 127.0.0.1 by default (HOST env override); Docker sets
  HOST=0.0.0.0 so container port mapping still works
- trim pipeline comments narrating past bugs (history lives in git)
- snapshot free-var/formula (de)serialization via asdict/**kwargs
- domains routes: shared form parsing and partial rendering helpers

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-09-25 15:03:59 -05:00
parent 3429bce8d0
commit b2ccd94fd5
8 changed files with 111 additions and 270 deletions

View File

@@ -9,7 +9,7 @@ PhysCom (Physical Combinatorics) — innovation discovery engine that generates
## Commands
- **Install**: `pip install -e ".[dev,web]"` (editable install with test and web deps)
- **Tests (all)**: `python -m pytest tests/ -q` (48 tests, ~5s). Run after every change.
- **Tests (all)**: `python -m pytest tests/ -q` (134 tests, ~2 min). Run after every change.
- **Single test file**: `python -m pytest tests/test_scorer.py -q`
- **Single test**: `python -m pytest tests/test_scorer.py::test_score_combination -q`
- **Web dev server**: `python -m physcom_web`