Merge branch 'feature/radio-receipts-inline' into unify/skills-20261112-night
radio.py conflict resolved by the unify side plus the prepared resolution (seen() on top of the feedback-channel radio.py); receipts.py and its tests adapted to the unify helpers. Merged tree: test_hub_receipts 15, test_radio_seen 8, test_radio 45 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
38d475ebd9
6 files changed
+645
-22
No files matched your search
@@ -436,9 +436,28 @@ def cmd_assist(args: argparse.Namespace) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
def seen(row: dict, name: str, sid: str, prompt: float, state: dict, since: float) -> bool:
|
||||
"""Args:
|
||||
row: a news.jsonl row with a numeric ts.
|
||||
name: the session's name, as name_of() gives it.
|
||||
sid: the session's id; a row pinned to it in to_sessions is for it
|
||||
under any name.
|
||||
prompt: the session's prompt mark, as prompt_mark() gives it.
|
||||
state: the session's radio-seen state; the mark of the row's channel
|
||||
holds the ts of the newest row the session took on it.
|
||||
since: rows at or before it count as taken; the hooks pass the start
|
||||
of WINDOW, a reader of the marks alone NEVER.
|
||||
|
||||
Returns:
|
||||
Whether the session has taken the row: it is for the session and its
|
||||
ts is not after the prompt mark, since or the mark of its channel.
|
||||
"""
|
||||
return for_me(row, name, sid) and not row["ts"] > max(prompt, since, mark(state, channel(row)))
|
||||
|
||||
|
||||
def pending(sid: str, name: str, state: dict, family: str) -> list[dict]:
|
||||
floor = max(prompt_mark(sid), time.time() - WINDOW, mark(state, family))
|
||||
return [row for row in items() if channel(row) == family and row["ts"] > floor and for_me(row, name, sid)]
|
||||
prompt, since = prompt_mark(sid), time.time() - WINDOW
|
||||
return [row for row in items() if channel(row) == family and for_me(row, name, sid) and not seen(row, name, sid, prompt, state, since)]
|
||||
|
||||
|
||||
def take(sid: str, family: str) -> list[dict]:
|
||||
|
||||
Reference in new issue
Block a user