You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: TypeScript API cannot read post-run loop polarity #760
The TypeScript engine (@simlin/engine) can only read a model's loops before simulation, so every loop it returns has its structural polarity and a confidence of 1.0 or 0.0.
libsimlin already has a post-run entry point, simlin_analyze_get_loops_runtime, that relabels loops from their simulated loop scores (including "mostly reinforcing" and "mostly balancing") with a real polarity confidence.
pysimlin uses it (Sim.get_loops_runtime, Run.loops); TypeScript does not bind it.
Why it matters
Nothing in the web app reads loops today, so no user sees this yet.
It is the first step for any web display of loop polarity (#731).
The LoopPolarity enum and Loop.polarityConfidence already exist in the TS types, so callers can be misled into thinking the values are runtime values.
Fix
Bind simlin_analyze_get_loops_runtime and expose it on the run or sim handle (for example Sim.loops()), next to the existing model-level Model.loops().
Both entry points return the same SimlinLoops struct, so the existing readLoops reader works for both.
It needs to go through the EngineBackend interface so the worker backend gets it too.
While there, update the "Simlin implementation note" in docs/reference/ltm--loops-that-matter.md (after the Rux/Bux table, around line 695).
It still says the TS surface folds Rux/Bux to R/B and points at #495, which is closed.
changed the title [-]engine: @simlin/engine never binds simlin_analyze_get_loops_runtime (runtime Rux/Bux polarity and real confidence unreachable from TS)[/-][+]engine: TypeScript API cannot read post-run loop polarity[/+]on Oct 12, 2026
Still real (direct-backend.ts binds only simlin_analyze_get_loops), but nothing in the web app reads loops, so this binding only matters as step 1 of #731's feature.
Activity
ltm: core-algorithm batch of root-caused fixes from epic #488 (#761)
[-]engine: @simlin/engine never binds simlin_analyze_get_loops_runtime (runtime Rux/Bux polarity and real confidence unreachable from TS)[/-][+]engine: TypeScript API cannot read post-run loop polarity[/+]bpowers commentedon Oct 12, 2026
Closing as a duplicate of #731.
Still real (direct-backend.ts binds only simlin_analyze_get_loops), but nothing in the web app reads loops, so this binding only matters as step 1 of #731's feature.