The principle
csauto was written for code_saturne, then opened to other solvers through the
SolverAdapter boundary. The boundary is real for the run lifecycle, but a
large amount of code_saturne knowledge still lives in modules with generic
names, outside csauto/solvers/.
The goal of this umbrella issue is a single, checkable property:
No code_saturne convention (file name, directory layout, log marker, regex)
appears outside csauto/solvers/code_saturne.py, except for a short,
explicitly documented list of accepted residue.
Moving those modules under solvers/code_saturne/ would not achieve it: a third
solver would then have to reimplement the machinery when all it needs is to
declare its own strings. The rule is generic mechanism, solver-declared
vocabulary — the split anomaly_file_names already demonstrates today.
Inventory
Five different shapes of fix, which is why this is split into children rather
than attempted as one change:
| Site |
What leaks |
Shape |
logs.py |
outcome / anomaly / progress / restart regexes, RESU layout, performance.log parsing |
A. adapter-declared patterns |
probes.py, residuals.py |
RESU/monitoring, RESU/profiles, residuals.csv |
B. adapter-declared file layout |
template.py |
find_setup_file, find_run_cfg |
C. plain move: already protocol methods, the adapter merely delegates |
fastapi_routes/case_data.py, web_support.py |
listing, monitoring, a hardcoded file list |
D. plain wiring to anomaly_file_names, which already exists |
execution.py, config.py, cli.py, runner.py |
saturne_bin, --saturne-bin, TOML keys |
E. accepted residue: allowlist it, change no code |
C and D need no new mechanism and are short. A is the largest. E is not work at
all, only bookkeeping.
Why the boundary test does not catch any of this
tests/unit/test_solver_boundary.py scans 6 modules out of 20 for 5 tokens. It
is green today while cli.py contains 10 code_saturne literals and
fastapi_routes/case_data.py declares file: str = "listing" and
scope: str = "monitoring" as API defaults. Widening it before the work above
lands would produce roughly 160 hits and be unusable, so it is the closing
step, not the opening one.
Children
Suggested order: D, C, B, A, E. D and C are quick wins that reduce the
inventory before the large one; E closes the door once there is nothing left to
report.
Definition of done
- A new solver can be added by writing one adapter class, with no edit to any
module outside csauto/solvers/.
test_solver_boundary.py scans every generic module, with a documented
allowlist for the residue in shape E.
docs/architecture.md and docs/adding-a-solver.md describe the
mechanism/vocabulary split rather than the current "all solver knowledge is
behind the adapter", which is not true today.
Non-goals
- Changing the HTTP API shapes or the TOML keys. Already recorded as deliberate
residue in docs/architecture.md.
- Any behaviour change for code_saturne users. Every child should be a pure
refactor, verifiable by the existing test suite plus the golden values each
child adds.
The principle
csauto was written for code_saturne, then opened to other solvers through the
SolverAdapterboundary. The boundary is real for the run lifecycle, but alarge amount of code_saturne knowledge still lives in modules with generic
names, outside
csauto/solvers/.The goal of this umbrella issue is a single, checkable property:
Moving those modules under
solvers/code_saturne/would not achieve it: a thirdsolver would then have to reimplement the machinery when all it needs is to
declare its own strings. The rule is generic mechanism, solver-declared
vocabulary — the split
anomaly_file_namesalready demonstrates today.Inventory
Five different shapes of fix, which is why this is split into children rather
than attempted as one change:
logs.pyRESUlayout,performance.logparsingprobes.py,residuals.pyRESU/monitoring,RESU/profiles,residuals.csvtemplate.pyfind_setup_file,find_run_cfgfastapi_routes/case_data.py,web_support.pylisting,monitoring, a hardcoded file listanomaly_file_names, which already existsexecution.py,config.py,cli.py,runner.pysaturne_bin,--saturne-bin, TOML keysC and D need no new mechanism and are short. A is the largest. E is not work at
all, only bookkeeping.
Why the boundary test does not catch any of this
tests/unit/test_solver_boundary.pyscans 6 modules out of 20 for 5 tokens. Itis green today while
cli.pycontains 10 code_saturne literals andfastapi_routes/case_data.pydeclaresfile: str = "listing"andscope: str = "monitoring"as API defaults. Widening it before the work abovelands would produce roughly 160 hits and be unusable, so it is the closing
step, not the opening one.
Children
logs.py: generic log engine + solver-declared patternsprobes.pyandresiduals.py: adapter-declared results layouttemplate.py: movefind_setup_file/find_run_cfginto the adaptercase_data.pyandweb_support.pytoanomaly_file_namestest_solver_boundary.pywith an explicit residue allowlistSuggested order: D, C, B, A, E. D and C are quick wins that reduce the
inventory before the large one; E closes the door once there is nothing left to
report.
Definition of done
module outside
csauto/solvers/.test_solver_boundary.pyscans every generic module, with a documentedallowlist for the residue in shape E.
docs/architecture.mdanddocs/adding-a-solver.mddescribe themechanism/vocabulary split rather than the current "all solver knowledge is
behind the adapter", which is not true today.
Non-goals
residue in
docs/architecture.md.refactor, verifiable by the existing test suite plus the golden values each
child adds.