Skip to content

Use the Harness digest in the interrupted recovery test - #556

Merged
Dong1017 merged 1 commit into
mainfrom
fix/555-project-explanation-digest
Nov 21, 2026
Merged

Dong1017 merged 1 commit into
mainfrom
fix/555-project-explanation-digest

Conversation

@zengchuang-hw

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

Copy link
Copy Markdown
Contributor

Governing Issue and delivery slice

Refs #555. The release PR #541 exposed an integration failure when GitHub tested against main after #457. The recovery test imported a helper from the inferrsi.infra package retired in #535.

Change and verification

Import the existing Harness digest at test collection time. The interrupted callback, recovery path and assertions are preserved. This change touches only tests/test_project_explanation.py.

  • Reproduced on unmodified main at 9466bc8d: the recovery test failed with DID NOT RAISE KeyboardInterrupt.
  • Ran the same test after this import change: 1 passed. The complete project-explanation test file also passed (33 passed). Ruff and git diff --check passed.
  • Downstream Linux run for the original failure.

Once this lands, #541 can validate against the corrected main.

Resolve the helper during test collection so import failures are visible outside the simulated interruption.

Agent-assisted-by: Codex (integration test correction)
Signed-off-by: Zeng Chuang <zengchuang1005@gmail.com>

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base 9466bc8 and head b2bf3dc (full diff, one file, +1/-1).

Verified:

  • tests/test_project_explanation.py now imports digest from inferrsi.harness.artifact_primitives at module level (line 12). It drops the function-local from inferrsi.infra.artifacts import digest inside forge_then_crash.
  • src/inferrsi/harness/artifact_primitives.py at this head defines digest as sha256 over json.dumps(sort_keys=True, separators=(",", ":"), ensure_ascii=False, allow_nan=False). Its header says the body is byte-identical to the apps copy and is kept equal by tests/test_artifact_helper_copies.py. The forged mechanism_sha256 in the recovery test therefore uses the same digest the Harness computes, which is what the test's purpose depends on.
  • src/inferrsi/infra/artifacts.py is not present at this head, so the removed import was a stale path. The new import points at an existing module.
  • The test body is unchanged, so its assertions still cover recovery: mechanism_unverified_after_recovery, not_declared, eligible is False, and a baseline best.
  • I saw no other local digest name in the first 120 lines of the test file or in lines 470–520, so I found no shadowing. I did not read the rest of the file.

No formal reviews are seeded on this head and there is no outstanding CHANGES_REQUESTED, so this is the first review.

Not verified here: I did not run the test suite or CI. I did not read tests/test_artifact_helper_copies.py. I did not confirm that the Harness's own recovery code path uses the same digest.

This Approve is one vote. The merge ruleset still requires two qualifying approvals.


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

@Dong1017 Dong1017 added kind:task Bounded delivery task with a delegated slice area:harness Harness module: profile, A/B loop, quality gates, evidence reports labels Nov 21, 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 9466bc8d910c9fef55d4a9e23ee1a82950280c30 and head b2bf3dcc6dac58ad0624e41e55347330d7c25a1b.

Technical / third-party verify only (cursor App collaborator permission none — not a write+ eligible Approver under docs/agent-collaboration.md; does not claim dual tip or merge-ready).

Verified:

  • Single-file change in tests/test_project_explanation.py: moves digest import from retired inferrsi.infra.artifacts to inferrsi.harness.artifact_primitives.digest at module scope.
  • Confirmed digest still exists on main in src/inferrsi/harness/artifact_primitives.py.
  • Matches the Ready failure on #541 (test_recovered_attempt_does_not_trust_a_rewritable_declaration / DID NOT RAISE KeyboardInterrupt from the failed lazy import).
  • Dong1017 always-on tip Approve present; lint/declarations/pr-references green (full-check still pending at review time).

Refs #555.

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

LGTM

PR review verdict — PASS
Reviewed base 9466bc8 and head b2bf3dc (full diff, one file, +1/−1).

Verified:

  • tests/test_project_explanation.py now imports digest from inferrsi.harness.artifact_primitives at module level and drops the function-local from inferrsi.infra.artifacts import digest inside forge_then_crash.
  • At this head, artifact_primitives.digest is sha256 over canonical JSON (sort_keys=True, compact separators, ensure_ascii=False, allow_nan=False). The module header says the body is kept equal to the apps copy by tests/test_artifact_helper_copies.py, so the forged mechanism_sha256 uses the same digest the Harness would compute.
  • The test body is otherwise unchanged: it still raises KeyboardInterrupt after forging, then asserts mechanism_unverified_after_recovery, not_declared, eligible is False, and a baseline best.
  • Other inferrsi.infra.artifacts hits on this tree are historical or synthetic (changelog, isolation-policy counterexamples, retired-path checks in tests/check_installed.py), not live test imports.

Accuracy/performance comparison evidence is not applicable (test-only import fix). Architecture and necessity: the change reuses the current Harness helper and is limited to the broken import; no extra test cases are needed.

On this head, pr-references, installed-package (3.10/3.11), dashboard-browser, and host-compatibility were green when I checked; knowledge declaration policy is green; full-check (3.10/3.11) in https://github.com/InferMatrixLab/InferRSI/actions/runs/44895392483 was still running. I did not rerun the test locally. @Dong1017 already approved this head; this is a second independent vote. No outstanding CHANGES_REQUESTED.

@Inference1

Copy link
Copy Markdown
Contributor

PR #553 is waiting on this fix as well. Its Python 3.10 and 3.11 Ready jobs hit the same ModuleNotFoundError before the recovery test could raise its intended KeyboardInterrupt.

I applied this PR’s patch locally to 9a4b5871 and ran the project-explanation and benchmark suites on Python 3.10.22 and 3.11.18. All 106 tests passed on each version, and Ruff passed.

@Dong1017, could you merge #556 once you’ve confirmed the approvals and checks? I’ll run #553’s Ready checks against the updated main.

@Dong1017

Copy link
Copy Markdown
Collaborator

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

I can't merge from this queue because Dong-bot only has review and comment tools here. The approvals on #556 are in place, so the merge is ready for a human with merge rights once full-check is green.

Approvals on head b2bf3dcc: Dong1017, amy-why-3459 and cursor[bot] each approved this exact head. No CHANGES_REQUESTED is outstanding. cursor[bot] is a non-eligible third-party verifier, so the two qualifying approvals are Dong1017 and amy-why-3459.

Diff, re-read against base 9466bc8d: the change is +1/−1 in tests/test_project_explanation.py.

Checks:

  • Your local run of this patch on 3.10.22 and 3.11.18 passed all 106 tests, and Ruff passed.
  • amy-why-3459 reported pr-references, installed-package (3.10/3.11), dashboard-browser and host-compatibility green when she looked.
  • full-check (3.10/3.11) was still pending at the last review. I can't see its current state, so confirm it is green before merging.

I did not run the tests myself. The verdict above comes from the diff and the seeded reviews.

Next step: once full-check is green, merge #556 and re-run #553's Ready checks against the updated main. The same applies to #541.

Dong-bot (authorized delegate).

@Inference1

Copy link
Copy Markdown
Contributor

Both full-check jobs for b2bf3dcc have finished successfully, and GitHub reports APPROVED and CLEAN. Python 3.10 · Python 3.11

@jiangkuaixue123, could you merge this fix? Dong-bot confirmed that its queue can review and comment. Once the fix lands, I can start a fresh Ready run for #553 against the corrected main.

@Dong1017
Dong1017 merged commit 10ba7a5 into main Nov 21, 2026
12 checks passed
@Dong1017
Dong1017 deleted the fix/555-project-explanation-digest branch November 21, 2026 11:35
Inference1 added a commit to Inference1/InferRSI that referenced this pull request Nov 21, 2026
Bring in InferMatrixLab#556, which restores the recovery test to the Harness digest.
The five-file Windows session lock patch is identical to the reviewed change.

Agent-assisted-by: Codex (author)
Signed-off-by: Inference1 <3617237115@qq.com>
Dong1017 added a commit that referenced this pull request Nov 21, 2026
#556 fixed the same stale import in tests/test_project_explanation.py with a
module-level import from harness.artifact_primitives. The merge keeps main's file, so
this branch no longer changes that test and its diff is the docs and docstrings only.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
Dong1017 added a commit that referenced this pull request Nov 21, 2026
The base branch merged main, which carries #556; this merge keeps main's tests/test_project_explanation.py, so the rename branch no longer changes that test.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)

Signed-off-by: GUOGUO <xwdong1998@163.com>
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.

4 participants