Skip to content

fix(todos): scope monitor resume predicates - #8231

Open
huangruiteng wants to merge 66 commits into
mainfrom
codex/scoped-monitor-resume-predicate-20261107
Open

huangruiteng wants to merge 66 commits into
mainfrom
codex/scoped-monitor-resume-predicate-20261107

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

A benchmark or fleet Monitor can observe many cases, but monitor_changed:<todo_id> currently fences every waiter on one global generation. A terminal transition for one case therefore wakes unrelated waiting Todos and can trigger duplicate reconciliation or replanning.

This change adds an optional scoped form, monitor_changed:<todo_id>@<scope>, paired with quota monitor-poll --material-change-scope <scope>. LoopX retains a bounded scope-to-generation projection while preserving the existing global predicate unchanged. Provider receipts, replay/conflict checks, Todo projections, CLI adapters, and benchmark-toolkit guidance all carry the same scope. The Monitor refuses a 129th distinct scope instead of evicting evidence needed by an existing waiter.

The two new metadata fields extend the existing canonical Monitor metadata contract. TypeScript remains the decision owner; Python only validates and projects the same wire contract.

Original proposal validation (recorded at e58446bd; full-suite results below predate the recovery fix):

  • full TypeScript control-plane suite: 6,158 passed, 77 skipped, 0 failed
  • npm run typecheck:control-plane
  • affected TypeScript suites: 121 passed
  • provider receipt suite: 22 passed
  • focused Python monitor/adapter/CLI suites: 138 passed
  • examples/control_plane/quota-resume-gated-open-todo-smoke.py
  • semantic-vocabulary-drift-smoke.py
  • historical Todo read-model upgrade suite: 18 passed
  • generated coordination contract check
  • staged RFC bilingual check
  • public-boundary scan over all changed files

Review follow-up

The scoped wait was accepted by public Todo authoring but checkpoint recovery interpreted a slash scope as part of the Todo identity, while a colon scope disappeared from its dependency basis. The fallback source selector also omitted the Monitor. This follow-up fixes those existing consumers without changing scope generations, admission, receipts, or quota policy.

  • Checkpoint recovery and planning relations now share a dependency projection backed by the TypeScript resume parser.
  • The existing Python read codec extracts the same scoped Todo reference for bounded fallback transport; TypeScript still owns readiness and fallback decisions. Only direct dependencies are transported; duplicate identities fail closed.
  • Public File/SQLite regression cases retain the exact authored scope, reject stale dependency evidence, stop the isolated runtime, resume the original Turn, and replay without rewriting the original result or charging again.
  • Integrated the proposal with main at 7e239ae4 using a merge, preserving the existing PR history.

Validation for the recovery fix:

  • Regression sensitivity: the final six-case public CLI harness produced 4 failed / 2 passed before the fix (slash and colon scopes failed on both providers; global controls passed). After the fix, 6/6 passed, including verified runtime exit/restart and replay.
  • 96 Python tests passed across checkpoint read context, provider fencing, fallback disposition, and resume adapters. This includes ownership, identity, concurrent writers, missing/replaced/stale contexts, bounded transport, invalid tokens, and global/scoped waits.
  • 140 TypeScript tests passed across seven relevant suites: checkpoint read context, task graph, resume conditions, Monitor metadata, monitor-poll commit, canonical monitor-poll, and shadow outbox.
  • Control-plane typecheck, focused Ruff, generated coordination contract, semantic-vocabulary drift smoke, RFC bilingual diff check, and git diff checks passed.
  • Quota resume-gated-open-Todo smoke passed in an isolated runtime; public-boundary scan passed over all ten repair paths using an empty isolated registry.

The broader original full suite was not rerun for this follow-up. This is source-level recovery qualification; installed App/Lark adoption, live models, long-running benchmark outcomes, and independent approval of the new head remain separate.

cocolord and others added 11 commits November 6, 2026 19:54
…idence

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
loopx-agent and others added 2 commits November 7, 2026 09:32
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

@loopx-agent loopx-agent 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.

Reviewer: model_agent, gpt-6.1-sol, OpenAI; runtime_reported; reasoning_effort=max

