Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 32 additions & 0 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4473,3 +4473,35 @@ view shows its independently checked result in the same conversation.
Pinned-source/artifact checks, actual-model adoption, complete D2/D5 costs,
R1/M3 and the original ten requirements remain separate. Preserve earlier
failures and run full original-goal regression before completion.

### 2026-11-15 — Reuse the final staged Host source check

- **Gap:** the temporary request built after capture staging repeated
`host_context` immediately before `host_dispatch_context`. Its complete
assembly still matters: frozen captures retain mutable nested plan aliases.
- **Delta:** the public request builder and staged dispatch share the original
inspection, turn-key and route guards, source assembly, optional context,
subagent and native-child metadata. Only a staged complete-v1 plan producing
a Host-v1 request with `work_contract` and no `turn_envelope` omits the nested
`host_context`; the existing carrier conversion and final dispatch check stay
before admission and publication. Other shapes retain the original finish.
No checked result is retained across admission, publication or later effects.
- **Evidence:** matched File/SQLite source checks cover 42 guard, alias, carrier,
numeric/text, interval-wait and bridge-failure cases on the baseline and
candidate. Exact startup, transport-permission and offloaded-snapshot-size
diagnostics preserve the original carrier and zero publication/ledger effects.
A deliberately dropped goal reference fails the independent value oracle.
The staged operation trace removes one `host_context` and retains one
`host_dispatch_context`. Separate true Core wheels pass 15 identity,
execution/checkpoint, replay, journal inspection, process-loss/stale-lease and
invalid-artifact checks each on the candidate and the clean `main@37a79decfe99`
plus C1 #8266 at `638b7e3c23f0` composition. The C1 source comparison uses its
direct-complete-source planner API on both arms; the earlier incompatible
keyword setup failure is preserved. These checks use Python 3.13.5 and Node
26.0.0; wheel, RECORD, source and runtime origins are independently bound.
- **Boundary:** this avoids one redundant bridge projection, without changing
the typed source owner, default activation, capture publication, recovery or
settlement boundaries. It does not establish total latency, complete-cost or
actual-model improvements, full D2/D5 closure, R1/M3 or C1 default cutover.
Preserve prior failures and the original ten requirements; full original-goal
regression still precedes completion and EdgeBench preparation.
26 changes: 26 additions & 0 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3462,3 +3462,29 @@ workspace 批准和脚本模型工作。桌面视图在采用检查后显示原
- **边界:**本次保护资格证据来源,不改变生产准入,也不认证 wheel 字节或模型
执行。固定源码/产物检查、真实模型采纳、完整 D2/D5 成本、R1/M3 和原十项要求
仍需分别验证;保留历史失败,完成前仍需完整原目标回归。

### 2026-11-15 — 复用 staged Host 的最终来源检查

