Skip to content

Preserve Turn loading isolation and qualify scoped interruption recovery - #8360

Merged
huangruiteng merged 19 commits into
mainfrom
codex/small-kernel-report-loading-20261108T0903
Nov 8, 2026
Merged

huangruiteng merged 19 commits into
mainfrom
codex/small-kernel-report-loading-20261108T0903

Conversation

@cocolord

@cocolord cocolord commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Optional Turn writeback loaded report construction before a caller needed it, and the browser interruption qualification could let its synthetic correction finish while navigation or an interrupt response was pending. This proposal defers report construction behind the existing caller, preserves disabled-subscription validation and compatibility exports, and keeps the exact correction Session/Turn running until its interruption assertions finish.

中文:报告构造改为由实际 caller 按需加载,关闭态保留原配置校验和兼容入口。浏览器资格场景只保持准确纠偏 Session/Turn 的流,并等准确 POST 中断回执后检查原请求账本;原 8 秒按钮等待、10 秒中断消息断言、完成优先及 stale-Turn 保护保持不变。

The exact proposal head is 09963efea8ff97a531889c9d79719391493510f4, integrated with target main 1075c4cba8933410af8315dd8404f7548d70fc32. It retains this PR's original ancestry. The existing lexical scope codec and feedback loading repair are already in main; this diff reuses their owners. The paired RFC retains all original loading, transaction, distribution and full-cost acceptance gaps and adds the controlled interruption evidence. Production UI, layout and runtime interruption semantics are unchanged.

Current validation Result and boundary
Controlled 6.5-second interrupt-response pressure Immutable original fails the early request-ledger check. Candidate passes. Removing only the scoped stream hold while retaining response waiting reproduces the original exact 10-second interrupted-message timeout. Final candidate pressure passes in 81.5 seconds. This establishes fixture sensitivity, not a matched-cost result or CI success.
Packaged browser at the exact proposal head typed-actions PASS (65.6 s), conversation-activity PASS (4.6 s), conversation-history-recovery PASS (22.0 s); generated bundle revision matches the proposal head. Chromium browser with synthetic upstream data. Main's fixed-clock activity fixture is included.
Native chat recovery at 953cebabbd3ee66ed710cba39ccb1b7a0dacc577 173 passed across active-Turn, process recovery, completed-background stop and steering tests; real store/controller/HTTP and isolated owned processes, synthetic upstream.
Loading integration at 953cebabbd3ee66ed710cba39ccb1b7a0dacc577 114 passed across feedback adapter loading, periodic report loading, native replan CLI and local delegation. 63 Node checks passed with zero skips/failures across digest, context root, work requirements, lease and effect-program behavior. Control-plane typecheck passed.
Revalidation provenance Runtime, apps, scripts, tests and packages are byte-identical between the two validated heads. Only paired RFC evidence and main's conversation-activity fixture changed; the latter was revalidated in the exact-head packaged run.
Exact-head standard premerge Passed: six direct checks and fourteen selected checks; zero failures, advisories, warnings or manual holds. Bilingual head checks and public-boundary scan passed. Validation reports self_merge_allowed=false; repository authority remains required.

Earlier source/wheel qualification remains attributable to its original head rather than being relabeled as a new run:

  • Four source/wheel × File/SQLite 101-Todo correctness episodes preserved immutable fixture/artifact bytes, original scopes and completion time, four receipts, one debit, refusal/restart/replay and two owned native exits each.
  • Wheel ownership was checked first: all 1,921 present tracked entries matched source; seventeen source-only/doc/media omissions were unchanged. Fourteen CPython 3.11 revalidation/UTF-8 cases passed in each source and isolated-wheel distribution, preserving the original Turn identity and one Host invocation.
  • Disposable PostgreSQL 16.15 store/service checks passed (391 + 11, zero skips). Source and isolated wheel each read the complete 101-Todo projection through the authenticated service-owned factory. The real quota CLI rejects valid PostgreSQL selection with local_authority_provider_unavailable and source_authority=postgresql_v0; an extra selector field rejects with local_authority_selector_invalid. Same-Turn replay preserves source/state, creates no File/SQLite fallback and debits zero. This qualifies the existing in-process boundary; deployment-owned PostgreSQL transport, verifier, tenant policy and pool lifecycle remain open.

Historical failures remain recorded. Earlier 532ecfd CI had Frontstage HTTP 504, six Windows recovery failures and TypeScript digest/loading failures. At d643f2a, Pages build failed during a desktop manifest download with TimeoutError, and Dashboard browser shard 1 reached the interrupted-message timeout. The controlled fixture result explains and repairs a demonstrated qualification race; it does not certify the new GitHub run or resolve the Pages failure. Missing-bundle, removed-temporary-Node-path, missing isolated-fixture dependency, and initial PostgreSQL fixture/fence failures remain separate preparation evidence. Frozen cost, attribution and normal-bytecode campaigns were not repeated or relabeled.

The caller surface remains the existing report configuration and conversation journeys. Bounded refactoring applies the existing lazy compatibility pattern and lexical scope owner; it adds no provider, configuration or policy owner. Full provider-first transaction, PostgreSQL host/wheel, whole-path/full marginal-cost/adoption, I3 for at least one minor release, M1/#8011, full R0/V10/R1, D2/D5/D6/D3 and context/model/split-install acceptance remain open. No installed-host qualification or maintainer merge is claimed. Exact-head review, required CI/readiness and explicit maintainer merge authorization remain pending.

cocolord and others added 11 commits November 8, 2026 13:49
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
loopx-agent
loopx-agent previously approved these changes Nov 8, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

未发现阻断性问题。下列结论只资格关闭态构造隔离,不把作者的性能、wheel 或 PostgreSQL 计数作为本轮独立验证。

动机 / Motivation

运行 Turn 的用户即使关闭自动报告,旧的可选写回装配也会导入报告来源、预设和阶段构造代码。 旧路径在进入关闭态判断前加载报告构造依赖;本次将加载移到实际调用点,保持原有订阅校验、启用态结果和写回恢复。 独立冷进程探针在基线因导入报告源失败,在候选关闭态通过;14 组完整配置、hook 和警告对照一致。 范围是可选报告的构造加载隔离,不更换订阅、调度、存储或授权 owner。 完整 R0/V10/R1、安装组合、PostgreSQL host/wheel、模型采用和完整成本收益仍未验收。

改动思路 / Approach

继续让 canonical resolver 决定有效订阅,先解析 Goal override 或读取 live machine default,再判断 enabled。只有实际需要构造报告时才解析原 provider 导出。Core 的 durable writeback、原 Turn 身份与精确来源读回仍在前,可选 observer 的异常不能重做主写回或扣费。

两处 _LAZY_EXPORTS 只保留原模块别名及 patch 点;__getattr__ 缓存原 owner 对象,内部经模块属性读取,因此 patch 原公开别名仍生效。直接在函数里重导入会绕过这些已存在的调用方;移动整套报告 owner 则扩大本次边界。保留 canonical schedule 校验,避免为减少导入而跳过非法关闭配置。当前 PR 边界是两个实际装配调用方的构造隔离和兼容性,不是新的最小内核、报告配置或执行策略。

具体改动 / Changes

准确 head 532ecfd91a499bfd5d18421c1472e1a7f85bc78d,完整 PR 相对 merge base c263f7c78353fcaa914f23475d4d99d07eab7c01 为 5 文件 +323/-43:两处生产 Python +94/-43,新测试 +143,双语非规范检查点 +86。检查点没有修改原规范或历史失败,也没有降低任何阈值。

