Skip to content

Release 0.11.0 (and npm 0.2.0) - #8

Merged
saadbuilt merged 152 commits into
mainfrom
release/0.11.0
Nov 3, 2026
Merged

saadbuilt merged 152 commits into
mainfrom
release/0.11.0

Conversation

@saadbuilt

Copy link
Copy Markdown
Owner

Releases the Python package 0.11.0 and the npm package 0.2.0. This covers everything since 0.10.1: the work was built feature by feature, then given one review, fix and verify pass over all of it (54 verified findings fixed, each with a regression test).

Python 0.11.0

  • Many workers on one store heal a broken key once. Threads, processes and async tasks share one in-flight heal, and the others adopt it after it passes the live check on their own page. Model declines are reused for MENDWRIGHT_DECLINE_TTL_SECONDS, and per-key leases and budgets are shared through keys/ records. At 1,000 threads on one broken selector: 1 model call (it was 3 calls plus 997 failures, or 1,000 calls with the caps off), 2 store writes and 0 lock timeouts.
  • Remote stores: MENDWRIGHT_STORE takes s3://bucket/prefix/ (pip install mendwright[s3]) or an HTTP(S) store, and a stdlib reference server is included. Writes use compare-and-swap, an unreachable store refuses heals instead of guessing, and MENDWRIGHT_STORE_READ_ONLY serves production workers.
  • A saved heal or seed row is checked on the page where it is used (role, destructive text, ARIA) before it acts.
  • heal_get_by="model" lets a model heal get_by_* calls, and heals are saved with a suggested get_by_* call that mendwright fix and the Action's pull request show.
  • MENDWRIGHT_RATE_PER_KEY_PER_HOUR and MENDWRIGHT_RATE_GLOBAL_PER_HOUR set the model budget without code.
  • mendwright demo asks your configured model and prints mendwright's own log lines; --scripted runs it with no model.
  • The guide got a readability pass.

npm 0.2.0: dismiss, expectValue/expectValues, interrupt({ run }), steps in any order, iframes one level down, open shadow roots, locatorAll with nonempty, healGetBy, the same reuse check before a saved heal acts, and unknown store fields are kept.

Checks run before this PR

  • Python with Playwright: 4527 passed, 0 failed.
  • Python without Playwright: 4433 passed, 0 failed.
  • Remote stores under moto: 502 passed.
  • Real browsers: 1781 passed, 0 failed.
  • TypeScript: 680 of 680 unit tests passed, and the typecheck was clean.
  • ruff: clean.

The wheel is 570,573 bytes, measured from a clean LF copy; it gets replaced by PyPI's size after the release.

…n log lines

mendwright demo now asks the provider from the environment, the one
mendwright doctor shows. With none, it exits 1 and says how to set one
up, the local model included, or to run --scripted, which keeps the old
offline run with a canned reply. --live stays as a hidden alias.

The coloured step-by-step display is gone, with --slow: the demo prints
what it is, the provider, the WARNING and INFO lines mendwright logs
during the run, and a one-line summary.
docs/assets/demo.svg recorded the coloured display mendwright demo no longer prints, and the README stopped showing it in 0.10.0. build_demo_svg.py, which built it, goes too, and so does the test's allowance for a recorded asset that isn't there yet.
The demo asks the configured model by default now, and these jobs have none: --scripted keeps the check offline, and it still fails the job when healing breaks.
The Python package's dismiss=True, ported rule for rule: Escape while the focus lets it reach
the popup, then its close button, then a decline button, never one that accepts, pays or goes
somewhere, and nothing at all on an alert dialog. The page scripts are the Python package's,
character for character, and the tests run both packages on the same rule tables, texts and
journal lines. With dismiss on, the locators heal.page does not heal get the same checks.
… and --scripted doesn't

The README's quick start and the guide's mendwright demo section said the demo was offline. Both now say it asks your provider and that --scripted runs with no model or key, and that python -m mendwright works when the mendwright command isn't on PATH. The guide shows the new output and drops --live and --slow from the options, and its doctor sample points at --scripted.
The example's README showed the old coloured display and the --live and --slow options. It now shows what mendwright demo --scripted prints, says the demo asks your model by default, and lists --scripted. demo.py, the signup-page script, is unchanged apart from its docstring.
Add a start-here line to the contents, and break the long paragraphs of
Configuration, Heals without a model, No changes per step, Checking what a
read returns and Lists into short paragraphs and lists, with the common case
first. Number parsing moves into a details block. No fact, heading or code
block changes.
Lead with the common case and turn the long paragraphs of Providers,
pytest plugin, Async Playwright, Iframes and Shadow DOM into short
paragraphs and lists. The notes on stores that 0.9.0 also writes move
into a details block. No fact, heading or code block changes.
…ach heal of a call with a get_by call that matched its element
Interruptions, Interruptions that need a form, Cookie banners, Popups
mendwright wasn't told about, Optional steps, Steps that moved to another
page and Steps in any order now open with what each is for and an example,
then list the rules. Playwright's overlay handler, the selectors a WARNING
names, button parsing and error routing move into details blocks. No fact,
heading or code block changes.
Selectors, overrides.json, journal.jsonl, Open a pull request with the
fixes and Alerts get short paragraphs and lists in place of the long
run-on ones: the per-key fields, the journal events, what a canary's by
says and what the action does are each one item per line. No fact,
heading or code block changes.
Checking for drift before a run, mendwright doctor, report and notify,
Low-level API and InvalidSelector lose their run-on paragraphs: the
action words, pre-0.9.0 addresses, doctor's extra lines, list heals in a
report, run selection and webhook masking are lists now. No fact,
heading or code block changes.
Healer.locator(), Log lines and journal events, Show heals in the job
summary and mendwright notify now say what they are for before their
code block. The expect_value= lead, the popup summary and the webhook
masking lead now say no more than the rules below them.
…expectValues })

The Python package's expect_value=, ported check for check: a heal that passes the gate can
still land on the rating next to a price, so a read through a selector a heal saved must return
what the key's check accepts, or the heal is quarantined and the read throws instead of handing
back the wrong value. A read through the selector in the code is never checked. parseMoney() and
parseNumber() give amounts as the string Python's Decimal prints, and the tests compare the
parsers, the checks, the texts and the journal lines with the Python package's.
…and narrow spaces escaped

pyRepr leaves the characters str.isprintable() is false for as they are, and a browser puts
exactly those in a price. The refusal now writes them as the Python package does, such as
'1\u202f299,00\xa0€', and the tests compare quoted() with Python's on such values.
…omium only

Under load, WebKit can let Playwright's click return before the navigation its handler starts is scheduled, so whether the click raises depends on timing there, and the test failed now and then.
…lls, suggested calls, and the budget from the environment

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/guide.md
… their own

Those tests skip without the Playwright or Selenium package, and no job ran them: the test
jobs install neither, and the browsers job, which installs both, runs only the tests
marked browser. So 81 offline tests never ran in CI, 25 of them new in 0.11 (the
get_by model heals and the reuse check among them). A job on Python 3.12 installs
.[test,playwright,selenium], with no browser, and runs the offline suite; a job of its own
keeps the browsers job within its 30 minutes.
…n it lets one through

Every refusal ended with 'asks again once older attempts drop out of the hour' and the two
rate variables, which is wrong for a spend cap (it counts the run, and no variable sets
it), for a rate passed to open() (the variable then changes nothing) and for a cap of 0
(nothing drops out of it). open() now records what set each rate: the variable, the
argument or the guardrails passed, and the message names that one; a spend cap says it
holds for the rest of the run, and a cap of 0 that it lets no attempt through.
…h test

tests/conftest.py unset most of the variables mendwright reads, but not
MENDWRIGHT_SUGGEST_GET_BY, MENDWRIGHT_LOCAL_MODEL or MENDWRIGHT_LOCAL_MIN_CONFIDENCE, so a
developer's shell with one of them set changed what the tests saw: with
MENDWRIGHT_SUGGEST_GET_BY=1 every heal saved a twin and a twin test failed. A test now
checks that every MENDWRIGHT_ variable the package names is in the list.
The demo passed dry_run, timeout_ms and fingerprint to open() but nothing for the rates,
get_by routing and twins, so MENDWRIGHT_RATE_PER_KEY_PER_HOUR=0 refused its heal and
--scripted called that a bug, and a value open() refuses (a rate of 'lots',
MENDWRIGHT_SUGGEST_GET_BY=maybe, MENDWRIGHT_DECLINE_TTL_SECONDS=soon) ended it with a
traceback. The demo now passes no rate limit, heal_get_by=False and suggest_get_by=False,
sets MENDWRIGHT_STORE_READ_ONLY and MENDWRIGHT_DECLINE_TTL_SECONDS aside as it did
MENDWRIGHT_DISABLE, and says in one line when open() refuses a setting.
… a model call

The demo's header says the scripted reply makes no model call, and its last line then
said '1 model call'. With ScriptedProvider the count is of scripted replies now; a live
provider's calls are still model calls. The samples in the guide and the demo's README
say so.
…en something can heal them

With MENDWRIGHT_HEAL_GET_BY=model, doctor counted get_by calls as healed whatever else was
set, so with MENDWRIGHT_DISABLE=1, or with the fingerprint tier off and no provider, it
said a call is healed when nothing heals it, and --json said heals: true. It also said a
call that never matched goes to the model, which only a get_by_role() call does. heals
now needs the fingerprint tier on, or a provider configured with MENDWRIGHT_DISABLE off,
and the text says what heals the call, or why nothing does.
…nd in PowerShell on Windows

The hint of the commands that refuse a store URL sent $MENDWRIGHT_STORE_TOKEN, which is
empty when the token is kept in the file MENDWRIGHT_STORE_TOKEN_FILE names (the docs' way
for a Docker or Kubernetes secret), so curl sent 'Bearer ' and got 401; and cmd.exe and
PowerShell don't expand $NAME. The hint now reads the file when that variable is set, and
on Windows gives the Invoke-WebRequest form. It writes out neither the token nor the
file's path.
… heal

