Implements an observer pattern where agents can register watchers
for conditions on their thread. When the condition is met, the
agent gets "nagged" on subsequent invocations until it explicitly
closes the todo.
Key components:
- TodoRegistry: thread-scoped watcher tracking with eyebrow state
- TodoUntil/TodoComplete payloads and system handlers
- HandlerMetadata.todo_nudge for delivering raised eyebrow notices
- Integration in StreamPump dispatch to check and nudge
Greeter now demonstrates the pattern:
1. Registers watcher for ShoutedResponse from shouter
2. On next invocation, sees nudge and closes completed todos
3. Includes nudge in LLM prompt for awareness
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Demonstrates message chaining: user -> greeter -> shouter -> user
- Add ShoutedResponse payload class (ALL CAPS response)
- Add handle_shout handler that forwards to original sender
- Update GreetingResponse to track original_sender
- Fix wrap_in_envelope to add xmlns="" to payloads
- Update organism.yaml with shouter listener
- Update tests for 2-listener configuration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major refactor of the message pump architecture:
- Replace bus.py with stream_pump.py using aiostream for composable
stream processing with natural fan-out via flatmap
- Add to_id field to MessageState for explicit routing
- Fix routing to use to_id.class format (e.g., "greeter.greeting")
- Generate XSD schemas from xmlified payload classes
- Fix xmlable imports (absolute -> relative) and parse_element ctx
New features:
- handlers/hello.py: Sample Greeting/GreetingResponse handler
- config/organism.yaml: Sample organism configuration
- 41 tests (31 unit + 10 integration) all passing
Schema changes:
- envelope.xsd: Allow any namespace payloads (##other -> ##any)
Dependencies added to pyproject.toml:
- aiostream>=0.5 (core dependency)
- pyhumps, termcolor (for xmlable)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Minimal, universal base for all capabilities
- Required listens_to class attribute
- Async handle() with convo_id preservation rule
- make_response() helper for thread continuity
- Explicit name, config, per-instance logger
- Clear documentation and NotImplementedError guard
This is the true substrate the entire organism will build on.