Skip to content

Large diffs are not rendered by default.

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions docs/architecture/rfcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,20 @@ failure leaves the generated files untouched.
- [Research Exploration Control Plane v0](research-exploration-control-plane-v0.md)
([中文版](research-exploration-control-plane-v0.zh-CN.md))
- **Delivery on `main`:** Partially implemented.
- **Current boundary:** The explicit composition projection and successor
binding from M2 shipped in
[#3173](https://github.com/huangruiteng/loopx/pull/3173). The canonical
observation contract, shared write-time gate, model selection, and inferred
triggers have not been promoted.
- **Current boundary:** Ordinary result capture/readback and the explicit-only
M3 Goal/Todo/experiment write-time gate are implemented; the RFC's §5 retains
their local and remote qualification limits. The §11.5 single-experiment
result/adoption gate, model utility and inferred triggers remain unqualified.
Reuse existing capture and composition owners when connecting those gaps.
- [Hierarchical Agent Stride Control v0](hierarchical-agent-stride-control-v0.md)
([中文版](hierarchical-agent-stride-control-v0.zh-CN.md))
- **Delivery on `main`:** M1 observation slice implemented.
- **Current boundary:** Read-only stride observation and its synthetic
boundary fixture shipped in
[#3207](https://github.com/huangruiteng/loopx/pull/3207) and
[#3290](https://github.com/huangruiteng/loopx/pull/3290). Adaptive effect,
delivery, and authority stride selection remains research-only.
- **Delivery on `main`:** M1 observation and opt-in source-bound replan feedback
and structured proposals are implemented.
- **Current boundary:** Prior decisions and later recorded work reach the same
review owner; source/proposal validity does not prove model adoption or gain.
§11 targets one provider-result/adopted-work/next-review episode. Matched
research continuation and adaptive promotion retain separate gates; see the
[implementation comparison](../long-running-execution-exploration-and-correction.md).
- [Post-Outcome Memory Utility Attribution v0](post-outcome-memory-utility-attribution-v0.md)
([中文版](post-outcome-memory-utility-attribution-v0.zh-CN.md))
- **Delivery on `main`:** Stage 1 implemented.
Expand Down
56 changes: 51 additions & 5 deletions docs/architecture/rfcs/agent-session-execution-modes-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ semantics and continuation paths stay with the
Default and opt-in boundary: a newly created LoopX Chat session defaults to
`managed_runtime`. Attaching an external host session is opt-in through an
explicit binding command, and a managed host only runs when an operator
launches it. Nothing attaches, resumes, replaces, or migrates a session
automatically, and no mode grants Goal, quota, or permission authority.
authorizes its execution profile. A mode tag alone never attaches, resumes,
replaces or migrates a session and grants no Goal, quota or permission authority.
An explicitly activated native Goal or qualified result-wake profile may continue
through its existing owner (§5); that does not authorize implicit activation,
replacement or a switch of continuation owner.

This RFC does not approve new always-on residency, automatic session resume,
This RFC does not by itself approve additional always-on residency or automatic-resume profiles,
cross-host session takeover, mode change as a side effect of a message or
probe, promotion of any optional preview host into a supported product
surface, or any new credential or permission boundary.
Expand Down Expand Up @@ -172,7 +175,9 @@ Every implementation must preserve these properties.

## 4. Current-system contract

Audited at `6c3da75ca`. These are current facts, not proposed behavior.
The original mode/broker audit was at `6c3da75ca`; the managed ZCode row was
checked at `3dd3c550afecfa0c525a34e8744a3cf06774ac94`. These are scoped source
facts, not a qualification of every installed Host.

| Boundary | Current behavior |
| --- | --- |
Expand All @@ -184,6 +189,7 @@ Audited at `6c3da75ca`. These are current facts, not proposed behavior.
| Runtime fencing | [`loopx/chat_runtime.py`](../../../loopx/chat_runtime.py) never starts a managed adapter for an attached session and fails closed with typed errors such as `attached_session_live_steering_unavailable`, `live_steering_requires_active_turn`, and `live_steering_session_not_attached`. |
| CLI surface | `loopx worker-bridge attached-session-bind`, `-list`, `-claim`, and `-complete` exist in [`loopx/cli_commands/worker_bridge.py`](../../../loopx/cli_commands/worker_bridge.py), documented in the [broker guide](../../integrations/attached-agent-session-broker.md) and the [worker-bridge install contract](../../integrations/worker-bridge-install-contract.md). |
| Existing-session delegation | [`loopx delegation`](../../reference/local-delegation.md#use-an-existing-agent-conversation-through-its-shell) exposes the same explicitly bound work as MCP to an existing shell-capable Agent. `operations` recovers requester-scoped work without remembered IDs, rechecks acceptance and exposes unavailable items and further pages. Newly tool-equipped Goal Chat consumes the same inventory; resumed native threads keep their original tool schema. It does not provision an Agent, migrate a host or install an automatic wake policy. |
| Managed native Goal | The opt-in [ZCode provider](../../../loopx/zcode_goal_mode/README.md) binds an idle session, starts under Core admission, retains session/target on resume and confirms pause on cold recovery. Native revisions and journaled start intent guard lost replies. Native completion writes no Core acceptance or credit debit; connected status can still pause denied execution. This is one provider, not generic native-Goal qualification. |
| Focused tests | [`tests/test_attached_session_cli.py`](../../../tests/test_attached_session_cli.py) and `tests/test_chat_codex_home.py::test_attached_session_uses_existing_host_not_managed_adapter` cover bind/claim/complete and the no-managed-adapter fence. |
| Product-level proposal | The [Desktop execution frontends RFC](desktop-execution-frontends-v0.md) owns the Mode A/Mode B product comparison, the connector and event-source orthogonality, and the Desktop non-goals. |
| Host-side loop guidance | [Codex CLI TUI loop](../../product/runtimes/codex-cli/codex-cli-tui-loop.md) documents session-attached automation and resume options for one visible host. |
Expand Down Expand Up @@ -279,6 +285,28 @@ the same binding. To change the continuation owner, stop new admission, reconcil
pending tools and uncertain effects, fence the old executor, and read back the
new binding before execution. Disconnection does not authorize that switch.

Qualification must name the adapter's actual input-consumption boundary: for
example, the next model request after a tool batch, a subsequent native Turn,
or explicit inbox drain. Reuse the
[ingress and wake-policy contract](desktop-execution-frontends-v0.md#delivery-intent-does-not-choose-the-wake-policy)
rather than another queue authority. A steering ACK does not cancel already
submitted tools or prove model consumption. Exercise input arriving during tools,
context preparation/compaction and finalization; preserve source/target identity
and observe the next eligible request or truthful pending/refusal. Then verify
actual work adoption separately. Unsupported boundaries remain unavailable,
not emulated by silently replacing the executor.

A native resume must separately qualify its first new protected action after
the same Goal instance's criterion or explicit source basis changes. The adapter
must either deliver and demonstrate consumption of current owning requirements
at that work boundary, or retain pending/paused work until the existing reentry
path does so. Reconcile the original effect under its original operation/fence;
do not replace its receipt to follow new intent. An unchanged session/target or
startup-objective hash proves neither current semantic basis nor stale model
behavior. Use existing criterion/source revisions, not whole-prompt hashes as
substitute authority. Qualify an amendment arriving during restore and readable
but no-longer-applicable evidence as well as outright source loss.

For the first mixed managed cohort, qualify a cloud adapter against the same
governed Turn contract as the local worker before expanding native Goal profiles.
This is a delivery priority, not a default migration. The
Expand Down Expand Up @@ -585,6 +613,8 @@ future evidence and must not be reported as green.
| Host-local state is not authority | Inspect host storage for Goal, Todo, quota, monitor, lifecycle copies | No competing status; journals are replayable results, not authority | Unverified for new hosts |
| Admission under restart and crash | Kill the host during execution with a bound session | No orphan executor; replacement binding has one owner and correct mode | Unverified for new hosts |
| Feature-off parity | Run without any attached binding and without the preview host | Existing managed behavior, routes, and defaults unchanged | Unverified for new hosts |
| Declared input boundary | Deliver a correction during a tool batch, compaction and finalization | Exact target/source retained; next eligible Host input or truthful pending/refusal; no implicit tool cancellation or retargeting | Per-adapter qualification; protocol fixtures do not prove model adoption |
| Same native identity, changed basis | Pause, change an applicable criterion/source within the same Goal instance, then resume; also amend during restore | Original target/effect retained; first new protected action consumes current basis or remains pending/paused; no receipt rewriting | Combined qualification remains required beyond existing native identity/recovery tests |

Deterministic package tests are not sufficient for admission. A new host needs
at least one real-host row: a live process, a real bind, and a real restart.
Expand Down Expand Up @@ -622,7 +652,23 @@ Preserve feature-off behavior for every existing profile and entrypoint.

[Roadmap](loopx-overall-roadmap-v0.md) R2 first qualifies a steward and 2–3 actual managed workers across Turns; R6 qualifies local/cloud execution on one authority, then R7 expands active scale. M1–M4 here retain host admission ownership. Team-plan `ready` cannot replace binding, qualification, claim/lease or actual process readback.

DSH steward Chat is currently single-segment, read-only and without cross-turn host sessions; `turn run-once` is a separate bounded execution path. The next slice proves successor wake, cancellation/stop, crash recovery and returning stale-executor fences with packaged frontend/CLI/Lark readback. An executor name, one segment or multiple registrations cannot establish continuous managed execution. Disconnection never switches attached hosts to managed, and unqualified hosts retain their existing boundary.
DSH steward Chat remains a single-segment, read-only profile without cross-turn
host sessions; `turn run-once` is a separate bounded path. Its next slice still
needs successor wake, stop, recovery and stale-executor fences with product
readback. This limitation must not be generalized to every existing profile.

The explicit [Goal Chat LoopX profile](../../reference/goal-chat-continuation.md)
already persists accepted-delegation wake intent and routes it through
[`pump_delegation_wakes`](../../../loopx/chat_loopx_mode.py) and the typed
collaboration owner. It pins the originating conversation, uses intent-derived
Turn identity, retains pending work while the lead is active or paused, and
refuses stopped/rebound/missing owners. Provider-start evidence remains distinct
from worker startup. Reuse that scoped path for the existing
[finalization/reconnect matrix](desktop-execution-frontends-v0.md#delivery-intent-does-not-choose-the-wake-policy);
a process notification may coalesce while the committed result and pending work
remain recoverable. This is not generic provider-checkpoint, all-Host, Lark,
model-adoption or whole-Goal qualification. No late event unpauses work, changes
its continuation owner or switches an attached host to managed execution.

The opt-in [local delegation interface](../../reference/local-delegation.md)
now provides durable operations around bounded Turns, including member-to-member
Expand Down
Loading
Loading