关键代码讲解

  1. loopx/capabilities/periodic_report/post_writeback_hook.py:45 的 __getattr__ 延迟解析并保留原对象身份;_report_export 经模块取属性,兼容已有 monkeypatch。订阅 resolver 与 machine store 保留在实际装配路径。
  2. 同文件 periodic_report_post_writeback_hooks_for_goal:96 在 enabled is True 后才取得 preset builder。14 组独立对照覆盖缺省、关闭、启用、override、非法 enabled/timezone/schedule/字段及 live default 翻转,hook、完整 warning/error 和无写入结果一致。
  3. loopx/cli_commands/turn_post_writeback.py:46 的 drain_committed_turn_post_writeback_hooks 先取有效 hooks;关闭时在读取 settlement/source 前返回。启用后仍读取原 Turn 的 committed source,再交给原 dispatch owner,source/refusal/retry 保留 primary settlement。

规范依据:docs/architecture/rfcs/monorepo-distribution-split-v0.md,不可变版本 c263f7c78353fcaa914f23475d4d99d07eab7c01,并核对既有 docs/reference/protocols/periodic-report-v0.md 的 Post-writeback hook boundary。R0 — implemented 为有界装配 seam,完整计量仍 deferred;V1 — implemented 本 seam 的冷进程构造拒绝与关闭态无效果,整个 minimal/standard 闭包 deferred;V3 — implemented 本调用方的配置、启用输出及公开 CLI 恢复对照,完整命令 corpus deferred;I3 — implemented,原导出对象、wildcard 和 patch 点保持;R1 与完整 V10 — deferred,原有 owner 继续,不能由模块数量或小样本时延代替验收。

对主干的风险 / Risks

PASS:162 项相关测试,包括新增冷进程/导出测试,以及真实 File、默认 SQLite 的启用/关闭、原来源拒绝、后续状态变化和精确重放。独立同一公共 CLI harness 在 base/head 各跑 4 个开关×后端场景通过;冷 import-refusal oracle 在 base 因 todo_source 导入失败,在 head 通过并确认没有额外文件。14 组配置对照保留完整警告文本和同进程默认变更,未做语义归一化。另以同一生产装配入口验证已覆盖 Goal、同容器其他 Goal、新建 Goal、标题/顺序变化和非法配置修复;base/head 的 hook 数及完整 warning 一致。

标准 premerge 为 6 个直接检查及 14 个选择检查,无 blocking failure;双语、source 及公共边界检查通过。继承的 maintainability advisory 仍为 FAIL:当前 base/head 独立运行的完整 450 字节失败输出相同,指向未改动的 Lark 模块 metric debt;配置、oracle 与环境匹配,阈值保持。

语义与 CI 对齐

复用既有报告、订阅、source 和 dispatch 契约;导出表是局部兼容映射,不创造新的控制面词汇或授权。订阅仍按每次真实配置读取,缓存的是函数对象。已检查现有 machine/Goal 配置编辑器及 Lark request 路径,本内部加载改动没有新增前端操作。默认关闭时不增加指导、schema、必填字段、报告 sidecar、排程或外部效果;启用仍只产生未授权 generation/delivery 的原 intent。未查询或等待 CI;作者提供的历史 CI/性能观察没有升级为本轮证据。

我的整体评价 / Verdict

原 resolver、source 和 dispatcher 已拥有校验及效果;局部 lazy aliases 保留现有 patch 边界,没有新增决策 owner。 当前 PR 边界:两个实际装配调用方的构造隔离和兼容性,不是新的最小内核、报告配置或执行策略。

判断为 justified_increment。long_horizon preserved:File/SQLite 原 Turn 重放保持主写回和原来源,不因可选构造失败重复执行。user_experience preserved:既有配置编辑器和错误修复语义不变,没有增加人工准备或确认步骤。视觉检查为 not_applicable:两处 Python 装配与 RFC 记录不修改渲染呈现,已检查原有配置入口。

兼容别名服务于真实公开导入和 patch 调用方,当前直接复用既有 lazy 模式即可,无需建立新 loader 框架。失效导入、错误 warning 和默认继承均有负例。作者的完整 wheel/101-Todo/391+11 PostgreSQL 与性能实验没有在本轮重跑;没有据此声称安装采用、完整成本改善或父级验收通过。保留原后继工作和合并授权门。

