Skip to content

fix(artifacts): preserve iNES shutdown ownership and I/O failures - #11154

Closed
ShuaixinHuang wants to merge 22 commits into
morluto:mainfrom
ShuaixinHuang:fix/ines-retirement-replacement-main
Closed

ShuaixinHuang wants to merge 22 commits into
morluto:mainfrom
ShuaixinHuang:fix/ines-retirement-replacement-main

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Disposition

Superseded by 11739 at @ShuaixinHuang's request after CI repair and local qualification. The replacement preserves the original feature commits and links this review history.

Latest-main qualification

Normally merged main f916b3ecf5455ffc80e300d8cf7eea144d02d61c into this same PR as 3b3aa7ef822ef4ce218a09c99507c2c8e58e7967. Accepted upstream test-only commits 94bf2bdec, 5579890dd and f916b3ecf repair shared setup/lifecycle/isolation fixtures. In particular, the five failures recorded earlier on main bd9f2cca4 are now fixed upstream; they are not current blockers from that earlier baseline.

  • The six changed upstream suites (hermesClientSetup, ompClientSetup, piClientSetup, ciTestProjects, agentEvaluationCleanup, agentEvaluationCommands) were run with npm run test:focused: 75 passed, no skips, exit 0, on clean main f916b3ecf. A local-only Linux subreaper preserved assertions and exit status while reaping 14 adopted children.
  • This PR's source and regression inputs were byte-compared with its previously qualified head 8eb8678a7da0c9319175649071b2975b7b520cb3 and are unchanged by this test-only merge. The feature-suite results below apply to those exact preserved inputs.
  • git diff --check and normal pre-push npm run check:fast (typecheck, lint and architecture guards) passed on the published tree. Linux x64, Node 24.22.1 / npm 11.16.0.

Fresh-head hosted CI remains pending. No complete monolithic local check, combined integration of all open PRs, or additional native Windows/macOS qualification is claimed. Earlier results below retain their stated revisions. Existing human-readiness text and checkbox lines are preserved verbatim; this update does not attest to a new human review.


Problem and fix

Closing an iNES reader during a region read or final identity validation could release its extraction-owned descriptor before admitted work retired. Buffered streams and paused inventories could continue after closure; a shared descriptor-read race could replace a physical I/O failure with cancellation.

Use the existing resource scope to stop producers and join producer completion plus readable retirement. Admit final source validation independently, preserve borrowed-descriptor ownership and failed-close retry ownership, and retain a physical failed-read outcome until it is forwarded. The doctor fixture publishes readiness only after installing its SIGTERM handler.

Current validation — 2026-11-16

Resolved the reader conflict by retaining both the lifecycle implementation and main's layout-consistency integrity classification. Linux x64, Node 24.22.1 / npm 11.16.0:

  • npm run test:focused -- tests/boundary/filesystem/inesCancellation.test.ts tests/boundary/filesystem/fileHandleChunks.test.ts tests/boundary/cli/doctorCancellation.test.ts: 3 suites, 65 passed.
  • Scoped typed lint of the reader, descriptor helper and cancellation tests: 0 errors, 5 warnings.
  • npm run check:fast, final diff check and normal pre-push hooks passed. Published head: 8eb8678a7da0c9319175649071b2975b7b520cb3.

The original pre-fix reproduction (17 failed / 78 passed plus an uncaught cancellation error) is historical, not rerun during this conflict repair. The harmless JavaScript duplicate-import consolidation in the final diff is applied by normal repository hooks and changes no behavior. No timeout, failure assertion, ownership rule or provider policy was weakened. Replaces #10554 at the author's request and retains its review history.

Normally merged main bd9f2cca45cb99c7460ab678f4fe6a3b12d6ba3a into this same PR. This includes accepted common-suite corrections #11193, #11211 and #11213 without copying their patches. The old failed hosted runs describe their executed heads; fresh-head hosted CI remains required. No full monolithic local check, native Windows/macOS or real-decompiler qualification is claimed.

A clean-main qualification of 22 previously failing files found 708 passes, 10 skips and 5 failures: four existing invalid-vs-unknown client registration expectations, and one local read-only account-home limitation. These shared baseline failures are recorded separately from this PR's focused passes.

Author readiness

Human owner: @ShuaixinHuang

The human owner explicitly confirmed review of this replacement’s final diff and current-base evidence on 2026-11-14 for head 4f6d85635b5cc8236fcf2ba54a835d72623f5c98, and declared it ready for initial maintainer review.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Resubmission

Re-submitted after closing the previous PR; source branch and validated change are unchanged.

Current author readiness

@ShuaixinHuang confirmed on 2026-11-15 that the current head was reviewed, the evidence and limitations were checked, responsibility for the complete AI-assisted change is accepted, and this PR is ready for initial maintainer review.

  • Current head reviewed and owned.
  • Current evidence and limitations confirmed.
  • Ready for maintainer review.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T13:28:26.429593Z
We couldn’t complete this review. Comment @codex review to try again.
ecadb01 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge; no blocking defects were found.

Summary

The PR keeps iNES reads and final source checks owned until shutdown finishes, while preserving physical I/O failures.

  • iNES readers wait for active reads before releasing owned files.
  • Process capture keeps its cleanup result in final progress updates.
  • Ghidra inspection skips Java checks when installation details are missing.
  • Supporting fixtures and checks now match the current test contracts.

Diagram

sequenceDiagram
  participant Caller
  participant Reader as iNES reader
  participant Scope as Resource scope
  participant Stream as Region stream
  participant File as Owned descriptor
  Caller->>Reader: close()
  Reader->>Stream: Abort region production
  Reader->>Scope: Stop admission and wait
  Scope->>Stream: Join production and readable retirement
  Scope->>Scope: Join admitted final source checks
  Scope-->>Reader: Work retired
  opt Reader owns descriptor
    Reader->>File: close()
  end
  Reader-->>Caller: Shutdown result
Loading

Reviews (5) · Last reviewed commit: "Merge commit 'a8f98b7a951ba0c28cb91f7429..." · Reviewed by Greptile

Copy link
Copy Markdown
Contributor Author

@morluto @kaoru0822-kitauji @N0zoM1z0 Could you please review this change when available? The PR description records the implementation, validation evidence, and remaining limitations. Thank you.

g1at and others added 15 commits November 16, 2026 14:18
…repair-11154-20261116

# Conflicts:
#	src/artifacts/InesArtifactReader.ts
#	tests/boundary/filesystem/fileHandleChunks.test.ts
#	tests/boundary/filesystem/inesCancellation.test.ts
…file

The Windows-only case at `clientConfigurationEnvironment.test.ts:226` wrote
`rea_mcp_input_schema_profile: "full"`. That profile was retired: the reader
now refuses it ("REA_MCP_INPUT_SCHEMA_PROFILE accepts only \"compact\" …"),
so `configureClientConfiguration` returned `failed/readback` before writing
and the case failed on every Windows run, including main's own
`Windows capability and package lane`.

The case has no Windows dependency — it passes an explicit `configPath` and
the Kimi write dialect is the same everywhere — so it now runs on every
platform, which is what let the stale value rot unnoticed. The fixture keeps
the lowercase explicit key the case is about, with the supported value.

Verified on `main` `d6bcfc10`: the same fixture driven through
`configureClientConfiguration(..., "win32")` on this host reproduced
`{"status":"failed","reason":"readback"}` with the retired value and now
returns `{"status":"configured"}` with `compact`. The file's 75 cases pass
here (66 run, 9 platform-conditioned skips) and `check:fast` passes.
…alue-11154

# Conflicts:
#	tests/boundary/mcp/decompileAllCaveats.test.ts
#	tests/boundary/mcp/environmentServeMcp.test.ts
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants