Skip to content

fix(kernel): integrate deferred loading and preserve staged context reads - #8346

Merged
loopx-agent merged 10 commits into
mainfrom
codex/small-kernel-scope-loading-20261108T053510
Nov 8, 2026
Merged

loopx-agent merged 10 commits into
mainfrom
codex/small-kernel-scope-loading-20261108T053510

Conversation

@cocolord

@cocolord cocolord commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Pure feedback and work-declaration reads should not load mutation or lease execution adapters. This proposal combines the existing deferred feedback adapters (#8339) with the declaration codecs, on current target main efd49352c. The equivalent anchored conversation clock repair from #8343 is already present on main and is preserved.

A real quota replan-view --replan-stage explore read also exposed a transport defect: a scalar-only staged view was compressed into a root replacement with an empty property path, which the Python consumer rejects. Nested records remain compact; staged roots now use the existing property edits. The original context, source hash and absent Explore basis read back successfully.

纯反馈和工作声明读取现在复用已有按需加载边界,保留原导出、写入顺序及 lease 栅栏。本提案在同一版本整合声明 codec 和 #8339 反馈组件,同时修复可空 Explore staged 读取的空 root path 编码缺陷。既有 source/number lineage 与嵌套压缩保持。

Author Declaration

  • Written by: model_agent — GPT-6 family via TRAE.
  • Specification and revision: monorepo-distribution-split-v0, existing diagnostic_projection.ts property-edit transport, and repository real-path validation policy.
Criterion Disposition Owning path Evidence
Reuse typed owners and preserve declaration values/exports implemented work_items/write_scope_codec.ts, original acquire exports Node 22 cold-loading/digest/source-identity checks and complete lifecycle readback
Preserve feedback adapter identity, patch points and write/refusal ordering implemented loopx/feedback.py Existing unavailable-adapter, write/recovery and policy checks; original star exports retained
Preserve exact captured reads and numeric/source lineage implemented quota/diagnostic_projection.ts Root property-path oracle fails before the fix; real File/SQLite captured Explore reads now preserve an absent basis and original hash
Complete source/wheel File/SQLite correctness and supported backend recovery implemented for this runtime slice existing CLI and authority owners Four original 101-Todo lifecycle oracle sets and isolated PostgreSQL store/service suites
Whole-path benefit, optional distribution rollout and installed adoption deferred existing RFC owners No performance or full-program completion claim; original qualification gaps remain

Scope And Continuation

This is a combined runtime proposal on one tested head, retaining the existing components and their historical evidence. Pure helpers stay separate from execution adapters; the new root-path correction stays in the existing TS transport owner. No new capability, provider, vocabulary, decision owner or authority cache is added.

The bounded refactoring pass applies the existing declaration-codec separation and limits the existing scalar compaction to its supported transport shape. Report subscription/construction loading remains the next known boundary. Component approval does not approve this combined head; protected merge still requires independent review/readiness and maintainer authority.

Validation

  • Tested revision: b26cf572c08429d662d02ab7a71176f0420d6f00 (runtime source bytes match the checked source and installed wheel).
  • Run state: finished locally; new-head CI and review remain pending.
  • Input classes: synthetic, public_fixture.
Check kind Result Evidence / limitation
regression_parity passed Independent root-path test fails on parent; preserved source-number identity cases and real captured reads pass after correction
unit / integration passed 37 feedback/replan cases plus 2 newly extended absent-Explore CLI cases; 34 Node 22.22.3 loading/digest/root/identity cases; 15 focused Node 26 cases
real_entrypoint passed Four new source/wheel × File/SQLite 101-Todo episodes retain original artifact, full scopes, completion time, four receipts, one debit, refusal/restart/replay and both managed native exits
real_backend passed Isolated PostgreSQL 16: 391 store and 11 service cases, no skips, separate disposable databases; this is source-suite coverage
real_entrypoint passed Original research-record-search on development and source/wheel packaged paths retains the negative paragraph, two original history rows, Goal isolation and exports; packaged wheel conversation-activity also passes
static / packaging passed with limits Installed ownership first; 1,921 present tracked package entries match bytes, including every changed runtime file. Seventeen tracked doc/media/testing or source-only entries are omitted; broader distribution coverage is not inferred
static / premerge passed with inherited advisory Standard diff-derived canary: 6 direct checks, 19 selected checks, no blocking failure/hold. One unchanged private_conversations.py maintainability finding remains an inherited advisory. Staged/head bilingual checks, public-boundary scan and production semantic advisory pass
integration failed, retained Initial source-driver preparation used python while its console selected python3, producing distinct runtime fingerprints and failing warmup/exit coverage. Subsequent episodes use each actual launcher interpreter; the failed episode and original semantics are retained
manual / CI not_run on new head Earlier CI research-record timeout did not reproduce locally. Its platform/timing cause remains unknown; successful local original assertions do not certify new-head CI

Corrected preparation failures (merge markers, missing browser binary, source/installed interpreter selection and Unix socket path length) remain in private evidence. Frozen 20-cost samples and attribution/default-bytecode pairs are neither rerun nor relabeled. Whole-cost benefit, model/attention, installed adoption, PostgreSQL host/wheel and the retained I3/minor-release, M1/#8011, full R0/V10/R1, D2/D5/D6/D3 and context/model/split-install qualifications remain open.

四条完整流程与真实 PG 校验通过,原研究记录负结果、历史和导出断言保持。此前 CI 超时本地未复现,原因仍未知;新 head 的 CI/评审继续待验收。保留初始解释器准备失败及全部冻结成本/PID 观察失败,不据模块数、测试数或组合提案宣称整体收益。

Frontend / Visual Evidence

  • UI impact: none; no presentation or interaction code changed. Existing populated research and conversation journeys were exercised against the real synthetic history backend in development/packaged paths.
  • First viewport and preview: N/A for unchanged presentation.

Type of Change

  • Bug fix
  • Refactoring
  • Documentation update
  • Test update

LoopX Area

  • Control plane
  • Build and packaging validation

Shared-authority RFC fixture impact

Synthetic 101-Todo full-read/lease/replay fixtures retain original semantics and artifact. File/SQLite source and wheel arms and isolated real PostgreSQL source suites pass. No authority promotion or runtime routing change is introduced; PostgreSQL host/wheel rollout remains unqualified.

Boundary Checklist

  • Public code and aggregate synthetic evidence only; no private state, credentials, raw logs, local paths or internal links.
  • No duplicate benchmark work or job launch.
  • Existing RFC mirrors both changed and staged/head bilingual checks pass.
  • UI impact is none.
  • Every commit includes DCO sign-off.

cocolord and others added 4 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>
cocolord and others added 5 commits November 8, 2026 15:53
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>
@cocolord cocolord changed the title refactor(kernel): keep declaration codecs independent of lease execution fix(kernel): integrate deferred loading and preserve staged context reads Nov 8, 2026
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

动机 / Motivation

普通反馈校验、工作声明和精确捕获读取的调用者,是本次组合修复的使用者。旧路径把纯校验或声明与写入、租约执行耦合;可空 Explore staged 视图还会生成消费者拒绝的空根路径。新路径按需加载执行适配器,并只在嵌套对象使用整块压缩。当前组合版本独立通过加载/值差分、根路径反例及真实 File/SQLite staged 读取;原副作用 owner、权限和 receipt 语义保持。本 PR 不新增能力、持久协议、权限、默认开关或安装入口。完整 distribution/preset、R0/V10、模型实际采用和长期净收益仍由父 RFC 的原资格负责,本次局部修复不能结清。

改动思路 / Approach

旧提交 57b 的纯 codec 评审未发布;作者更新为当前组合版本后,我重新核对全部差异,没有继承组件批准。work_requirements 直接消费纯词法 owner,反馈模块只在明确访问写入符号或调用 append 时解析既有适配器。租约、写入栅栏、锁、journal/receipt 和恢复仍归现有执行 owner。既有词法规则和反馈适配器复用原实现,根节点修复留在原 transport owner,不新增状态、执行器或并行决策。

最强反例是“普通读已不加载执行模块,但写入前置检查或精确捕获读取被破坏”。当前独立进程故障探针验证未选择租约 owner 时 ping 可用,选择后两次准确失败,后续 ping 可用;反馈缺 writer 在 registry 读取前拒绝。根路径测试按既有 Python 消费者的非空属性路径要求构造,基线失败、当前通过;真实 File/SQLite 的 Explore 读取保留原 source hash 和 null basis。当前边界是纯调用路径的依赖隔离及既有 staged 读取修复,不以模块数或组件批准代替组合验收。

具体改动 / Changes

关键代码讲解

准确 head b26cf572c08429d662d02ab7a71176f0420d6f00,真实 merge base efd49352cc087cb299d5f7194cefd95a64b83e95,完整范围 12 文件 +496/-108。packet 的 key_files 只列关键文件,完整 Git 差异还包括 digest guard 和新增 root oracle,均已检查。相对旧 57b,四个 codec/调用模块及 npm manifests 字节不变;反馈模块与先前组件 6d1 字节相同,但仍重跑当前组合的相关验证。

  • write_scope_codec.ts:87 保留请求原拼写、首次出现顺序、coercion、字符类与 160 字符限制。task_lease_acquire.ts:214 的严格解码仍先拒绝非法成员,不能用过滤代替授权。原模块保留相同函数对象;没有第二份规则。
  • todos/work_requirements.ts:93 仅改变词法导入,省略、null、空数组和非法成员拒绝保持;Goal 根路径投影不授予写权限。
  • feedback.py 的 __getattr__ 与 _mutation_adapter 保留原符号对象、star exports 和可 patch 的模块 binding。append_human_reward 先解析两个 adapter,再读 registry 或追加 index;实际写入处仍重新读取 binding,原 TS 栅栏及 index/state 次序不变。模块存在或 dir 可见均不等于写入已获授权。
  • quota/diagnostic_projection.ts:75 的 contextProjectionChanges 在标量对象压缩分支增加 path.length > 0。根对象继续用属性编辑,符合 turn_envelope.py:_apply_context_projection_changes 的非空路径契约;嵌套压缩、数字/source lineage 沿原路径。新增 root oracle 验证可重建视图且不修改 source;File/SQLite CLI 追加的 Explore 断言核实 basis 为 null、source hash 不变。
  • digest guard 仍为既有 action wildcard 构造声明精确数量 1;可见 64-hex matcher 反测仍失败。双语 RFC 只追加非规范证据记录,保留失败、冻结成本和安装采用边界,没有改写规范以迎合实现。

规范依据:docs/architecture/rfcs/monorepo-distribution-split-v0.md,固定修订 efd49352cc087cb299d5f7194cefd95a64b83e95。I2 单 owner、I6 无顺带 schema/私密边界变化、I7 未选择不激活与选择失败闭合,在受影响切片 implemented;I8 以精确来源/数字测试与真实 staged 读取核验本次 transport 修复,不能推成全部模型采用。V1 绑定冷进程/故障注入,V2 绑定实际 File/SQLite 租约及反馈/重规划检查,V3 绑定值、拒绝、导出和 CLI 读回;这些只验收受影响路径。I3 公共 Python 模块搬迁 out_of_scope,旧模块仍是原 owner;原导出绑定保留。I9 的收益边界保留,完整 V10、preset/安装及实际模型采用 deferred 给原 RFC 资格。

当前 Node 24.21.0/macOS:加载/digest/root/source identity 34 PASS,完整类型检查 PASS;新 base/head 的 138 组完整值及错误结果一致。将新增 root oracle 对准未修改基线,正确 FAIL 于空属性路径;当前 PASS。当前反馈与真实 replan/lease/requirements 合并组 51 PASS、2 FAIL,相邻反馈 84 PASS。两项失败都是 selected-Todo 旧测试在第 407 行读取缺失的 selected_todo,不是 Explore 断言失败;同一 16 项命令在不可变 base 与当前 head 的完整详情分别核对并保留,下文没有将其改写为通过。

当前标准 premerge 六项直接检查、19 项选择检查全部 PASS,零失败、跳过或 manual hold。先前 57b 的结果、基线失败以及 root oracle 首次因基线没有新测试文件而未执行的准备结果均保留;后者已改用同一新 oracle 的独立私有测试副本执行,实际基线断言失败,不把“找不到文件”算作回归检出。作者的 PostgreSQL、wheel、最低 Node 和完整 browser 声明未在本轮独立复验,也未查询远端 CI。

对主干的风险 / Risks

未发现当前组合 head 的阻断问题。词法规则搬迁的主要风险是非法 scope 被丢弃后意外扩大授权;138 组差分、原严格调用分支及真实租约 replay/renew/release/complete/readback 支持保持。反馈的风险是纯路径解耦后发生半写入或错过 writer patch;现有 mutation preflight、原 binding 查找、当前 adapter 和相邻反馈测试验证了该边界。根路径修复只限制既有优化的适用位置,不增加 transport 类型或策略分支。

语义与 CI 对齐

复用既有词汇、owner 和属性编辑协议,没有新增状态分类、默认启用或 hidden obligation;原错误与恢复文字没有压缩。两项 selected-Todo KeyError 为同条件基线失败,保留完整身份、详情及环境/夹具证据;不删除断言、不放宽检查。Windows、最低 Node、独立 PostgreSQL/wheel、本机安装采用、模型及完整长期成本仍未验证。主干整合、CQR 和 merge readiness 分别读回;当前通过不代表获准合并。

我的整体评价 / Verdict

APPROVE。 这是 justified_increment:纯调用路径的隔离与可空 staged 读取已通过当前组合验证,父 RFC 的完整资格保持开放。long_horizon 为 preserved,真实 lease/replan 的重放、完成、终态拒绝、原 source hash 与后续 staged 读取保持;user_experience 为 improved,正常纯调用避免不相关适配器缺失的失败,Explore 读取恢复且没有新增确认轮次。视觉检查为 not_applicable,因为没有渲染页面变化;未验证范围为 Windows、最低 Node、独立 PostgreSQL/wheel、安装、模型采用和完整成本。既有词法规则和反馈适配器复用原实现,根节点修复留在原 transport owner,不新增状态、执行器或并行决策。当前边界是纯调用路径的依赖隔离及既有 staged 读取修复,不以模块数或组件批准代替组合验收。未合并。

English verdict: APPROVE — head b26cf57 preserves the selected owners and affected File/SQLite behavior while fixing nullable staged-root transport; inherited failures and broader qualification remain explicit.

@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
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@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.

Self-review of exact head 6ca929ad885b0cda4edb9b2ac7409ed7a7d61fae: PASS.

The latest-main merge completed automatically. Main already contains the feedback-adapter loading changes, so the final PR delta is now 10 files: declaration codec separation, lease consumers, the scalar staged-root transport correction, focused tests, and bilingual RFC evidence.

Exact-head verification passed: 119 Node tests with 1 expected skip; full control-plane TypeScript typecheck; 100 Python feedback/replan/requirements/lease cases. Two selected-Todo cases fail identically on immutable main at the same missing selected_todo assertion, and are explicitly retained as inherited baseline failures. Quick premerge passed all direct checks, semantic-vocabulary, task-lease runtime and public-boundary checks.

@huangruiteng huangruiteng 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.

Independent approval of exact head 6ca929ad885b0cda4edb9b2ac7409ed7a7d61fae.

The latest-main result preserves the validated deferred loading and declaration-codec boundary while correcting scalar staged-root transport. Node, TypeScript, focused Python and quick premerge checks passed. The two selected-Todo failures reproduce unchanged on immutable main and remain explicitly identified rather than waived.

@loopx-agent
loopx-agent merged commit 709ed28 into main Nov 8, 2026
6 of 7 checks passed
@loopx-agent
loopx-agent deleted the codex/small-kernel-scope-loading-20261108T053510 branch November 8, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants