Skip to content

fix(coordination): let an owner close an exact linked user gate on a single-agent goal - #8844

Merged
huangruiteng merged 4 commits into
loopx-project:mainfrom
mojunzi:fix/single-agent-user-gate-override
Nov 16, 2026
Merged

huangruiteng merged 4 commits into
loopx-project:mainfrom
mojunzi:fix/single-agent-user-gate-override

Conversation

@mojunzi

@mojunzi mojunzi commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Self-contained reproduced defect; no issue or roadmap id invented.

  • Goal/source and gap: authority() in loopx/control_plane/coordination/todo_lifecycle_decision.ts consults exactUserGateOverride() only in the multi-agent branch. A goal that registers a single agent therefore falls through to single-agent compatibility, where an owner decision carries no agent actor and is refused with actor_required. The owner cannot close their own user_gate; the only working path is to impersonate the one registered agent with --agent-id, which is an unauthenticated flag. Under handoff_mode: hard_lease the defect has a second layer: terminalFence() requires an execution lease, and an actorless decision has no owner identity, so ownerEligible() is false and allow_user_gate_auto_acquire cannot fire either — the decision is refused with handoff_mode_requires_lease.

  • Observable before → after, with the validation row that proves it: Before, a single-agent goal using soft_claim or hard_lease could not close an exact linked user_gate from the owner terminal without an agent actor (actor_required, then handoff_mode_requires_lease once authority() admits it). After, on single-agent goals (registered_agents.length <= 1), an actorless owner decision (actor_agent_id=None) applies with authority_mode=exact_user_gate_decision_scope_override and lease_fence=not_required (and retires any pre-existing expired lease lineage), while registered actors retain single_agent_compatibility, unregistered or excluded actors remain rejected, and multi-agent hard_lease goals preserve their existing attributed-actor contract (handoff_mode_requires_lease when actor_agent_id=None). Proven by the unit and real_entrypoint rows below, which drive complete_goal_todo(agent_id=None) and App gate.resolve through canonical File and SQLite providers on single-agent ([AGENT_A]) and multi-agent workspaces for soft_claim and hard_lease.

  • Issue/task and intended base: Related to: none (self-contained reproduced defect). Intended base: main.

Author Declaration

  • Written by: model_agent — Google (Gemini 4 Hydrogen)

Implemented against

  • Specification and revision: No written specification; the reproduced defect described in this PR is the basis, together with the invariants already pinned by tests/control_plane/test_canonical_handoff_invariants.py::test_exact_user_gate_completion_preserves_execution_fence and tests/control_plane/test_chat_gate_decisions.py::test_hard_lease_decision_requires_an_attributed_agent at 8ade78c.

  • Criteria:

Criterion (spec clause) Disposition Symbol / path Test or command
An actorless owner decision (actor_agent_id === null) on an exact linked user_gate is admitted on a single-agent goal implemented authority(), loopx/control_plane/coordination/todo_lifecycle_decision.ts tests/control_plane_ts/todo_terminal_decision.test.ts (single-agent goals consult the exact user gate override for owner decisions) and tests/control_plane/test_canonical_handoff_invariants.py::test_owner_closes_exact_user_gate_without_an_agent_actor
Registered, unregistered, and excluded actors keep ordinary single-agent admission rules implemented authority(), registeredTodoMutationRejection() tests/control_plane_ts/todo_terminal_decision.test.ts asserts single_agent_compatibility, actor_not_registered, and actor_excluded
The exact decision-scope link is still required implemented exactUserGateOverride() TS unlinked case and Python unlinked user_gate case both return actor_required
The override grants nothing beyond that one linked gate implemented exactUserGateOverride() unchanged unchanged predicate, no new call sites
An actorless owner gate decision on a single-agent goal needs no execution lease and retires expired lease lineage implemented terminalFence() (registered_agents.length <= 1) tests/control_plane_ts/todo_terminal_decision.test.ts asserts lease_fence: not_required, expired lease retirement (released), active-holder rejection (lease_fence_required), and explicit-fence rejection (handoff_mode_requires_lease)
A registered actor keeps the ordinary lease requirement implemented terminalFence() same TS test asserts handoff_mode_requires_lease; existing test_exact_user_gate_completion_preserves_execution_fence unchanged
Multi-agent admission and hard_lease App attribution contract are unchanged implemented multi-agent branch of authority() untouched; terminalFence() actorless exemption restricted to registered_agents.length <= 1 tests/control_plane/test_chat_gate_decisions.py::test_hard_lease_decision_requires_an_attributed_agent, test_owner_closes_exact_user_gate_without_an_agent_actor (multi-agent parameter arm), and tests/control_plane_ts/todo_terminal_decision.test.ts
  • Self-check before submission: Ran targeted TypeScript decision/runtime/update/completion suites (80 + 89 passed), seven canonical Python coordination/App gate/authority test suites (419 passed, including tests/control_plane/test_chat_gate_decisions.py and tests/control_plane/test_todo_decision_scope_lifecycle.py), ruff check on the modified Python test, scripts/check_rfc_bilingual.py, scripts/generate_semantic_inventory.py, git diff --check, and loopx check --scan-path. Inspected terminalFence() and todo_terminal_lifecycle.ts::releasedLease() to confirm the decision target comes from the existing unblocks_todo_id lookup and expired lease lineage retires atomically with the Todo transition. Deliberately left out: altering excluded_agents handling in the multi-agent exactUserGateOverride() path, relaxing multi-agent hard_lease attribution in App/Chat gate resolution, changing unlinked user_gate authorization without decision_scope / unblocks_todo_id, and modifying the todo update admission surface.

Scope And Continuation

  • Completed scope and remaining work: Complete within this scope for actorless owner closure of an exact decision-scope-linked user_gate on single-agent goals (registered_agents.length <= 1). Registered actors preserve single_agent_compatibility audit mode and registeredTodoMutationRejection() enforcement (registered, excluded, bound, and claim-owner checks). Unlinked user_gate items without decision_scope and unblocks_todo_id remain actor_required by design, and multi-agent exactUserGateOverride() and hard_lease attribution behavior remain unchanged.

  • Slice boundary / successor: The authority admission change and the single-agent actorless terminal-fence exemption are independent: if actorless closure under single-agent hard_lease is not desired, the terminalFence() branch can be reverted without affecting soft_claim.

Validation

  • Tested revision: a29aed1c1e9a8a08c062c70d84b4bfa8d72cebb5
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
unit passed node --no-warnings --experimental-sqlite --experimental-strip-types --test: combined todo_terminal_decision.test.ts, todo_completion_update_runtime.test.ts, deferred_hard_lease_lifecycle.test.ts, and local_authority_runtime.test.ts 80/80; combined todo_update.test.ts, user_completion.test.ts, todo_completion_transaction.test.ts, and todo_update_soft_claim.test.ts 89/89
unit not_run Aggregate npm run test:control-plane across all tests/control_plane_ts/*.test.ts was not run after a29aed1c1e9a8a08c062c70d84b4bfa8d72cebb5 (targeted TS suites above and all 419 Python coordination/App gate tests pass after the final edit)
real_entrypoint passed pytest -q tests/control_plane/test_chat_gate_decisions.py tests/control_plane/test_todo_decision_scope_lifecycle.py tests/control_plane/test_canonical_handoff_invariants.py tests/control_plane/test_coordination_authority_core.py tests/control_plane/test_todo_mutation_authority.py tests/control_plane/test_auxiliary_scoped_gate.py tests/control_plane/test_todo_decision_scope_cli_validation.py — 419 passed, covering App multi-agent hard_lease handoff_mode_requires_lease rejection, single-agent ([AGENT_A]) soft_claim/hard_lease actorless closure, multi-agent soft_claim actorless closure, and unlinked-gate actor_required rejection on File and SQLite providers
static passed ruff check tests/control_plane/test_canonical_handoff_invariants.py passed (All checks passed!); python3 scripts/check_rfc_bilingual.py --base 8ade78c --head HEAD passed; python3 scripts/generate_semantic_inventory.py --changed-from 8ade78c reported 0 candidates; git diff --check clean; python3 -m loopx.cli check --scan-path ... (run with disposable non-existent --registry/--runtime-root flags) reported public boundary scan clean: 3 files
static not_run typecheck:control-plane (node_modules absent in this checkout) and mypy were not run after a29aed1c1e9a8a08c062c70d84b4bfa8d72cebb5
regression_parity passed At base 8ade78c, single-agent authority() omits exactUserGateOverride() (actor_required) and terminalFence() lacks the actorless gate branch (handoff_mode_requires_lease); at a29aed1c1e9a8a08c062c70d84b4bfa8d72cebb5, linked single-agent actorless completion passes across File/SQLite providers while negative controls confirm multi-agent hard_lease actorless rejection (handoff_mode_requires_lease in both test_chat_gate_decisions.py and test_canonical_handoff_invariants.py), unlinked (actor_required), unregistered (actor_not_registered), excluded (actor_excluded), registered hard_lease (handoff_mode_requires_lease), active holder (lease_fence_required), and explicit fence (handoff_mode_requires_lease). Upstream main (cac86bb) has zero changes to these modified files or test_chat_gate_decisions.py since 8ade78c.
integration not_run No PostgreSQL authority store (pg package absent) and no live CLI invocation against a production registry
  • Coverage and gaps: The changed branches are the single-agent arm of authority() (actor_agent_id === null exact-scope override vs. non-null registered/unregistered/excluded actor preservation) and the single-agent (registered_agents.length <= 1) actorless user_gate arm of terminalFence() (no-lease completion, expired-lease retirement, active-holder rejection, explicit-fence rejection, and multi-agent hard_lease parity); all are exercised directly by unit TS tests and File/SQLite Python canonical-authority/App tests. Untested locally after this edit: full npm run test:control-plane aggregate, tsc (typecheck:control-plane), mypy, and the PostgreSQL provider arm.

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: Core control-plane hardening.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A
  • Provider conformance arms run: N/A
  • Read-only legacy/file/PostgreSQL three-arm rehearsal (required for promotion, runtime-routing, or compatibility-projection changes): N/A

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).

A single-agent goal's user_gate todo can never be resolved by an owner
decision: the terminal CLI has no human owner actor, so actor admission
returns actor_required, and exactUserGateOverride was only consulted in
the multi-agent branch. The gate stays open forever unless a human
implements the ruling by acting as the registered agent (outside the
gate's intent).

Consult the exact linked user gate override before single-agent
compatibility, mirroring the multi-agent branch. The override still
requires command=complete, role=user, task_class=user_gate, a non-null
decision_outcome, and the exact decision-scope link to the unblocked
todo; it grants nothing beyond closing that one linked gate. Registered
actor admission is unchanged.

Observed on a real single-agent goal: todo complete --role user without
--agent-id was rejected with actor_required even for the project owner
on their own machine.

Test: todo_terminal_decision.test.ts 20/20; full control-plane suite
matches the pre-change baseline (6250 pass / 18 pre-existing missing-
optional-dependency failures) plus the new test (6251 pass).

Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
A single-agent hard_lease goal could not resolve its exact linked user gate
from the owner terminal: authority() now admits the exact-scope override, but
the terminal fence still demanded an execution lease that an actorless
decision can never hold.

A user gate records a decision rather than executing work, so the actorless
exact-scope override is admitted without a fence. A registered actor keeps the
ordinary lease requirement, and an active holder or explicit fence is never
bypassed.

Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
…wners

In single-agent goals (registered_agents.length <= 1), check registeredTodoMutationRejection whenever actor_agent_id is non-null before consulting exactUserGateOverride. Registered actors retain single_agent_compatibility authority mode, while unregistered or excluded actors remain rejected even when the decision-scope link matches.

In terminalFence(), retire any expired lease lineage to status released on the actorless exact-scope user_gate completion path, matching the user_action and deferred supersede transitions.

Parametrize test_owner_closes_exact_user_gate_without_an_agent_actor across both single-agent and multi-agent workspaces, pin unlinked actor_required rejection, and add TypeScript assertions for unregistered/excluded single-agent actors and expired/active/fenced lease handling.

Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 02:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@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

评审提交 4d35dd18be02056b48bd2513f3701638e47831c0,验证主干 f38fae05bb9a1c2cc54a2641359224cc253d32ac。GitHub 差异分叉点为 8ade78cddeb6bdcd947c0a81507393c4599c7652。

[P2] 协调 App 多 Agent 门禁的归属条件。 单 Agent CLI 修复成立,仍需处理共享规则改变 App 多 Agent hard_lease 归属条件的差异。 位置

动机 / Motivation

在单 Agent Goal 中审批待办的用户,以及从 App 审批同类门禁的用户。 单 Agent 的终端调用返回 actor_required。多 Agent 的 hard_lease 调用会继续要求执行租约,App 同样拒绝缺少 agent_id 的预览。 双 Agent 的 hard_lease Goal 中,App 用户预览并确认缺少 agent_id 的 approve。门禁准确链接待办,且没有活跃租约。 主干预览拒绝并保持门禁 open、依赖 blocked。候选在 File 和 SQLite 均允许预览与确认,依赖变为 open。现有 App 与 scope 套件从 20 项通过变为 19 项通过、1 项失败。

真实 todo complete 在 File 和 SQLite 上各覆盖单 Agent 与多 Agent、soft_claim 与 hard_lease。候选的八种组合均提交了精确门禁,保留其他条件。同一请求重放不写入,冲突的 reject 重试也不写入。 本次只涉及用户决定的原终态事务,且明确保留真实 Agent 工作任务的租约。

改动思路 / Approach

精确范围和租约仍由现有终态事务维护。共享例外影响 App 默认,需以实际受影响的路由界定准入。 保留单 Agent CLI 修复与原子写入,在同一 PR 核对 App 多 Agent hard_lease 的支持范围。 沿用精确 scope 与终态事务。继续依赖操作者填写 Agent ID 会保留已有操作摩擦,增加第二套终态接口会分裂权限判断。

具体改动 / Changes

完整差异为 3 个文件,+267/−2。终态判定复用原范围匹配函数。新增分支让无活跃租约且无显式 fence 的精确门禁由原事务完成。

docs/product/core-control-plane/state-machine.md 在 f38fae05bb9a1c2cc54a2641359224cc253d32ac 的 Approve。完成准确链接的 user_gate,消耗目标待办中被该决策覆盖的范围,保留独立条件。 当前实现 契约

关键代码讲解

  • authority。单 Agent 时沿用具名 actor 注册与归属检查,并准入 actorless 的精确用户门禁。 CLI 单 Agent 之前返回 actor_required,候选通过。 代码
  • terminalFence。允许无活跃租约、无显式 fence 的 actorless 精确用户门禁完成。 同一分支对多 Agent 的 hard_lease 也生效。 代码
  • ChatActionService._run_gate_resolve。将可选 agent_id 与 owner-confirmed typed action 转发到共享终态规则。 相同 App 请求从拒绝变为可确认,读回依赖恢复。 代码

对主干的风险 / Risks

116 项真实 canonical provider 测试、21 项 TypeScript 终态测试及 typecheck:control-plane 通过。现有 App 测试在主干和候选有 1 项净差异。 同一 App 套件在不可变主干通过,原文件中无候选测试改动。候选的新增终态分支直接改变现有多 Agent 入口。 主干 App 回归

明确用户决定的准入条件是否适用于 App 多 Agent 模式。保留该 App 条件,或在同一修改中明确覆盖该入口并补齐预览、确认、无效具名 actor、活跃租约和 readback 对照。 复验命令为 uv run --extra test python -m pytest -q tests/control_plane/test_chat_gate_decisions.py tests/control_plane/test_todo_decision_scope_lifecycle.py。

我的整体评价 / Verdict

REQUEST_CHANGES。 单 Agent CLI 修复成立,仍需处理共享规则改变 App 多 Agent hard_lease 归属条件的差异。 保留当前 TypeScript 终态规则和原 provider CAS。在共享入口定义一致的用户决策范围,消除 App 归属契约与实际行为不一致。 变更涉及 App 操作的准入与读回。没有修改界面渲染,已核验 App preview/apply 和现有 HTTP 测试。 PostgreSQL 实例与已部署 App 未运行。远端 CI 未查询;已运行的 App API 逻辑使用真实 File 和 SQLite。

English verdict: REQUEST_CHANGES at 4d35dd1. The single-agent CLI fix works. Align the shared actorless hard-lease exception with the existing multi-agent App gate contract and its preview/apply regression coverage.

// override is admitted this way; a registered actor keeps the ordinary lease
// requirement below, and an active holder or an explicitly supplied fence is
// never bypassed.
if (request.command === "complete" && authorityMode === "exact_user_gate_decision_scope_override" &&

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] 协调 App 多 Agent 门禁的归属条件。 双 Agent 的 hard_lease Goal 中,App 用户预览并确认缺少 agent_id 的 approve。门禁准确链接待办,且没有活跃租约。 主干预览拒绝并保持门禁 open、依赖 blocked。候选在 File 和 SQLite 均允许预览与确认,依赖变为 open。现有 App 与 scope 套件从 20 项通过变为 19 项通过、1 项失败。 明确用户决定的准入条件是否适用于 App 多 Agent 模式。保留该 App 条件,或在同一修改中明确覆盖该入口并补齐预览、确认、无效具名 actor、活跃租约和 readback 对照。 主干 App 回归

…-agent goals

Multi-agent hard-lease goals require an attributed actor when closing an exact linked user gate from the App/Chat route (pinned by test_hard_lease_decision_requires_an_attributed_agent). Restrict the actorless exact_user_gate_decision_scope_override terminal-fence exemption in terminalFence() to single-agent goals (registered_agents.length <= 1), leaving multi-agent hard-lease admission unchanged.

Update todo_terminal_decision.test.ts and test_canonical_handoff_invariants.py to verify multi-agent hard_lease actorless calls still reject with handoff_mode_requires_lease while single-agent hard_lease and soft_claim actorless calls pass.

Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
@mojunzi

mojunzi commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Updated in a29aed1 to address the [P2] review finding:

  • Restricted the actorless exact_user_gate_decision_scope_override lease exemption in terminalFence() (loopx/control_plane/coordination/todo_lifecycle_decision.ts) to single-agent goals (registered_agents.length <= 1).
  • Preserved the existing multi-agent hard_lease App contract (handoff_mode_requires_lease when actor_agent_id=None), and updated tests/control_plane_ts/todo_terminal_decision.test.ts and tests/control_plane/test_canonical_handoff_invariants.py accordingly.
  • Re-verified locally on a29aed1c:
    • pytest -q tests/control_plane/test_chat_gate_decisions.py tests/control_plane/test_todo_decision_scope_lifecycle.py tests/control_plane/test_canonical_handoff_invariants.py tests/control_plane/test_coordination_authority_core.py tests/control_plane/test_todo_mutation_authority.py tests/control_plane/test_auxiliary_scoped_gate.py tests/control_plane/test_todo_decision_scope_cli_validation.py -> 419 passed (including test_hard_lease_decision_requires_an_attributed_agent).
    • Targeted TS decision/runtime/update/completion suites -> 80/80 and 89/89 passed.

@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

评审提交 a29aed1c1e9a8a08c062c70d84b4bfa8d72cebb5,对照主干 cac86bbad92ba99c3430b3f7eaa9632727573821。

动机 / Motivation

使用单 Agent Goal 的所有者需要从终端或 Chat 确认精确链接的待办,让对应任务恢复。
单 Agent Goal 有一项被明确门禁阻断的任务。用户从 CLI 完成门禁,或在 Chat 预览并确认,未填写 Agent ID。
File 和 SQLite 上单 Agent 的 CLI 与 Chat 均能完成门禁。对应依赖打开,无关待办仍阻断,也没有新租约。双 Agent hard_lease 继续拒绝无归属请求。
交付限于本地终态事务的精确、无 Agent 身份的用户决定。既有具名执行与远程受认证的 Agent 操作沿用原入口。

远程认证边界经过源码检查和可运行的 13 项测试。真实 PostgreSQL 集成用例 9 项跳过,未认证安装态宿主。

改动思路 / Approach

CLI 与 Chat 共享终态准入,复用精确门禁有助于保留作用范围。由原 provider 事务一次记录决策、依赖和回执。
批准仅限单 Agent Goal 的精确门禁关闭。多 Agent hard_lease 继续要求可归属的 Agent 以及适用的执行栅栏。
规范已定义的 decision_scope、required_decision_scopes、unblocks_todo_id,加上提交当前的 Agent 集合和 lease 状态。
精确单 Agent 用户决定可进入原终态事务,关闭目标门禁并消耗被覆盖范围。只在没有活跃或显式 fence 时免执行租约。
原终态 CAS 保证状态读回。Chat 同提案重放返回原回执,未创建租约。App 的双 Agent hard_lease 无归属请求仍受原拒绝规则限制。
在已有 authority 与 terminalFence 中复用一次精确匹配和单 Agent 例外,让同一终态事务处理作用范围与状态。

具体改动 / Changes

GitHub 与本地精确 diff 一致,共 3 个路径,新增 296 行,删除 2 行。批准仅限单 Agent Goal 的精确门禁关闭。多 Agent hard_lease 继续要求可归属的 Agent 以及适用的执行栅栏。
从上一轮候选到本头,生产差异在 terminalFence 为 actorless 豁免增加注册 Agent 数量限定。整个 PR 仍比较精确门禁事务、CLI 和 App 两个入口。生产文件净增 27 行,其余为回归。

在 8ade78cddeb6bdcd947c0a81507393c4599c7652 的 docs/reference/protocols/decision-scope-v0.md 核对接受条件。 规范

  • exact_link_and_scope。只有带作用范围并精确链接的 user_gate 可以消费其匹配范围。 无链接仍 actor_required,两个后端公开 CLI 读回不相关任务仍 blocked。
  • preserve_other_scope。保留未覆盖作用范围和拒绝状态。 已链接依赖恢复,独立有作用范围的任务和其未链接门禁分别保持 blocked 和 open。
  • atomic_resume_and_receipt。旧事务同次提交门禁、依赖状态及结果回执。 真实 App 201/200/200 重放同一回执,canonical revision、Todo 和 lease 字段未再次变动。

关键代码讲解

  • exactUserGateOverride。要求 user_gate 精确链接并匹配目标的作用范围。 代码
  • authority。无 Agent 身份的单 Agent 输入复用精确例外,具名 actor 先走原校验。 代码
  • terminalFence。单 Agent 原范围内免新租约,活跃持有者及显式 proof 仍受栅栏。 代码
  • ChatActionService.preview。gate.resolve 通过现有 canonical preview 持有 exact head basis,无第二套状态判断。 代码

对主干的风险 / Risks

输入与入口 基线 当前提交
单 Agent,无归属精确门禁,soft_claim 和 hard_lease(File/SQLite CLI) actor_required,状态保持 门禁 done,目标 open,零租约
单 Agent,hard_lease 无 Agent(File/SQLite HTTP) 400 actor_required 201 预览、200 确认、200 同回执重放
双 Agent,hard_lease 无 Agent(File/SQLite CLI/HTTP) handoff_mode_requires_lease 同错误,门禁 open、目标 blocked
双 Agent,soft_claim 既有精确门禁(File/SQLite CLI) 成功 同成功,零租约
未链接、作用范围不相同(File/SQLite CLI) actor_required,无关依赖 blocked 同错误,另一任务与需求保留
  • PASS 当前主干对照的精确门禁。24 条主干/新头记录。单 Agent 两模式 CLI 放行,hard_lease App 通过确认及无副作用重放。
  • PASS 双 Agent 归属和不相关目标。双 Agent hard_lease 同原拒绝,未链接门禁和其他任务保持原状,任意显式/活跃 lease 情形有单独反例。
  • PASS 仓库预合并。预合并 quick 与 3 个 catalog 安全检查通过,差异合树无冲突。
  • PASS Python 协调和定向 TypeScript。当前头 Python 419 项和 TypeScript 108 项通过,主干相关 App/scope 两套件 20 项通过。
  • UNVERIFIED 远程 Agent 认证入口。13 项可运行测试通过,9 项 PostgreSQL 集成跳过。此远程路径固定 authenticated actor 和 expected_role agent,无 owner gate 操作。

语义与 CI 对齐

保留目标的精确 scope 和原租约拒绝优先顺序。注册 actor 原判定路径与远程 Agent 执行调用不变。
同错误,门禁 open、目标 blocked
PR 说明列出单 Agent CLI/App 的准入改动,补上原先多 Agent hard_lease 归属不变的反例。限定既有输入组合,无全局功能开关。
远端 CI 按本次评审配置未查询。

我的整体评价 / Verdict

APPROVE。 无阻塞发现。上一轮的多 Agent hard_lease 归属回归已由当前头的真实 File/SQLite CLI 与 App 对照验证。单 Agent 的精确关闭保留原范围及事务。
匹配的 User 决策可恢复对应任务;独立任务仍保留各自 gate。重放原回执不再次写入。
用户不需从聊天或终端补填 Agent ID,App 原预览、确认与精确结果沿用当前界面。
已追踪 Chat gate.resolve 的现有 preview/apply 路径。本次三文件改动没有呈现、布局或文案变化。

远程认证边界经过源码检查和可运行的 13 项测试。真实 PostgreSQL 集成用例 9 项跳过,未认证安装态宿主。

English verdict: APPROVE. The exact single-agent owner decision now completes over both local providers, and multi-agent hard-lease attribution and existing scope boundaries remain intact.

@huangruiteng
huangruiteng merged commit f15ebdd into loopx-project:main Nov 16, 2026
3 of 5 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.

4 participants