Repository navigation
fix(coordination): inspect retained Todo contracts without write authority - #8806
CharleoYang wants to merge 5 commits into
Conversation
Signed-off-by: Qi Yang <yangqi45@meituan.com>
Signed-off-by: Qi Yang <yangqi45@meituan.com>
…e authority Signed-off-by: Qi Yang <yangqi45@meituan.com>
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. 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 HEADFor a same-repository clone whose Keep the DCO |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
评审提交 38091aba6aecd2267c2b35252ff222000218e2fe。与当前主干比较的共同基点为 1965965992fffa1a1cca1a18cb297860155bc133。
动机 / Motivation
需要核查保留 Todo 的操作者必须能够准确读回当时的任务、评审与收据,检查本身不能授予执行权限。 用 File 和 SQLite 各复现 canonical/domain 的历史读回,并对照公开发布 wheel、严格执行分支和同源完整正文请求。 普通精确 CLI 能读回新支持的样本,且不改存储。完整正文适配器会替换原题名并重写 domain schema;Manager 用原题名搜索漏掉同一条待办。 源码验证覆盖 File/SQLite、已有 Manager 读取函数及下载包里的正式清单。PostgreSQL 与安装前端/Lark 尚未实跑,当前主干和此 head 合并时还有一处 TS 测试冲突。
同源查询已经可只读,实际新支持版本的来源以及完整正文和搜索的一致性仍待补足。
改动思路 / Approach
继续用现有 canonical 快照和约束校验,从同一 revision 取源记录。展示分支在选中后复用同一次原值回填。 只读检查复用已持久化声明、排序、摘要和计数。保留现有写入规则以免为读旧记录引入历史执行分支。 改动限于 Todo 本地权威快照的读取路径。迁移、领租约与写入继续由已有严格 decoder 决定。
具体改动 / Changes
实际 8 文件、+446/-17。快照、声明验证与列表恢复是生产路径。其余是直接可复现的双库测试和只读说明。 候选新增只读约定 验收约定
关键代码讲解
-
按原有 schema 识别有序声明 retainedTodoReadFields
-
列表只在当前 provider 快照的身份和 revision 下读取记录 canonicalTodoCollection
-
仅有 list query 且无 read_pipeline 才启用保留读取 readCanonicalTodoProjection
-
只在非 full_text 分支恢复源字段 todoListPayload
-
frozen-contract-source。认可的冻结声明要对应可核查的历史 writer。 具体差距见风险段。
-
one-provider-revision。在同一个 provider 快照完成声明、完整性和原 ID 检查。 候选真实 CLI 按 ID 读 File/SQLite × canonical/domain,保留 archived 证据/回执和 active 依赖/暂停评审,未写入或退回 Markdown。
-
read-only-authority。历史读取不扩大默认承认范围或引发迁移、写入和执行。 篡改声明顺序、计数、摘要或必需类型拒绝。保留快照通过有限精确读取,但 quota、执行准备、canonical summary 和 mutation prepare 拒绝,provider head 与原回执不变。
-
preserve-original-selected-fields。精确读取和同源正文消费保留已选定原记录。 具体差距见风险段。
对主干的风险 / Risks
[P2] 核对冻结声明的发布来源。 对照官方 wheel(SHA-256 已与发布资源核对)和 7445ae3。真实清单是 canonical 70/domain 68,测试自称 release 1.3.1 的 91/89 多 21 字段,例如 depends_on_todo_ids、review_gate_paused、retirement_receipt_id。用官方清单构建的 File/SQLite × 两种结构四项在当前主干全过。 提供真实 91/89 字段声明的不可变 writer 版本或生成的脱敏快照,按真正来源命名并构造独立 oracle。若目标是正式 v1.3.1,改用其清单并说明现有兼容为何仍有缺口。 相关代码
[P2] 完整正文读取要保留同一源记录。 两库四组,精确读加 full_text 后存储 title 被首行重算,domain 另变成 todo_item_v0,仍声明 source_complete。真实 Manager 非精确搜索使用原题名均返回 0,以同条正文检索各返回 1。所有对照在同一权威 revision,Markdown 与持久化内容相同。 在既有作用域选择后,对 retained 精确读取无论 full_text 是否打开都回填同一源记录。用于搜索的完整正文行要保留原题名,继续复用现有范围、不可见字段过滤与严格执行读取。 相关代码
正式发布包 · 标签下的清单 · Manager 的完整正文调用
候选列表与快照 Python 34 过、限定 TS 46 过,本地 quick premerge 通过。当前 main 合入预演在 coordination_runtime_shadow.test.ts 有冲突。GitHub CI 按本轮策略未取;完整 suites/PG 和安装资格未得出。
语义与 CI 对齐
读写隔离、已知声明匹配和默认拒绝在所测生产路径有效。需要核实新的兼容范围,并让完整正文消费遵守同一源信息的只读约定。
我的整体评价 / Verdict
REQUEST_CHANGES。 普通精确 CLI 读取和严格执行隔离已通过。请提供冻结声明的真实来源,并修正完整正文和标题搜索的保留字段。当前主干合并冲突也需随新头处理。
English verdict: REQUEST_CHANGES at 38091ab. Retained CLI inspection is read-only in the tested paths. The 91/89-field fixture does not match the published v1.3.1 manifests, and full-body reads rewrite fields that exact inspection promises to preserve.
| # Exact retained coordination_state_contract_v0 declaration; inspection only. | ||
| # Keep it literal: deriving it from the current contract would let a removed | ||
| # historical obligation disappear from this regression. | ||
| _RELEASE_131_TODO_FIELDS = ( |
There was a problem hiding this comment.
[P2] 核对冻结声明的发布来源。 对照官方 wheel(SHA-256 已与发布资源核对)和 7445ae3。真实清单是 canonical 70/domain 68,测试自称 release 1.3.1 的 91/89 多 21 字段,例如 depends_on_todo_ids、review_gate_paused、retirement_receipt_id。用官方清单构建的 File/SQLite × 两种结构四项在当前主干全过。 提供真实 91/89 字段声明的不可变 writer 版本或生成的脱敏快照,按真正来源命名并构造独立 oracle。若目标是正式 v1.3.1,改用其清单并说明现有兼容为何仍有缺口。
| (row.archive_state ?? "active") === (item.archive_state ?? "active")); | ||
| if (matching.length !== 1) throw new Error("Todo detail cannot recover an unambiguous full source body"); | ||
| item.text = String(matching[0]!.text ?? ""); | ||
| if (retainedTodoReadFields(requireJsonObject(canonical.todo_read_model, "Todo read model")) !== undefined) { |
There was a problem hiding this comment.
[P2] 完整正文读取要保留同一源记录。 两库四组,精确读加 full_text 后存储 title 被首行重算,domain 另变成 todo_item_v0,仍声明 source_complete。真实 Manager 非精确搜索使用原题名均返回 0,以同条正文检索各返回 1。所有对照在同一权威 revision,Markdown 与持久化内容相同。 在既有作用域选择后,对 retained 精确读取无论 full_text 是否打开都回填同一源记录。用于搜索的完整正文行要保留原题名,继续复用现有范围、不可见字段过滤与严格执行读取。
|
Follow-up patch preserved and pushed to branch
Ready to be folded into #8806 once #8806 is rebased on |
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ained-todo-reads Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
维护者通过 Todo list、精确详情和 Manager 搜索读取历史保留任务。 原读取承认 v1.3.1 的声明,但底层选择后的投影会重算原题名或将 domain 记录转为当前 schema。 生产 reader 额外硬编码 91/89 字段宣言,但当前提案仅用手工构造的记录证明该分支。与当前主干可达的 35 个 canonical manifest 源版本逐一比较,最长 72 字段,没有一版发出这份有序宣言。真实 v1.3.1 的 70/68 声明在旧源码即能进入读取,四组旧失败分别是标题或 domain schema 被重写。新代码的投影修复独立解决了这四组失败。 修订在选定的同一 provider revision 恢复真实旧记录,并另增一组读取兼容分支。 本轮覆盖源码中的只读查询与回执;不涉及持久数据迁移或安装态验收。
改动思路 / Approach
复用同一权威快照、分页和作用域选择。新增读取分支只对普通 list-query opt-in 生效。 先交付真实版本记录的无损只读。新增保留格式需要可核对的实际写入者。 保留已验证的同源投影修复。给 91/89 读适配绑定实际写入版本或经脱敏的不可变持久声明,再用同一真实读口复验;若暂无可核实来源,暂缓这组生产兼容分支。
具体改动 / Changes
逐项检查当前头 1bb71e5 和 merge base c563a47,7 个文件,+494/-23。完整七文件增量覆盖声明、快照、只读传输及 File/SQLite 的投影与严格输入控制。 评审依据为 c563a47。 目标规范
关键代码讲解
retained-declaration-source选择唯一批准进入额外兼容的字段声明。 消费声明released-record-fidelity按已选中的同一记录恢复完整字段与标题。 list 投影read-only-authority保留查询和执行准备的独立验证,并核对源 revision。
对主干的风险 / Risks
[P2] 给新增 91/89 兼容声明补真实写入证据。 生产 reader 额外硬编码 91/89 字段宣言,但当前提案仅用手工构造的记录证明该分支。与当前主干可达的 35 个 canonical manifest 源版本逐一比较,最长 72 字段,没有一版发出这份有序宣言。真实 v1.3.1 的 70/68 声明在旧源码即能进入读取,四组旧失败分别是标题或 domain schema 被重写。新代码的投影修复独立解决了这四组失败。 保留已验证的同源投影修复。给 91/89 读适配绑定实际写入版本或经脱敏的不可变持久声明,再用同一真实读口复验;若暂无可核实来源,暂缓这组生产兼容分支。 永久维护两个手工对齐的声明会使兼容边界独立于实际持久生产者。
候选头八组 File/SQLite × canonical/domain × 字段宣言全部通过,把真实版本和合成版本区分开。已选记录的原题名、domain schema、归档来源和票据保持可读;Manager 可按原题名查到记录。 20 项 Python、24 项 TS、类型检查和 Ruff 通过。 标准预合并执行 5 项直接检查和 17 项选中检查,失败命令 0。 未运行远端 CI、完整仓库和真 PostgreSQL 服务。 严格资格状态为 quality_receipt_missing。
我的整体评价 / Verdict
请求修改。复用同一权威快照、分页和作用域选择。新增读取分支只对普通 list-query opt-in 生效。 先交付真实版本记录的无损只读。新增保留格式需要可核对的实际写入者。 当前尚缺 91/89 声明的可复核生产来源;真实旧版本数据保真问题已解决。 以原有投影修正作为有价值的独立切片,收窄额外兼容声明。
English verdict: REQUEST_CHANGES at 1bb71e5. Preserve the verified v1.3.1 fidelity fix. The additional 91/89-field production compatibility rule has only synthetic coverage; tie it to a real immutable producer or leave that rule out of this slice.
|
|
||
| // Frozen retained declaration, not an extension of the executable contract. | ||
| // Inspection preserves these fields without assigning their old execution rules. | ||
| const RETAINED_TODO_FIELDS = Object.freeze(( |
There was a problem hiding this comment.
[P2] 生产 reader 额外硬编码 91/89 字段宣言,但当前提案仅用手工构造的记录证明该分支。与当前主干可达的 35 个 canonical manifest 源版本逐一比较,最长 72 字段,没有一版发出这份有序宣言。真实 v1.3.1 的 70/68 声明在旧源码即能进入读取,四组旧失败分别是标题或 domain schema 被重写。新代码的投影修复独立解决了这四组失败。 保留已验证的同源投影修复。给 91/89 读适配绑定实际写入版本或经脱敏的不可变持久声明,再用同一真实读口复验;若暂无可核实来源,暂缓这组生产兼容分支。
Problem
todo listrejects a retained canonical Todo store when its pinned read-model declaration differs from the current declaration, even when the original records, ordering and digest are intact. Inspection should preserve those records without treating their historical fields as current execution authority.Root cause
CoordinationProjectionRead.validateTodoReadModel()recognizes current and additive historical contracts, but not the exact retained canonical/domain declarations exercised here. List reads share that validation boundary with execution-facing consumers, so globally relaxing it would also relax writers.建议修法(为什么是这个修法)
Keep validation strict by default. Admit only two exact frozen retained declarations through an internal inspection opt-in used by list-query transport. Preserve the original record fields after selection; do not rewrite the store or replay a historical execution engine. This is a read-only compatibility slice, not a completed migration or restored historical write semantics.
Change
Evidence
Current-head full Python, full control-plane TypeScript, TypeScript typecheck, configured Python mypy and Todo-adapter mypy qualification are pending. The full TypeScript run includes isolated real PostgreSQL store/service/remote/archive coverage. This PR is not merge-qualified until those results and independent review are recorded.
The red-first and focused observations are recorded in the change history below; they do not substitute for the full current-head gate.
变更历史(逐轮)
canonical_snapshot_projection_invalidand field-contract mismatch.openLocalAuthorityStore; retain the active exact-read scope and every assertionnode --no-warnings --experimental-sqlite --experimental-strip-types --test --test-concurrency=1 tests/control_plane_ts/coordination_projection.test.ts: 22 passed, 0 failed, 0 skipped.Review 历史(逐轮)
Review status
Independent review and complete cumulative regression qualification are pending. Not merged. No approval or execution authority is implied by historical readability.
Not covered
Maintainer update
Head
1bb71e5780e0ece776715fff9d9e0499c1f77f62integratesmainatc563a473d845af6f23f9245c3af242ad505c393band preserves the original commits on this PR. GitHub reports the new head as mergeable.The new head passed 28 focused Python tests, 48 TypeScript tests, the control-plane typecheck, Ruff and the seven-path public-boundary scan.
The standard diff-selected premerge run passed all 17 checks. The first run timed out on the vocabulary smoke, which passed standalone and on the standard rerun. Full repository regression qualification and independent review of this head remain pending.