Skip to content

doc: LTM design doc is out of date with the code #1049

Open

Description

@bpowers

docs/design/ltm--loops-that-matter.md is the entry point for LTM (linked from docs/README.md, docs/architecture.md, the engine's CLAUDE.md, and an engine warning message), but large parts of it describe older code.
It needs one pass that checks each section against the current tree and rewrites what has drifted.

Known problems

  • It names build_partial_equation, which no longer exists; the builders are build_partial_equation_shaped and build_partial_equation_shaped_with_live_ref in ltm_augment.rs.
  • It describes recompute_module_input_edge_series as the discovery-time recompute for edges into a module.
    That function is now an adapter kept for tests; production goes through recompute_module_input_edge_series_for, cached by ModuleOverrideCache (ltm_finding.rs), which the doc never mentions.
  • "Module Classification" presents Infrastructure / DynamicModule / Passthrough as a code-level taxonomy.
    No such type exists; the decision is spread across model_ltm_variables, modules_carry_state, and the module pathway map.
    Whether the prose still matches what they decide is unchecked.
  • About ten passages narrate history ("now fires only for", "Before this fix") or cite PR review-comment ids (r3353459409 and others), which the evergreen-docs rule forbids.

Checking that names exist is not enough: the second and third items pass a name check and are still wrong.
The sections on how array references are classified were already checked against the code; the rest (two modes, module handling, polarity, discovery, arrays, pinned loops, test coverage) were not.

Why it matters

A reader following the doc to the adapter will draw wrong conclusions about where production behavior lives.
No CI check covers identifiers inside backticks in docs/design/, so this drift is invisible.

Fix

A doc-only PR: go section by section, confirm each named function and each behavioral claim against the code, fix the items above, and rewrite the narration as standing statements.
Optional, and probably not worth it: a scripts/check-docs.py rule that every backticked identifier in docs/design/ resolves somewhere in src/ (it would catch only the first kind of problem).

Pointers

  • docs/design/ltm--loops-that-matter.md
  • src/simlin-engine/src/ltm_finding.rs, ltm_augment.rs, db/ltm/mod.rs, ltm/graph.rs

Activity

  1. changed the title [-]docs: full verification pass of ltm--loops-that-matter.md against the LTM code (build_partial_equation is gone; recompute passage describes the adapter, not ModuleOverrideCache; module-role taxonomy is prose-only)[/-] [+]doc: LTM design doc is out of date with the code[/+] on Oct 12, 2026
  2. added
    docs
    ltm
    hygiene
    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

    docshygieneltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions