Skip to content

docs(adr): ADR-001 — reactive state via scoped StateBus and ownership-based discovery#196

Open
WilliamKarolDiCioccio wants to merge 1 commit into
mainfrom
docs/adr-001-reactive-state-management
Open

docs(adr): ADR-001 — reactive state via scoped StateBus and ownership-based discovery#196
WilliamKarolDiCioccio wants to merge 1 commit into
mainfrom
docs/adr-001-reactive-state-management

Conversation

@WilliamKarolDiCioccio
Copy link
Copy Markdown
Collaborator

Summary

  • Replaces five per-PR design docs (state-bus.md, agent-session-agent-state.md, agent-runtime-thread-state.md, agent-session-bus-route.md, agent-state-as-bus-view.md) with a single consolidated ADR covering the full PR feat(soliplex_client): GenUI P0 — Surface + StateProjection + StateBus #189refactor(soliplex_agent): agentState is now a view of bus.agentState #193 stack
  • Documents the key design decisions that emerged across the stack: ThreadKey over bare threadId, @immutable ThreadState with withHistory, ensureThreadState vs threadStateOf, runtime-owned disposal cascade, and ownership-based discovery as the RAII substitute
  • Flags the late final agentState / plain bus getter asymmetry as a contractual (not mechanical) safety guarantee — the invariant that _threadStates[key] is never overwritten with a fresh ThreadState for an existing key must hold for agentState to stay on the correct bus

What changed from the per-PR docs

The five source docs were written incrementally as each PR landed. The ADR reflects the final state after #193 collapsed the parallel computed() path into bus.agentState. Key corrections vs the original per-PR framing:

  • "Host (per-thread)" replaced by AgentRuntime as the concrete bus owner throughout
  • agentState data-flow diagram updated to the PR refactor(soliplex_agent): agentState is now a view of bus.agentState #193 final form (_onStateChange → bus.setAgentState → bus.agentState = session.agentState)
  • Exhaustive sealed-switch argument repositioned: the switch feeds the bus via _onStateChange, it no longer powers agentState directly
  • Lifecycle sequence diagram shows the Runtime → ThreadState → StateBus cascade, not a manual host teardown

Test plan

  • markdownlint-cli2 — clean
  • No code changes; docs only

🤖 Generated with Claude Code

@91jaeminjo 91jaeminjo force-pushed the feat/agent-state-view-of-bus branch from e5bd3c0 to 0cc6de7 Compare April 28, 2026 20:57
Base automatically changed from feat/agent-state-view-of-bus to main April 28, 2026 21:18
…-based discovery

Replaces the five per-PR design docs (state-bus, agent-session-agent-state,
agent-runtime-thread-state, agent-session-bus-route, agent-state-as-bus-view)
with a single consolidated ADR covering the full PR #189#193 stack.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@91jaeminjo 91jaeminjo force-pushed the docs/adr-001-reactive-state-management branch from 0d2e3e1 to 77e2cce Compare April 28, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant