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
2 changes: 1 addition & 1 deletion .github/workflows/ark-turn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concurrency:
jobs:
adapter-contract:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 15
strategy:
matrix:
python: ["3.11", "3.13"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

- **RFC status:** Accepted (effective upon merge; a discussion proposal before merge)
- **Supersedes / closes:** none
- **Delivery maturity:** Proposal; this document delivers a source audit and target architecture, with no runtime change.
- **Delivery maturity:** Partial upon merge: ordinary-execution linkage in the existing source reader; method benefit and the remaining target architecture are unqualified.
- **Authors / owners:** LoopX maintainers; source facts have code references, while the target architecture and trade-offs are AI-assisted proposals pending maintainer review and confirmation.
- **Created / last normative revision:** 2026-11-14
- **Created / last normative revision:** 2026-11-14 / 2026-11-15
- **Implementation baseline:** `8d7d234c6f55fa45fa5db0ad5a156dcaaf726d32`; references to `main` in section 4 mean this revision.
- **Semantic mirror:** [中文版](mechanism-convergence-and-learning-loop-v0.zh-CN.md)
- **Related:** [roadmap](loopx-overall-roadmap-v0.md), [small kernel](monorepo-distribution-split-v0.md), [Controller/unified contract](controller-executor-unified-contract-v0.md), [Target/Yardstick/Stride](target-yardstick-stride-decisions-v0.md), [research exploration](research-exploration-control-plane-v0.md), [memory utility](post-outcome-memory-utility-attribution-v0.md), [Goal contract evolution](goal-contract-evolution-v0.md).

## Document map and maintenance contract

Section 4 describes the pinned implementation; 4.3 separates unmerged work. Sections 5–11 propose the converged structure, calls, migration and composition acceptance, not shipped behavior. This RFC owns cross-mechanism composition; individual schemas, authority, defaults and promotion gates remain in their owning specifications. Amend those specifications together when changing them rather than overriding them here. Implementation evidence stays in existing RFCs/tasks and ledgers, without a parallel roadmap or execution queue. Maintainers must verify and confirm consequential design choices; this document assumes neither a human contribution ratio nor ownership of unconfirmed ideas.
Section 4 describes the pinned implementation; 4.3 separates unmerged work. Sections 5–11 propose the converged structure, calls, migration and composition acceptance; only the explicit implementation checkpoint qualifies source behavior. This RFC owns cross-mechanism composition; individual schemas, authority, defaults and promotion gates remain in their owning specifications. Amend those specifications together when changing them rather than overriding them here. Implementation evidence stays in existing RFCs/tasks and ledgers, without a parallel roadmap or execution queue. Maintainers must verify and confirm consequential design choices; this document assumes neither a human contribution ratio nor ownership of unconfirmed ideas.

## 1. Decision summary

Expand Down Expand Up @@ -249,6 +249,90 @@ Effect evaluation reuses the [existing pilot and decision-episode acceptance](lo
| Evidence-supported cross-task improvement | Reward Memory carries conditional experience; the original policy owner decides whether to use calibrated/learned values; Skills qualify separately. | Real choices, execution and outcomes in new tasks, including mismatch/counterexamples/revocation and complete cost. Extend application only for callers missing the needed relation. |
| Execution convergence | C1/C4/C9 and #8266/#8484 migrate entries, results and recovery. | Original single-session semantic/outcome/cost/recovery controls; remove duplicate normal paths and qualify dual roles separately. |

**Source checkpoint: ordinary execution linkage (2026-11-15).** The existing
[`work Yardstick reader`](../../../loopx/control_plane/work_items/yardstick_decision.ts)
consumes confirmed ordinary execution findings without requiring a repeated
decision. It reuses canonical history ordering and the existing measurement
work-window rule, retains the original choice and links prior execution after
the next choice. The existing Explore adapter supplies missing source ordinals
only to the opted-in work reader; public history and disabled behavior retain
their wire. [File/SQLite CLI regression](../../../tests/control_plane/test_work_yardstick_cli.py)
covers the original omission failure, independent candidate readback, a later
choice, replay and disable; typed checks reject foreign, tentative, stale and
late-visible attribution. This qualifies source transport and record linkage,
not current-model adoption, prediction calibration, cross-task benefit or
matched-budget gains. Those requirements and C1/C4/C9 integration remain open;
there is no new decision owner, execution entry, schema or default activation.

The ordinary [`Turn consumer`](../../../loopx/cli_commands/turn_run_once.py)
also retains the existing inline `explore_result` in its decoded Vision packet
and delegates parsing and delivery to the original Explore owner. File/SQLite
[public Turn checks](../../../tests/control_plane/test_explore_settlement_attachment.py)
cover independently validated artifacts, off/omitted and rejected inputs,
committed replay, and interrupted delivery recovered from the original Run.
Recovery preserves that Run, invokes the Host once, and debits once only after
the requested delivery finishes. Terminal and successor completion are covered;
the original attachment preflight runs before completing a Todo. Inputs rejected
by that preflight leave it open without primary writeback or debit. These checks qualify the caller boundary;
native model adoption, complete-budget benefit, other backend qualification
and integration of the in-flight execution proposals remain open.

The same source checkpoint also rejects public quota CLI spending while a
requested attachment is pending. Both ordinary Turn and `refresh-state` receipt
writers finish attachment delivery first; ordinary and combined refresh recovery
deliver the verified original Run before repairing its receipt. File/SQLite
failure controls cover progress, completion, terminal and successor Runs, plus
interrupted first CLI delivery. Failure leaves no writeback receipt or debit;
recovery preserves the original Run, invokes the Host once and debits once.
Receipt repair retains committed replay semantics after Yardstick is disabled;
the original delivery and settlement finish before the next Turn starts.
The opted-in reader honors the verified successor history prefix during a
wall-clock rollback while retaining the original work window and strict fallback
for captures without a prefix. File/SQLite regressions cover both rejected early
spend and retained candidate/finding readback; these are correctness boundaries,
not evidence of model adoption or benefit.

The existing [released-feedback consumer](../../../tests/control_plane/test_material_feedback_checkpoint.py)
now follows the ordinary selection route's captured review, Explore evidence
and writeback readers instead of expecting raw guard fields. The same
File/SQLite checks cover Stride off/enabled, soft claims/hard leases and
historical feedback as context. They retain the independently checked cost-two
route, use released evidence for a prospective comparison, execute a cost-one
route and reject terminal closeout without the original completion validation.
Readers preserve the original settlement identity and perform no debit. The
unchanged runtime at the pinned base and author/composition sources supports
this path; the obsolete test consumer failed before its reader migration.
This is scripted local execution and caller qualification. Actual model
adoption, calibration, matched-budget and cross-task benefit remain unproven.

Direct `run-once` recovery now carries that committed replay through both the
ordinary writeback callback and its resolver. A verified original receipt repair
can finish after Yardstick is disabled; a new typed capture remains refused.
The focused File/SQLite regression preserves the original Run and Host, writes
one finding and receipt, spends once, and checks effect-free replay plus rejected
new capture. This repairs the existing recovery contract without a new owner or
activation; installed Hosts, other backends and benefit retain their own gates.

The replay and new-capture assertions execute inside the recovery fixture.
An earlier test update put that block in the no-evidence test: the recovery
cases skipped those assertions, while ordinary settlement failed on undefined
fixture names. Moving the existing block to its owning scope restores both
checks without changing runtime logic. File/SQLite recovery, effect-free replay,
new disabled capture refusal and ordinary no-evidence settlement now run through
the public CLI; earlier results retain their original narrower coverage.

Backend names also need actual provider evidence. The shared
[local authority fixture](../../../tests/control_plane/canonical_authority_fixture.py)
now rejects unsupported providers before storage or writer-fence effects;
[CLI controls](../../../tests/control_plane/test_canonical_authority_fixture.py)
verify actual File/SQLite readback and preserve state on rejection. Previously,
a PostgreSQL label silently initialized File authority. The existing
[PostgreSQL remote task candidate](../../reference/remote-authority-task-service-v0.md)
is separately qualified through real TLS, restricted roles, task lifecycle and
read-only quota observation. It admits no ordinary host Turn. These service
checks therefore do not qualify an ordinary PostgreSQL feedback Turn or justify
adding another execution profile to this slice.

The first task needs an actual feedback or method-choice requirement. Reuse complete existing paths; real consumers must demonstrate gaps before repairing them rather than manufacturing a failure for the example. Experiments, training and procedural publication retain original authority. This document allocates neither another lane's quota nor a prescribed PR count.

## 12. Consequential choices to confirm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

- **RFC 状态:** Accepted(合并后生效;合并前是讨论提案)
- **替代 / 关闭:** 无
- **交付成熟度:** Proposal;本文交付源码盘点与目标架构,不改变运行行为。
- **交付成熟度:** 合并后 Partial:既有源码读取链路支持普通执行关联;方法收益及剩余目标架构尚未取得资格。
- **作者 / 归属:** LoopX maintainers;源码事实由路径支持,目标架构和取舍为 AI 辅助提案,待维护者审阅确认。
- **创建日期 / 最近规范修订:** 2026-11-14
- **创建日期 / 最近规范修订:** 2026-11-14 / 2026-11-15
- **实现基线:** `8d7d234c6f55fa45fa5db0ad5a156dcaaf726d32`(第 4 节的 `main` 均指此版本)。
- **语义镜像:** [English](mechanism-convergence-and-learning-loop-v0.md)
- **关联:** [总体路线](loopx-overall-roadmap-v0.zh-CN.md)、[小内核](monorepo-distribution-split-v0.zh-CN.md)、[Controller/统一契约](controller-executor-unified-contract-v0.zh-CN.md)、[Target/Yardstick/Stride](target-yardstick-stride-decisions-v0.zh-CN.md)、[研究探索](research-exploration-control-plane-v0.zh-CN.md)、[记忆效用](post-outcome-memory-utility-attribution-v0.zh-CN.md)、[Goal 契约演化](goal-contract-evolution-v0.zh-CN.md)。

## 文档地图与维护契约

第 4 节记录固定版本的实现,4.3 单列未合入工作。第 5–11 节定义拟议的收敛后结构、调用关系、迁移和组合验收;它们不是当前已交付行为。本文持有跨机制的组合设计,单个能力的 schema、权限、默认值和晋升门仍归原规范;涉及改变时须同步修订所属规范,不能用本文覆盖。实施证据沿原 RFC/任务及 ledger 记录,不另建路线图或执行队列。维护者须核实并确认关键设计选择;本文不推定人工贡献比例或未确认观点的归属。
第 4 节记录固定版本的实现,4.3 单列未合入工作。第 5–11 节定义拟议的收敛后结构、调用关系、迁移和组合验收;只有显式实施 checkpoint 说明已取得资格的源码行为。本文持有跨机制的组合设计,单个能力的 schema、权限、默认值和晋升门仍归原规范;涉及改变时须同步修订所属规范,不能用本文覆盖。实施证据沿原 RFC/任务及 ledger 记录,不另建路线图或执行队列。维护者须核实并确认关键设计选择;本文不推定人工贡献比例或未确认观点的归属。

## 1. 决策摘要

Expand Down Expand Up @@ -249,6 +249,71 @@ flowchart TD
| 有证据支持的跨任务改进 | Reward Memory 传递条件性经验,原策略 owner 决定是否采用校准/学习值;Skill 另行资格化。 | 新任务中的真实选择、执行与结果,包含失配/反例/撤销及完整成本;application 扩展仅为缺失关联的 caller 实施。 |
| 执行融合 | C1/C4/C9、#8266/#8484 迁移入口、结果及恢复。 | 对照原单会话的语义、成果/成本和恢复;删除重复正常路径,双角色独立验收。 |

**源码 checkpoint:普通执行关联(2026-11-15)。** 既有
[`work Yardstick 读取模块`](../../../loopx/control_plane/work_items/yardstick_decision.ts)
直接消费 confirmed 的普通执行 finding,无需重复声明决策。复用 canonical 历史
排序和既有测量工作窗口规则,保留原选择,并在下一选择后关联此前执行。
既有 Explore 适配器只向显式启用的工作读取模块补充缺失来源序号;公开历史及
关闭状态保留原 wire。[File/SQLite CLI 回归](../../../tests/control_plane/test_work_yardstick_cli.py)
覆盖原省略失败、独立候选回读、后续选择、重放及关闭;typed 检查拒绝其他归属、
tentative、过时和迟到证据的错误关联。这只取得源码传输和记录关联资格,尚不证明
当前模型采用、预测校准、跨任务收益或可比预算下的效果提升。对应要求与
C1/C4/C9 集成继续开放;没有新增决策 owner、执行入口、schema 或默认启用。

普通 [`Turn 消费者`](../../../loopx/cli_commands/turn_run_once.py)也在解码后的
Vision packet 中保留已有内联 `explore_result`,由原 Explore owner 解析和交付。
File/SQLite [公开 Turn 检查](../../../tests/control_plane/test_explore_settlement_attachment.py)
覆盖独立验证的产物、关闭/省略及非法输入、已提交重放,以及从原 Run 恢复中断的交付。
恢复保持原 Run 不变、Host 调用一次,且仅在请求的交付完成后扣额一次。
覆盖最后一个 Todo 及带后继的完成路径;完成 Todo 前先执行原附件预检。
被该预检拒绝的非法或未启用输入使 Todo 保持 open,且不产生主写回或扣额。
这些检查取得调用边界资格;native 模型采用、完整预算收益、其他后端资格及在途
执行提案的集成仍开放。

同一源码 checkpoint 还拒绝附件待交付时经公开 quota CLI 提前扣额。普通 Turn 与
`refresh-state` 的回执写入都先完成附件交付;普通及组合 refresh 恢复先交付已验证的
原 Run,再修复回执。File/SQLite 故障对照覆盖 progress、completion、terminal 和
successor Run,以及首次 CLI 交付中断。失败时不发写回回执、不扣额;恢复保持
原 Run 不变,Host 调用一次且扣额一次。
关闭 Yardstick 后,回执修复仍保留已提交捕获的重放语义;先完成原交付和结算,
再开始下一 Turn。显式启用的读取模块在时钟
回拨时采用已验证的后继历史前缀,保留原工作窗口及缺少前缀时的严格退路。
File/SQLite 回归覆盖拒绝提前扣额和保留原候选/finding 回读;这些是正确性边界,
不证明模型采用或收益。

既有[已释放反馈消费者](../../../tests/control_plane/test_material_feedback_checkpoint.py)
现沿普通选择入口返回的 captured review、Explore 证据和 writeback reader,
不再期待 raw guard 字段。同一 File/SQLite 检查覆盖 Stride 关闭/启用、
soft claim/hard lease 及历史反馈仅作上下文:保留独立验证的成本二路线,
根据已释放证据记录前瞻比较,实际执行成本一路线,并在原完成验证缺失时
拒绝终态收口。Reader 保持原结算身份且不扣额。固定基线与作者/组合源码中
未变的 runtime 已支持该路径;迁移 reader 前失败的是过时测试消费者。
这取得脚本式本地执行与调用方资格;实际模型采用、校准、同预算与跨任务
收益仍未证明。

直接 `run-once` 恢复现经普通 writeback callback 及其 resolver 保留已提交的
重放标记。经验证的原回执修复可在 Yardstick 关闭后完成,新 typed 捕获仍被拒绝。
聚焦的 File/SQLite 回归保留原 Run 和 Host,只写一个 finding 与回执、扣额一次,
并验证重放无副作用及新捕获拒绝。这修复既有恢复合同,不新增 owner 或 activation;
已安装 Host、其它后端及收益仍沿各自门禁。

重放和新捕获断言现于恢复 fixture 内执行。此前测试更新将该块放在无证据测试中:
恢复用例未执行这些断言,普通结算则因 fixture 名称未定义而失败。将既有断言块
移回所属作用域恢复两类检查,不改变 runtime 逻辑。File/SQLite 恢复、无副作用
重放、新 disabled 捕获拒绝及普通无证据结算现经公开 CLI 执行;此前结果保留
其原有、更窄的覆盖范围。

后端名称也须有实际 provider 证据。共享的
[本地 authority fixture](../../../tests/control_plane/canonical_authority_fixture.py)
现于存储或 writer-fence 副作用前拒绝不支持的 provider;
[CLI 对照](../../../tests/control_plane/test_canonical_authority_fixture.py)
验证真实 File/SQLite 回读及拒绝时状态不变。此前 PostgreSQL 标签会静默
初始化 File authority。既有
[PostgreSQL remote task 候选](../../reference/remote-authority-task-service-v0.md)
另经真实 TLS、受限角色、任务生命周期和只读 quota 观察验证,仍不准入普通
host Turn。因此这些服务检查不能取得普通 PostgreSQL 反馈 Turn 资格,
也不构成本切片新增执行 profile 的理由。

首个任务须确有反馈或方法选择需求。已有链完整时直接复用;有缺口时由真实消费者证明并修复,不为配合示例制造失败。运行实验、训练模型和发布过程各沿原权限,本文不占用其他 lane 配额或预设 PR 数。

## 12. 待确认的关键选择
Expand Down
Loading
Loading