fix(control-plane): reuse canonical lease digest matcher - #5377
Conversation
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Exact-head CI confirms the digest-owner fix: all three |
|
Final exact-head update for @cocolord @huangruiteng please review this exact head when available. No merge action was taken. |
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Synced with Focused validation on the new exact head: |
huangruiteng
left a comment
There was a problem hiding this comment.
动机
这个修改修复了工作树租约校验引入的确定性主干回归:工作区解析器复制了裸 SHA-256 正则,触发已有的“单一定义源”检查。我在不可变父提交复现了同一处失败,也验证了当前提交确实移除重复定义。这是完整的维护修复;它本身不代表管家派发、协作或结果回传的产品旅程已经完成。
改动思路
保持工作树身份解析和租约准入各自的原有职责,仅让摘要形状回到既有 content_digest.ts。输入仍先检查字段集合与三个摘要,再检查仓库标识,最后由既有租约逻辑决定所有权和重叠处理。没有新增权限、配置、执行器或迁移分支,也没有用测试豁免掩盖重复定义。既有 API、持久化形状、错误次序和用户操作步骤均保留。
具体改动
关键代码讲解
leaseWorkspace(工作区模块第 23 行)仍接收空值或完整的四字段身份。第 27 行把局部正则换成规范 matcher;额外字段、缺少字段、非字符串及非法摘要仍先报身份错误,随后才进入仓库校验。实际消费者是租约获取决策里的准入、重放与工作树关系判断。BARE_SHA256_PATTERN(摘要模块第 3 行)已经定义锚定的 64 位小写十六进制形状。它不带g或y,重复调用不会产生lastIndex状态。这个定义没有修改;新增消费者直接复用它。CANONICAL_CONSUMERS(检查模块第 87 行)新增工作区解析器路径,要求其实际导入并使用规范 owner。它没有把该文件列为豁免;包级检查仍会拒绝任何新出现的等价重复摘要正则。共 2 个文件,3 行增加、1 行删除。
对主干的风险
最需要排除的是共享正则带来隐含状态或输入语言变化。我用相同合成语料分别运行父提交和当前提交的真实 TypeScript 解析器及租约决策:54 组完整结果逐字一致,没有归一化。语料覆盖合法身份、重复调用、63/65 位、大小写、前缀、空白、Unicode、错误字段、复合错误次序,以及同树、兄弟树、未知身份、其他主机和所有权拒绝。原始缺陷检查在父提交为 16 通过、1 失败,当前完整 TypeScript 套件为 3564 通过、0 失败;31 个外部环境相关用例按原有规则跳过。配置的类型检查通过;14 项风险选择检查和 3 项直接检查全部通过,exact-scope quality receipt 有效。该改动不涉及 PostgreSQL 写入或 schema,未把未运行的外部集成说成已通过。
语义与 CI 对齐
这里复用既有摘要契约,不新增状态分类词汇。评审依据为本地 exact-head 原生验证;没有抓取或等待远程 CI。主干合入仍由维护者执行。
我的整体评价
建议批准这个精确提交。它删除了重复规则,恢复持续开发的验证入口,并保留现有租约与用户交互语义;没有加入兼容包袱或推测性结构。相关的有界重构已经体现在直接复用规范 owner,暂不需要扩展模块移动。产品能力和已安装 App 的体验验收仍应在各自交付中独立完成,不能用本次维护修复代替。
English verdict: APPROVE - HEAD 8d00626
Goal And Delivered Outcome
typescript-core (1/3)at the content-digest single-owner guard after fix(coordination): allow isolated worktree edits with integration advisories #5364 addedtask_lease_workspace.ts.content_digest.ts.task_lease_workspace.ts:26and passes after the module importsBARE_SHA256_PATTERN. Lease workspace behavior remains unchanged.9c9b90d8e.Scope And Continuation
Validation
30dd19cd3a3faf392f6c78e46760d1aa62d19f27regression_paritycontent_digest_single_owner.test.tsfailed on the base with the new lease workspace matcher as the only offender, then all 17 cases passed after the change.unitstaticnpm run typecheck:control-planeandgit diff --check.integrationloopx canary premerge --from-git-diff: 14 selected checks passed with no failures or manual holds.unitnpm run test:control-plane: 3563 passed, 31 skipped, 1 unrelated failure inhost_process.test.tswhere a descendant counter advanced once after abort. The exact failed case passed when rerun alone; neither changed file is in that process lifecycle path.static/umatcher. PostgreSQL integration was not run because this change does not alter persistence and no test backend was configured.See validation disclosure guidance.
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A. This repair preserves the existing lease workspace wire shape and validation semantics.
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).