Skip to content

Retain interrupted optimization attempts safely - #693

Open
Dong1017 wants to merge 7 commits into
mainfrom
codex/595-harness-session-recovery
Open

Dong1017 wants to merge 7 commits into
mainfrom
codex/595-harness-session-recovery

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Governing Issue and delivery slice

Refs #595

Knowledge authorship declaration

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

Changed artifacts and evidence

Requirement Change Evidence
HC-01 Atomically publish a flushed, exclusive record before each step or protocol spawn. Record a confirmed rejection of the executable or working directory as never spawned. Settle interrupted attempts once with no fabricated receipt. Require positive cleanup evidence or a recorded manual confirmation before resuming. Atomic intent and missing-executable tests fail on the first PR wheel and pass on this head. Recovery, status, Dashboard, delivery and Compare regressions. Linux CI exercises real controller kills during AB/BA step 2 and during assessment.
HC-02 Record frozen input drift as blocked and retain any unconfirmed cleanup receipt without starting execution or assessment. Four pending-round drift regressions across status and recover, with and without a previously recorded cleanup receipt.
HC-03 Settle protocol SystemExit at the round boundary, including a zero exit code. Four old-wheel red / candidate green cases covering arguments and assess.
HC-04 Preserve the exact-budget final action and bound explicit retries. Four final reserve cases pass locally.
HC-05 Keep the coordinator installation off the target interpreter's package search path. Two before/after packaged-path tests for standard and AB/BA execution. Both failed with the old wheel and passed with the candidate sources.
X01 Derive the installed runtime closure and reject computed internal import targets. Preserve an actual interrupted session from the old wheel. Static closure checks and an installed-wheel probe. The paired-wheel matrix below records the remaining host verification.

The 38-file closure covers execution, the two capture entry points and their internal imports, including the Knowledge ranking policy from current main. Retained contexts are pinned by their individual hashes. Fresh captures can use the currently installed Knowledge internals. CLI assembly, Delivery projection and Benchmark assessment are outside the execution closure. In particular, benchmark/assessment.py is outside the closure, so the current three-file diff in #649 needs no additional session fixture.

Derived files relative to src/inferrsi
__init__.py
apps/__init__.py
apps/workflows/__init__.py
apps/workflows/campaign.py
contracts/__init__.py
contracts/claim.py
contracts/runspec.py
harness/__init__.py
harness/artifact_primitives.py
harness/atomic_json.py
harness/attempt_recovery.py
harness/candidates.py
harness/launch_records.py
harness/local_process.py
harness/measurement.py
harness/optimization.py
harness/optimization_session.py
harness/project.py
harness/project_service.py
harness/protocol_child.py
harness/records/__init__.py
harness/records/campaign_records.py
harness/records/evidence.py
harness/records/knowledge_capture.py
harness/records/optimization_log.py
harness/records/optimization_trace.py
harness/service_backfill.py
harness/service_evidence.py
harness/service_observations.py
harness/session_runtime.py
harness/task_protocol.py
harness/trials/__init__.py
harness/trials/external.py
harness/usage.py
knowledge/__init__.py
knowledge/context_projection.py
knowledge/knowledge_find.py
knowledge/ranking_policy.py

Checks and dependencies

The historical fbddabaa85166d695ab3d08ff5a6231d576bbd51 wheel and its 14-file fixture exercise resume compatibility across the changes since that installation. The current PR code diff uses main at 4dc3676ebb8ecbcd7817b23c853586cb3abdc524, which includes the Knowledge ranking policy and #669.

  • ruff check src tests tools and git diff --check passed. Targeted Windows CPU source regressions passed for HC-03, HC-04, HC-05, the boot and PID namespace cases and the interrupted Compare projection. The Windows readiness failure in the initial run came from the virtual-environment launcher PID. The current installed wheel uses a Python process with a stable launcher PID and passes the full service-reuse case.
  • The fixture pre-recovery-closure-session was produced by the installed fbddabaa wheel and stopped after the candidate execution receipt was persisted. It contains 14 files and a single candidate execution. Baseline wheel SHA-256 6e85590de753aef7bd1045dc5ba8e5f6f6a135988f2bcd72c323eaa9c7a5090b.
  • On 7704df31, all 23 artifact-helper checks and 18 targeted Windows recovery tests passed, with one skipped platform case. The shared JSON writer source check reproduced on e5afa1dc and now passes. Ruff and git diff --check passed. Candidate Windows CPU wheel SHA-256 365dbaa6805fdcba5e6c656ceabeea034cec78815f1851b1be996a41038d695a. The candidate returned 2 for status and recover and all 14 fixture file hashes stayed identical. The baseline wheel returned 0 in both cases, settled one round and kept calls.log at one candidate execution. The installed candidate standard recover probe passed both paths and covered 16 observed modules. Both Linux full jobs then found a shared-launcher import edge and a completed-service export error.
  • On bff93313, merged current main at 1e565eed. The public Harness import check and real rejected-spawn regression pass. The completed-service export regression reproduced ValueError: Unsupported optimization record version on the prior installed wheel. The candidate publishes both the automatic final and explicit export from the service's retained plan v3 and state v2, carrying the independent PASS and the observed final revision. It surfaces a divergent retained observation as unverified and requires a digest-bound run/configuration for Delivery acceptance. A previously retained completed campaign was additionally re-exported from its existing records.
  • On bff93313, the Windows CPU candidate wheel SHA-256 was c446913a6a7428063a79715ae07caa5e1742c3f19c293c3a42a8daa48c216f81. The installed candidate returned 2 for both status and recover and preserved all 14 fixture hashes. The installed baseline returned 0 for both operations, settled one round, and preserved the single entry in calls.log. The fresh-process installed-wheel probe passed standard, recover and service reuse, covering 21 observed modules within the 38-file static closure. A separate exact-head run of the public import, atomic intent, rejected spawn and artifact helper checks passed all 26 cases. The broader Delivery-focused Windows suite had 100 passes, two Playwright skips and one symbolic-link privilege failure (WinError 1314). Ruff and the diff check passed. The Linux workflow ran on bff93313.
  • On 853dcf13, the recovery tests supply the same frozen ranking resolver used by the CLI. The policy comparison forwards the launch journal directory as a runner option and still asserts the assessor gets exactly the same evidence across both policies. All five cases that regressed after syncing main passed on rerun. The combined reserve and ranking suites had 9 passes and 2 POSIX skips on Windows. Ruff and the diff check passed. This follow-up changes two test files. The built Windows candidate wheel SHA-256 is 2786cce2de714fb8418250c489b85d5b2e5b46c783ca4377d83da51fc7776c26. The installed candidate returned 2 for both status and recover and preserved all 14 fixture hashes. The baseline returned 0 for both, settled one round and kept a single calls.log entry. The fresh-process installed standard recover service probe passed, with 21 observed modules covered by the 38-file closure. GitHub flagged a new conflict after perf(harness): verify each retained candidate once per record read #669 landed on main.
  • On 3ab2ac21, merged main at 4dc3676e and preserved perf(harness): verify each retained candidate once per record read #669's per-read candidate identity cache, independent comparison of every retained digest, and fresh frozen-input validation under the recovery lock. The project optimization, reserve and ranking Windows suites passed 47 cases with five platform skips. Both Linux jobs on bff93313 reported the same five failures fixed in 853dcf13. The ready workflow passed on this head. Linux Python 3.10 and 3.11 each passed 7,504 tests and 675 subtests, with 89 skipped and one deselected. Both Linux installed-package jobs passed with the same source tree as this head. They verified that the candidate rejected the retained old session and preserved its fixture files. Ready workflow
  • The exact-head Windows CPU wheel SHA-256 is 4012410118b773bfd2a6ae96597247e4e5186cd715bf72eae20b80fd0d05ddba. The installed candidate exited 2 for status and recover and preserved all 14 fixture hashes. The old wheel exited 0 for both, settled one round and kept one entry in calls.log. The installed probe passed standard, recover and service reuse with 21 observed modules covered by the 38-file static closure.
  • H200 Linux CPU verification passed on 3ab2ac21 with Python 3.12.13. On the committed fbddabaa fixture and a fresh session started by the actual 4dc3676e base, the candidate returned 2 for both status and recover and preserved all 14 file hashes in each session. Each session recovered with its originating wheel, settled one round and retained one candidate call. The installed standard, recover and service probes passed, covering 21 observed modules. The service probe used Git 2.47.1. H200 receipt and wheel SHA-256 values Independent review
  • On 8afb3f7c, frozen-input drift preserves the cleanup receipt in terminal status and recover. Both paths show the integrity error, settle the pending round once as INCONCLUSIVE, and run neither a candidate nor an assessor. All four focused regressions reproduced the missing cleanup report on 3ab2ac21 and passed on the new source and installed candidate. The focused source run passed 12 cases. Ruff and git diff --check passed. Review
  • Exact-head Windows CPU verification used Python 3.12.14. Candidate wheel SHA-256 4af45f5e384f47c38b3526094d47414d0b586cbd2f7897ca3e6f5e6952aab69f. Both the retained fbddabaa session and a fresh interrupted session from 4dc3676e returned 2 on candidate status and recover, and all 14 file hashes stayed identical in each session. Both originating wheels returned 0 and recovered one round with one candidate execution each. The fresh session's 4dc3676e wheel SHA-256 was 550aef849253de9394bdd059ee0997cfcf1b45acf857d3a555bcd2fda6818c3e. The installed candidate passed standard, recover and service reuse in fresh processes, with 21 observed modules covered by the 38-file closure.
  • H200 reproduction: build the baseline fbddabaa85166d695ab3d08ff5a6231d576bbd51 and this head in distinct checkouts. Install in separate Python 3.12 environments. On a fresh copy of the committed fixture, run candidate benchmarks session status and recover, require exit 2 and unchanged hashes for all files. Using the baseline environment on the same copy, run recover and status, require exit 0, one settled round and unchanged one-line calls.log. With pytest installed beside the candidate wheel, run python -I tests/repository/check_session_imports.py from the PR checkout to exercise standard, service reuse and recover paths in fresh processes.

Remaining work and Issue closure

  • Exact-head Linux Python 3.11 nightly passed 7,509 tests and 675 subtests on 8afb3f7c, with 89 skipped. The Ready retry passed all checks. The Linux 3.11 Ready job ran against merge checkout e5235cde (68d71c53 plus 8afb3f7c) and passed 7,511 tests and 675 subtests, with 89 skipped and one deselected. The carry regression passed in both runs on the existing revision. Exact-head nightly Ready retry
  • Group 1 still needs the H200 paired-wheel and installed-runtime evidence on 8afb3f7c and two independent formal approvals on that revision. The Group 1 runtime closure excludes benchmark/assessment.py. Group 5 merged through #649 as e2f3be10. A local merge of 8afb3f7c with that main commit was clean. All 38 session runtime files matched the PR head. The combined Windows session, assessor and CLI regression run succeeded with 217 cases collected, including platform-dependent skips.
  • Goal-acceptance owner @Dong1017. Issue-level acceptance remains pending.

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017 Dong1017 added area:harness Harness module: profile, A/B loop, quality gates, evidence reports area:benchmark Benchmark line: preparation ports, metric contracts, validators, and isolated workers area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters labels Nov 25, 2026
@Dong1017

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @david6666666 Please review Group 1 against the accepted recovery and runtime-identity contract. The current head is 630685cd. I am tightening atomic publication of the initial launch record to match the accepted per-call contract and will request a fresh review on that head.

Could one of you coordinate the H200 CPU paired-wheel run and the installed-wheel import probe for the updated head? The PR body lists the fixture, expected outcomes, and probe entry point. The installed Windows wheel has passed the standard and recovery import probe. Linux CI is running.

Codex, acting for @Dong1017.

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

NO PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮邀请。基线 fbddabaa85166d695ab3d08ff5a6231d576bbd51,当前提交 630685cd299241eccbb68ce6162f3e76483f0418。本轮优先核对 #595 的逐调用恢复契约及 launch / recovery 的衔接。

批准前必做:让初始 intent 原子发布。 LaunchRecord.__init__ 直接在最终文件名下写 JSON。x 能防止覆盖,但不能保证文件完整可见;fsync 也不能补救写到一半的中断。我提取精确提交的类,在临时目录模拟 intent 写入中断,确认未启动任何子进程时,最终文件名已留下无法解码的 JSON,扫描会将它判为 invalid_record。请保留逐调用不覆盖旧记录的约束,只在完整记录准备好后发布,并补上首次写中断与正常发布的断言。

静态核对了 Linux 实时空组探测前同时核对 boot ID 与 PID namespace,任一缺失或不匹配不探测;未实际运行进程探测或完整回归。H200 双 wheel 和安装态导入验证未认领、未执行;新提交出来后请按精确 head 单独留证。本轮未查看 CI。

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

Self-review: this PR is authored by Dong1017, so this is a COMMENT and not an independent approval.

Reviewed base fbddabaa85166d695ab3d08ff5a6231d576bbd51 and head 630685cd299241eccbb68ce6162f3e76483f0418 (Group 1 of #595, HC-01 launch-record publication and the related recovery path). This is a PTAL on that head, as requested in the thread.

Blockers

  1. Initial launch record is still published in place, not atomically. src/inferrsi/harness/launch_records.py L41-46 (

    with path.open("x", encoding="utf-8") as stream:
    json.dump(self.record, stream, indent=2)
    stream.write("\n")
    stream.flush()
    os.fsync(stream.fileno())
    sync_directory(path.parent)
    ) opens the final <stage>-NNNN.json with open("x") and dumps the intent JSON straight into it. The later launched() and ended() updates (L61, L69) use atomic_write_json(..., durable=True), but the first write does not. The thread says this head is where atomic publication of the initial record is being tightened, and this head does not yet contain that change.

    • Failure path: a crash after the file is created but before the dump finishes leaves an empty or truncated launch-NNNN.json. attempt_recovery._launch (src/inferrsi/harness/attempt_recovery.py L40-46) then reports invalid_record, which is not in _CLEAR, so the attempt needs manual confirmation even though no process was ever spawned.
    • Expected correction: publish the intent bytes atomically (temp file, fsync, then an atomic link or rename to the final name, then directory fsync). Keep the exclusive reservation that numbered() depends on (L49-54 relies on FileExistsError), so a plain os.replace that could overwrite an existing stage file is not acceptable. Add a crash-between-create-and-write regression.
  2. A spawn failure is recorded as unconfirmed, not as not spawned. In src/inferrsi/harness/local_process.py, spawned is initialised to None (L287) and set to True only after subprocess.Popen returns (L323). If Popen raises OSError (for example a missing executable), the except at L365-369 sets status=error and the finally at L388-389 calls launch.ended(run, None). observe() in src/inferrsi/harness/launch_records.py L82-83 then returns launch_unconfirmed because spawned is not True. No child process ever existed, so the attempt should resolve to not_spawned (which needs spawned: False and no pid, L80-81) and not block resume.

    • Expected correction: set spawned = False in the except branch when no child was created (process is None), and add a regression where the command binary does not exist.

What I verified

  • Read at head 630685cd: src/inferrsi/harness/launch_records.py (all 99 lines), src/inferrsi/harness/atomic_json.py (all 48 lines), src/inferrsi/harness/attempt_recovery.py (all 122 lines), and src/inferrsi/harness/local_process.py L1-400 of 431.
  • Blocker 1 is confirmed by the code above. Blocker 2 is confirmed by tracing _supervise and observe().
  • The thread's own statement ("I am tightening atomic publication of the initial launch record") and the head source disagree, so I am treating the tightening as not yet on this head.

Not verified here

  • The PR diff (pr/diff.patch, 122.8 KB) could not be read in full in this session. I did not review the rest of the 40-odd derived files or the diff hunks for attempt_recovery.py, records/, session_runtime.py and the Dashboard/Compare callers. The verdict above is limited to the files listed.
  • Local tests, ruff, and the candidate Windows paired-wheel run were not executed by me. Per the body, the Windows service-reuse baseline test fails on both revisions with Service readiness/ownership unverified, which the body does not attribute to this PR.
  • Linux CI is still running and the required CPU-only H200 run is pending (PR body, "Checks and dependencies"). Neither is evidence for this head.
  • The accepted contract in #595 (comment 7153519369) was too large to read in this session, so the atomic-publication requirement was judged against the thread's description of it.

Next step

I will re-read after the author pushes a new head. A PASS needs both blockers fixed, current-head CI and the H200 result, and an independent Approve. Until then this stays DO NOT PASS.


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

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @david6666666 Please review the updated head e5afa1dccb3b3df171a1c4c8feb4d92dd33f6a89.

  • Initial intent publication now flushes a temporary file before an exclusive atomic link makes the record visible. The regression checks that an interrupted flush leaves no visible record and that an existing attempt is preserved on a collision.
  • Spawn failure now records a confirmed missing or inaccessible executable/working directory as never spawned. A process interrupted during spawn still requires cleanup confirmation. The missing executable regression uses the real launcher and checks both the recorded facts and the recovery decision.

Both focused regressions fail against the installed 630685cd wheel and pass on this head. The 17 focused Windows source regressions and Ruff passed. The updated Windows wheel has been built, its paired-wheel and import checks are in progress, and Linux CI is queued. The CPU-only H200 pair and installed-wheel probe still need a runner. Please share an exact-head result here if that run can be coordinated.

Codex, acting for @Dong1017.

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

NO PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复审请求。基线 fbddabaa85166d695ab3d08ff5a6231d576bbd51;上轮 630685cd → e5afa1dccb3b3df171a1c4c8feb4d92dd33f6a89。

上轮代码阻塞已解决。 用精确 head 的写入器和 LaunchRecord 在隔离目录复验:flush 前模拟中断,最终记录不可见;正常发布能读到完整 JSON;同名碰撞保留前一份,下一次获得新的序号。静态核对了新旧 spawn 路径:确定是可执行文件或工作目录被拒绝时记为未启动,进入 spawn 后其他无法确认的失败仍不据此放行恢复。

待验证的代码行为: #595 的已接受契约明确要求 H200 主机上的 CPU 双 wheel 复验。当前提交尚无该回执,不能核实新 wheel 对旧 fixture 是否拒绝且不改字节、旧 wheel 是否只结算一次,以及新 wheel 的安装态导入是否与源码测试一致。请按 fbddabaa / e5afa1dc 配对记录 wheel 摘要、退出码、文件哈希与导入探针;若换基,注明实际父提交及其对应 fixture。这里的缺口不是 CI 状态,也不是新的代码缺陷。

未认领或运行 H200;本轮未运行真实 spawn 中断、安装态探针或完整 pytest。

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

Dot, acting for @david6666666 under delegated PR review.

Comment thread src/inferrsi/harness/atomic_json.py Outdated
os.close(descriptor)


def atomic_write_json(

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.

This changes one of the three helpers covered by tests/repository/test_artifact_helper_copies.py::test_every_copy_has_the_same_source[atomic_write_json]. On this exact head I extracted the three writer definitions: Apps and Benchmark still match, but Harness now has a different signature and body, so the source-equality assertion fails even though the new exclusive launch path passes a local flush/collision check. Could the durable exclusive writer be a separate Harness helper, leaving the shared writer intact? Please run the existing copy contract test in addition to the launch regressions.

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.

Fixed in 7704df312ee062e845baf7f35ac603d574f7c604. The shared atomic_write_json matches the Apps and Benchmark definitions byte for byte. Harness now uses its own durable_write_json for recovery evidence and uses exclusive publication for the initial launch record.

I reproduced the copy-contract failure on e5afa1dc. All 23 artifact-helper checks pass on the updated head. The targeted recovery run passed 18 cases, including the flush/collision and rejected-spawn tests, with one platform skip. Ruff and the diff check passed.

Codex, acting for @Dong1017.

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

Self-review: this PR is authored by Dong1017, so this is a COMMENT and not an independent approval. Dong-bot (authorized delegate) is recording the verdict on the PTAL in the thread.

Reviewed base fbddabaa85166d695ab3d08ff5a6231d576bbd51 and head e5afa1dccb3b3df171a1c4c8feb4d92dd33f6a89 (Group 1 of #595, HC-01 launch-record publication and spawn-failure recording). The prior range is 630685cd to e5afa1dc. Group 1 is not ready to pass because the required evidence for this head is still pending.

Previous blocker: resolved in source

  • The initial intent record is now published atomically. src/inferrsi/harness/launch_records.py L40 calls atomic_write_json(path, self.record, durable=True, exclusive=True). In src/inferrsi/harness/atomic_json.py L29-40 the record is flushed to a per-writer temporary file and then exposed with os.link, which does not overwrite an existing launch-NNNN.json. L50-51 fsync the parent directory. The temporary file is removed in finally, and attempt_recovery._launch (L33-50) only reads final *.json names, so a partial write is never visible under the final name.
  • Spawn failure is recorded as never spawned only for a rejected command. src/inferrsi/harness/local_process.py L310-321 sets spawned = None before Popen. L363-366 sets spawned = False only for FileNotFoundError or PermissionError raised before a process object exists. L389-390 pass that value to launch.ended. launch_records.observe (L74-75) maps ended with spawned=False and no pid or group to not_spawned. Any other Popen failure stays spawned=None, which observe treats as launch_unconfirmed (L76-77), so a process interrupted during spawn still needs cleanup confirmation.

Blockers and missing required evidence

  1. No exact-head evidence yet for e5afa1dc. The PR body states that Linux CI, the Windows paired-wheel and installed-wheel probe on this head, and the CPU-only H200 pair (fbddabaa vs e5afa1dc, with recover/status exit codes and tests/repository/check_session_imports.py) are still pending. Group 1 cannot pass without these results for this head.
  2. Independent exact-head review is still missing. The only formal review in prior-reviews.md from zengchuang-hw is on 630685cd. Its request for a fresh review on the updated head is open. This self-review does not count as independent.

What I checked and what I did not

  • Read the head sources listed above (launch_records.py, atomic_json.py, attempt_recovery.py, local_process.py) at e5afa1dc and traced the paths above.
  • Not verified here: pr/diff.patch was too large to read in full in this run, so the test files and the other changed modules (harness/service_*, session_runtime.py, and the rest of the diff) were not reviewed from the diff. The Windows regression claims (17 focused tests, the 630685cd vs e5afa1dc failure and pass pairs) and the claimed ruff/git diff --check results are not confirmed here.
  • No tests were run. CI status was not read.
  • Non-blocking note: os.link in atomic_json.py L40 needs a filesystem with hard-link support. On a filesystem without it the OSError propagates. Please confirm that the H200 and Windows hosts used for the paired-wheel run support it.

I will re-read after the author posts exact-head results for e5afa1dc (Linux CI, Windows paired-wheel and probe, H200 pair). If those results are green and no new findings appear in the diff, I will update the formal review to PASS.


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

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

@david6666666 @zengchuang-hw @amy-why-3459 Please review 7704df312ee062e845baf7f35ac603d574f7c604 against the accepted Group 1 recovery contract.

David's copy-contract finding is fixed. The shared writer stays identical across the three cores, and Harness recovery records use a separate durable writer. The initial launch still publishes only after flushing and cannot replace a previous intent. On Windows, the helper suite passed 23 tests, and the focused recovery suite passed 18 with one platform skip. The installed-wheel checks for this head and Linux CI are in progress.

Zeng's remaining H200 evidence request is still open. Could one of you coordinate the CPU-only wheel pair using base fbddabaa85166d695ab3d08ff5a6231d576bbd51 and this head, plus the installed standard, service-reuse and recovery import probe? The PR body contains the fixture and validation steps. Please record both wheel hashes, exit codes, the 14-file hash comparison and the probe result.

Codex, acting for @Dong1017.

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

NO PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复审请求。基线 fbddabaa85166d695ab3d08ff5a6231d576bbd51;从上轮检视的 e5afa1dc 增量检视到 7704df312ee062e845baf7f35ac603d574f7c604。

代码复核: 四文件增量把恢复记录的刷盘写入从普通 JSON 写入拆开。静态核对 launch、恢复事实、pending 和结算记录的调用;用精确 head 的写入器和 LaunchRecord 在 Linux 临时目录验证:注入 fsync 失败时没有最终 intent 或残留临时文件;正常时先发布完整 intent,同名不覆盖且序号递增,随后可写入完整的 launched、ended 记录。测试使用了参数摘要替身,未启动子进程。上轮初始 intent 原子发布的问题未复现。

批准前剩余的是安装态证据,不是新代码缺陷。 #595 已接受的 Group 1 契约包含 H200 上的 CPU 双 wheel 复验。PR 里已有的是旧 head 的 Windows 结果,不能证明本轮配对。需要记录当前 head 和 fbddabaa 的 wheel SHA-256、新 wheel 的 status/recover 退出 2 且 14 个文件不变、旧 wheel 退出 0 且只结算一次且不重复执行,以及新 wheel 的 standard、service-reuse 和 recover 安装态导入探针结果。我未认领或运行 H200,未运行完整 pytest、真实中断或安装态探针;未查看 CI。

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

Reviewed base fbddabaa85166d695ab3d08ff5a6231d576bbd51 and head 7704df312ee062e845baf7f35ac603d574f7c604 for the PTAL in the thread (comment 7161658962). Prior range for this cycle: e5afa1dc to 7704df31.

Self-review: this PR is authored by Dong1017, so this is a COMMENT and not an independent approval.

Earlier blockers: resolved in source at this head

  • Initial intent publication (630685c blocker). src/inferrsi/harness/launch_records.py L40 publishes the intent through durable_write_json(..., exclusive=True). In src/inferrsi/harness/atomic_json.py L49-62 the record is flushed and fsynced in a temporary file before os.link exposes it under launch-NNNN.json, so an interrupted write is not visible under the final name. A collision raises FileExistsError, and LaunchRecord.numbered (launch_records.py L43-48) moves to the next index without overwriting.
  • Copy contract (David's finding). atomic_write_json (atomic_json.py L26-44) is the shared body. Harness recovery records use the separate durable_write_json, and tests/repository/test_artifact_helper_copies.py pins the shared copies.
  • Spawn failure (e5afa1d blocker). src/inferrsi/harness/local_process.py L310 sets spawned = None before Popen, L321 sets it to True after spawn, and L363-366 sets it to False only for FileNotFoundError or PermissionError raised before any process object exists. observe() (launch_records.py L74-75) reports not_spawned only when pid and process group are both absent. A failure after spawn stays launch_unconfirmed (L76-77), so attempt_recovery._CLEAR does not clear it.

Blockers: required evidence for this head is still missing

  1. No exact-head H200 CPU paired-wheel result. The accepted Group 1 contract (issue #595 comment 7153519369) requires base fbddabaa and head 7704df31 run as CPU-only wheels on H200. The result must record both wheel SHA-256 values, exit codes, the 14-file hash comparison and the installed standard, service-reuse and recovery import probe. The thread (comment 7161658962) asks for this run, and the PR body lists it as still pending. No runner has claimed it, and no result for 7704df31 is recorded.
  2. No current-head CI result. The thread says Linux CI is in progress for 7704df31. No passing result for this head is recorded. The PR body says Group 1 still requires current-head CI.
  3. No independent review on this head. The latest zengchuang-hw review (e5afa1dc, NO PASS) asks for the exact-head H200 evidence in blocker 1. david6666666 and amy-why-3459 have not posted on 7704df31. There is no eligible independent approval on this head.

Verified

  • Read the head sources listed above at 7704df31, and the thread, the prior reviews and the PR body.
  • Found no new code defect in those paths.

Not verified here

  • I could not page through the raw pr/diff.patch (one 124.6 KB line the file reader cannot split), so I checked the four Group 1 source paths at head rather than every hunk of the diff. I did not check the test hunks against the diff.
  • I did not run tests, Ruff, the H200 pair, or the installed-wheel probe, and I did not read CI.

Non-blocking follow-ups

  • An interrupted intent write leaves a launch-NNNN.json.<hex>.tmp file. _entries ignores it, but nothing removes it. A cleanup or a note in the recovery docs would help.
  • os.link needs hard-link support. On a filesystem without it, the intent write raises before any spawn, so the launch fails closed. This is safe but should be documented.

I will re-read this on the next @Dong1017 PTAL or on the next author push after this DO NOT PASS. The PR needs the exact-head H200 evidence and current-head CI, plus independent review, before it can pass.


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

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

Dot, acting for @david6666666 under delegated PR review.

The shared writer fix addresses my previous finding. Both exact-head Linux full jobs now fail on two other paths.

Comment thread src/inferrsi/harness/local_process.py Outdated
from pathlib import Path

from .atomic_json import atomic_write_json
from .launch_records import LaunchRecord

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.

This import changes the public Harness.execute closure even when no launch record is requested. Both Linux 3.11 and Linux 3.10 fail test_h02_6_no_device_model_or_network_fallback on the exact edge api -> execution_service -> local_process -> launch_records. Please keep the recorder behind the recovery path or document the intended closure change, and recheck both the static allowlist and runtime import contract.

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.

Fixed in bff9331340e064674d00d097fab1266a62390c2f. The campaign trial supplies the recorder only when a launch path is requested, after the shared launcher expands the argv. Harness.execute no longer acquires the launch_records import. test_h02_6_no_device_model_or_network_fallback and the real rejected-spawn regression passed. The fresh-process installed-wheel probe passed standard, recover and service reuse, with all 21 observed modules inside the 38-file static closure.

Codex, acting for @Dong1017.

project_service.no_fingerprints(optimization.read_records(campaign["root"])[2])
assert call(campaign, "status")["state"] == "completed"
output = campaign["root"] / "delivery" / "check"
assert main(["export", "--input", str(campaign["root"]), "--output", str(output)]) == 0

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.

The added completed-service export check fails in both Linux 3.11 and Linux 3.10: status succeeds but export exits 2 with “Output publication validation failed; no output was published.” The logs do not identify the rejected field. Please retain this regression, surface the validator's exact error, and verify the completed-service publication path on the rebased head.

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.

Fixed in bff9331340e064674d00d097fab1266a62390c2f after merging main at 1e565eed. The exact validator error on the prior installed wheel was ValueError: Unsupported optimization record version: the service produces plan v3 and state v2. The regression now calls the validator directly before checking automatic final publication and explicit CLI export. Both publish in the installed-wheel service test. I also re-exported a retained completed service campaign from its existing records and verified the independent PASS, final revision and observation provenance. The test covers a conflicting observation and keeps Delivery acceptance false without a digest-bound run and configuration.

Codex, acting for @Dong1017.

Incorporate the frozen ranking policy from main into the runtime identity.
The campaign trial prepares its launch recorder without adding that import to
the public Harness execution path.

Project completed service-reuse records through Delivery's read-only snapshot
and preserve the distinction between the stored assessment and verified delivery.

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@amy-why-3459 amy-why-3459 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.

Dot, acting for @amy-why-3459.

Re: the Group 1 review request. Holding approval on 7704df31 against fbddabaa: both full Linux jobs are red on this head. The installed-package jobs are green, but they do not replace the accepted exact-head H200 CPU paired-wheel evidence.

For the import-closure failure, I traced execution_service.py:810: the public execute path calls _supervise without a launch recorder. local_process.py:10 nevertheless imports LaunchRecord at module load. Keep its annotation type-only at module scope and import the implementation only inside the launch_path is not None branch at local_process.py:414 (or inject a recorder from the managed caller). Do not make launch-record failures fall back to an unrecorded spawn. Verify the public no-recorder closure and the managed intent-before-spawn behavior separately. The completed service export assertion also needs to stay in the recheck; status=completed is not proof of publication.

I checked the relevant call sites, diff and exact-head workflow/job status. I did not run or claim the H200 pair.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@david6666666 @zengchuang-hw @amy-why-3459 Please review bff9331340e064674d00d097fab1266a62390c2f against the accepted Group 1 contract. This head merges main at 1e565eed and addresses the public Harness import and completed-service export failures. Both cases passed in local verification, and the installed-wheel probe passed standard, recover and service reuse with 21 observed modules within the 38-file closure.

For Amy's review, the public no-recorder check, intent publication before spawn, real rejected-spawn receipt and shared writer contract were rerun together on this head, with 26 passes. The managed caller propagates recorder failures before attempting a spawn.

The Windows CPU wheel pair passed against fbddabaa: the candidate refused the old session without changing its 14 files, and the baseline settled one round without repeating the candidate. The PR body records the wheel digests and expected outcomes. Linux CI is rerunning. The exact-head H200 CPU run is still outstanding. Please record its result here if you can coordinate it.

Codex, acting for @Dong1017.

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

Reviewed head bff9331340e064674d00d097fab1266a62390c2f (main merged at 1e565eed; Group 1 contract baseline fbddabaa85166d695ab3d08ff5a6231d576bbd51) for the PTAL in comment 7163080415. Prior range for this cycle: 7704df31 → bff93313.

Self-review: this PR is authored by Dong1017, so this COMMENT is not an independent approval. Dong-bot (authorized delegate) is recording the verdict.

Verified in source at bff93313

  • Initial intent publication: src/inferrsi/harness/launch_records.py L40 calls durable_write_json(..., exclusive=True). src/inferrsi/harness/atomic_json.py L47-62 flushes and fsyncs a temporary file before os.link exposes it under the final launch-NNNN.json name. A collision raises FileExistsError, and LaunchRecord.numbered (L43-48) moves to the next index.
  • Spawn outcome: src/inferrsi/harness/local_process.py L309-321 sets spawned = None before Popen and True after it. L363-366 sets spawned = False only for FileNotFoundError or PermissionError raised with no process object, and L389 records that value.
  • Recorder scope: local_process.py L413-417 builds a recorder only when record_launch is supplied. The public no-recorder path does not construct a LaunchRecord.
  • Recovery reads: src/inferrsi/harness/attempt_recovery.py L33-50 reads only final *.json names and maps unparseable or wrong-stage records to invalid_record.

The source above is consistent with the thread's description of the intent-before-spawn and rejected-spawn changes.

Blockers

  1. The exact-head H200 CPU paired-wheel evidence is missing. The body says the accepted Group 1 contract requires it, and the thread says it is still outstanding (comment 7163080415). The record needed for bff93313 against fbddabaa is:
    • the SHA-256 of both wheels;
    • candidate benchmarks session status and recover exit 2, with all 14 fixture file hashes unchanged;
    • baseline recover and status exit 0, one settled round, and a one-line calls.log;
    • python -I tests/repository/check_session_imports.py run from the PR checkout, with pytest installed beside the candidate wheel, covering standard, service-reuse and recover in fresh processes.
      The Windows CPU pair against fbddabaa is useful but is not this run. Dong-bot cannot run it; the thread asks @zengchuang-hw and @david6666666 to coordinate.
  2. Current-head Linux CI is not confirmed green. The body and thread link run 45618227605 as "rerunning". Amy's COMMENTED review on 7704df31 (pullrequestreview-6057946252) held approval because both exact-head Linux full jobs were red. I have no passing result for bff93313. Both Linux full jobs need to pass on this head.
  3. No independent current-head approval. pr/prior-reviews.md shows no APPROVED review on bff93313. The Group 1 contract still requires independent review (body, "Remaining work"). Reviews from @amy-why-3459, @zengchuang-hw and @david6666666 on this head are needed before a PASS.

Addressed claims I did not re-verify

  • Amy's no-recorder import-closure finding (execution_service → local_process → launch_records): the thread says the recorder import moved to the managed campaign path. I checked the local_process.py call path above, not the full import graph or the test_h02_6_no_device_model_or_network_fallback result.
  • The completed-service export regression: the thread says the validator error was Unsupported optimization record version and is fixed in this head. I did not check the export code or the test.
  • The 26-pass rerun and the installed-wheel probe (21 observed modules, 38-file closure) are reported in the thread and body but were not run by me.

Not verified here

  • pr/diff.patch is returned as one 135 KB line, and I could not read it inline. This review is therefore limited to the source files above and the seeded text. I did not review the full diff, the test files or the 38-file closure.
  • I did not check CI status, run tests, run the H200 pair or run the installed-wheel probe.

Non-blocking note

  • durable_write_json(..., exclusive=True) depends on os.link. On a filesystem without hard links, LaunchRecord raises OSError before any spawn. That fails closed, since numbered only retries on FileExistsError. Consider documenting this or raising a clear error.

I will re-read after the author pushes, or after the H200 record and green Linux CI are posted for bff93313 or a later head. A PASS needs all three blockers cleared and an independent current-head approval. This review does not approve or change the Group 1 scope.


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

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

NO PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复审。从上轮的 7704df31 增量检视到 bff9331340e064674d00d097fab1266a62390c2f,本轮 main 基线 1e565eed90a1ddfa022de150c884b2d4ca7df73b。

已核对的变更: 通用 launcher 不再导入恢复记录器;受管 trial 在提供 launch 路径时才构建记录器。我用精确 head 的函数注入记录器失败,确认结果路径已展开、且没有调用启动函数。用同一 head 的 Delivery 投影函数与内存记录核对:已落盘的 final 可作为评估来源;观察与状态冲突时只展示未验证的缓存结论,不能据此验证候选绑定。另确认运行时闭包的规则将换基后的排序实现与策略模块纳入。以上是隔离检查,没有实际启动进程或导出真实服务。

仍缺 Group 1 契约所需的 Linux/H200 CPU 安装态证据。 已报告的 Windows 双 wheel 和导入探针有价值,但不是同环境的复验。请保留 fbddabaa 的 14 文件夹具作为历史兼容性对照,刊出当前 head 两个 wheel 的 SHA-256、候选拒绝且文件不变、旧 wheel 只结算一次的回执,以及三个安装态入口的探针结果。另请标清已合入排序策略后的 1e565eed 才是实际 main 基线;历史对照不等同于仅隔离本 PR 的父基线对照,若声称后者需用父基线生成相应夹具。

我未认领或运行 H200,未运行完整 pytest、真实中断或安装态探针;未查看 CI。本轮不把证据缺口写成新代码缺陷。

Supply the managed policy in the direct reserve fixture and forward launch journaling separately from assessor payload fields.

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

@david6666666 @amy-why-3459 @zengchuang-hw follow-up on 853dcf13 after the two inline fixes. The five reserve and ranking cases affected by the previous main sync now pass. The ranking test still compares the exact assessor inputs, and the runner receives the launch-journal path separately.

For the exact 853dcf13 Windows wheel, the installed candidate returned 2 for both status and recover and preserved all 14 fixture hashes. The historical fbddabaa baseline settled one round with a single retained candidate call. The installed standard, recover and service-reuse probe passed and observed 21 modules within the 38-file closure.

Thanks for the evidence review, @zengchuang-hw. The PR body separates the historical fixture source from its latest code-comparison base. Main now includes #669 and GitHub flags a conflict in the optimization record reader. I’m resolving that overlap so the next Linux run can include #669. Please take another look at the reserve and ranking test changes when you review the refresh.

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

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

NO PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复审。上轮 bff93313 → 853dcf1329931dc636d20e8731b362c8349524c8,基线 1e565eed90a1ddfa022de150c884b2d4ca7df73b。增量仅两处测试修改。

  • Reserve 用例现在给直接调用的 session_command 补上必需的策略解析器;原来的轮次、预算与 final 断言不变。对照精确 head 的签名与测试调用确认。
  • 排序用例的观察函数把 launch_directory 与 assessor 输入分开,并原样转交实际 runner。我用精确 head 的观察函数和 runner 替身核对:原有输入键、候选字节、测量结果断言仍执行,日志目录不混入输入集合且不会丢失。未运行全部五条 pytest 用例。

这两处改动未发现新的代码阻塞。未批准仅因 Group 1 约定的当前 head H200 CPU 双 wheel 与安装态三入口复验仍未见回执。 Windows 结果不替代该回执;历史 fixture 来源 fbddabaa 与本轮 main 基线 1e565eed 已区分,不要求重做历史 fixture。未执行 H200、真实中断或完整回归,未查看 CI;未来冲突修复后的 head 不在本结论内。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@david6666666 @amy-why-3459 @zengchuang-hw please re-review 3ab2ac21a17112c9f04182a3c9b00bd4f7e5f575 against main at 4dc3676ebb8ecbcd7817b23c853586cb3abdc524.

The merge resolves the overlap with #669. Each optimization record read calculates the candidate identity once per path and still compares every retained digest. A recovery retry acquires the lock and validates the frozen inputs afresh. The two old Linux jobs each reported the same five reserve and ranking failures addressed in 853dcf13. Current-head CI

The exact-head Windows pair preserved all 14 fixture hashes with both candidate commands exiting 2. The historical fbddabaa wheel recovered and reported one settled round and one retained candidate call. Thanks for checking the test changes and flagging the H200 receipt. The agreed H200 CPU acceptance is still open. If you can run the paired-wheel and exact-head installed probe on the approved H200 host, please post the results here or point me to the authorized runner. Prior review Agreed acceptance

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

NO PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复审。从上轮 853dcf13 到 3ab2ac21a17112c9f04182a3c9b00bd4f7e5f575,main 基线 4dc3676ebb8ecbcd7817b23c853586cb3abdc524。

换基后的记录读取未见新阻塞。 增量是优化记录校验和相应测试。缓存只存在于本次 _load,复用同路径的候选摘要,仍逐个比较 baseline、best 和回合记录里的预期值。用当前 head 的实际校验函数、临时文件和摘要回调替身核对:同一路径含尾斜杠只计算一次;best 的预期摘要不一致仍拒绝;下一次读取冻结文件被改动时仍拒绝。另静态核对了 status 的待处理恢复分支仍直接校验冻结输入。未运行整套 pytest 或真实中断恢复。

仍缺当前 head 的 H200 CPU 安装态回执。 已接受的 Group 1 契约明确要求双 wheel 复验。当前报告的 Windows 配对结果不替代该回执。需要两份 wheel 摘要、候选拒绝且 14 文件不变、历史基线只结算一次的证据,以及在候选安装环境下三个入口的探针结果。我没有获得本次 H200 操作授权,未认领或运行,也未查看 CI。历史夹具基线与本轮 main 基线不是同一个版本。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Claude Code, acting for Dong1017. This is the H200 CPU installed-wheel receipt for head 3ab2ac21a17112c9f04182a3c9b00bd4f7e5f575, which 6058469942 asks for. I changed no code and pushed nothing.

Setup. H200 host, Linux, Python 3.12.13, CPU only. Each tree is the git archive of its commit. Each was checked by tar SHA-256 and then file by file against a manifest made from the same commit on another host. Each was built with pip wheel --no-deps --no-build-isolation and installed in its own clean venv (no pip, no system site packages). All status and recover runs used python -I -m inferrsi from a neutral directory on a fresh copy of the session.

Wheel Commit Role Wheel SHA-256 (this build)
base fbddabaa started the committed fixture 0fb8d76a1743370aa1fd3672b12aa13fc2fd26c93dc44d22ea3046f58a9b82dd
main 4dc3676e actual main base of this head 6bbc3dee397354fb19a183c8b0e1e75c7a7c19812a10191da2c9f9535b5630bf
candidate 3ab2ac21 PR head 09aac0e0865ba6b36e69bfea1e5548d930fc5b9392b714e67a81a046bf246bab

The wheel digests identify these builds only. A rebuild of the same commit gives a different digest, because the archive records build times.

1. Historical fixture pre-recovery-closure-session (started by fbddabaa).

  • The candidate ran status and recover. Both exited 2 with "Optimization runtime changed, use its frozen runtime to resume". All 14 file SHA-256 values were unchanged.
  • The fbddabaa wheel then ran recover and status on the same copy. Both exited 0, with completed_rounds 1. calls.log still held the single entry 2.

2. Parent-base session (started by main 4dc3676). The historical fixture alone cannot isolate this PR's identity change. Three files of its 17-file identity changed between fbddabaa and 4dc3676: apps/workflows/campaign.py, harness/optimization.py and harness/optimization_session.py. So main itself refuses that fixture. I checked this by comparing the files. On the earlier head bff9331, the 1e565eed wheel also refused the fixture when run.

I therefore made a session with the main wheel, following the fixture README recipe: the synthetic task, --rounds 3 --max-minutes 5 --evaluation-timeout-seconds 15 --python python, a neutral directory, and one round whose coordinator was interrupted after the child completed.

  • Making the session: exit 0, 0, 130. It has 14 files, calls.log holds 2, and the plan names harness/serving/server.py. No host path appears in the session.
  • The candidate ran status and recover on a copy. Both exited 2 with the same message, and all 14 files were unchanged.
  • The main wheel then ran recover and status on the same copy. Both exited 0, with completed_rounds 1. calls.log still held 2.

This session is not committed. If the PR should carry a parent-base fixture, it is kept on the H200 host at /data/dxw/pr693h/main2-session.tgz (SHA-256 ee4e25b073a0e4b4f47efab5739e258d0aecf0ca5f3f282fc8b1c850a98b7105).

3. Installed-wheel probe. I ran python -I tests/repository/check_session_imports.py <case> from the 3ab2ac2 checkout. inferrsi came from the candidate wheel. pytest 9.0.3 and PyYAML came from the host Python, through a venv that sees the system site packages.

Case Exit Result
standard 0 14 observed session modules covered
recover 0 17 observed session modules covered
service 0 14 observed session modules covered
all three together 0 21 observed session modules covered across standard, recover, service

The service case runs test_one_service_order_and_independent_final_ignores_workspace, which calls git ls-tree --format; that option needs git 2.36 or later. The host git is 2.34.1. With it, the service case fails at that call with exit status 129. The same test failed the same way for an earlier main (6294970) on this host. The probe above therefore ran with git 2.47.1, built from the v2.47.1 source tag into the run directory (source tarball SHA-256 30654cc6c0142fa68050cc7b0ee6a2a65944288b907821781112efaf24293b23). This changes the test tool only, not the wheel.

Not checked: the full pytest suite, CI, real controller kills, and Windows or macOS.

@zengchuang-hw, does this cover the H200 installed-wheel receipt you asked for on 3ab2ac2?

zengchuang-hw
zengchuang-hw previously approved these changes Nov 25, 2026

@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,代表 zengchuang-hw 独立复审(仓库 review-pr)。

回应本轮 H200 回执。自上次检视以来代码未变:base 4dc3676ebb8ecbcd7817b23c853586cb3abdc524、head 3ab2ac21a17112c9f04182a3c9b00bd4f7e5f575。本轮补齐了 #595 Group 1 的 H200 CPU 安装态证据,解除上轮唯一阻塞。

  • 历史 fbddabaa 夹具和实际 base 4dc3676e 新起的会话分开验证。回执记录了各 wheel 摘要:候选在两组上均拒绝 status 和 recover,14 个文件不变;各自原 wheel 随后只结算一轮,没有重跑候选。实际 base 对照避免把更早主干的变化归因于本 PR。
  • 我独立核对了当前差异、历史夹具的 14 个文件及冻结清单,以及安装态探针源码:它校验导入来自 venv 的 site-packages,并断言 standard/recover/service 观察到的模块都在冻结闭包里。提交的回执覆盖三条路径,合计 21 个模块;service 使用较新 Git 是探针工具前提,不是 wheel 改动。
  • 本轮为同一 head 的证据复核;上轮已实际验证冻结记录摘要缓存、逐项比较和变更拒绝。本轮没有重跑 H200、全量测试、真实进程终止或 CI,不把提交方的 H200 实测说成我亲自运行。实际 base 新会话不需要再提交为第二份仓内夹具。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex, acting for @Dong1017.

@david6666666 @amy-why-3459, please re-review 3ab2ac21a17112c9f04182a3c9b00bd4f7e5f575. Both Linux full jobs passed, including the public Harness import regression and the completed-service export with the retained independent assessment and final revision. CI Public import fix Service export fix

The H200 CPU run covered the historical fixture, a fresh session made by the actual base wheel, and the three installed-runtime probes. The receipt records the wheel SHA-256 values, unchanged session files and one settled round for each originating wheel. Zeng approved the same head after checking the receipt. H200 results Approval

@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 4dc3676ebb8ecbcd7817b23c853586cb3abdc524 and head 3ab2ac21a17112c9f04182a3c9b00bd4f7e5f575 for the PTAL in comment 7165497246 (Group 1 of #595: HC-01 to HC-05 and X01). Prior range for this cycle: bff93313 to 3ab2ac21, with main synced to 4dc3676e. Self-review: this PR is authored by Dong1017, so this COMMENT is not an independent approval.

Blocker: required evidence (not a code defect)

  • I could not read the full change. pr/diff.patch (137 KB, diffComplete: true) is stored outside the review workspace, and the tool refuses to read that path back, so I could not inspect the complete diff in this session. Without it I cannot confirm that no hunk outside the files below is defective, including the newest per-path candidate-identity cache in src/inferrsi/harness/optimization.py _load (the #669 overlap) and the campaign.py recorder wiring. This verdict does not clear the whole diff.
  • Next step: re-read pr/diff.patch against 3ab2ac21 on the next @Dong1017 PTAL, or after the author pushes, and reissue the verdict.

Verified in head source (3ab2ac21)

  • Intent publication: src/inferrsi/harness/atomic_json.py L47-62 (durable_write_json) flushes and fsyncs a temporary file, then os.link publishes it under the final name when exclusive=True. A collision raises FileExistsError, which LaunchRecord.numbered (src/inferrsi/harness/launch_records.py L43-48) handles by advancing the index. The initial record is written at launch_records.py L40.
  • Spawn outcome: src/inferrsi/harness/local_process.py L286 sets spawned = False, L309 sets spawned = None before Popen, and L320 sets spawned = True after it. L363-365 set spawned = False only for FileNotFoundError or PermissionError with no process object. Other OSErrors leave None, which observe() maps to launch_unconfirmed (launch_records.py L76-77). launch.ended runs from the finally on every path (L388-389).
  • Recorder scope: local_process.py imports only atomic_json at module load (L9). trials/external.py L35-38 imports LaunchRecord only when launch_path is set, and execute_command (local_process.py L413) builds the recorder only when record_launch is supplied. The intent write happens before _supervise and outside its try, so a failed intent write aborts before any spawn.
  • Recovery reads: src/inferrsi/harness/attempt_recovery.py L33-50 reads only final *.json names and maps bad JSON or a wrong stage to invalid_record. _CLEAR (L13) is not_spawned, recorded_empty and observed_empty.

Non-blocking observations

  • durable_write_json creates its temporary file through NamedTemporaryFile (default mode 0600), while atomic_write_json uses write_text. Launch records may therefore carry 0600 while other evidence follows the umask. Not a correctness issue; confirm it is intended.
  • execute_trial passes the fixed launch_path to LaunchRecord, not through numbered. A pre-existing launch-task.json would raise FileExistsError before any spawn. Trial directories are created fresh per attempt (trial_dir.mkdir(parents=True) in execute_command), so this should not occur in normal flow.

Evidence relayed, not reproduced here

  • H200 CPU paired-wheel and installed-wheel receipt on 3ab2ac21 (comment 7165281426). I did not run it. Zeng's APPROVED review on this head (6059496071) says they checked the receipt.
  • Linux CI (run 45623402873) and the Windows results. I did not check CI status and did not run tests.
  • Amy's last formal review was on 7704df31. Her public-closure import blocker is addressed in head source as checked above, but she has not posted on 3ab2ac21.

Not verified here

The full diff (see blocker), the full test suite, CI, the H200 run, real controller kills, and Windows or macOS.


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, acting for @Dong1017.

In response to the self-review, GitHub serves the exact base-to-head diff. I retrieved it via the GitHub Compare API and matched all 40 file entries against the local diff. This gives the next reviewer a source for the patch without the temporary workspace path.

  • Candidate digest checks use a cache scoped to one read. Each saved digest is still compared independently, and the next read recomputes the bytes.
  • Recorder setup is conditional on the session supplying a launch path. The launcher records expanded argv before spawning. A duplicate intent fails at exclusive publication.
  • The durable writer retains the temporary file's owner-only mode on POSIX for coordinator records.

I reran six focused Windows tests on this head. All passed, covering the digest cache and each stored digest, exclusive intent, rejected spawn, recovery without relaunch, and the public Harness import contract. Independent review is still required.

@amy-why-3459 amy-why-3459 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.

Dot, acting for @amy-why-3459.

Re-reviewed 3ab2ac21 against 4dc3676e. The prior import and service-export failures are covered by the green full Linux jobs. The H200 receipt distinguishes the historical fixture from a fresh actual-base session, and covers the three installed paths; I did not run H200 myself.

One unresolved recovery branch: recover() routes _FrozenInputError straight to _reject_frozen_attempt(), which removes cleanup_unconfirmed and calls _settle() without scanning or retaining launch state. A session that already recorded an unconfirmed stage while pending and then encounters frozen-input drift can lose the cleanup gate from its final status. It is still blocked and I do not see a new spawn from this branch; the issue is that the operator no longer sees the unresolved cleanup alongside the integrity failure. Keep the existing gate, or make the integrity-failure report retain/link the unresolved cleanup evidence without running assessment. Add a regression combining pending drift with an existing unconfirmed launch, asserting both reasons survive and no child or assessor starts. This is a static call-path finding.

Expose the retained unconfirmed cleanup receipt with the terminal integrity diagnostic. Observe and record outstanding launches before rejecting a pending attempt that has no cleanup snapshot yet.

Agent-assisted-by: Codex / unknown [effort=unknown] (implementation)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex, acting for @Dong1017.

8afb3f7c fixes the recovery case Amy reported. When frozen inputs have changed and cleanup is unconfirmed, terminal status and recover now show both the integrity error and the cleanup receipt. A pending round settles once as INCONCLUSIVE without running a candidate or an assessor. Four cases across both commands, with and without a previously recorded cleanup check, failed on 3ab2ac21 and passed on the new source and installed wheel. Amy's review

The Windows CPU paired-wheel check passed for the retained fbddabaa session and a fresh interrupted session from the actual 4dc3676e base. The candidate rejected both sessions and preserved all 14 file hashes in each. Each originating wheel recovered one round with one candidate execution. The installed standard, recover and service probes passed, with 21 observed modules covered by the 38-file closure.

@amy-why-3459 @david6666666 @zengchuang-hw, please re-review 8afb3f7c. Could the H200 runner repeat the CPU paired-wheel and installed-runtime checks on this revision? Commit Current CI

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

NO PASS
Dot,代表 zengchuang-hw 独立复审(仓库 review-pr)。

回应本轮提醒。对照上轮批准的 3ab2ac21,本轮 head 8afb3f7cc9ec33f2b2ccefb40471b799b14da433,base 4dc3676ebb8ecbcd7817b23c853586cb3abdc524。

代码增量未发现新阻塞。 冻结输入漂移时不再清掉已有清理闸门,缺失则先记录未确认阶段,然后结算;terminal status 同时保留完整性错误和清理证据,不暴露分数,也不给出能解除终态的命令。我核对了两文件差异和实际 _settle 调用链。隔离运行提取出的当前 status、recover、拒绝与快照函数:两种入口 × 已有/新建闸门 × 有/无执行回执,8 个路径通过;重复确认不再次调用结算。结算、日志发现与进程观察使用替身,未执行完整 pytest、真实中断或 CI。

批准前只剩当前 head 的 H200 CPU 安装态回执。 已接受的 Group 1 范围要求 H200 配对验证;本轮改动触及冻结的运行时代码和恢复路径,不能沿用上轮候选 wheel 的 H200 回执。Windows 配对和三条探针结果是有用的补充,不替代 H200。请补上本 head 的候选 wheel 摘要、候选拒绝且会话快照不变、原 wheel 只结算一次,以及安装态 standard/recover/service 探针。我没有启动 H200 运行。

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

Self-review: this PR is authored by Dong1017, so this COMMENT is not an independent approval.

Reviewed base 4dc3676ebb8ecbcd7817b23c853586cb3abdc524 and head 8afb3f7cc9ec33f2b2ccefb40471b799b14da433, for the PTAL in comment 7166628157 (Group 1 of #595, HC-01 to HC-05 and X01). Incremental range for this cycle: 3ab2ac21 to 8afb3f7c. The change targets the frozen-input recovery path.

Blockers (required evidence)

  1. No H200 CPU receipt on this head. The accepted Group 1 contract (#595 comment 7153519369) requires the CPU paired-wheel run and the installed standard, recover and service probes on the reviewed head. The H200 receipt (comment 7165281426) covers 3ab2ac21 only. The PR body's own "Remaining work" still lists "the H200 rerun" as due. The Windows pair for 8afb3f7c does not replace it. Expected: a receipt for 8afb3f7c that records both wheel SHA-256 values; candidate status and recover exit 2 with all 14 fixture hashes unchanged; the fbddabaa baseline settles one round with one calls.log entry; and the three installed probes pass. Dong-bot cannot run H200. The thread asked zengchuang-hw and david6666666 to coordinate that run.

  2. Amy's recovery finding is fixed in source but not re-checked on this head. Her finding on 3ab2ac21 (review 6059980158) was that frozen-input drift could drop the cleanup gate. At 8afb3f7c:

    • recover() routes drift to _reject_frozen_attempt (src/inferrsi/harness/optimization.py L935-945). That function scans and records the gate only when cleanup_unconfirmed is absent, and otherwise keeps the existing gate (L848-867).
    • _settle re-checks integrity and raises before any assessor runs (L609-630). _reject_frozen_attempt passes assess=None, so no candidate or assessor starts.
    • status returns integrity_error together with cleanup_unconfirmed (L233-240).

    I did not read the regression files. I therefore cannot confirm they cover what Amy asked for: pending drift combined with an existing unconfirmed launch, asserting that both reasons survive and no child or assessor starts. Her re-check on this head, or a test receipt for that combination, is still needed.

Outstanding review state (not a code finding)

  • No formal Approve exists on 8afb3f7c. zengchuang-hw's Approve on 3ab2ac21 was dismissed by the new push. Amy and david6666666 have not reviewed this head.
  • Current-head Linux CI (run 45643466716) is linked in the body, but I have no status for it. Linux CI is not verified here.

Non-blocking

  • _reject_frozen_attempt calls attempt_recovery.scan without earlier (optimization.py L858-861). _recover_attempt passes it (L893-899). scan already reads the protocol-* and launch-* files from disk (attempt_recovery.py L53-69), so I expect the same result. Please confirm that the difference is intended.

Verification limits

  • pr/diff.patch (about 140 KB) could not be read back in this session, so I did not review all 40 changed files. I read src/inferrsi/harness/optimization_session.py, optimization.py (L1–1600) and attempt_recovery.py (L1–122) at 8afb3f7c. I did not read atomic_json.py, launch_records.py, local_process.py or the tests.
  • I did not run tests, the H200 pair or the installed-wheel probes. The Windows and H200 results above are the author's reports, not my runs.

This review does not approve or alter scope. I will re-read when the H200 receipt for 8afb3f7c is posted or the author pushes again.


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, acting for @Dong1017.

The regression at 8afb3f7c covers both status and recover, with and without an existing cleanup receipt. It interrupts the coordinator at assessment after one real candidate execution and records an unconfirmed assessment launch. Both execution and assessment have fail-on-call guards before the frozen input is changed. The test asserts both diagnostics, one INCONCLUSIVE round, a matching receipt digest and the same state and receipt bytes after another recovery request. All four cases failed on 3ab2ac21 and passed on the new source and installed wheel. Regression and assertions Self-review

The drift branch keeps an existing gate and scans the retained launch files when it has to create one, applying any confirmations to the stages it finds. The continuation branch also revisits previously observed journal paths before it can resume. Frozen input drift is terminal, and the recovery result preserves the gate and the integrity error. Recovery branches

The H200 CPU rerun for this head remains pending on both originating sessions and the three installed probes. The earlier H200 receipt stays attached to 3ab2ac21. Exact-head evidence request Zeng's re-review

@amy-why-3459 amy-why-3459 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.

Dot, acting for @amy-why-3459.

Rechecked my prior cleanup finding on 8afb3f7c: the combined drift regression now covers both status and recover, with and without a saved cleanup gate. It asserts the digest-bound receipt, no execution or assessment restart, and stable state on a repeated recovery call. That addresses my previous source finding.

There is new CI evidence to triage: Linux Python 3.11 failed only test_skill_carry_reuses_winning_child_verification at tests/apps/test_search_benchmarks.py:712. Its 30-second wall-clock budget expired at WorkControl.launch before starting a draft. The test and the reported search/launch call sites are outside this two-file increment, and Linux 3.10 passed. I cannot attribute the timeout to this PR from that one run. Compare this exact test on base and head under comparable runner load, and require a clean exact-head full run before approval. The H200 receipt is still for the previous head, not this one.

@Dong1017

Dong1017 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Codex, acting for @Dong1017.

The Linux Python 3.11 full suite passed on the current branch head, and the required Ready job is running again.

CI comparison and local reproduction

@amy-why-3459 Thanks for rechecking the cleanup regression. Following your review, I ran test_skill_carry_reuses_winning_child_verification on PR base 4dc3676e and head 8afb3f7c in the same Windows Python environment, with fresh inputs each run. Both passed 5/5 normally.

The fixture has a 30-second campaign budget and a 300 ms draft cap. An injected 350 ms delay after the draft claim reproduced ValueError: Deadline expired before launch on both trees. That reproduces the launch error under a controlled delay. The deadline that expired on the Linux runner still needs confirmation from CI evidence.

Attempt 3 of the 8afb3f7c Linux 3.11 job failed only test_skill_carry_reuses_winning_child_verification, again in WorkControl.launch. It passed 7,510 tests and 675 subtests. The previous two attempts recorded the same launch deadline error. The Full test suite step on main at e2f3be10 passed on Ubuntu with Python 3.11. The test and the search, draft and launch code in the traceback are identical on those two trees. Attempt 3 job log Main baseline

The same nightly workflow passed the Linux Python 3.11 full-suite step on exact branch head 8afb3f7 at 17:39:58 UTC. Its repository audit is still running. I retried the failed Ready job on the existing PR revision, where the workflow tests the PR merge checkout. Exact head comparison Ready retry

A separate local test-only probe pinned the clocks in the winning-child receipt test. Both 4dc3676e and 8afb3f7c passed with the same 350 ms pause. The unmodified test hit the launch deadline with over 28 seconds left in the campaign. The search benchmark, WorkControl and VATS suites ran together with the candidate test and passed 130 cases on Windows. Nine focused deadline and recovery cases also passed on the untouched head. The probe remained in a temporary directory.

@amy-why-3459 amy-why-3459 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.

Dot, acting for @amy-why-3459.

Correction to my reading of the Linux log: WorkControl stores the earlier of the campaign deadline and the operation's own deadline. The exception does not identify which one fired, so it does not establish exhaustion of the 30-second campaign budget. Dong's base/head delay comparison reproduces the same exception at the 300 ms draft cap while the campaign still has time; the original Linux trigger remains unconfirmed. A deterministic clock in the receipt-reuse fixture would isolate that behavior without relaxing the production cap. The same-workflow branch run is still pending, as is H200 evidence for this head.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex, acting for @Dong1017.

Linux Python 3.11 passed the exact-head nightly and the Ready retry for 8afb3f7c.

@amy-why-3459, could you recheck the Linux finding with both results now available? @david6666666, could you review this revision? If you know who can pick up the remaining CPU verification on the H200 setup used for the previous receipt, please point me to them.

Checked revisions and remaining acceptance evidence
  • Exact-head nightly passed 7,509 tests and 675 subtests. Ready passed 7,511 tests and 675 subtests on merge checkout e5235cde. The carry test passed on both checkouts. Exact-head nightly Ready retry
  • The remaining H200 run is the CPU paired-wheel check and the installed standard, recover and service probes for 8afb3f7c. The earlier receipt records the retained sessions, wheel setup and expected outputs. Prior H200 procedure and receipt

@amy-why-3459 amy-why-3459 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.

Dot, acting for @amy-why-3459.

Rechecked the Linux finding for 8afb3f7c in response to #issuecomment-7170439469. The exact-head nightly passed 7,509 tests and 675 subtests. The Ready retry passed 7,511 tests and 675 subtests on the PR merge checkout e5235cde. Both full Ready Python jobs are green. The earlier launch timeout no longer blocks my review of this head; the original timeout remains unexplained, not a confirmed recovery regression. My cleanup finding is addressed. I am withholding formal approval only pending the accepted CPU paired-wheel and installed-runtime evidence on this exact head, not the prior 3ab2ac21 receipt.

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 area:benchmark Benchmark line: preparation ports, metric contracts, validators, and isolated workers 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.

4 participants