mendwright deletes nothing, as the same page says, so the DeleteKeyRecordsOnly statement
only let a compromised worker delete coordination records. The policy is now GetObject
and PutObject on the prefix and the ListBucket statement, and the page says to give
DeleteObject to whoever cleans up keys/ by hand.
…et too

With s3:GetObject alone, S3 answers the GET of a key record that doesn't exist yet with
403, which reads as an outage: the worker logs it, journals store.unavailable, and stops
reading the store for 1 to 60 seconds after each one. docs/remote-store.md already asks
for the ListBucket statement.
…n the store

It said the limit is shared per store file within one process. Since 0.11 the per-key
limit counts the attempts of every process on the machine that uses the store file, and of
every machine on a remote store, through the key's record; the global limit is still per
process, and workers waiting for another's heal spend none.
…, in SECURITY.md

Since 0.11 every store writes a record per key next to it, which holds the key, the times
of the model attempts, the model's decline reasons, which can quote the page, and a lease
owner made of the host name and process id. SECURITY.md listed none of it, and said a
remote store's records have 'the same fields' as nothing.
…DWRIGHT_STORE_READ_ONLY's

It told teams to give the other workers read-only access with MENDWRIGHT_STORE_READ_ONLY=1,
which only stops that process writing: a worker with the healers' IAM role or the server's
one token can still change every worker's selectors. It now says to give those workers
credentials that can only read, and to set the variable so they don't try to write.
… comment, doctor's sample

- 'How it works' linked to a README heading that doesn't exist; it now links to the checks
  in SECURITY.md.
- The command line has eight commands, notify included, not seven.
- A pin by SHA of the action takes the release tag as its comment; the prose named
  v0.10.0 next to @v0.10.1, and nothing bumps prose at a release.
- doctor's sample left out MENDWRIGHT_LOCAL_MODEL and local, which doctor prints.
…ll hit it

It told users whose workers hit the cap to raise timeout_ms above the model's answer time,
which changes nothing since a follower waits for the leader up to 60 seconds whatever its
timeout. It now names what does: different pages, a leader slower than FOLLOW_CAP, or a
provider failure, which is never shared; and what sets the cap, as the message now says.
…e_path takes a URL

The open() table and the journal section put journal.jsonl next to the store, which for a
store URL is in MENDWRIGHT_JOURNAL_DIR, ./.mendwright by default, on each machine; and the
store_path row described a path only.
…akes and what skips

It said the offline suite takes about 10 seconds with one or two skips; it takes a few
minutes, and skips what needs Playwright, Selenium, pytest-xdist, pytest-rerunfailures, a
live gateway or POSIX. [dev] also installs cssselect, boto3 and moto, and the autouse
fixtures unset every MENDWRIGHT_* variable and reset more shared state than it listed.
…nly for a control

'A repair is used only if it matches exactly one visible element with the step's role'
held for a new repair, but a saved repair of a key that is only read is used when its
span became a div on another page variant: the reuse check compares roles only when one
of them is a control's. The bullet now says a repair is made under those rules, and a
saved repair of a control is checked again on each page that uses it.
…already has

It said the TypeScript port has no dismiss, expect_value, iframe or shadow-root repairs,
all of which npm 0.2.0 has. What it leaves out, by its own README: Selenium, remote
stores, one heal for many workers and model repairs of getBy* calls; and it uses the
Python package's commands on its store.
… store in S3 or over HTTPS

The README never mentioned 0.11's two main additions, one heal for many workers on one
store and remote stores. One bullet under In CI says what they do and links to the remote
store page, and that the commands and the GitHub Action read a downloaded copy.
…dows is deleting

ba0b117 counted every refusal of one acquire, so a waiter behind more than four writers,
which can meet the moment a lock file is being deleted once per release, raised
PermissionError again under heavy contention. The count starts again each time the lock
file is seen, so only refusals in a row with no lock file between them, which a folder it
cannot write gives, raise.
…le() call heals onto

Since 1174d08 a call that never matched is checked against every gate role its ARIA role
can mean, so a heading with no level= heals onto any of h1 to h6.
…ables it unsets

The test imported conftest by name, which in a whole run is tests/browser/conftest.py, so
it failed with ImportError there while it passed alone.
# Conflicts:
#	README.md
On GitHub Actions every journal line carries the run id (gh-<run>.<attempt>), so the
test failed in CI only. The unit tests already leave it out the same way.
Its unit suite requires the Python package (MENDWRIGHT_REQUIRE_PYTHON=1), and some of
the tests that compare the two load tests/conftest.py or lxml.cssselect. CI's js job got
the same fix.
…cesses

A spawned process copies the run's sys.path, and a whole run under pytest 7 puts
tests/browser first, so 'from conftest import FakePage' found that folder's
conftest.py and the process died with ImportError. The parent then waited out its
timeouts: the lowest-deps job failed four herd tests and hung in test_remote_fleet.py
until the job's 15 minutes ran out. Under pytest 8 and later, tests comes first.
@saadbuilt
saadbuilt merged commit 6a5a854 into main Nov 3, 2026
17 checks passed
@saadbuilt
saadbuilt deleted the release/0.11.0 branch November 3, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant