Commit graph

109 commits

Author SHA1 Message Date
dullfig
e23fa6a2a9 Add platform architecture design doc
Documents the trust model for context and prompt management:
- Platform as trusted orchestration layer
- Context buffer: pure message history, keyed by UUID, auto-GC
- Prompt registry: immutable, invisible to agents
- LLM call assembly: platform controls, agents request
- Handler sandbox: what agents can/cannot do

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 13:49:42 -08:00
dullfig
5fe63bf943 Add /monitor command to show recent thread messages
Shows last 20 messages from a specific thread or last 5 per thread
when using /monitor *. Color-coded by direction (console=green,
responses=cyan).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 18:32:32 -08:00
dullfig
f75aa3eee6 Add SecureConsole v3.0 with password authentication
- SecureConsole with Argon2id password hashing
- Password stored in ~/.xml-pipeline/console.key
- Protected commands require password re-entry
- Attach/detach model with idle timeout
- Fallback to simple input for incompatible terminals
- @listener message injection into pump
- Boot handler no longer sends to old console
- Response handler prints to stdout with prompt refresh

Dependencies: argon2-cffi, prompt_toolkit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 18:24:24 -08:00
dullfig
379f5a0258 Use BufferSlot as single source of truth for handler dispatch
Handlers now receive payload references directly from the context
buffer slot rather than independent copies. Metadata is derived
via slot_to_handler_metadata() ensuring consistency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:51:38 -08:00
dullfig
f195835bea Update secure console design: simplify detached mode
When detached, console changes prompt from '>' to '#' and rejects
@messages while still accepting /commands. Simpler than the ring
buffer approach - operator can still check status and re-attach.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:44:57 -08:00
dullfig
fc8b6608cf Add secure console design doc (v3.0)
Design for keyboard-only privileged interface:
- OOB port eliminated — privileged ops via keyboard only
- Argon2id password protection for destructive commands
- Attach/detach model with idle timeout
- Ring buffer for messages while detached

Key security properties:
- No network attack surface for privileged operations
- Password required for /restart, /kill
- Handler returns None on timeout → organism continues headless
- /attach + password to reconnect

Commands: /status /listeners /threads /buffer /config /restart
          /kill /pause /resume /attach /detach /timeout /quit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:40:05 -08:00
dullfig
fc7170a02e Add context buffer - virtual memory manager for AI agents
Implements thread-scoped, append-only storage for validated payloads.
Handlers receive immutable references; messages cannot be modified
after insertion.

Core components:
- BufferSlot: frozen dataclass holding payload + metadata
- ThreadContext: append-only buffer per thread
- ContextBuffer: global manager with GC and limits

Design parallels OS virtual memory:
- Thread ID = virtual address space
- Buffer slot = memory page
- Immutable reference = read-only mapping
- Thread isolation = process isolation

Integration:
- Incoming messages appended after pipeline validation
- Outgoing responses appended before serialization
- Full audit trail preserved

This is incremental - handlers still receive copies for backward
compatibility. Next step: skip serialization for internal routing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:20:43 -08:00
dullfig
a5e2ab22da Add thread registry, LLM router, console handler, and docs updates
Thread Registry:
- Root thread initialization at boot
- Thread chain tracking for message flow
- register_thread() for external message UUIDs

LLM Router:
- Multi-backend support with failover strategy
- Token bucket rate limiting per backend
- Async completion API with retries

Console Handler:
- Message-driven REPL (not separate async loop)
- ConsolePrompt/ConsoleInput payloads
- Handler returns None to disconnect

Boot System:
- System primitives module
- Boot message injected at startup
- Initializes root thread context

Documentation:
- Updated v2.1 docs for new architecture
- LLM router documentation
- Gap analysis cross-check

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 16:53:38 -08:00
dullfig
8aa58715df Add TodoUntil watcher system for async confirmation tracking
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>
2026-01-10 16:51:59 -08:00
dullfig
8fa92b8f56 Add multi-agent flow demo with shouter listener
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>
2026-01-10 10:47:09 -08:00
dullfig
82b5fcdd78 Replace MessageBus with aiostream-based StreamPump
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>
2026-01-10 10:41:17 -08:00
dullfig
dc16316aed fixing docs 2026-01-08 15:49:07 -08:00
dullfig
a1e1b9a1c0 fixing docs 2026-01-08 15:35:36 -08:00
dullfig
ab207d8f0b fixing docs 2026-01-08 12:30:58 -08:00
dullfig
e314bb01e8 fixing docs 2026-01-07 20:58:31 -08:00
dullfig
f2758e5c49 fixing docs 2026-01-07 16:39:55 -08:00
dullfig
3105648fd1 fixing docs 2026-01-07 13:12:08 -08:00
dullfig
6696c06e4f fixing docs 2026-01-07 12:31:47 -08:00
dullfig
86ad3c7eb2 fixing docs 2026-01-06 19:28:25 -08:00
dullfig
e6aa9cbd61 Merge remote-tracking branch 'origin/main' 2026-01-06 19:25:47 -08:00
dullfig
2e8ed88e42 fixing docs 2026-01-06 19:24:41 -08:00
dullfig
9ae2fb608d fixing docs 2026-01-06 19:23:40 -08:00
dullfig
ed66b16821 fixing docs 2026-01-04 23:33:46 -08:00
dullfig
67c77d568e added rant 2026-01-04 22:22:17 -08:00
dullfig
a1ad8b843f added rant 2026-01-03 17:57:07 -08:00
dullfig
9a3e7df851 major realignment of docs, v2.0 now 2026-01-03 16:37:42 -08:00
dullfig
ab062bca18 re-writing docs and code 2026-01-03 14:48:57 -08:00
dullfig
9e75cfffd6 added message pump overview and yaml configuration 2026-01-02 16:02:48 -08:00
dullfig
580f32c035 added message pump overview 2026-01-02 15:46:33 -08:00
dullfig
8723a121de added self-registration and autonomous grammar generation to docs 2026-01-02 15:35:00 -08:00
dullfig
807322be3e added self-registration and autonomous grammar generation to docs 2026-01-02 15:23:02 -08:00
dullfig
3f4a6990ed added self-registration and autonomous grammar generation to docs 2026-01-02 15:20:24 -08:00
dullfig
f9304f6794 added self-registration and autonomous grammar generation to docs 2026-01-02 15:05:26 -08:00
dullfig
df7d02b5c8 creating new file for thread context 2026-01-02 00:01:20 -08:00
dullfig
8c4ee6f20f re-wrote message bus to remove return value and add run() 2026-01-01 16:18:48 -08:00
dullfig
2e682f8f6d major changes to message bus, and xml listener 2026-01-01 15:27:20 -08:00
dullfig
48b4a2b2bd major changes to message bus, and xml listener 2026-01-01 15:05:13 -08:00
dullfig
2fd40bd664 major changes to base, renamed base to xmlListener 2025-12-31 22:59:02 -08:00
dullfig
262c14458e major changes to base, renamed base to xmlListener 2025-12-31 15:08:42 -08:00
dullfig
3ebf72bfb5 Merge remote-tracking branch 'origin/main' 2025-12-30 23:35:46 -08:00
dullfig
ed4c1c88ea major changes to base 2025-12-30 23:35:31 -08:00
dan
f3b90963b8 Replace XMLListener stub with real foundation
- 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.
2025-12-29 12:16:03 -08:00
dullfig
4c3a5bad02 major changes to base 2025-12-28 21:14:08 -08:00
dullfig
a34105761b added position paper 2025-12-28 20:43:18 -08:00
dullfig
f3e9faf6b8 added position paper 2025-12-28 20:22:38 -08:00
dullfig
16be31ecce test dummy file 2025-12-28 18:45:26 -08:00
dullfig
ddb0009ca2 test dummy file 2025-12-28 18:20:51 -08:00
dullfig
0b2ff36e75 test dummy file 2025-12-28 18:16:09 -08:00
dullfig
21d6532cce test dummy file 2025-12-28 18:14:01 -08:00
dullfig
8364fa6544 Merge remote-tracking branch 'github/main' 2025-12-28 17:54:05 -08:00