Skip to content

fix(replan): scope succession requirements to their own obligation - #7265

Merged
huangruiteng merged 1 commit into
mainfrom
codex/monitor-replan-ack-scope-20261024
Oct 24, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/monitor-replan-ack-scope-20261024

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A worker can accept a blocked monitor replan, settle its Turn without a debit, then select the same obligation again because a separate completed task has a succession warning. Peer-owned work can keep the shared Goal advancing while that worker is correctly waiting. The lane-wide succession flag incorrectly vetoed the exact accepted monitor receipt.

Apply successor-only qualification to the obligation carrying the registered completed_advancement_without_successor trigger. The native next-Turn journey now waits while retaining the historical warning, original source observation and independent runnable work.

修复“监视器阻塞已收口,下轮仍重复重规划”的循环:将后继要求限定到它所属的义务,避免无关历史任务否决另一条已接受的回执。历史任务要求、原等待条件和精确身份检查均保留。

  • Outcome basis: reproduced source-level defect; roadmap S3/S7 continuation and budget correctness.
  • Intended base: main at c1a589aac771b39df9137dc808280c2a33fb4cbd.

Author Declaration

Criterion Disposition Implementation / evidence
An accepted receipt matches its original obligation implemented Existing ACK owner and registered trigger; native next-Turn regression fails before this fix
Lifecycle succession still needs its own qualified transition implemented Existing terminal/successor negative tests, plus stale-identity and independent-duty cases
Blocked closeout grants no debit or completion implemented Real File/SQLite refresh, replay, later spend no-op, preserved pending tasks and monitor fields
  • Self-check: reviewed the complete four-file diff, instruction/ownership references and native validation. Reused the existing Python frontier adapter and TypeScript-owned semantic/settlement contracts; no parallel decision owner or new vocabulary.

Scope And Continuation

The scoped predicate and native regression are implemented. Hosted qualification remains incomplete as described below. The existing native CLI journey is extended rather than adding another fixture or helper. The repair catalog records the diagnosis for later agents. Installed-host adoption, independent PR review and long-horizon cost benefit remain separate; no merge or installation is requested or performed here.

Validation

  • Tested revision: 200606ebd2b3083549753ac0747bd9600acdd5de.
  • Run state: finished. Input classes: synthetic, public_fixture.
Check kind Result Evidence / limitation
regression_parity passed New policy oracle and native File next-Turn assertion fail on the base production code, then pass with the scoped guard
unit / real_entrypoint / real_backend passed 42 tests: novelty policy, autonomous ACK, Agent scoping and four native File/SQLite journey cases; local Python 3.14.8, disposable runtimes
negative / recovery passed Wrong Agent/Turn refused; replay and later spend are no-ops; historical warning, peer ownership, source hash/generation/deadline and original scheduled work remain; independent work is selectable
static passed Ruff on all changed Python; diff-scoped semantic advisory; selected-project contract/public-boundary scan
premerge passed Exact-scope author quality receipt and quick premerge readback reported below
hosted failed CI merge 5e3c51aa05ddf590bd65455ecc9ff29187abc677 uses base c1a589a and this unchanged head. Static lint failed on 13 inherited E701 errors; dependent lanes were skipped. A separate packaged browser assertion also failed; see the qualification update below
installed not_run Installed-host/model benefit is not inferred from these source checks

Quality: Author quality receipt cqr_78afc1d20744b9f4e336, exact scope 78afc1d20744b9f4e336d3e3a9a4da1a82cf209ffdd108372d0b4ee82ad527c2; verify returned valid. Six direct and three selected quick-premerge checks passed; zero manual holds. The earlier stale-receipt hold remains historical; this final scope is requalified independently of that old receipt. An initial check routed to the default global registry failed outside the selected project scope; its failure is retained, and the explicitly selected project check passed.

Frontend / Visual Evidence

  • UI impact: none. Existing Goal/quota/Todo consumers use the corrected readback; no layout, settings or new caller-facing capability.
  • Before / after / viewport / source data / attention and craft review: N/A.

Type of Change

  • Bug fix

Affected Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

Core control-plane hardening; S3/S7. Bounded refactoring: reused the registered trigger and existing predicate, retained one direct branch, and extended the existing canonical native journey. No broader migration or abstraction was needed.

Shared-authority RFC fixture impact

N/A: no authority-store, promotion, transport schema or runtime-routing migration. Real File/SQLite coverage is described above; no PostgreSQL store qualification is claimed.

Boundary Checklist

  • Public-safe diff/body; no private state, credentials, raw trajectories, internal links or local paths.
  • No maintainer-owned benchmark work duplicated.
  • Scoped to the reproduced defect.
  • No paired RFC changed.
  • UI impact is none.
  • Every commit has a DCO sign-off.

Hosted Qualification Update

The actual static job reports eight E701 errors in tests/test_native_steward_turn_host.py and five in tests/test_native_steward_monitor.py. Both complete files are byte-identical across the immutable target base, author head and actual CI merge; a local Ruff replay returns the same 13 locations. Existing PR #7262 covers the first eight; extending that same prerequisite proposal to the five remaining errors is pending. No full-CI pass is claimed. The dependent checks and Stage 2C aggregate failed after their required lanes were skipped.

The package build browser job separately failed the Goal activity empty-running-tile assertion. Its cause remains unqualified; the static-lint finding does not explain it. The hosted PostgreSQL authority job passed; this does not qualify skipped suites or installed adoption.

托管资格仍未通过:静态门的 13 处 E701 在精确基线、作者版本和 CI 合成版本同源同位置复现,复用 #7262 补齐同类前置。多数后续检查尚未执行;打包页面另有断言失败,单独保留且不猜测因果。原本地通过记录保持其作用域,不改称完整 CI 或安装采用已通过。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported; observation_id=0956f835f35a14ed9628f47a3145e8c5710554ab78cf98631d175df2a5953bca

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机

已经为监视任务登记具体阻塞、等待原来源的 worker,下一轮应能继续等待或领取独立工作。 原监视重规划已经被准确接收并无扣额结算,但另一项已完成任务的后继告警会让同一重规划再次出现。现在只把后继要求用于携带该要求的原义务;监视器继续按原条件等待,历史告警与其他任务仍保留。 真实File、SQLite旧/新对照复现并解除原循环;原结算可重放、没有扣额或提前poll,后来新建的独立任务仍能被选择。 本次只修正已有ACK判定的义务范围,不关闭历史任务、不清告警、不创造后继,不增加执行、等待或完成权限。

改动思路

只收窄现有ACK适配器的限制范围:后继要求仍由已有登记触发项指明,接收结果、所需语义成果和真实结算继续沿原所有者判断。 当前四路径交付一个谓词修正、原native旅程的扩展和对应修复目录说明;不另建状态、规则框架或继承协议。 Conjoin the existing registered succession trigger with the existing lane flag; reuse exact ACK/TS outcome owners and established canonical CLI fixture. 原身份、输入完整性和独立未完成义务都保留;拒绝与恢复由原所有者处理,不能以继续运行代替证明。

具体改动

准确头 200606ebd2b3083549753ac0747bd9600acdd5de,实际merge-base c1a589aac771b39df9137dc808280c2a33fb4cbd,本次目标main快照 920f18809d906b840325c4f40013e9224e4a3a2e。接受规格 docs/reference/protocols/quota-blocked-causal-closeout-v0.md 取修改前不可变版本 c1a589aac771b39df9137dc808280c2a33fb4cbd。以下编号为评审映射,未用本PR修改内容自证。

  • ACK-EXACT implemented:Accepted blocked replan must retain exact Goal/Agent/Turn/obligation, semantic delta and original durable receipt. 路径:autonomous_replan_ack_satisfies_obligation / existing settlement owner;验证:wrong-Agent/Turn native refusals and original receipt replay。

  • ACK-NO-DEBIT implemented:Blocked closeout closes only the Turn; no debit, Todo completion or source observation is created. 路径:existing quota settlement and native CLI;验证:File/SQLite no-spend and original source/deadline/status preservation。

  • ACK-CONTINUE implemented:Current canonical resume conditions decide readiness; independent work and genuine uncovered gaps retain ordinary admission. 路径:goal_frontier original and frontier ACK callers;验证:8 immutable base/head native cases, new independent task selection and retained warning。

  • ACK-UNQUALIFIED implemented:Stale/rejected ACKs or mismatched identity cannot qualify; separate lifecycle duty still requires its own transition. 路径:registered trigger and exact ACK/outcome checks;验证:novelty/wrong-identity/own succession negative tests。

关键代码讲解

  • autonomous_replan_ack_satisfies_obligation:核对本义务的ACK成果。lane-wide后继限制改为本义务含登记触发项才限制;关键约束:exact identity first; own succession still requires new_runnable_successor。调用 existing required_semantic_outcomes / typed trigger list 后交给 original and frontier quota ACK readback;失败由 empty/rejected/wrong ACK remains false 负责。

  • build_goal_frontier_projection_context_from_status:保持后续工作与独立职责。same consumer, corrected scope-specific predicate;关键约束:ACK identity/frontier match and canonical resume still required。调用 existing frontier derivation and transition owner 后交给 CLI/managed quota status;失败由 uncovered/new duty retains its own original gates 负责。

  • test_blocked_replan_closes_without_debit_and_retains_scheduled_work:真实跨轮验收。拓展File/SQLite及有无无关历史告警;先初始化canonical fixture再读;关键约束:no changed source clocks, no debit/poll, exact replay, independent work selection。调用 native guard/refresh/spend/todo add 后交给 validated next-Turn readback;失败由 wrong Agent/Turn refused before effects 负责。

完整审查四路径 +78/-6。唯一生产行为变化是将lane标志与该义务实际携带的登记触发项相与;先前exact ACK与accepted检查、TypeScript所需成果、frontier绑定与canonical等待均保持。修复目录增加同一失败模式说明,明确不清历史计数、不改回执、不关闭未完成任务或虚构后继。真实CLI fixture在读取前建立隔离canonical权威源,避免把未迁移Markdown当已可用provider。

当前四个完整相关测试文件为42 passed、8 failed,失败保留。四组变更旅程均通过,另做8组不可变基线/当前File、SQLite对照。有无历史告警两类输入都经过真实guard、blocked refresh、原身份重放、later spend无操作、下一Turn与原字段读回;再通过原生todo add证明后来独立工作可以进入执行。标准premerge6直接、10catalog、8风险检查及独立四文件公开扫描通过,不等同其余完整检查全部通过。

对主干的风险

相反风险是让任何blocker充当本义务需要的后继。当前先核原obligation身份与accepted语义,再仅对自身携带completed_advancement_without_successor的义务保留new_runnable_successor要求。错误Agent/Turn在真实CLI中被拒绝;错误义务ACK与自身生命周期blocker仍不合格。历史完成任务告警继续为1,peer归属、原待办、监视器generation/hash/期限/等待条件均保留,没有产生poll、扣记或完成。

不可变基线与当前的真实File/SQLite对照表明:无历史告警的路径保持;有独立历史告警时,基线在有效阻塞收尾后又选择同一义务,当前改为等待并允许后来的独立任务。8项完整文件失败则都在旧fixture建立canonical源之前发生,尚未进入本次ACK分支;基线同8节点、失败行与完整拒绝payload一致,仅生成的event时间/id不同。fixture前278行完全相同,该失败仍为failed。

完整Ruff在准确基线和当前均有13处E701,两份未改steward文件全等,6606字节诊断完全相同,SHA-256为f21dbe8f47cb8a043a3c947051e4fca9ea7cadf2d9bfb46aa0ba5a175bc24dc2。配置mypy在两者均为5241错误、614文件、17配置输入;完整错误与note在排序、三个已核实源行位移及一次相同全局help提示的位置归一化后相同,其原始输出全部保留。三个同文件旧类型错误所在语句未改,没有把它们改写成通过。

这些当前失败按不可变基线、具体因果路径及变更实路覆盖判为pre_existing_unrelated。它们保持required/failed,严格质量回执为FAIL,不以APPROVE消除质量资格。作者记录的较早托管页面断言原因没有在本轮诊断,既不猜测其原因,也不声称已经修复;当前评审依当前变更的独立实路证据,不查询或等待CI。

我的整体评价

APPROVE,仅对应当前完整提交 200606ebd2b3083549753ac0747bd9600acdd5de,本次明确的修复切片达成;没有当前引入且未解决的阻塞发现。只收窄现有ACK适配器的限制范围:后继要求仍由已有登记触发项指明,接收结果、所需语义成果和真实结算继续沿原所有者判断。 当前四路径交付一个谓词修正、原native旅程的扩展和对应修复目录说明;不另建状态、规则框架或继承协议。 现有所有者与这个局部改变足够,不需要第二个规则服务、配置页或形式化后续任务。

long_horizon 为improved,依据是本次有界实路中的原效果保护、重放和后续可用工作,不扩大为真实模型或长期净收益。user_experience 为improved:合法等待不再要求使用者重复说明同一阻塞、清除无关告警或重输原身份;有独立工作时直接沿既有入口选择。 仅已有frontier判定、修复目录和测试变化,没有页面、组件或样式改动。 无新增渲染表面;已安装宿主、真实模型与长期收益未验证。

严格质量回执 cqr_c6cb91948c08922b4bdf 保持FAIL,阻断项为完整fixture测试、Ruff和mypy;这是与变更评审归因分开的资格状态。 未查询或等待CI,未执行合并、共享安装、真实模型或实验。APPROVE不是GitHub正式自我批准,不授予合并权限,也不替代准确头的准备检查;新提交或相关所有者/条件变化需重新核验。

English verdict: APPROVE — 200606ebd2b3083549753ac0747bd9600acdd5de. The exact accepted monitor receipt is no longer vetoed by a separate succession duty; its own lifecycle and identity requirements remain.42 current tests and8 real File/SQLite base/head cases support the fix. The8 fixture failures,13 Ruff errors and5241 mypy errors match pre-existing base diagnostics and remain failed; strict CQR is FAIL. Earlier hosted browser cause, installed/model benefit and merge authority remain separate; no merge performed.

@huangruiteng
huangruiteng merged commit 29dd554 into main Oct 24, 2026
21 of 27 checks passed
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