Repository navigation
Integrate the required native Bend2 REPL and recovery fixes - #852
Merged
Merged
Conversation
Add the notebook model, runtime, source composition and command handler, the host custody calls, and the CLI action, route and observer wiring. The MCP conductor exposes baton2_repl with the same operations, advertises its guidance when the coordinator surface lists repl, and the MCP command test asserts the advertised guidance. The coordinator redefinition path keeps the F1 behavior from the compiler frontend. This slice depends on the compiler frontend and packaging prerequisites and requires the native coordinator build acceptance.
Recovery observes only an attempt without a recorded wait status. A settled compiler or native attempt keeps its native identity, birth, output, wait status and cause. A cleanup failure cannot append a cause to a recorded exit-0 attempt with no cause. A focused check mirrors the f4c0c53 F3 cases at the Runtime.execute boundary. Refs #778.
A colon command that reports a recoverable refusal must not end the interactive session. :bind without a name now prints its usage and continues. :submit checks the notebook guard first; when another evaluation holds it, the session prints the active-evaluation cause, preserves the draft and continues. The one-shot REPL commands keep their existing exit status.
…ation ReplHost.line used the generic raw reader import, so the compiler assigned a line effect ID that no C registration backed; the interactive REPL exited with an unknown effect. Register the line reader in repl.c and bind the line operation to that file. Add a focused native entry for the attach, repl and repl-observe routes so the F2/F3 fixtures exercise the same command handler without a full Main build. The fixture starts the shared owner, records the actor workspace and holds the notebook lock the coordinator derives.
Stage directories are direct database siblings (db.cell.compiler and db.cell.native) so owner admission sees the database parent. The legacy nested layout is refused with its recorded outcome preserved. The interactive line reader keeps getline count, rejects embedded NUL and invalid UTF-8 with typed errors before io_str, and preserve_output verifies regular files. The custody fixture now fails on observer exit or unstarted causes instead of skipping, uses a short isolated XDG_RUNTIME_DIR, and covers native eval plus NUL, invalid UTF-8 and multiline/EOF input. Refs #845 Refs #846
The keeper reports BR_READY without treating a still-running native as a fatal keeper error; the native exit remains with the keeper waiter. A subscription with an empty expected generation accepts the owner ready cursor or gap instead of rejecting it as a malformed decimal. Refs #845
The fixture now requires the released marker and no acknowledged marker before stopping the observer, and resumes a stopped observer when a window is missed. This prevents the observed active-observer refusal during recovery. Refs #845
A waiter can set native_waiting before the observer sends BR_READY. The keeper now calls br_native_exited after the readiness reply when that flag is set, recording any error without failing the keeper. This preserves readiness for a running native and reaps a native that exited before readiness. Refs #845
This was referenced Oct 18, 2026
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.
Baton exposes its required Bend2 REPL through the native coordinator and agent command routes. Recorded cell outcomes survive recovery; interactive line input and readiness handling preserve the native owner across recoverable refusals. The package prefix uses the required Bend2 compiler.
This carries the complete nine-commit source series through original revision
16b31a8a2d828731c92407e4446ab2e1ec9c709c, applied on current mainca0e04c, plus a focused driver for the productionRecruit.joinoperation. Current source is538d902973c00e424c0da9de355723549aada473. Native account and helper-install changes remain in its ancestry.Homelab validation: exact source recovery fixture 17/17 with zero skips; a negative readiness control reproduced the prior failure; isolated installed-prefix attach and evaluation passed. The focused production join driver passed compiler checking, built with clang-19 and SQLite under a 16 GiB/no-swap scope (peak 4,154,132,224 bytes), registered the child in a disposable workspace, and the installed REPL then evaluated
installed-repl-joined-evalsuccessfully. The owner shut down cleanly.The full production Main package has not been rebuilt or installed. This source merge retains that deployment gate; the isolated prefix receipts establish the scoped REPL and join paths. References the required REPL work in #772.