Skip to content

v0.1.7 — 27 fixes from the pre-launch stability audit

Choose a tag to compare

@shdbl shdbl released this 10 Oct 04:22
· 57 commits to main since this release

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_index end-to-end. describe now emits fig_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 --write now 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 in changes.
  • 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_LANG override); --json stays 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 --json always emits valid JSON —
    including on failure paths.

Interaction

  • Help window NameError (the process used to hang after pressing ?).
  • Ctrl+click multi-select used event.key, which real Qt reports as
    control — fixed to use event.modifiers (with a reverse test proving it).
  • Bare clicks no longer consume an undo step; undo restores canvas size using
    the real dpi; --fig close counting.

Parameters & tooling

  • Previous rounds' parameter files are no longer deleted; --dry-run no
    longer cleans anything; apply gained an mtime staleness guard (--force).
  • check no longer flags legitimate asymmetric layouts; describe no 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/).