Skip to content

engine: Run.links doc does not say it is empty when LTM is off #626

Open

Description

@bpowers

In the TypeScript engine, Sim.getRun() fetches links only when LTM is enabled, so a default (LTM-off) run has Run.links = [].
That is intended, and sim.ts says so in a comment, but the public doc on Run.links reads "Get causal links, potentially with LTM scores", which suggests an LTM-off run still lists the model's causal links without scores.
The doc should state the actual contract.

Why it matters

No current consumer reads Run.links from an LTM-off run, so nothing is broken.
A future caller that wants the causal structure from a cheap run could get [] and conclude the model has no links.
The structural link list is already available from Model.getLinks(), regardless of LTM.

Fix

Change the doc on Run.links (and Sim.getRun()) to say links are populated only for LTM-enabled runs, and point to Model.getLinks() for the causal structure.
Alternative: always fill Run.links from the causal graph and add scores only under LTM; this costs an extra call on every run for data nobody reads today.

Pointers

  • src/engine/src/run.ts (links getter)
  • src/engine/src/sim.ts (getRun, the wantLinks check)
  • src/engine/src/model.ts (getLinks)

Activity

  1. added
    engine
    on Jun 8, 2026
  2. added
    hygiene
    on Oct 12, 2026
  3. changed the title [-]engine: LTM-off Sim.getRun() now returns Run.links=[] instead of populated-scoreless (AC1.3 deviation)[/-] [+]engine: Run.links doc does not say it is empty when LTM is off[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enginehygiene

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions