Skip to content

refactor(harness): close the artifact-primitive edges from six Harness modules into Infra (R2) - #478

Merged
Dong1017 merged 5 commits into
mainfrom
impl/r2-harness-primitives
Nov 17, 2026
Merged

Dong1017 merged 5 commits into
mainfrom
impl/r2-harness-primitives

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Refs #412

R2 only, following merged C1/C2/R1/A1/A2 and independent of M1 (#477). R3 is not implemented.

  • Add harness/artifact_primitives.py with digest, sha256 and file_lock. Each function's source is identical to the one in infra/artifacts.py; a test compares them with inspect.getsource.
  • Switch the six Harness modules named in task: R01 — retire legacy root paths and close core dependencies #412 (agent_sessions, candidates, optimization, optimization_session, project, task_protocol) to these primitives, and take atomic_write_json from the existing harness/atomic_json.py, which S01 already pinned byte-for-byte to the Infra writer. optimization_session's three function-level imports are switched as well.
  • infra/artifacts.py is unchanged and stays for its other users (tools, Benchmark, Model validators, infra/campaign.py).
  • The optimization session's runtime identity adds harness/artifact_primitives.py. The six edited modules are already in that identity, so a session started before this change refuses to resume after it, as for any edit to them.
  • first_wave_report() no longer reports harness reaches model/infra. Its 12 hits were the package-level inferrsi.infra edge and the inferrsi.infra.artifacts edge from each of the six modules; both are gone, and none was replaced by another inferrsi.infra import. Harness has no inferrsi.model edge. The only blocker left is runtime resource loaders: 5 (R3), so isolation_complete stays false.
  • No scan, assertion or allowlist was widened. No Harness-to-Infra allowance was added.

Tests

  • test_target_module_import_gate, test_knowledge_compatibility_shells and test_legacy_run_forwarder_gate now expect blockers == ("runtime resource loaders: 5",) and no Harness -> model/infra path.
  • New negative control test_returning_r2_harness_infra_edges_fail (24 subtests): for each of the six modules, a relative top-level import of infra.artifacts, an absolute import inside a function, an import of another Infra module (infra.processes) and an import of inferrsi.model each report both the package edge and the module edge and keep isolation false. The same tree without them is fully isolated.
  • New equivalence test test_harness_artifact_primitives_match_infra_bytes_and_semantics: identical source for all three functions; no inferrsi or relative import in the new module; equal digest output, ValueError on NaN; equal sha256 over a file larger than the 1 MiB read block, FileNotFoundError on a missing file; a Harness lock and an Infra lock on the same path exclude each other in both orders, and the lock file stays b"0".

Provenance

Based on main 1acfacf8d49a13edf8d1fbdfde224c11ddbee8bf. Commits: the change (e99ca4b); a test-only fix for two real-tree assertions that the H200 full suite caught (a7d4b08); an ordinary signed-off merge of main 1bbc3b0c8de14d6194d7ee7987607365b665fbfe (M1, #477) that keeps both CHANGELOG entries and leaves the four root MindIE modules retired (36d14e3); a test-only review fix (1d0190e); and a CI-only commit that runs the R2 primitive and writer nodes in the hosted Windows job (6bc3750). No rebase, no amend, no force push, no skipped hooks.

The code, tests and docs were written in a Claude Code session reported as claude-opus-5-5, effort xhigh, confirmed by the owner. This is client/session attribution, not a backend attestation. The changed paths are outside the knowledge-model-policy protected scope, so the declaration below is disclosure only. Passing tests is not architecture approval.

Evidence

  • Hosted Windows, R2 primitive regressions (6bc3750): host-compatibility (windows-latest) now has a step "Test the Harness artifact-primitive and writer nodes on Windows". It runs test_harness_artifact_primitives_match_infra_bytes_and_semantics, test_harness_owned_writes_and_digests_match_infra_bytes, the three writer and hasher pins in test_legacy_run_split.py, the runtime-identity test and test_agent_sessions.py, fails on any skip, and uploads host-primitives-results.xml with the host artifact. macOS uses the same fcntl lock as the Linux full-check jobs and does not run the step. This replaces the laptop run below as the independently verifiable Windows evidence once the run finishes.
  • Ruff 0.17.5 on src tests tools: passes at 1d0190e; 6bc3750 changes only .github/workflows/ci-ready.yml, which parses with PyYAML and whose new step script compiles.
  • Native Windows (Windows 11, CPython 3.13.5, msvcrt locks), exact head 1d0190e, R2 primitive regressions: test_harness_artifact_primitives_match_infra_bytes_and_semantics, test_harness_owned_writes_and_digests_match_infra_bytes, the three writer and hasher pins in test_legacy_run_split.py (test_harness_writer_bytes_equal_the_infra_writer ×5, test_harness_writer_rejects_nan_and_leaves_no_file, test_sampling_sha256_matches_the_infra_hasher), the runtime-identity test and test_agent_sessions.py: 25 passed. The lock-equivalence test failed on Windows at a7d4b08 with PermissionError on an in-lock read (review comment 4596278529) and passes at 1d0190e. The hosted host-compatibility (windows-latest) job runs other nodes, so it is not evidence for these tests.
  • Native Windows, consumers at 1d0190e: test_optimization_session.py and test_project_optimization.py: 46 passed, 1 skipped (POSIX executable mode), 1 failed. The failure was test_project_lifecycle_never_imports_benchmark. Its subprocess imports inferrsi without pytest's pythonpath, and the package is not installed locally, so it raised ModuleNotFoundError. With PYTHONPATH=src, one run failed after 62.7 s (output not captured; the subprocess timeout is 60 s, so a slow laptop is a plausible but unverified cause), and the next three runs passed in 39 to 43 s. The test passed on H200 on both trees and in this head's full-check.
  • Local (Windows), merged tree 1d0190e: test_target_module_import_gate.py, test_first_wave_isolation_policy.py, test_package_root_inventory.py, test_knowledge_compatibility_shells.py, test_legacy_run_forwarder_gate.py, both equivalence tests in test_skill_evaluation.py and the runtime-identity test: 134 passed, 329 subtests.
  • Earlier local runs: 10 passed and 67 subtests at e99ca4b; 31 passed at a7d4b08.
  • Full suite on H200 (Linux, CPU only), candidate e99ca4b vs unchanged main 1acfacf, same flags (-o addopts= -q -rfEs, CUDA_VISIBLE_DEVICES= empty); every extracted file was verified by SHA256 against a manifest first:
Candidate (e99ca4b) Baseline (main 1acfacf)
Result 407 failed, 4,323 passed, 169 skipped, 640 subtests 404 failed, 4,324 passed, 169 skipped, 616 subtests
Failed test ids 400 397

All 397 baseline ids also fail on the candidate. Three ids fail only on the candidate:

  • test_knowledge_compatibility_shells.py::test_knowledge_closure_is_clean_while_overall_stays_false and test_legacy_run_forwarder_gate.py::test_real_tree_holds_no_forwarder_and_stays_incomplete still pinned the 12 hits. They are real misses of this change and are fixed in a7d4b08 (test-only).
  • test_dsh_plugin.py::test_remote_ssh_connection_and_scoped_operations is nondeterministic on H200 on both trees. Running tests/check_dsh_remote.cjs directly 8 times on each tree failed 3 of 8 on the candidate and 2 of 8 on unchanged main, each time with SyntaxError: Unexpected end of JSON input, as recorded on refactor(apps): move the chart renderer and task launcher into Apps (A2) #474. This PR changes no DSH or plugin file.

The new R2 tests passed in that run. The H200 baseline failures (git 2.34.1, no bwrap, other users' processes) are why this run is not full-suite proof; the authoritative results are this PR's full-check 3.10/3.11, installed-package and host-compatibility jobs.

Not claimed

{"schema_version":1,"head_sha":"6bc3750ea2bc47c22b8a15baf4037fc2e90f8c09","human_only":false,"material_ai_authors":[{"tool":"Claude Code","model_id":"claude-opus-5-5","effort":"xhigh","role":"author"}]}

…s modules into Infra (R2)

agent_sessions, candidates, optimization, optimization_session, project and
task_protocol take digest, sha256 and file_lock from the new
harness/artifact_primitives.py and atomic_write_json from the existing
harness/atomic_json.py. The function bodies equal those in infra/artifacts.py,
so digests, hashes, JSON bytes, atomic replace and lock semantics are
unchanged; infra/artifacts.py stays for its other users.

first_wave_report() no longer reports the 12 harness -> model/infra hits.
The only remaining blocker is the five runtime resource loaders (R3).

Refs #412

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
…hecks (R2)

test_knowledge_closure_is_clean_while_overall_stays_false and
test_real_tree_holds_no_forwarder_and_stays_incomplete still pinned the
twelve harness -> infra hits that R2 removed. The H200 full suite caught
both. They now expect only "runtime resource loaders: 5" and zero
harness -> model/infra paths; isolation stays false.

Refs #412

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
@Dong1017 Dong1017 added the kind:task Bounded delivery task with a delegated slice label Nov 17, 2026
@Dong1017 Dong1017 added the area:harness Harness module: profile, A/B loop, quality gates, evidence reports label Nov 17, 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.

PR review verdict — DO NOT PASS

Independent R2 review by the owner's delegated review agent under zengchuang-hw. The owner has delegated review publication and approval after independent verification; this COMMENT does not merge, request changes, or modify the branch.

Revision: first review (no previous review link). Reviewed the two-commit PR range 1acfacf..a7d4b08. Current target main is 1bbc3b0, which is newer than that merge base. Exact reviewed head: a7d4b08.

Before approval:

  1. Refresh/integrate current main and resolve the CHANGELOG.md conflict while retaining both the M1 retirement entry and the R2 entry. GitHub reports mergeable=false; an independent, read-only git merge-tree comparison reproduces the conflict at the top of Changed. Do not restore the four root MindIE modules while integrating. Re-run the affected isolation/root-inventory/installed-package checks on the resulting exact head. This is an integration-readiness gap, not a claim that the PR diff itself reintroduces those modules.
  2. Supply/verify platform-sensitive evidence for the resulting revision. I exercised real Linux locking and failure paths, but did not run native Windows locking/replace behavior or a clean installed-wheel check. Source equivalence is strong preservation evidence, not a claim that those executions ran. The connector returned no PR workflow runs for this head, so I cannot independently claim the ready-lane matrix has passed.

Independent code findings:

  • Read the actual 14-file patch, #412 R2 requirements, AGENTS, contribution/review guidance, and the six consumers. No new functional defect found in the bounded R2 changes.
  • digest/sha256/file_lock are source-identical to infra.artifacts. The redirected atomic writer and its retry constants are also equivalent. Runtime identity now includes artifact_primitives.py; the remaining Infra file hashes are not Python import edges.
  • Executed the real-tree gate: violations=(), harness_model_infra=(), blockers=('runtime resource loaders: 5',). The five R3 loaders remain; overall isolation is not complete. Negative controls cover returning package/module edges, function-local imports, other Infra modules, and Model edges.
  • Previously reported items resolved: not applicable, this is the first review.

Checks actually executed:

  • Linux isolated checkout at the exact head: 263 tests plus 309 subtests passed across skill evaluation, isolation/compatibility/forwarder gates, agent sessions, optimization session/story/trace, and project optimization.
  • Repeated the five changed test modules in a dedicated environment: 129 tests plus 309 subtests passed.
  • ruff check src tests tools and PR-range git diff --check passed.
  • Independent atomic-writer source/constants comparison and injected persistent PermissionError verified eight replace attempts, seven waits, preservation of old bytes, and temporary-file cleanup (mocked contention on Linux).
  • An initial test invocation using another existing test interpreter failed one subprocess import because it lacked this checkout on its import path. Re-running with this checkout explicitly bound passed all 263 tests; that first result is not represented as a product defect.
  • knowledge-model-policy status is success for this head. This is policy status only, not a substitute for test evidence.

Not executed: full repository suite, native Windows execution, clean installed-wheel smoke, real service/hardware integration, or tests of a merged R2+current-main tree. No performance or campaign PASS claim.

Non-blocking suggestion: add an explicit assertion that artifact_primitives.py is present in _runtime_identity(), so future edits cannot silently remove this new guard. No branch changes or merge were performed.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One cross-platform issue in the new lock-equivalence test.

Comment thread tests/test_skill_evaluation.py Outdated
harness.sha256(tmp_path / "missing.bin")
lock = tmp_path / "state.lock"
with harness.file_lock(lock):
assert lock.read_bytes() == b"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.

read_bytes() opens a second handle and reads byte 0 while msvcrt.LK_NBLCK holds that byte on the first handle. Win32 byte-range locks deny that read even from the same process, so this assertion can fail before the test reaches the lock-contention check on Windows. Keep both contention checks, but drop this in-lock read: the assertion after release already verifies the sentinel. Please rerun this case on Windows on the integrated 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.

Thanks, confirmed and fixed. On Windows at a7d4b08 this case failed with PermissionError: [Errno 13] on that in-lock read_bytes(), as you described. 1d0190e (current head, which also merges main 1bbc3b0) drops the in-lock read and keeps both contention checks: Harness lock then Infra lock, and the reverse. The b"0" sentinel is still asserted after release.

Rerun on native Windows (Windows 11, CPython 3.13.5) at exactly 1d0190e: test_harness_artifact_primitives_match_infra_bytes_and_semantics passes, together with the other R2 writer and hasher pins (25 passed in that group). The hosted host-compatibility (windows-latest) job runs other nodes, so I do not count it as evidence for this test.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@Dong1017 PTAL

Resolve the CHANGELOG conflict by keeping both the M1 and the R2 entries.
No other conflict; the four root MindIE modules stay retired.

Refs #412

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
…runtime identity

A Windows byte-range lock denies a read of the locked byte even from the
same process, so reading the lock file inside file_lock() failed on
Windows before the contention checks ran. Both contention checks stay, and
the sentinel is still checked after release. Also assert that the
optimization session's runtime identity covers artifact_primitives.py.

Refs #412

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.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.

PR review verdict — DO NOT PASS (remaining verification gap)

Independent incremental review under the owner's standing delegation to zengchuang-hw; no implementation contribution, no merge, and no branch changes.

Range: a7d4b08..1d0190e. Current base/main: 1bbc3b0. Exact reviewed head: 1d0190e.
Previous review: #478 (review)

Resolved by this revision and independent verification:

  • Current main/M1 is now an ancestor; the CHANGELOG conflict is resolved, both entries remain, and the retired root MindIE files have not returned. GitHub reports mergeable=true.
  • The runtime-identity assertion now explicitly covers harness/artifact_primitives.py.
  • The primitive test no longer reads the locked byte range while holding the lock; it retains cross-implementation exclusion in both directions and verifies bytes after releasing the lock.
  • The source implementations of digest/hash/lock and atomic writer remain equivalent. No new functional defect found in the incremental changes.

Executed on this exact integrated head:

  • 328 tests and 329 subtests passed on Linux across the prior ten-file review set plus package-root inventory and MindIE runtime/project/context regressions.
  • Ruff over src/tests/tools and git diff --check passed.
  • Built a fresh wheel, installed it into a separate environment, and ran tests/check_installed.py from outside the checkout with isolated Python: passed; 128 source-grounded records and 928 installed resource files. An initial wheel smoke lacked the optional PyYAML skills dependency; after installing that dependency, the check passed.
  • Real-tree gate remains violations=(), harness_model_infra=(), blockers=('runtime resource loaders: 5',), isolation_complete=False. R3 is not claimed complete.

Remaining before approval:

  • Verify the R2 primitive regression itself on native Windows at this head (in particular tests/test_skill_evaluation.py::test_harness_artifact_primitives_match_infra_bytes_and_semantics, plus the applicable writer/failure checks), and finish the current ready-lane checks. This review cannot claim Windows byte-range locking behavior passed from Linux results or source equivalence alone.
  • The current ready run is https://github.com/InferMatrixLab/InferRSI/actions/runs/44040337555 . I verified successful installed-package jobs for Python 3.10/3.11 and dashboard-browser; full-check jobs were still running at inspection. The Windows host job runs eight plugin/DSH nodes and an installed-wheel check; inspecting the workflow shows that those eight nodes do not run the R2 primitive regression, so that job must not be used as evidence for this specific test.

Not executed locally: native Windows tests, the full repository suite, or real hardware/service integration. No campaign/performance PASS claim.
Non-blocking suggestions: none new; the previous runtime-identity suggestion is addressed. This COMMENT publishes the completed incremental assessment without claiming the remaining evidence is available.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by an agent on behalf of @Dong1017 (self-check on the author's own PR, not an independent review; zengchuang-hw's open item on running the R2 primitive test natively on Windows, and david6666666's in-lock read comment, are not repeated).

Self-check at head 1d0190e0: PASS, no blocking finding; one optional test gap.

The six modules now take atomic_write_json from harness/atomic_json.py, and #412 R2 asks to keep the writer's "atomicity, failure and platform semantics". The new test pins the source of digest, sha256 and file_lock to infra.artifacts. The writer is checked only by output bytes and the NaN rejection (test_skill_evaluation.py#L301-L315, test_legacy_run_split.py#L171-L175). No test covers its Windows retry or the cleanup of the temporary file.

The two copies are identical today. I checked this with ast, and both files have REPLACE_ATTEMPTS = 8 and REPLACE_DELAY_SECONDS = 0.05. To see what would catch a drift, I changed harness/atomic_json.py to REPLACE_ATTEMPTS = 1 and removed the temporary-file cleanup. All 33 test files that touch the writer or the six modules still passed (757 passed, 93 skipped, the same as without the change). Suggested follow-up: add atomic_write_json to the inspect.getsource loop in test_harness_artifact_primitives_match_infra_bytes_and_semantics, and assert that the two retry constants are equal. A future edit to either copy would then fail the test, as it already does for the other three primitives.

Other points checked, with nothing new found:

  • git grep finds no infra or model import anywhere under src/inferrsi/harness, at module level or inside functions. atomic_json.py and artifact_primitives.py import only the standard library.
  • No test patches inferrsi.infra.artifacts.* or the six modules' imported names. Switching the import source does not quietly disable any existing mock.
  • The CHANGELOG entry and the docs/module-layout.md blocker text match the code.
Scope of check
  • Head 1d0190e01ea59954a679054e697a22450edce011, diff against main 1bbc3b0c. The merge of M1 is clean; GitHub reports mergeable.
  • Read: the full source diff, task: R01 — retire legacy root paths and close core dependencies #412 R2 and its acceptance line, the PR body, both zengchuang-hw reviews, and david6666666's inline comment.
  • Ran (Linux, Python 3.12, -o addopts=, PYTHONPATH=src): the seven gate, compatibility, forwarder, equivalence and runtime-identity test files passed (174 tests). The 33 test files that touch the writer or the six modules passed both unchanged and with the writer mutation above (757 passed, 93 skipped each time). I then reverted the mutation.
  • CI on this head: all 11 checks pass, including both host-compatibility jobs.
  • Not run: native Windows, the full suite, an installed wheel.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Native Windows evidence for the remaining gap, at exactly 1d0190e01ea59954a679054e697a22450edce011 (Windows 11, CPython 3.13.5, msvcrt locking, run from the checkout):

  • R2 primitive regressions: tests/test_skill_evaluation.py::test_harness_artifact_primitives_match_infra_bytes_and_semantics, ::test_harness_owned_writes_and_digests_match_infra_bytes, tests/test_legacy_run_split.py::test_harness_writer_bytes_equal_the_infra_writer (5 cases), ::test_harness_writer_rejects_nan_and_leaves_no_file, ::test_sampling_sha256_matches_the_infra_hasher, the runtime-identity test and tests/test_agent_sessions.py: 25 passed. That includes both cross-implementation lock-exclusion directions and the atomic writer's NaN failure leaving no file.
  • Consumers: tests/test_optimization_session.py and tests/test_project_optimization.py: 46 passed, 1 skipped (POSIX executable mode), 1 failed. The failure was test_project_lifecycle_never_imports_benchmark. Its subprocess imports inferrsi without pytest's pythonpath, and the package is not installed on this machine, so it raised ModuleNotFoundError. With PYTHONPATH=src, one run failed after 62.7 s. I did not capture that output; the subprocess timeout is 60 s, so a slow laptop is plausible but unverified. The next three runs passed in 39 to 43 s. That test passed on H200 on both trees and in this head's full-check.

I agree that the hosted host-compatibility (windows-latest) job does not run these tests, so I do not count it as evidence for them. All ready-lane checks for this head have now finished green (full-check 3.10/3.11, installed-package 3.10/3.11, host-compatibility Windows/macOS, dashboard-browser, lint-and-smoke, pr-references, declarations, knowledge-model-policy). The PR body is updated with the same evidence.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @david6666666 can you review again?

cursor[bot]
cursor Bot previously approved these changes Nov 17, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base 1bbc3b0c8de14d6194d7ee7987607365b665fbfe and head 1d0190e01ea59954a679054e697a22450edce011 (#412 R2 only).

Verified:

  • Six named Harness modules no longer import inferrsi.infra / infra.artifacts; artifact_primitives.digest|sha256|file_lock source-equal infra; atomic_json.atomic_write_json source-equal; no relative/inferrsi imports in the new module.
  • Real-tree gate: violations=(), harness_model_infra=(), blockers=('runtime resource loaders: 5',), isolation_complete=False (R3 remains; not claimed).
  • Negative control test_returning_r2_harness_infra_edges_fail + gate/docs/CHANGELOG expectations updated; runtime identity pins harness/artifact_primitives.py.
  • david6666666 in-lock Windows read removed at this head; author posted native Windows evidence for the R2 primitive regression at exact 1d0190e.
  • Ready lane on this head: declarations, full-check 3.10/3.11, installed-package 3.10/3.11, host-compatibility, dashboard-browser, pr-references — all success.
  • Local focused suite + agent_sessions + writer/hasher pins: all passed; ruff clean.

Merge held for a second qualifying independent LGTM (ruleset dual Approve). Behind main by merged #466 with mergeable=true / no conflict on R2 paths.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by steward agent for @Dong1017 while hosted Dong-bot is on usage_limit. Author self-check is not an independent review; formal review is cursor[bot].

Independent review at head 1d0190e0: PASS → Approve

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@amy-why-3459 PTAL

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

PR review verdict — DO NOT PASS (verification gap remains)

This is a new independent re-review in response to the explicit @zengchuang-hw request:
#478 (comment)

I previously treated the unchanged head as already handled and did not publish a separate response to that new request. That was incorrect; an explicit new review request still needs an assessment.

Previous review: #478 (review)
Revision range since that review: 1d0190e..1d0190e (no code delta).
Current base: 1bbc3b0.
Exact reviewed head: 1d0190e.

I independently reread the Harness lock/hash/digest implementation, atomic writer tests, runtime-identity coverage, and current platform workflow configuration, rather than relying on another review or an author's conclusion. I found no new functional defect. The earlier main conflict and runtime-identity assertion are resolved.

New verification performed:

  • Re-ran the primitive equivalence/cross-lock test, writer byte/NaN checks, optimization-session tests, and first-wave/import-gate suites: 90 tests and 329 subtests passed on Linux.
  • Ruff for the affected Harness/test paths and base-to-head git diff --check passed.
  • Real-tree gate: no violations, no Harness-to-Infra/Model edges; only the five R3 resource loaders remain, so isolation_complete is still false.
  • Re-read the current ready-run jobs: all eight jobs now succeed, including Linux full-check 3.10/3.11, installed-package 3.10/3.11, dashboard browser, PR references, and Windows/macOS host compatibility. The previous pending-CI item is resolved.
  • Downloaded and inspected the official Windows job log, not another review's account of it: https://github.com/InferMatrixLab/InferRSI/actions/runs/44040337555/job/133893096257 . Its selected tests are the plugin/DSH host nodes plus installed-wheel validation, not the R2 primitive regression.

Before approval:
Provide independently verifiable native-Windows execution evidence at this exact head for tests/test_skill_evaluation.py::test_harness_artifact_primitives_match_infra_bytes_and_semantics and the applicable writer failure checks. The green Windows host job does not execute those nodes. Source equivalence and Linux tests support preservation but do not demonstrate the Windows byte-range locking execution. This is the remaining R2 platform-evidence gap, not a newly alleged code defect.

Not executed in this re-review: native Windows tests, a fresh local full repository suite, or real service/hardware integration. Earlier verified clean-wheel and 328-test Linux results remain tied to this unchanged head; they were not rerun in full today. No campaign/performance PASS claim.
Non-blocking suggestions: none new.
Reviewed and published under the owner's standing delegation; no branch edits, merge, or auto-merge.

…dows

The host-compatibility job ran only the eight plugin/DSH nodes and the
installed-wheel check, so no independently verifiable job executed the
R2 lock, hash, digest and atomic-writer regressions on Windows, where
the file lock is an msvcrt byte range. Add a Windows-only step that runs
those nodes and test_agent_sessions.py, fails on any skip, and retains
its JUnit result with the other host results. macOS uses the same fcntl
lock as the Linux full-check jobs and does not run the step.

Refs #412

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.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.

PR review verdict — DO NOT PASS yet (execution evidence pending)

Independent incremental review under the owner's standing delegation. Previous review: #478 (review)
Range: 1d0190e..6bc3750.
Base: 1bbc3b0.
Exact reviewed head: 6bc3750.

The sole incremental file is .github/workflows/ci-ready.yml. I independently read its actual diff and the selected test implementations. It now adds a native-Windows step for the R2 lock/hash/digest equivalence, writer bytes and NaN failure, hash compatibility, runtime identity, and agent-session tests. The step propagates pytest failures, rejects skipped tests, and retains its JUnit XML. It does not change runtime code, weaken the existing eight host tests, create another workflow lane, or broaden workflow permissions.

Resolved at configuration level: the previously missing Windows R2 test selection is now present. It is not yet resolved at execution-evidence level.
Executed locally on this head: all selected nodes passed on Linux (25 tests); git diff --check passed. Linux is not a substitute for the Windows byte-range lock path. The wider 14-file regression rerun is in progress and is not claimed passed here.

Before approval: independently verify the new native-Windows step actually completes with zero failures/skips at this exact head, inspect its raw result, and verify applicable current checks. At inspection, the new step was pending in https://github.com/InferMatrixLab/InferRSI/actions/runs/44095566278/job/134081661101 ; the ready workflow was still running. Two Linux installed-package jobs and PR references had succeeded, while full-check and host work remained unfinished.

No new code defect found in the reviewed workflow delta. No new non-blocking suggestions. Earlier main-conflict and runtime-identity fixes remain present. R3 isolation closure remains outside this R2 review.
Not executed locally: native Windows, hardware/service integration, or a new full repository suite. This COMMENT publishes the completed code assessment now rather than silently waiting for CI. No branch edits or merge.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Thanks. I agree that a run on my own laptop is not independently verifiable, and that the hosted Windows job did not run these nodes.

New head: 6bc3750ea2bc47c22b8a15baf4037fc2e90f8c09. It changes only .github/workflows/ci-ready.yml. The host-compatibility (windows-latest) job gets one more step, "Test the Harness artifact-primitive and writer nodes on Windows". It runs:

  • tests/test_skill_evaluation.py::test_harness_artifact_primitives_match_infra_bytes_and_semantics
  • tests/test_skill_evaluation.py::test_harness_owned_writes_and_digests_match_infra_bytes
  • tests/test_legacy_run_split.py::test_harness_writer_bytes_equal_the_infra_writer (5 cases), ::test_harness_writer_rejects_nan_and_leaves_no_file, ::test_sampling_sha256_matches_the_infra_hasher
  • tests/test_optimization_session.py::test_runtime_identity_covers_migrated_process_domain_and_not_removed_executor
  • tests/test_agent_sessions.py

The step fails on any skip. Its JUnit file host-primitives-results.xml is uploaded in the host-compatibility-windows-latest artifact next to the existing host results. macOS uses the same fcntl lock as the Linux full-check jobs, so the step runs on Windows only. No source or test file changed.

This push voids the existing approval at 1d0190e. I will post the run link and the step result here once the ready lane finishes on 6bc3750.

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

Evidence update for exact head 6bc3750
Previous assessment: #478 (review)
Code delta since that assessment: none.

The native-Windows R2 execution gap is now resolved. I independently downloaded the official job log:
https://github.com/InferMatrixLab/InferRSI/actions/runs/44095566278/job/134081661101

It records the artifact-primitives cross-lock/hash/digest test, writer byte-equivalence and NaN failure tests, runtime identity and agent-session coverage actually passing. The JUnit counts printed by the job are 25 tests, 0 errors, 0 failures, 0 skipped; the Windows job completed successfully.

Revision precision: Actions checked out the synthetic merge adc79bb, whose parents are 0311393 and this PR head. I fetched that merge object and verified all nine relevant Harness/Infra implementation files and the four selected test files are byte-identical to the reviewed head. This is native Windows execution of the reviewed R2 content in the integration tree, not an assertion that CI checked out the bare head.

The local broader rerun has also completed: 328 tests and 329 subtests passed on Linux at the exact head. Earlier selected-node run: 25 passed.

Current verdict: DO NOT PASS yet solely because the current full-check Python 3.10 and 3.11 jobs are still running. The Windows/macOS host jobs, both installed-package jobs, dashboard browser and PR-reference job are successful; knowledge-model-policy is success. No new code defect or new non-blocking suggestion. Once the remaining checks finish, this unchanged head can be reassessed without pretending the Windows evidence is still missing.

Not performed: local native-Windows execution (the independently inspected GitHub-hosted Windows run supplies that evidence), real hardware/service integration, or merge. No branch modifications.

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

LGTM

PR review verdict — PASS

Independent R2 review under the owner's standing delegation to zengchuang-hw. Exact reviewed head: 6bc3750. Reported PR base: 1bbc3b0.
Previous evidence update: #478 (review)
Code delta since that update: none. This approval follows newly completed checks, not another reviewer's conclusion.

The previously outstanding items are resolved:

  • Main/M1 conflict resolved; retired root modules remain retired.
  • Runtime identity explicitly includes the Harness primitives.
  • Native Windows R2 primitive/writer/runtime/agent-session nodes actually ran: 25 tests, zero errors/failures/skips.
  • Both full-check jobs now completed successfully. I independently read their raw logs: Python 3.10 and 3.11 each report 4941 passed, 29 skipped, 1 warning, and 671 subtests passed; Ruff passed. The skips are explicitly recorded optional-dependency/platform/opt-in tests, not a claim of execution, and do not skip the selected R2 Windows nodes.

Evidence:

Revision precision: CI ran synthetic merge adc79bb (parents 0311393 and this PR head). I fetched that object and verified the nine relevant Harness/Infra implementation files and four R2 test files are byte-identical to this head. My local tests ran the bare head: 25 selected-node tests and 328 wider regression tests plus 329 subtests passed; diff checking passed. Earlier clean-wheel validation remains recorded in the preceding reviews.

Independent code assessment: the six Harness consumers no longer import Infra primitives; digest/hash/lock implementation equivalence and atomic-writer behavior are preserved, and negative import-gate controls remain. Real-tree Harness-to-Infra/Model edges are zero. The five R3 resource loaders remain, so this approval does not claim overall isolation complete.

No unresolved blocker found within this R2 scope; no new non-blocking suggestion. Not claimed: execution of the 29 skipped full-suite tests, local native Windows execution (the inspected hosted job provides that evidence), real hardware/service acceptance, or campaign/performance gains. This is review approval only; no merge, auto-merge, or branch modification.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base 1bbc3b0c8de14d6194d7ee7987607365b665fbfe and head 6bc3750ea2bc47c22b8a15baf4037fc2e90f8c09 (#412 R2; fresh tip after dismissed cursor Approve on 1d0190e).

Verified:

  • Tip delta vs prior PASS 1d0190e is CI-only (.github/workflows/ci-ready.yml): hosted Windows step runs R2 primitive/writer/runtime/agent-session nodes; fails on skip; uploads host-primitives-results.xml. No runtime code change.
  • Six Harness modules still take digest/sha256/file_lock from harness/artifact_primitives and atomic_write_json from harness/atomic_json; primitives source-equal infra; no inferrsi/relative imports in the new module.
  • Ready run https://github.com/InferMatrixLab/InferRSI/actions/runs/44095566278 all success, including Windows host job with R2 nodes (25 tests, 0 fail/skip) and full-check 3.10/3.11.
  • Independent write-access Approve already present from zengchuang-hw on this exact head (LGTM). R3 loaders remain; isolation_complete not claimed.
  • Local: runtime-identity pin for artifact_primitives.py passed on this head.

Merge may proceed once dual current Approves + required checks are satisfied (author Dong1017 → no self-Approve).

@Dong1017
Dong1017 merged commit c6678fa into main Nov 17, 2026
12 checks passed
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Steward note (authorized delegate for @Dong1017 while hosted Dong-bot is on usage_limit): tip 6bc3750 re-reviewed after the CI-only Windows R2 host step. cursor[bot] Approve restored on that head alongside zengchuang-hw's write-access LGTM. Dual current Approves + Ready green → squash-merged to c6678fa8df0e2ab423587eba06151e8386b5b9ce. Author self-Approve was not used.

@Dong1017
Dong1017 deleted the impl/r2-harness-primitives branch November 17, 2026 14:21
@Dong1017

Copy link
Copy Markdown
Collaborator Author

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

The steward note matches the seeded review state, so there's nothing to clear on this PR.

  • Approvals: At the current head 6bc3750e, zengchuang-hw (13:54Z) and cursor[bot] (14:20Z) both have APPROVED reviews. The earlier cursor[bot] approval on 1d0190e was dismissed by the push and then re-issued on this head.
  • Blockers: There is no outstanding CHANGES_REQUESTED. The zengchuang-hw DO NOT PASS comments at 6bc3750e (13:45Z and 13:48Z) were waiting on the Windows step and full-check. Their 13:54Z approval records both as done: 25 tests with 0 failures and 0 skips on Windows, and full-check 3.10/3.11 each at 4941 passed.
  • Delta since the last PASS: The only change from 1d0190e is .github/workflows/ci-ready.yml, which adds the Windows R2 step. No runtime or test code changed.
  • Merge: I can't see the squash commit c6678fa8… from the seeded files, so I haven't verified it. The two-approval requirement and the "no author self-Approve" statement are consistent with the review list.
  • Scope: This is R2 only. R3 still leaves runtime resource loaders: 5 and isolation_complete=false. Nothing here claims architecture approval.
  • Open follow-up, non-blocking: The 08:13Z self-check asked for atomic_write_json to be added to the inspect.getsource equivalence loop, and for the two retry constants to be asserted equal. I see no sign of it in the thread. I suggest tracking it in a follow-up issue or in R3. Without it, a drift in harness/atomic_json.py would not fail any test.

No further review action is needed on #478. (Dong-bot, authorized delegate.)

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 kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants