[PR #422] [MERGED] feat(process): add bounded reactive scenario domain #1970

Closed
opened 2026-10-16 21:12:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/422
Author: @morluto
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/23/2026
Merged by: @morluto

Base: main ← Head: codex/issue-330-terminal-process


📝 Commits (1)

  • d34463c feat(process): add bounded reactive scenario domain

📊 Changes

12 files changed (+2934 additions, -122 deletions)

View changed files

➕ src/domain/processObservation.ts (+211 -0)
➕ src/domain/processReactiveCheckpointDataflow.ts (+41 -0)
➕ src/domain/processReactiveMatching.ts (+302 -0)
➕ src/domain/processReactiveRuntime.ts (+263 -0)
➕ src/domain/processReactiveScenario.ts (+500 -0)
➕ src/domain/processReactiveScenarioPreflight.ts (+165 -0)
➕ src/domain/processReactiveTransition.ts (+250 -0)
📝 src/domain/processTraceEvaluation.ts (+14 -97)
📝 src/domain/processTraceSpecification.ts (+8 -25)
➕ tests/processObservation.test.ts (+156 -0)
➕ tests/processReactiveRuntime.test.ts (+642 -0)
➕ tests/processReactiveScenario.test.ts (+382 -0)

📄 Description

Problem

Process Capture v4 has a globally ordered observation journal, but issue #330 needs a bounded reactive scenario model before the capture adapter can safely execute terminal-driven actions. Adding reactive input directly to the public scenario today would silently accept behavior the host cannot execute or preflight.

What changed

  • adds one provider-neutral observation vocabulary shared by live reactive evaluation and post-hoc trace comparison
  • adds a strict v1 reactive scenario schema with explicit limits, iterative unknown-input preflight, graph/checkpoint validation, bounded trigger matching, explicit priorities, and fail-closed overflow behavior
  • adds an immutable reducer with stale-deadline identity, visit/use bounds, and two-phase effect proposals
  • binds successful effect acknowledgements to exact action-compatible journal observations before committing state, checkpoints, consumption, or transition history
  • reuses the shared observation projection in existing Process Trace evaluation instead of maintaining a second journal vocabulary

This advances #330. It intentionally does not expose the reactive schema through ProcessScenario, CLI, or MCP yet; the next slice will add the serialized capture coordinator and effect executor so accepted public input is executable end to end.

Review order

  1. processReactiveScenario.ts and processReactiveScenarioPreflight.ts
  2. processReactiveMatching.ts and processReactiveRuntime.ts
  3. processReactiveTransition.ts
  4. processObservation.ts and the trace projection refactor
  5. focused tests

Verification

  • npx vitest run tests/processObservation.test.ts tests/processReactiveRuntime.test.ts tests/processReactiveScenario.test.ts tests/processTraceComparison.test.ts tests/processTraceAdapters.test.ts (37 tests)
  • npm run check
  • npm run docs:check
  • git diff --check

Real Hopper and Ghidra verification was not performed; this change does not alter either provider boundary.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/422 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/23/2026 **Status:** ✅ Merged **Merged:** 7/23/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/issue-330-terminal-process` --- ### 📝 Commits (1) - [`d34463c`](https://github.com/morluto/rea/commit/d34463c27c9b5d71c9e2e3b33cdaef2eab5b99de) feat(process): add bounded reactive scenario domain ### 📊 Changes **12 files changed** (+2934 additions, -122 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/processObservation.ts` (+211 -0) ➕ `src/domain/processReactiveCheckpointDataflow.ts` (+41 -0) ➕ `src/domain/processReactiveMatching.ts` (+302 -0) ➕ `src/domain/processReactiveRuntime.ts` (+263 -0) ➕ `src/domain/processReactiveScenario.ts` (+500 -0) ➕ `src/domain/processReactiveScenarioPreflight.ts` (+165 -0) ➕ `src/domain/processReactiveTransition.ts` (+250 -0) 📝 `src/domain/processTraceEvaluation.ts` (+14 -97) 📝 `src/domain/processTraceSpecification.ts` (+8 -25) ➕ `tests/processObservation.test.ts` (+156 -0) ➕ `tests/processReactiveRuntime.test.ts` (+642 -0) ➕ `tests/processReactiveScenario.test.ts` (+382 -0) </details> ### 📄 Description ## Problem Process Capture v4 has a globally ordered observation journal, but issue #330 needs a bounded reactive scenario model before the capture adapter can safely execute terminal-driven actions. Adding reactive input directly to the public scenario today would silently accept behavior the host cannot execute or preflight. ## What changed - adds one provider-neutral observation vocabulary shared by live reactive evaluation and post-hoc trace comparison - adds a strict v1 reactive scenario schema with explicit limits, iterative unknown-input preflight, graph/checkpoint validation, bounded trigger matching, explicit priorities, and fail-closed overflow behavior - adds an immutable reducer with stale-deadline identity, visit/use bounds, and two-phase effect proposals - binds successful effect acknowledgements to exact action-compatible journal observations before committing state, checkpoints, consumption, or transition history - reuses the shared observation projection in existing Process Trace evaluation instead of maintaining a second journal vocabulary This advances #330. It intentionally does not expose the reactive schema through `ProcessScenario`, CLI, or MCP yet; the next slice will add the serialized capture coordinator and effect executor so accepted public input is executable end to end. ## Review order 1. `processReactiveScenario.ts` and `processReactiveScenarioPreflight.ts` 2. `processReactiveMatching.ts` and `processReactiveRuntime.ts` 3. `processReactiveTransition.ts` 4. `processObservation.ts` and the trace projection refactor 5. focused tests ## Verification - `npx vitest run tests/processObservation.test.ts tests/processReactiveRuntime.test.ts tests/processReactiveScenario.test.ts tests/processTraceComparison.test.ts tests/processTraceAdapters.test.ts` (37 tests) - `npm run check` - `npm run docs:check` - `git diff --check` Real Hopper and Ghidra verification was not performed; this change does not alter either provider boundary. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1970
No description provided.