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 |
huangruiteng
left a comment
There was a problem hiding this comment.
动机
在 #4940 的 M2 范围内,为新建 source-session Goal 建立不可变实例身份。旧方案仅看当前 Goal/alias 时,A 创建后重建为 B,再重放 A 的创建操作会被当前状态误判;这不是扩大到存量 Goal 迁移的授权。本次评审固定在 62376c0。
改动思路
source_session_v1 只对全新项目显式启用。TypeScript 的 typed decision 负责 bind/unbind/recreate 合法性;Python 在 alias 级锁和严格 v2 registry transaction 下完成 journal、state、registry 写入及回读。创建操作优先按 operation id + request digest 查历史 receipt,再判断当前可变 Goal,因此 A→B 后的 A 重放仍返回原 A 的 GoalRef,不会再建实例或改写 B。通用 v1 writer 明确拒绝 v2 profile。
具体改动
注册、绑定、重建分别落在 source_session_registration、source_session_binding、source_session_recreation;registry codec/transaction 与 connect/CLI/TS effect handler 接入新 profile;双语 M2 RFC、生成的 IO manifest、Python CLI/拒绝用例和 TypeScript transition 用例同步覆盖。新状态是实例 id、绑定与操作 receipt;journal 只承担崩溃恢复,不是第二套决策权。相关的前瞻性重构已把规则留在 typed TS 边界、文件效果留在 Python 的相邻服务,未另造泛化框架。
对主干的风险
主要风险是 alias 重用、旧实例误命中新实例以及 v1/v2 registry 混读。精确 receipt 重放、retired-instance 拒绝、schema/profile 隔离和无效果回读覆盖了这些路径。代码体量较大(28 文件,+3953/-170),但属于完整的 M2 fresh-only 生命周期;M3–M5 和存量迁移仍是显式未交付边界。首次 Python 汇总运行有 1 个子进程 barrier 的 10 秒超时;该单项重跑通过,完整套件重跑 43/43 通过,故保留这一波动记录。未触碰真实活跃 Goal,亦未按当前 review 契约查询远端 CI。
我的整体评价
APPROVE 此精确 head 的 fresh-only M2 增量,不将其解释为存量迁移或执行权限开放。Python 43/43、TypeScript 17/17、TS typecheck、Ruff 及风险 canary 19/19 通过,未见阻断性发现;公开/私有边界与默认关闭路径已核对。此批准不等于合并授权:这是控制面/持久状态变更,留给维护者按 exact-head 门槛合并。
English verdict: APPROVE - 62376c0; receipt-first A-to-B replay and fresh-only v2 isolation verified; 43 Python, 17 TypeScript, typecheck, Ruff and 19 canaries passed. Maintainer merge required.
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).