You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1833870
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: specs/executable-mdx-spec.md
+35-6Lines changed: 35 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8682,11 +8682,23 @@ selects success or failure; a live pane cancelled only because the reader
8682
8682
closed the grid becomes `closed`. These states display core's result and never
8683
8683
author it.
8684
8684
8685
-
Close first prevents new pane launches, then cancels live pane scopes, awaits
8686
-
every child and provider finalizer, destroys the exact composite, restores the
8687
-
root terminal, and releases the foreground lease. Only then does the element
8688
-
settle and a later document sibling begin. There is no implicit timeout; parent
8689
-
cancellation and an enclosing execution deadline use the same complete teardown.
8685
+
The provider's `closed()` operation proposes reader close. Reader close takes
8686
+
effect when the grid owner has entered a cancellation-deferred await of the
8687
+
grid's durable child and acknowledges that proposal. Before that acknowledgement
8688
+
reaches the child, no close signal reaches a pane. Close then prevents new pane
8689
+
launches, asks every live pane child to close, awaits every child and provider
8690
+
finalizer, destroys the exact composite, restores the root terminal, and
8691
+
releases the foreground lease. The deferred await ends only after the durable
8692
+
child has settled and its `Close` has been acknowledged. Only then does the
8693
+
element settle and a later document sibling begin. There is no implicit timeout;
8694
+
parent cancellation and an enclosing execution deadline use the same complete
8695
+
teardown.
8696
+
8697
+
Pane work and the finalizers it installs are scoped inside that pane's durable
8698
+
child. Reader close does not halt that durable child. It cooperatively closes
8699
+
the pane's live work and the child retains `closed` only after its work and
8700
+
finalizers have settled. A pane that had already succeeded or failed keeps that
8701
+
outcome.
8690
8702
8691
8703
#### Native launch ownership inside a pane
8692
8704
@@ -8721,6 +8733,12 @@ continues.
8721
8733
8722
8734
A provider or host failure cancels the composite and is the grid failure.
8723
8735
Parent cancellation remains cancellation rather than becoming a pane failure.
8736
+
If it arrives after reader close takes effect, reader close still decides the
8737
+
grid and pane outcomes: then-live panes retain `closed`, already-settled panes
8738
+
keep their outcomes, and the grid retains `reader` or `failed` under the normal
8739
+
authored-order rule. The cancellation remains pending until complete teardown
8740
+
and the grid's durable close, then reaches the parent before any following
8741
+
document sibling runs. A fatal or cleanup failure keeps its existing precedence.
8724
8742
All acquired resources are finalized even when an earlier failure already
8725
8743
decides the result, and the existing fatal-infrastructure and cleanup precedence
8726
8744
still applies. Before the first cancellation signal, the provider snapshots
@@ -8758,6 +8776,16 @@ claims that whole region and restores its result without contacting a terminal
8758
8776
provider, creating a composite, starting a shell, expanding pane content,
8759
8777
resolving an Agent, taking session ownership, or launching a native UI.
8760
8778
8779
+
Reader-close intent has no separate durable `closing` state. It becomes durable
8780
+
as the completed grid `Close`, after all pane and provider teardown. The live
8781
+
handshake described above holds later parent cancellation across that interval,
8782
+
so cancellation during a blocked pane finalizer still produces completed pane
8783
+
and grid records before it reaches the parent. A continuation therefore claims
8784
+
the completed grid and proceeds without waiting on or re-entering a pane the
8785
+
reader closed. If the host itself disappears before completion, the journal has
8786
+
no completed grid close and the ordinary partial-replay rules apply; any pane
8787
+
whose completed `Close` was acknowledged remains settled.
8788
+
8761
8789
Partial replay compares the **resolved** layout first — the column count and
8762
8790
each pane's title — and refuses a change before the foreground lease is taken
8763
8791
and before any provider is contacted. It then builds a new live composite.
@@ -10768,7 +10796,8 @@ test derives a core result from a provider identifier.
10768
10796
| TG15 | Completed replay | A completed successful or failed grid restores its exact result while contacting no terminal provider, shell, Agent provider, coordinator, pane content or native launcher |
10769
10797
| TG16 | Partial replay | Exact layout rebuilds a fresh provider composite; completed pane children appear settled without effects, incomplete paired children follow their durable records, incomplete native launches preserve prepared/detached session identity, and an incomplete shell starts current host policy without terminal-history continuity |
10770
10798
| TG17 | Replay divergence and retained shape | A resolved layout change — `columns` or a `title`, reached through a prop-borne value, because a continuation executes the retained root — refuses before the lease and before provider contact, with zero provider observation. Pane count, order and form cannot differ under a fixed retained root, so they are proved retained and honoured rather than refused: the complete authored structure appears in the record, and a continuation whose supplied file differs in count, order or form opens the retained structure rather than the file's. Retained layout, close kind and pane outcomes contain no provider command, socket, process, session, window or pane identifier, path, argv, environment or terminal bytes |
10771
-
| TG18 | Provider neutrality | The controlled non-tmux provider passes TG1–TG17; the tmux adapter prepares one hidden invocation-private server with authenticated persistent pane workers, transmits exact child creation outside tmux parsing, applies explicit row-major layout, distinguishes visible detach from control loss and server stop, attaches only after runtime spawn readiness, and satisfies TG14 without leaking provider identifiers; Node and Bun validate the same document and refuse before pane start with no provider installed |
10799
+
| TG18 | Provider neutrality | The controlled non-tmux provider passes TG1–TG17 and TG19; the tmux adapter prepares one hidden invocation-private server with authenticated persistent pane workers, transmits exact child creation outside tmux parsing, applies explicit row-major layout, distinguishes visible detach from control loss and server stop, attaches only after runtime spawn readiness, and satisfies TG14 without leaking provider identifiers; Node and Bun validate the same document and refuse before pane start with no provider installed |
10800
+
| TG19 | Reader close crossed with parent cancellation | A controlled live pane enters a signal-held finalizer after reader close takes effect. Parent cancellation begins while teardown is blocked; releasing the finalizer lets pane and provider teardown complete, retains the pane as `closed` and the grid with its reader-close result, and only then delivers cancellation to the parent. A continuation neither contacts the provider nor enters pane work, does not hang, and proceeds from the retained grid outcome. Provider-resource and following-sibling observations prove both sides of the ordering; no elapsed duration is evidence |
10772
10801
10773
10802
### Tier CR — Component registration and resolution
0 commit comments