feat(core): convert residual operator lifecycle onto the Go host (#2618) #2639

Open
conductor wants to merge 3 commits from feat/2618-operator-residual into master
pull from: feat/2618-operator-residual
Owner

Relates to #2618

Based on PR#2632's eaa5c907. Commit: 1b25d0ec82a7ab5e4de615ebc2efd72b20497bd3.

Admitted contracts: ADMIT-2618-operator-residual and scope supplement ADMIT-2618-operator-oracle-canaries (both left building/open; no closure or Python retirement claimed).

Capability evidence

  • Intake/classification/routing: Rust owns task-family, follow-up/create/amend, and parent-lineage decisions. rune-core calls the existing adaptive-router derive/classify/dispatch/record processes; no construction or research executor was reimplemented. TestProcessRouteClientUsesExistingRouteAndDispatchServices and the serving tests pass.
  • Lifecycle/state: canonical created→running→completed and failure terminalization are served by Go repositories with Rust legal-transition decisions. research_required and awaiting_approval resume to running after real process kills; researched turns do not call the model. Duplicate completed-turn receipts are atomic with final task state and cause no second message/event/model call.
  • Events/atomicity: fsync'd JSONL event append/replay preserves physical offsets, identity, corruption errors, and duplicate idempotency. Atomic checkpoint tests use real files, failed writers, and concurrent readers proving only complete old/new values are visible.
  • Records/conversation: Rust validates task/message/event records and computes Python-compatible payload hashes. User/assistant messages carry the canonical task ID through the existing Go TailStore; /v1/status and /v1/tasks now derive from canonical state instead of zero placeholders.
  • Python compatibility: default RuneOperator methods are thin fail-loud clients of the same Go /v1 surface. No independent dispatch runs by default and no Python authority is deleted. core="python" / RUNE_OPERATOR_CORE=python is the explicit final-retirement oracle; the five direct scripted canaries select it deliberately.

Serving-path proof

TestRealNativeServingTurnDoesNotInvokePythonOperator drives httptest -> Server.Handler -> Engine.TurnStream -> NativeOperator with real Rust and adaptive-router processes, native event/route files, and a fake model only at the provider boundary. The captured completed task uses route STANDARD_CHANGE; trace is operator=go-operator, native=rust-operator-lifecycle, events=go-event-store, family=chat, intake_action=created; Python/Python3 sentinels remain absent. See verification/operator-lifecycle-serving.json.

RUNE_CONTEXT_PROOF=1 go test ./internal/runecore -run TestRealNativeServingPathWithCanonicalStore -v also passes, proving PR#2632 canonical recall still reaches the model on top of this lifecycle.

Verification

  • Rust operator_lifecycle: 18 tests, clippy -D warnings, and fmt all green.
  • Go rune-core: full go test ./..., go test -race ./..., and go vet ./... green.
  • Python: 307 passed + 5 subtests across the complete orchestration glob, operator tools/probe, task lifecycle/state, conversation compaction, and native-client suites.
  • canary_conversation_state, canary_orchestration_foundation, all 35 canary_rune_serve checks, and explicit-oracle p1_01/02/03/07 pass.
  • ruff check src tests, henxels check, and python3 scripts/dichotomy_audit.py pass. The staged landing/contract gate passes.
  • Red-first discharge for D1–D8 is recorded in plans/2618-operator-residual.md and the commit trailers.

Remaining gaps / boundaries

  • Provider stack: registry/transport/profile conversion remains outside this tranche. canary_p1_06 remains RED before operator dispatch in untouched model_routing because its SimpleNamespace lacks provider; it is not counted green or caused by this conversion.
  • Background memory: curator, consolidation, drift, tiers, sleep_time, continuity, and warm/background pipelines remain their separate package.
  • Construction/research: execution stays with #2609/#2617; this branch only makes client calls into the existing route/dispatch service.
  • Retirement: Python compatibility bodies remain for the final retirement tranche; no Python authority was deleted and no construction contract was closed.
  • python3 -m pyright is unavailable, so the type ratchet cannot analyze. The lint ratchet remains RED on pre-existing BLE001 139>47 and S110 197>31 debt; full Ruff is green. Scaffolding coverage also names 33 pre-existing ungoverned modules, none from this branch; operator_lifecycle is covered.

Do not merge from this description alone; required protected checks and independent review still apply.

Relates to #2618 Based on PR#2632's `eaa5c907`. Commit: `1b25d0ec82a7ab5e4de615ebc2efd72b20497bd3`. Admitted contracts: `ADMIT-2618-operator-residual` and scope supplement `ADMIT-2618-operator-oracle-canaries` (both left building/open; no closure or Python retirement claimed). ## Capability evidence - **Intake/classification/routing:** Rust owns task-family, follow-up/create/amend, and parent-lineage decisions. `rune-core` calls the existing adaptive-router derive/classify/dispatch/record processes; no construction or research executor was reimplemented. `TestProcessRouteClientUsesExistingRouteAndDispatchServices` and the serving tests pass. - **Lifecycle/state:** canonical created→running→completed and failure terminalization are served by Go repositories with Rust legal-transition decisions. `research_required` and `awaiting_approval` resume to running after real process kills; researched turns do not call the model. Duplicate completed-turn receipts are atomic with final task state and cause no second message/event/model call. - **Events/atomicity:** fsync'd JSONL event append/replay preserves physical offsets, identity, corruption errors, and duplicate idempotency. Atomic checkpoint tests use real files, failed writers, and concurrent readers proving only complete old/new values are visible. - **Records/conversation:** Rust validates task/message/event records and computes Python-compatible payload hashes. User/assistant messages carry the canonical task ID through the existing Go `TailStore`; `/v1/status` and `/v1/tasks` now derive from canonical state instead of zero placeholders. - **Python compatibility:** default `RuneOperator` methods are thin fail-loud clients of the same Go `/v1` surface. No independent dispatch runs by default and no Python authority is deleted. `core="python"` / `RUNE_OPERATOR_CORE=python` is the explicit final-retirement oracle; the five direct scripted canaries select it deliberately. ## Serving-path proof `TestRealNativeServingTurnDoesNotInvokePythonOperator` drives `httptest -> Server.Handler -> Engine.TurnStream -> NativeOperator` with real Rust and adaptive-router processes, native event/route files, and a fake model only at the provider boundary. The captured completed task uses route `STANDARD_CHANGE`; trace is `operator=go-operator`, `native=rust-operator-lifecycle`, `events=go-event-store`, `family=chat`, `intake_action=created`; Python/Python3 sentinels remain absent. See `verification/operator-lifecycle-serving.json`. `RUNE_CONTEXT_PROOF=1 go test ./internal/runecore -run TestRealNativeServingPathWithCanonicalStore -v` also passes, proving PR#2632 canonical recall still reaches the model on top of this lifecycle. ## Verification - Rust `operator_lifecycle`: 18 tests, clippy `-D warnings`, and fmt all green. - Go `rune-core`: full `go test ./...`, `go test -race ./...`, and `go vet ./...` green. - Python: 307 passed + 5 subtests across the complete orchestration glob, operator tools/probe, task lifecycle/state, conversation compaction, and native-client suites. - `canary_conversation_state`, `canary_orchestration_foundation`, all 35 `canary_rune_serve` checks, and explicit-oracle p1_01/02/03/07 pass. - `ruff check src tests`, `henxels check`, and `python3 scripts/dichotomy_audit.py` pass. The staged landing/contract gate passes. - Red-first discharge for D1–D8 is recorded in `plans/2618-operator-residual.md` and the commit trailers. ## Remaining gaps / boundaries - **Provider stack:** registry/transport/profile conversion remains outside this tranche. `canary_p1_06` remains RED before operator dispatch in untouched `model_routing` because its `SimpleNamespace` lacks `provider`; it is not counted green or caused by this conversion. - **Background memory:** curator, consolidation, drift, tiers, sleep_time, continuity, and warm/background pipelines remain their separate package. - **Construction/research:** execution stays with #2609/#2617; this branch only makes client calls into the existing route/dispatch service. - **Retirement:** Python compatibility bodies remain for the final retirement tranche; no Python authority was deleted and no construction contract was closed. - `python3 -m pyright` is unavailable, so the type ratchet cannot analyze. The lint ratchet remains RED on pre-existing BLE001 139>47 and S110 197>31 debt; full Ruff is green. Scaffolding coverage also names 33 pre-existing ungoverned modules, none from this branch; `operator_lifecycle` is covered. Do not merge from this description alone; required protected checks and independent review still apply.
conductor added 3 commits 2026-10-26 10:26:47 +00:00
feat(memory): one canonical memory store with native retrieval and fail-loud authority (#2618)
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Failing after 49s
CI Pipeline / go-surface (push) Failing after 30s
CI Pipeline / rust-surface (push) Failing after 14s
CI Pipeline / best-practices (push) Canceled after 0s
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 4s
CI Pipeline / unit-tests (push) Canceled after 51s
Auto-label / auto-label (pull_request) Successful in 0s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 22s
Spec gate (headless) / spec-gate (pull_request) Successful in 15s
CI Pipeline / unit-tests (pull_request) Failing after 41s
CI Pipeline / lint (pull_request) Failing after 43s
CI Pipeline / rust-surface (pull_request) Failing after 9s
CI Pipeline / go-surface (pull_request) Failing after 26s
CI Pipeline / best-practices (pull_request) Successful in 4s
CI Pipeline / documentation (pull_request) Successful in 2s
CI Pipeline / canary (pull_request) Failing after 57s
CI Pipeline / type-check (pull_request) Failing after 39s
CI Pipeline / gitea-offline (pull_request) Successful in 19s
CI Pipeline / required-checks (pull_request) Failing after 1s
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Failing after 4s
f4b2b13ba6
Unify the three database conventions and native candidates on memory-store-deep, keep Python as a delegating compatibility facade, and make Go/Rust serving failures explicit instead of silently degrading.

Contract: ADMIT-2618-canonical-memory-store
Construction-Contract: BUILDER-2026-10-26T01:59:46Z-c5e4b2-mimo-2618
Construction-Contract: BUILDER-2026-10-26T04:10:18Z-6c3814-mimo-2618
Discharge: D1 -> src/go/memory-store-deep/canonical_cli_test.go
Discharge: D2 -> src/go/paths/resolver/memory_test.go
Discharge: D3 -> src/go/memory-store-deep/canonical_test.go
Discharge: D4 -> tests/test_memory_store_native.py
Discharge: D5 -> src/go/memory-store-deep/canonical_cli_test.go
Discharge: D6 -> src/go/memory-store-deep/canonical_test.go
Discharge: D7 -> tests/test_memory_store_native.py
Discharge: D8 -> src/go/memory-store-deep/canonical_cli_test.go
Discharge: D9 -> src/go/memory-store-deep/canonical_test.go
feat(context): governed model-visible context assembly on the canonical memory store (#2618)
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Canceled after 0s
CI Pipeline / unit-tests (push) Canceled after 0s
CI Pipeline / go-surface (push) Canceled after 0s
CI Pipeline / rust-surface (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 0s
CI Pipeline / best-practices (push) Canceled after 0s
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / lint (pull_request) Canceled after 0s
CI Pipeline / unit-tests (pull_request) Canceled after 0s
CI Pipeline / go-surface (pull_request) Canceled after 0s
CI Pipeline / rust-surface (pull_request) Canceled after 0s
CI Pipeline / canary (pull_request) Canceled after 0s
CI Pipeline / best-practices (pull_request) Canceled after 0s
CI Pipeline / documentation (pull_request) Canceled after 0s
CI Pipeline / type-check (pull_request) Canceled after 0s
CI Pipeline / gitea-offline (pull_request) Canceled after 0s
CI Pipeline / required-checks (pull_request) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Canceled after 0s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 19s
Spec gate (headless) / spec-gate (pull_request) Successful in 25s
Auto-label / auto-label (pull_request) Successful in 1s
eaa5c9073a
Assemble channel history and canonical recall through a mandatory Go ContextAssembler, with Rust memory selection, budget admission, and capsule rendering. Keep Python consumers on fail-loud delegating shims and expose native serving traces.

Contract: ADMIT-2618-governed-context
Construction-Contract: ADMIT-2618-governed-context
Discharge: D1 -> src/go/rune-core/internal/runecore/context_assembler_test.go
Discharge: D2 -> src/rust/attention_capsule/src/context.rs
Discharge: D3 -> tests/test_context_native.py
Discharge: D4 -> src/go/context-broker/phaseb_test.go
Discharge: D5 -> src/rust/attention_capsule/src/context.rs
Discharge: D6 -> src/go/rune-core/internal/runecore/context_assembler_test.go
Discharge: D7 -> src/go/rune-core/internal/runecore/context_assembler_test.go
feat(core): convert residual operator lifecycle onto the Go host (#2618)
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Canceled after 0s
CI Pipeline / unit-tests (push) Canceled after 0s
CI Pipeline / go-surface (push) Canceled after 0s
CI Pipeline / rust-surface (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 0s
CI Pipeline / best-practices (push) Canceled after 0s
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
Auto-label / auto-label (pull_request) Successful in 1s
CI Pipeline / lint (pull_request) Failing after 43s
CI Pipeline / unit-tests (pull_request) Failing after 44s
CI Pipeline / rust-surface (pull_request) Failing after 10s
CI Pipeline / go-surface (pull_request) Failing after 23s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / type-check (pull_request) Failing after 38s
CI Pipeline / canary (pull_request) Failing after 1m0s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 17s
CI Pipeline / gitea-offline (pull_request) Successful in 22s
Spec gate (headless) / spec-gate (pull_request) Successful in 22s
CI Pipeline / required-checks (pull_request) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Canceled after 0s
1b25d0ec82
Move task intake and route-client handoff, lifecycle transitions, durable events, atomic checkpoints, task-scoped conversations, and record semantics into rune-core with deterministic Rust decisions. Preserve nonterminal resume and duplicate-signal idempotency, prove native serving traces, and make the default Python operator a fail-loud compatibility client while retaining its explicit oracle for final retirement.

Contract: ADMIT-2618-operator-residual
Construction-Contract: ADMIT-2618-operator-residual
Scope-Contract: ADMIT-2618-operator-oracle-canaries
Discharge: D1 -> src/rust/operator_lifecycle/src/lib.rs and src/main.rs
Discharge: D2 -> src/go/rune-core/internal/runecore/operator_atomic_test.go and operator_events_test.go
Discharge: D3 -> src/go/rune-core/internal/runecore/operator_tasks_test.go and operator_resume_test.go
Discharge: D4 -> src/go/rune-core/internal/runecore/operator_serving_test.go
Discharge: D5 -> tests/test_operator_native.py
Discharge: D6 -> src/go/rune-core/internal/runecore/engine_test.go and operator_serving_test.go
Discharge: D7 -> src/go/rune-core/internal/runecore/operator_events_test.go
Discharge: D8 -> tests/test_operator_native.py and src/rune/canary_p1_01.py

🤖 Headless spec gate (non-blocking, #204 first slice)

Spec-gate agent produced no text output — check runner logs.

Deterministic floors still govern the merge

This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.

🤖 **Headless spec gate (non-blocking, #204 first slice)** Spec-gate agent produced no text output — check runner logs. <details><summary>Deterministic floors still govern the merge</summary> This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.</details>
Some required checks failed
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Canceled after 0s
CI Pipeline / unit-tests (push) Canceled after 0s
CI Pipeline / go-surface (push) Canceled after 0s
CI Pipeline / rust-surface (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 0s
CI Pipeline / best-practices (push) Canceled after 0s
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
Auto-label / auto-label (pull_request) Successful in 1s
CI Pipeline / lint (pull_request) Failing after 43s
CI Pipeline / unit-tests (pull_request) Failing after 44s
CI Pipeline / rust-surface (pull_request) Failing after 10s
CI Pipeline / go-surface (pull_request) Failing after 23s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / type-check (pull_request) Failing after 38s
CI Pipeline / canary (pull_request) Failing after 1m0s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 17s
CI Pipeline / gitea-offline (pull_request) Successful in 22s
Spec gate (headless) / spec-gate (pull_request) Successful in 22s
CI Pipeline / required-checks (pull_request) Canceled after 0s
Required
Details
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Canceled after 0s
This pull request has changes conflicting with the target branch.
  • store/scaffold/segments/observations.jsonl
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/2618-operator-residual:feat/2618-operator-residual
git checkout feat/2618-operator-residual
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#2639