Principle:23blocks OS Ai maestro Status Normalization
| Knowledge Sources | |
|---|---|
| Domains | Status_Presence |
| Last Updated | 2026-10-26 10:00 GMT |
Overview
A normalization pattern that maps raw hook status words and notification types to a shared four-value vocabulary (working / needs-you / ready / offline), resolving ambiguities where the same word means different things.
Description
Before normalization, each view picked its own colors and the same color meant different things: green was "working" in the sidebar and "ready for input" in the chat; amber was "waiting" in the sidebar and "working" in the chat. The sidebar also called an agent "waiting" when it had simply been idle for a minute (Claude Code's `idle_prompt` notification), so "needs you" and "done, holding" looked the same.
The normalization functions resolve these ambiguities:
- `claimsActivity`: 'ended' and 'started' claim nothing (stale-overwrite semantics)
- `hookNeedsYou`: distinguishes a real block (permission_prompt, elicitation_dialog) from mere idle (idle_prompt)
- `normalizeActivityStatus`: maps any raw word to 'active', 'waiting', or 'idle'
- `presenceFrom`: combines online flag + activity + hook state → full presence value
Usage
Use this principle when a raw status feed has ambiguous or overlapping words and a single normalized vocabulary is needed for consistent display.
Theoretical Basis
The normalization is a disambiguation function:
hookNeedsYou(hookStatus, notificationType) =
hookStatus == 'permission_request' → true
hookStatus == 'waiting_for_input' && notificationType in {permission_prompt, elicitation_dialog} → true
else → false
normalizeActivityStatus(status, notificationType) =
status in {active, working} → 'active'
status == 'waiting' → 'waiting'
hookNeedsYou(status, notificationType) → 'waiting'
else → 'idle'
The key disambiguation: `waiting_for_input` with `idle_prompt` is ready (holding for next task), but `waiting_for_input` with `permission_prompt` is needs-you (blocked on user). The notification type, not the status word alone, carries the distinction.