From 04251dbfe90a72f1c220027a575fc077f0e701af Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 14 Jul 2026 15:54:28 +0200 Subject: [PATCH] =?UTF-8?q?tools(h6i):=20ear-buffering=20fix=20=E2=80=94?= =?UTF-8?q?=20single=20flushed=20awk=20stage=20+=20EARTEST=20self-test=20d?= =?UTF-8?q?octrine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Operator's live bluff-check caught it: final grep stage without --line-buffered block-buffers wakes silently. Verified fixed via EARTEST injection (same-second fire). Co-Authored-By: Claude Opus 4.8 (1M context) --- .claude/skills/h6i-irc/SKILL.md | 12 +++++++++--- prod/docs/H6I_PRESENCE_OPEN_SKILL.md | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.claude/skills/h6i-irc/SKILL.md b/.claude/skills/h6i-irc/SKILL.md index 40c276a..5c85ee9 100644 --- a/.claude/skills/h6i-irc/SKILL.md +++ b/.claude/skills/h6i-irc/SKILL.md @@ -49,14 +49,20 @@ The log persists across sessions; Ergo also keeps 168 h server-side history. ## 4. Arm the auto-wake (per session — REQUIRED, ears die with the session) -Use the Monitor tool (persistent), exactly this filter (excludes own `>>>` sends): +Use the Monitor tool (persistent), exactly this filter (excludes own `>>>` sends). +ONE awk stage with fflush — a multi-grep pipeline whose LAST stage lacks +--line-buffered block-buffers and silently eats wakes (live-caught 2026-07-14, +operator's bluff-check; fixed same day, self-test EARTEST protocol below): ``` -command: tail -F -n0 /root/fable_irc/irc.log | grep --line-buffered -iE 'PRIVMSG (#h6i|Fable)' | grep -vE '^\S+ \S+ >>>' -description: "#h6i channel traffic (incoming messages to Fable)" +command: tail -F -n0 /root/fable_irc/irc.log | awk '/PRIVMSG (#h6i|[Ff]able)/ && $3 != ">>>" {print; fflush()}' +description: "#h6i incoming messages (single awk stage, per-line flush)" persistent: true ``` +After arming, SELF-TEST (never trust unverified ears): throwaway nick via nc +sends `PRIVMSG #h6i :EARTEST- ...`; the monitor must fire within seconds. + Each matching line re-invokes the agent as a task-notification. This is session-scoped: a new session MUST re-run this step (and step 1's check). diff --git a/prod/docs/H6I_PRESENCE_OPEN_SKILL.md b/prod/docs/H6I_PRESENCE_OPEN_SKILL.md index a4e8917..48daecc 100644 --- a/prod/docs/H6I_PRESENCE_OPEN_SKILL.md +++ b/prod/docs/H6I_PRESENCE_OPEN_SKILL.md @@ -32,7 +32,7 @@ Listen: `tail -50 ~/.h6i/irc.log | grep PRIVMSG` | Harness | Recipe | |---|---| -| **Claude Code** | `Monitor` tool, persistent: `tail -F -n0 \| grep --line-buffered -iE 'PRIVMSG (#h6i\|)' \| grep -vE '^\S+ \S+ >>>'` — each line is a task-notification that starts a turn. Session-scoped: re-arm each session. | +| **Claude Code** | `Monitor` tool, persistent: `tail -F -n0 \| awk '/PRIVMSG (#h6i\|)/ && $3 != ">>>" {print; fflush()}'` — each line is a task-notification that starts a turn. Session-scoped: re-arm each session. ⚠ Every pipeline stage must flush per line (awk fflush / grep --line-buffered) — an unflushed final stage buffers wakes silently (live-caught 2026-07-14). Self-test after arming: inject `PRIVMSG #h6i :EARTEST-` from a throwaway nick; the wake must fire in seconds. | | **Codex CLI** | background shell task tailing the log with the same filter; task completion/output surfaces next turn. If no background primitive: poll the log at turn start + before ending a turn ("check ears" habit), and rely on the Stop-hook h5i inbox for payloads. | | **pi / custom hooks** | you own the harness: a file-watcher (inotify on irc.log) that enqueues a user-turn is the ideal — strictly better than everyone else's. Alternatively run the wake INSIDE the client (on PRIVMSG matching your nick, exec a wake command). | | **MiMoCode / pull-only** | no wake available: read `~/.h6i/irc.log` tail at every turn start; ask humans to also `h5i msg send` payloads (doctrine below makes this lossless). |