Skip to content

Pause XMD expansion in one REPL execution without cancelling it #841

Description

@taras

Story

As a person inspecting live XMD execution, I want Pause to stop further XMD expansion in one visible execution subtree without cancelling it, so I can inspect earlier History checkpoints and then continue the same in-memory work.

Example

A document is expanding while a background provider request and an independent sibling execution are still running. Pause changes the selected execution from playing to pausing. It becomes EXPANSION PAUSED once every active XMD expansion walk in that subtree is held at an existing expansion boundary or has settled.

The background request may finish and append its durable outcome to the Journal while expansion remains paused. The expansion pause point stays fixed even though the live History head advances. Continue releases the held expansion continuations exactly once; it does not replay the recorded outcome or reconstruct the execution.

Current gap

The REPL does not yet install a production pause controller around XMD execution. Effection provides the runtime and continues running ordinary tasks, but the REPL needs a cooperative boundary that can stop XMD expansion, preserve cleanup and keep unrelated UI and execution work responsive.

The experiment establishes that the existing execution, component, output and REPL-owned expansion surfaces provide that boundary. It does not require a new XMD API, Effection scheduler decoration or runtime-quiescence query.

Contract

  • The REPL installs its pause middleware before starting one REPL execution. The controller and retained continuations live for that execution and are inherited by its XMD expansion work.
  • While execution is playing, the middleware delegates immediately and produces the same output and Journal records as unmediated execution.
  • Pause is cooperative. Requesting it changes the controller to pausing synchronously. Work already between expansion boundaries may continue until it reaches the next controlled boundary or settles.
  • An active expansion walk is one bracketed unit of XMD expansion. The root document, projected component content and REPL-owned expansion regions create walks; component, code-block and output operations provide step gates inside them.
  • The controller reports paused only when every active expansion walk in the selected subtree is held at a controlled boundary or has settled. Concurrent child walks are included before their parent is considered paused.
  • paused means XMD expansion is stopped. It does not mean Effection is quiescent, external systems are frozen or the durable Journal head is stationary.
  • Ordinary Effection tasks continue normally and are not pause obligations. Work that produces a durable outcome appends it to the Journal normally while expansion is paused.
  • No later XMD element or rendered output expands until Continue, including work triggered by a background outcome.
  • Sibling executions outside the selected subtree remain live and may continue expanding and recording.
  • Continue releases the same retained expansion continuations exactly once. It does not halt, replay or reconstruct them, and it does not append an already-recorded background outcome again.
  • Completion, failure, explicit interruption and CLI shutdown while pausing or paused unwind every owned child and resource. Interruption and shutdown unwind a hold instead of releasing it into ordinary execution.
  • The controller and retained continuations are ephemeral REPL state and never enter the durable Journal. The UI may project their status without owning the gate.
  • The expansion pause point and the live History head are separate positions. The interface calls the mode EXPANSION PAUSED, never paused at head.
  • Process restart is not Continue: the in-memory continuation is gone and Journal replay owns later resumption.
  • Pause remains a REPL concern. Production adds no public or core XMD pause API and does not reach into Effection reducer or scheduler internals.

Acceptance

  • A real XMD execution reaches EXPANSION PAUSED while ordinary descendant Effection work continues.
  • Every active concurrent expansion walk is held or settled before paused; allowing one walk to keep expanding makes the test fail.
  • Removing the middleware restores byte-identical pass-through output and Journal records.
  • A background operation finishes while expansion is paused, appends one durable Journal event, and does not advance the expansion pause point.
  • Continue resumes every held expansion continuation exactly once and never duplicates the background event.
  • An execution outside the selected subtree continues expanding and recording throughout the paused interval.
  • Explicit interruption from paused produces a terminal interrupted outcome and complete teardown without releasing held work.
  • CLI-style owner shutdown from paused unwinds holds and retained resources without reporting successful completion.
  • Failure during coordination propagates to the execution owner.
  • A boundary inventory covers every exercised route by which the representative document can expand, including rendered prose and output.
  • Restoring descendant-Effection-scope completeness leaves the real execution stuck in pausing, proving runtime quiescence is not the contract.

Evidence

Dependencies

Out of scope

  • Terminal rendering, routing and StarFX.
  • Durable process-restart replay.
  • Automatically reconciling external environment changes.
  • Production integration with XMD components or Agent providers.
  • Pausing arbitrary Effection continuations or external systems.
  • A new public or core XMD pause API.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXUser-facing usability and interaction improvementsenhancementNew feature or requestexperimentBounded evidence work that may conclude by discarding its implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions