Principle:23blocks OS Ai maestro Activity Signal Collection
| Knowledge Sources | |
|---|---|
| Domains | Status_Presence, Signal_Collection |
| Last Updated | 2026-10-26 10:00 GMT |
Overview
A signal collection pattern that gathers raw activity signals from hooks (permission needs), transcript files (Codex live status), and pane text (observed permission verdicts) to feed the status aggregation.
Description
Activity signals come from multiple sources:
- hookNeedsYou: checks if the hook report means the agent is blocked on the user (permission_request or waiting_for_input with a blocking notification).
- codexLiveStatusFromFile: reads the tail of a Codex transcript JSONL file to extract the live status string. Reads only the last 64KB to avoid re-reading large files.
- observedPermissionVerdict: inspects pane text to decide whether a permission dialog is still open ('keep'), was answered ('active'), or was dismissed ('idle').
These signals feed the `getActivity` aggregation and the `normalizeActivityStatus` logic.
Usage
Use this principle when designing a status system where:
- Signals come from heterogeneous sources (hooks, transcript files, pane text)
- Each source has different freshness and reliability characteristics
- Reading large files must be bounded (tail-only reads)
Theoretical Basis
Each signal collector is a pure function over a specific source:
hookNeedsYou(hookStatus, notificationType) → boolean
codexLiveStatusFromFile(filePath, tailBytes) → string | null
observedPermissionVerdict({ageMs, paneText}) → 'keep' | 'active' | 'idle'
The tail-only read for Codex transcripts is a bounded-read optimization: the last task event is near the end of the file, and re-reading the entire file on every poll would be wasteful for large rollouts.