发现一个阻塞问题,结论绑定 e58446bd79641dbda55833760ffbe26209ee2599。

[P1] scoped 条件尚未接入现有 checkpoint 依赖解析。 公开 todo update 能接受 monitor_changed:todo_scope_monitor@case-a/run-1,但原 Turn 的 checkpoint-context 把整个后缀当成 Todo ID,报 checkpoint dependency todo_scope_monitor@case-a/run-1 is absent。scope 合法包含冒号时,例如 @case-a:run-1,旧正则则不匹配,返回的 basis.dependencies 为空。两种情况都已在真实临时 File 和 SQLite 上独立复现;完整源中存在该 Monitor,不能把读取遗漏解释成对象不存在。

动机 / Motivation

一个 Monitor 同时观察多个对象时,等待其中一个对象的 Agent 会被无关变化唤醒。
原来对象 B 的变化也会唤醒等待对象 A 的任务;新 scoped 条件能隔离这次唤醒,但当前版本尚不能完整通过既有 checkpoint 恢复。
已验证独立 scope 的 generation 隔离;真实 File/SQLite 恢复仍会报错或漏掉依赖,交付需补齐这一现有消费者。
本评审不执行 benchmark、模型、安装或合并,也不把合成检查当作实际长期收益。

改动思路 / Approach

计数仍由既有 TS Monitor owner 管理是合理的;依赖身份却继续由多处字符串拆分解释,必须复用同一 scope-aware parser,才能让恢复与规划读取同一对象。
在本 PR 内补齐 checkpoint 与 fallback 的 scoped 依赖解析和真实恢复回归;无需引入新调度器或扩大为整个 benchmark 重构。
设计仍利用既有 Monitor observation、provider CAS 和 receipt。每次匹配变化记录该 scope 对应的 generation;等待任务保存同一 scope 的 baseline,独立工作继续可执行。单独为每个对象建 Monitor 是更小的既有替代,但会增加 watcher 数量;扩展共享 owner 可以合理成立,前提是原有恢复路径完整采用它,不能只让新 parser 和 serializer 互相证明。

具体改动 / Changes

改动前规范为 docs/project-agent-todo-contract.md,版本 ac62962255322cd80a5b701a4187c6f47bc17d8c。文档无这些条款的编号,本评审使用定位标签:MON-generation-fence 对应原 generation/replay 和独立工作规则,局部实现通过;MON-current-recovery 对应完整依赖及现有恢复边界,目前不满足。

关键代码讲解

  • advanceMonitorScopeGeneration 在既有全局 generation 旁保留 scope 摘要到最新 generation 的映射;最多 128 项,第 129 项拒绝,保留旧等待证据。它是派生投影,不是新的授权 owner。
  • parseResumeWhen 新接受 @scope 并分离 Monitor ID,但这个解释没有到达 checkpoint_read_context.dependencies 和 select_fallback_source_items。后者仍把含 scope 的完整 target 交给 Todo ID normalization,也会漏掉直接依赖。
  • observationObject 将 scope 绑定 material observation、provider plan、receipt 与 replay 冲突;这一传输路径的定向测试通过,但不能覆盖上述缺失消费者。

完整 diff 为 42 路径 +658/-46,包含两个既有 canonical metadata 字段扩展、CLI/投影/历史 codec、文档和回归。没有因为局部 green 而把整体恢复视为完成。

对主干的风险 / Risks

独立 PASS:六个 TS suite 共 127 项、零跳过;五个 Python 模块共 184 项、零跳过;control-plane typecheck 通过。quick 的机械检查通过,仍保留 benchmark_sensitive 人工评审 hold。未查询或等待 CI。

独立 FAIL:同一六案例 harness 先通过公开 Todo 更新并核 canonical readback,再运行原 Turn 的真实 checkpoint-context。两种 provider 的 global control 均成功带回 Monitor;slash scope 两例报错,colon scope 两例缺少依赖,最终为 4 failed / 2 passed。最早的测试导入错误和后续直接种子版本另存;上述结论来自改正后包含公开 authoring 的完整复现,不把 harness 错误算产品回归。

语义与 CI 对齐

最小修复是复用同一 scope-aware typed parser,更新当前 checkpoint 与 fallback 的目标提取,完整保留 Monitor 来源。回归须从公开更新经过真实 File/SQLite 的原身份恢复,覆盖无 scope、slash/colon scope、缺失目标、依赖变化、重启和重放;不得靠删 scope、改成全局等待或删除原回执绕过。现有未绑定输出及所有 receipt 的完整 base/head parity、App/Lark scoped 操作旅程仍未资格;这些未知保留,不要求本 PR 运行模型或承包长期 benchmark。

我的整体评价 / Verdict

局部 scope 隔离已得到证据,但当前整体延续能力有回归,用户可能被困在不能完成的 checkpoint 恢复。计数 owner 的放置可以保留;依赖解析应在本 PR 内统一,避免长期维护多套字符串语法。共享 vocabulary 的扩展尚未与所有当前消费者对齐,因此当前 head 不能批准。本 PR 没有渲染页面差异;已检查现有 Todo/Monitor 展示与 native steward 调用,问题在共享恢复路径。scoped 操作的完整 App/Lark 旅程、真实安装采用与长程收益未验证。

English verdict: REQUEST_CHANGES

if (!TODO_RESUME_KINDS.includes(kind as TodoResumeKind)) return null;
let target = rawTarget;
let scope: string | undefined;
if (kind === "monitor_changed" && rawTarget.includes("@")) {

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.

[P1] 新 scoped token 需要同步更新现有 checkpoint/fallback 依赖读取器。公开 todo update 接受 monitor_changed:todo_scope_monitor@case-a/run-1 后,真实 File/SQLite 的 checkpoint-context 都报 checkpoint dependency todo_scope_monitor@case-a/run-1 is absent;合法 @case-A:run-1 则得到空 basis.dependencies。两组 global control 均正常。请让 checkpoint_read_context.dependencies 和 fallback_source.select_fallback_source_items 复用同一 scope-aware target parser,并补公开更新到原 Turn checkpoint 恢复的两后端回归,保留 scope 和原回执。

loopx-agent and others added 14 commits November 7, 2026 10:52
)

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…#8245)

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

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…al policy (#8171)

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…tion (#8174)

* feat(research): preserve selection when importing native usage versions

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

* test(research): bind usage lineage to registered captures

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

* test: retain lost-response injection without unused assignment

Reuse the narrow fixture cleanup already proposed in #8193 so required lint can qualify the research proposal. The committed operation and subsequent injected timeout retain their order.

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* fix(lark): redact credentials from shared Lark sinks

Remove canonical provider credential shapes before record serialization, including nested values and worker output, while retaining existing redaction for shared board paths and private references.

Default operator todo sync, seed, and heartbeat paths to shared visibility so documented shared boards do not require an opt-in. Route automatic issue-fix Explore sync and CLI-linked Explore refresh through the same visibility.

Mirror the expanded credential shapes in both TypeScript owners and apply the visibility-aware boundary to seed-task and seed-cases.

Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>

* chore(lark): qualify reviewed module metric growth

Record the accepted shared-sink redaction growth: explore_results.py adds 34 lines, while kanban.py adds five Any annotations and its line ceiling is tightened from 2791 to its current 2760. No additional runtime behavior is introduced by this baseline update.

Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>

* fix(lark): redact Explore display values before rendering

Redact node titles, summaries and blocked reasons plus edge types and
summaries before SVG or Mermaid is encoded. Re-render a role view from the
sanitized values when redaction changes display text, so stage titles, stage
SVG and overview diagrams stay consistent while the source digest and
freshness contract keep their original semantics.

Keep the shared visibility boundary for caller-supplied pre-rendered views by
rewriting decoded SVG text spans and Mermaid labels only; the previous
whole-source replacement could consume a closing </text> after a private link.

Add a regression that builds the real presentation bundle, publishes through
the shared stage write path and parses the written SVG with an independent XML
parser. Record the reviewed module metric growth.

Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>

---------

Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
loopx-agent and others added 27 commits November 7, 2026 15:59
…-readers-20261107

test(native): verify policy reads through CLI fixtures
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ualification-20261106

docs(rfc): propose managed small-kernel composition with recovery evidence
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ersion-20261106

perf(cli): load the existing version owner on demand
…tate (#8208)

Qualify the original interrupted Host, preserve its native session and append a finite continuation phase. Keep stopped-source archive reads on one monotonic deadline.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* feat(goals): check Goal commitments without gating local Todos

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

* Bind Goal checks to the outcome named in their receipt

Require a retained outcome ID before a Goal-only check contributes to its requirements. Exercise the owner configure and verify path through the default policy transport.

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Co-authored-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* refactor(turn): integrate complete source and governed settlement with main

Retain the complete checked decision across production callers, reuse main Progressive/Delta presentation and keep late transport options in derived views. Preserve original capture, numeric identity, failure and explicit-off semantics.

Co-authored-by: aihop <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* test(turn): qualify complete source callers and context recovery

Cover checked source fidelity, real File/SQLite caller settlement, native transport recovery, numeric observations and source-entrypoint parity. Retain independent semantic oracles and historical failure boundaries.

Co-authored-by: aihop <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* docs(turn): retain complete source migration evidence and qualification limits

Keep paired RFC checkpoints, production caller contracts and historical negative cost evidence. Integration and retry results do not establish original-workload net benefit or installed delivery.

Co-authored-by: aihop <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* test(context): read complete Goal and recovery through actual CLI views

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

* docs(turn): record main integration and original workload cost limits

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

* perf(context): narrow selected-source and settled-record transport

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

* test(context): preserve selected reader and settlement recovery parity

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

* docs(context): record current main cost and inherited recovery holds

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

* fix(quota): preserve planning-only Turn recovery

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

* test(quota): follow managed claim readiness and guard lineage

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

* docs(quota): reconcile recovery diagnosis and full-task costs

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

* perf(context): reuse published native quota captures

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

* test(context): check native source reuse and reader recovery

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

* docs(context): record native capture IO qualification

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

* fix(settlement): omit repeated Run values from settled control reads

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

* test(settlement): cover receipt-only reads through the native CLI

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

* docs(c1): qualify settled readback transport against main

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

* fix(codex): hand off the captured ready contract and claim reference

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit dcc1d50)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* fix(codex): retain the native work contract after lease preparation

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

* docs(c1): qualify native ready handoff and full hard-lease caller costs

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

* fix(control-plane): preserve executable read obligations in current sources

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

* docs(controller): qualify read-rule convergence and runner budget cause

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

* docs(controller): record current-main source and wheel qualification

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

* docs: qualify current C1 against latest quota baseline

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

* fix(turn): validate supplied complete sources on journal resume

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

* test(turn): qualify recovery from the producing workspace

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

* fix(benchmark): bind native preflight reads to the original capture

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

* Bind prepared context delivery to the lifecycle event session

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

* Verify immutable preflight sources through the native reader

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

* fix: restore file deltas carrying the current unread index

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

* Qualify full packet decisions and native model-visible terminal receipts

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

* Read capability reentry from the model-visible CLI channel in portfolio replay

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

* Verify capability repair from the capture read by the scripted model

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

* Deliver the explicit Todo binding route on the first context read

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

* Distinguish suggested candidates from required binding in the tool actor

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

* Keep the shared native steward fixture compatible with direct recovery tests

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

* Keep benchmark selection on the exact presented guard view

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

* Reuse prepared Codex read guidance in benchmark checkpoint prompts

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

* Prove progressive benchmark choices from receiver-visible pages

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

* Deliver the captured review command on the first replan read

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

* Validate progressive replan against its published reader contract

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

* Isolate the user skill directory for native context comparisons

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

* Check inline opt-out and immutable checkpoint recovery on the real CLI

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

* Reject ambiguous acceptance owners during replan readback

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

* Scope the quota display request to the facts it reads

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

* Verify captured vision audits and share them in one display request

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

* Leave an already-shared acceptance owner in the original capture

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

* Check the unchanged writeback contract when audit authoring is absent

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

* Refuse substituted nonregular Turn observations before reading

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

* Pin native ready delivery to the guard that proved the claim

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

* Drop shadowed duplicates from settlement coverage

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

* Verify native claim readiness with the original writer receipt

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

* fix(quota): preserve verified source and successor identity on staged reads

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

* fix(context): deliver the current replan basis on its first read

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

* refactor(context): reuse the quota action vocabulary for staged review

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

* fix(context): apply progressive recovery to saved complete turns

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

* Reuse observed preference and acceptance fields in native first reads

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

* Plan field reuse inside the existing delivery transaction and qualify invalidation

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

* Verify C1 recovery through its emitted CLI and pinned capture digest

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

* Type the mixed native delivery request for the kernel contract check

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

* Keep private field observation descriptors typed on both native routes

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

* Narrow the request cache owner before retaining Todo context

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 6c54540)

* fix(context): preserve async reader handles in code-mode guidance

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit a2e0eae)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* Fix strict native thread matching in exhausted answer review

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 75ffa6f)

* fix: reuse observed outcomes delivered through complete parents

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

* test: cover omitted saved-context activation and identity checks

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

* Record matched quota costs and packaged context qualification

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

* Qualify main first-read convergence and retain cost counterevidence

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

* test(context): follow returned cursors in native batch qualification

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

* test(context): preserve static replay qualification outside batch stress case

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

* docs(context): record current-main incremental cost and recovery qualification

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

* fix(context): reuse unchanged criteria across progressive first reads

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 9df99f0)

* docs(context): record hierarchical reuse costs and native qualification

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

* docs(context): distinguish late-main integration from frozen cost cohort

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

* refactor(turn): keep source transport below driver imports

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

* docs: record qualified C1 import boundary and main adoption

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

* fix: scope thin heartbeat reads to current dependencies

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

* fix: qualify complete-contract consumers from installed packages

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

* docs: reconcile C1 read scope and consumer qualification

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

* fix(turn): retain recorded acceptance index compatibility

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

* test(quota): opt in to local usage-cycle qualification

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

* fix(testing): qualify complete Turn sources before actor calls

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

* fix(chat): acquire selected native Task lease before delivery guard

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

* docs(c1): record complete-source and native ordering qualification

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

* test(control-plane): retire remaining normal v0 task writers

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

* docs(control-plane): qualify installed native lifecycle

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

* fix: preserve scoped Goal reads and acceptance audit triggers

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

* docs: record scoped Goal and installed capture qualification

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

* fix: retain producer-bound heartbeat Turn identities

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

* docs: qualify bound heartbeat identity and output repair

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

* fix(turn): retain modern Host execution boundaries

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

* docs: clarify complete Turn consumer qualification

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

* fix(context): show one ready settlement recipe in C1

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

* Exercise C1 preference reads through the checked Host request

Keep ordinary plans inspection-only, and use the existing complete request builder for Host disclosure. Compare the typed work projection across scopes and keep tamper, readback and delta tests on the signed source.

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Co-authored-by: aihop <4408344+hhyykk@users.noreply.github.com>
This reverts commit c649fe5.

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

refactor(cli): load history reads on demand
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…8225)

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

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

refactor(runtime): defer process transport at core callers
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* perf(turn): defer optional modules on read-only previews

Keep process-tree cleanup and semantic preference recall on their selected paths. Exercise the normal Turn plan entrypoint in fresh File and SQLite fixture processes and preserve bounded Git and validation cleanup.

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

* Scope Turn preview to deferred preference recall

Keep the distinct recall import seam and its real CLI regression. The process transport proposal owns the shared cleanup callers.

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

---------

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

Preserve producer-bound heartbeat Turn identities
…x-8231-scoped-checkpoint-20261107

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

@loopx-agent loopx-agent 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.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

[P2] 让不同范围的相同结果各自推进。 同一个 Monitor 上,让 A、B 各提交一次 --material-change,分别带不同范围,内容摘要相同。在 File 和 SQLite 上,A 唤醒自己的任务;B 带后续任务提交时被拒,去掉后续任务则返回成功,但 B 仍不可运行。这里用 Monitor 全局的上次摘要决定 advances,B 的范围代次因此不更新。请在既有事务里按范围区分新结果,同时保留全局规则和精确重放;用 A、B 同摘要、各自重复的用例覆盖。 monitor_metadata.ts:204

[P2] 在缺少后续任务的修复指引中保留原范围。 执行 todo update --resume-when monitor_changed:todo_public_watch@case-b/run-2 但缺少独立后续任务时,两种存储均返回不带范围的 waiting_todo.resume_when,轮询配方也没有范围参数。按指引重试会让 A 的变化重新唤醒 B。请把 Monitor ID 和规范化的范围条件分别传给诊断,并让实际 CLI 负例验证原条件和匹配参数都保留。 provider_update.py:197

动机 / Motivation

一个 Monitor 可以替多个用例或运行跟踪结果。等待某次运行结果的任务,应该只在那次运行有实质变化时继续。 例如 A 已结束、B 仍在跑。原来的全局等待会被 A 的结果一起唤醒,B 的任务可能重复检查还没就绪的结果。 这次为等待和轮询加入同一个范围标识。实测 A 能唤醒 A 和全局等待;但 B 若产生与 A 相同的结果摘要,B 的等待仍停在原地。 这个改动只负责从观测恢复任务,继续沿用原 Todo、租约和写入权限。

要交付可用的范围等待,还需要让不同范围的真实变化独立推进,并让修复指引和前端操作保留原范围。

改动思路 / Approach

调用方在 Todo 的恢复条件和 Monitor 的轮询里使用同一范围。既有 TypeScript 事务继续负责观测、代次和后续任务,Python 负责传输和读取。直接沿用全局条件会重复唤醒;每个用例另建 Monitor 会重复调度和领取。共享 Monitor 的范围条件值得做,但只有每个范围能独立推进,才减少这些重复工作。旧恢复错误已修复,当前两个失败都发生在新范围的常规操作里。继续用现有事务,在交付前补齐独立推进和修复指引。本次范围是恢复条件、权威观测和依赖读取。

具体改动 / Changes

关键代码讲解

  • poll 从原 Monitor 读上次结果摘要,再决定是否调用 advanceMonitorScopeGeneration 更新这次范围。当前摘要比较跨范围,因此同内容的 B 被算成 A 的重复。需要在现有事务中区分范围证据。monitor_metadata.ts:204
  • todoResumeDependencyId 从已校验的条件取 Monitor ID,范围仍留在等待条件上。dependencies 用这个 ID 读原任务的依赖;Python 的 bounded fallback 同样只补实际 Monitor。resume_condition.ts:254 checkpoint_read_context.ts:24 fallback_source.py:145
  • _raise_public_update_rejection 也取出了实际 Monitor ID,但结构化指引只收到这个 ID,丢掉了原等待范围。provider_update.py:197

以修订 7e239ae4a3e3738208c50da4b742ccba63e43356 的 docs/project-agent-todo-contract.md 为规范。Monitor generation fence 和 Independent advancement 在 B 的合法事件中未满足;Typed authoring and replay 的原回执恢复已复验,但修复指引仍丢范围;Existing global waits 的就绪、代次和历史回执保持。GitHub 旧基点显示 259 个路径;212 个额外路径已进主干。以共同祖先 7e239ae 核对 47 路径 +811/-63。当前主干 c0b6ade 的模拟合并干净,同 47 路径的净行内容一致。

对主干的风险 / Risks