- **缺口:**capture staging 后构造临时请求,在 `host_dispatch_context` 前紧接着
重复 `host_context`。完整组装仍有实际作用:frozen capture 的嵌套 plan 仍有
可变别名。
- **增量:**公开请求 builder 与 staged dispatch 共享原 inspection、turn-key、
route guards、来源组装、可选 context、subagent 和 native-child metadata。
仅 staged complete-v1 plan 生成含 `work_contract`、不含 `turn_envelope` 的
Host-v1 请求时省去嵌套 `host_context`;原 carrier 转换和最终 dispatch 检查仍在
准入与发布之前。其它形状保留原 finish,不跨准入、发布或后续效果保留 checked
result。
- **证据:**File/SQLite 基线与候选对照覆盖 42 个 guard、别名、carrier、数字/
文本、interval-wait 和 bridge 失败场景。精确 startup、transport permission、
offloaded snapshot 大小诊断保留原 carrier,发布与 ledger 效果为零。刻意丢弃
goal reference 能使独立值 oracle 失败。staged operation trace 少一次
`host_context`,仍保留一次 `host_dispatch_context`。候选及 `main@37a79decfe99`
与 C1 #8266 `638b7e3c23f0` 的干净组合分别构建真实 Core wheel,各通过 15 个
identity、执行/checkpoint、回放、journal 查看、进程丢失/stale lease 和无效
产物检查。C1 来源两 arm 使用同一 direct-complete-source planner API;先前
不兼容 keyword 的 setup 失败保留。上述检查使用 Python 3.13.5、Node 26.0.0,
wheel、RECORD、source 与 runtime 来源分别绑定。
- **边界:**本次省去一次重复 bridge projection,不改变 typed source owner、默认
激活、capture 发布、恢复或结算边界。它不证明总延迟、完整成本或真实模型改善,
也不完成 D2/D5 闭包、R1/M3 或 C1 默认切换。保留历史失败和原十项要求;完成前
仍需完整原目标回归,随后才准备 EdgeBench。
30 changes: 28 additions & 2 deletions loopx/control_plane/turn_driver/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
normalize_reward_memory_reflection_validation,
reward_memory_reflection_digest,
)
from ..quota.turn_envelope import turn_plan_host_source
from ..quota.turn_envelope import (
COMPLETE_TURN_HOST_REQUEST_SCHEMA,
captured_turn_host_input,
turn_plan_host_source,
)
from .driver import (
COMPLETE_TURN_PLAN_SCHEMA_VERSION,
selected_turn_todo, turn_host_lineage,
Expand Down Expand Up @@ -156,6 +160,10 @@

def build_loopx_turn_host_request(plan: Mapping[str, Any]) -> dict[str, Any]:
"""Deliver the plan's original source; decode saved v0 plans as recorded."""
return _complete_loopx_turn_host_request(_assemble_loopx_turn_host_request(plan))


def _assemble_loopx_turn_host_request(plan: Mapping[str, Any]) -> dict[str, Any]:
boundary = plan.get("boundary")
if isinstance(boundary, Mapping) and boundary.get("inspection_only") is True:
raise ValueError("LoopX Turn CLI inspection requires the explicit run-once execution surface")
Expand Down Expand Up @@ -197,13 +205,31 @@ def build_loopx_turn_host_request(plan: Mapping[str, Any]) -> dict[str, Any]:

if configured_native_child_limit(request) is not None:
request["turn_instance_id"] = transaction.get("turn_instance_id") or turn_key
return request


def _complete_loopx_turn_host_request(request: dict[str, Any]) -> dict[str, Any]:
if "work_contract" in request:
from .host_candidate import complete_host_input

return complete_host_input(request)
return request


def _build_staged_dispatch_request(plan: Mapping[str, Any]) -> dict[str, Any]:
"""Assemble staged input for the immediate mandatory dispatch check."""
request = _assemble_loopx_turn_host_request(plan)
if (plan.get("schema_version") == COMPLETE_TURN_PLAN_SCHEMA_VERSION
and request.get("schema_version") == COMPLETE_TURN_HOST_REQUEST_SCHEMA
and "work_contract" in request and "turn_envelope" not in request):
# All assembly guards and projections still run on the staged aliases.
# This carrier's existing conversion only copies the top-level mapping;
# host_context returns no facts used by it. The caller checks this exact
# source with host_dispatch_context before admission or publication.
return captured_turn_host_input(request)
return _complete_loopx_turn_host_request(request)


def _bounded_public_text(
result: Mapping[str, Any],
field: str,
Expand Down Expand Up @@ -1706,7 +1732,7 @@ def persist_source_journal(source_admission: Mapping[str, Any]) -> None:
# must not put otherwise eligible work into an interval wait.
# Saved typed results retain their original finalization path.
complete_turn_host_source(
build_loopx_turn_host_request(capture.plan) if capture is not None else request,
_build_staged_dispatch_request(capture.plan) if capture is not None else request,
operation="host_dispatch_context",
)
admission = None
Expand Down
Loading
Loading