English verdict: APPROVE: off-state construction isolation preserves enabled reporting and settlement semantics.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
cocolord and others added 4 commits November 8, 2026 19:03
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@cocolord
cocolord requested a review from maxliux5 as a code owner November 8, 2026 11:39
@cocolord cocolord changed the title Defer report construction during optional Turn writeback Preserve Turn loading isolation through report, feedback and scope codecs Nov 8, 2026
@mergify

mergify Bot commented Nov 8, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 8, 2026
cocolord and others added 2 commits November 8, 2026 22:00
…ecks

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@cocolord cocolord changed the title Preserve Turn loading isolation through report, feedback and scope codecs Preserve Turn loading isolation and qualify scoped interruption recovery Nov 8, 2026
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 8, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

APPROVE。当前范围内未发现阻断性问题。精确 head 09963ef。

动机 / Motivation

运行 Turn 的用户需要让关闭的报告订阅维持原校验,同时省去构造模块的加载。旧路径提前导入报告构造依赖。新路径先解析原订阅,只在需要时构造报告。冷进程拒绝构造导入时,基线在加载报告来源处失败,当前提交在关闭态通过。14 组配置和 6 组目标范围对照保留原结果。范围为可选报告加载、UTF-8 测试 Host 和浏览器中断夹具。完整 V4、真实模型和安装采用、PostgreSQL Host 与全成本仍有独立验收。浏览器场景还需要把真实按钮触发与异步中断响应分开验证。

改动思路 / Approach

原 resolver、source 和 dispatcher 已拥有校验和效果,局部延迟加载复用原导出对象。当前 PR 交付关闭态加载隔离和两处测试资格修复。Goal override 仍优先于机器默认。报告启用后继续读取原已提交的来源。浏览器夹具只暂停指定纠偏的 Session/Turn 事件流,再等准确 POST 返回,保持原中断信息断言。

具体改动 / Changes

完整差异 7 个文件,+530/-45。两处 Python 保留原别名对象、patch 入口和配置警告。UTF-8 变更仅在合成 Host,和 #8365 的夹具相同。两个提案集成时只纳入一次。

关键代码讲解

  1. periodic_report_post_writeback_hooks_for_goal 先解析 Goal 和机器订阅,再加载 preset。订阅入口 L96
  2. drain_committed_turn_post_writeback_hooks 在有效订阅存在时才读取原结算来源。写回入口 L46
  3. interruptPath 用精确 Session 与 Turn 约束响应,随后检查请求账本。中断场景 L2137

规格映射 R0、V1、V3、I3 在本调用边界 implemented。V4 原任务端到端、完整 R1/V10 与安装及成本证据 deferred。不可变 RFC

对主干的风险 / Risks

独立运行 77 个报告加载及委派测试通过。相同配置和范围对照保留完整输出及警告。当前提交打包后在真实 Chromium 上运行 typed-actions,使用合成上游,约 67 秒通过。原生预检 6 项直接和 14 项选择检查通过,包括双语 RFC 与公共边界。作者的延迟压力、原生 Windows、独立 wheel 与 PostgreSQL 托管路径本轮未重跑。

我的整体评价 / Verdict

长程影响和用户体验判为 preserved,现有报告权限、原结算回执和重试路径保留。浏览器改动属于测试夹具,视觉检查不适用。此结论覆盖已验证的本地代码和打包测试,保留完整运行、部署和采用验收。

English verdict: APPROVE — 09963ef. Preserve report loading isolation and the bounded interruption fixture.

@huangruiteng
huangruiteng merged commit e37a1d6 into main Nov 8, 2026
34 of 62 checks passed
@huangruiteng
huangruiteng deleted the codex/small-kernel-report-loading-20261108T0903 branch November 8, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants