Skip to content

Count benchmark worker quota guards in trajectory usage - #8841

Merged
loopx-agent merged 128 commits into
mainfrom
codex/benchmark-worker-wake-request-attribution
Nov 18, 2026
Merged

loopx-agent merged 128 commits into
mainfrom
codex/benchmark-worker-wake-request-attribution

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

结果

让轨迹登记识别 benchmark worker 的单个字面量 quota guard,同时保留原 UTC 形式。修复独评指出的重复参数问题:追加 --turn-instance-id=other-turn 后,实际 CLI 使用另一 Turn,旧解析器却仍把原调用归为 LoopX。现在空格和等号两种重复写法都保持未分类,沿现有工作台呈现未知归属。

在同一集成基线中比较原解析器和修复解析器,使用完全相同的六份合成原生轨迹、真实 trajectory-pack-register / trajectory-packs 入口,以及实际 CLI parser 的最终 Turn:

输入 原解析器 修复后
UTC / worker,单次绑定 识别 1 次 识别 1 次
UTC / worker,空格重复覆盖 未分类 1 次、份额未知 相同
UTC / worker,等号重复覆盖 错误识别 1 次、份额 100% 未分类 1 次、份额未知

每对原始轨迹 SHA-256 相同,原生输入计数始终为 100 tokens;改变的是后两种等号反例的命令归因。合成计数不代表实测费用或收益。

实现与边界

测试提交 0f0db6a210ae349f25f3ac29842c300217e6bef4;集成基线 684400582063e16d6c460b005598714f03ae380b。保留原 8246b40fe84578684e3d1be4b8bc545e8a3a5a73 为 merge parent,正常快进原分支,所有新提交 DCO 签署。

沿 builtin benchmark-toolkit 的现有 Python capture adapter 和 TypeScript 请求 reconciler,只在原受限两行 guard 中核对完整选项名。复用原 native 登记测试表;相邻边界无需新增 shell parser、状态层、capability、配置或协议字段。当前 worker 的 wake-<clock>-<hex> 生成器和现有 App 的未知值消费已核对。既有关闭采集、动态/复合命令、原生 response 去重和历史读取边界保留。

验证

  • 三模块 125 passed,包含真实登记/读回、关闭/缺失/未知来源、响应关联、文件完整性及使用脚本化 Provider 的存储流程。
  • 23 项 TypeScript 工具返回、原生请求计数和比较测试通过;三文件 Ruff、配置范围 mypy 17 文件、DCO、双语 RFC diff 和四路径公开边界检查通过。
  • 六例同输入真实 CLI 前后对照:旧解析器复现两项错误归因,修复后全部符合独立语义预期;原生计数和原始文件不变。
  • 完整 standard premerge 的 6 项 direct + 15 项 selected 全部执行通过,0 failure / 0 warning,严格 CQR 有效。整道自动门仍为 manual_review_required,仅保留原 benchmark_sensitive 维护者审查条件;新头独评和实际合并尚未完成,未将整门改称通过。

首次 Python 整套结果为 122 passed / 2 failed / 1 error,日志包含 ENOSPC。回收可重建的验证依赖缓存、使用独立临时目录后,同一 125 项在原断言与预算下通过;初次失败保留。一次误用未安装 tsx 的启动失败发生在测试执行前,最终采用仓库声明的 Node strip-types 方式。没有新增该依赖或放宽检查。

实际模型、worker 任务、安装态、真实费用和长程收益未测。现有界面与字段结构未改,本片验证真实 CLI 登记和相同投影 owner;不宣称已安装 App 体验资格。新精确头仍需独立复审,旧头的求改结论不自动消除。

English: Recognize literal worker guards while keeping either duplicate Turn-option spelling unclassified. Native totals and capture bytes remain unchanged; exact-head independent review and merge qualification remain separate.

公开比较边界

原 PR 当前仍固定旧基线 f3bdad2387397e078fbc887e7cb7ed80adaf7510,因此 PR 文件视图显示 521 文件、+35,725/-38,581,包含集成主线历史。实际源头保持 0f0db6a210ae349f25f3ac29842c300217e6bef4;与当前目标 b03e7b66eddb3aee8fa804f1030f99d7605c6bad 的真实三点比较为 4 文件、+43/-11,merge base 为 684400582063e16d6c460b005598714f03ae380b。查看精确版本比较。

该差异已用 Git 和 GitHub compare API 交叉核对,未把显示异常当作额外产品变更。本次没有修改 PR 的目标元数据;按仓库政策,刷新同名基线需要协调独占目标编辑权。该展示差异和新头独评仍是交付余项,实际合并资格单独检查。

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)

评审提交 8246b40fe84578684e3d1be4b8bc545e8a3a5a73,目标基线 f3bdad2387397e078fbc887e7cb7ed80adaf7510。

[P2] worker 轨迹仍会接纳用等号覆盖 Turn 的重复参数。 在真实 benchmark trajectory-pack-register 路径,用同一 worker guard 追加一个 --turn-instance-id=other-turn。配额 CLI 实际采用 other-turn,轨迹登记却认出 1 个请求,并把该样本的请求输入全部归给 LoopX。使用分隔写法追加同一个参数时,登记得到 0 个已识别请求和 1 个未分类调用。在现有 argv 校验中核对选项名,使分隔参数和 --turn-instance-id=… 都参与重复检测。对 worker 与 UTC 的单绑定、等号覆盖和分隔覆盖提交相同 native 轨迹登记夹具,并读回已识别和未分类计数。 新增 worker 格式 · 重复检测

动机 / Motivation

这个问题影响用轨迹工作台评估 LoopX 工具调用开销的维护者和研究者。worker 执行一次预算入口,原登记识别不了它生成的 Turn 字符串。该请求进入未分类项,比较时看不到它的工具返回和请求输入。候选能读出正常 worker 的单个调用。等号写法重复指定 Turn 时,候选没有保留约定的未分类状态。评审使用合成原生记录和真实源码 CLI 注册与读回,覆盖归因与现有计数。实际运行的历史样本和费用未测。

改动思路 / Approach

同一 Python 解析入口识别字面量,现有 TypeScript reconciler 按宿主的响应顺序归因。两者已经满足这项工作所需的来源与读回。当前 PR 的边界是现有可选采集中新增 worker Turn 的字面量识别,保留单绑定约束和原生响应关联。 原命令解析已经识别两行的 UTC 形式,扩展该处即可恢复 worker。允许任意赋值形态会放宽动态命令边界,也没有证据需要在 TypeScript 另写一个 shell 解析器。

具体改动 / Changes

关键代码讲解

  • _TURN_ASSIGNMENT 和 _argv 接受 worker 的 wake-<clock>-<hex>,对已识别的两行命令仍检查一个精确的带引号占位符。原 UTC 文本照常归因。 字面量分支

  • _literal_exec_argv 解包单一静态 exec 调用,随后 project_tool_context 使用原响应与位置提取数据。回传字节与请求 token 继续分别计算。测试增加 worker 与动态赋值的对照。 静态入口 · 响应投影 · 范围用例

规范 docs/reference/trajectory-assessment.md @ f3bdad2387397e078fbc887e7cb7ed80adaf7510。 原采集规范

  • literal-quota-argv 未满足。正常 UTC 与 worker 都可读回,等号重复参数仍进入已识别集合。
  • native-response-association 已实现。候选通过已有响应 reconciler 关联正常 worker,已归因的原生请求包含 100 个输入 token。
  • capture-opt-in 已实现。关掉采集扩展时公共投影匹配原读回,原轨迹文件字节保持一致。

对主干的风险 / Risks

配对样本使用同一份静态响应和返回。主干两种重复 worker 参数都未分类。现头只漏掉等号写法的检查,等号样本的请求输入比例从未知变为 100%,还把 8 个返回字节计入 LoopX。这个比例来自单请求的合成样本。正常 worker、旧 UTC、复合 shell 和未启用选项的对照均达到预期。

语义与 CI 对齐

Python 基线 119 项、候选 120 项通过,候选 TypeScript 21 项与 Ruff 通过。标准 premerge 的 6 项直接检查和 15 项选中检查均通过。benchmark-sensitive 仍需维护者审查。 仓库的标准 gate 单独保留 benchmark-sensitive 的人工审查。托管 CI 未查询。代码沿用现有 capture 和 request-usage 字段,兼容缺口是被扩大的旧重复参数检查。对 worker 与 UTC 的单绑定、等号覆盖和分隔覆盖提交相同 native 轨迹登记夹具,并读回已识别和未分类计数。

我的整体评价 / Verdict

请求修改。直接补现有参数校验即可让这项局部改动完整保住归因边界。长程比较会受错误认领影响,CLI 注册和读回本身可正常使用,受影响的是同一请求的已识别状态。现有工作台消费同一投影,视觉检查不适用。

English verdict: REQUEST_CHANGES at 8246b40. Worker registration works, but an equals-form duplicate overrides the actual guard Turn and is incorrectly counted as a recognized request.

cocolord and others added 26 commits November 16, 2026 08:30
* Restore Goal stop and resume in standalone Core

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

* Preserve native controller lifecycle ownership

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

* Check stopped Core Turns through their execution effects

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

* Verify stopped Host execution independently of unknown effects

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>
* fix(quota): bound unchanged prior-turn recovery admissions

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

* fix(quota): retain recovery epoch across controller activation

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

* Retain the latest owner resume through controller lifecycle transitions

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

* Commit bounded recovery grants against current receipts

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

---------

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Co-authored-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* control_plane/testing: single-source the actor-result field set

onboarding_model_behavior_qualification restated _ACTOR_RESULT_FIELDS as
_RESULT_FIELDS while already importing three private helpers from
model_behavior_qualification -- the strongest form of the duplicate-knowledge
case. It now borrows the owner object and the restated name is retired.

The by-name semantic inventory cannot see this pair: _RESULT_FIELDS is bound
to different value sets in two other modules, so by name it is a fork, not a
twin. The new guard keys on the folded value instead -- a whole-tree census,
identity, retirement, and behavioural parity through both normalizers.

Refs #4447.

Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>

* control_plane/testing: scope actor-result field guard to its entry points

The loopx-agent review flagged the whole-package folded-value census as
over-broad: it treated any independent same-value data as a restatement,
including an ordered preview_columns() presentation tuple that merely
happens to share the four members. Reuse requires the same semantic slot,
scope and contract, not merely equal members.

Narrow the enforcing assertion to the two actual validation entry points:
the owner states the set exactly once, the consumer borrows it and states
it nowhere. Demote the whole-package same-value scan to advisory (RFC
semantic-vocabulary-convergence-v0 same_value_candidates_advisory) so
independent data is reported for review, never an enforcing failure.

Object identity and normalizer behavioural parity are unchanged, so a
migration that silently altered the accepted keys still fails here. Add a
tmp_path regression that distinguishes a real consumer restatement (bitten)
from a legitimate independent presentation tuple (advisory only).

Test-only change; production owner and consumer are untouched.

Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>

* control_plane/testing: key actor-result field guard to the field binding

The entry-point enforcement scanned every same-value literal in the owner
and consumer files, so independent presentation data in the same file (an
ordered preview_columns() tuple) folded to the field set and failed the
guard, while the identical function in a third module passed.

Scope enforcement to the field binding itself: the owner binds
_ACTOR_RESULT_FIELDS exactly once at module level and the consumer borrows
it (identity) and binds no field set of its own. Every other same-value
literal -- including same-file presentation data -- is advisory only per
the RFC same_value_candidates_advisory; the normalizers' accepted keys stay
pinned by behavioural parity.

Guard 21 passed; model-behavior/onboarding focused 210 passed; the
reviewer's preview_columns() injection into the real owner/consumer files
no longer enforces while a genuine restatement still bites. Net regression 0.

Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>

* control_plane/testing: pin actor-result normalizers to the owner object

The binding-name enforcement missed a renamed equal-value local copy that
takes over the unknown-key check while the imported owner object is kept
only for display: identity, binding and behavioural parity all passed, yet
validation silently fell back to a local copy.

Add a distinguishable-set usage regression: perturb the borrowed
_ACTOR_RESULT_FIELDS and require each normalizer's unknown-key rejection to
follow it. A renamed local copy ignores the perturbation and fails the test.

Guard 23 passed; model-behavior/onboarding focused 210 passed; the renamed
local-copy attack is caught while the real consumer tracks the owner object.
Net regression 0.

Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>

* control_plane/testing: pin actor-result field checks in both directions

The usage regression only removed a member from the shared field set, so an
onboarding validator that also applied a renamed local equal-value cap kept
passing: the removed key was absent from both sets, while a field added to the
shared definition was still rejected by the local cap. Probe both directions on
each entry point's own known-legal result: an extension field in the shared set
must be accepted with the canonical projection unchanged, and a removed member
must be rejected by name.

Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>

---------

Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>
Co-authored-by: psychologister <230141834+psychologister@users.noreply.github.com>
* fix(quota): require compute allowance for fresh replan admission

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

* Preserve admitted replan recovery when the compute window fills

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

* Cover admission state in scoped replan receipt tests

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

---------

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Co-authored-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* fix(replan): accept a same-second whole-second historical ACK

historicalAckDelta still required generated > admitted at microsecond
precision. Compact generated_at is the whole-second run clock, while
admission guard_recorded_at is often fractional inside that second, so
an exact later ACK was dropped and the original receipt-bound Turn
stayed unsettleable.

A whole-second stamp at or after the admission second is post-admission.
A fractional stamp still has to be strictly later than the admitted
instant. Earlier fractions and the previous whole second stay rejected.

Signed-off-by: Duang777 <duangjl007@gmail.com>

* fix(replan): require writeback order for same-second historical ACKs

A whole-second generated_at cannot separate an ACK written before
admission from one written after it. Same-second recovery now requires
the original refresh_state event bound to the Goal, Agent, obligation,
and ACK Turn, with both its recorded time and log position after
admission. A generated_at that is already strictly later keeps the
precise path. Missing or conflicting order leaves the obligation pending.

Signed-off-by: Duang777 <duangjl007@gmail.com>

* fix(replan): bind same-second ACKs through the Todo receipt

A Todo-bound refresh records the obligation on the accepted semantic
delta and leaves replan_obligation_id empty on the rollout event.
Match that event by the Todo settlement receipt, and keep the time
and log-order checks. Historical events that omit the field still
bind when the receipt agrees. The writeback qualifier calls the
shared reader instead of loading events itself.

Signed-off-by: Duang777 <duangjl007@gmail.com>

* fix(replan): require a positive writeback identity for same-second ACKs

A historical index can omit the Todo and effect. An empty comparison
then accepted a same-second refresh for a different Todo. Bind only
when the event obligation equals the accepted semantic delta, or its
Todo and effect equal the ACK receipt. Fill a missing index identity
from that turn's heartbeat receipt. An event with no identity stays pending.

Signed-off-by: Duang777 <duangjl007@gmail.com>

---------

Signed-off-by: Duang777 <duangjl007@gmail.com>
* Preserve distinct same-second replan work evidence

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

* Verify Todo settlement identity before crediting replan work

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

* Preserve legacy Turn evidence and qualify replan decisions

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

* Qualify settlement evidence against its scoped history

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Route Chat image reads, Feishu repair descriptors and native child receipts through the existing digest owner. Carry the native-inbox prerequisite from #8266 independently of the C1 integration.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Exercise matching and changed live Todo recovery through the real CLI. Read the Steward terminal delivery at the accepted recovery presentation key. Preserve the core recovery expectations also covered by the broader C1 integration.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* Recheck the original Lark message before a recovered reply

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

* Verify the source on both retained Lark answer paths

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* Load Lark conversation settings before delivery diagnostics

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

* Refresh Lark authorization while diagnostics are pending

Start each refresh with its own cancellation signal. A newer authorization read invalidates the previous diagnostic result and timer, including when a binding was revoked outside this session.

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

* Test Lark steward scope through staged settings reads

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

* Refresh Lark authorization while slow diagnostics run

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

* Return verified Lark disconnects before diagnostics

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

* Allow Lark connection setup when the list is unavailable

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

* Acknowledge Lark connection before scanning delivery diagnostics

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

* Keep conversation find scrolling in the selection layout pass

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: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
* docs: add Japanese README

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>

* docs: sync Japanese README with Goal lifecycle and route it through README checks

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>

---------

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…eout (#8854)

A replan admitted for a Monitor's no-change streak lost its receipt
source once the agent completed the Monitor inside that Turn, so the
same Turn's writeback and guard re-entry failed with
heartbeat_receipt_identity_conflict. Treat the streak as a scalar review
source, with a fixed kind precedence independent of trigger order.

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Preserve requested scheduler detail during recovery waits

Prior-Turn recovery rebuilds the scheduler hint when the unchanged admission limit is reached. Forward the CLI detail selector to that projection so the DSH Driver receives the bounded recheck cadence it requested.

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

* Keep App scheduler reconciliation executable during recovery waits

Reuse observed host cadence and persisted backoff when projecting a prior-Turn recovery wait. Preserve the registered scheduler scope and place CLI options after the standalone interpreter prefix so the matched host can be acknowledged using the original receipt.

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Revalidate the captured Session and combined admission signal before publishing a queue or scheduler wait plan. Cover Pause and native maintenance cancellation for both plans, followed by a fresh evaluation.

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

* fix(monitor): project User gate completion for an observed prerequisite

An admitted due Monitor that still has open User gates now gets the
existing User lifecycle completion command ahead of its poll actions,
on unchanged observations too. The Monitor Turn's settlement identity
stays separate; observation never grants approval.

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>

* fix(monitor): never project a User gate completion from an observation

Replace the projected completion command with a read-only notice. A due
Monitor that is admitted while the agent has open User gates is told that
its observation cannot complete or approve a gate, which attempts stay
rejected, and that work continuing on an observed change belongs in the
poll's own successor. Unrelated owner decisions receive no command.

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>

* fix(monitor): do not point an observation at any User gate

The notice told the agent to report the observed evidence as the pending
user action of an open gate, even when the gate was unrelated to the
observation. Keep only the boundary (an observation never completes or
approves a gate) and the original poll.

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
#8584)

* fix(turn): enable builtin Codex durable Todo completion

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

* fix(turn): validate terminal Todo before accountable refresh

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

* refactor(turn): remove redundant lease shape check

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

* Recheck the original Goal after built-in Codex validation

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

---------

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Co-authored-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Co-authored-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…rk-app-feedback-writeback-20261116

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>
loopx-agent and others added 24 commits November 17, 2026 23:57
…ation-20261117t1346

test(workspace): await native follower teardown before counting subscriptions
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
#8883)

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* docs: add LoopX community quickstart and FAQ

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

* docs: start LoopX onboarding in the user’s assistant

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ate chat_store locks, and retire ceiling (#8909)

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

* fix(canary): escape a pathname the report cannot spell

`os.fsdecode` keeps the bytes of a name that is not valid UTF-8 as lone
surrogates (PEP 383). The maintainability report and the public-boundary
scan both projected such a path, its module name and the finding id straight
into their payload, and both commands write JSON with
`json.dumps(..., ensure_ascii=False)`. The result was a failing report whose
stdout carried the original bytes, so a strict UTF-8 consumer could not parse
it at all -- the finding that named the file could not be read, and the file
could not be located from the report.

Paths now pass through `display_path_text`. A decodable name is unchanged,
so every existing report and reviewed exception id keeps its spelling. An
undecodable one is written as `git-bytes:<repr(bytes)>`, the marker the
issue-fix artifact already uses, which keeps the record's exact bytes and
keeps two distinct byte records distinct. The escape happens where a path is
projected into the report; matching, budget lookup and enumeration still use
the raw identity.

Verified on macOS with the plain and CR cases and by the payload
serializers; the new POSIX tests build a real Git index with plain, CR and
undecodable names and read the two commands' JSON back, so the Linux lane is
where the undecodable bytes are exercised.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(canary): keep one label per Git record and read the root as bytes

The display escape introduced for undecodable names was not injective: a
tracked file whose own name spells `git-bytes:b'...'` produced the same label
as the undecodable record, so one finding label named two files and a consumer
could neither locate nor deduplicate them. A decodable name that opens with the
reserved prefix is now escaped the same way, which keeps ordinary names and
every reviewed exception id unchanged while making the label space disjoint.
`display_path_bytes` recovers the record behind a label.

The worktree root was still rebuilt from a text read. `git rev-parse
--show-toplevel` answers with one pathname; the text read turns a CR or an LF
inside a legal directory name into a line break and an undecodable byte into
U+FFFD, and `strip()` also removed a trailing CR the name really carried. The
rebuilt root then named no directory, `_tracked_scan_files` returned nothing,
and a repository whose root cannot be spelled with UTF-8 reported a clean
pruned-directory scan instead of the tracked files inside it. The root is now
read as bytes and only Git's own terminator is removed, with an unanswered
probe keeping the existing unverifiable state.

Verified on macOS and in a Linux container (Git 2.54.1, Python 3.14): the real
Git fixtures now cover a CR root, a 0xFF root, a tracked 0xFF name, and a plain
name that spells the escape label. Both commands keep their JSON parseable, the
two labels stay distinct and reversible, and the old readers fail these tests.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(check): keep project-local config paths decodable in the report

The check report already kept Git record labels, but it still wrote the
registry, the runtime root and any warning that quoted either one verbatim.
With a legal worktree root that UTF-8 cannot spell and both config paths
inside that repository, the scan found the tracked files and exited 1 while
its stdout carried raw bytes: a strict reader could not decode it and an
automation could not name the findings it did locate.

The report boundary now projects every string once. Known path fields keep the
existing whole-record `git-bytes:` label, and a diagnostic that quotes a path
escapes only the byte run it cannot spell, so the sentence stays readable and
`display_path_bytes` recovers the record. Ordinary text and ordinary paths
keep their original spelling, and the boundary scan carries its own path
strings through the same projection.

Verified on macOS with the display unit tests and the existing plain, CR and
record-label fixtures; the new project-local fixture is a real Linux Git case
that runs where the filesystem holds a raw byte name and skips otherwise.
Windows, installed distributions and hosted CI were not exercised here.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* test(check): compare the whole pathname each label recovers

The project-local regression closed the root's bytes literal and appended a
plain suffix, so the expectation named a different pathname than the report's
whole-path label even though the output was correct. Both fields are now
compared through `display_path_bytes`, which is the inverse of the projection
the report applies, so the assertion covers the exact bytes rather than the
spelling.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(check): preserve raw Goal scope and encode error reports

Scope contract health on the original diagnostic identity before projecting
paths for display. A Goal id that cannot be spelled now keeps its errors, so
scoped status and quota health stay fail-closed.

Project the final check and status payloads at the CLI boundary, including the
exception report, and use whole-path labels for the registry, runtime root and
scan roots. The normal and error paths now emit strict UTF-8 without changing
ordinary report text.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(check): keep report keys intact and Git paths literal
A Goal id that merely spells the reserved escape label was rewritten by the
report projector, so `goal_errors` keys and `error_diagnostics[].goal_id` no
longer matched the id the caller queried. Project structured keys with the
diagnostic spelling, which leaves ordinary UTF-8 text untouched, and reserve
the `git-bytes:` rewrite for names Git cannot spell.
Explicit scan roots reached Git as pathspecs: a directory named
`:(missing-magic)` enumerated nothing, and `:` read unrelated documents. Pass
`--literal-pathspecs` on both ownership probes and on the tracked-file
enumeration so a selected directory is always a literal path.
The Linux exception regression never entered the exception branch because an
empty `goals` object reads as no goals; use a non-empty invalid object so the
command really exits 1, and locate probe subcommands by name now that Git
global options precede them.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(check): keep an inherited pathspec mode out of literal Git reads
Git resolves its pathspec mode from the environment after it reads
`--literal-pathspecs`, so an inherited `GIT_GLOB_PATHSPECS=1` turned the
literal directory query back into a glob. Git then rejected a pruned
directory's name with exit 128, and `_tracked_scan_files` folded the refusal
into an empty list: an explicitly selected `.venv` holding a tracked file
reported zero files and success.
Both bounded reads now start with the caller's environment minus the four
`GIT_*PATHSPECS` variables, which is the only thing that changed. A refused
enumeration raises the existing `GitProbeUnavailable` so the scan reports the
unavailable probe instead of a clean boundary; an empty match still returns no
files and success.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(check): ask Git's ignore question the way check-ignore accepts it

`check-ignore` rejects pathspec magic outright, so the literal global option
this module asks for made it exit 128 on every path. `_git_probe` read that
status as "not ignored", and a correctly ignored private state file was
reported as needing a `.gitignore` rule.

The ignore query now runs without the literal option and passes a `./`
prefixed repository path, which keeps a name that starts with `:` literal.
Both probes also keep Git's "no" (exit 1) apart from a failed query, and an
unanswered ignore question is reported through the existing unavailable-probe
path instead of becoming a warning.

Verified through the public CLI on a real worktree: ignored private state
exits 0 with no warning, an unignored one exits 0 with the warning, and a
force-tracked one exits 1 with `local_private_state`.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(check): treat a refused Git discovery as an unknown selection

`_git_worktree_root` read every nonzero `rev-parse --show-toplevel` as
"this is not a worktree".  A refusal - unsafe ownership, a blocked index,
a corrupt repository - exits nonzero too, so an explicit scan of a pruned
directory lost its only source of tracked files and reported a clean,
empty boundary.

Only Git's own "not a git repository" answer is now a negative one; any
other failure raises the existing unavailable-probe path, so the boundary
scan and the contract report keep the selection unknown instead of clean.
The probe runs with a fixed message language so that answer is stable.

Signed-off-by: gcl <gongchengli@users.noreply.github.com>

* fix(check): accept only Git's canonical "no repository" answer

Discovery outside a repository answers exactly
`fatal: not a git repository (or any of the parent directories): .git`.  A
broken linked worktree answers `not a git repository: <target>`, and a refusal
may quote any path - including one that itself contains that phrase.  Matching
the substring read both as an absence of a repository, so an explicitly
selected pruned directory reported a clean scan of zero tracked files.

`_git_worktree_root` now accepts only the whole canonical diagnostic as a
negative answer and raises `GitProbeUnavailable` for every other nonzero exit.
The probes run under a fixed C locale, so the text cannot be localized.

Verified: a real linked worktree whose gitdir target is missing leaves the
selected scan unavailable (`ok=false`, `unavailable_git_probes`,
`public_boundary_scan_git_unavailable`); a refusal quoting the phrase is
unavailable; the canonical absence, ordinary non-Git directories, recovered
worktrees and tracked enumeration still answer as before.  122 targeted tests
pass, 6 skip on this platform.  Native Windows was not re-run.

Signed-off-by: gcl-coder <gcl-coder@users.noreply.github.com>

---------

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>
Signed-off-by: gcl <gongchengli@users.noreply.github.com>
Signed-off-by: gcl-coder <gcl-coder@users.noreply.github.com>
… canonical content_digest consumers (#8910)

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

Keep original Lark replies and App discovery moving under backlog
…age-collection-20261117

Avoid rereading portfolio rows discarded by pagination
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…larize-20261117

fix(cli): accept inline JSON in refresh-state, add spend-slot --delivery-workspace-path, and modularize CLI command modules
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…-regression-20261117

Retain the supported-CLI cleanup refusal regression.

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

fix(manager): recover decisions from oversized portfolio rows
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…teness-20261118

fix(manager): disclose omitted records in every read view
…ock-20261117

fix(benchmark): share native task clocks across Frontier trials
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…s-20261118

fix(manager): recover oversized Todo details through bounded pages
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.

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

动机 / Motivation

登记 Agent 轨迹并查看 LoopX 请求占比的操作者。同一 guard 命令追加等号式第二个 Turn 参数时,真实 CLI 最终采用后一个值;旧解析器仍把整次请求记给原 guard,新 head 保留归因未知。真实登记、持久化和独立读回证实正常 worker guard 可识别,重复参数、动态和复合命令保留未知,native 总计与关闭采集结果不变。
本次不执行真实 worker、模型或付费 benchmark,不更新 PR target,也不宣称长期收益、完整成本或安装采用已经验证。GitHub PR 展示仍有 521 项,统一 diff 返回 406;需要有 target 编辑协调授权的维护者处理展示,真实长期收益另由原研究验收负责。

改动思路 / Approach

该修复继续使用已有Python传输与TS计数owner,只修可选归因的词法边界;无需新增状态、服务或通用执行器。517项与当前target相同,实际四路径负责literal guard识别、重复参数拒绝、现有测试及说明;展示修复和真实长程收益不在代码批准内。 原始 native 记录经 Python 保守解析进入现有 TS 计数 owner,再冻结为 pack;本次没有增加第二套计数器。include-tool-context 仍须明确开启;非字面或有歧义的命令返回 argv=null,不会执行命令来“猜”归属。对同一原始轨迹使用相同输入做真实登记和独立读回,避免只检查 helper 或测试返回值。

轨迹输入 旧 producer 当前 head
正常 UTC / worker guard 均识别 均识别
UTC / worker 追加等号式 Turn 错记 1 请求、100% 输入、8 返回字节 0 已识别、1 未分类、占比未知、0 归属字节
UTC / worker 追加分隔式 Turn 未分类 未分类
动态、复合命令 保守未知 保守未知

表中旧 producer 是 8246b40fe84578684e3d1be4b8bc545e8a3a5a73 的不可变 Python parser,受控加载进当前 head 的其他真实 owner;不是旧版完整安装。另以当前 main b03e7b66eddb3aee8fa804f1030f99d7605c6bad 的真实检出做完整对照,其中正常 worker 尚不识别,head 将其恢复为可识别。

具体改动 / Changes

关键代码讲解

  • _argv 接受 worker.py:557 实际生成的 wake-数字-12位hex,继续要求完整两行、单一带引号 placeholder、quota should-run 和字面参数。按 word.partition("=")[0] 统计 option 名,关闭等号式重复参数绕过;真实 CLI 的两个完整重复形式都会最后值生效,缩写选项则被 allow_abbrev=False 拒绝。
  • project_tool_context 沿用 native response_item 和完整 exec wrapper 的过滤,将歧义留给 TS 的未分类统计,避免仅凭文本里出现 LoopX 就认定归属。_usage_capture 仍在显式 flag 内调用该 helper,native计数与原始输入观察各自独立。

审查依据是修改前 684400582063e16d6c460b005598714f03ae380b 的既有轨迹测量说明,不是把新文档当作自己的验收依据。literal-guard-attribution、native-counter-and-opt-in、native-return-dedup-privacy 三项分别落实为字面归因、关闭采集的旧结果保持、原生身份/回包去重和隐私边界;均已实现。新 EN/CN 说明与实际 producer 和失败路径一致。

完整 GitHub 文件 API 六页共 521 项,所有路径与 head blob SHA 已逐一匹配;517 项与当前 target 对象相同,零项无法解释。Git merge-tree 模拟合并对 target 的结果也只有四路径,完整实际净 diff 为 +43/-11。没有把这517项历史实现当成本次重新逐行审过,也没有修改 target。

对主干的风险 / Risks

未发现当前四路径的阻断性代码问题。最强反例是原 CLI 实际使用另一个 Turn、测量却仍报100%;独立复现旧 producer 的两种等号式错误,新 head 都保留未知。38组真实 CLI register/readback 覆盖两套检出和受控旧 producer,native输入100、缓存60保持;原输入估计0.02与整请求占比没有混为一谈。六组关闭采集的完整 solver_usage 与 main 完全相等,无语义归一化;重复输出、重复 native response、动态/复合命令及源文件哈希不变都已验证。

PASS:base/head Python 119/125,实际 TypeScript 均14项(已有tool-context及usage-comparison两套文件),Ruff三文件和mypy17均通过;不继承作者的23项TS声明。严格四路径CQR cqr_879ec54e1d15e16c717f已记录,standard六项direct和15项selected检查通过。初次总门禁因回执缺失未通过,回执后再次standard验证为CQR有效、direct/run失败均为0,整体仍manual_review_required;benchmark人工审查仍是独立hold,不能写成整体可合并。未查询或等待CI。

FAIL/限制:gh pr diff 两个计划命令均因300文件上限返回406,已用完整API及不可变对象替代,展示问题仍在。主机出现ENOSPC,首轮合成验证只完成8项后缺少完整结束证据;恢复脚本首次路径选择错误也已保留,最后复用已完成登记并重新核对全部38项,没有降低断言。没有运行真实模型/worker,也未验证安装后的产品收益。

语义与 CI 对齐

沿用现有typed observed/unavailable/null词汇与现有native计数owner,没有新增协议、状态或通用工作义务。default-off全值对照已通过,reference说明没有变成自动加载指令;无新的权限、调度或配额效应。仓库声明的Sign-off/merge-gate与本次代码结论分列;不凭本地测试冒称CI已绿。

我的整体评价 / Verdict

这是一项有真实登记与读回结果的有界修复:长程继续语义保持,测量旅程更诚实,未证明长期成果、完整成本或采用收益。原P2在当前精确head已解决,整体实际四路径没有新的阻断发现;该结论建立在完整521项来源核对上。该修复继续使用已有Python传输与TS计数owner,只修可选归因的词法边界;无需新增状态、服务或通用执行器。 517项与当前target相同,实际四路径负责literal guard识别、重复参数拒绝、现有测试及说明;展示修复和真实长程收益不在代码批准内。

实际增量无渲染代码/布局变更;现有research-usage-comparison.tsx:14-24的Unknown消费与517路径对象相同已核,当前仅改变可选数据归因。 未重跑已安装App/browser视觉流程;没有新的呈现布局需要截图。 GitHub展示、旧线程/旧review状态、benchmark人工审查和合并授权继续由各自owner处理,本次不dismiss或merge。

English verdict: APPROVE — the verified four-path increment at 0f0db6a210ae349f25f3ac29842c300217e6bef4 fixes duplicate-Turn attribution and recognizes literal worker guards while preserving capture-off output and native counters. Merge and presentation holds remain separate.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

合并前资格复核,精确源头 0f0db6a210ae349f25f3ac29842c300217e6bef4,实际目标 b03e7b66eddb3aee8fa804f1030f99d7605c6bad。

本头独立评审 已完整读回:原重复等号 Turn 的 P2 在真实登记/读回中解决;完整 521 项来源核对解释了 517 项与当前目标相同,实际净增量仅四路径 +43/-11。原生输入与 capture-off 全值保持,独评另完成 38 项原生登记对照、125 项 Python 与 14 项 TS;作者的 125/23 和六例对照分别保留为另一组实际记录。

Root 当前 checkout 的严格 CQR 已按实际目标重新准备、审核和登记为 cqr_879ec54e1d15e16c717f。初次核验因旧目标回执过期而失败的结果保留,未冒称旧回执仍然有效。当前完整 standard premerge 6 项 direct + 15 项 selected 全部执行通过,0 failure / 0 warning,CQR 有效;双语 RFC diff 也通过。

自动整门仍为 manual_review_required,唯一人工条件为 benchmark_sensitive。依据维护者对此 PR 的明确合并授权,本次人工判断通过:这是可选轨迹捕获中的受限字面归因 helper,复用现有 Python/TS owner;不修改评分、任务语义、排行榜/提交或权限,不启动 worker、模型或付费作业。两种重复参数都保守归为未知,正常 worker 可识别,原始 native 计数及关闭采集的输出不变。现有实现已足够局部,无需再增加通用 parser 或状态层。

GitHub 文件展示仍固定旧比较基线;精确目标比较 和独立完整对象核对支持上述四路径代码结论。此次未修改 target 元数据,不宣称展示问题已修复。旧发现的代码与验证依据已复核,线程和即时 readiness 仍按原生流程收口。历史 ENOSPC、启动与恢复失败保留;真实模型/worker、长期成果、完整成本和安装采用不由本批测试或代码批准证明。

@loopx-agent
loopx-agent merged commit 513b6f1 into main Nov 18, 2026
35 of 40 checks passed
@loopx-agent
loopx-agent deleted the codex/benchmark-worker-wake-request-attribution branch November 18, 2026 01:30
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.

10 participants