Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa3c11d
refactor(turn): share candidate conversion across governed hosts
huangruiteng Sep 18, 2026
5c304cb
feat(ark-turn): add optional cloud host with bound local MCP tools
huangruiteng Sep 18, 2026
0a62a0d
feat(examples): qualify autonomous cloud and local research delegation
huangruiteng Sep 18, 2026
8520f3f
docs(rfcs): record bounded cloud Turn delivery and remaining team gates
huangruiteng Sep 18, 2026
f0d99a6
docs(teams): connect managed research to shared acceptance ownership
huangruiteng Sep 18, 2026
605274d
Merge main with canonical Goal acceptance into the managed team integ…
huangruiteng Sep 18, 2026
a2d4e08
fix: bind explicit Turns and preserve acceptance through completion
huangruiteng Sep 18, 2026
ceb1d5f
feat: run local-led mixed teams through canonical acceptance
huangruiteng Sep 18, 2026
853fc22
docs: describe mixed-team qualification and integration boundaries
huangruiteng Sep 18, 2026
a001bb3
fix: reserve cloud cleanup time in research delegation
huangruiteng Sep 18, 2026
10dbf30
fix: isolate optional Ark test discovery and example imports
huangruiteng Sep 18, 2026
efc36e1
docs: place model selection in shared agent execution profiles
huangruiteng Sep 18, 2026
dc5ef20
Merge remote-tracking branch 'origin/main' into codex/managed-team-fo…
huangruiteng Sep 18, 2026
2cb05ec
feat: add durable authorized delegation through governed turns
huangruiteng Sep 18, 2026
415de96
refactor: run mixed research teams through shared delegation
huangruiteng Sep 18, 2026
a0a43a8
docs: explain mixed team delegation and recovery boundaries
huangruiteng Sep 18, 2026
0a3d740
Merge remote-tracking branch 'origin/main' into codex/managed-team-fo…
huangruiteng Sep 18, 2026
5102fe7
fix: consolidate delegation host and preserve admitted worker startup
huangruiteng Sep 18, 2026
dd8af65
fix: pin Ark Turn MCP runtime to the qualified SDK version
huangruiteng Sep 18, 2026
c63356e
fix: publish delegated rejection status and reason atomically
huangruiteng Sep 18, 2026
d8e8944
test: follow canonical update admission in diagnostic mutant
huangruiteng Sep 18, 2026
8bad02e
test: restore valid provider fault probes and full shadow diagnostics
huangruiteng Sep 18, 2026
324e453
refactor(hosts): reuse governed conversion and validate worker arguments
huangruiteng Sep 18, 2026
2cd77d6
test(collaboration): collect shared delegation journeys in core CI
huangruiteng Sep 18, 2026
002cc14
fix(collaboration): derive worker workspace from its pinned binding
huangruiteng Sep 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ark-turn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Optional Ark Turn

on:
pull_request:
paths:
- ".github/workflows/ark-turn.yml"
- "packages/loopx-ark-turn/**"
- "loopx/control_plane/turn_driver/**"
- "loopx/control_plane/collaboration/**"
- "loopx/collaboration_mcp.py"
- "loopx/dsh_goal_mode/**"
- "loopx/cli_commands/turn*.py"
- "loopx/control_plane/goals/acceptance*.ts"
- "loopx/control_plane/goals/acceptance.py"
- "examples/managed-research-team/**"
- "pyproject.toml"
- "tests/test_local_delegation.py"
- "tests/test_managed_research_scenario.py"
- "tests/test_managed_research_team.py"
workflow_dispatch:

permissions:
contents: read

jobs:
adapter-contract:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: "24.21.0"
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- run: python -m pip install -e ".[test]" -e packages/loopx-ark-turn
- name: Public SDK, real stdio MCP, negative cases and DSH parity
run: >-
python -m pytest -q packages/loopx-ark-turn/tests
tests/test_dsh_goal_mode.py tests/test_turn_managed_executor_binding.py
tests/test_ark_managed_agent_host.py
tests/test_loopx_turn_driver.py tests/test_collaboration_mcp.py
tests/test_auto_research_artifact_receipt.py
tests/test_worker_command_validation.py tests/test_workspace_story_demo.py
tests/test_local_delegation.py tests/test_managed_research_scenario.py
tests/test_managed_research_team.py
- name: Lint optional package and example
run: python -m ruff check packages/loopx-ark-turn examples/managed-research-team
51 changes: 51 additions & 0 deletions docs/architecture/rfcs/agent-session-execution-modes-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,47 @@ This is a delivery priority, not a default migration. The
Reuse the existing profile editor and session projections; do not add a
manager-only creation service, task ledger or scheduling loop.

### Model selection within Agent creation and attachment

This is a proposed refinement of the reusable Agent operations above, not a
shipped model-catalog API. Model selection belongs to an Agent's execution
profile and binding, independently of whether that Agent coordinates others.
Reuse the existing managed execution profile, subagent launch preferences and
profile editor; the steward's machine defaults are one caller's defaults, not
the universal configuration owner. A model change does not create a new logical
Agent or grant permission to launch one.

| Step | Owner and required observation |
| --- | --- |
| Discover choices | The selected executor/provider adapter reports model IDs, supported parameters, capability limits, discovery scope and freshness. Keep provider catalog presence, managed-host compatibility and account authorization separate; unknown or failed discovery is not an empty supported list. |
| Request and resolve a profile | The shared typed TS boundary validates caller scope, allowed profiles, budget constraints and explicit configuration precedence. Retain the requested model and parameters separately from resolved values and their sources. SDK/network discovery remains in the adapter; do not copy selection or admission rules into each Python launcher. |
| Create or attach | Creation uses the resolved profile through the selected adapter. Attachment observes the existing host's actual profile; it cannot silently change its model, start a replacement executor or claim that a requested preference already took effect. Repeated creation reuses the existing identity/binding contract. |
| Start and read back | Bind the profile revision to the execution generation and read back the provider-reported model and effective parameters. A visible catalog row or successful Agent-definition creation does not establish that an inference session can run. A mismatch or unsupported option produces an actionable failure, never an implicit model fallback. |

Parameter support is provider-specific: the same reasoning-effort label need
not have the same meaning across hosts, and speed, thinking mode, context limits
and tool support are not universal knobs. Use a small common selection contract
with validated provider-owned options rather than a core list of vendor models
or one global parameter enum. Credentials remain in the selected provider's
credential scope and never enter an Agent profile or public projection.

Mutable model aliases require explicit readback. Record a resolved version only
when the provider exposes it; otherwise record that the backing version is
unknown rather than treating the alias as a reproducible snapshot. Profile
changes use the existing binding revision/generation and rebind boundary;
running work retains its admitted profile until a qualified transition occurs.
Changing the parent profile does not silently change existing children. An
authorized child coordinator may choose only within its inherited profile and
budget scope, using the same operation as the lead.

The next implementation slice must connect discovery, selection, creation or
attachment, launch and readback for both a local and a cloud executor. Qualify
unsupported parameters, stale discovery, unavailable authorization, retry,
mutable aliases, and profile changes during active work. Reuse the existing
CLI, frontend and Lark configuration owners/projections where affected; a
backend field alone does not complete that user journey. Existing defaults and
explicit host choices remain unchanged until a disclosed implementation lands.

### State model and schema

The binding is the unit of mode ownership. Its canonical fields:
Expand Down Expand Up @@ -517,6 +558,16 @@ Preserve feature-off behavior for every existing profile and entrypoint.

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.

The opt-in [local delegation interface](../../reference/local-delegation.md)
now provides durable operations around bounded Turns, including member-to-member
launch grants and TS task acceptance. Its Ark process-loss drill resumes the
original Session/input after cloud tool waiting; it does not resend acknowledged
effects or reset the deadline. This qualifies local execution recovery, not
successor wake, attached-host takeover or full fleet cancellation. Provider file
profiles preserve the existing model/tool configuration boundary; the general
Agent creation/model discovery proposal above remains separate.


## 12. Normative delivery plan

| Milestone | Shipped behavior | Entry gate | Exit evidence | Rollback |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,37 @@ claim 与完成回执,以及"只有经过验证的回写才推进工作"这一
[harness 选型 RFC](harness-selection-dsh-pi-v0.zh-CN.md)负责。复用现有 profile editor
和会话投影,不新建管家专属创建服务、任务账本或调度循环。

### Agent 创建与接入中的模型选择

这是对上述可复用 Agent 操作的设计细化,尚未交付通用模型目录 API。模型选择属于
Agent 的 execution profile 与绑定,不取决于它是否担任协调员。复用现有 managed
execution profile、子 Agent 启动偏好和 profile editor;管家的机器默认值只是一个
调用入口的默认配置,不是通用配置 owner。换模型不产生新的逻辑 Agent,也不授予
创建或启动 Agent 的权限。

| 步骤 | Owner 与必须读回的事实 |
| --- | --- |
| 发现候选 | 所选 executor/provider adapter 返回模型 ID、支持参数、能力限制、发现范围与新鲜度。分别记录 provider 目录存在、managed host 兼容和账号授权;未知或发现失败不能冒充空的支持列表。 |
| 请求与解析配置 | 共享 typed TS 边界校验调用者范围、允许的 profile、预算约束和显式配置优先级。保留请求模型/参数与解析值及来源的区别。SDK/网络发现留在 adapter,不让每个 Python launcher 复制选择或准入规则。 |
| 创建或接入 | 创建经所选 adapter 使用已解析配置;接入只观察既有宿主实际配置,不能静默改模型、启动替代执行器,或把请求偏好显示为已生效。重复创建复用现有身份与绑定合同。 |
| 启动并读回 | 配置 revision 绑定执行 generation,读回 provider 报告的模型与实际参数。目录可见或 Agent 定义创建成功,都不能证明推理会话可运行。配置不符或参数不支持必须给出可操作错误,不隐式换模型。 |

参数支持由 provider 决定:相同 reasoning-effort 标签在不同宿主中未必同义,speed、
thinking mode、上下文限制和工具支持也不是通用旋钮。采用小型公共选择合同与经校验的
provider 参数,不在核心维护厂商模型名单或一个全局参数枚举。凭据留在所选 provider
的凭据作用域中,不进入 Agent profile 或公开投影。

动态模型别名需要显式读回。只有 provider 暴露解析版本时才记录具体版本;否则标明
底层版本未知,不能把别名当作可复现快照。配置变更沿现有 binding revision/generation
与 rebind 边界生效;运行中工作保留已准入的配置,直到经过已验证的迁移。父 Agent
配置变更不静默修改已有子 Agent。获授权的子协调员仅能在继承的 profile 与预算范围
内选择,使用和主 Agent 相同的操作。

下一实现切片须为一个本地和一个云端执行器打通发现、选择、创建或接入、启动及读回。
验证不支持的参数、过期目录、授权不可用、重试、动态别名和运行中配置变更。受影响的
CLI、前端和 Lark 复用现有配置 owner/投影;单有后端字段不代表用户路径完成。在明确
披露的实现交付之前,既有默认值和显式宿主选择保持不变。

### 状态模型与 schema

绑定是模式归属的单元。其规范字段:
Expand Down Expand Up @@ -416,6 +447,13 @@ worker 请求并采用另一 worker 的产物;driver 切换竞态拒绝旧执

目前 DSH 管家 Chat 是单段、只读、无跨 turn 宿主会话;`turn run-once` 是另一条有界执行路径。下一切片要证明 successor wake、取消/停止、崩溃恢复及旧执行器返回 fence,经 packaged frontend/CLI/Lark 回读真实状态。不能仅增加一个 executor 名称、启动一个片段或绑定若干 Agent 就声称持续 managed 模式完成。attached host 不因掉线而改为 managed,未验收宿主保持原资格边界。

