Skip to content

mcp: SD-AI relationships omit variables whose equations do not parse #433

Description

@bpowers

When the MCP server saves an SD-AI JSON file, it regenerates the relationships array from the model's equations.
A variable whose equation does not parse contributes no relationships, so for a model that already has broken equations the saved array is missing those variables' links.
The question is whether an agent repairing such a model needs them.

Example

An SD-AI file where growth = population * (a parse error) and the file's relationships lists population -> growth.
Any EditModel call that does not touch growth is allowed (only new errors block an edit), and the saved file no longer lists population -> growth.

Why it matters

Speculative: no agent or user has been seen relying on the array being complete.
Leaving the links out is arguably correct, since the engine cannot know what a broken equation reads.

Fix

Recommended: document in the EditModel tool description and the SD-AI save code that relationships covers only equations that parse.
Alternative: keep the file's original relationships for variables whose equations do not parse, merged with the regenerated ones; this preserves information but can keep stale links for a variable the agent is in the middle of rewriting.

Pointers

  • src/simlin-mcp-core/src/fs_access.rs: the SourceFormat::SdaiJson arm of the save, which calls compute_link_polarities and generate_relationships
  • src/simlin-engine/src/json_sdai.rs: generate_relationships
  • src/simlin-mcp-core/src/tools/edit_model.rs: the new-error gate in edit_model

Activity

  1. added
    engineIssues with the rust-based simulation engine
    on Jun 8, 2026
  2. added
    mcpMCP tool surface / AI integration
    enhancementNew feature or request
    on Oct 12, 2026
  3. changed the title [-]SD-AI relationships may be incomplete for models with pre-existing equation errors[/-] [+]mcp: SD-AI relationships omit variables whose equations do not parse[/+] on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing as won't fix.

    Speculative: no consumer has been seen relying on a complete array, and leaving out links the engine cannot know is defensible. At most add a sentence of documentation.

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

    engineIssues with the rust-based simulation engineenhancementNew feature or requestmcpMCP tool surface / AI integrationwontfixThis will not be worked on

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions