Observe domain and component actions through one envelope - #5
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a unified, serializable action observation stream across both domain dispatch and component stores, using a shared action_envelope and an Algebraic Effect boundary so hosts (browser/tests) can capture or discard ordered action observations without exposing runtime-tree details to views.
Changes:
- Added
explore/react/action.kkwith sharedaction_codec,action_envelope,action_observation, andcapture_actions(...). - Wired observation emission into typed component stores (
use_store/dispatch_store) and domain dispatch paths (route/todo/lab), plus added an observed runtime entrypoint (run_runtime_action_observed). - Updated tests and documentation to validate codec round-trips and the
domain -> componentobservation order.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the unified action observation envelope and semantics. |
| PLAN.md | Updates plan to reflect observation completion and future replay policy work. |
| Agents.md | Adds repo conventions for action observation usage and semantics. |
| explore/react/action.kk | New shared action codec/envelope + observation effect + capture helper. |
| explore/react/state.kk | Emits component action observations from stores; shifts store action encoding to action_envelope. |
| library/route.kk | Simplifies route decoding API and removes now-redundant helper. |
| demo/model.kk | Introduces observed route dispatch and a route action codec. |
| demo/runtimeframe.kk | Adds observed runtime action runner and updates non-observed path to discard. |
| demo/routebar.kk | Routes navigation through observed route dispatch (domain action). |
| demo/todo/events.kk | Adds todo domain action codecs and emits domain observations during dispatch. |
| demo/todo/state.kk | Propagates action_observation through task editor dispatch API. |
| demo/lab/events.kk | Adds lab domain action codec and emits domain observations during dispatch/routing. |
| demo/lab/state.kk | Propagates action_observation through incident local-store dispatch API. |
| demo/lab/workflow.kk | Propagates action_observation through workflow dispatch path. |
| demo/labpanel.kk | Propagates action_observation through lab panel event routing APIs. |
| demo/tests/support.kk | Updates harness helpers to handle/ignore action_observation where appropriate. |
| demo/tests/todocases.kk | Verifies store protocol still holds and adds unified observation ordering test. |
| demo/tests/statecases.kk | Updates malformed action decoding tests to use action_envelope. |
| demo/tests/labcases.kk | Adjusts workflow test setup to accommodate observation handling. |
| demo/tests/basics.kk | Adds observation capture assertions around route normalization and ensures test host is installed. |
| demo/tests.kk | Registers the new unified observation test in the test suite. |
| boilerplate/browserapp.kk | Logs observed actions from event dispatch alongside existing listener warnings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification