Let the runner drop and count a row without an id, a title or a link, as ADR Plugins 3.8 has it, in one place for whole, paged and search reads: the count is stamped per target, logged, named on the board's row, and over 10% of the rows fails the read; the 28 readers hand every listing over instead of skipping it
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
38c31c830b
commit
911dfe8584
58 files changed
+479
-203
No files matched your search
+17
-3
@@ -10,7 +10,10 @@ both; nothing here decides how a board is read, so the words never disagree
|
||||
with the pull as long as they read the keys the pull writes.
|
||||
|
||||
A word with a number carries it after a colon ("without text: 12"), and the
|
||||
filter matches the phrase before the colon (`WORDS`).
|
||||
filter matches the phrase before the colon (`WORDS`). One word is outside
|
||||
`WORDS`: the listings the last read dropped for want of an id, a title or a
|
||||
link ("3 listings dropped: no title or link", `_runner.valid`), shown on the
|
||||
board's row and not offered by the filter.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -49,7 +52,7 @@ WORDS: dict[str, str] = {
|
||||
|
||||
#: The `state` keys `words` reads, `<prefix>:<key>:<target>`.
|
||||
KEYS = ("failing", "ok", "complete", "swept", "sweep", "filtered", "remote_unasked",
|
||||
"narrowed", "detailfailed")
|
||||
"narrowed", "detailfailed", "dropped")
|
||||
|
||||
|
||||
class Texts(NamedTuple):
|
||||
@@ -84,7 +87,8 @@ def texts(store: Store) -> dict[int, Texts]:
|
||||
def words(module: ModuleType, state: Mapping[str, str], target: str,
|
||||
sub: Subscription | None, size: int | None, *, plan: Plan | None = None,
|
||||
line: str = "", counts: Texts | None = None) -> list[str]:
|
||||
"""The limits of one board, in the order of `WORDS`, those that apply.
|
||||
"""The limits of one board, in the order of `WORDS`, those that apply, the
|
||||
rows the last read dropped after "read incomplete".
|
||||
|
||||
`state` holds the board's keys (`state_of`), `size` its kept size,
|
||||
`plan` and `sub` the reach it is read with (for "read whole"), `line` the
|
||||
@@ -105,6 +109,8 @@ def words(module: ModuleType, state: Mapping[str, str], target: str,
|
||||
out.append("failing")
|
||||
if state.get(key("ok")) and not state.get(key("complete")):
|
||||
out.append("read incomplete")
|
||||
if dropped := _count(state.get(key("dropped"))):
|
||||
out.append(f"{dropped} listing{'' if dropped == 1 else 's'} dropped: no title or link")
|
||||
if state.get(key("swept")) == "1" or key("sweep") in state:
|
||||
out.append("swept")
|
||||
if state.get(key("filtered")) == "1":
|
||||
@@ -130,6 +136,14 @@ def words(module: ModuleType, state: Mapping[str, str], target: str,
|
||||
return out
|
||||
|
||||
|
||||
def _count(value: str | None) -> int:
|
||||
"""A number kept in state, 0 for none or one that does not parse."""
|
||||
try:
|
||||
return max(0, int(value or 0))
|
||||
except ValueError:
|
||||
return 0
|
||||
|
||||
|
||||
def _whole(reads: Reads, sub: Subscription | None, size: int | None, plan: Plan | None) -> bool:
|
||||
"""Whether the reach leaves the board unread by place: its reader cannot
|
||||
filter, or the board is under `SMALL` roles (the line's two "read whole"
|
||||
|
||||
Reference in new issue
Block a user