mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 13:24:14 +02:00
08b83f23e3
#984 switches JavaScript scripting off by default, and five tools here drive QElectroTech through --run: qet_query, qet_continuity, qet_check, qet_project_new, qet_edit. Against such a build they all stop working, and what came back was exit code 3 and a paragraph of French naming a settings dialog nobody driving an MCP server is looking at. Nothing needed building to make them work again -- _run_qet() inherits its environment, so QET_ENABLE_SCRIPTING=1 in the "env" block of the client's own configuration already reaches QElectroTech. Verified both ways against a #984 binary: without it qet_query returns ok=false exit=3, with it ok=true and the rows. So this is about saying so. The refusal is now recognised and answered with an instruction the caller can act on, keyed on QElectroTech naming the variable with exit 3 as a fallback for a future build that words it differently. Two older hints fitted the same symptom and were overwriting it -- "the binary never ran the script ... is it a build with --run support?" sends the reader to check the one thing that is fine -- so both now yield to whatever the launch already reported. qet_check builds its answer fresh rather than layering onto the launch result, so it carries the reason across explicitly; without that every check read "no result came back", which is true and tells nobody why. The server does not set the variable itself, on purpose. A switch a program turns on for itself is not a switch: whoever configured this server and pointed it at a QElectroTech binary made that choice, and their interactive QElectroTech keeps whatever its own setting says. README says this, and the registration example now shows the env block with both variables in it. Six tests, faking subprocess.run so they cost no launch. Two are structural rather than behavioural: one fails if either older hint goes back to assigning over the specific one, the other reads which tools actually pass script= to _run_qet and fails if the hint's list of them drifts. Both were mutation-checked by reintroducing exactly those mistakes. 176 tests pass with QET_BINARY, QET_ELEMENTS, QET_EXAMPLES and QET_ENABLE_SCRIPTING set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>