验证 观察
PASS · 原 checkpoint 恢复 File 与 SQLite 上,修复前同一 CLI 用例为 4 失败 / 2 通过,当前头 6/6。斜杠和冒号范围都保留原 Monitor 依赖;旧依据会被拒,重新读取后补齐原 Turn,重启和重放不改原回执、不再扣额。
FAIL · 两个范围的相同摘要 A 和 B 使用同一个 Monitor 和两次独立观测。把同一份终态内容的摘要用于 A 和 B,A 推进到 1。B 请求创建独立后续任务时被拒;仅提交观测则返回成功并追加回执,但 B 的范围代次保持 0,Todo 仍待恢复。换一个摘要后,B 推进到 2 并可继续。File 与 SQLite 一致。
FAIL · 缺少后续任务 缺少后续任务时,CLI 返回的结构化修复指引把 monitor_changed:todo_public_watch@case-b/run-2 写回成 monitor_changed:todo_public_watch,且轮询参数没有范围。按该指引修复会重新绑定全局等待。
PASS · 无范围对照与容量限制 未指定范围时,基线与当前头在 File 和 SQLite 均保持同一结果:未变化不唤醒,首次变化唤醒,同摘要不再次增加代次。当前公开回执的嵌套 transition 仍新增两个 null 字段;旧输出没有它们。 SQLite 实际轮询中,第 129 个不同范围被拒,权威状态和运行索引逐字保持;已有范围仍可推进,保留 128 个范围。
PASS · 聚焦与静态 184 项 Python、64 项 Monitor 兼容性测试、140 项 TypeScript。类型检查、工作流范围 Ruff、生成契约、双语 RFC 和差异检查通过。
FAIL · 本地标准预检 标准本地预检 6 项直接检查全通过,19 项选定检查中 18 项通过,语义词汇 smoke 在 120 秒门限超时。 同命令单独复跑通过;原批次超时保留。
GAP · 操作入口 以实际 Task 编辑器使用的解析器验证:todo_done 通过,旧 Monitor 条件和新斜杠/冒号范围均返回 null,Review 按钮会禁用。编辑器能展示已设的条件和状态;该验证只覆盖源码的输入门。 参见 todo-resume-condition.ts:2、context-drawer.tsx:773 和 现有交付要求。

语义与 CI 对齐

新增两个字段扩展既有 Monitor 元数据词汇,TypeScript 仍是写入和就绪判定的唯一来源。第 129 个范围的拒绝不会丢失既有证据。未指定范围时的业务行为保持,但旧回执形状新增了两个空字段,建议省略或明确记录。核心用例和结构化指引的失败都在本地复现,托管 CI 状态未查。独立验证覆盖源码 CLI、真实 File/SQLite 和 Task 编辑器的输入函数。未验打包 App、Lark 操作、真实模型、长时间运行或 PostgreSQL;没有查询托管 CI。

我的整体评价 / Verdict

请求修改当前提交。前一轮发现的原任务恢复问题已经解决;实际轮询仍可能让第二个用例永久等不到自己的结果,错误指引也会让修复后的等待重新跟踪全局。在现有 TypeScript Monitor 事务中,以范围和结果证据判定 scoped 变化,保留未指定范围时的原全局规则和原 effect 的精确重放。让修复响应携带原 scoped 条件和对应轮询参数,沿用同一 typed authoring owner。 保留现有 Monitor 所有权,补齐已有 Task 操作入口的可用路径和读回;无需另建调度或授权机制。下轮以两种存储的等摘要反例、精确重复和结构化修复后的实际唤醒结果复验。

English verdict: REQUEST_CHANGES for 52b22068f8f53555d91772005d030bed72ea5d47. Distinct scopes can suppress each other's material transition when their results share a digest, and the public repair recipe drops the requested scope.

if (reactivate && replay) throw new EffectRuntimeRequestError("a historical Monitor observation cannot reactivate completed work");
const advances = !replay && material && (reactivate || resultHash !== previousHash);
const generation = previousGeneration + Number(advances);
const scoped = advanceMonitorScopeGeneration(

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.

[P2] 让不同范围的相同结果各自推进。 同一个 Monitor 上,让 A、B 各提交一次 --material-change,分别带不同范围,内容摘要相同。在 File 和 SQLite 上,A 唤醒自己的任务;B 带后续任务提交时被拒,去掉后续任务则返回成功,但 B 仍不可运行。这里用 Monitor 全局的上次摘要决定 advances,B 的范围代次因此不更新。请在既有事务里按范围区分新结果,同时保留全局规则和精确重放;用 A、B 同摘要、各自重复的用例覆盖。

code=reason_code,
monitor_todo_id=(
dependency_id
dependency_id.partition("@")[0]

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.

[P2] 在缺少后续任务的修复指引中保留原范围。 执行 todo update --resume-when monitor_changed:todo_public_watch@case-b/run-2 但缺少独立后续任务时,两种存储均返回不带范围的 waiting_todo.resume_when,轮询配方也没有范围参数。按指引重试会让 A 的变化重新唤醒 B。请把 Monitor ID 和规范化的范围条件分别传给诊断,并让实际 CLI 负例验证原条件和匹配参数都保留。

This branch has not been deployed

No deployments
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.

5 participants