[GH-ISSUE #57] Define reusable deterministic process-capture scenario contracts #44

Closed
opened 2026-10-15 18:20:24 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @morluto on GitHub (Jul 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/57

Problem

Process-level behavior cannot be compared reproducibly without a typed scenario, explicit authority, budgets, normalization, and side-effect declarations.

Outcome

Define provider-neutral contracts for approval-gated process capture.

Public contract

A scenario specifies an absolute executable, argument array, working directory, isolated HOME policy, inherited environment allowlist, explicit environment values and secret keys, timed PTY input, resize and signal events, timeout/settle limits, declared filesystem roots, optional loopback replay scripts, and normalization rules for time/PIDs/ports/paths/patterns.

Output specifies PTY frames, exit/signal, owned process events, filesystem changes, protocol timelines, cleanup, truncation, limitations, and residual unknowns.

Safety

Require approved: true. Parse all external input. Default to no external network. Never persist secrets or arbitrary inherited environments.

Acceptance criteria

Schemas reject contradictory events, relative executables, unsafe roots, unbounded limits, unsupported signals, and secret-policy gaps. Capability metadata accurately declares launch/network/write behavior. CLI and MCP schemas match.

Dependencies

Parent: #48. Requires typed capabilities and Evidence v2 environments/authority.

Non-goals

Implementing PTY execution or platform adapters.

Root capability expansion: reactive scenario algebra

Timed events are insufficient for interactive software. Scenarios need a deterministic reactive state machine.

Triggers

Support bounded terminal raw/rendered matches, nth occurrence, owned process spawn/exit, approved filesystem mutation, HTTP/WebSocket event, shim invocation, root exit, quiescence, settlement, timeout, and idle timeout. Allow finite all/any/sequence composition with explicit deadlines.

Actions

A trigger may send PTY input, resize, send an allowed signal, checkpoint evidence, advance a declarative loopback-peer state, release a predeclared response, mark a milestone, or terminate the scenario. Portable scenarios must not contain arbitrary callbacks or target-code execution.

Determinism

  • Every trigger has an identity, deadline, and match cap.
  • Ordering is defined when triggers observe the same event.
  • Actions serialize unless an explicit bounded concurrency group exists.
  • Unmet triggers, target exit before match, timeout, and dispatch failure remain distinct.
  • Captures preserve scheduled, matched, dispatched, skipped, and failed transitions.
  • Scenario identity commits the trigger/action graph, replay, shims, and secret aliases.

Acceptance

Reproduce a multi-prompt 80x40 CLI with terminal-triggered inputs, resize, stateful HTTP, WebSocket reply, descendant checkpoint, and settlement. Vary response timing and prove the semantic interaction trace remains stable without normalizing meaningful ordering.

Originally created by @morluto on GitHub (Jul 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/57 ## Problem Process-level behavior cannot be compared reproducibly without a typed scenario, explicit authority, budgets, normalization, and side-effect declarations. ## Outcome Define provider-neutral contracts for approval-gated process capture. ## Public contract A scenario specifies an absolute executable, argument array, working directory, isolated HOME policy, inherited environment allowlist, explicit environment values and secret keys, timed PTY input, resize and signal events, timeout/settle limits, declared filesystem roots, optional loopback replay scripts, and normalization rules for time/PIDs/ports/paths/patterns. Output specifies PTY frames, exit/signal, owned process events, filesystem changes, protocol timelines, cleanup, truncation, limitations, and residual unknowns. ## Safety Require `approved: true`. Parse all external input. Default to no external network. Never persist secrets or arbitrary inherited environments. ## Acceptance criteria Schemas reject contradictory events, relative executables, unsafe roots, unbounded limits, unsupported signals, and secret-policy gaps. Capability metadata accurately declares launch/network/write behavior. CLI and MCP schemas match. ## Dependencies Parent: #48. Requires typed capabilities and Evidence v2 environments/authority. ## Non-goals Implementing PTY execution or platform adapters. ## Root capability expansion: reactive scenario algebra Timed events are insufficient for interactive software. Scenarios need a deterministic reactive state machine. ### Triggers Support bounded terminal raw/rendered matches, nth occurrence, owned process spawn/exit, approved filesystem mutation, HTTP/WebSocket event, shim invocation, root exit, quiescence, settlement, timeout, and idle timeout. Allow finite all/any/sequence composition with explicit deadlines. ### Actions A trigger may send PTY input, resize, send an allowed signal, checkpoint evidence, advance a declarative loopback-peer state, release a predeclared response, mark a milestone, or terminate the scenario. Portable scenarios must not contain arbitrary callbacks or target-code execution. ### Determinism - Every trigger has an identity, deadline, and match cap. - Ordering is defined when triggers observe the same event. - Actions serialize unless an explicit bounded concurrency group exists. - Unmet triggers, target exit before match, timeout, and dispatch failure remain distinct. - Captures preserve scheduled, matched, dispatched, skipped, and failed transitions. - Scenario identity commits the trigger/action graph, replay, shims, and secret aliases. ### Acceptance Reproduce a multi-prompt 80x40 CLI with terminal-triggered inputs, resize, stateful HTTP, WebSocket reply, descendant checkpoint, and settlement. Vary response timing and prove the semantic interaction trace remains stable without normalizing meaningful ordering.
Author
Owner

@morluto commented on GitHub (Jul 17, 2026):

Current main delivers the bounded process-scenario v4 base: strict executable/policy/bounds, timed input/resize/signal actions, normalization and commitment, plus time/terminal-literal/root-exit/settled checkpoints. The expanded reactive trigger/action algebra in this issue remains open: process/filesystem/HTTP/WS/shim triggers, all/any/sequence composition, serialized actions, transition traces, and the reactive fixture. Treat #60 state-machine design as the prerequisite.

<!-- gh-comment-id:5001547990 --> @morluto commented on GitHub (Jul 17, 2026): Current main delivers the bounded process-scenario v4 base: strict executable/policy/bounds, timed input/resize/signal actions, normalization and commitment, plus time/terminal-literal/root-exit/settled checkpoints. The expanded reactive trigger/action algebra in this issue remains open: process/filesystem/HTTP/WS/shim triggers, all/any/sequence composition, serialized actions, transition traces, and the reactive fixture. Treat #60 state-machine design as the prerequisite.
Author
Owner

@morluto commented on GitHub (Jul 17, 2026):

Current-main audit: the versioned Process Capture v4 contract, CLI/MCP adapters, timed input/resize/signal events, and time/terminal-literal/root-exit/settled triggers are delivered. Remaining scope is a reactive scenario algebra for process, filesystem, HTTP, WebSocket, and shim triggers; all/any/sequence composition; committed transition traces; and a reactive end-to-end fixture. This issue remains open with that reduced scope.

<!-- gh-comment-id:5002759357 --> @morluto commented on GitHub (Jul 17, 2026): Current-main audit: the versioned Process Capture v4 contract, CLI/MCP adapters, timed input/resize/signal events, and time/terminal-literal/root-exit/settled triggers are delivered. Remaining scope is a reactive scenario algebra for process, filesystem, HTTP, WebSocket, and shim triggers; all/any/sequence composition; committed transition traces; and a reactive end-to-end fixture. This issue remains open with that reduced scope.
Author
Owner

@morluto commented on GitHub (Jul 20, 2026):

Split into focused child issues:

These replace the broad remaining scope in this issue. Closing this parent can happen once all children are closed.

<!-- gh-comment-id:5023381051 --> @morluto commented on GitHub (Jul 20, 2026): Split into focused child issues: - [ ] #330 - [ ] #331 These replace the broad remaining scope in this issue. Closing this parent can happen once all children are closed.
Author
Owner

@morluto commented on GitHub (Jul 25, 2026):

Completed on current main. The original Process Capture v4 contract and its reactive expansion are now delivered: strict approval-gated schemas and budgets, CLI/MCP parity, deterministic event and action semantics, Evidence-backed transitions, and the real terminal/process/filesystem/HTTP/WebSocket/shim fixture. Both focused children are complete: #330 and #331.

<!-- gh-comment-id:5078497869 --> @morluto commented on GitHub (Jul 25, 2026): Completed on current main. The original Process Capture v4 contract and its reactive expansion are now delivered: strict approval-gated schemas and budgets, CLI/MCP parity, deterministic event and action semantics, Evidence-backed transitions, and the real terminal/process/filesystem/HTTP/WebSocket/shim fixture. Both focused children are complete: #330 and #331.
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#44
No description provided.