Skip to content

Remove redundant legacy envelope builds from Turn CLI - #8389

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/retire-turn-cli-legacy-envelope-20261109
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/retire-turn-cli-legacy-envelope-20261109

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

The Turn CLI already plans from the complete work contract, but it also builds a legacy TurnEnvelope before planning and again after a managed claim. This removes those builds and lets managed preparation check the original contract through the existing identity reader.

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Independent CLI and managed preparation slice of C1: unify work sources and validate recovery #8266, targeting main.
  • Goal/source and gap: Pass the already composed work contract through preparation while preserving the selected Todo, the lease, independent validation and settlement.
  • Observable before → after: On both File and SQLite, turn plan preview and details went from 2 to 1 Turn projection RPCs. Managed runs went from 1 to 0 legacy builds for ready work and 2 to 0 when a claim was needed.

Author Declaration

  • Written by: model_agent — OpenAI Codex.

Implemented against

Criterion Disposition Symbol / path Test or command
Read the original complete contract during preparation implemented handle_turn_command, prepare_native_task Native ready and claim paths on File and SQLite
Check identity and reject corrupted carriers implemented complete_turn_host_source Source-only, malformed source, explicit null/empty adapter, and saved Host readback tests
Preserve the selected Todo through validation and settlement implemented tests/test_native_steward_turn_host.py Real store, independent synthetic validator, original native session and idempotent replay
  • Self-check before submission: Compared the same four plan inputs on base and head, reproduced the redundant build on both managed paths, and ran the scoped source and packaged tests below.

Scope And Continuation

  • Completed scope: The CLI and steward preparation now use the same work source. The TypeScript identity owner still verifies complete sources; explicit legacy adapters and capture headers retain full validation. Historical readers remain available.
  • Slice boundary: The CLI and steward production changes match C1: unify work sources and validate recovery #8266. Landing this slice lets those two production files drop out of the remaining C1 diff. C1 context delivery and recovery qualification continues in C1: unify work sources and validate recovery #8266.

Validation

  • Tested revision: 8bcef3766672725bd9afc429fef8cc55c0d48ff6, compared with aa475b29f1976a4fde901deca84672ddb3415152.
  • Run state: finished.
  • Input classes: synthetic.
Check kind Result Public-safe evidence / limitation
regression_parity passed Same File/SQLite fixtures, read-only preview and full details, turn plan: 2 → 1 Turn projection RPCs in each case. No legacy envelope on either output.
real_entrypoint passed 26 native tests, including ready/claim, validation, lease conflict, unavailable work, and replay; plus generic turn run-once completion through a synthetic host.
real_backend passed File and SQLite with disposable state. Managed validation checks the same Todo and Turn before settling; absent or malformed proof cannot launch work.
integration passed 76 source tests for complete Host requests, capture/recovery, controller projection and generic execution. The built wheel passed 8 focused tests plus two fresh CLI processes, with imports resolved from the wheel.
static passed Ruff, Git whitespace check, public-boundary scan and signed commit. The diff-scoped premerge canary passed locally; any manual checks are listed by its validation contract.
  • Coverage and gaps: The RPC counts cover the Turn projection boundary in these fixtures. No model token, latency, or benchmark outcome claim. No provider migration or deployment.

Frontend / Visual Evidence

  • UI impact: none. This changes how the existing CLI and managed host obtain their work source; there is no visual change.

Type of Change

  • Refactoring (no functional changes)
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Host or runtime integration

Shared-authority RFC fixture impact

N/A; no change to provider routing or stored authority.

Boundary Checklist

  • Diff and review materials contain public-safe evidence.
  • Scoped to the linked CLI and native host slice.
  • No paired RFC changed.
  • UI impact marked none.
  • DCO sign-off present.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

This branch has not been deployed

No deployments
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