Answer architecture round 1: 1 🔴, 6 🟡 (0 misread); open claude through one hand_over, route loop-inbox's /talk through the Talking state, give Ask one state
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
|
||||
How it shows the loops and a question was picked on 2026-10-28 by a bench of three readers seated as the README's
|
||||
audience, as ~/.claude/CLAUDE.md → "Working loop" → "Bench a syntax with the people who write it." has it: a block per
|
||||
loop with its checkout's path and how long it has waited, and an answer prompt saying that Enter alone stops nothing.
|
||||
loop with its checkout's path and how long it has waited, and an answer prompt saying that Enter alone doesn't stop the loop.
|
||||
"""
|
||||
import dataclasses
|
||||
import textwrap
|
||||
import typing
|
||||
|
||||
from loop_claude.waiting import Ask
|
||||
from loop_claude.waiting import Ask, Asking, OpenInInbox, OpenOnTerminal
|
||||
from loop_claude.cycle.interrupt import TALK
|
||||
|
||||
ENTER = "enter"
|
||||
@@ -83,13 +83,13 @@ def picked(shown: tuple[Ask, ...], typed: str) -> Listing | Answering:
|
||||
if not 1 <= number <= len(shown):
|
||||
return Listing(note=f"No loop has the number {number}.")
|
||||
ask = shown[number - 1]
|
||||
if ask.talk is None:
|
||||
return Listing(note=f"{ask.root}: claude is open {where_open(ask)}; answer there.")
|
||||
if not isinstance(ask.state, Asking):
|
||||
return Listing(note=f"{ask.root}: claude is open {where_open(ask.state)}; answer there.")
|
||||
return Answering(ask)
|
||||
|
||||
|
||||
def where_open(ask: Ask) -> str:
|
||||
return "in loop-inbox" if ask.talking else "on its terminal"
|
||||
def where_open(state: OpenOnTerminal | OpenInInbox) -> str:
|
||||
return "in loop-inbox" if isinstance(state, OpenInInbox) else "on its terminal"
|
||||
|
||||
|
||||
def listing_lines(screen: Listing, now: float, local_time: typing.Callable[[float], str], width: int) -> list[str]:
|
||||
@@ -98,7 +98,7 @@ def listing_lines(screen: Listing, now: float, local_time: typing.Callable[[floa
|
||||
head = "No loop waits for you." if not count else "1 loop waits for you." if count == 1 else f"{count} loops wait for you, oldest first."
|
||||
lines = [head, ""]
|
||||
for number, ask in enumerate(screen.shown, 1):
|
||||
state = f"; claude is open {where_open(ask)}" if ask.talk is None else ""
|
||||
state = "" if isinstance(ask.state, Asking) else f"; claude is open {where_open(ask.state)}"
|
||||
lines.append(f"[{number}] {ask.root}, waiting since {local_time(ask.asked)} ({waited(now - ask.asked)}){state}")
|
||||
lines += cut(wrapped(ask.question, width - 4), SHOWN_LINES, " ")
|
||||
lines.append("")
|
||||
|
||||
Reference in New Issue
Block a user