Skip to content

fix: distinguish refused and partially effected interruptions (#212) - #218

Draft
SSFSKIM wants to merge 5 commits into
feat/117-m4from
fix/212-interruption-effects
Draft

SSFSKIM wants to merge 5 commits into
feat/117-m4from
fix/212-interruption-effects

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Stacked on feat/117-m4 at 7c8efac4 (draft #211), not main. Refs #212; related #208 and #206. Plugin 0.18.1.

Design

  1. Keep -10016 / userIntervened, but distinguish a request-level before-effects refusal (including cleanup) from a conservative in-flight interruption after possible effects.
  2. Record value-free reached steps: AX focus write attempted, preparation/focus click posted, activation click posted, value write attempted, ordinary action input dispatched, and held activation teardown attempted. This is not an exhaustive inventory of preparation mutations.
  3. Render those facts in native and JS-visible errors, including concealed inputs; a null ordinary action interval never proves no preparation effects. Attributed input is not proof of a human.
  4. Preserve the latest interrupted action's phase/effects, route, interval, receipt time and activation-click metadata through an observation in the same execution; each thrown error retains its own diagnostic. The next execution starts clean.
  5. Yield without route 4's optional reactivation/window raise after detecting intervention. Preserve the guards and required cleanup; no automatic retry and no rollback claim. Recovery names the public getAXState().

What the fixtures guarantee

Injected Swift AX/event seams cover both pre-action guard conditions; interruption after AXFocused (whether focus takes or a fallback click would follow); after a focus/activation click but before AXValue; and a value-write attempt seen by a subsequent guard. The field's default value is unchanged when the stop precedes AXValue. An already-dispatched down/up group can complete, but the next optional group cannot begin after a detected stop. Route 4 neither reactivates the old app nor raises its window after intervention, while ordinary delivery failures still restore.

The JS fake-engine → trusted service → real facade tests cover ordinary and concealed setValue, bounded value-free messages, and same-execution observation without losing the interrupted action's snapshot.

The incident's root cause—who pressed Save—remains unproven. No live save sheet was reproduced, no GUI or Mac mini was driven, and no secrets/auth files were read. These fixtures prove interruption classification and mutation boundaries, not the provenance or target of the incident's Save. This PR deliberately uses Refs, not Closes.

Verification

  • RED: hosted Swift regression 40039285987 failed on missing phase/effect diagnostics and the optional post-stop restore. JS regressions failed on the old message and the concealed path's false no-entry implication.
  • GREEN locally: 61 focused JS tests pass (services-engine-protocol, services-engine-service, services-sky); git diff --check clean.
  • Authority gate GREEN 2/2 on final head aa247af8: 40042332977, via ci-gate /Users/new/Developer/GitHub/cua-212 --gates engine-swift,test. Swift: 540 passed, 0 failures. Full Node suite: 4,221 passed, 89 skipped, 0 failures (4,310 total). No native build ran locally.
  • Self-review completed; independent review is left to the controller. The final fixture injects the event through actual FakeActivation / HeldActivations with fake event delivery, rather than assigning activation metadata by hand.

Review correction: request-level teardown

The reviewer identified that a method-local pre-input refusal can follow menu/focus teardown in execute(), or precede deactivation posted while the request unwinds. The correction accounts for release attempts over the entire execute lifecycle, inspecting them only after all deferred cleanup has finished. It preserves existing cleanup ordering rather than retaining stale held activations or merely moving a guard ahead of one teardown path.

If teardown occurred, the final error is in-flight / interrupted-after-possible-effects with activation-teardown-attempted: a deactivation event may have been posted (a shared holder or real activation can suppress it). Prior effect markers and input metadata remain intact. A subsequent request without teardown retains before-effects rather than inheriting history.

The regression calls the real execute() lifecycle and real guard/held-activation release, substituting only the method input boundary to avoid live input or permission prompts. It covers menu teardown before set_value, menu teardown while a refused item click unwinds, and focus-hold teardown before dispatch. Hosted RED 40041621738 reproduced the false before-effects result in all three cases; the final GREEN run above passes them. The JS error also names the teardown attempt.

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
…#212)

Yield without foreground restore after a detected intervention. Surface bounded, value-free diagnostics through the native error, JS facade and concealed-input wrapper; retain the interrupted action snapshot through observation. Bump plugin to 0.18.1.

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
Exercise FakeActivation and HeldActivations over the existing event seam: the activation click group completes, the ordinary click never starts, and the interruption retains the preparation effect despite a null action interval.

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
Extract the method dispatcher from the execute lifecycle so the regression exercises real menu/focus teardown and the guard without permission prompts or live input.

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
Account for held menu/focus release attempts across the entire execute lifecycle, including deferred cleanup after a refusal. Preserve required cleanup and prior input metadata, but replace before-effects with an in-flight outcome whenever teardown may have posted deactivation.

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 23, 2026
…t-way and names what may have taken effect (refs #212)

PR #218's intent, re-cut on today's engine. The vendor's sentence still opens the answer; one clause follows it:
"Nothing was done" for a refusal before the action, else "The action was stopped part-way" and "What may have taken
effect: ..." from the steps the request reached (a scroll into view, route 3's activation and its click, the field's
focus write or WebKit caret, the focus fallback's click, the value write, the action's own input), none undone. The
meta carries the same as `interruption {phase, effects}`. A request that ended a held activation (a menu span or a
focus hold), as it began or while it unwound, names that end too, read once execute's own cleanups have run; execute
takes a dispatch seam so the lifecycle is tested without live input. Rides on engineVersion 0.2.0.

Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM added a commit that referenced this pull request Nov 23, 2026
…-sheet cell prepared (refs #212)

Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM added a commit that referenced this pull request Nov 23, 2026
…s the interrupted action's snapshot (refs #212)

cua/interruption carries the engine's account with the interrupted action's route, interval, receipt and activation
data, and is the one key not reset per call: it stays through the observation the answer advises in the same cell,
and the host's fresh meta per execution keeps it from the next. Ports PR #218's act -> observe -> next-execution
regression for ordinary and concealed calls. The wrapper's refusal says "it was refused before its first step; nothing
was entered", and its fixed phrases follow the engine's.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant