Skip to content

feat(apps): expose saved-request evaluation CLI - #597

Merged
zengchuang-hw merged 5 commits into
mainfrom
codex/apps-596-evaluate-cli
Nov 23, 2026
Merged

zengchuang-hw merged 5 commits into
mainfrom
codex/apps-596-evaluate-cli

Conversation

@zengchuang-hw

@zengchuang-hw zengchuang-hw commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Governing Issue and delivery slice

Refs #596
Refs #371

The accepted Apps design requires saved-request evaluate prepare/execute/assess; main previously exposed the Python ports and fixed read views without these CLI commands. This PR adds those commands using the existing Apps API/result publication and existing B/H ports.

Accepted authority: #371 step 5; B/H adapter shape and exit-table acceptance, reaffirmed in 7090241452. Actual base 8a8e85795a851dc884278aea4e0db67d4c6e77f5; head 682acf738755d7b340454406ea431f267fb711b2. Apps author/accountable implementer: zengchuang-hw / Codex. Dong1017 accepted this slice's architecture and is excluded as its accountable parent; these scope records are not code approvals.

Behavior and boundaries

  • Requires explicit --request @file, output ID, authorized workspace and existing StorageConfig. Optional full-ref/scope/claim arguments must agree with the saved request before operation effects.
  • Separate explicitly located runtime JSON configures existing frozen B protocol/read-only resources and existing H target. No cwd discovery, request-selected imports/authority, StorageConfig change or new core port.
  • Defers writable Store opening until Apps binding succeeds. Offline assess reads no runtime file or target/worker section.
  • Prints the shared canonical AppsResultV1, preserves committed refs when publication fails, and explicitly resubmits the original attempt/digest for replay.
  • Leaves old fixed-view plain-path flags and all three plugin launchers unchanged. Parser construction does not load the new execution/assessment ports.
  • No task selection, new worker profile, grading, attempt allocation, request generation, automatic retry, feedback selection or scheduling. feat(benchmark): deliver the pinned CPU task after Apps integration #575 remains the real CPU profile; full production/generated-candidate/three-host acceptance remains task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371.

Checks and evidence

  • Current synchronized head: 276 passed, zero skips, across the CLI, complete Apps migration gate, task-plan/run, shared task input and legacy-run group. This includes the reported excessive-nesting regression, which reproduced an uncaught RecursionError before the fix. Whole-tree Ruff / actual-main diff whitespace checks passed. A new bare-core sdist → wheel / complete outside-checkout installation passed; three runtime-file source/wheel/installed byte comparisons matched.
  • Historical 013ab8c verification: 327 passed / 43 subtests, zero skipped: CLI plus the complete Apps migration gate, output/prepare/assess/port-validation, contracts and import boundaries. Includes 43 focused CLI cases covering production ports, actual CPU process, new-process replay, changed-digest conflict, request-side authority injection, required CLI arguments, malformed JSON/config, independent 0/8/9 claim exits, committed refusal/worker failure, publication-failure ref preservation and original-attempt replay.
  • Whole-tree Ruff and whitespace checks passed.
  • Fresh source distribution → bare-core wheel → isolated outside-checkout check_installed.py passed, including all three new command help entries.
  • Additional installed-core probe ran actual CLI prepare → CPU execute → offline assessment → retired/missing-source original-reference replay, with canonical output readback and exactly one original attempt/record. Its controlled worker supplies no production proofs, so its claims correctly remain INCONCLUSIVE.
  • All three changed runtime files are byte-identical across checked source, built wheel and installed package.
  • The earlier local Windows full-suite trial ended with 6210 passed, 671 subtests, 66 skipped, 70 failed and 14 errors in 75 minutes. It began on db436e2 while later help/test/registry changes were made, so it is not a uniform final-head result. Some failures were separately reproduced on unchanged main (environment-length limits, CRLF and unavailable FIFO); others remain unclassified. The Apps registry failure was fixed by 013ab8c. No failed trial is relabeled passed. Windows/macOS remain advisory; fresh final-head Linux checks are required.

Current review correction: David's 4661831874 is fixed: _object_file translates recursion failures from JSON parsing or canonical validation into the existing ValueError / CLI exit-2 input path before port construction. The deep-input regression also asserts no traceback. Actual main #577/#580/#583/#590 is incorporated without conflict; the bounded increment is still eight files, +681/−0. New-head CI and two fresh independent formal LGTM Approves are required; older votes do not transfer.

Earlier review follow-up: Five malformed StorageConfig cases now verify the pre-existing ArtifactReader shape check returns CLI exit 2 before any writable Store opens. Added action help text and documented the read-only execute-scope check and stdout line ending. Runtime execution, trust authority and result/exit mapping are unchanged. Fresh bare-core build/install, installed actual flow, all three host-package actual CLI flows, and runtime-byte comparisons passed again. Parent technical feedback remains visible but is not an independent vote.

Historical CI correction: Linux 3.11 on the preceding dcc2290 reported one genuine registry failure (6323 passed / 674 subtests, 31 skipped). The current follow-up adds exactly three canonical consumer registrations in docs/apps-module-migrations.json; the existing test now passes and its gate is unchanged. The 327-test local verification includes that complete migration module. All runtime files remain byte-identical to the freshly packaged/three-host-flow-tested dcc2290 runtime, so package evidence remains applicable; current-head CI reruns the required checks. The failed predecessor run remains recorded.

Knowledge authorship declaration

{
  "schema_version": 1,
  "head_sha": "682acf738755d7b340454406ea431f267fb711b2",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Codex",
      "model_id": "unknown",
      "effort": "unknown",
      "role": "author"
    }
  ]
}

Remaining work and Issue closure

Process findings; obtain two distinct eligible independent current-head formal LGTM Approves and required green CI before squash. Author/material contributors/accountable parent are excluded. This Ready PR targets actual main; no temporary merge base or Draft.

#596 component acceptance requires its own actual-main checks and Delivered / Verified / Limits card. #371 retains the complete six-step design and separate integrated production/host acceptance. Neither whole-issue completion nor service/performance gain is claimed.

Agent-assisted-by: Codex (author/integrator)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

Copy link
Copy Markdown
Contributor Author

Codex / author-integrator: @jiangkuaixue123 @david6666666 @linyueqian @hsliuustc0106 please independently review head db436e2 against main 3b1b4ce, accepted #596 adapter contract (7090234403). Seven files, Apps-only production composition; runtime schema and the unchanged result/exit contract are documented in docs/apps-evaluate-cli.md. Evidence: 284 targeted tests / 43 subtests, Ruff, fresh bare-core distribution/install check, installed CLI actual CPU/offline assessment/original-attempt replay, and all three runtime-file byte matches. Local whole-suite failures and independently reproduced unchanged-main Windows environment-limit failure are disclosed in the body. Please report concrete findings; on PASS, submit a formal review with LGTM alone on the first nonempty line under the normal rule. Two independent write+ accounts required; author and accountable parent Dong do not count. CI is pending; no request to merge early.

Copy link
Copy Markdown
Contributor Author

Local full-suite failure classification update (no source change): independently ran the affected Anthropic edit/full-context modules on unchanged main 3b1b4ce and on this head. Both reproduce the same three host-specific categories: initial fixture bytes become CRLF while the test expects LF, a FIFO case calls unavailable os.mkfifo on Windows, and an oversized parametrized test ID exceeds Windows' 32767-character environment-variable limit during pytest setup/teardown. The earlier hostile-HTTP-body limit was likewise reproduced on main. Full local run remains in progress; I have not labeled it passed or changed these unrelated tests. Required Linux checks and exact-head code reviews still decide this PR's merge readiness; native host CI remains advisory.

Dong1017
Dong1017 previously approved these changes Nov 23, 2026

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

LGTM

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

PR review verdict — PASS
Reviewed base 3b1b4ce and head db436e2 (full diff, 7 files). pr/prior-reviews.md has no formal reviews and no outstanding CHANGES_REQUESTED, so this is a first review of the head and is not a re-check of an earlier Approve. Dong-bot (authorized delegate) review, diff-based.

Verified by reading the code. I did not run any tests.

  • Contract match. The adapter matches the #596 contract I accepted on 2026-11-23 (comment 7090226644).
    • evaluate.py adds no port and no authority. It only builds the callables api.prepare, api.execute and api.assess already take, in src/inferrsi/apps/api.py. The Apps results and exit codes come from apps/storage/result.py unchanged.
    • The doc's exit table matches _EXIT_CODES and _ERROR_OUTCOMES there. 0, 2 and 3–9 each map to the stated outcome.
  • Runtime authority.
    • --runtime-config is the only source of B/H configuration. The top-level keys are closed, and benchmark and target keys are checked.
    • The benchmark/target keys the code reads are only required to be absolute; UNC and // anchors are refused.
    • The request cannot select a root. The test test_request_cannot_supply_runtime_authority covers this.
    • assess never reads a runtime file, and the test monkeypatches the port builders to fail if they are called.
  • Writable Store timing. RunStore.from_mount runs inside the execute closure. api._execute_saved calls it only after _port_call(bind_execution…) has verified the saved request and preparation. A PublicError raised at that point goes through _port_call into a structured result. RunStore.__init__ creates directories and the SQLite schema, so deferring it is the right design.
  • Prepare. PreparationService.prepare returns (prepared, protocol, read_resource), which is what api.prepare expects. preparation.PreparationService exists in benchmark/preparation.py at this head. A malformed protocol raises PreparationError, a ValueError, which main turns into exit 2 through parser.error.
  • Replay and publication failure. The docs and tests are consistent with api.execute and H replay: the original attempt and digest are reused, and a failed output publication still prints committed refs.
  • Input hygiene. Duplicate keys, non-object input, and encode() for NaN, floats and unsafe integers are all rejected before any port is built. The parser does not import the new ports, and test_parser_and_unrelated_commands_do_not_load_new_ports asserts this.

Non-blocking follow-ups (not required for this PASS)

  1. _execute_ports indexes storage["mounts"], storage["harness_namespace"], item["namespace"] and item["kind"] directly. main catches only OSError, ValueError, JSONDecodeError and sqlite3.Error. A structurally malformed storage config (a missing key or wrong type) therefore raises an uncaught KeyError or TypeError traceback instead of the documented config error with exit 2. The Python prepare and assess paths return a structured InvalidRequest for the same input. A shape check that raises ValueError, plus a test, would close it.
  2. --scope on execute reads the archive through read_prepared during option checking. This is read-only and its PublicError is mapped to exit 2, so it is fine. A one-line doc note would help.
  3. The doc's "Missing --output-id is a parser error" is true. A --help text for each of the three actions would help discoverability.

Not verified here

  • No CI status or test execution; the new tests and check_installed.py were read, not run.
  • Module-boundary and import-rule tests (test_module_boundaries.py) were not checked against the new apps/cli → benchmark/harness lazy imports.
  • The real three-host integration and the CPU profile are out of scope per the doc and the parent issue.

This is one review vote. The two-independent-approval and green-CI merge gates are unchanged.


@Dong1017 Dong1017 added area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters kind:task Bounded delivery task with a delegated slice labels Nov 23, 2026
Dong1017
Dong1017 previously approved these changes Nov 23, 2026

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

LGTM

PR review verdict — PASS
Reviewed base 3b1b4ce and head db436e2 (full diff on opened; no previous head). No formal APPROVED review was on this head.

Verified from the diff:

  • evaluate prepare|execute|assess is registered in src/inferrsi/apps/cli/arguments.py and returned from main via dispatch (src/inferrsi/apps/cli/__init__.py, src/inferrsi/apps/cli/evaluate.py). The handlers call existing api.prepare / execute / assess and return result["exit_code"].
  • Request, ref, storage, and runtime files are JSON objects only. Duplicate keys, non-UTF-8, and encode() cover non-finite values, floats, and unsafe integers before port construction. Request and ref flags require @file.
  • Runtime config is a closed schema_version / benchmark / target document (schema_version must be int 1, so a boolean is refused). Resource, work, and source paths must be absolute local paths; UNC and // anchors are refused. Prepare installs read-only B PreparationService openers and does not build a target or Store. Execute builds LocalCpuTarget from that file and opens RunStore.from_mount only inside execute_harness, after Apps invokes it. Assess wires assessment.assess only and leaves --runtime-config unread.
  • --prepared-ref, --record-ref, --scope, and --primary-claim are equality checks against the saved request (execute scope comes from the archived preparation). They leave saved fields unchanged. Missing required flags fail in argparse before dispatch.
  • docs/apps-evaluate-cli.md and the new docs/operations.md row match that contract: same Apps result and exit mapping, no attempt allocation, no retry, replay keeps the original attempt. Tests lock prepare publication, cross-process replay (one attempt and one record), assess exits 0/8/9, pre-effect option and JSON refusal, request fields ignored as runtime authority, entry refusal exit 3, worker failure exit 7, and publication failure exit 6 with the committed ref still printed.

Not verified here: pytest and tests/check_installed.py were not executed, and CI on this head was not inspected. Unchanged Apps result mapping, PreparationService, and Harness replay were reviewed only at these call sites.

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

LGTM

改了什么

本 PR 在 Apps(应用层 CLI,命令行入口)上补齐了已保存请求的三步评估命令:inferrsi evaluate prepare / execute / assess。它没有新增核心端口,而是把现有 B(Benchmark,任务准备/离线评估)与 H(Harness,本地 CPU 执行与记录)接到 CLI:

  • 新模块 src/inferrsi/apps/cli/evaluate.py:解析 --request @文件、显式 --workspace / --storage-config / --runtime-config,组装已有 api.prepare|execute|assess。
  • 可信运行时配置(host 提供的本地 JSON,不从请求或 cwd 发现)只认 schema_version / benchmark / target;路径必须是绝对本地路径,拒绝相对路径与网络路径。
  • execute 把可写 RunStore(执行记录库)的打开推迟到 Apps 绑定成功之后;assess 完全不读 runtime,也不建 target。
  • 可选 --prepared-ref / --record-ref / --scope / --primary-claim 只能与已保存请求一致,不能覆盖字段。
  • 文档 docs/apps-evaluate-cli.md、operations 表项、安装探测与约 38 个聚焦 CLI 测试覆盖端口接线、拒绝路径、权威注入、退出码与原始 attempt 重放。

对照 #596 已接受的适配器约定(7090234403)与现有 apps.storage.result 退出表,行为边界一致:不分配 attempt、不自动重试、不改旧 fixed-view / 三插件启动约定。

问题与风险

未发现影响正确性、安全或声明行为的实质缺陷。边界检查(重复键 / 非有限数 / 请求侧权威注入 / 发布失败仍保留已提交 ref)与延迟开库设计合理,测试与实现匹配。

非阻塞提醒:

  1. 作者已披露全量本地 suite 仍有失败,且 Windows 环境变量长度问题可在未改动的 main 上复现——不归因于本 diff;合入仍依赖所需 CI 变绿与第二份独立 LGTM。
  2. prepare 侧若 runtime 资源角色与 protocol 不完全对齐,理论上可能冒出未映射的 KeyError(主路径由 B 校验兜住);若后续要更严的 CLI 失败面,可再收成统一的 exit 2 / PublicError。非本切片阻塞项。

结论

批准。 head db436e22d49c3215c9870722527b7191793fcac0 相对 base 3b1b4cebf0b2babba37758d3752aec59fdc9a41d 的 Apps-only 组合清晰,权限与效果边界符合已接受契约,聚焦证据充分。不合并;squash 前仍需另一名合格独立审查者的当前 head Approve 与 required CI。

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

LGTM

变更概述

本 PR 在现有 Apps Python 端口与结果发布路径上,新增 inferrsi evaluate prepare|execute|assess,用于消费已保存请求。调用方需显式给出 --request @文件、--output-id、已授权绝对 --workspace 和既有 StorageConfig;prepare/execute 另需显式定位的可信 --runtime-config,不从 cwd、存储配置或请求中发现适配器。可选的完整 ref / --scope / --primary-claim 只做一致性核对,不覆盖已保存字段。固定视图 status/report/dashboard/trace 的普通路径约定,以及三类插件启动器,均未改动。解析器构造只引入 add_parser,B/H 与 Apps 执行端口在 dispatch 时才加载。

我对照 head db436e22d49c3215c9870722527b7191793fcac0 与 base main 3b1b4cebf0b2babba37758d3752aec59fdc9a41d 审阅了 7 个变更文件,并核对了现有 Apps API、结果/退出码映射、RunStore/LocalCpuTarget 与存储配置校验。

关键行为与代码一致:

  • 运行时 JSON 只允许 schema_version/benchmark/target,拒绝 import/工厂/凭据等未知字段;资源与 work/source 路径必须是显式绝对本地路径,并拒绝 UNC/// 网络路径与空字节。
  • 可写 Store 的打开(RunStore.from_mount 会建目录并初始化 schema)被推迟到 Apps 绑定成功后、H execute 回调之内;LocalCpuTarget 与只读 ArtifactReader 的构造本身无写效果。请求侧注入的 runtime/storage/target 不能替换宿主配置。
  • assess 不要求、也不读取 runtime 文件,不构造 prepare/execute 端口。
  • 标准输出打印完整规范 AppsResultV1,进程退出码取自结果中的 exit_code;发布失败时保留已提交 ref(exit 6),重放显式提交原始 attempt/digest,不会改分配或自动重试。

新测试覆盖了生产端口准备与发布、跨进程原 attempt 重放、digest 冲突、请求侧权限注入、缺参/冲突选项/畸形 JSON、离线评估 0/8/9、拒绝启动 exit 3、worker 失败 exit 7、发布失败后的 ref 保留与重放,以及解析器不预加载新端口。作者披露的全量本地失败已在不变 main 上复现分类,不能单独构成对本 diff 的否决。当前 mergeable_state=blocked 是待评审/必过 CI,不是未合并前置 PR;Linux full-check 仍在进行,其余已完成检查(含 installed-package、lint、声明与 Windows/macOS advisory)为成功。

问题与风险

未发现正确性、安全边界或已声明行为上的阻断性问题。非阻断观察如下:

  • execute 在 port 构造阶段就会校验 StorageConfig / LocalCpuTarget。非法配置会经 PublicError→ValueError 变成 argparse 退出码 2,且不打印 AppsResultV1。这与「配置/参数冲突为 2」一致,只是与 prepare/assess 走 API 发布错误信封的路径略有不同。
  • dispatch 已校验 workspace 为现存绝对路径且 resolve() 后不变(拒绝符号链接穿越),但调用 API 时仍传入原始 args.workspace。通过该项检查后二者应等价,建议直接传入已校验对象,避免以后分叉。
  • 新 CLI 测试未直接覆盖 exit 4/5 与 workspace 符号链接拒绝;前者是既有 H/Apps 行为,后者已在实现中落实,不构成声明被打破。

结论与理由

建议批准。实现与 #596 已接受的适配器边界、退出码表和「不分配 attempt、不重试、不改固定视图」的范围一致;信任边界、Store 推迟打开、离线 assess 与发布失败/重放行为都有对应测试。合入仍应等待必过 Linux CI 变绿,以及另一份合格独立 Approve;这不影响对本 head 代码的判断。

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

LGTM

改了什么

这条 PR 给已有的 Apps 命令行补上了三个子命令:inferrsi evaluate prepare、execute、assess。它们处理的是「已经保存好的请求文件」,不会自己挑任务、分配尝试(attempt,一次评测运行名额),也不会失败后自动重试。用法和 Python 里现成的 apps.api.prepare/execute/assess 相同,结果也还是那份标准信封 AppsResultV1(一份规范的 JSON 结果,里面带着退出码和已提交的引用)。

调用时必须显式给出 --request @文件、--output-id、已授权的输出目录 --workspace,以及现有的存储配置 --storage-config。可选的 --prepared-ref / --record-ref / --scope / --primary-claim 只能和保存请求里的字段核对,不能改写请求。@文件 这种写法只用于这组新命令;原来的 status / report / dashboard / trace 以及三个插件启动器仍用原来的普通路径。

准备(prepare)和执行(execute)还要另给一份可信的本地运行时配置 --runtime-config,用来接入现成的 B 端口(Benchmark,基准准备/评估)和 H 端口(Harness,本地 CPU 目标与记录库)。这份配置不会从当前目录、存储配置或请求里自动发现;请求也不能指定导入模块或权限。评估(assess)是离线的:不要求、也不读取运行时文件,不构建执行目标。可写的记录库(Store)会等到 Apps 绑定成功后再打开。

文档写在 docs/apps-evaluate-cli.md,操作一览里加了一行。安装检查只确认三个新命令的 --help 里出现了 --request 和 --output-id。

明显问题或风险

未发现实质问题。实现与 #596 已接受的适配器形状、退出码表(apps/storage/result.py)以及「参数冲突在产生操作效果前以退出码 2 失败」的约定一致。路径限制、未知顶层键、重复 JSON 键、请求侧塞权限等负向用例都有覆盖。构造解析器时不会加载新的执行/评估端口。

非阻塞建议:标准输出用 print(encode(...).decode("utf-8")),会在规范 JSON 后再多一个换行。用 json.loads 读没有问题;如果有人拿 stdout 和归档的 result.json 做逐字节比较,需要记得这一点。

结论和理由

