From cf39ad7551a58b77485ffaf9806554e713046193 Mon Sep 17 00:00:00 2001 From: Titus Date: Mon, 23 Nov 2026 17:39:48 +0100 Subject: [PATCH] The layout answers' version key says it is deprecated where help() shows it KindLayout and AroundLayout carry a version key that is always 1 and that the layout profile's mark does not have; the npm SDK marks its twin @deprecated. Here only a source comment said so, which help() and an editor's hover do not show. The two class docstrings now say it, with when the key leaves. No behaviour changes. The changelog's Unreleased section also names the test added for the address parser's length check on a moment. Co-Authored-By: Claude Fable 5.2 --- CHANGELOG.md | 3 +++ src/onlyworlds/layout_kind.py | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a6799b..4d3a244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ The package version runs on its own semver; the schema it is generated from is ` ## Unreleased +- `KindLayout` and `AroundLayout` say in their docstrings that the `version` key is deprecated: it is always 1, the layout profile's mark carries no such key, and it leaves when the npm SDK's does, at its 5.0. Until now only a source comment said so, so `help()` and an editor's hover showed nothing. No behaviour changes. +- A test holds the address parser's length check on a moment: a run of more than 4,300 digits after `@` is refused as `bad_moment` before `int()` can raise on it, and the readers of prose pass over it. + ## 0.141.0 (2026-11-23) - **`name_finder(elements, case=...)`**: a world's element names found in prose. It reads the names once and answers `find(text)`, which lists every `NameFound` (`start`, `end`, `element`) in order, `element` being the object that was passed in, so a tool can mark the words that are elements. It finds and never writes. `case` must be given, `"exact"` or `"folded"` (simple case folding, Unicode 15.1), with no default; `names` gives the names an element is found by, by default its `name` alone. The rule: a whole name only, where the character on each side is not a letter, a combining mark, a decimal digit or an underscore in any script (so `Kira's` holds the name and `Kiran` does not); trimmed, three characters at least; the longest whole name where several start at one place; a name two elements share is never answered, nor anything inside it; nothing inside an address or a Markdown link. Limits: text is compared as written, with no Unicode normalisation; a space in a name matches that one space; in a script written without spaces between words a name is whole only between punctuation or spaces. The work for one text is at most its length times the longest name's length, whatever the number of names, with no pattern that backtracks. The npm SDK's `nameFinder` (4.194.0) is the same rule on the same file of cases (`tests/fixtures/name-finder.cases.json`, 47 cases, each want written by hand); the two differ only in what `start` and `end` count, code points here and UTF-16 units there. diff --git a/src/onlyworlds/layout_kind.py b/src/onlyworlds/layout_kind.py index a3de874..3b385e7 100644 --- a/src/onlyworlds/layout_kind.py +++ b/src/onlyworlds/layout_kind.py @@ -40,11 +40,14 @@ class KindPoint(TypedDict): class KindLayout(TypedDict): - """What ``layout_by_kind`` answers: one point per node, in the graph's node order, and the method that made them.""" + """What ``layout_by_kind`` answers: one point per node, in the graph's node order, and the method that made them. + + ``version`` is deprecated. It is always 1: a method's word is its version, so read ``method``, never this + number. The layout profile's mark carries no version key, and this one leaves when the npm SDK's does, at + its 5.0.""" method: Literal["by-kind"] - # Always 1: a method's word is its version, so read ``method``, never this number. The layout profile's - # mark carries no version key; this one leaves when the npm SDK's does, at its 5.0. + #: Deprecated: always 1 (the class docstring says when it leaves). version: int points: list[KindPoint] @@ -60,11 +63,14 @@ class AroundPoint(TypedDict): class AroundLayout(TypedDict): - """What ``layout_around`` answers: the focus and every element within the steps, in the graph's node order.""" + """What ``layout_around`` answers: the focus and every element within the steps, in the graph's node order. + + ``version`` is deprecated. It is always 1: a method's word is its version, so read ``method``, never this + number. The layout profile's mark carries no version key, and this one leaves when the npm SDK's does, at + its 5.0.""" method: Literal["around"] - # Always 1: a method's word is its version, so read ``method``, never this number. The layout profile's - # mark carries no version key; this one leaves when the npm SDK's does, at its 5.0. + #: Deprecated: always 1 (the class docstring says when it leaves). version: int points: list[AroundPoint]