Skip to content
Open
148 changes: 148 additions & 0 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2984,3 +2984,151 @@ cost and adoption remain unqualified. Preserve I3 for at least one minor
release, M1/#8011, full R0/V10/R1, D2/D5/D6/D3, context/model/split-install,
PostgreSQL host/wheel and every frozen failure. The original task remains open;
this checkpoint does not authorize merge or declare the minimal kernel complete.


### 2026-11-08 — Canonical source scalar-comparison refinement

The existing `todo.read` owner now uses exact equality for unchanged primitive
fields after its complete canonical-field digest and JSON clone. Containers and
altered scalar values keep the full canonical digest comparison; missing fields,
source-lane additions, scalar-fact protections and stale-reference rejection
remain with their current owners. No source allowlist, provider cache, protocol,
configuration or competing decision owner is introduced.

A fresh synthetic complete-CLI caller trace on `main@aee777008` confirms the
existing two-role native transaction is adopted. Quota before/after projections
belong to different budget decisions, so their repeated read recipes do not
justify an authority cache. The bounded refactoring stays in the existing
canonical source comparison instead of collapsing those decisions.

Final `read_transaction.ts` SHA-256 `ac0ae4311e4fe5c385ec75b3569cd8ebbe98328189e2885b5ecdcccb11c476b3`
passes 61 Python and 56 TypeScript cases plus real isolated PostgreSQL16.15
store391/service11, zero skips in these qualified runs. The immutable original
passes the selected native PostgreSQL source-protection case; a mutation that
treats all primitives as unchanged fails it. Parent replacement, deletion and
restoration, changed notes/scopes/counts and provider-state readback remain covered.
Four complete 101-Todo source/wheel × File/SQLite CLI lifecycles preserve sum45,
original completion time, four receipts, one debit, restart and refusal/replay;
each owns and observes two normal native process exits. The isolated wheel's
runtime source bytes match the checkout. Validation uses macOS arm64,
CPython3.13.5 and Node22.22.3. Earlier toolchain/setup failures and a service-env
skip remain preparation evidence, distinct from the qualified runs.

This removes redundant scalar digest work; it is not a matched-cost or full
marginal-cost/adoption result. Frozen cost, attribution and normal-bytecode
campaigns remain unchanged. Preserve the original complete transaction and all
I3/minor-release, M1/#8011, full R0/V10/R1, D2/D5/D6/D3,
context/model/split-install, PostgreSQL host/wheel and historical failure gaps.
Exact-head review, required CI/readiness and maintainer merge authority remain
separate gates; no installed-host upgrade or Goal completion is claimed.


### 2026-11-09 — Reuse validated complete source-basis bytes

The existing Python Todo compatibility transport now retains its validated
canonical field bytes as the complete source basis. It previously encoded each
field twice, once for the basis and once for digest validation. The basis is
only decoded as JSON; mapping insertion order is not a source difference. Full
digest mismatch fallback, scalar-fact protection, request-scope provenance and
source/revision/lease/refusal/replay guards remain. No decoder, cache, provider,
configuration, protocol or competing decision owner is added.

On the same real isolated SQLite field observation, the immutable original
encodes two fields four times and the candidate twice; both retain complete
values and empty source differences. The original passes two mapping-order and
scalar-protection characterization cases; the candidate passes all nine canonical
source cases across File/SQLite. Final `summary_item.py` SHA-256 `a8ca890eee547929060ac326fc8b85ca9c14a8fd5ec850deb2fe3e6586628513`
matches the isolated wheel. Four complete 101-Todo source/wheel × File/SQLite
CLI lifecycles preserve sum45, original completion time, four receipts, one debit,
restart and refusal/replay, with two normal native exits per lifecycle.
Validation uses macOS arm64, CPython3.13.5 and Node22.22.3.

