Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The package version runs on its own semver; the schema it is generated from is `

## Unreleased

- Docstrings describe onlyworlds.com's wrong-PIN limit as it stands since 2026-11-21: ten different wrong PINs on one key or account within fifteen minutes refuse every PIN there, and the same wrong PIN never counts twice. No behaviour changes: a `429` `rate_limited` is still never retried and still stops `push`.

## 0.139.1 (2026-11-21)

- **`push` goes on past a refusal about one element.** A world's Charter and the elements it names now change only by the owner and co-builders (`403` `keeper_only`); a contributor's push that met one of them stopped every later patch, as it does for a refused key. `keeper_only`, `review_by_another` and `not_reader` now join `not_author`: that patch is failed and the run goes on. Any other `403`, and one whose code is new, still stops the run (`push.ELEMENT_403`).
Expand Down
11 changes: 7 additions & 4 deletions src/onlyworlds/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
writes refuse one before sending, and strip any other ``known_of``;
- lists are ``{data, has_more, next_cursor}``, continued with ``?cursor=``;
- ``Idempotency-Key`` on POST and ``/bulk`` replays the first successful answer for 24 h;
- 429 carries ``Retry-After``; on v2 its only 429 is ``rate_limited``, the failed-PIN
throttle (10 failures lock the key for 15 minutes); under load keel answers 503 ``server_busy`` with
- 429 carries ``Retry-After``: ``rate_limited`` is the wrong-PIN limit (ten different wrong PINs on
one key or account within fifteen minutes refuse every PIN there, the right one included, for up
to 900 seconds; the same wrong PIN never counts twice), ``too_many_requests`` the request budget,
``quota_exceeded`` a daily cap; under load keel answers 503 ``server_busy`` with
``Retry-After: 5`` (2026-09-28).

One difference from the TypeScript SDK, on purpose: this client retries 429, 5xx and
Expand Down Expand Up @@ -252,8 +254,9 @@ class RetryPolicy:
Idempotency-Key is still running, which is what a retry after a timeout meets: the
retry, same key and body, replays its answer once the first has finished.

Never a 429 with code ``rate_limited``: keel sends it for a wrong PIN, and each retry is
one more failure toward locking the key. keel's 500 is an unhandled exception, almost
Never a 429 with code ``rate_limited``: keel sends it once ten different wrong PINs have
been tried on the key or account, and it refuses every PIN there, the right one included,
for up to fifteen minutes, so a retry inside the run only waits. keel's 500 is an unhandled exception, almost
always the same on every try, so it gets one retry, not the full budget.

Waits ``Retry-After`` when the server sends a valid one (whole seconds or an HTTP
Expand Down
4 changes: 2 additions & 2 deletions src/onlyworlds/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

A generic link's two halves (Pin's ``element_type`` / ``element_id``) go together when
either changed: keel refuses a write that sets one half. The run stops at the first
answer that refuses the key itself (``stops_run``): a wrong PIN repeated across a push
locks the key for every tool that uses it.
answer that refuses the key itself (``stops_run``): every later patch would get the same
answer, and a key or account at keel's wrong-PIN limit refuses every tool that uses it.

A 202 is a patch held as a proposal (the world takes this AI seat's writes as
proposals): the element did not change, so it is neither pushed nor failed. It is counted in
Expand Down
2 changes: 1 addition & 1 deletion tests/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def pin(eid: str, et: str) -> dict[str, Any]:
],
)
def test_a_refused_key_stops_the_run(tmp_path: Path, make_client: MakeClient, status: int, code: str) -> None:
"""A wrong PIN on every patch would lock the key (10 failures, 15 minutes) for every tool that uses it."""
"""A refused key refuses every later patch too: the run stops at the first."""
chars = [wire_char(f"c0000000-0000-7000-8000-00000000000{i}", "A") for i in range(5)]
edited = [{**c, "name": "B"} for c in chars]
base, edit = folders(tmp_path, {"character": chars}, {"character": edited})
Expand Down