Skip to content

fix(control-plane): reuse canonical lease digest matcher - #5377

Merged
huangruiteng merged 2 commits into
mainfrom
codex/fix-lease-workspace-digest-owner
Oct 1, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/fix-lease-workspace-digest-owner

Conversation

@Duang777

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Scope And Continuation

  • Completed scope and remaining work: Reuse the canonical bare digest matcher and register the new consumer in the pinned owner list. No other digest producer or lease behavior changes.
  • Slice boundary / successor: Complete within this scope. test(ci): isolate semantic probe fixture coverage #5375 remains an independent Python coverage fix.

Validation

  • Tested revision: 30dd19cd3a3faf392f6c78e46760d1aa62d19f27
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
regression_parity passed content_digest_single_owner.test.ts failed on the base with the new lease workspace matcher as the only offender, then all 17 cases passed after the change.
unit passed Focused digest-owner and lease-workspace tests: 20 passed, 1 PostgreSQL-gated test skipped because no backend URL was supplied.
static passed npm run typecheck:control-plane and git diff --check.
integration passed loopx canary premerge --from-git-diff: 14 selected checks passed with no failures or manual holds.
unit failed Full npm run test:control-plane: 3563 passed, 31 skipped, 1 unrelated failure in host_process.test.ts where 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 passed Pre-commit Bits Code Guard review covered both changed files and found no P0-P2 defects.
  • Coverage and gaps: The canonical matcher has no global or sticky state, and existing tests pin equivalence with the removed /u matcher. 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

  • UI impact: none
  • Before: N/A
  • After: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference, when applicable: Core control-plane hardening.

Shared-authority RFC fixture impact

N/A. This repair preserves the existing lease workspace wire shape and validation semantics.

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
@Duang777

Copy link
Copy Markdown
Collaborator Author

Exact-head CI confirms the digest-owner fix: all three typescript-core shards passed, including the previously failing single-owner check. The two Python failures are inherited from current main: test-shard (2) is the runtime source-churn race fixed by #5367; test-shard (3) contains the same race plus the stale usage notice 4 assertion fixed by #5379. Both failures reproduce outside this two-file TypeScript diff, so no #5377 code change is planned.

@Duang777

Copy link
Copy Markdown
Collaborator Author

Final exact-head update for 30dd19cd3a3faf392f6c78e46760d1aa62d19f27: the target validation remains green across all three typescript-core shards, including the former duplicate matcher failure. The later test-shard (4) failure is the third known manifestation of the current-main runtime fingerprint race: test_runtime_request_source_churn_raises_a_stable_startup_diagnostic observed runtime_exited_before_ready instead of packaged_runtime_source_unstable; #5367 fixes this fixture/path and passed all four shards on its own exact head. The aggregate pytest and merge-gate failures are downstream of those inherited shard failures. No #5377 code change is needed.

@cocolord @huangruiteng please review this exact head when available. No merge action was taken.

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
@Duang777

Duang777 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Synced with main@f49b4a00870604d39fa4318da24d6dd35e72bb6e using signed merge commit 8d00626696058d91b792e7f7dc6f740e8261af8a. The merge was conflict-free, and the PR diff remains limited to the canonical digest owner and its single-owner regression test.

Focused validation on the new exact head: content_digest_single_owner.test.ts passed all 17 tests, and the control-plane TypeScript typecheck passed. The branch was pushed normally without history rewriting. CI has restarted; no merge action was taken.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

动机

这个修改修复了工作树租约校验引入的确定性主干回归:工作区解析器复制了裸 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

@huangruiteng
huangruiteng merged commit e240730 into main Oct 1, 2026
28 of 30 checks passed
@huangruiteng
huangruiteng deleted the codex/fix-lease-workspace-digest-owner branch October 1, 2026 04:24
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.

2 participants