This is an encoding mechanism refinement, not matched-cost or full marginal-cost
and adoption qualification. Frozen cost, attribution and normal-bytecode
campaigns remain unchanged. PostgreSQL host factory absence is already recorded;
its store/service checks do not qualify a source/wheel host journey. Retain every
original acceptance and I3/minor-release, M1/#8011, full R0/V10/R1, D2/D5/D6/D3,
context/model/split-install, installed-host, full-cost/adoption and historical
failure gap. Exact-head review, CI/readiness and maintainer merge authority remain
separate gates.

### 2026-11-09 — Combined report and canonical-source caller qualification

The original #8360 proposal now combines report construction isolation with
the scalar comparison from #8372 and complete validated source-basis reuse from
#8374 over target main `aee777008`. Runtime qualification uses
`8b4df2fac966933e200ba15bb36b2f7afb9a194a` and preserves the original proposal's
ancestry. The same existing report and typed Todo owners retain configuration
validation, complete canonical reads, source/revision/lease protection and
receipt/refusal/replay semantics; no decoder, authority cache or provider is added.

Four fresh 101-Todo source/wheel × File/SQLite complete CLI lifecycles retain
the original fixture/artifact fingerprints, scopes and completion time, four
receipts, one debit and two observed normal native exits each. All 1,921 present
tracked wheel entries match source bytes; seventeen existing source-only,
documentation and media omissions remain. On Node 22.22.3 and CPython 3.13.5,
the control-plane typecheck and 105 adjacent TypeScript cases pass. Real isolated
PostgreSQL 16.15 store/service checks pass (391/11, zero skips), and the owned
server is stopped afterward.

The isolated wheel's packaged browser passes `typed-actions`,
`conversation-activity` and `conversation-history-recovery` with synthetic
upstream data. The original exact interruption assertion and completion/Turn
isolation remain. Extended report caller checks return 70 passes and one failure:
the calendar capability-action test expects a missing `turn_envelope`. The same
test fails identically on immutable target main `aee777008`; this is retained
as an unresolved validation gap, not relabeled as passing. Initial relative
interpreter, installed-package provenance and missing-browser preparation
failures are retained separately from the qualified runs.

This combined boundary qualifies integration correctness, not whole-path or
full marginal-cost/adoption benefit. Frozen cost, attribution, normal-bytecode
campaigns, every original acceptance gap and historical failure remain intact.
#8372/#8374 remain separate open proposals pending reconciliation; combination
is not merge. Exact-head review, CI/readiness and explicit maintainer merge
authority remain required. The original task stays open.

### 2026-11-09 — Reconcile merged loading and the remaining source proposal

Before publication, #8360 was observed merged as `e37a1d691`; #8011 is also in
target main `520a1ab47`. The remaining source refinements now continue through
the original #8372 proposal, preserving its `cbda59c6e` ancestry and incorporating
#8374's complete-basis change. The merged report proposal is not recreated.

Fresh runtime qualification at `4e72980bee91c7bbfcedb2eb481b8573113340b3` over
that main passes 82 focused Python cases, 105 TypeScript cases, typecheck,
real isolated PostgreSQL store/service (391/11), four complete 101-Todo
source/wheel × File/SQLite lifecycles and the three packaged browser scenarios.
Wheel ownership remains 1,921 matching entries and seventeen existing omissions.
The standard premerge at that runtime revision passes six direct and nineteen
selected checks. The expanded report family remains 70 passed/one failed;
immutable `520a1ab47` reproduces the same `turn_envelope` assertion failure.
That unresolved packet-contract qualification remains a hold alongside exact-head
review, required CI/readiness and maintainer merge authority. Initial collection,
environment and interrupted interim runs retain their original limits.

This reconciles shipped loading with the remaining reviewed source boundary;
it does not close the original task, installed-host, PostgreSQL host/wheel,
full-cost/adoption or any other retained acceptance. No frozen campaign is rerun
or relabeled, and this lane performs no main merge.

### 2026-11-09 — Reconcile the M0 ratchet after the merged status move

The exact #8372 qualification head's CI fails its kernel-static prerequisite:
merged #8011 moved `chat_status_api.py` into `chat/status_api.py`, reducing the
root from 128 modules to 127, while the fixture still pins 128. The downstream
Stage 2C, checks and aggregate pytest jobs reject their skipped/failed inputs;
those results do not establish new runtime failures or passes.

The existing M0 fixture now records measured main `520a1ab47` and lowers its pin
to 127. Its schema, entrypoint allowlist, exact-count rule and over-budget
rejection remain intact. The same seven kernel-static checks pass on CPython
3.13 and 3.11. In the same isolated source tree, an added unapproved 128th root
module still fails; removing only that synthetic module restores the pass.
The original CI and local 127-versus-128 failures remain retained evidence.

This repairs the validation handoff for an already merged module relocation;
it neither moves another runtime owner nor changes a production limit. Pages,
the separate report packet-contract gap, full CI/review/readiness and every
original installed-host, PostgreSQL host/wheel, full-cost/adoption and frozen
qualification remain separate. The complete original task stays open.
118 changes: 118 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 @@ -2317,3 +2317,121 @@ tracked 条目逐字节匹配源码,十七项源码专用、文档和媒体遗
保留 I3 至少一个 minor release、M1/#8011、完整 R0/V10/R1、D2/D5/D6/D3、
context/model/split-install、PostgreSQL host/wheel 以及每项冻结失败。
原任务保持开放;本检查点不授权合入,也不宣告最小化内核完成。

### 2026-11-08 — Canonical source 标量比较细化

现有 `todo.read` owner 在完整 canonical field digest 与 JSON clone 之后,对完全相等的
原始标量使用精确相等判断。容器和发生变化的标量保留完整 canonical digest 比较;
缺失字段、source lane 新增、标量 fact 保护及过期 reference 拒绝继续由原 owner 负责。
未引入 source allowlist、provider cache、protocol、配置或竞争的决策 owner。

在 `main@aee777008` 上,一次新的合成完整 CLI caller trace 确认现有双 role native
transaction 已被实际采用。Quota before/after projection 属于不同预算决策,重复的
read recipe 不能据此变成 authority cache。本次有界重构留在现有 canonical source
比较层,保留这两次决策。

`read_transaction.ts` 最终 source SHA-256 `ac0ae4311e4fe5c385ec75b3569cd8ebbe98328189e2885b5ecdcccb11c476b3`
通过 Python61、TypeScript56,以及真实隔离 PostgreSQL16.15 store391/service11;
这些已资格验证的运行均无 skip。不可变原版通过所选 native PostgreSQL source 保护用例,
将所有原始标量视为 unchanged 的 mutation 在同一用例失败。父级替换、删除和恢复,
note/scope/count 变化与 provider state 读回继续覆盖。source/wheel × File/SQLite
四次完整 101-Todo CLI lifecycle 保留 sum45、原完成时间、四份 receipt、一次 debit、
restart、refusal/replay;每次都拥有并观测两条正常 native process exit。隔离 wheel
runtime source bytes 与 checkout 一致。验证环境为 macOS arm64、CPython3.13.5、
Node22.22.3。更早的工具链/setup 失败与 service-env skip 仍作为独立准备失败保留。

本次减少重复标量 digest 工作,不代表 matched-cost、完整边际成本或 adoption 收益。
冻结的 cost、attribution 与 normal-bytecode campaign 均保持原样。继续保留原完整
transaction 与 I3/minor-release、M1/#8011、完整 R0/V10/R1、D2/D5/D6/D3、
context/model/split-install、PostgreSQL host/wheel 及所有历史失败验收缺口。
exact-head review、必需 CI/readiness 与 maintainer merge authority 仍是独立门;
未宣称 installed-host upgrade 或 Goal 完成。


### 2026-11-09 — 复用已验证的完整 source basis bytes

现有 Python Todo compatibility transport 将已经通过 canonical field digest
验证的完整字节复用为 source basis;此前每个字段分别为 basis 和 digest 编码一次。
basis 只作为 JSON 解码,mapping insertion order 不属于 source difference。
完整 digest mismatch fallback、标量 fact 保护、request-scope provenance 与
source/revision/lease/refusal/replay guards 均保留;未新增 decoder、cache、provider、
配置、protocol 或竞争的决策 owner。

在同一次真实隔离 SQLite field observation 上,不可变原版对两个字段编码四次,
候选版编码两次;二者保留完整值与空 source differences。原版通过两个 mapping-order
与标量保护 characterization 用例,候选版通过 File/SQLite 全部九个 canonical source
用例。最终 `summary_item.py` SHA-256 `a8ca890eee547929060ac326fc8b85ca9c14a8fd5ec850deb2fe3e6586628513`
与隔离 wheel 一致。source/wheel × File/SQLite 四条完整 101-Todo CLI lifecycle
保留 sum45、原完成时间、四份 receipt、一次 debit、restart 和 refusal/replay,
每条均观测两次正常 native exit。验证环境为 macOS arm64、CPython3.13.5、Node22.22.3。

这是编码机制细化,不代表 matched-cost、完整边际成本或 adoption 资格。冻结的 cost、
attribution 与 normal-bytecode campaign 保持不变。PostgreSQL host factory 缺失
已有记录,其 store/service 验证不能成为 source/wheel host journey 资格。继续保留
原完整验收以及 I3/minor-release、M1/#8011、完整 R0/V10/R1、D2/D5/D6/D3、
context/model/split-install、installed-host、full-cost/adoption 与全部历史失败缺口。
exact-head review、CI/readiness 和 maintainer merge authority 仍是独立门。

### 2026-11-09 — 报告与 canonical-source 完整 caller 组合资格

原 #8360 提案在目标 main `aee777008` 上组合报告构造隔离、#8372 的标量比较与
#8374 的完整已验证 source-basis 复用。运行时代码资格基于
`8b4df2fac966933e200ba15bb36b2f7afb9a194a`,保留原提案祖先。沿用报告与 typed Todo
owner,保持配置验证、完整 canonical read、source/revision/lease 保护及
receipt/refusal/replay 语义;未新增 decoder、authority cache 或 provider。

source/wheel × File/SQLite 四条新的完整 101-Todo CLI lifecycle 保留原
fixture/artifact 指纹、scope、完成时间、四份 receipt、一次 debit,以及各两次
可观察的正常 native exit。wheel 中现存 1,921 个 tracked 条目与源码逐字节一致;
十七项既有 source-only、文档和媒体遗漏保持。Node 22.22.3、CPython 3.13.5 下,
控制面 typecheck 和 105 项相邻 TypeScript 检查通过。真实隔离 PostgreSQL 16.15
store/service 通过(391/11,零 skip),自有服务随后停止。

隔离 wheel 的 packaged 浏览器在合成 upstream 下通过 `typed-actions`、
`conversation-activity` 和 `conversation-history-recovery`,保留原准确中断断言、
完成优先及 Turn 隔离。扩展报告 caller 检查得到 70 项通过、一项失败:日历
capability-action 测试预期的 `turn_envelope` 缺失。不可变目标 main `aee777008`
上的同一用例以同样错误失败;保留为未解决验证缺口,不重标签为通过。初始相对解释器、
installed-package provenance 与缺少浏览器的准备失败,与已验证运行分别保留。

组合边界验证集成正确性,不代表 whole-path、完整边际成本或 adoption 收益。
冻结 cost、attribution、normal-bytecode campaign、原全部验收缺口和历史失败保持。
#8372/#8374 暂时仍是开放独立提案,待后续协调;组合不代表已合入。
exact-head review、CI/readiness 与 maintainer 明确合入授权继续必需;原 Task 保持开放。

