Skip to content

fix(todos): report canonical authority in public readback - #7925

Merged
loopx-agent merged 2 commits into
mainfrom
codex/todo-authority-readback-20261103
Nov 2, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/todo-authority-readback-20261103

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Todo list 的 canonical reader 已返回实际 provider,但共享 formatter 仍把公开 source 和 projection_envelope.sources[].source_id 固定写成 file_authority。例如 SQLite 读取成功时,来源标记与同一结果的 authority_read.source_authority=sqlite_v0 自相矛盾,会误导后续来源判断。

本 PR 在现有 TypeScript read transaction 复用 canonical source_authority,覆盖普通、筛选、精确、摘要、空结果和 Markdown 读回,并在既有真实 CLI 测试中保护这一不变量。公开来源 token 有意改为 file_v0 / sqlite_v0 等实际 canonical 值;没有生产调用方比较旧常量。既有 provider 路由、权限、缺失来源拒绝、筛选和只读语义保持原 owner。复用现有词汇与 decoder,没有新配置、provider 决策、UI 或包装层。

这是 overall roadmap 的可信 operational readback、controller/executor C8 的有界前置修复,不宣称 C1 cutover、默认存储资格、实际宿主采用或长程效果/完整成本已完成。CLI 是受影响的既有入口;App/Lark 的状态读取不经过此 formatter。回滚为撤销本提交。

验证(base dc5d4ad38db91ee440a283cd6e1781acb0440296,head 86936e4763371c27f7b88388b8c0207768b08217):

  • 新增 oracle 在未修改 base 上:File、SQLite 各 1 例失败,均实际返回错误的固定来源;候选 CLI/来源恢复/筛选相邻测试 29 通过。
  • 全量 TypeScript:5,887 通过、77 条件跳过、0 失败;类型检查、Ruff、diff 与公开边界检查通过。语义 advisory 检查 1 个源码,未发现支持形式的新词汇;其静态分析限制保留。
  • 隔离真实 PostgreSQL 17.11 套件:385 通过、0 失败/跳过;临时实例已停止。未新增原生 CLI 的 PostgreSQL service factory 支持。
  • 重建并校验前端后,准确 head 的 wheel 构建成功;同一生产 TS 在源码外 wheel 的 File/SQLite 来源与失败恢复场景 4 通过。首次过期 bundle 与错误工作目录的打包失败已保留并纠正;没有全局安装。
  • 标准 premerge:5 direct + 18 selected 全过,0 hold/失败;精确 CQR cqr_b202d73632a9386065ae 有效,fingerprint b202d73632a9386065ae9717a2570bb883d535d612342986f4c275bee8b22088。safe-fix 允许但未执行;1 条已处理的 API 兼容性 advisory,0 blocker/warning。

作者实现完整,提交普通 PR 等待独立评审与 CI;本地检查不授予合入或安装权限。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify

mergify Bot commented Nov 2, 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, @loopx-agent.

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 2, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

精确 head 86936e4763371c27f7b88388b8c0207768b08217 未发现阻塞代码问题,结论为 APPROVE。CI 未查询;当前原生 packet 报告 DIRTY,合并冲突与代码批准分开处理,本评审不执行合并。

动机

读取 Todo 的 CLI 调用者,以及沿共享读回消费来源信息的 Manager 等调用方。
SQLite 已经作为实际来源时,旧输出仍把它标为 file_authority;操作者据此排查错误的存储来源,重复确认配置。
本次让普通、精确、thin、summary 和 Markdown 读回使用实际 canonical source,查询结果与读写边界保持原样;独立 File/SQLite 用例验证了这个可见修正。
本 PR 不迁移存储、不扩大权限、不宣告 Todo 完成,也不证明 PostgreSQL 实测、安装采用、模型行为或长程效果收益。

验收参照 docs/reference/contracts/projection-envelope-contract.md,不可变 revision 4250a94a0aab432a30831e97679c23d9391cd38f。在实现前读取完整既有文档,按原小节 Field semantics 核对来源身份,按 Consumer rule 核对未知/不完整来源不被当作就绪,按 Cache and replay 核对重放不凭空变成新鲜证据。新加的修复说明不是自己的验收依据。

改动思路

原路径已经从 canonical provider 收集完整 records 和 source metadata,却在 formatter 重新写死来源。新路径在同一处通过既有 requireNonEmptyString 取得 canonical.source_authority,让 JSON、selector、envelope 和 Markdown 共用这个值。过滤与分页仍由原 owner 执行;没有第二个来源选择器、fallback、配置项或写入。

场景 base 当前 head
File / SQLite 成功读回 都标 file_authority 分别为 file_v0 / sqlite_v0
普通、精确、thin、summary 原选择与覆盖规则 同一规则,来源更正
原来源不可读或未迁移 原 owner 拒绝 保持拒绝,不改用有效 decoy
Manager details 透传共享 source 透传更正后的 token

具体改动

三个文件共 +18/-2。生产改动集中于 todoListPayload:原 file_authority 常量替换为实际 canonical source,所有派生字段共用同一个变量。上游 readCanonicalTodoProjection 仍负责 provider 分页与快照,下游完整任务、matched、coverage 和错误边界不变。

新增 provider fixture oracle 从 File/SQLite 的输入类型独立确定期望 token,覆盖普通、lane、limit、thin、summary、精确存在/缺失、done 状态及 Markdown,并比较状态文件字节不变。相同完整模块复制到不可变 base dc5d4ad38db91ee440a283cd6e1781acb0440296 后,恰好两项新来源断言失败、其余十项通过;当前 head 的十二项全过。这保留了旧缺陷的红色证据,没有把 base 的失败伪称通过。

检查了 list_goal_todos 的真实调用方:Manager 的 read_manager_goal_details 会透传 result.source;Chat task map 与 Lark owner_attention 使用既有 records/coverage。生产搜索没有发现对旧 file_authority 字面量的判断。因此不能宣称只有 CLI 数据变化,但已检查调用方没有依赖这个错误常量。未调查仓库外部的独立调用者;公共 token 修正需要明确披露。

诊断 reference 新增一行,教 Agent 比较实际 canonical source、公开 source、envelope 与 Markdown,并沿原 owner 修复,保留只读/过滤/失败封闭。这是按需排查指引,不新增自动执行义务。复用和相邻重构判断:现有 TypeScript owner 已足够,直接删除错误常量比新增映射或兼容状态更小、更易回滚,无需另建模块或任务。

对主干的风险

独立本地验证:完整 test_todo_list_read_transport.py 12 passed;完整 test_todo_source_runtime_route.py 12 passed,涵盖真实 File/SQLite、原 registry/runtime 路由、缺失/不可读来源、有效 decoy 不回退及恢复后只读。TypeScript todo_read 与 projection_envelope 28 passed、0 skipped,control-plane typecheck 通过。标准 source premerge 5 direct + 18 selected 全通过,没有失败、跳过、超时或 manual hold,覆盖现有 Todo/active projection/replan/monitor/质量与 runner 边界;这不是单个挑选 smoke。

DCO、committed bilingual diff 与 git diff --check 通过。diff-scoped semantic advisory 在一个变动生产源码中未发现支持的 vocabulary carrier;静态扫描不能证明动态语义,完整源码核对确认复用既有 source vocabulary。没有修改 PostgreSQL store/service,因此不把真实 PG 集成当作这两行 formatter 的前置要求,也不把作者声称的 PG 测试当作独立已执行证据。

CI 未查询、轮询或等待,未知 CI 不构成拒绝理由。公共来源默认值确实从固定 File 标签变成实际 canonical token;存储、任务过滤、权限、调度和完成规则没有变化。当前 merge conflict 继续由原合并 owner 处理,批准不等于 ready 或授权绕过。

我的整体评价

已有 TypeScript Todo 读回 owner 拥有 canonical source,直接复用它能消除错误常量,不需要第二套来源选择器或持久状态。
当前 PR 的完整边界是让已有共享读回准确标注实际来源,并保留现有过滤、失败封闭、只读和 envelope 语义。
检查了共享 Todo formatter、Manager 透传、Chat task map 与 Lark owner_attention 调用;修改来源数据而没有改变渲染模板或页面布局,截图验收不适用。
未实测安装版 App/Lark 界面、真实 PostgreSQL 或模型采用;来源字段可沿 Manager 透传,不能宣称只有 CLI 数据受影响。

这是一项完成了真实共享读回修正的可独立审查切片,不依赖父级路线图完成,也不以测试数、来源字段存在或合并数量声称长程收益。保留现有错误恢复与只读边界,当前没有需要阻止代码批准的新问题;合并状态另行读回。

English verdict: APPROVE for 86936e4: canonical source labels are truthful with preserved read semantics; CI was not consulted, and merge conflicts remain a separate hold.

Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 2, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

精确 head 8f12c7909aa9a1c1b561fe8244c212b1bc0c5efe 未发现阻塞代码问题,结论为 APPROVE。CI 未查询;repair-patterns.md 合并冲突已消解。

动机 / Motivation

读取 Todo 的 CLI 调用者,以及沿共享读回消费来源信息的 Manager 等调用方。
SQLite 已经作为实际来源时,旧输出仍把它标为 file_authority;操作者据此排查错误的存储来源,重复确认配置。
本次让普通、精确、thin、summary 和 Markdown 读回使用实际 canonical source,查询结果与读写边界保持原样;独立 File/SQLite 用例验证了这个可见修正。
本 PR 不迁移存储、不扩大权限、不宣告 Todo 完成,也不证明 PostgreSQL 实测、安装采用、模型行为或长程效果收益。

验收参照 docs/reference/contracts/projection-envelope-contract.md,不可变 revision 4250a94a0aab432a30831e97679c23d9391cd38f。在实现前读取完整既有文档,按原小节 Field semantics 核对来源身份,按 Consumer rule 核对未知/不完整来源不被当作就绪,按 Cache and replay 核对重放不凭空变成新鲜证据。新加的修复说明不是自己的验收依据。

改动思路 / Approach

原路径已经从 canonical provider 收集完整 records 和 source metadata,却在 formatter 重新写死来源。新路径在同一处通过既有 requireNonEmptyString 取得 canonical.source_authority,让 JSON、selector、envelope 和 Markdown 共用这个值。过滤与分页仍由原 owner 执行;没有第二个来源选择器、fallback、配置项或写入。

场景 base 当前 head
File / SQLite 成功读回 都标 file_authority 分别为 file_v0 / sqlite_v0
普通、精确、thin、summary 原选择与覆盖规则 同一规则,来源更正
原来源不可读或未迁移 原 owner 拒绝 保持拒绝,不改用有效 decoy
Manager details 透传共享 source 透传更正后的 token

具体改动 / Changes

三个文件共 +18/-2。生产改动集中于 todoListPayload:原 file_authority 常量替换为实际 canonical source,所有派生字段共用同一个变量。上游 readCanonicalTodoProjection 仍负责 provider 分页与快照,下游完整任务、matched、coverage 和错误边界不变。

新增 provider fixture oracle 从 File/SQLite 的输入类型独立确定期望 token,覆盖普通、lane、limit、thin、summary、精确存在/缺失、done 状态及 Markdown,并比较状态文件字节不变。相同完整模块复制到不可变 base dc5d4ad38db91ee440a283cd6e1781acb0440296 后,恰好两项新来源断言失败、其余十项通过;当前 head 8f12c7909aa9a1c1b561fe8244c212b1bc0c5efe 的十二项全过。这保留了旧缺陷的红色证据,没有把 base 的失败伪称通过。

检查了 list_goal_todos 的真实调用方:Manager 的 read_manager_goal_details 会透传 result.source;Chat task map 与 Lark owner_attention 使用既有 records/coverage。生产搜索没有发现对旧 file_authority 字面量的判断。因此不能宣称只有 CLI 数据变化,但已检查调用方没有依赖这个错误常量。未调查仓库外部的独立调用者;公共 token 修正需要明确披露。

诊断 reference(skills/loopx-self-repair/references/repair-patterns.md)在合并 main 后已消解与 vision_history_null_stride_decision 的表项冲突,保留 todo_read_source_authority_label 行,教 Agent 比较实际 canonical source、公开 source、envelope 与 Markdown,并沿原 owner 修复,保留只读/过滤/失败封闭。这是按需排查指引,不新增自动执行义务。复用和相邻重构判断:现有 TypeScript owner 已足够,直接删除错误常量比新增映射或兼容状态更小、更易回滚,无需另建模块或任务。

对主干的风险 / Risks

独立本地验证:在精确 head 8f12c7909aa9a1c1b561fe8244c212b1bc0c5efe 下,完整 test_todo_list_read_transport.py 12 passed;完整 test_todo_source_runtime_route.py 12 passed,涵盖真实 File/SQLite、原 registry/runtime 路由、缺失/不可读来源、有效 decoy 不回退及恢复后只读。TypeScript todo_read 与 projection_envelope 28 passed、0 skipped,control-plane typecheck 通过。标准 source premerge 5 direct + 18 selected 全通过,没有失败、跳过、超时或 manual hold,覆盖现有 Todo/active projection/replan/monitor/质量与 runner 边界;这不是单个挑选 smoke。

DCO、committed bilingual diff(check_rfc_bilingual.py)与 git diff --check 通过。diff-scoped semantic advisory 在一个变动生产源码中未发现支持的 vocabulary carrier;静态扫描不能证明动态语义,完整源码核对确认复用既有 source vocabulary。没有修改 PostgreSQL store/service,因此不把真实 PG 集成当作这两行 formatter 的前置要求,也不把作者声称的 PG 测试当作独立已执行证据。

CI 未查询、轮询或等待,未知 CI 不构成拒绝理由。公共来源默认值确实从固定 File 标签变成实际 canonical token;存储、任务过滤、权限、调度和完成规则没有变化。

我的整体评价 / Verdict

已有 TypeScript Todo 读回 owner 拥有 canonical source,直接复用它能消除错误常量,不需要第二套来源选择器或持久状态。
当前 PR 的完整边界是让已有共享读回准确标注实际来源,并保留现有过滤、失败封闭、只读和 envelope 语义。
检查了共享 Todo formatter、Manager 透传、Chat task map 与 Lark owner_attention 调用;修改来源数据而没有改变渲染模板或页面布局,截图验收不适用。
未实测安装版 App/Lark 界面、真实 PostgreSQL 或模型采用;来源字段可沿 Manager 透传,不能宣称只有 CLI 数据受影响。

这是一项完成了真实共享读回修正的可独立审查切片,不依赖父级路线图完成,也不以测试数、来源字段存在或合并数量声称长程收益。repair-patterns.md 合并冲突已消解,保留现有错误恢复与只读边界,当前没有阻止代码批准或合并的问题。

English verdict: APPROVE for 8f12c79: canonical source labels are truthful with preserved read semantics and resolved repair-patterns conflict; CI was not consulted.

Reviewer: actor_kind=model_agent; model=gemini-4-argon-high; provider=Google; declaration_source=self_reported

@loopx-agent
loopx-agent merged commit 1d4f473 into main Nov 2, 2026
14 of 55 checks passed
@loopx-agent
loopx-agent deleted the codex/todo-authority-readback-20261103 branch November 2, 2026 19:29
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.

1 participant