Skip to content

ltm-finding: remove hardcoded 'main' model assumption #313

@bpowers

Description

@bpowers

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

  1. Add an API that allows specifying the target model ident for discovery.
  2. Keep backward-compatible convenience behavior for main where useful.
  3. Ensure stock selection and causal-graph construction use the caller-specified model.
  4. Add tests for a project whose analysis model is not named main.
  5. Document API behavior and migration path.

Notes

This is a usability/architecture fidelity issue and independent of the known flow-to-stock timing choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ltmLoops that Matter (LTM) analysis subsystem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions