Skip to content

Add branching Ensembles, native inbox handling and the required Bend2 REPL - #772

Draft
flip-engineer wants to merge 202 commits into
mainfrom
codex/postrelease-751-761-20261015
Draft

flip-engineer wants to merge 202 commits into
mainfrom
codex/postrelease-751-761-20261015

Conversation

@flip-engineer

@flip-engineer flip-engineer commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Baton can snapshot a settled Player's workspace, start fresh conversations in separate worktrees, evaluate their results, select a branch and continue its existing conversation. Branch commands resolve the Conductor, owned Ensemble and recorded round from context. Complete tasks, ancestry, evaluator output, pending input and explicit stops remain recorded through recovery.

CLI help, MCP descriptions and agent documentation explain the team structure and branch workflow. An Ensemble records its owner, members and coupling. Loose coupling uses parent-child and Conductor-descendant routes. Tight coupling also permits eligible peers in the same Ensemble to communicate, including peers with different parents. Branching works with either coupling. Help describes Principal and Associate responsibilities, organizational Sections, the sole-owned Ensemble default, the selected source, evaluator JSON, explicit score selection, tie handling and continuation.

Codex inbox claims, native and stop checks, admission, continuation, terminal reports and recovery now run in Bend. The native adapter transports complete WebSocket frames and owns the Codex proxy process. Registration and endpoint migration preserve recorded HOME and effective CODEX_HOME. Result propagation retains failure causes and completes proxy cleanup. Witness output contains one JSON result; proxy cleanup writes its exit record to stderr. Subscription cleanup releases blocked and queued readers and preserves a subsequent subscription. Terminal replay preserves the committed report and first receipt. Packaging removes codex-inbox-wake.mjs.

Agents can use send PLAYER TEXT, report TEXT, ask TEXT, guide PLAYER TEXT, finish SUMMARY and confirm PLAYER. Successful native settlement handles complete owned reads automatically. Interactive Claude MCP handling binds reads to the actual prompt and handles them on its successful native Stop event; failed and interrupted prompts retain pending input. Managed Codex admissions retain the generated initialization seed, instruction and complete guidance, sharing the seed across retries of the same native conversation.

Direct turns validate their output parent before native preparation. CI can reuse a verified completed Main for the current target and select the target compiler archive separately. Selected comparison includes the Codex and OMP root instruction contracts. The candidate compiler archive enables the small heap in the standalone command and retains phase diagnostics. Optional ccache compilation caches native fixture objects; baseline, cold-cache and warm-cache runs produced identical generated C and executables for ReceiveOutput and Control.

Validation completed so far:

  • Remote native transport and branching fixtures passed. Four actual Codex branches passed evaluation, and the selected branch continued in the same conversation. Separate recovery acceptance preserved lineage and explicit stops. These scores establish no performance gain.
  • The repaired narrow follower entry passed three mock scenarios: terminal reporting with an explicit stop, provider refusal with complete retained input, and native exit with its actual failure and cleanup status. These results cover the narrow entry.
  • Remote Claude adapter checks passed prompt isolation, successful handling, failed and interrupted input retention, and launcher compatibility. The configured Claude profile returns OAuth refresh HTTP 400 and profile HTTP 401 before inference. Actual authenticated Claude acceptance remains open; the same external limitation affected 2.0.
  • The original-HOME Muse acceptance completed with exit0 and 21 new response IDs in the original native conversation.
  • Packaged Main9 CLI help and MCP descriptions passed all six CLI readouts and five parity checks. The full output was reviewed against the implementation and independent Muse review.

Main11 for 9bdc172e9 completed naturally on the homelab. Actual public Codex acceptance completed two turns in the same native conversation, retained complete Unicode input, handled recipient reads on successful settlement, reported both results to the parent and refused admission after an explicit stop. The original acceptance script retained a final assertion failure against the earlier stop contract; a separate verification of the same retained attempt passed the current stop contract without admitting another native turn.

Qualification run 38943886237 ended with failed Linux jobs after the operator rebooted the homelab. The candidate completed 57 of 58 suite groups, with five failed groups; its original fixed-coordinator fixture waited for removed diagnostic events. Focused replay identified stale fixture expectations and a managed Codex explicit-resume regression. Corrected fixed-coordinator fixtures passed six focused cases against Main11. The resume repair and the delivery, REPL and missing-output recovery follow-ups require a new combined candidate build and exact target comparison.

The combined canonical coordinator check passed naturally at 19:37:26 UTC on tree 0d518d6099af97485315d177c94ac4dd75c05fc9, after 214.251 seconds with maximum RSS 28,083,960 KiB and empty stderr. The original native C-generation process for that same production closure ended at 20:31:17.194666 UTC with SIGTRAP, return code -5 and original wait status 133, after 3071.617683 seconds. Maximum RSS was 139,774,760 KiB. Cgroup OOM counters and the kernel OOM-kill counter were zero; the crash cause remains under investigation. No object compilation, native link, candidate handoff or installation followed. The complete result and 24,710,137-byte diagnostic stream remain retained. No retry has been admitted. The earlier Main and check failures, reboot-interrupted jobs and incomplete fixture waits also remain retained. Final test overlays add semantic checks for controlled child exits and preserve complete terminal custody. They do not change the compiled Bend source.

The exploratory exact-target baseline is complete: 18 groups judged 446 cases, recorded 68 failed assertion items and included five passing groups. All 18 selected test files match the final integration. Each group retains its actual shared fixture closure; earlier groups used shared revisions that differ from the final closure. This evidence establishes the target's observed behavior. Normal paired target and candidate CI remains pending. Five earlier controlled Python fixture runs remain interrupted and incomplete, with pre-interruption custody retained. Their generic wrapper exit labels do not establish natural fixture results. The final AgentInput rerun judged all 22 cases naturally and recorded one original native-conversation preservation failure. The final matrix SHA256 is 5a847f8d6dbbf49ee12b1475ef5206cfb9fd317ea989ef12aff4af29bc6e3351; independent review verified all 371 captured files and group counts.

