Skip to content

Commit 5e26851

Browse files
authored
Merge pull request #7665 from loopx-project/codex/c1-packaged-comparison-ledger
2 parents 33d9ecd + 565082c commit 5e26851

8 files changed

Lines changed: 226 additions & 2 deletions

‎docs/architecture/rfcs/STATUS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ appendix may keep dated history, but no dated log heading may precede it.
3131
| [RFC: Capable Agent Manager and Semantic Work Handoff (v0)](capable-manager-semantic-handoff-v0.md) | Accepted | [Personal Follow-through independent proposal](personal-follow-through-v0.md) | [2 entries](ledger/capable-manager-semantic-handoff-v0/) |
3232
| [RFC: Complete State Recovery and Controlled Reactivation (v0)](complete-state-recovery-v0.md) | Accepted | none | — |
3333
| [RFC: Composable State Machines and Recovery Verification (v0)](composable-state-machines-recovery-verification-v0.md) | Accepted | none | — |
34-
| [RFC: Controller / Executor Sessions and One Governed Work Contract (v0)](controller-executor-unified-contract-v0.md) | Accepted | none | [2 entries](ledger/controller-executor-unified-contract-v0/) |
34+
| [RFC: Controller / Executor Sessions and One Governed Work Contract (v0)](controller-executor-unified-contract-v0.md) | Accepted | none | [3 entries](ledger/controller-executor-unified-contract-v0/) |
3535
| [Explicit Todo continuation: Stage A](cross-session-memory-substrate-v0.md) | Accepted | none | — |
3636
| [RFC: LoopX Desktop Execution Frontends v0](desktop-execution-frontends-v0.md) | Accepted | none | — |
3737
| [RFC: External Evidence Research Capability v0](external-evidence-research-capability-v0.md) | Accepted | none | [3 entries](ledger/external-evidence-research-capability-v0/) |

‎docs/architecture/rfcs/STATUS.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
| [RFC:强能力 Agent 管家与语义工作交接(v0)](capable-manager-semantic-handoff-v0.zh-CN.md) | 已接受 | [个人事项持续跟进独立提案](personal-follow-through-v0.zh-CN.md) | [2 条](ledger/capable-manager-semantic-handoff-v0/) |
2929
| [RFC:完整状态恢复与受控重新激活(v0)](complete-state-recovery-v0.zh-CN.md) | 已接受 | 无 | — |
3030
| [RFC:可组合状态机与恢复验证(v0)](composable-state-machines-recovery-verification-v0.zh-CN.md) | 已接受 | 无 | — |
31-
| [RFC:Controller / Executor 会话与统一受治理工作契约(v0)](controller-executor-unified-contract-v0.zh-CN.md) | 已接受 | 无 | [2 条](ledger/controller-executor-unified-contract-v0/) |
31+
| [RFC:Controller / Executor 会话与统一受治理工作契约(v0)](controller-executor-unified-contract-v0.zh-CN.md) | 已接受 | 无 | [3 条](ledger/controller-executor-unified-contract-v0/) |
3232
| [显式 Todo 接续:阶段 A](cross-session-memory-substrate-v0.zh-CN.md) | 已接受 | 无 | — |
3333
| [RFC:LoopX 桌面执行前端 v0](desktop-execution-frontends-v0.zh-CN.md) | 已接受 | 无 | — |
3434
| [RFC:外部证据研究能力 v0](external-evidence-research-capability-v0.zh-CN.md) | 已接受 | 无 | [3 条](ledger/external-evidence-research-capability-v0/) |

‎docs/architecture/rfcs/controller-executor-unified-contract-v0.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,13 @@ full encoding and its delta encoding separately so transport reuse cannot hide
824824
a semantic regression. Controller/executor separation is a later independent
825825
comparison and cannot explain away a C1 regression.
826826

827+
The [packaged source comparison](ledger/controller-executor-unified-contract-v0/2026-10-29-packaged-source-comparison.md)
828+
pins mainline quota and the C1 candidate through real File/SQLite CLI delivery,
829+
file deltas, capture refusal/recovery and once-only settlement. Source fidelity
830+
improves while cold and observer-output bytes grow on that workload. Exact-byte
831+
capture checks and standalone numeric hash integrity remain distinct; this
832+
engineering evidence does not establish net cost benefit or complete C1.
833+
827834
Qualify [human interaction during execution](#human-interaction-during-execution)
828835
on the same long-running work, rather than disconnected chat demonstrations:
829836

‎docs/architecture/rfcs/controller-executor-unified-contract-v0.zh-CN.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,12 @@ C1 的主要对照是**同一单会话产品路径中的原 quota packet 与融
618618
传输复用掩盖语义退步。Controller/executor 分离是之后独立的对照,不能用来解释或
619619
抵消 C1 回归。
620620

621+
[打包来源对照](ledger/controller-executor-unified-contract-v0/2026-10-29-packaged-source-comparison.zh-CN.md)
622+
固定 mainline quota 与 C1 候选版本,经真实 File/SQLite CLI 验证交付、文件差分、
623+
capture 拒绝/恢复及一次结算。本负载来源保真改善,冷态和观察器累计输出字节增加。
624+
精确字节 capture 校验与独立数值 hash 完整性仍是不同边界;这些工程证据不证明
625+
净成本收益,也不结清 C1。
626+
621627
在同一长程工作上验收[执行期间的人机交互](#human-interaction-during-execution),
622628
不能用脱离工作的独立聊天演示代替:
623629

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Packaged source fidelity and the remaining C1 cost gap
2+
3+
中文镜像:[同名检查点](2026-10-29-packaged-source-comparison.zh-CN.md)。
4+
5+
This checkpoint supports the [single-session comparison](../../controller-executor-unified-contract-v0.md#9-validation-and-acceptance).
6+
It qualifies source delivery and recovery on a bounded engineering workload;
7+
it does not establish a net efficiency gain or complete C1.
8+
9+
## Versions and workload
10+
11+
The comparison pins original quota to mainline
12+
`b201da8bab305d053866aa0d4516b97ba4a4499e` and the proposed unified contract to
13+
`3afc2d547f6f9ca41368fd4f3f34d8f8dae9edcf` in
14+
[#7430](https://github.com/loopx-project/loopx/pull/7430).
15+
These are the tested versions, not a qualification of later mainline changes.
16+
Each isolated wheel has its own verified frontend source fingerprint;
17+
1,857 packaged product files match that arm's source, excluding generated Chat
18+
assets, which pass their separate bundle check. Both use Python 3.14.
19+
20+
Each arm uses the same synthetic active Goal, full selected task and final stop,
21+
one current-Agent outcome and five peer outcomes with four requirements each.
22+
Both real File and SQLite authorities are initialized in disposable runtimes.
23+
The original 24 descriptions, owners, work links and global stop conditions are
24+
retained. No active Goal or installed host is used as a fixture.
25+
26+
The packaged CLI runs thin heartbeat bootstrap, one admitted App-heartbeat guard,
27+
saved-file reads, native lifecycle hooks, warm presentation, compaction recovery,
28+
refusal controls, writeback/spend and their replays. Hook events are synthetic;
29+
the actual packaged hook and CLI implementations execute. A deterministic
30+
observer reads full sources to check equivalence. That observer is not a model,
31+
a recommendation to read every peer body, or evidence of model retention.
32+
The actual emitted warm delta is separately read and reconstructed against its
33+
digest-verified baseline and current files.
34+
35+
This is a new matched workload, not a rerun or replacement of the historical
36+
13,000-byte experiment. The earlier **25,862 > 13,000** failure is unchanged.
37+
38+
## Source and recovery results
39+
40+
Both arms retain the selected task, all 24 requirements and global stops. Early
41+
spending is refused. Restoring the original capture recovers the same source
42+
without another admission; repeated writeback and spending commit one effect
43+
and one debit, leaving the original task open.
44+
45+
The mainline generic codec changes the admitted source's `quota.compute` from
46+
`1.0` to `1`; its cold, warm-recovery and missing-baseline exact-source predicates
47+
fail on both backends. Its native cold presentation also carries `1` rather
48+
than the admitted `1.0`. The C1 candidate preserves the original source through
49+
these paths. This exercises the source-preservation repairs also proposed
50+
separately in [#7661](https://github.com/loopx-project/loopx/pull/7661) and
51+
[#7657](https://github.com/loopx-project/loopx/pull/7657), rather than creating a
52+
caller-specific numeric policy. Those proposals and C1 adoption are distinct
53+
from a mainline or installed rollout.
54+
55+
Both native warm files use `captured_file` continuity. Their actual deltas
56+
reconstruct the current file exactly; missing baselines and damaged deltas
57+
recover its full body. This proves saved-file reconstruction, not retained
58+
model input. Mainline's reconstruction is exact relative to its already
59+
normalized presentation; that does not repair the preceding source loss.
60+
61+
A numeric-only capture mutation distinguishes two integrity boundaries. In C1,
62+
changing `quota.compute` from `1.0` to `1` still passes the standalone complete
63+
contract's JavaScript-normalized hash check. Reading the changed file against
64+
its original byte SHA-256 is refused; restoring the original bytes recovers it.
65+
The exact-byte capture boundary is qualified for this caller. The standalone
66+
contract's numeric commitment remains open; neither check substitutes for the
67+
other or qualifies arbitrary Host input.
68+
69+
Three preliminary author runs remain failed observations: the first fixture
70+
used a non-active Goal for refinement, the second exceeded the existing
71+
512-character requirement limit, and the third supplied the forbidden fixed
72+
output-directory option to `context-project`. The corrected matched cohort
73+
uses an active synthetic Goal, bounded complete descriptions and the existing
74+
output-root option. No product limit, assertion or acceptance criterion changes.
75+
76+
## Measured costs and decision
77+
78+
One observation per arm/backend gives the following byte counts:
79+
80+
| Measurement | File: quota → C1 | SQLite: quota → C1 |
81+
| --- | --- | --- |
82+
| Initial guard stdout (file manifest) | 5,413 → 5,440 | 5,429 → 5,456 |
83+
| Cold saved presentation | 65,756 → 68,411 | 65,866 → 68,519 |
84+
| Cold full-read CLI stdout | 70,568 → 73,533 | 70,680 → 73,643 |
85+
| Actual warm delta file | 3,761 → 3,755 | 3,769 → 3,763 |
86+
| Complete observer CLI stdout | 482,505 → 494,464 | 483,299 → 495,250 |
87+
88+
The six-byte warm difference includes fixture-path and surface spelling; it
89+
does not demonstrate an encoding gain.
90+
91+
The observer makes 38 CLI calls in every arm, including fixture authoring,
92+
full recovery, refusals and readback. Separate warm-file qualification adds one
93+
CLI read per arm. In-process codec checks add nine coarse operations per arm;
94+
C1 also performs one extra standalone-hash negative control. These are explicit
95+
qualification costs, not a normal Turn's mandatory read policy.
96+
97+
The 38-call elapsed sums are 10.08 → 10.98 seconds for File and 9.41 → 9.57
98+
seconds for SQLite. Sequential single samples, process/broker startup and the
99+
chosen full-read observer do not establish a latency effect. The warm follow-up
100+
timer includes CLI and codec verification and is not a CLI-latency measurement.
101+
Memory, model tokens/cache/billing, accepted task outcomes, installed App
102+
behavior and human-attention costs remain unmeasured. Construction and failed
103+
author probes also remain costs; they are not erased by the completed cohort.
104+
105+
The useful delta is source fidelity and a more complete contract, with modest
106+
additional cold/output bytes on this workload. There is no demonstrated net
107+
cost reduction. Continue through existing source/context/journal owners and
108+
independently usable repair PRs. Use actual caller failures to choose the next
109+
hash or bridge change; do not infer a need for another full-source carrier or
110+
parallel hash policy from an isolated assertion. Keep numeric integrity,
111+
caller/writer cutover, historical-reader retirement and the original-quota
112+
decision/outcome/full-cost comparison open. The optional two-session study
113+
remains separate.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# 打包来源保真与 C1 尚未闭合的成本差距
2+
3+
English mirror: [matching checkpoint](2026-10-29-packaged-source-comparison.md).
4+
5+
本检查点支持[单会话对照](../../controller-executor-unified-contract-v0.zh-CN.md#9-验证与验收)。
6+
它验证有界工程负载中的来源交付与恢复,不证明效率净收益,也不结清 C1。
7+
8+
## 版本与负载
9+
10+
原 quota 固定为 mainline `b201da8bab305d053866aa0d4516b97ba4a4499e`,
11+
统一契约提案固定为 [#7430](https://github.com/loopx-project/loopx/pull/7430) 的
12+
`3afc2d547f6f9ca41368fd4f3f34d8f8dae9edcf`。这些是已测版本,不代表后续
13+
mainline 变化已合格。两份隔离 wheel 分别通过自身前端源码指纹校验;各有 1,857 个
14+
打包产品文件与对应源码一致,不含另经 bundle 校验的生成 Chat 资源。两组均使用
15+
Python 3.14。
16+
17+
每组使用同一合成 active Goal、完整已选任务及末尾停止条件、一个当前 Agent 成果,
18+
以及五个 peer 成果,每个成果四条要求。真实 File 与 SQLite authority 分别在可丢弃
19+
runtime 初始化。原始 24 条描述、owner、工作关联与全局停止条件保留,不以活跃 Goal
20+
或已安装 host 为 fixture。
21+
22+
打包 CLI 执行 thin heartbeat bootstrap、一次已准入 App heartbeat guard、保存文件
23+
读取、原生 lifecycle hook、暖态投影、压缩恢复、拒绝对照、写回/扣额及其重放。
24+
Hook 事件为合成事件,实际执行的是打包 hook 和 CLI。确定性观察器为验证等价而读全量
25+
来源;它不是模型,不是建议每轮读取全部 peer 正文,也不证明模型保留。实际发出的暖态
26+
delta 另经读取,使用摘要校验后的 baseline 与当前文件重建。
27+
28+
这是新的同负载对照,不是历史 13,000 字节实验的重跑或替代。
29+
此前 **25,862 > 13,000** 的失败保持不变。
30+
31+
## 来源与恢复结果
32+
33+
两组均保留已选任务、24 条要求及全局停止条件,拒绝提前扣额。恢复原 capture 后,
34+
无需再次准入即可读回同一来源;重复写回和扣额只提交一次 effect、扣一次额度,原任务
35+
保持 open。
36+
37+
Mainline 通用 codec 把已准入来源的 `quota.compute` 从 `1.0` 变为 `1`;两个后端的
38+
冷态、暖态恢复和丢 baseline 精确来源断言均失败,其原生冷态投影也携带 `1`,而非
39+
已准入的 `1.0`。C1 在这些路径保留原值。这实际复用了另行提案
40+
[#7661](https://github.com/loopx-project/loopx/pull/7661) 与
41+
[#7657](https://github.com/loopx-project/loopx/pull/7657) 的来源保真修复,
42+
没有建立 caller 专用数值规则。独立提案及 C1 采用,仍与 mainline 或安装采用分开。
43+
44+
两个原生暖态文件均采用 `captured_file` 连续性。实际 delta 精确重建当前文件;
45+
缺失 baseline 或损坏 delta 时恢复其完整正文。这证明保存文件重建,不证明模型保留。
46+
Mainline 的重建相对于已经归一化的投影精确,并不修复此前的来源丢失。
47+
48+
仅改变数值写法的 capture 负例区分了两种完整性边界。C1 中把 `quota.compute` 从
49+
`1.0` 改为 `1`,仍能通过独立完整契约的 JavaScript 归一化 hash 校验;但使用原始
50+
字节 SHA-256 读取已改文件会被拒绝,恢复原字节后可继续读取。这个 caller 的精确字节
51+
capture 边界通过验证;独立契约的数值承诺仍开放。两种校验互不替代,也不证明任意
52+
Host 输入已合格。
53+
54+
前三次作者运行仍记为失败:第一次用非 active Goal 发起 refinement,第二次超过既有
55+
512 字符要求描述限制,第三次向 `context-project` 传入被禁止的固定输出目录选项。
56+
修正后的同负载组使用合成 active Goal、有界完整描述与既有 output-root 选项,未修改
57+
产品限制、断言或验收标准。
58+
59+
## 已测成本与决策
60+
61+
每个组/后端各一次观察,字节数如下:
62+
63+
| 测量 | File:quota → C1 | SQLite:quota → C1 |
64+
| --- | --- | --- |
65+
| Guard 首次 stdout(文件清单) | 5,413 → 5,440 | 5,429 → 5,456 |
66+
| 冷态保存投影 | 65,756 → 68,411 | 65,866 → 68,519 |
67+
| 冷态全读 CLI stdout | 70,568 → 73,533 | 70,680 → 73,643 |
68+
| 实际暖态 delta 文件 | 3,761 → 3,755 | 3,769 → 3,763 |
69+
| 完整观察器 CLI stdout | 482,505 → 494,464 | 483,299 → 495,250 |
70+
71+
暖态的六字节差异包含 fixture 路径及 surface 拼写,不能证明编码收益。
72+
73+
每组观察器均执行 38 次 CLI 调用,包含 fixture 编写、全量恢复、拒绝及读回。暖态文件
74+
独立验证每组另加一次 CLI 读取;进程内 codec 检查每组另有九次粗粒度调用,C1 还多做
75+
一次独立 hash 负例检查。这些是明确计入的资格验证成本,不是正常 Turn 的必读策略。
76+
77+
38 次调用的耗时之和,File 为 10.08 → 10.98 秒,SQLite 为 9.41 → 9.57 秒。
78+
顺序执行的单次样本、进程/broker 启动及所选全读观察器,不能证明时延效果。暖态补充
79+
计时包含 CLI 和 codec 校验,不是 CLI 时延测量。内存、模型 token/cache/billing、
80+
验收成果、已安装 App 行为和人工注意力成本仍未测量;构造与失败作者探测也仍是成本,
81+
完成后的对照组不能抹除它们。
82+
83+
本负载的有效变化是来源保真与更完整的契约,同时增加了少量冷态和累计输出字节,
84+
没有证明净成本下降。继续复用既有 source/context/journal owner,优先交付独立可用
85+
修复 PR;根据实际 caller 失败选择下一项 hash 或 bridge 改动,不从孤立断言推导出
86+
需要另一份全量来源 carrier 或平行 hash 策略。数值完整性、caller/writer 切换、历史
87+
reader 退出和原 quota 的决策/成果/完整成本对照继续开放;可选双会话研究另行验收。

‎docs/architecture/rfcs/loopx-overall-roadmap-v0.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ host prompts. A common capture does not unify those consumers. Qualification
212212
checks source obligations through composition, reconstruction and actual final
213213
input; new-admission cutover stays separate from historical receipt replay.
214214

215+
The [pinned packaged comparison](ledger/controller-executor-unified-contract-v0/2026-10-29-packaged-source-comparison.md)
216+
qualifies C1 source/recovery behavior on real File/SQLite fixtures but records
217+
larger cold/output bytes and an open standalone numeric hash boundary. Preserve
218+
that counterevidence and the original outcome/full-cost gate; a working saved-file
219+
delta or once-only receipt does not establish long-horizon benefit.
220+
215221
Use that RFC’s C1–C9 task/deletion map within the existing work streams: first
216222
qualify unified single-session inputs, then role binding and shared lifecycle,
217223
replan/result authoring, executor exchange, benchmark reuse, packaged App

‎docs/architecture/rfcs/loopx-overall-roadmap-v0.zh-CN.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ C1 的[消费链切换表](controller-executor-unified-contract-v0.zh-CN.md#c1-
162162
共享 capture 不表示这些消费者已统一。资格检查须追踪来源义务经过组合、重建到实际
163163
最终输入;新准入切换与历史回执重放分别处理。
164164

165+
[固定版本的打包对照](ledger/controller-executor-unified-contract-v0/2026-10-29-packaged-source-comparison.zh-CN.md)
166+
在真实 File/SQLite fixture 验证 C1 来源/恢复行为,同时记录更大的冷态/累计输出,
167+
以及尚开放的独立数值 hash 边界。保留这些反证和原成果/完整成本门;文件差分或一次
168+
结算回执可用,不证明长程收益。
169+
165170
把该 RFC 的 C1–C9 任务/删除表放在既有工作流内:先验收统一单会话输入,再做角色绑定
166171
与共享生命周期、replan/结果编写、executor 交流、benchmark 复用、打包 App readback
167172
及退役。App heartbeat 流程和实际 benchmark 消费者分别验收;managed Codex 可以作为

0 commit comments

Comments
 (0)