Skip to content

fix(dsh): read progressive quota admission from its original capture - #8543

Merged
huangruiteng merged 4 commits into
mainfrom
codex/dsh-progressive-admission
Nov 11, 2026
Merged

huangruiteng merged 4 commits into
mainfrom
codex/dsh-progressive-admission

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • The DSH continuation driver forces raw quota output on the current main branch. With LoopX CLI 2.3 and later, the driver follows the effective context delivery setting and consumes a progressive response from the original capture.
  • Initial admission reads the verified field directory and the required fields. The held path can omit reward memory. Each of the two pre-step checks reads only quota authority and the original Turn receipt. Both checks still run before entering the step, including when a quota hold arrives during the next hook.
  • Older CLI versions use the original raw request. Explicitly disabling progressive delivery uses raw output. Reader failures exit the read path without rerunning admission.
  • Intended base is main. Related controller work is C1: unify work sources and validate recovery #8266.

Author Declaration

  • Written by model_agent, OpenAI Codex (GPT-6).
  • Specification is the original-capture and reader compatibility sections of the required work context contract. Required work context
Criterion Disposition Symbol / path Evidence
Keep the original capture and Turn identity implemented LoopXContinuationDriver.readQuota Real CLI admission, two pre-step checks and once-only settlement
Reject a stale or invalid authorization implemented authorityStillAllows, readQuotaCapture Wrong digest rejects. A quota hold in the next pre-step hook rejects previously queued work.
Read optional context when needed implemented readQuotaCapture Initial wait needs one guard and two reads. Queued revalidation reads the authority fields directly.
Retain the older CLI request path implemented LoopXContinuationDriver.readQuota Legacy routing and explicit off pass. The published v1.2.4 fixture limitation is below.

Scope And Continuation

  • The driver uses the existing Core decision and reader. The pre-step checks share the same verification and select fields for their caller. Core continues to own admission and settlement.
  • This slice can enter review independently of C1: unify work sources and validate recovery #8266. Qualification on a running DSH installation and on Windows remains open.

Validation

  • Tested head f2e623c96f05b7ca1b087a8c27f7901edb792ecd on main 8986ed85bf54. Run state finished. Input class synthetic.
Check kind Result Evidence
integration passed All 251 DSH tests passed. Cases cover raw routing, explicit off, the progressive and held paths, bad digest, pagination, quota closure during a pre-step hook and once-only settlement.
real_entrypoint passed Packed driver passed seven File-authority cases each with the published 2.3.0 wheel, the main Core wheel at b89a574b05a3, and C1 at 34171ceb98bb. The newer main commit changes only docs. The released 2.3.0 default setting also passed.
real_entrypoint passed Real SQLite on the main and C1 wheels passed the normal progressive and quota-closure cases. The previous driver passed both as a main control.
regression_parity failed The published 1.2.4 fixture stops before queueing at the existing admission schema check with both the previous and current packed drivers.
static passed Host, client and test type checks, package build and local packing, whitespace and staged bilingual RFC check.
  • The first released-wheel run used a File fixture generated by source and failed the release's Todo read-model check. The rerun generates authority with the wheel under test. The targeted reader-count test also fails on the earlier progressive implementation at six reads and passes at four.
  • In three matched progressive File runs with the same main Core wheel, all three guard calls remain. Reader calls fall from six to four. Median child stdout falls from 57,487 to 30,078 bytes (47.7% lower). Paired cumulative child times change by +83 ms, -188 ms, -267 ms. In the first matched run, the current raw-off path emits 81,400 bytes. Measurements cover the local guard and reader subprocesses. Model input, model output and end-to-end cost are open.

Frontend / Visual Evidence

  • UI impact is none. This change is in the DSH continuation transport.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Host or runtime integration

Shared-authority RFC fixture impact

N/A. The host reads the existing authority result.

Boundary Checklist

  • Public-safe code and synthetic validation.
  • No paired RFC changed.
  • DCO signed.

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

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

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max

评审提交:f2e623c96f05b7ca1b087a8c27f7901edb792ecd

动机 / Motivation

受影响的是继续已准入工作的 DSH Agent。现有 DSH 驱动请求 raw quota JSON。候选开始使用 CLI 2.3 的 progressive capture。候选用已保存的原 reference 读 field index 和已知 admission 字段,并继续核验 Goal、Agent、Turn。用户在已经准入后能否继续,取决于驱动能否读完同一份已验证的上下文。可写目录下已验证可以继续。此改动处理 DSH 与 Core CLI 间的准入读回,保持原 Turn 的归属。请兼容现有的显式选读页和续页,继续验证原摘要、选读摘要和偏移,并保持真正损坏捕获的拒绝。

改动思路 / Approach

保留从同一原捕获读取的设计,让驱动接受现有 Core reader 的兼容分页。改动覆盖 DSH 首次入队和进入工作前的两次复验。 Core 负责核对原捕获摘要和分页。驱动负责读取选中的字段,然后核对 Goal、Agent 和原 Turn 的收据。pre-step 已知道所需的六个字段,可以直接选读。首次入队需要发现 scheduler hint 和 reward memory 等可选字段,仍先读索引。

具体改动 / Changes

关键代码讲解

改动涉及 4 个文件,增加 294 行、删除 22 行。按 docs/reference/required-work-context.md 核对 original-turn-identity、verified-explicit-fallback、raw-and-wait-compatibility 和 pre-step-revalidation。 规范

readQuotaCapture 首次根据索引组装指针,复验时直接选择必需字段及收据。它用指针集合检查是否存在多读、重复或缺失的字段,再由 exactQuota 判断是否继续原工作。readQuotaSelections 检查 UTF-8 字节边界,连续读取派生 reference,并在组装完整 JSON 后核对选读类型。它在第 364 行先要求 context_capture_selection_page_v1,因此两种调用都会拒绝 Core 的显式选读页。 实现

对主干的风险 / Risks

[P2] 只读捕获目录会导致驱动拒绝有效选读页。 用同一份官方 2.3.0 wheel 和同版本 File authority 对照,派生描述符无法写入时,原捕获仍可读。CLI 的 context_capture_page_v1 返回 ok=true,带原摘要和选读摘要。候选对单页和分页均报 invalid page,只产生一条准入收据且没有入队,基线可以入队。仅在第二次 pre-step 禁止写派生描述符时,候选也会误拒绝已入队工作。

语义与 CI 对齐

在同一官方 wheel 上,正常流程合计三次 guard 和四次 reader 调用,两次 pre-step 各选读六个字段。在 next hook 新增 quota hold 后,第二次复验拒绝进入。251 项插件测试、TypeScript 检查、构建和标准 premerge 的 4 项直接及 16 项定向检查通过。严格 Change Quality 仍被上述显式选读反例挡住。旧版本路径由现有源码测试模拟版本标识,远程 CI 未查询。 官方 2.3.0 发布包

我的整体评价 / Verdict

请在同一读取路径兼容显式单页和续页,核对原摘要、选读摘要和偏移。用只读派生目录覆盖首次入队和第二次 pre-step,同时验证损坏捕获和后置 quota hold 仍然拒绝。独立复验使用构建后的 DSH 插件和隔离 File authority,实际 DSH 安装与 Windows 未运行。

English verdict: REQUEST_CHANGES. Accept verified explicit selection pages when derived reader metadata cannot be written.

Comment thread packages/dsh-loopx-plugin/src/driver.ts Resolved
@mergify

mergify Bot commented Nov 11, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 11, 2026
songoow
songoow previously approved these changes Nov 11, 2026

@songoow songoow 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 Astra Pro · OpenAI · self_reported

评审 head:f2e623c96f05b7ca1b087a8c27f7901edb792ecd;固定比较基线:beff0f3e55d1f70eceebbd8e78c11f1cff34643b。

动机 / Motivation

使用DSH continuation driver并启用LoopX渐进上下文交付的用户。

旧driver固定请求raw admission;较新CLI返回capture navigation时不能按原来源取回准入字段,无法正确进入既有同会话接续路径。

CLI 2.3及以后尊重context delivery设置,必要时从同一原capture读取准入字段;旧兼容CLI继续raw,配置off不增加reader。

不增加新capture、执行授权、quota消费或重试请求,不替代DSH会话及LoopX既有准入和结算owner。

改动思路 / Approach

复用原版本判定、context-read协议和exactQuota owner;新增函数只做传输解码与有界字段选择,不构建第二个准入来源。 批准限于DSH消费既有捕获,不是全C1重构、宿主安装或模型行为验收。

CLI版本决定是否理解capture导航;2.3以上仍接受配置off的raw响应。capture index只用于发现可选字段,必要的ok/mode/Goal/Agent/should_run必须存在;每页验证UTF-8字节进度、总量、cursor目录和完整性,最终精确消费请求字段集合。

具体改动 / Changes

完整检查 4 个差异文件。关键入口是 readQuotaCapture / readQuotaSelections / LoopXContinuationDriver.readQuota。完整检查4文件。supportedLoopXVersion由原版本解析器导出并接受可选minimum;driver新增同一capture reader并保留原raw兼容。readQuota在首次决策读可选scheduler/reward信息,后续重验聚焦原Turn receipt,未将只读失败纳入guard重试。集成测试检查单次结算与hook竞态。

本轮独立验证: 7项真实CLI admission-to-closeout集成、86项driver/CLI单元测试及完整plugin typecheck通过。 相同候选 fixture 的基线结果:相同7项fixture中兼容路径1项通过、其余6项失败;强制原capture的held/digest/paged场景没有执行所需reader,不能队列原continuation。;head:7项全部通过;raw/off零reader,progressive按原receipt读取;held不进入,坏digest拒绝,700-byte分页保留原Turn且只写一次guard事件。。基线为完整beff归档,只替换同一测试fixture;driver和CLI生产文件哈希已与git show逐一比对,Python子进程也指向该归档。不是把head driver装进基线后声称双版本对照。

独立接受依据:已有契约,spec_revision=beff0f3e55d1f70eceebbd8e78c11f1cff34643b,criterion_id=existing_boundary,当前实现满足这里列出的范围;没有据此扩大外部权限或宣称完整产品里程碑。

对主干的风险 / Risks

最关键风险分别由真实CLI负例覆盖:quota在下一个hook中关闭仍拒绝;坏digest不进入工作;小页只改变读取次数,不增加guard事件。源码还检查offset递增、总字节一致、重复/遗漏字段及cursor约束,没有以read成功替代原exactQuota。

与已读取主干cf807b55的合并演练在src/cli.ts产生文本冲突,当前head不能直接合入;需同时保留主干在version probe返回后检查signal.aborted的取消逻辑,以及本PR导出的版本解析器调用,解决冲突后按新head复核。本轮未把冲突树当成执行通过。driver只消费公开index/selection,不依赖capture缓存内部布局。

使用 实际Python CLI、原Effect/Goal/receipt及provider状态;DSH Agent会话对象为可控fixture。未运行真实DSH安装界面或真实模型。第一次误用pnpm test --导致扩大测试范围,且显式PYTHON_BIN影响发现测试;该日志保留,不作为产品失败或通过证据,随后明确目标重跑7+86项及typecheck。 远端CI没有作为整体通过依据;本review不宣称合并条件已全部满足。

我的整体评价 / Verdict

建议APPROVE。实际CLI与旧raw/off对照说明它补齐了原capture的消费边界,保留同一Turn和原准入/结算;不应将这一项批准扩张为整个C1或完整DSH部署已验收。

本 PR 没有修改页面布局、组件或样式;验证范围为已有后端、CLI或文件观察边界。 未验证范围:未运行真实DSH安装界面或真实模型。第一次误用pnpm test --导致扩大测试范围,且显式PYTHON_BIN影响发现测试;该日志保留,不作为产品失败或通过证据,随后明确目标重跑7+86项及typecheck。

English verdict: APPROVE. Consume admission fields from the original progressive capture while preserving raw compatibility, exact receipt checks and pre-step revalidation.

Integrate the reviewed branch with current main and address the verified review finding.

Signed-off-by: huangruiteng <huangrt01@163.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 11, 2026

@huangruiteng huangruiteng 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

动机 / Motivation

在 DeepSeek Harness 中使用 LoopX 同一会话续跑的用户。 原驱动固定 raw 准入。候选开始消费渐进捕获后,只读目录返回的合法 inline 选读页仍会被拒绝,在首次入队或最后一次 pre-step 校验中阻断已准入工作。

DSH 按 CLI 版本和现有设置读取原捕获,普通引用和只读选读页都能持续校验。原 Todo/Turn 结算一次。坏摘要或 hook 期间新来的 quota hold 均拒绝进入。

这是已存在续跑入口的读取修复。原准入、结算、权限和 Host 行为继续由各自现有 owner 决定。

改动思路 / Approach

合入主干 version probe 的 AbortSignal 检查,保留共享版本解析。使用现有 quota context-read 明确选择字段,首次浏览目录,两个 pre-step 只读 authority 和原 Turn。只读回退继续用原引用、原 selector 和 selection hash,通过同一 CLI 进行分页。

保持两个 schema 的既有含义。简短引用由 CLI 核查两个摘要;inline 页要求相同摘要、选择与字节范围,拼完再比对 hash。传输失败落在已有读取分支,guard 不重跑。 原捕获和 selector 决定页与 offset,inlineDigests 是一次调用内部从 CLI 验证结果派生的事实。数据必须来自同一个原引用与同一精确 selector,空页、篡改或取消不足以产生授权。

具体改动 / Changes

从原版本解析派生 2.3 能力判断;探测完成仍先处理取消,兼容旧支持版本的 raw 路由。 supportedLoopXVersion

两种已存在选读响应共用连续 UTF-8 偏移和响应解析。只读回退验证摘要和已选地址,再按原引用和稳定 hash 继续。 readQuotaSelections

首次取目录加必要字段,已有入队工作重验读取同一原 Turn 和必要准入事实。 readQuotaCapture

旧 CLI 的 raw 路由、用户显式 off 与新版渐进响应进入同一 exactQuota 核对,读取错误保持在 guard 之后。 readQuota

4 文件 +377/−26。production 2 文件 +165/−20,tests_or_fixtures 1 文件 +208/−6,docs 1 文件 +4/−0。规格依据为 docs/reference/required-work-context.md 的 Selected capture details、原捕获绑定及只读分页,版本 de684cd7eaae46114c1e51fefdadb09a920e4bae。评审映射 original-capture-admission 要求 用既有选择协议读同一原捕获并保留原 Goal/Agent/Turn,确认完整摘要和分页。两次 pre-step 权限重验、用户关闭设置和 legacy raw 兼容继续成立。 结果为 implemented,验证来自 DSH plugin Vitest 全套与公开 admission-closeout.integration.spec.ts;插件 typecheck、package、runtime smoke。

相同真实 CLI 依次验证旧版本兼容、2.3 原 capture、显式 off。旧版本及 off 均为零选读,实际使用 Goal/Agent/Turn 匹配的同一结算逻辑。 保留 Core 已发行的 context_capture_page_v1 与新 context_capture_selection_page_v1。只读路径由真实 CLI 的既有 OSError 回退产生,复用原可读引用和完整摘要,不创建 DSH 专属持久格式。

对主干的风险 / Risks

选择页不能充当 fresh authority。内联分支的错摘要或页偏移、缺失/重复字段、角色不符或已取消 probe 必须拒绝。老 CLI 继续走已发布 raw 路径,最老真实发行版和 Windows 安装仍是外部覆盖边界。

真实 Core CLI 上 raw/off 不发 reader,普通 progressive 正常入队并仅结算一次;选读描述符写入返回 EACCES 时,首次单页和最后一次重验多页仍可完成同一回路。

原引用错误摘要或 inline 选读内容摘要错误均拒绝入队,guard 仍只有一次。第二次 pre-step 收到 quota hold 仍停止。version probe 完成时的取消覆盖成功、失败返回与抛错三种情况。

278 项 Vitest 通过。包括两种真实 CLI 只读回退和坏 inline 摘要,及原取消、raw/off、held、分页和双重 revalidation。三套 TS 类型检查、构建和 pack 通过。 预合并首轮的 4 项 direct 和其他 smoke 均通过。三项 DSH 命令因 PATH 选到 pnpm 11 失败。采用仓库 CI 固定的 10.33.0 在同一版本重跑全部三项,质量、打包和 runtime smoke 均通过。磁盘恢复后完整 Vitest 的 278 项全部通过。

真实本机 Core CLI 和合成 DSH Agent/Goal 连接验证。未重新跑用户的已安装 DSH、真实模型或 Windows;旧版本 raw 测试模拟版本标识,源 CLI 使用当前版本。

我的整体评价 / Verdict

评审版本 a8a9621d957d3f40a5129fa8e478062a2a05e84e。原捕获选读、DSH 入队、两次准入重验与一次结算已通过上述实际入口验证。原评审发现的条件均以修复前反例和当前结果对应核查。

检查了 DSH driver、CLI 与现有 GoalBar runtime smoke。差异位于会话续跑的准入传输。 已安装 DSH 与 Windows 未验证。

English verdict: APPROVE. Head a8a9621. The reported findings are resolved and the changed behavior is covered by the stated checks.

@huangruiteng
huangruiteng merged commit abdd987 into main Nov 11, 2026
8 of 10 checks passed
@huangruiteng
huangruiteng deleted the codex/dsh-progressive-admission branch November 11, 2026 10:17
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.

3 participants