Skip to content

Conversation

@younes-io
Copy link
Collaborator

PlusCal transpilation and SANY parsing (LM tool and MCP server paths) now execute on temporary copies, remapping diagnostics to the original files so user workspace files remain unchanged.


  • PlusCal transpilation now accepts an override path so diagnostics point to the original file
  • Both LM ParseModule tool and MCP SANY flow work on temporary copies, copying local .tla modules, remapping diagnostics back, and cleaning up after themselves
  • Added a regression test to confirm the temp-copy behavior and that original files stay untouched

@younes-io younes-io force-pushed the fix/sany-readonly-lm branch from a9d0b13 to 149b874 Compare November 30, 2025 16:02
@younes-io younes-io marked this pull request as ready for review November 30, 2025 16:28
@lemmy
Copy link
Member

lemmy commented Nov 30, 2025

Why don't we want the AI to be able to mutate the files?

@younes-io
Copy link
Collaborator Author

Why don't we want the AI to be able to mutate the files?

Before this PR, the LM/MCP path called transpilePlusCal directly on the user’s .tla, and the PlusCal translator writes in-place. That means an AI-invoked tool (no explicit user action) could modify workspace files just to parse, which is an unexpected side effect. This PR keeps AI calls read-only by working on a temp copy (see ParseModuleTool and MCPServer changes) and remaps diagnostics so the user still sees paths to their original files. The new regression test in tests/suite/lm/sanyTool.test.ts asserts the original file stays untouched while diagnostics reference it

@lemmy
Copy link
Member

lemmy commented Nov 30, 2025

Isn’t this bypassing the agent-chat mode that’s designed to track all LLM-driven changes? If the user wants to accept the synthesized changes, how is she supposed to apply them?

@younes-io
Copy link
Collaborator Author

This is not bypassing anything. This PR only makes the LM/MCP parse tool read-only. If users want AI-suggested edits, those should go through agent-chat so changes stay explicit and tracked.

@lemmy

This comment was marked as duplicate.

@younes-io

This comment was marked as duplicate.

@lemmy

This comment was marked as duplicate.

@younes-io
Copy link
Collaborator Author

as tools will be removed, let's close this, and re-assess in the future

@younes-io younes-io closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants