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
When the MCP server saves an SD-AI JSON file, it regenerates the
relationshipsarray 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'srelationshipslistspopulation -> growth.Any
EditModelcall that does not touchgrowthis allowed (only new errors block an edit), and the saved file no longer listspopulation -> 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
EditModeltool description and the SD-AI save code thatrelationshipscovers 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: theSourceFormat::SdaiJsonarm of the save, which callscompute_link_polaritiesandgenerate_relationshipssrc/simlin-engine/src/json_sdai.rs:generate_relationshipssrc/simlin-mcp-core/src/tools/edit_model.rs: the new-error gate inedit_model