Summary
discover_loops() is hardwired to analyze only a model named main.
Why this is a problem
The strongest-path algorithm itself is model-agnostic, but current API behavior assumes a specific model name. This limits reuse for projects that do not use main as the analysis root and makes discovery less composable with tooling that selects models dynamically.
Literature / algorithm alignment
LTM discovery is defined over a model’s causal graph and stock set; algorithmically it is not tied to a fixed model identifier.
Current implementation behavior
find_main_model() fetches canonicalized "main" only.
get_stock_variables() and downstream discovery depend on this.
Location:
src/simlin-engine/src/ltm_finding.rs
Impact
- Discovery cannot be directly applied to non-
main top-level models.
- Hidden coupling to naming convention in library behavior.
Success criteria
- Add an API that allows specifying the target model ident for discovery.
- Keep backward-compatible convenience behavior for
main where useful.
- Ensure stock selection and causal-graph construction use the caller-specified model.
- Add tests for a project whose analysis model is not named
main.
- Document API behavior and migration path.
Notes
This is a usability/architecture fidelity issue and independent of the known flow-to-stock timing choice.
Summary
discover_loops()is hardwired to analyze only a model namedmain.Why this is a problem
The strongest-path algorithm itself is model-agnostic, but current API behavior assumes a specific model name. This limits reuse for projects that do not use
mainas the analysis root and makes discovery less composable with tooling that selects models dynamically.Literature / algorithm alignment
LTM discovery is defined over a model’s causal graph and stock set; algorithmically it is not tied to a fixed model identifier.
Current implementation behavior
find_main_model()fetches canonicalized"main"only.get_stock_variables()and downstream discovery depend on this.Location:
src/simlin-engine/src/ltm_finding.rsImpact
maintop-level models.Success criteria
mainwhere useful.main.Notes
This is a usability/architecture fidelity issue and independent of the known flow-to-stock timing choice.