Repository navigation
🧪 Wait for REPL questions before asserting lifecycle - #981
Merged
Merged
Conversation
PR #981: 🧪 Wait for pending questions in REPL lifecycle tests1 files, +73 / -24 Scope✅ PR scope looks good. Structural✅ No structural bloat detected. Slop✅ Slop indicators look low. Static Analysis✅ Oxlint found no issues. CorrectnessFILE: packages/cli/tests/repl-lifecycle.test.ts FILE: packages/cli/tests/repl-lifecycle.test.ts |
taras
marked this pull request as ready for review
October 22, 2026 05:05
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.
Why
L2 needs a real unanswered question before it checks the element's lifecycle. Component import can still be in
enterafter entry admission, so a finite scheduler poll does not establish question readiness.What changes
Before: L2 polls for up to 1,000 scheduler turns until some lifecycle occurrence reports a wait.
After: L2 subscribes to question changes before checking the pending question, then asserts the entire
Elicit:active:questionreading. Answering the real question still leads through joined entry teardown to an empty reading and non-live session.How to verify it
The added regression holds Elicit import and checks the entire
Elicit:enter:reading with no pending question. After release, it obtains the real question, checks the full lifecycle and waiting-element assertions, answers and joins completion. A missing question wait still fails the assertion after question readiness completes.Retained focused runs passed on the candidate verified to match signed head
06e31348460a0320d9db55dde993c3511ca24848:deno task test packages/cli/tests/repl-lifecycle.test.ts— 1 passed, 9 steps, 0 failed.deno task test packages/cli/tests/repl-execution.test.ts packages/cli/tests/repl-lifecycle.test.ts— 8 passed, 42 steps, 0 failed.Scope
Included
packages/cli/tests/repl-lifecycle.test.ts.Intentionally unchanged
New abstractions
nextQuestionhelper serves ordinary L2 and the delayed-import regression. Its subscription ends when the read returns, fails or is cancelled.Risks and limitations
The controlled delay demonstrates the pre-question interval. The exact scheduling of the historical failures was not reproduced.
Scope confirmation
Refs #935.