Repository navigation
fix(native): SIGTERM orderly exit, acceptance --dry-run, and real-desktop driver recipes (#328, #329) - #330
Merged
Merged
Conversation
…top driver recipes hold on real hosts (#328, #329) Two real-product journeys (#314) left findings this change closes. SIGTERM orderly exit (#329): the embedded Racket CS runtime maps SIGTERM to a Racket break, which a GUI host swallows - a packaged app then hangs forever when a process manager or suite terminates it (reproduced deterministically on a healthy app; plain racket exits). The macOS host template and the reference taskboard now install a self-pipe SIGTERM handler whose main-queue dispatch source performs NSApplication.terminate, reusing the existing applicationShouldTerminate orderly stop. Installed at launch and re-asserted after backend start so the runtime boot cannot leave its own handler in charge. Red-green: a packaged app from the old template survives SIGTERM; one from the new template exits orderly in about one second. acceptance --dry-run (#328): validates the manifest shape and requirement coverage, resolves the current platform suites and their executables, and checks evidence path rules before launching any child, so a hand-edited manifest fails in seconds instead of minutes into a packaged suite. The report is flagged dry-run with per-suite dry-run statuses and must not feed the cross-platform matrix. Reference driver and docs (#328, #329): the macOS launch orchestration now states the real exit semantics (quit Apple Event; SIGTERM/terminate/close button can all be swallowed), warns against keyboard phases in a second instance (false-positive frontmost, broken key routing), and documents the four silent desktop failures: AX focus writes that do not move focus, IMEs swallowing synthetic text (TIS ASCII-layout switch with restore), posted keys routing to the user on shared desktops (frontmost guard, fail fast), and AX element zombies after view rebuilds (re-find from the live tree in every bounded wait). The reference driver gains keyboardGuard, TIS input-source switching, the quit-Apple-Event exit, and live-tree re-probing in its event polling; the wedged-startup signature and one bounded-relaunch mitigation are documented.
The runner's current platform resolves the suites, so the manifests these tests drive through run-acceptance-command must apply everywhere CI runs them (linux legs failed the platform-resolution check).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the implementation deliverables of #328 and #329 (both sourced from the #314 real-product journeys). Docs, the reference driver, a new CLI capability, and one runtime-behavior fix with red-green proof.
SIGTERM orderly exit (#329, finding 2)
The embedded Racket CS runtime maps SIGTERM to a Racket break; a GUI host swallows that break, so a packaged app hangs forever when terminated. Reproduced deterministically on a healthy packaged app (this is not only the wedged-startup case), while a plain
racketprocess exits because its top level lets the break propagate.The macOS host template (and the reference taskboard example) now install a self-pipe SIGTERM handler whose main-queue dispatch source runs
NSApplication.terminate— reusing the existingapplicationShouldTerminateorderly stop. The handler is installed at launch and re-asserted after the backend starts, because the runtime boot installs its own handlers and the last installation must win.Red-green evidence: packaged app from the old template survived
kill -TERM(still running at 0.0% CPU minutes later); packaged app from the new template exited orderly ~1 second afterkill -TERM.raco rivet acceptance --dry-run(#328, finding 3)Loads and validates the manifest (shape, requirement coverage), resolves the current platform's suites and their executables, checks evidence path rules, and exits before launching any child. A hand-edited manifest with a syntax error now fails in seconds with a precise read error instead of minutes into a packaged suite. The report is flagged
"dry-run": truewith per-suite"dry-run"statuses — a validation record that must not feedraco rivet matrix. Tests cover the green path, no-execution proof, parse failure, missing executable, and evidence-path rejection.Reference driver + docs (#328 findings 1–2, #329 findings 1–3)
native-ui-testing.mdnow documents the four silent desktop failures and the real exit contract:keyboardGuardin the reference driver).frontmostwith broken key routing. The reference driver exits through Cmd+Q (quitOrderly).Validation
raco test rivet/ rivet-cli/: 10205 passed (includes 6 new dry-run tests).raco test rivet/tests/documentation.rkt: 732 passed.swiftc -typecheck rivet/tests/native-ui/macos-ax.swift: green.raco rivet buildin examples/taskboard: green (host template change compiles).--dry-runsmoke on a real project: valid manifest →exit 0with per-suite listing; broken manifest → precise read error,exit 1.Scope note
#329's startup-spin heisenbug is not fixed here (cannot be reproduced on demand; static analysis points at a GC thread-suspension rendezvous class of race inside the embedded Chez runtime — needs a spindump from a wedged instance). The issue keeps that finding open with the documented mitigation and the diagnostic evidence path; SIGTERM and the exit-semantics findings are resolved by this PR.