Project conversation state from immutable events. Replaying the same ordered events must produce the same semantic state, even when snapshots or schema migrations are used.Event-sourced conversation engine
Reconstruct state from recorded events.
conversation_state_projectionRECORD STATUSCandidate · v0.1.0UML class view
The proposed contract drawn as participant roles, received calls, and numbered dependencies.
Object interactions
The same roles and calls as a class collaboration and a numbered message sequence.
Pointcut
Where the mechanism applies. All four dimensions belong to the proposed match, not just its vocabulary.
- Context
- Conversation state is derived from recorded events.
- Trigger
- A new event is appended or history is loaded.
- Structure
- Event schema, sequence or identity rules, and a projector.
- Effect
- The current view is reproducible from the event history.
Protected contract
The obligation that clients, operators, and auditors should be able to rely on.
- Requires
- Events are immutable enough to replay and schema versions are identifiable.
- Ensures
- Applying the same ordered events yields the same semantic state.
- Invariant
- Projection never mutates historical event identity.
- Violation
- Missing, incompatible, or corrupt events produce recoverable migration or rejection.
Negative control
A mutable message array without projection semantics is insufficient.
Variation & lifecycle
The hot spot is admitted only where the protected semantics survive.
Permitted variation
Event type unions, snapshots, migrations, local or remote persistence.
Test obligation
Test full replay, snapshot-plus-tail replay, schema evolution, and partial history.
Evolution question
Did conversation state move behind an append-and-project boundary?
Prompt + code design
An illustrative prompt and a small design sketch for the proposed contract. Names and APIs are invented; this is not a repository excerpt.
def project(events, initial_state):
state = initial_state
for event in sorted(events, key=lambda item: item.seq):
handler = HANDLERS.get(event.kind)
if handler is None:
raise UnknownEvent(event.kind)
state = handler(state, event)
return stateIllustrative design sketch. State is a projection; an event with no handler is a contract violation, not a no-op. This example is a teaching aid, not implementation evidence or a conformance claim.
Detection & matching
The frozen rule that retrieves this record, the canonical source exemplar, and the control that should stay unmatched.
- Join point
conversation_state_projection- Source locator
- See the source record.
- Lexical cue
(?i)\b(?:event[_-]?sourc(?:e|ed|ing)|conversation[_-]?events|append[_-]?event|projection)\bFrozen expression, v0.1.0. A match is a retrieval cue, not a confirmed implementation.- Aliases
- None
- Canonical exemplar
- OpenHands/software-agent-sdk
openhands-sdk/openhands/sdk/conversation/state.py:342Support: tests/sdk/conversation/local/test_state_serialization.py:234 - Negative control
- A mutable message array without projection semantics is insufficient.
Scope-anchored review. pohe-agent analyze <repo> --pattern P14 anchors the cue to its enclosing declaration and checks a separate operational signature for all four pointcut dimensions. Missing roles and negative-control risks remain visible; a structural match is not E2/E3. Calibration report ↗
Repository files
Up to five public files retrieved by the frozen cue and pinned to the audited commit. A match is a place to inspect, not a confirmed implementation.
openhands-sdk/openhands/sdk/conversation/state.py:342CANONICAL SOURCE02aaif-goose/goosecrates/goose-mcp/src/autovisualiser/templates/assets/d3.min.js:2RETRIEVAL CUE03agno-agi/agnolibs/agno/agno/db/base.py:56RETRIEVAL CUE04Aider-AI/aideraider/website/assets/asciinema/asciinema-player.min.js:1RETRIEVAL CUE05anomalyco/opencodepackages/ai/src/route/client.ts:594RETRIEVAL CUEEvidence & provenance
Each layer answers a different question. Do not substitute retrieval for review.
Source-located exemplar
A concrete source anchor is available for this proposed record. It is one exemplar, not evidence that all repositories—or every contract field—conform.
Review boundary: this candidate and its specification come from an AI-assisted study. Independent human validation remains open.
86.1% of repository families in the frozen panel have at least one current cue, historical cue, or canonical source layer. This is not confirmed prevalence.
Current lexical-cue repositories: 34 / 415c524ad65d81openhands-sdk/openhands/sdk/conversation/state.py:342tests/sdk/conversation/local/test_state_serialization.py:234State updated by appending events and rebuilding a view.
Exploratory retrieval cue Regex / v0.1.0
(?i)\b(?:event[_-]?sourc(?:e|ed|ing)|conversation[_-]?events|append[_-]?event|projection)\bThis expression is a discovery instrument only. A match is a retrieval cue—not a confirmed implementation, pointcut match, or contract proof.