Conversation
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
@huangruiteng The exact-head Python Tests run is blocked by a stale run on an obsolete head.
I attempted to cancel the stale run, but GitHub returned |
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Follow-up after head
@huangruiteng Could you also cancel stale run |
|
Exact-head CI triage for
This branch does not modify either failing test or |
|
Exact-head run
No #4944 code change is warranted from this run; head remains |
|
Final exact-head result for run |
|
The isolated baseline repair #4952 is now green at exact head #4944 remains unchanged at |
|
The isolated baseline repair in #4952 is now green on exact head #4944 remains unchanged at |
huangruiteng
left a comment
There was a problem hiding this comment.
动机
按 Goal instance identity RFC 的 M2 和 #4940,现有仅凭人类可读 goal_id 的 session 绑定无法区分删除前的 A 与同名重建后的 B。本 PR 在新项目显式选择 source_session_v1 时引入源注册表持有的实例身份、别名级事务锁和精确操作收据;M3 效果所有者资格、全局路由及 M4 孤儿恢复仍被明确保留。
改动思路
project register 在发布 v2 envelope 前以 journal 预留实例;bind/unbind 和 recreate 在别名锁与注册表事务内交给 TypeScript 判定 commit/replay/reject,再由 Python 完成文件效果。v2 使用不兼容的 writer protocol 拒绝旧写入,普通 runtime/bootstrap/configure/migration 路径拒绝生命周期专用 profile;返回值仍为 execution_authority: false。这符合源注册表是身份权威、M2 不能提前开放执行的边界。v1/legacy codec、事务与文件锁得到复用;新增模块的体量虽大,但覆盖了同一个可独立验证的本地生命周期。
具体改动
registry_codec.py增加 v2 envelope 和专用事务;project.py/registry.py接入显式注册、精确绑定/解绑、重建和只读解析。多个既有入口加入 v2 拒绝,I/O census 和双语 RFC 更新相应契约。source_session_lifetime.ts定义精确 GoalRef 与绑定/重建判定;Python registration、binding、recreation 与 registry-state 模块实现 journal、收据、锁和原子提交。新增真实 CLI/崩溃/并发/ABA、codec、拒绝路径和 TypeScript 测试。- 我在 exact head
44f4828520ea4f196d97474b68ade8a88a7df415跑了 35 个聚焦 Python、17 个 TypeScript、71 个旧项目路径测试,TypeScript typecheck、Ruff、与最新main的无冲突合并树,以及 19/19 premerge 检查均通过。按 Goal 的wait_for_ci=false,没有把远端 CI 当作本次结论的证据。
对主干的风险
[P1] 已发布创建收据的精确重放仍依赖可变的当前 Goal/状态文件。 source_session_registration.py 的 existing_receipt 分支在找到同一 operation_id 和请求摘要后,仍要求当前 Goal 是原始 A(第 314–323 行),并用最初渲染的状态文本检查现存文件(第 325–328 行)。我用真实临时文件和 CLI 复现两种情况:注册 A、重建为 B 后重试原注册,返回 “creation receipt does not match current Goal”;注册后给状态文件增加正常进展再重试,返回状态冲突。两次收据都仍存在,源注册表未发生新写入,但响应丢失后的调用者无法取得原操作结果。这与 M2 的精确操作收据/重放退出条件不符,也与本 PR 的 bind/recreate 先检查收据再判断当前实例的规则不一致。
建议把首次发布时的 state 冲突校验与已提交收据的重放分开:重放返回不可变的原收据、不覆盖后续状态;如需要,让结果明确标示当前实例已变化。补上“注册 A→重建 B→同 operation_id 重试”和“注册后状态内容更新→同 operation_id 重试”的真实 CLI 零写入回归,再复跑 M2 与旧路径测试。另一个面向下一次改动的小型重构是将创建的首次发布检查和 receipt-first replay 在现有 registration owner 内明确拆开;无需在此引入更广泛的 TS 迁移。
我的整体评价
M2 的 ABA、锁序、崩溃恢复和默认关闭边界有扎实的局部实现与验证;但精确重放是此阶段承诺的核心恢复语义,上述可复现缺口需要在当前 PR 修复,因此请求修改。即使修复后,本 PR 仍是控制平面行为变更,应由维护者在新 head 复审后决定合并,不能因为本地检查通过而自合并。
English verdict: REQUEST_CHANGES - exact head 44f4828; delayed creation replay fails after A-to-B recreation or legitimate state progress despite a retained receipt. Focused Python/TS/legacy suites and 19/19 premerge checks passed; add receipt-first no-write replay regressions.
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Addressed the requested receipt-first replay fix at exact head
Validation on this head:
The branch remains unmerged. I will sync the maintainer's Node-floor baseline change only after #4960 lands in |
Goal And Delivered Outcome
source_session_v1profile now publishes immutable Goal instance identity before registry exposure; bind, unbind, and A-to-B recreation share an alias-scoped guard and exact operation receipts; stale A cannot mutate B. Registration rejects unknown v2 profiles, orphaned state without its journal, and competing reservations.main@eb16c54; the PR diff contains only the M2 source-session slice.Scope And Continuation
execution_authority: false, generic runtime paths reject the profile, and legacy/v1 behavior remains available through its existing commands.Validation
44f4828520ea4f196d97474b68ade8a88a7df415real_entrypointpassedtests/cli_commands/test_source_session_lifetime.py: 20 real CLI cases cover fresh v2 registration, exact bind/unbind, A-to-B recreation, paused stale-A ABA rejection, exact-byte rollback, replay, capacity, operation conflicts, missing journals, process death, and lock ordering.unitpassedrecoverypassedconcurrencypassedintegrationbaseline_blockedauthority_source.test.ts. The focused M2 suite passes, and the mismatch reproduces on cleanmain.staticpassedgit diff --checkpassed.staticpassedloopx canary premerge --from-git-diff --git-diff-base origin/main: 19/19 selected checks passed, with no failures, warnings, or manual holds;self_merge_allowed=false.staticfailedautomatic-execution-admission-v0.mdmirror failure; this PR does not modify that RFC.See validation disclosure guidance.
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
loopx_project_registry_envelope_v2/goal_instance_v2source-session registry with bounded exact receipts.Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).