Repository navigation
v2.5.0 - every open issue closed
Issues #3 through #11, all reported externally, all closed. Eight of the nine are one defect wearing different clothes: a result built from the request instead of from a read.
The two that destroyed data
#11 pine_open pasted source into the previously open script. setValue is a text mutation. It put the target's source into whatever buffer was open, left the editor bound to the previous script, and returned {success: true, name: <target>}. A following pine_save wrote the opened script's code over the previous one. Four saved scripts on the reporting account ended up sharing one in-code title that way.
The obvious check does not catch it: comparing the buffer against a known copy of the target passes, because the text really is the target's. It proves the fetch, not the binding. The panel title is now read back; a mismatch throws and names both scripts, and an unreadable title returns binding_verified: false rather than a confident wrong answer.
#10 pine_open had no confirm_overwrite guard, unlike both its siblings. Opening a script is how an agent reads one, so it was reached for early and often, destroying unsaved work silently. The guard now runs before the fetch: refusing after the buffer is gone is not a guard.
New tool, requested in that issue: pine_get_script_source reads a saved script over the REST API without touching Monaco. A test asserts the generated page script contains no setValue and does not even look for the editor.
The rest
- #3
capture_screenshotreturned a stale frame from a hidden tab: a real PNG of the right chart showing the wrong data, header and clock current while the candles were frozen. Refused now unless the tab is visible. - #4
region:"chart"captured pane 0, not the active pane. Prefers.chart-container.active, reportspane_selected_by, warns on a fallback. - #5 A timed-out readiness check was reported as a failed mutation, so retries double-applied. The contract now, stated in the tool descriptions: a thrown error means nothing changed.
indicator_add_from_searchpolls to a deadline instead of sleeping 1500ms and hoping. - #6
tab_closewas blocked by the unsaved-changes dialog and blamed the tab count. The dialog is its own CDP page target, invisible to every selector the chart page can run. Found by enumerating targets now, named, and dismissed so the chart is not left blocked. "Save and close" is never clicked automatically. - #7
replay_startsilently relocated an out-of-range date, so every read afterwards was correct for a date nobody asked for. Refused beyond a 4-day tolerance, replay stopped rather than left pointing at the wrong date. Changing timeframe during replay is refused too. - #8
draw_shapereported success for an unknown shape and silently made a flag. The created name is read back; a mismatch removes the wrong drawing and throws, and says so plainly if the removal failed. - #9 The CLI could not reach the safety guards. Three were refusals whose own hint named a flag the CLI did not have.
tests/cli_mcp_parity.test.jsnow executes both sides and compares them, including that each declared flag is actually read by its handler.
What the existing suite caught
My first cut of the replay guard reached past injected _deps to the module-level CDP functions. tests/sanitization.test.js hung: a unit test opening a real browser connection. That is the fail-open dependency injection this project has been bitten by before, and the hermetic suite caught it in one run.
Three existing tests were passing on mocks where nothing happened, including drawShape's sanitization tests running against a chart where no shape was ever created. Fixtures fixed.
101 new tests. 909/909, lint clean. Every fix mutation-tested; the page-side Pine lookup and the capture selector ordering are executed against stub DOMs rather than described by a mock.