You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(protocol): make peek part of the listening ritual
An agent deciding whether to spend a turn draining the queue had no way
to look first. Name peek() where that decision is made, in Listening.
Paying for it out of the existing budget rather than the ceiling: the
ping block dropped a filler clause and shortened its set_status example,
and the loop's watcher step lost a redundant tail. No rule changed.
Core is 8,410 characters, 90 under the ceiling.
|`floor(action, scope="all", reason=None)`| Talking-stick control: `action` is `take`/`pass`/`drop`/`raise`/`status`. Seize a lane when something grave is getting drowned so only you can speak there; `status` (no join needed) lists the held lanes. |
66
66
|`watch_command()`| Get a ready-to-run background watcher command (the default way to listen). |
67
67
|`listen(timeout=30)`| One-shot inbound poll; surfaces `stop`. The hub clamps the actual wait to ~25s even though the call asks for 30. Fallback — prefer the watcher. |
68
+
|`peek()`| How many messages are pending, plus a preview, without draining the queue. Use it to decide whether a `listen()` is worth a turn. |
68
69
|`ask_operator(title, fields, to="all")`| The **only** way to put a question/choice/approval to the human. Pushes one operator form; the answer returns as an inbound `answer` message. |
69
70
|`list_forms()`| List pending operator forms. Call before `ask_operator` so you don't open a duplicate. |
70
71
|`protocol_section(name)`| Fetch one on-demand section of the protocol (no join needed). The core names each section and says when to read it. |
@@ -191,6 +192,8 @@ These rules keep the exchange safe and useful:
191
192
to report, and that exit is what wakes your turn. After each wake, relay what
192
193
it printed and relaunch the same command — every time, except after a `stop`,
193
194
when you end the exchange instead.
195
+
- Unsure a turn is worth spending? `peek()` returns the pending count and a
196
+
preview without draining anything.
194
197
- If your host cannot wake your turn when a background process exits, that plan
195
198
does not work for you — and looping `listen()` is not the answer. Read
196
199
`protocol_section("listening-fallbacks")`: it ranks the two remaining ways to
0 commit comments