这是在现有 Apps API 和 B/H 端口上的命令行组装,范围清楚,权威边界(存储配置不变、运行时配置与请求分离、离线 assess、Store 延后打开、不分配 attempt)在代码和测试里对得上。仓库内 15 个测试函数、按参数展开后正好 38 个 CLI 用例,与 PR 声明一致。作者另报的整树失败已说明也能在未改动的 main 上复现,且不作为本 PR 已通过的证据。可以在当前 head 上给出正式 LGTM;所需的 Linux CI 变绿以及第二份合格独立 Approve 仍按仓库规则,不提前合并。

@zengchuang-hw
zengchuang-hw dismissed Dong1017’s stale review November 23, 2026 03:06

Keep the complete technical review as attributable owner feedback. Under the explicit #596 acceptance record 7090241452, author and Dong1017 as this slice's accountable architecture parent are excluded from the two independent votes. This Approve state therefore cannot count; no code criticism is removed or waived. Please post subsequent owner self-checks as COMMENTED.

Copy link
Copy Markdown
Contributor Author

@Dong1017 已处理 6016088399:保留全部代码检视内容,但按 #596 7090241452 明确的实际父责任排除规则 dismissed 其 Approve 状态,不计独立票;后续 owner 自检请用 COMMENTED。关于第 1 条,现有调用顺序是先 ArtifactReader(storage),它调用 _storage_mounts 校验整个闭合 StorageConfig,再索引 mounts/namespace,因此缺键/错误类型已经转成 PublicError → CLI 参数错误 2;我会补具体回归验证这个顺序,若发现实际漏网再修。第 2 条补明 execute --scope 会读取固定归档以核对;第 3 条补三条子命令的说明。新提交只处理这些有据的检视点,完整刷新相关验证/当前头记录。

@Dong1017

Copy link
Copy Markdown
Collaborator

接受:6016088399 的 Approve 按 #596 评论 7090241452 的实际父责任排除,不计独立票。本切片 Dong1017 是架构接受后的 accountable parent;后续 Dong-bot 自检使用 COMMENTED。

当前头 db436e22d49c3215c9870722527b7191793fcac0 上,该 login 的最新正式决定仍是 APPROVED:https://github.com/InferMatrixLab/InferRSI/pull/597#pullrequestreview-6016101440(2026-11-23T03:02:21Z)。dismiss 6016088399 之后,这张仍是有效票,同属父责任排除,请一并 dismiss,避免规则集把它算作当前头的一张票。本轮不再提交 Approve。

独立票:@jiangkuaixue123 在同一 head 的 Approve(最新 https://github.com/InferMatrixLab/InferRSI/pull/597#pullrequestreview-6016110800)计 1 票。还差另一名 write+ 账户的当前头 LGTM Approve。合入仍要求这张票与 required CI。

三条检视按你的说明记录。本轮种子的 head 仍是 db436e22,未附更新 SHA 或 diff,回归与文档还没有落在这个头上:

  1. StorageConfig 缺键/错误类型:按给出的调用顺序,先 ArtifactReader(storage),经 _storage_mounts 校验整个闭合 StorageConfig,再索引 mounts/namespace,缺键/错误类型走 PublicError → CLI 参数错误 2。锁定该顺序的回归你写的是将要补;若证明有漏网再修。在该提交进入 head 之前,此项保持待验证。
  2. execute --scope:补明会读取固定归档做核对。与已有检视中「scope 对照归档 preparation、不改已保存字段」一致;文档/测试随新提交落地后再看。
  3. 三个子命令说明:prepare / execute / assess 的说明补齐属于该提交的文档范围。

新提交只覆盖这三处有据检视点,并刷新相关验证与当前头记录。推上来之后若再 @,我按 COMMENTED 自检读增量。

Dong-bot(authorized delegate)

@Dong1017

Copy link
Copy Markdown
Collaborator

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Noted. Neither Dong1017/Dong-bot Approve on #597 counts as an independent vote, including the second one (6016101440, 03:02:21Z), which is still active on db436e2. I can't dismiss reviews, so someone with the authority needs to dismiss 6016101440 as well, the same way as 6016088399.

Further owner checks on this PR will be COMMENTED, not Approve. This follows the line recorded on #371 (7089393818) and #590. The PR body already names Dong1017 as excluded because of the #596 architecture acceptance.

Your plan for items 1–3 is fine. For item 1, a regression test that pins the order (ArtifactReader(storage) validates the whole StorageConfig before storage["mounts"] is indexed) is the right check. Please also cover _check_options on the execute --scope path. It calls read_prepared(storage, ref) before ArtifactReader is built, so the test should show that a malformed storage config still ends in exit 2 there.

The head is still db436e2, so the new commit isn't visible yet. Reviews on the old head won't carry over to it. The merge gates stay as they are: two distinct independent LGTM Approves on the final head, plus green required CI.

Details
  • Decision recorded: Dong1017/Dong-bot Approves on feat(apps): expose saved-request evaluation CLI #597 are not independent votes, and owner technical checks use COMMENTED.
  • I did not re-read the diff for this reply. It is not a re-review, and I ran no tests.
  • Jiang's two active Approves on db436e2 are the only counted votes so far. The second independent one is still needed, and CI is still pending.

@zengchuang-hw
zengchuang-hw dismissed Dong1017’s stale review November 23, 2026 03:08

Second owner technical review retained in full. This account is explicitly excluded as the accountable architecture parent for #596 in 7090241452. It cannot provide an independent approval; do not use native approval totals as the eligibility gate. Future owner self-checks should use COMMENTED. Two distinct eligible independent peer approvals remain mandatory.

Copy link
Copy Markdown
Contributor Author

Integrator eligibility correction: two separate Dong reviews (6016088399 / 6016101440) both predate the latest owner-status correction and have now had their non-independent Approve states dismissed; technical text stays intact. #596 7090241452 explicitly excludes the author and Dong as this slice's accountable architecture parent. Jiang's 6016110800 is the one valid independent db436e2 code approval. Native review totals must not be treated as two independent votes. The small help/documentation/storage-regression follow-up is being verified before a new head; Jiang's stdout line-ending note is clarified in the doc. No code authority or result/exit mapping is changed.

Agent-assisted-by: Codex (author/integrator)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

Copy link
Copy Markdown
Contributor Author

Current head is dcc2290. @jiangkuaixue123 @david6666666 @linyueqian @hsliuustc0106 please review/refresh against actual main. The follow-up to the reviewed db436e2 is three files / +39 -2: five malformed-storage regression cases, subcommand help, and scope/stdout documentation. Existing storage validation already maps those shapes to exit 2; no extra authority/error mapping was added. 289 tests / 43 subtests pass, including all 43 CLI cases; Ruff, fresh bare-core wheel/install, installed actual CLI flow, three host-package actual CLI flows and source/wheel/installed byte matches pass. Old-head approvals are not inherited; the author/accountable parent remain excluded. Required current-head CI is running. Please raise findings or submit a normal exact-head formal verdict.

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

LGTM

改了什么

相对上一版已审过的 db436e22,当前头 dcc22904 只动了三处、共 +39/-2:

  1. 畸形存储配置回归:tests/test_apps_evaluate_cli.py 新增 5 个参数化用例(缺配置、mounts 为 null、缺 namespace、harness_namespace 类型错、非 SQLite mount),并 monkeypatch RunStore.from_mount,确认在打开可写记录库(Store,本地评测结果库)之前就以退出码 2 失败、且不打印 Traceback。
  2. 子命令帮助:evaluate.py 给 prepare / execute / assess 补了 help/description。
  3. 文档澄清:说明 execute --scope 会先只读核对固定准备归档;stdout 在规范 JSON 后再多一个换行,逐字节比对应以归档的 result.json 为准。

整体仍是给已有 Apps 命令行补上 inferrsi evaluate prepare|execute|assess:消费已保存请求,走现成的 apps.api 与 B/H 端口(Benchmark 基准准备/评估、Harness 本地 CPU 目标),不分配 attempt(一次评测运行名额)、不自动重试。权威边界与上一版一致:显式 --runtime-config、请求不能选权限、离线 assess 不读运行时、Store 延后到绑定成功后再开。

明显问题或风险

未发现实质问题。ArtifactReader(storage) 会先走 _storage_mounts 校验闭合的 StorageConfig,再索引 mounts;畸形配置会变成 PublicError → CLI 退出码 2,新测试把这条路径钉死了。上一版提到的 stdout 换行差异已在文档写明。未改生产权威映射,也未扩大 CLI 范围。

结论和理由

在已批准的适配器形状上,这次跟进只补了有据的回归、帮助文案和文档,代码与 #596 约定仍然对齐。对当前头 dcc22904f13b09ce7be0e51f73ca16de0db50909 正式 LGTM / Approve。仓库仍需合格的第二份独立 Approve 与 Linux CI 按规则处理;不提前合并。

Copy link
Copy Markdown
Contributor Author

CI failure identified and reproduced locally: the #490 consumer registry omitted the new canonical archive/artifact-reader consumers in apps/cli/evaluate.py and the new CLI tests. Linux 3.11 reported exactly this one failure (6323 tests and 674 subtests passed, 31 skipped). I have added the three exact registrations in docs/apps-module-migrations.json without weakening the gate; full migration + CLI/Apps/contracts/boundary regressions are running before the corrective commit. No runtime behavior, port or trust mapping changes.

Agent-assisted-by: Codex (author/integrator)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

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

LGTM

改了什么

相对上一版已审过的 dcc22904,当前头 013ab8c1 只改了一处、共 +3:

  1. 迁移门禁消费者登记:在 docs/apps-module-migrations.json 里,给相关模块补上了三个消费者路径——src/inferrsi/apps/cli/evaluate.py(两处)和 tests/test_apps_evaluate_cli.py(一处)。这是登记「谁在用这份模块」,好让迁移检查(module migration gate,检查新代码有没有漏记依赖关系)能通过;不改运行时权限、退出码或结果格式。

连同此前两版已审内容,整体仍是给已有 Apps 命令行补上 inferrsi evaluate prepare|execute|assess:消费已保存请求,走现成的 apps.api 与 B/H 端口(Benchmark 基准准备/评估、Harness 本地 CPU 目标),不分配 attempt(一次评测运行名额)、不自动重试。权威边界不变:显式 --runtime-config、请求不能选权限、离线 assess 不读运行时、Store 延后到绑定成功后再开。

明显问题或风险

未发现实质问题。本次 +3 只是把本就存在的 CLI/测试文件登记进迁移门禁,与作者说明的「修 Linux 门禁失败、保留 gate」一致;未扩大 CLI 范围,也未改生产权威映射。上一版已钉死的畸形 StorageConfig → 退出码 2、以及 stdout 换行与 result.json 字节比对的文档说明,仍然成立。

结论和理由

在已批准的适配器形状上,这次跟进只补了门禁登记;代码与 #596 约定仍然对齐。对当前头 013ab8c1ebd7d0596f0fb947957d9681ce8edd5a 正式 LGTM / Approve。仓库仍需合格的第二份独立 Approve 与 Linux CI 按规则处理;不提前合并。

Copy link
Copy Markdown
Contributor Author

Current head 013ab8c now has all Ready checks green (45106495374), including both Linux full suites, installed packages and the separate browser checks. The prior registry failure remains recorded and was fixed without weakening the gate. Jiang's 6016261874 is one valid exact-head independent code approval. @david6666666 @linyueqian @hsliuustc0106 please complete a second independent review of the eight-file feature/current +3 registry delta; concrete findings will be handled first. Author and this slice's recorded accountable parent remain excluded. No source change is planned while waiting for that review.

Copy link
Copy Markdown
Contributor Author

Codex / integrator,按用户本次“向所有 committer 寻求检视”的要求更新请求。

@amy-why-3459 @Bounty-hunter @david6666666 @Dong1017 @jiangkuaixue123 @linyueqian @hsliuustc0106

请检视当前头 013ab8c1ebd7d0596f0fb947957d9681ce8edd5a(base: main),实际范围、委托、验证证据和历史失败保留在 PR 正文及前文。

当前头的迁移清单遗漏已修复,全部 CI 已绿;Jiang 有一份有效本头独立批准,仍需第二个独立 write+ 账号。作者与该切片已记录的实际父责任人 Dong 不计独立票。

请先提出并处理具体意见;若独立审查结论为 PASS,请按仓库规则提交第一非空行为独立 LGTM 的正式 Approve。每账号一次,作者/实质贡献者/实际父责任人的技术自检请用 COMMENTED;scope comments 不计代码批准。达到该 PR 的实际主线前置、两份有效独立批准及必需 CI 条件后才 squash。

账号按链接核对:dengyunyang 对应 @Bounty-hunter,WeiQing Chen 对应 @david6666666。本次只扩大检视请求范围,不更改既有验收/席位条件。

@Dong1017

Copy link
Copy Markdown
Collaborator

技术自检(COMMENTED):当前头 013ab8c1ebd7d0596f0fb947957d9681ce8edd5a(base 3b1b4cebf0b2babba37758d3752aec59fdc9a41d)在本轮种子证据上没有新的阻断项。按 #596 评论 7090241452,本账号是该切片已记录的实际父责任人,结论留在这条评论里。独立 LGTM Approve 继续由其余 write+ 账号各自提交,每账号一次。

已核对:

  • 当前头有一份有效独立 APPROVED:@jiangkuaixue123 https://github.com/InferMatrixLab/InferRSI/pull/597#pullrequestreview-6016261874(2026-11-23T03:33:11Z)。最新每账号决定里没有未关闭的 CHANGES_REQUESTED。本 login 在旧头上的 Approve 已 DISMISSED。
  • 相对已审 dcc22904 的增量,正文与 Jiang 本头审查一致:docs/apps-module-migrations.json 增加三处消费者登记(src/inferrsi/apps/cli/evaluate.py 两处、tests/test_apps_evaluate_cli.py 一处),补上 Linux 3.11 迁移门禁漏记,门禁本身保持。运行时权限、退出码和结果格式保持已接受的适配器形状。
  • 线程 7091171347:Ready 检查 45106495374 已绿,含两套 Linux full suite。前序 registry 失败仍留在记录里。
  • 席位保持原条件:作者 zengchuang-hw 与本账号的技术自检都是评论。还差第二名独立 write+ 当前头 LGTM。两份有效独立批准与必需 CI 齐后再 squash。

本轮没有重跑测试;种子里也没有 pr/diff.patch,因法逐行重读那三处登记。上述依据是 PR 正文、线程和当前头正式审查。此前 StorageConfig 退出码 2、execute --scope 只读归档核对、子命令说明和 stdout 换行说明已落在 dcc22904 及之后,本头描述未改这些路径。

Dong-bot(authorized delegate)

@Dong1017

Copy link
Copy Markdown
Collaborator

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

技术自检(comment only,非 Approve、不计独立票):在 013ab8c1(base 3b1b4ceb)的完整 diff 中我没有发现阻断项。本账号是 #596 记录的该切片实际父责任人,与 #597 7090489855、#371 7089393818 的决定一致,所以不提交正式 Approve。

席位状态:当前头只有 @jiangkuaixue123 一份有效独立 APPROVED(6016261874),没有未关闭的 CHANGES_REQUESTED。还差一份其他 write+ 账号(@david6666666、@linyueqian、@hsliuustc0106、@amy-why-3459、@Bounty-hunter 等)在 013ab8c1 上提交的 LGTM Approve,另需必需 CI 绿。作者和 Dong 不计票。

仅非阻塞提醒:execute --scope 路径会在 ArtifactReader(storage) 之前调用 read_prepared。我看到的校验链路会把畸形 StorageConfig 转成 PublicError 并以退出码 2 结束。现有 5 个畸形存储用例没有带 --scope,所以这条顺序没有被测试钉住。可以作为后续小补丁,不挡本 PR。

Details

已读 diff(8 个文件):

  • evaluate.py:--runtime-config 是唯一的 B/H 配置来源,顶层键和绝对本地路径检查是封闭的。可写 Store 通过 RunStore.from_mount 延后到 execute_harness 回调内才打开。assess 不读 runtime。选项只做一致性比对,不改写已保存字段。PublicError 统一转成 ValueError(参数错误 exit 2)。
  • cli/__init__.py 和 arguments.py:evaluate 的 dispatch 是惰性导入,parser 只调用 add_parser。
  • docs/apps-module-migrations.json 的 +3 条目与已批准的 evaluate.py 和测试路径一致,门禁没有放宽。
  • 文档的退出码表与已记录的 apps/storage/result.py 映射一致。
  • archive._storage_mounts 对 mounts 做闭合校验,缺键或类型错误都会变成 PublicError("InvalidRequest")。

我没有运行测试,CI 结果取自线程中作者的说明和 Jiang 的审查,我没有独立核对。

Dong-bot(authorized delegate)

@Dong1017

Copy link
Copy Markdown
Collaborator

更正席位里的 CI 一句(仍是 COMMENTED 自检,不计独立票,不提交 Approve):作者已记录当前头 013ab8c1ebd7d0596f0fb947957d9681ce8edd5a 的 Ready 检查 45106495374 全绿,含两套 Linux full suite(7091171347、7091308597)。本轮未独立重查 CI。合入还差第二张其他 write+ 账号在该头上的 LGTM Approve;jiangkuaixue123 的 6016261874 仍是唯一有效独立票,没有未关闭的 CHANGES_REQUESTED。作者与本账号(#596 记录的实际父责任人,与 7090489855、#371 7089393818 一致)不计票。

execute --scope 先 read_prepared 再 ArtifactReader、5 个畸形存储用例未带 --scope,继续作为非阻断后续补丁。父责任自检已在 7091336457 与 7091397401;本条只更正 CI 表述。本轮种子没有 diff,未重跑测试。

Dong-bot(authorized delegate)

Copy link
Copy Markdown
Contributor Author

补充完整本机 Windows 试跑的结束记录:6210 passed、671 subtests passed、66 skipped、70 failed、14 errors(75 分钟)。该试跑起于 db436e2,期间完成 dcc2290/013ab8c1 的帮助文本、回归和消费者登记修正,因此它不是统一最终头的全量验收,不能写成当前头全量通过。此前已在不含本 PR 的 actual main 复现部分失败:超长参数名触发 Windows 环境变量上限、LF/CRLF 夹具差异与缺少 POSIX FIFO;其余失败仍未逐项归因,不一概称作基线。唯一 Apps 消费者登记失败已由 013ab8c 修复,当前头包含完整 Apps 迁移检查/CLI/输出/prepare/assess/端口/边界的 327 tests 与 43 subtests 零跳过通过。本头独立 Ready CI 45106495374 的 Linux 3.10/3.11 全量、bare-core 安装、Dashboard 浏览器与必需检查全部成功;主机兼容检查仍按既定 advisory 政策,不削弱断言或把上述失败改记 PASS。

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

One CLI input-error handling note.

Comment thread src/inferrsi/apps/cli/evaluate.py Resolved
Convert recursion failures from saved JSON parsing and canonical validation into the existing CLI input-error path before port construction. Add a regression for the reported unhandled traceback.

Agent-assisted-by: Codex (author/integrator)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
…apps-596-evaluate-cli

Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author/integrator)

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

LGTM

改了什么

相对上一版已审过的 013ab8c1,当前头 682acf73 主要是两处:

  1. 过深嵌套 JSON 的输入拒绝:_object_file 把解析或规范编码(canonical encode,把数据压成固定格式)时的 RecursionError(递归过深错误)转成既有的 ValueError,由 CLI 以 exit 2 拒绝;在构建端口、写输出之前就失败,也不再打出 traceback。
  2. 回归用例:畸形输入参数组补了 2000 层嵌套用例,并断言 stderr 不含 Traceback。
  3. 同步合入了当前 main(#577/#580/#583/#590),本切片仍是 8 个文件、Apps CLI 适配层,无新核心端口。

这直接回应了 David 在 #discussion_r4661831874 的指出。

明显问题或风险

未发现影响正确性、安全或声明行为的实质缺陷。

非阻塞小建议:docs/apps-evaluate-cli.md 的拒绝列表仍未点名「过深嵌套」,与代码行为略有文档漂移;可另开小补丁补一句。

结论

批准(APPROVE)。修复路径与既有 exit-2 输入错误一致,测试覆盖到位;旧头批准不继承,本票针对 682acf738755d7b340454406ea431f267fb711b2。未合并。

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

LGTM

PASS for 682acf738755d7b340454406ea431f267fb711b2 against 8a8e8579. The prior inline input-error issue is fixed: decoding and canonical encoding now map nesting failures to exit 2, and the regression checks no traceback or port construction. The saved-request dispatch and fixed prepare/execute/assess paths remain scoped to the existing ports.

Exact-head Ready (45113255365, eight jobs) and knowledge-model-policy passed. I did not independently rerun the serving/production evidence path; this does not accept #371 or the follow-on capture wiring.

Reviewer: Dot, acting under direct delegation from @david6666666 for independent InferRSI PR review and eligible Approve votes.

@zengchuang-hw
zengchuang-hw merged commit 214fb40 into main Nov 23, 2026
12 checks passed

Copy link
Copy Markdown
Contributor Author

Merged as 214fb40 after current-head Jiang 6016684236 / David 6016892318 formal LGTM Approves, resolved input-error feedback and all green required checks. Actual main passed 82 CLI/migration tests; its entire tree equals reviewed 682acf7 and the three checked-out runtime files equal the verified wheel/installed bytes. Revision-scoped package/three-launcher evidence and all original failures retain their scope. #596 is accepted/closed via card 7092457977; #599 production capture, #584 generated evaluation and whole #371 acceptance remain separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants