Skip to content

fix(collaboration): surface peer returns on next turn - #8644

Open
huangruiteng wants to merge 3 commits into
mainfrom
codex/peer-inbox-next-turn-delivery-20261112
Open

huangruiteng wants to merge 3 commits into
mainfrom
codex/peer-inbox-next-turn-delivery-20261112

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Reproduced collaboration recovery defect; no external issue required.
  • Goal/source and gap: A peer result could already be queued for the requester, yet a long Manager Inbox agenda left its required read outside the opening context. If the Agent missed that read after recovery, the next Turn showed only aggregate counts and could overlook which result needed consumption.
  • Observable before → after, with the validation row that proves it: Before, omitted agenda rows carried no compact result identity in the opening. After, the next Turn opens with a bounded return_attention projection containing request/result identities and consumption state; full result text remains behind manager-inbox read, and visibility does not consume it. The focused first-read and real inbox round-trip tests cover both boundaries.
  • Issue/task and intended base: Self-contained fix against main at d9432f235.

Author Declaration

  • Written by: Codex GPT-6 (OpenAI), directed by the repository operator.

Implemented against

  • Specification and revision: loopx/capabilities/manager_context/README.md at d9432f235; the reproduced request in this PR is the outcome basis.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
Returned peer work remains pending until explicit requester consumption implemented projectDelegationTurnItems / projectDelegationTurnContext test_native_inbox_preserves_unconsumed_results_across_corrections
The next Turn exposes bounded result identity before long work context implemented managerReturnAttention / initialContextReadGroups test_initial_read_surfaces_bounded_peer_return_attention_before_long_sources
Full result text remains owned by Manager Inbox reads implemented return_attention identity-only projection focused TypeScript and Python inbox suites
Active Turns are not interrupted by peer returns implemented no push path added; projection is assembled only for Turn context static review plus first-read test
  • Self-check before submission: Reviewed the collaboration agenda owner, progressive first-read selection, Manager Context contract, and exact consume/read paths. Ran focused static, unit, integration, real CLI, and public-boundary checks. No UI or live provider path is involved.

Scope And Continuation

  • Completed scope and remaining work: Complete within this scope. The change repairs next-Turn discovery while preserving existing pull, read, delivery, and explicit-consumption semantics.
  • Slice boundary / successor: N/A; active-Turn notifications are intentionally outside the accepted behavior.

Validation

  • Tested revision: bf24ca17ba87d69714c39d10fee789d99e1584cd
  • Run state: finished
  • Input classes: synthetic, public_fixture
Check kind Result Public-safe evidence / limitation
static passed npm run typecheck:control-plane; git diff --check; semantic-vocabulary advisory found no supported new closed-set carrier.
unit passed 31 focused TypeScript collaboration/inbox tests, including bounded aggregation rejection.
integration passed 237 Python first-read, inbox, amendment, and original-conversation tests across file and SQLite authority fixtures.
real_entrypoint passed Two provider-parametrized Manager Inbox CLI round trips prove repeated reads retain attention, reads do not consume, and explicit consumption removes the next-Turn attention.
static passed Public-boundary scan: six changed public files scanned, zero blocking hits.
  • Coverage and gaps: The tests cover projection creation, batch aggregation, opening order, full-text ownership, repeated reads, and explicit consumption. No frontend, external provider, or active-Turn delivery behavior changed.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • First viewport and preview: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A
  • Craft 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: Shared Goal Authority and cross-host coordination; Manager Context pull/consumption contract.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A
  • Semantic dimensions changed, or reviewed no-impact rationale: Adds a backward-compatible bounded projection over existing request/result receipt facts; no authority or persistence schema changes.
  • Provider conformance arms run: Existing file and SQLite inbox fixtures in the integration suite.
  • Read-only legacy/file/PostgreSQL three-arm rehearsal (required for promotion, runtime-routing, or compatibility-projection changes): N/A; no provider routing or stored-authority change.

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.
  • Existing English/Chinese RFC pairs (including ledger entries) both have a diff, and the local premerge check python3 scripts/check_rfc_bilingual.py --base origin/main --head HEAD passes, or no paired RFC changed.
  • 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: huangruiteng <huangrt01@163.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 · max

本次评审对应提交 bf24ca17ba87d69714c39d10fee789d99e1584cd。

[P2] 三次已确认的结果更新会隐藏原始待确认结论。 两种 authority provider 的真实 Inbox 都仍保留这条结论。无 journal 的原生首读还有独立的分页缺口。

动机 / Motivation

在 File 或 SQLite Goal 中通过 Manager Inbox 协作的请求者,以及使用原生 quota context 首读的宿主。原议程展示每请求最后三条结果。完整 Inbox 能保留未确认原始结论,原生首读缺少独立结果提醒。普通的一条返回有提醒,原入口仍保留原始结论、已确认更新和正文权限。两个真实边界会漏掉提醒。使用隔离 File 和 SQLite、真实原生 CLI 与合成回执。生产会话和托管 CI 本次未验证。File 和 SQLite 中,确认三条较新的更新后,原结论仍待确认,return_attention 却是零。File 上的原生入口在 12 KB、290 条 write_scope 且没有 Codex journal 时,把有效提醒排到后页。

改动思路 / Approach

复用同一 Inbox 的持久回执与读取范围,投影无需另起生命周期。修正提醒依据和物理首读位置,沿用现有确认动作。 先按真实回执筛选未确认结果,再限制提示条数。让无 journal 的读取也在长写入范围之前看到有界身份和 Inbox 入口。

具体改动 / Changes

关键代码讲解

基线 d9432f23544e595f9861fcc6d8453ea926721612 与提交 bf24ca17ba87d69714c39d10fee789d99e1584cd。真实 Inbox 先返回原始结论与三条更新。只确认三个新结果后,agendaResults 仍观察到原结论,unconsumed_return_count=1。当前 peerReturnNeedsAttention 还要求末三条摘录中有未确认项,这三条恰好已确认,return_attention.count=0。独立地,290 条写入范围、12 KB 首读、一个待确认结果的原生调用中,有 journal 的首读含提醒。无 journal 时,capture 有一条提醒,首读页在大范围中耗尽。

规格 loopx/capabilities/manager_context/README.md。核对 explicit_requester_consumption、bounded_identity_only、next_turn_pending_return_visibility。

对主干的风险 / Risks

请求者有合法结果可处理,却可能错过下一轮提醒。两条修复都可使用已有回执与同一 capture 的分页机制。请用未确认结果的 key 和首个物理页的内容分别验收,再从同一 capture 续读完整范围。

语义与 CI 对齐

本地预合并 18 项、186 项 Python、9 项 TypeScript 与类型检查通过。真实 File/SQLite 回执及原生 12 KB 首读复现两个反例。

我的整体评价 / Verdict

请求修改。用尚未确认的结果生成身份提示,把提醒放进无 journal 的实际首读页,并保留原始范围的续读。本次评审覆盖现有宿主与 CLI 行为。使用隔离 File 和 SQLite、真实原生 CLI 与合成回执。生产会话和托管 CI 本次未验证。

English verdict: REQUEST_CHANGES. Request changes. A pending original return is hidden after three newer acknowledgements, and journal-less native openings can page past a valid cue.

…-8644-review-repair-20261113

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 · max

本次评审对应提交 b34af9fff7da9dc7f4d73e41646b6e7fc8c7f201。

无阻塞发现。

动机 / Motivation

下一轮继续处理同伴回传的请求者。一条旧结论仍待确认,后来的三条更新都已确认。旧议程把后三条填进展示,漏掉旧结论。长写入范围也会把有效提醒推到后页。File 和 SQLite 都在 290 项写入范围、12 KB 预算下的首个物理页显示旧结论的身份与 Inbox 命令。正文仍由 Inbox 提供,明确确认后提醒消失。覆盖源码 CLI 和隔离 File、SQLite。已安装会话的实际模型采用与完整成本仍待观察。

改动思路 / Approach

用已有结果回执先筛仍待确认的条目,再限制展示。原 Inbox 继续管理完整结果、读回和显式确认。私有 return_attention 由现有扫描派生,保留身份和状态。原权限、收据与准入继续由原 owner 管理。 现有 Inbox 可用性与读取范围继续决定什么时候可以展示提示。

具体改动 / Changes

关键代码讲解

projectDelegationTurnItem 先挑选待确认身份,再做三条截断。 projectDelegationTurnContext 有界聚合并保留遗漏计数。 managerReturnAttention 将匹配 Inbox 的身份放入早读。 聚合测试覆盖展示上限和坏计数,原生回归覆盖原请求、三条新确认与 290 项范围。说明同步记载了私有提示的字段及读取边界。 turn_context.ts turn_context.ts progressive_context.ts

评审以 d9432f2 的 loopx/capabilities/manager_context/README.md 为准。explicit_requester_consumption 对应旧修订的结果待明确确认才退出。 bounded_private_agenda 对应议程限于身份和状态,正文由作用域内的 Inbox 读取。 next_turn_pending_return_visibility 对应下一轮原生打开保留待确认身份、读取义务和原范围的恢复。 README.md

对主干的风险 / Risks

PASS。旧评审提交 bf24ca1 可重现原结论身份缺失。候选保留原 key,290 项原范围可同 capture 读回,只有请求者明确确认才让结果退出。两版各一条原决策回执、零扣额。工作控制和原 Inbox 的确认权保持。标准预合并检查通过。首屏位置变化只在启用 native delivery 时发生。原始完整议程也展示新增身份和修正后的 returns,消费与准入规则保留。

语义与 CI 对齐

210 项 Python、73 项 TypeScript及类型检查通过。检查同一 reader 上的 #8659,两个开放提交的静态合成树无冲突。当前 main 在本 PR 的触及路径没有新改动。托管 CI 未查询。

我的整体评价 / Verdict

批准。两个旧发现已在当前提交复验。请求者能在继续工作前看到待处理结果,消费仍由原确认路径负责。验证覆盖现有原生入口。覆盖源码 CLI 和隔离 File、SQLite。已安装会话的实际模型采用与完整成本仍待观察。

English verdict: APPROVE. At b34af9f, the original pending return and scoped read appear on the first native page with a wide write scope. Requester consumption still owns acknowledgment.

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.

2 participants