### 2026-11-09 — 对齐已合入加载与剩余 source 提案

发布前观察到 #8360 已以 `e37a1d691` 合入,#8011 也已进入目标 main `520a1ab47`。
剩余 source 细化沿原 #8372 提案继续,保留 `cbda59c6e` 祖先并纳入 #8374 的
完整 basis 修改;不重建已经合入的报告提案。

在该 main 上,运行时代码 `4e72980bee91c7bbfcedb2eb481b8573113340b3` 的新验证
通过 Python82、TypeScript105、typecheck、真实隔离 PostgreSQL store/service
(391/11)、source/wheel × File/SQLite 四条完整 101-Todo lifecycle,以及三个
packaged 浏览器场景。wheel 仍有 1,921 项字节匹配与十七项既有遗漏。
该 runtime revision 的 standard premerge 通过六项 direct 与十九项 selected 检查。
扩展报告检查仍为 70 项通过、一项失败,不可变 `520a1ab47` 复现同一个
`turn_envelope` 断言失败。这项 packet-contract 验证缺口与 exact-head review、
必需 CI/readiness、maintainer 合入授权共同保持为限制。初始 collection、环境和
中断的临时运行继续保留各自原始资格限制。

本次对齐已交付的加载与剩余待评审 source 边界,不关闭原 Task、installed-host、
PostgreSQL host/wheel、full-cost/adoption 或任何其他保留验收;不重跑或重标签
冻结 campaign,本 lane 未执行 main 合入。

### 2026-11-09 — 对齐已合入 status 迁移后的 M0 ratchet

#8372 的准确资格 head 在 CI 的 kernel-static 前置检查失败:已合入 #8011
将 `chat_status_api.py` 移入 `chat/status_api.py`,顶层模块数从 128 降至 127,
fixture 却仍固定为 128。下游 Stage 2C、checks 与汇总 pytest 因前置被跳过或失败
而拒绝;这些结果不能证明新的 runtime 失败或通过。

现有 M0 fixture 将测量基线记录为 main `520a1ab47`,并把 pin 降至 127。
schema、入口 allowlist、精确计数规则与超额拒绝保持。相同七项 kernel-static
检查在 CPython 3.13 和 3.11 通过;同一个隔离源码树增加未批准的第 128 个顶层
模块仍失败,仅移除该合成模块后恢复通过。原 CI 与本地 127/128 失败继续保留。

本次修复已经合入的模块迁移的验证交接,不迁移另一个 runtime owner,也不改生产
上限。Pages、独立 report packet-contract 缺口、完整 CI/review/readiness,以及
全部原 installed-host、PostgreSQL host/wheel、full-cost/adoption 和冻结资格继续
分别保留;原完整 Task 保持开放。
7 changes: 6 additions & 1 deletion loopx/control_plane/todos/read_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,13 @@ function resolveCanonicalSource(fields: JsonObject, reference: JsonObject, expec
delete parent[last];
} else Object.defineProperty(parent, last, {value: change.value, enumerable: true, writable: true, configurable: true});
}
// JSON cloning owns containers while retaining primitive values. Exact
// equality already proves an unchanged primitive; containers and altered
// scalar values retain their full canonical digest comparison.
for (const [key, value] of Object.entries(field)) {
if (key !== "goal_acceptance_contract" && (!Object.hasOwn(record, key) || canonicalAuthoritySha256(value) !== canonicalAuthoritySha256(record[key]))) {
const unchangedScalar = value === record[key] && (value === null || typeof value !== "object");
if (key !== "goal_acceptance_contract" && (!Object.hasOwn(record, key) ||
!unchangedScalar && canonicalAuthoritySha256(value) !== canonicalAuthoritySha256(record[key]))) {
throw new EffectRuntimeRequestError("canonical Todo facts cannot be replaced by caller source differences");
}
}
Expand Down
Loading
Loading