fix: get_symbol_info returns wrong data for every small symbol

Parser used a 5000-char heuristic slice per symbol; any symbol block
shorter than 5000 chars bled into the next one, and last-write-wins in
the properties dict ensured the neighbor's data clobbered the target.
Reported as Simulation_SPICE:OPAMP returning PJFET data.

Switch to parenthesis-depth tracking to find the true end of each
(symbol ...) block. Also surface Sim.Pins so agents can read opamp pin
numbering without inferring it from schematic placement.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Eugene Mikhantyev
2026-04-18 12:55:41 +01:00
parent 4a6d6c725a
commit 55ec4950d9
4 changed files with 563 additions and 5 deletions

View File

@@ -158,6 +158,7 @@ Returns symbol references that can be used directly in schematics.`,
info.category ? `Category: ${info.category}` : "",
info.lib_class ? `Class: ${info.lib_class}` : "",
info.datasheet ? `Datasheet: ${info.datasheet}` : "",
info.sim_pins ? `Sim.Pins: ${info.sim_pins}` : "",
]
.filter((line) => line)
.join("\n");