显式启用的[本地委派接口](../../reference/local-delegation.md)已为有界 Turn 提供持久
操作,涵盖成员继续委派的授权及 TS 任务验收。Ark 进程中断实验在云端等待本地工具后,
以原 Session/输入接回,不重发已确认副作用、不重置期限。这验证本地执行恢复,不代表
successor wake、attached 接管或完整团队取消。Provider 文件配置保留现有模型/工具
边界;上文通用 Agent 创建与模型发现提案仍是独立后续范围。


## 12. 规范性交付计划

| 里程碑 | 交付行为 | 进入门槛 | 退出证据 | 回滚 |
Expand Down
29 changes: 29 additions & 0 deletions docs/architecture/rfcs/harness-selection-dsh-pi-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,35 @@ dated 2026-09-15 and is written to land with the managed stack:
| L1 event source and session-owning runtime candidate | DSH | opt-in, not promoted; the bounded Turn host role is the default row above | the C0, C1, overhead, retention and Mode B rows in this document being run and reviewed |
| Optional visible host loop | Pi | not a managed runtime | declare a per-binding session mode with readback, prove single-executor behavior under restart, "conversation is not a receipt", non-authoritative host-local state, and one real-host restart row |

### Optional Ark governed Turn profile

[`loopx-ark-turn`](../../../packages/loopx-ark-turn/README.md) is a separately
installed provider selected explicitly through `--host generic-cli` with fresh
iteration context. It shares DSH's signed request/candidate conversion; LoopX
still owns admission, independent validation, work writeback and quota. A
per-Turn stdio MCP process exposes only operator-selected tools with bound work
identity. Provider model usage and resource-cleanup receipts are observations,
not accepted-work quota or a second task lifecycle.

This profile does not change the default host or the native Ark `goal_once`
profile. Native Goal continuation and outer LoopX Turn continuation must not
drive the same binding. The [research composition example](../../../examples/managed-research-team/README.md)
exercises a managed coordinator delegating to local workers; it does not promote
a persistent steward Chat transport, recursive fleet supervision, full live
steering, or a shared authority service. Use its explicit setup/readback/cleanup
instructions and preserve failed versus untested qualification boundaries.

The example's integrated acceptance path uses five preauthorized canonical
tasks and startup-only owner configuration. Both hosts select exact work via
`turn --todo-id`; fresh TS Todo completion precedes accepted result return.
Synthesis checks current child completion, binding and artifact hashes.
Provider cleanup, Turn progress and canonical completion remain separate.
This does not supply dynamic work derivation or another Python lifecycle owner.
Its default profile uses a local DSH lead with two DSH and two Ark members;
the cloud reviewer consumes a completed local analysis before returning its own
result. A secondary cloud-led profile tests the inverse delegation direction.
Both reuse the same Turn host adapters; neither changes the steward default.

### Managed host binding and live qualification (2026-09-15)

A managed host binding names four things: the host adapter, the provider, the
Expand Down
21 changes: 21 additions & 0 deletions docs/architecture/rfcs/harness-selection-dsh-pi-v0.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ C1、开销、保留与 Mode B 各行。
| L1 事件源与会话归属 runtime 候选 | DSH | opt-in,未晋级;有界 Turn 宿主角色见上一行默认值 | 本文 C0、C1、开销、保留与 Mode B 各行被真实执行并通过评审 |
| 可选的可见宿主循环 | Pi | 不是 managed runtime | 先声明按绑定持久化且可回读的会话模式,证明重启下的单执行器行为、"对话不是回执"、宿主本地状态非权威,并提供一条真实宿主重启行 |

### 可选 Ark 受控 Turn 档位

[`loopx-ark-turn`](../../../packages/loopx-ark-turn/README.md)单独安装,通过
`--host generic-cli` 显式选择并使用 fresh iteration context。它复用 dsh 的签名
请求/候选转换;admission、独立验收、工作写回及 quota 仍由 LoopX 拥有。每次 Turn
绑定一个 stdio MCP 进程,只暴露 operator 选择的工具和绑定的工作身份。Provider
模型用量、资源清理回执是观测,不是已验收工作 quota 或第二份任务生命周期。

本档位不改变默认宿主,也不改变原有 Ark `goal_once` 档位。原生 Goal 自驱和外层
LoopX Turn 驱动不能同时驱动同一绑定。[投研组合示例](../../../examples/managed-research-team/README.md)
验证 managed 协调员委派本地 worker,不据此晋升持久管家 Chat、递归团队监督、完整
实时 steer 或共享权威服务。按示例显式配置、回读和清理,保留失败与未验证的区别。

示例已集成五个预授权 canonical 任务和启动时一次性 owner 配置。两类宿主通过
`turn --todo-id` 选择精确工作;TS Todo 新鲜验收完成后才返回 accepted 结果。
综合任务检查子任务当前完成状态、绑定和产物哈希。Provider 清理、Turn 进展和
canonical 完成仍是不同事实;本切片不提供动态派生授权或另一份 Python 生命周期。
默认示例由本地 DSH 协调员组织两个 DSH 与两个 Ark 成员;云端核验员消费已完成的
本地分析,再返回自己的产物。辅助云端协调档位验证反向委派。两者复用相同 Turn
适配器,不改变管家默认执行器。

### 托管宿主绑定与真实环境验证(2026-09-15)

一个托管宿主绑定要说明四件事:宿主适配器、provider、模型,以及凭据来自哪里。
Expand Down
28 changes: 28 additions & 0 deletions docs/architecture/rfcs/loopx-overall-roadmap-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,34 @@ These priorities do not change live Goal quota or authorize experiments/cloud re
- **Exit:** 2–3 workers, one dependency, one failure and one direction correction; Agents select and revise delegation without manual phase input or result forwarding. Inspect through packaged frontend and independent CLI readback. An authorized Lark entry reads the corresponding audience-visible feedback. Untested Lark remains explicitly unqualified.
- **Rollback:** stop new admission, drain accepted work and retain bindings/receipts; attached fallback cannot be used to simulate availability.

**Optional mixed-team Turn slice.** The [Ark adapter](../../../packages/loopx-ark-turn/README.md)
uses the existing generic-cli Turn boundary alongside DSH. The
[shared local delegation interface](../../reference/local-delegation.md) now
composes semantic peer requests/adoption/return, explicit operator execution
bindings and the merged TS acceptance owner. It replaces demo-owned delegation;
coordinators and ordinary members use the same grant contract. Disabled stdio
servers retain their original five non-executing tools. Configuration files
compact provider launch arguments without changing default executor selection.

The [synthetic research example](../../../examples/managed-research-team/README.md)
uses a local lead, two DSH members and two Ark members. One cloud reviewer adopts
local analysis; another Ark member delegates to DSH before returning to local
synthesis. Five stable preauthorized tasks bind exact criteria once. Turn
validation and ordinary Todo completion independently execute current pinned
checks; accepted returns read canonical completion and exact artifacts. All
business questions/order remain model decisions; the Goal stays active.

Durable operation ids and existing Turn journals recover results after a source
conversation disappears. A real process-group interruption after Ark input ACK
has been resumed on the original Session/input to canonical completion; cloud
waiting for a local tool was observed, and owned resources were cleaned.
Uncertain creation/input acknowledgements or tool effects remain reconciliation
cases. The adapter retains the original deadline and does not resend work.
This is a local trusted-host foundation, not G1/G3 completion: attached persistent
sessions, generic Agent creation, dynamic governed work derivation, complete
inbox/queue/steer, authenticated remote authority and packaged frontend/Lark
companion work remain R2/R3/R4/R6 boundaries. Existing Goals are not promoted.

### R3: Semantic Requests and Automatic Return

- **Owner:** manager RFC M2/M3; migrate existing `manager_context` request/tracking/return into one typed collaboration transaction, incorporating the #4094 adapter.
Expand Down
Loading
Loading