Use SymPy-native APIs for core math behavior where we currently hand-roll logic, while preserving phil safety and UX contracts.
Goal
Reduce custom math plumbing in core internals to lower correctness risk and maintenance overhead.
Scope
- Simplification policy
- Replace unconditional broad
simplify() in src/calc/core.py with a targeted pipeline using SymPy primitives where intent is clear (cancel, together, trigsimp, powsimp, etc.).
- Preserve
--no-simplify behavior.
- Matrix solve internals
- Migrate
msolve / linalg solve internals toward SymPy matrix-native solve APIs (A.solve(b) family) instead of hardwiring a single method.
- Keep existing UX errors/hints for bad shapes/inputs.
- Assumption-sensitive behavior
- Use SymPy assumptions/refinement APIs for selected domain-sensitive paths.
- Keep conservative behavior when assumptions are unknown.
Out of Scope
Relationship to Other Issues
Acceptance Criteria
- Scoped internals are SymPy-backed rather than custom algebra logic.
- Existing CLI UX remains intact (
E: + hint: quality).
- One-shot and REPL parity maintained.
- Tests added for each user-visible behavior change.
Validation Gate
uv run --group dev pytest
uv run --group dev pytest --cov=calc --cov-report=term-missing --cov-fail-under=90
Use SymPy-native APIs for core math behavior where we currently hand-roll logic, while preserving
philsafety and UX contracts.Goal
Reduce custom math plumbing in core internals to lower correctness risk and maintenance overhead.
Scope
simplify()insrc/calc/core.pywith a targeted pipeline using SymPy primitives where intent is clear (cancel,together,trigsimp,powsimp, etc.).--no-simplifybehavior.msolve/linalg solveinternals toward SymPy matrix-native solve APIs (A.solve(b)family) instead of hardwiring a single method.Out of Scope
GLOBAL_DICT, blocked tokens, input limits).Relationship to Other Issues
Acceptance Criteria
E:+hint:quality).Validation Gate
uv run --group dev pytestuv run --group dev pytest --cov=calc --cov-report=term-missing --cov-fail-under=90