v0.4.0: differentiator — prose for TUI-side (on-daemon-msg, status bar, add-msg)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
Prose added: - gateway-tui-main.org: Contract item 2 updated — on-daemon-msg now extracts :gate-trace, :rule-count, :foveal-id from daemon response - gateway-tui-view.org: Status Bar section — explains the three differentiator visualizations (rule counter, focus map, gate trace), noting they cost 0 LLM tokens and are unique to Passepartout's deterministic gate architecture - gateway-tui-model.org: Contract item 2 updated — add-msg supports &key gate-trace for message-attached trace rendering
This commit is contained in:
@@ -17,7 +17,10 @@ Event handlers + daemon I/O + main loop.
|
|||||||
chat and history. Non-printable keys are ignored.
|
chat and history. Non-printable keys are ignored.
|
||||||
2. (on-daemon-msg msg): processes inbound daemon messages. Routes
|
2. (on-daemon-msg msg): processes inbound daemon messages. Routes
|
||||||
text responses to chat display (:agent), handshake to system
|
text responses to chat display (:agent), handshake to system
|
||||||
messages, routes errors to log via ~log-message~.
|
messages, routes errors to log via ~log-message~. Extracts
|
||||||
|
~:gate-trace~ (attached to message), ~:rule-count~, and
|
||||||
|
~:foveal-id~ (v0.4.0 differentiator) from daemon response and
|
||||||
|
updates TUI state for status bar rendering.
|
||||||
3. (send-daemon msg): serializes and sends a message to the daemon
|
3. (send-daemon msg): serializes and sends a message to the daemon
|
||||||
over the framed TCP protocol.
|
over the framed TCP protocol.
|
||||||
4. (tui-main): the main loop — connects to daemon, initializes
|
4. (tui-main): the main loop — connects to daemon, initializes
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ All state mutation flows through event handlers in the controller.
|
|||||||
|
|
||||||
1. (init-state): returns a fresh state plist with ~:msgs~ list,
|
1. (init-state): returns a fresh state plist with ~:msgs~ list,
|
||||||
~:input~ buffer, ~:dirty~ flag, ~:busy~ flag, and ~:connection~ status.
|
~:input~ buffer, ~:dirty~ flag, ~:busy~ flag, and ~:connection~ status.
|
||||||
2. (add-msg type text): appends a message to the ~:msgs~ list in
|
2. (add-msg role content &key gate-trace): appends a message object
|
||||||
~*state*~, tagged with a timestamp and type. Truncates at the
|
to the ~:messages~ vector (v0.3.3), tagged with timestamp, role,
|
||||||
message buffer limit.
|
and optional gate-trace from the daemon (v0.4.0).
|
||||||
3. (queue-event ev): thread-safely enqueues an event for the
|
3. (queue-event ev): thread-safely enqueues an event for the
|
||||||
reader loop. (drain-queue) returns and clears the queue.
|
reader loop. (drain-queue) returns and clears the queue.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ State is read via ~(st :key)~ — no mutation here.
|
|||||||
** Contract
|
** Contract
|
||||||
|
|
||||||
1. (view-status win): renders the status bar with connection info,
|
1. (view-status win): renders the status bar with connection info,
|
||||||
version, and timestamp.
|
msg count, scroll offset, rule counter, focus map (v0.4.0), and
|
||||||
|
timestamp. Two lines: line 1 (status + rules), line 2 (focus + time).
|
||||||
2. (view-chat win h): renders the scrolled chat message list. Takes
|
2. (view-chat win h): renders the scrolled chat message list. Takes
|
||||||
window and available height. Messages are color-coded: green (user),
|
window and available height. Messages are color-coded: green (user),
|
||||||
white (agent), yellow (system).
|
white (agent), yellow (system).
|
||||||
@@ -19,6 +20,23 @@ State is read via ~(st :key)~ — no mutation here.
|
|||||||
flags (status, chat, input). Minimizes terminal writes.
|
flags (status, chat, input). Minimizes terminal writes.
|
||||||
|
|
||||||
** Status Bar
|
** Status Bar
|
||||||
|
|
||||||
|
The status bar, as of v0.4.0, renders Passepartout's three differentiator
|
||||||
|
visualizations — data only available because of the deterministic gate
|
||||||
|
architecture:
|
||||||
|
|
||||||
|
- *Rule counter* (~Rules:N~): the number of pending HITL actions from the
|
||||||
|
Dispatcher's ~*hitl-pending*~ hash table. The user watches this tick up
|
||||||
|
as they teach the agent their preferences through approve/deny decisions.
|
||||||
|
- *Focus map* (~[Focus: <id>]~): the foveal focus from the daemon's signal
|
||||||
|
context. Shows the user what the agent is currently looking at.
|
||||||
|
- *Gate trace* (not rendered in status bar — attached to individual
|
||||||
|
messages via ~:gate-trace~ field for future collapsible rendering per
|
||||||
|
message).
|
||||||
|
|
||||||
|
All three enrichments cost 0 LLM tokens — they are daemon-state queries
|
||||||
|
that the TUI actuator attaches to the response plist before transmission.
|
||||||
|
|
||||||
#+begin_src lisp
|
#+begin_src lisp
|
||||||
(in-package :passepartout.gateway-tui)
|
(in-package :passepartout.gateway-tui)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user