The exact target e18f003bf has a verified native build. Its retained Main C matches all 129 target production inputs with the existing approved C substitution. The target runner verified the mapped original handoff and source/toolchain hashes, then the normal Clang object build and link completed with a verified cache hit. The final CI helper also accepts the current combined Main handoff through source, artifact and original process-wait checks. Its 16 remote synthetic acceptance/refusal cases passed without compiler execution. Compiler archive closure is verified during reuse; the original handoff records the compiler executable hash.

Both CI users now read the shared retained target evidence and completed reuse preparation, generated-C staging and transfer verification naturally. Both verified the exact target commit and generated C SHA256 ca552285e64a7cfad67bc657b7e81a32d6c0c3b80eb6a9628c4de512a369c202. These preflights executed no compiler and preserved the original files and permissions. The 37-file evidence capture has archive SHA256 3576503d7fd4082f57e61480c5a91870889d4eda5d065ccc42dcd68f88f58c3b. Candidate CI still requires a complete candidate Main handoff.

The missing-output recovery follow-up reconstructs the retained output projection and preserves the original native attempt. An observation-failure report committed before recovery keeps its original body and identity. The recovery qualification does not establish replacement of that parent report.

Standard release archives and normal installation require the bundled Bend2 REPL compiler source and Bun runtime, with exact file hashes and distribution notices. The REPL accepts Bend2 source. Its pinned compiler source is included in the checkout. Native REPL IO also requires a system C toolchain and SQLite development files. Supported macOS installation checks Apple Command Line Tools and the macOS SDK before activation. The required Darwin archive qualification exercises pure evaluation, interactive input and complete native IO from the extracted installation while the build source is unavailable. Normal coordinator archive and installed CLI acceptance remain pending. The corrected remote Darwin dependency preflight completed naturally with all 83 extracted dependency files verified, pure Bend2 evaluation returning 42 and native SQLite-linked Unicode IO after the original source paths were moved away. It recorded Apple Clang 17.0.0 and macOS SDK 15.5. The first SDK-path failure remains retained; this dependency check establishes no normal coordinator archive or live adoption verdict.

Baton 2.0 remains released and active. Version 2.1 still requires complete candidate qualification, the selected target comparison, Darwin artifact qualification, publication, installation and live adoption. Compiler memory work has no measured performance improvement claim.

Refs #751, #761, #731, #733, #758, #771, #773, #774, #775, #776, #780, #781; follow-ups #668, #778, #786.

Implement inherited-environment subprocess pipes, WebSocket upgrade and text frames, complete protocol errors, cancellation, and natural child wait for #761. Add remote-validated protocol and Bend effect regressions.
Implement inherited-environment subprocess pipes, WebSocket upgrade and text frames, complete protocol errors, cancellation, and natural child wait for #761. Add remote-validated protocol and Bend effect regressions.
Implement inherited-environment subprocess pipes, WebSocket upgrade and text frames, complete protocol errors, cancellation, and natural child wait for #761. Add remote-validated protocol and Bend effect regressions.
Preserve SIGINT and SIGTERM forwarding for #761. Restore prior handlers after the last actual child wait and test concurrent reads, external cancellation, and multiple owned handles.
Preserve SIGINT and SIGTERM forwarding for #761. Restore prior handlers after the last actual child wait and test concurrent reads, external cancellation, and multiple owned handles.
Refuse cancellation with ECHILD after the actual child is reaped. Keep PID selection and kill under the registry lock so concurrent close cannot select process group zero. Add an actual retired-child regression for #761.
Refuse cancellation with ECHILD after the actual child is reaped. Keep PID selection and kill under the registry lock so concurrent close cannot select process group zero. Add an actual retired-child regression for #761.
flip-engineer and others added 22 commits October 16, 2026 22:10
…ate-20261017

Record deployed observer recovery and compiler qualification tasks
…-20261016

Track exact DeepSeek V4.1 Flash API metadata
…tch-20261017

Track dated DeepSeek model appearances through the API
…ing-20261017

Record no-PCH emitted-C sharding experiment
…-pidfd-20261017

Retain the validated process lifetime during terminal observer retirement
…n-sharder-20261017

Use no-PCH sharding for Linux Clang 19 Main builds
…-20261017

Resolve current executable path after atomic replacement
…-narrow-20261017

Avoid repeated terminal serialization on output-only frames
@flip-engineer

Copy link
Copy Markdown
Collaborator Author

Root merged the required Bend2 REPL source and recovery fixes as PR #852, main ad54e466471da307541c825d548465bfb47a2344. The complete original source series through 16b31a8a was transplanted on current main and qualified with 17/17 recovery tests plus isolated installed-prefix attach/join/eval acceptance. This consolidates the REPL source portion of this older combined PR.

Full Main/package generation and deployment remain open; the compiler and memory lanes retain those gates. Remaining branching/native-inbox deltas in this PR still require explicit reconciliation against current main before closure.

@flip-engineer flip-engineer left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned to development by the root conductor. The required REPL portion has already landed through #852 and subsequent fixes. Reconcile the remaining branching and native-inbox changes with current main, preserving the original contributor lineage. The current PR has failed or interrupted Linux qualification and no complete current candidate runtime result. Continue the remaining implementation and self-hosted qualification, publish the reconciled candidate, and request root review. Choose integration increments based on the actual remaining changes. This task remains open.

Review disposition recorded 2026-10-19. Completed and validated work proceeds through root review, merge and deployment; remaining work stays assigned for development or escalation.

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