Skip to content

Move managed sessions, budgets and recovery into Harness Manager - #741

Open
Dong1017 wants to merge 6 commits into
mainfrom
codex/702-p9-manager
Open

Dong1017 wants to merge 6 commits into
mainfrom
codex/702-p9-manager

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #702

Session ownership

Both CLI entry points now construct typed requests and call inferrsi.harness.manager.run_session. The same public entry point accepts direct callers. Manager owns ordinary and service-reuse state, round budgets, cancellation, checkpoint recovery, agent session records and parallel round accounting. Apps supplies the knowledge reader, service-context collector and CLI presentation. The component package is the public import path. The migration guide maps the retired modules and their callers. Accepted design · Interface and sequence · Public imports

A direct Manager round and a second, real CLI process contend for the same session lock in the new regression. The CLI contender is refused before it can change a session file. The lock holder commits one observation and the next CLI read sees that decision and budget. Separate regressions cover invalid budgets on direct entry, stale and duplicate receipts, and the distinction between settling a pending round and explicitly resuming after a final FAIL.

Verification

The base is the merged P8 commit 8e5cca94. The normal wheel built from eeeb33f5ffe989e88adaf4634d4a027fef9ee97e is 0.3.5.dev19+geeeb33f5, SHA-256 55ef284898848ed4d60fcfa2b5382d19af23c36d5e94b2682a178181fc57be5c. Checked 1,037 archive members and read all seven registered D007 packs. The source archive SHA-256 is fea68986b9c98b181bdfa91853f7e0aa64985b7e23ba0cdbe6f5991c279e7cda.

Acceptance Evidence
Ordinary sessions Package-external campaign and benchmarks session each launch real arguments, benchmark and assess children. Interrupted assessment runs once. Two historical ordinary sessions × both CLIs × status/recover yield eight fingerprint refusals with byte-identical files and zero launches.
Service-reuse, schema 3 The normal wheel reads old sessions, refuses writes across package versions, and settles its own pending FAIL once with matching cleanup proof. A separate test wheel built from the same source with the P1 version replays all 13 frozen cases. Missing proof, the other real attempt, wrong service identity, and wrong attempt ID preserve pending, observations and budget.
Installed outcomes for this head Both real ordinary CLI subprocess sequences, the 7/6/13 schema-3 cases, 15 normal and 11 isolated CLI/Manager comparisons, 12 AB/BA goldens, the cross-process session lock, D023 and two pinned SQLite versions passed on eeeb33f5. The published-interface group passed 156 cases, with four optional image-dependency skips and two Linux-only skips on Windows. The 14 online, 11 continuation and 41 service-fault cases retain their original timeouts. Their initial concurrent run and serial retry are recorded separately. Per-check results and hashes
Integration #693's static/runtime and installed child-process checks, D023, two retained SQLite versions and repeated collection, the AB/BA evidence from P3 and the ordinary/service behavior frozen in P1 remain part of #702's acceptance. The final main wheel receives its own three recovery receipts after this PR merges.

The overlap check found eight paths shared with #699 and seventeen with #709 against their current heads. The Manager migration includes the public callers, fixed documentation entry points and package checks affected by these moves. Codex implements and integrates on behalf of @Dong1017. P9 baseline · P8 integration

{"schema_version":1,"head_sha":"eeeb33f5ffe989e88adaf4634d4a027fef9ee97e","human_only":false,"material_ai_authors":[{"tool":"Codex","model_id":"gpt-6.2-astra","effort":"max","role":"author"}]}

dongxinwen added 5 commits November 27, 2026 08:18
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
Signed-off-by: dongxinwen <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
Signed-off-by: dongxinwen <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
Signed-off-by: dongxinwen <[email protected]>
Signed-off-by: dongxinwen <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
Signed-off-by: dongxinwen <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex 代表 @Dong1017 提请复核 27233555862ee0bcd95c261bc51ba5a756909546。这是 #702 最后一片。正常安装包的 SHA-256 是 f47d9dfdf708836a1c7e10238c3cd921162eff6b179a6ee14a45ef4d333a2871。

@amy-why-3459 请核对普通会话从 CLI 和直接 Manager 调用进入同一写入锁、两进程竞争时只有持锁者记 observation 和预算,以及 #705 显式续跑的请求身份。

@david6666666 请核对 service-reuse 的版本门槛、原 attempt 与服务身份匹配的清理证明、恢复只结算原轮次,以及静态指纹覆盖迁入 Manager 的路径。两个普通 CLI 已在此 wheel 实跑子进程,旧普通样本的八次查询与恢复均拒绝且文件逐字节一致。候选包的旧 schema 3 状态查询、版本错配拒写与同版本补证单次结算也已通过。请将正式评审提交到这个 head。接口时序 · P1 样本和校验清单

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

PR review verdict — DO NOT PASS

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

Reviewed base 8e5cca9 and head 2723355. First review of this head, so there is no incremental range. This is a self-review: the PR author is Dong1017, so this COMMENT is not an independent approval.

Blockers

  1. The diff is not complete. pr/meta.json has diffComplete: false. The seeded pr/diff.patch exceeded the read limit, and its stored copy could not be opened from this session. I therefore did not review the changed lines, and I cannot confirm which part is missing. The author should re-seed a complete diff for this head, or show that the missing part is covered, before any PASS.

  2. The exact-head installed checks are still pending. pr/body.md says "Exact-head installed checks are being rerun from clean copies". No result for 27233555862ee0bcd95c261bc51ba5a756909546 is posted in the body or the thread. The result needs to be posted on this head.

  3. There is no independent approval on this head. pr/prior-reviews.md lists no formal reviews on this head and no outstanding CHANGES_REQUESTED. The author and the Codex-declared material author (knowledge-model-policy in pr/body.md) cannot supply an independent approval. The thread asks @amy-why-3459 (shared write lock, #705 request identity) and @david6666666 (service-reuse version gate, original attempt and service cleanup proof, fingerprint coverage) to review. Their formal reviews on this head are still needed.

Verified here

  • src/inferrsi/harness/README.md L17-L18 and L123-L129 describe Manager as the entry point for run_session and the service-reuse recovery path. Recovery checks the plan version before writing, and it matches the checkpoint and cleanup proof to the original attempt and service. This is documentation at the head, not a code check.
  • src/inferrsi/harness/manager/__init__.py L36 exports run_session, which is consistent with the body's entry-point claim.

Not verified here

  • The changed code in the diff (see blocker 1).
  • Tests, the wheel build and its SHA-256, the archive member check, the 13 frozen service-reuse cases, and the cross-process lock regression. I did not run any of them.
  • The #702 issue body. The read output could not be opened from this session.

Scope: this review does not change the #702 scope or the final acceptance, which stay with Dong1017 (decisions.md, 2026-11-26T13:16:49Z).

Next step: I will re-read after the author pushes. Blockers 1 and 2 must be closed on the new head, and blocker 3 needs the reviewers' formal reviews.


Self-review: the PR author and the posting account are the same, so this review is not an independent approval.

@Dong1017 Dong1017 added the area:harness Harness module: profile, A/B loop, quality gates, evidence reports label Nov 27, 2026
Signed-off-by: dongxinwen <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PASS
dot, acting for zengchuang-hw.

首次独立检视 #702 的 P9,基线 8e5cca9 → eeeb33f。两个 CLI 共用 typed request 转换,Manager 接管生命周期,分流后仍由 Executor 执行、Evaluator 判定。8 个旧根模块已迁走;16 个改动的生产 Python 文件未发现仍依赖这些旧模块的入口。末次增量只改两份测试代码:锁回归参数换行,冻结包检查只在旧包校验分支动态读取旧入口,生产代码未变。

在隔离样本中运行实际 Manager 入口和 CLI 转换:8 种无效预算均未创建会话目录;旧指纹的 status/recover 在状态控制器调用前拒绝,文件不变;服务 status/resume 进入同一控制器。另用实际锁函数启动第二个 Python 进程,竞争同一锁时收到 EAGAIN,目录内容不变。与 P8 对照,清理回执身份检查、服务与普通结算、恢复及 round 的函数体除迁移 import 外保持一致。

未独立重建 wheel 或重放真实服务。此结论不替代 #702 要求的合入后 main wheel、旧样本与真实 CLI 回执。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex 代表 @Dong1017。@amy-why-3459 @david6666666 请复核当前提交 eeeb33f5ffe989e88adaf4634d4a027fef9ee97e。Amy 请看直接调用 Manager 与第二个 CLI 进程争用会话锁时,失败一方能否留下写入。David 请看版本、静态指纹和清理证明的核对次序,以及原轮次能否被重复结算。

这一版修正了 Linux lint 发现的两个测试问题。原 P1 wheel 重新独立重放 6 次通过。当前正常 wheel 的 SHA-256 是 55ef284898848ed4d60fcfa2b5382d19af23c36d5e94b2682a178181fc57be5c。在这个包上,两个普通入口都实际启动了 arguments、benchmark、assess。服务旧版本的七次读取及拒绝均为零启动、逐字节无写入。同版本新建 FAIL 检查点,四种不合格清理证明均被拒绝,正确证明只结算一次。冻结样本和清理证明

本 PR 有 46 个文件。GitHub 的文件列表可分五页读,每页最多十个。第 1 页 · 第 2 页 · 第 3 页 · 第 4 页 · 第 5 页

在有仓库访问权限的 checkout 中可按目录读取两个确定提交之间的完整补丁,保留重命名关系。

git fetch origin main refs/pull/741/head
git diff --find-renames --stat 8e5cca94b67b98089bf5b06703dd8d3b851bca4d eeeb33f5ffe989e88adaf4634d4a027fef9ee97e
git diff --find-renames 8e5cca94b67b98089bf5b06703dd8d3b851bca4d eeeb33f5ffe989e88adaf4634d4a027fef9ee97e -- src/inferrsi
git diff --find-renames 8e5cca94b67b98089bf5b06703dd8d3b851bca4d eeeb33f5ffe989e88adaf4634d4a027fef9ee97e -- tests
git diff --find-renames 8e5cca94b67b98089bf5b06703dd8d3b851bca4d eeeb33f5ffe989e88adaf4634d4a027fef9ee97e

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

PR review verdict — DO NOT PASS

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

Reviewed base 8e5cca9 and head eeeb33f (PTAL after the previous DO NOT PASS on 2723355). I did not separately verify the incremental range 2723355..eeeb33f. This is a self-review: the PR author is Dong1017, so this COMMENT is not an independent approval.

Blockers

  1. The diff is not complete. pr/meta.json has diffComplete: false. The seeded pr/diff.patch is about 154 KB on one line, and I could not read its contents in this session. I therefore did not review the changed lines and cannot confirm which part is missing. Re-seed a complete diff for eeeb33f, or show that the missing part is covered, before any PASS.

  2. Installed checks are not posted for this head. pr/body.md (Verification) says "Fresh installed runs on this revision are in progress." The 00:50Z trigger comment reports the wheel SHA-256 55ef284898848ed4d60fcfa2b5382d19af23c36d5e94b2682a178181fc57be5c and says the CLI child-process runs and the frozen-package replays passed on that wheel. The record does not contain the per-check results for eeeb33f itself. Post those results with the head SHA and wheel hash.

Resolved or updated since the previous review

  • Independent approval (previous blocker 3, partly): pr/prior-reviews.md shows @zengchuang-hw APPROVED on eeeb33f (2026-11-27T00:39:36Z). I weigh it as independent re-check evidence. Its own text says it did not rebuild the wheel or replay the real service. Formal reviews from @amy-why-3459 (shared session lock, direct Manager vs second CLI process) and @david6666666 (service-reuse version gate, original attempt and cleanup proof, fingerprint coverage) are still not in the record on this head. Both were asked for review in the thread.
  • Previous blocker 1 (incomplete diff) and blocker 2 (installed checks) remain open, as above.

Not verified here

  • I did not run tests, installs, wheel builds or the real service, and I did not read the diff lines.
  • I checked the layout at eeeb33f only: src/inferrsi/harness/manager/ contains _session.py, _runner.py, _round_budget.py, _attempt_recovery.py and _service_backfill.py.
  • I have not confirmed the claim that the 8 retired root modules have no remaining callers.

Next step: once the author pushes a new head or re-seeds a complete diff, and the installed results for that head are posted, I will re-read the review record and the diff.


Self-review: the PR author and the posting account are the same, so this review is not an independent approval.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex on behalf of @Dong1017.

The installed checks on eeeb33f5 and the full base-to-head diff are now available for the two evidence requests in the current-head review. The normal wheel SHA-256 is 55ef284898848ed4d60fcfa2b5382d19af23c36d5e94b2682a178181fc57be5c. Per-check results, exact build and three recovery receipts

I fetched all five pages of the GitHub files API (10 + 10 + 10 + 10 + 6). I applied the returned hunks for each of the 46 files to its named base Git blob, including all eight rename sources. All 46 outputs matched the destination blobs byte for byte. The diff contains 37 modifications, eight renames and one addition, 857 added and 449 removed lines. All eight old module names are absent in the installed wheel. An AST scan found zero imports of them in active Python source, examples, tools and tests. The independently frozen historical inputs are preserved. The per-file reconstruction receipt SHA-256 is 27263a79641e138b06ff05c3a177995cd50b16e32c0741b363ec8fcfe741ad1a. Pinned comparison · Test-only follow-up commit

Read the decision-bearing files separately or reproduce the complete diff

The links below open the individual PR diffs. The Git commands compare the pinned objects and show regular line breaks even when a review client truncates its aggregate patch.

git diff --find-renames --stat 8e5cca94b67b98089bf5b06703dd8d3b851bca4d eeeb33f5ffe989e88adaf4634d4a027fef9ee97e
git diff --find-renames 8e5cca94b67b98089bf5b06703dd8d3b851bca4d eeeb33f5ffe989e88adaf4634d4a027fef9ee97e -- src/inferrsi/harness/optimization_session.py src/inferrsi/harness/manager/_session.py
gh api --paginate 'repos/InferMatrixLab/InferRSI/pulls/741/files?per_page=10' --jq '.[] | [.filename, .sha] | @tsv'

@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
Dot, acting for @david6666666 (repository admin) under delegated independent InferRSI PR review and approval.

PR review verdict — PASS
Reviewed base 8e5cca94b67b98089bf5b06703dd8d3b851bca4d and head eeeb33f5ffe989e88adaf4634d4a027fef9ee97e for #702 P9. Advisory score: 86/100.

Evidence and scoring
  • Scope 3/3: CLI adaptation and the direct typed entry share Manager lifecycle ownership without moving process execution or evaluation into Manager.
  • Correctness 3/3: Traced ordinary fingerprint rejection, service version rejection before mutation, and cleanup proof binding to the original attempt and service. The matching proof settles the retained outcome once; repeat recovery does not relaunch or debit it again. The direct Manager and CLI contender use one session lock.
  • Validation 3/3: On the pinned source, 44 focused CPU cases passed (one skipped), including lock contention, retention and recovery. Independently installed and replayed normal and frozen-version wheels outside source; the cross-version rejection and frozen service matrix passed, and wheel package payloads matched except generated version metadata. Both required Linux full and installed lanes passed on the exact head; both advisory hosts passed.
  • Claim evidence N/A: No model performance claim. Simplicity 0/3: new or rewritten explanatory comments in repository test/check helpers trigger the rubric's hard zero.

Normal independently rebuilt wheel SHA-256: d6fc130c3e5392b86b54c4042ab90fa4fe95a46bb8b81f96356c456cd4e648d8; separately built frozen replay wheel: 6df8f8b77590e909de7e5fbacd39231717693e27f1981a60e74677faf4a89618. This vote does not substitute for the owner’s post-merge main-wheel and Issue acceptance checks.

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

Labels

area:harness Harness module: profile, A/B loop, quality gates, evidence reports

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants