Conversation
capability_monitor_fallback restated WORK_LANE_CONTRACT_SCHEMA_VERSION as its own module-level constant, and task_orchestration imported the owner on line 12 then spelled the value inline 350 lines later. Both now project the owner's constant. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
The guard keeps three shapes pinned: module-level bindings, payload literals (the form a name-keyed inventory cannot see), and the two deferred sites by file and count so they cannot go stale silently. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
same_runtime_forks 11 -> 10, same_runtime_fork_definitions 25 -> 23 and schema_version_same_runtime_forks 2 -> 1, measured on this revision with the drift smoke and re-anchored in the registry and the smoke anchor together. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
|
CI triage for exact head The failed checks are the same mainline failures seen on neighboring PRs and do not point to this PRs five changed files:
This PR changes the two work-lane contract consumers, its new architecture guard, and semantic budget metadata; none of the failing implementation or test paths are part of its diff. The branch is currently two commits behind This comment explains the red checks only; it is not an approval. The PR still needs exact-head review after the branch update. |
huangruiteng
left a comment
There was a problem hiding this comment.
动机
评审精确 head:5e9c5ad0833547f439ecea3f1d7ad82d59d6cd21;比较基线:f49b4a00870604d39fa4318da24d6dd35e72bb6e。这是 #4447 Track A、Semantic Vocabulary Convergence RFC 的有界债务收敛:同一个 work-lane wire version 由多个 Python producer 独立拼写,未来版本调整可能让正常 lane 与 capability fallback 输出不同契约。目标是减少真实重复知识,不是改变调度或用扫描计数宣布整个 RFC 完成。
改动思路
复用 work_items/work_lane.py 的既有 owner:fallback 显式重新导出该常量,orchestration 使用自己已经导入的常量。保持 work_lane_contract_v1、字段、义务和拒绝顺序不变;不新增 Python 决策源,也不为一次 Python wire-carrier 收敛引入 TS 桥。架构测试同时检查定义、已知 inline 副本和 producer 输出,并下调原有 inventory 预算。live_decision.py、unsettled_host_turn.py 的两个 inline 副本仍被精确记录,不应将这一阶段表述成全部 producer 已归一。
具体改动
五文件 +226/-8,其中生产代码只有两处替换;其余主要是 218 行架构护栏及 smoke/registry 的一致预算调整。
关键代码讲解
capability_monitor_fallback.py:9的显式重导出保留原模块符号可用性,值来自work_lane.py,没有重新声明 literal。build_capability_skip_monitor_fallback_contract的 due、schedule-gap、quiet 和无 monitor 分支仍分别产生原 obligation、原 must-attempt 标志或(None, None)。task_orchestration.py:355的_task_orchestration_work_lane_contract只替换schema_version来源;上游apply_task_orchestration_contract仍依据已有 capability、actor 与 lane 事实准入。没有观察到“导入常量即激活编排”的路径。test_work_lane_contract_schema_version_single_owner.py:34的 deferred census 锁住两处剩余副本及次数;owner 以独立 wire literal 为 oracle。它是限定语法的 source guard,不是执行状态机、持久化兼容或全程序语义证明。
独立验证:157 个相关 pytest 通过;work-lane public smoke、完整 semantic-vocabulary smoke、changed-diff advisory、改动文件 Ruff 和 whitespace 检查通过。同一独立 harness 在 base/head 执行四种 fallback、编排 capability 开/关及三个公开 quota 场景,共九份完整结果;仅规范化生成的临时 runtime 路径后全部相同,未删除 obligation、诊断、命令或字段。故意让 producer 发出错误 wire version,独立 oracle 按预期失败。无 opt-in/default-off 宣称;既有无 capability 的编排控制也保持一致。
对主干的风险
未发现阻塞问题。主要风险是未来 fork 或 inline 漂移,而非当前 wire 变化;现有 literal oracle、producer 验证和全树预算形成互补。没有修改 persisted receipt、租约、authority store、CLI 参数、权限或 UI,故不需要新的 PostgreSQL/前端迁移资格;也未读取活跃 Goal 来构造测试。没有查询远端 CI,本次批准不代替 merge readiness。
两个同作者的收敛 PR 都修改预算锚点,合并时应按最新主干重跑完整 semantic smoke,并保留各自 census 声明;不能从单个 PR 的历史计数推断合并后的实际库存。未来面对更复杂语法时,可先复用 inventory 的 AST facts、压缩重复 census 辅助代码;这次不扩展扫描框架或强制无关语言迁移。已考虑这个相邻重构边界,当前有界改动独立可回滚。
我的整体评价
APPROVE。这不是功能扩张,而是把两个真实 producer 接回既有 owner,完整外部结果保持一致,删除的重复知识有可执行 readback。两个 deferred inline 副本与 RFC 的更广泛收敛仍未完成;本评审没有关闭它们,也没有把通过测试数量当作产品接受。批准后继续核对有效旧阻塞评审,仅在逐项证明过期且具备权限时撤销;不合并 PR。
English verdict: APPROVE — existing wire ownership is reused without observable quota drift; remaining inline copies are explicit, and independent parity plus wrong-version sensitivity passed. No merge or whole-RFC completion is implied.
Goal And Delivered Outcome
inventory_ratchetsnote inloopx/semantics/vocabulary_v0.json: "Both the number of affected names and the number of definitions are budgets, so a third spelling of an already-conflicting name is still a regression."control_plane/work_items/work_lane.py:35andcontrol_plane/work_items/capability_monitor_fallback.py:12) and three were inline payload literals (control_plane/quota/task_orchestration.py:362,control_plane/quota/live_decision.py:318,control_plane/quota/unsettled_host_turn.py:348).task_orchestration.pyalready imported the owner constant on line 12 and then restated the same value inline about 350 lines later, which is also why the name-keyed inventory reports one fork group where the tree really holds five.work_lane.pyis the only module that binds the name and the only module underloopx/that spells the value;capability_monitor_fallback.pyandtask_orchestration.pyproject the owner's constant; the new guard fails on a private copy, on a new inline literal, and on a deferred entry that goes stale. Theregression_parityrow shows the generated inventory now reportssame_runtime_forks=10/10,same_runtime_fork_definitions=23/23andschema_version_same_runtime_forks=1/1.mainatf49b4a008.Scope And Continuation
capability_monitor_fallback.pybecame an import of the owner, the inline literal intask_orchestration.pyreads the constant that file already imported, and both counted budgets plus the schema-version budget were re-anchored to the values measured on this revision. The product change is two lines added and two removed, with the six anchor lines moving in the same diff; the semantic inventory movessame_runtime_forks11 -> 10,same_runtime_fork_definitions25 -> 23 andschema_version_same_runtime_forks2 -> 1, withsame_runtime_forks_semanticunchanged at 9 because[A-Z][A-Z0-9_]*_SCHEMA_VERSIONis a module-local convention name.quota/live_decision.py:318andquota/unsettled_host_turn.py:348still restate the value inline. Both files are being changed by in-flight PRs Refactor/event driven control plane #3200, fix(scheduler): inject capability registry instead of importing catalog from control_plane #4023, refactor(quota): resolve fallback advice from one typed snapshot #4061 and fix(quota): fence settlement by exact GoalRef #5340, so converting them here would merge-conflict for no evidence gain; they are declared by file and count in the guard'sDEFERRED_INLINE_RESTATEMENTS, so a new site, a fixed site that keeps its declaration, or a silently widened set all fail. The remaining counted*_SCHEMA_VERSIONtwin isSNAPSHOT_SCHEMA_VERSION(capabilities/issue_fix/repository_snapshot.py:14andcapabilities/issue_fix/metrics_projection.py:16), which cross-validate each other's payloads with that same literal and is deliberately left for its own PR. Tests, examples and docs keep their own copy of the expected value on purpose: if they read it from the owner, a wrong owner would have nothing to fail against.Validation
5e9c5ad08unitpassedtests/architecture/test_work_lane_contract_schema_version_single_owner.py: 8 passed, covering the binding scan, the payload-literal census, the deferred declaration set, consumer wiring through all three fallback branches plus the orchestration projector, and the generated inventory.integrationpassedtests/architectureplustests/canary: 1097 passed, 0 failed.staticpassedpython -m ruff checkclean on all changed files;python -m ruff format --diffreports the same two pre-existing files on base and head, so no format finding is introduced; configuredpython -m mypysucceeded for 19 source files;git diff --checkclean.real_entrypointpassedexamples/control_plane/work-lane-contract-smoke.pyandexamples/control_plane/quota-plan-smoke.pyboth passed on the tested revision.regression_paritypassedsame_runtime_forks=11/11 -> 10/10,same_runtime_fork_definitions=25/25 -> 23/23andschema_version_same_runtime_forks=2/2 -> 1/1.premergepassedloopx canary premergeover the exact five changed files completed 19 checks with 0 failures, 0 warnings and no manual hold; the public-boundary scan reported clean for all five paths.work_lane_contract_v2(guard red). Survived, and why it is equivalent: adding a second payload literal inside the owner module passes every test, because the owner would still be the single module deciding the value - the census excludes the owner path by design, and the same-module restatement is a readability issue rather than a second owner.work_lane_contract_v2left the eight focused contract tests green, because that suite compares against its own restated literal - same-value restatements are invisible behaviourally, which is the reason the census is structural. Second,tests/control_plane/test_work_lane_contract_core.pyand the two smokes above ran against a worktree without a compiled Chat bundle, which this change does not touch. No backend, persisted state or wire payload changes: every projected payload keeps the byte-identical value.uv pip install -e ".[test]") instead ofuv sync --extra test, with Node 22.23.2 on PATH and the repository's npm dev dependencies installed, both required by the drift smoke.Frontend / Visual Evidence
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A. This PR does not claim progress against the shared Goal Authority or TypeScript migration RFCs.
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).Technical Direction
single-sourcecarrier cleanups.Notes For The Reviewer
vocabulary_v0.jsonandBUDGET_ANCHORin the drift smoke) move in this single diff, as the smoke's own error message requires.same_runtime_forks10 -> 9 andsame_runtime_fork_definitions23 -> 21 re-measured on the integrated base; the values quoted above are measured againstf49b4a008.