Skip to content

Read evaluated readiness for due Monitor polls - #8674

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/monitor-poll-resume-readiness
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/monitor-poll-resume-readiness

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis: A reproducible disagreement between quota should-run and quota monitor-poll.
  • A due Monitor with a satisfied resume condition can be selected when a User gate applies to other work. The poll path read the stored Todo without its evaluated readiness and rejected the observation as blocked by that gate.
  • Poll admission now reads the canonical evaluation when the selected record has no readiness value. It binds the result to the selected Todo, target and resume condition, then passes the due fact to the existing gate and commit checks. A qualified poll writes one receipt and does not debit quota. A pending or unresolved wait still refuses a fresh poll.
  • Target loopx-project/loopx:main. The signed commit is based on 441c6077e7c5c8e896ea79562761fd483baf157e. The merge preview passed against current main at 09886ba7afec07dba709229cc9dfb7fabf15d03a.

Author Declaration

Criterion Disposition Symbol / path Test
Qualify exact due Monitor and independent live gate Implemented resolve_due_monitor_candidate Elapsed, future and unresolved waits through the source and target-only global routes
Preserve actor, lease and commit-head gate checks Preserved Existing Monitor provider plan and admission Missing proof, linked/global/unknown gates and a gate change after preflight
Keep exact replay and no-spend Monitor settlement Preserved Existing receipt transaction First observation and identical replay leave exactly one poll entry and no debit

Scope And Continuation

The change is limited to Monitor admission readback. Existing CLI arguments, provider commit rules and historical receipts are unchanged. No new frontend flow or configuration is needed.

Validation

  • Tested revision: af1540f9fec5c178905dc06d3d7028e438dfaf55
  • Run state: finished
  • Input class: synthetic
Check kind Result Evidence
regression_parity passed The installed base reproduces four elapsed-wait failures; the installed candidate passes all 12 readiness cases.
real_entrypoint passed The installed loopx console admitted and wrote the qualified poll, rejected missing lease and pending/unresolved waits, and replayed without a second write.
real_backend passed Isolated File and SQLite providers, with both source and target-only global routing.
integration passed A fresh run of this change's test file passed all 35 tests. The previous 79-test run covered settled scoped gates, exact target transport and leased Monitor polling. The broader 134-test run passed before the final archive guard and explicit missing-proof assertions.
static passed Changed-file Ruff and standard diff-selected premerge validation.

Hosted CI, PostgreSQL and live rollout are unverified. The change has no provider storage or protocol change.

Frontend / Visual Evidence

  • UI impact: none.

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Control plane

Shared-authority RFC fixture impact

  • N/A. No provider or persisted schema change.

Boundary Checklist

  • Diff and PR description contain no private operational material.
  • No paired RFC changed.
  • No UI change.
  • Commit includes a DCO sign-off.

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 · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

评审提交 af1540f9fec5c178905dc06d3d7028e438dfaf55,PR base 为 09886ba7afec07dba709229cc9dfb7fabf15d03a。对照主干 eba8a7f95f54fe09cb3dcc28bb1f55443898bbed 的相关路径与 PR base 相同。

[P2] 等待条件在提交前变为未满足时仍会写入 Monitor。 有一个独立 User gate。Monitor 的 resume_at 已到期,持有效 lease 的 poll 通过 preflight。provider 提交前,另一次合法 Todo 更新把等待条件改成尚未合并的 PR。 Todo 读回显示 resume_ready=false。候选仍提交一次 poll、写入 result_hash 并推进 next_due_at。主干的相同到期等待被旧 preflight 挡住;从无等待开始的对照表明,底层漏检 PR 条件原已存在。 让新放行的观察在原 provider 写入边界复核所依据的当前等待条件。条件变动时中止这一轮未提交的 poll,重新判断新条件,并保留原提交回执的精确重放。 新准入路径 提交时的等待判断

动机 / Motivation

受其他 User gate 影响、但仍需轮询独立到期 Monitor 的 Agent 和项目维护者。 主干 guard 能选中等待条件已满足的 Monitor。真正的 poll 重新读到存储 Todo 时缺少计算后的 readiness,于是拒绝本该可以提交的观察。 候选让已到期且独立的 Monitor 在 File 和 SQLite 成功写入一次。同一命令可重放,原用户 gate 保持开放,轮询没有扣额。 本轮验证覆盖真实源码 CLI、当前 lease、File 和 SQLite。本地夹具不查询真实外部 PR,托管 CI 和正式部署未验证。

改动思路 / Approach

Python 复用 canonical Todo 的 readiness 读回,TypeScript provider 在当前权威快照上决定是否提交。 让新放行的观察在原 provider 写入边界复核所依据的当前等待条件。条件变动时中止这一轮未提交的 poll,重新判断新条件,并保留原提交回执的精确重放。 准入修复有明确收益,能恢复此前被误挡的到期观察。它也让带等待条件的观察进入现有提交路径。当前提交需要验证自己所依赖的条件仍有效,否则一次合法配置更新会在旧观察之后被忽略。 当前 provider 事务

具体改动 / Changes

关键代码讲解

resolve_due_monitor_candidate 先用现有 selector 选 exact Todo 或 target,再为缺少 readiness 的存储记录读取 canonical projection。它核对同一个 Todo、target、归档状态和归一化后的条件,继续交给现有 due 判定。两份源码文件分别负责准入和既有 scoped-gate 回归,夹具扩展到有效 lease、已到期、未来时间和缺失依赖。provider 仍在 revision CAS 所用的快照上核验租约和 gate。当前依赖判定处理日期和 Todo 完成,尚未处理已经改变的外部 PR 等待。 Readiness 和 due 判定 真实 CLI 回归

以 09886ba7afec07dba709229cc9dfb7fabf15d03a 的 docs/reference/protocols/quota-monitor-observation-receipt-v0.md 为准。current-due-monitor 在提交前的等待变化下仍有缺口。independent-live-gate 和 exact-no-spend-replay 由阻塞、重新允许、回执重放及零扣额的本地用例覆盖。 Monitor 观察协议

对主干的风险 / Risks

同一真实 CLI 夹具先用 File 与 SQLite 为到期 Monitor 取得原始 guard 和 lease。主干在这组输入下未进入 provider;候选能够提交,但若在提交前把等待条件改成未合并的 PR,两个后端都会在 readiness 为 false 时更新 hash 和 cadence。把条件改为未来日期,候选在写入前拒绝。另以原先无等待开始,两版都有同样的 PR 等待漏检。用真实 quota monitor-poll 和 lease,在 provider writeback 前提交未满足的 pr_merged 条件。File 和 SQLite 都应保持原 hash、due 时间和无 poll 记录。对照已到期、未来时间、linked gate 和已提交重放。

语义与 CI 对齐

42 个聚焦用例及 standard premerge 六项直接检查、17 项选中检查通过。独立的 12 组 lease/条件对照中,候选四组 PR 等待竞态失败,其中两组来自本 PR 新放行的到期路径。托管 CI 未查询。

我的整体评价 / Verdict

请求修改。恢复到期 Monitor 准入的方向成立。请把当前等待条件的校验绑定到原 provider 事务,再用两个后端复跑。本次变更影响 CLI 监控准入和回执,未涉及渲染页面。

English verdict: REQUEST_CHANGES. At af1540f, evaluated readiness restores an elapsed Monitor, but a later pending PR dependency can still be ignored at commit on File and SQLite.

or normalize_todo_resume_when(evaluated.get("resume_when")) != resume_when
):
return {}
item = evaluated

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.

[P2] 等待条件在提交前变为未满足时仍会写入 Monitor。 有一个独立 User gate。Monitor 的 resume_at 已到期,持有效 lease 的 poll 通过 preflight。provider 提交前,另一次合法 Todo 更新把等待条件改成尚未合并的 PR。 Todo 读回显示 resume_ready=false。候选仍提交一次 poll、写入 result_hash 并推进 next_due_at。主干的相同到期等待被旧 preflight 挡住;从无等待开始的对照表明,底层漏检 PR 条件原已存在。 让新放行的观察在原 provider 写入边界复核所依据的当前等待条件。条件变动时中止这一轮未提交的 poll,重新判断新条件,并保留原提交回执的精确重放。 用真实 quota monitor-poll 和 lease,在 provider writeback 前提交未满足的 pr_merged 条件。File 和 SQLite 都应保持原 hash、due 时间和无 poll 记录。对照已到期、未来时间、linked gate 和已提交重放。

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.

1 participant