Skip to content

Release 0.11.1: one fingerprint run for a decline herd, soft fingerprint writes, async confirm docs - #9

Merged
saadbuilt merged 8 commits into
mainfrom
fix/0.11.1
Nov 3, 2026
Merged

saadbuilt merged 8 commits into
mainfrom
fix/0.11.1

Conversation

@saadbuilt

@saadbuilt saadbuilt commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Release 0.11.1: fixes for the problems the 0.11.0 review left open, and for what one review pass over these changes found. Python only: the TypeScript package has none of the code paths involved.

A decline herd scores the page once (N1). With the fingerprint tier on, every worker that waited for another's attempt at a key whose element is gone scored the page before reusing the model's decline, and each journaled heal.requested. 1000 threads made 1000 fingerprint runs and 1000 requests for 1 model call. A decline now keeps, in this process, a digest of the page (mendwright.fleet.scored_page) when the tier found nothing there from the HTML alone. A worker on the same page takes the decline before the tier. A worker on another variant of the page path still scores its own page first, and so does one where the tier had to ask the live page what is visible (a phone and a desktop can show the same HTML differently). A worker with no model gets its own decline. heal.requested is journaled only once an attempt goes past a reused decline or another worker's heal.

Soft fingerprint writes (N2). A store's waiting fingerprint, written by another store's flush in the same process, kept the store's next fingerprints from being written at exit. The flush now decides with what the file holds. A waiting fingerprint is written over the one it replaced, as before, or over what this process's last flush left there, which no other process has changed since. Stores keep no flush state. A remote store's soft writer also updates the process's read of overrides.json, and a fingerprint set back to the one a store read takes the place of its own change that waits (a 0.11.0 bug).

Async confirm docs (N3). confirm() and confirm_all() are sync and write on the calling thread. The docs said every remote-store request of the async healer runs in a worker thread. The docs and docstrings now say so and show asyncio.to_thread(), and a test checks it.

Messages. The two store URL refusals that ended in a period don't any more, so the command line and doctor end them with one.

Checked:

  • Every new test fails on the code before its fix.
  • The offline suite passes under pytest 7.4 with lxml 5.0 and no extras, and under pytest 9.
  • The remote and herd tests pass with moto.
  • Fleet harness, 1000 threads: 1 fingerprint run and 1 heal.requested for 1 model call where there were 1000; the fingerprint-page herds are unchanged.
  • The guide's 1000-thread numbers hold at timeout_ms=3000.
  • The wheel built from a clean archive is 572,477 bytes; after the release the docs get the size PyPI serves.

…hread

The guide and docs/remote-store.md said the async healer makes every request to a
remote store in a worker thread. These two are sync, so a quarantine they write, and
their report to a gateway, run on the thread that calls them: the event loop waits.
The docs and docstrings now say so and show asyncio.to_thread(), and a test checks
that it keeps the write off the loop.
…as a request

With the fingerprint tier on, every worker that waited for another's attempt at a key
whose element is gone scored the page before it reused the model's decline, and each
journaled heal.requested: 1000 threads made 1000 fingerprint runs and 1000 requests for
1 model call (since 163fe40, which ran the tier first so another variant of a page could
still heal). A decline now keeps, in this process, a digest of the page the tier found
nothing on (its HTML, the key's fingerprint and role: mendwright.fleet.scored_page), and a
worker on that same page takes it before the tier; a worker on another variant still
scores its own page first. heal.requested is journaled for such a page only once the
attempt goes on past the reused decline, so mendwright report counts 1.

Measured with 1000 threads, timeout_ms=10000: 1 fingerprint run and 1 heal.requested
where there were 1000 each; model calls, writes and the fingerprint-page herds unchanged.
…ush wrote

A store's new fingerprint waited for SOFT_EVERY; a flush of another store of the same
process (store.flush() or flush_all()) wrote it; the store's next fingerprint was then
skipped at exit, because it was written only over the fingerprint the store had read, and
the file held the store's own newer one. A flush now notes what it left in the file and
its number (SoftWrites.left, SoftWrites.flushes), and a store whose own last change a
flush left there after the store last read or wrote the file takes that as what its next
change replaces. A fingerprint another process saved in between still stays, and a
store's own later write still comes first.
The refusals of a URL with a user name, a password or a credential in its query string
end in a sentence of their own, and the command line and doctor added another period.
The guide's table of mendwright notify's exits gets the remote store row: 0, or 1 with
--fail-on-error, as for its other refusals, since an alert must never fail the tests.
Reusing a decline before the fingerprint tier:
- Only when the tier found nothing on that page from its HTML alone. When it asked the live
  page whether elements show, which can differ with the same HTML (a phone and a desktop),
  the next worker scores its own page: _fingerprint_tier says which ('html' or 'live').
- Not for a worker with no model, which gets its own no_provider decline, with the steps to
  configure one, as before.

A store's soft fingerprints after another store's flush wrote its change:
- The store now moves its merge base on to its own change the flush left in the file, so any
  number of later changes replace it, not only the first. It takes that change only while
  its base is still the value the change replaced, so no flush counter is needed: the races
  between a flush and a store's read or write it had, and a dict changing while iterated,
  are gone.
- A fingerprint set back to the one the store read takes the place of its change that
  waits, which the exit flush wrote over it before.
- A remote store's soft writer hands what it wrote to the process's read of overrides.json,
  as a store's own write does, so a refresh doesn't take the version before it.

The two store URL refusals that ended in a period don't any more, and doctor's problem line
for a store URL ends with one, as the command line's lines do.
A store moved its merge base on to its own change another store's flush had written. That
broke two cases main got right: another process putting the old fingerprint back, after
which the store's next change was skipped, and a change made while that flush ran.

So the flush decides now, with what the file holds: a waiting fingerprint is written over
the one it replaced, as before, or over what this process's last flush left there, which
no other process has changed since. Stores keep no flush state, and _persist_soft is as
on main, but for one thing: a fingerprint set back to the one the store read takes the
place of the store's own change that waits, and only that.

Also: scored_page() takes a page whose text holds a lone surrogate, and the CHANGELOG and
the guide say an attempt that another worker's heal answers after the fingerprint tier
found nothing isn't a heal.requested of its own either.
@saadbuilt saadbuilt changed the title Fixes for 0.11.1: one fingerprint run for a decline herd, soft fingerprint flushes, async confirm docs Release 0.11.1: one fingerprint run for a decline herd, soft fingerprint writes, async confirm docs Nov 3, 2026
@saadbuilt
saadbuilt merged commit c5384aa into main Nov 3, 2026
17 checks passed
@saadbuilt
saadbuilt deleted the fix/0.11.1 branch November 3, 2026 18:07
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