Repository navigation
v0.1.7 — 27 fixes from the pre-launch stability audit
Release after a pre-launch stability audit: five independent audit
passes (write-back engine / interaction & lifecycle / CLI-agent interface /
environment portability / adversarial input) plus an independent verification
pass. 27 issues fixed, every one with a reproduction.
Write-back engine
fig_indexend-to-end.describenow emitsfig_index/n_figs; the
engine refuses to write back when a multi-figure script has no figure number
(it used to silently write into another figure and still report
"verification passed").- Concurrency.
apply --writenow takes a per-script lock, and each run
keeps its own pid-suffixed backup — two concurrent runs used to both report
success, lose one edit, and overwrite the single shared backup. - Atomic replacement preserves file permission bits; fields skipped by the
overlap guard are no longer counted inchanges. - Encoding. GBK and UTF-8-BOM scripts are now readable and writable, and
the original encoding is preserved.
Output & machine contract
- The seven
✓/✗markers became ASCII: on Chinese Windows with captured
stdout the tool used to crash after the file had already been rewritten. - New
messages.py: human output follows the system language (--lang/
MPLTWEAK_LANGoverride);--jsonstays English + stable error codes. - Block sentinels are now language-neutral ASCII and still recognise the old
Chinese ones. - stdout is redirected at the fd level; the multi-figure summary goes to
stderr; top-level handling guarantees--jsonalways emits valid JSON —
including on failure paths.
Interaction
- Help window
NameError(the process used to hang after pressing?). Ctrl+clickmulti-select usedevent.key, which real Qt reports as
control— fixed to useevent.modifiers(with a reverse test proving it).- Bare clicks no longer consume an undo step; undo restores canvas size using
the real dpi;--figclose counting.
Parameters & tooling
- Previous rounds' parameter files are no longer deleted;
--dry-runno
longer cleans anything;applygained an mtime staleness guard (--force). checkno longer flags legitimate asymmetric layouts;describeno longer
reports log axes as linear.
⚠️ Change in default install
PyQt5 is no longer a default dependency. For the interactive window:
pip install -U "mpltweak[qt]"The CLI (describe / check / apply / mcp) does not need a GUI backend
and works with a plain pip install -U mpltweak.
Also: mcp extra now carries a python_version marker (so Python 3.9 no
longer silently downgrades), python -m mpltweak works, and the demo GIFs
were redrawn with a low-saturation palette.
Full details: each fix is documented in the commit message and covered by
regression tests (tests/).