Repository navigation
mac tests: capture acceptance asserts the caret-aware contract it actually has - #491
Merged
Merged
Conversation
…ually has
Two expectations in CaptureAcceptanceTests predate the caret-context work and
fail against the real bridge and preview controller.
`session.destination` was compared with a rebuilt `Destination` carrying only
the four identity fields. The announced destination also carries
`caret_context` -- what the companion shows before sending -- which
`announcedNearbyDestination` attaches whenever the document is open here,
independent of the fluid-caret-pin switch the suite turns off in setUp. Now
asserted field by field: the wire contract is additive, so a whole-value
comparison fails on every new optional field rather than on a real change.
`pending.text` was compared with `Insertion.insertionText`. A capture goes
through `Insertion.captureInsertion`, which is "separate from insertionText on
purpose" (its own doc comment): it runs `CaretContext.normalize` first and only
lays out newlines for a display wrap. Byte 17 is the start of the line holding
"Hello durable world.", so the caret is inline text and the sample's
`\begin{equation}` is legitimately rewritten to `$…$` -- display would split
the sentence.
Both only run with FLASHTEX_BRIDGE / FLASHTEX_PREVIEW_CONTROLLER set.
Implementation-Agent: orchestrator-astra
Commit-Executor: orchestrator-astra (direct; Cursor usage limit)
…pture-acceptance-staleness
GoKubar
added a commit
that referenced
this pull request
Sep 15, 2026
…n_launch (#632) The CI job `rust bridge (ubuntu-latest)` intermittently failed compiler_process_success_and_timeout_leave_editor_unchanged with "validation_launch: Could not launch the configured FlashTeX compiler" on unrelated PRs (#264, #284, #491). Root cause, reproduced locally: the classic fork/exec ETXTBSY race. The bridge integration tests run in parallel threads, and each writes a fresh fake-compiler script (fs::write + chmod) before validate() spawns it. If another thread forks a child while the writer's fd is still open, that child inherits the write fd until its own exec; exec'ing the script in the meantime fails with os error 26 (Text file busy) even though the writer already closed the file. A standalone stress harness reproduced 605 ETXTBSY failures in 24000 write+spawn cycles across 8 threads, and the same fake()+validate() pattern against the unfixed crate reproduced the exact CI error 8 times in 3200 cycles. Fix in CompilerValidator::validate: - retry the spawn (up to 20 x 10ms) when the error kind is ExecutableFileBusy - the condition is transient by definition and clears as soon as the interfering child execs; - on real launch failure, include the executable path and the underlying io::Error in the validation_launch message instead of discarding it, so a future failure is diagnosable from the CI log. The test itself is unchanged, so nothing it asserts is weakened. Verified: full bridge suite green (170 passed, 0 failed, 2 ignored); proposal_validation run 20x in a loop, 20/20 green; stress harness 0 failures in 3200 concurrent validate() cycles with the fix vs 8 without it. Implementation-Agent: fable-bridge-flake Commit-Executor: fable-bridge-flake (direct; Cursor usage limit)
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.
Two expectations in
CaptureAcceptanceTestspredate the caret-context work and fail against the real bridge and preview controller.1. The advertised destination carries caret context
announcedNearbyDestinationattachescaret_contextwhenever the destination's document is open here — that is what lets the companion say "display math" or "already inside$…$" before you send. It is independent of the fluid-caret-pin switch this suite turns off insetUp, so the override does not suppress it.Now asserted field by field. The wire contract is additive ("consumers must tolerate their absence and unknown values"), so a whole-value comparison fails on every new optional field rather than on a real change.
2. A capture is normalised for its caret
approveProposalcallsInsertion.captureInsertion, which the source says is "separate frominsertionTexton purpose": it runsCaretContext.normalizefirst and only adds surrounding newlines for a display wrap.The document is
\begin{document}\nHello durable world.\n\end{document}\nand the caret is byte 17 — the start of the line holding the prose. So the caret is inline text, and the sample'sis correctly rewritten to
$\int_0^1 x^2 \, dx = \frac{1}{3}$. Display there would split the sentence — which is exactly the casecaptureInsertionexists to handle.Asserted against
captureInsertionnow, so the test tracks the path the model actually takes.Why this sat on main
Both tests
XCTSkipwithoutFLASHTEX_BRIDGE/FLASHTEX_PREVIEW_CONTROLLER. Gated onmac-m1max-awith the helpers wired in: main is 13 failures across 7 tests, and these are 2 of them.Implementation-Agent: orchestrator-astra
Commit-Executor: orchestrator-astra (direct; Cursor usage limit)