Skip to content

simlin-mcp-core: LTM diagnostics never surface (collect_all_diagnostics runs with ltm_enabled=false) #662

Closed

Description

@bpowers

Problem

simlin-mcp-core collects diagnostics on a freshly-synced db with ltm_enabled=false (the default), so LTM-specific diagnostics never reach MCP callers. Call sites:

  • src/simlin-mcp-core/.../read_model.rs (around line 79)
  • src/simlin-mcp-core/.../edit_model.rs (around lines 262 and 290)

These call simlin_engine::db::collect_all_diagnostics without ever enabling LTM. As a result MCP callers see neither the auto-flip advisory ("LTM auto-switched to discovery") nor the LTM fragment-compile-failure warnings (model_ltm_fragment_diagnostics), both of which only accumulate when SourceProject::ltm_enabled is true.

Relationship to #466

This bypasses the GH #466 latch fix entirely. #466 fixed the libsimlin FFI path (simlin_project_get_errors transiently re-enables ltm_enabled for the diagnostic harvest via the LtmEnabledGuard whenever any sim on the project was created with enable_ltm=true). But simlin-mcp-core is a separate code surface -- it calls collect_all_diagnostics directly on its own synced db and never applies the #466 transient-enable, so the latch fix does not reach MCP analyze surfaces. #466 does not mention simlin-mcp-core.

Why it matters

UX / diagnostic visibility for AI-agent workflows. The MCP read_model / edit_model tools are the canonical "what's wrong with my model?" surface for agents, and they silently drop LTM advisories and fragment-failure warnings that a user who asked for LTM analysis would want to see.

Components affected

  • src/simlin-mcp-core (read_model.rs, edit_model.rs)

Possible approaches

Mirror the #466 approach: transiently enable ltm_enabled for the diagnostic-collection pass, gated on whether the MCP caller actually requested LTM analysis (so non-LTM callers don't pay the LTM synthesis cost).

Severity

Low-medium (UX; not a correctness bug).

Discovery context

Identified during an LTM-hardening session while tracing the #466 latch fix across all diagnostic-collection surfaces.

Part of epic #488.

Activity

  1. added
    engine
    ltm
    on Jun 2, 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

    engineltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions