Skip to content

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

Closed
ShuaixinHuang wants to merge 23 commits into
morluto:mainfrom
ShuaixinHuang:review/ci-repair-11154
Closed

ShuaixinHuang wants to merge 23 commits into
morluto:mainfrom
ShuaixinHuang:review/ci-repair-11154

Conversation

@ShuaixinHuang

Copy link
Copy Markdown
Contributor

Summary

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.

Resubmission and prerequisites

Replaces #11154 at the human owner's request after repairing its inherited CI failures. Preserve iNES cancellation, physical I/O failures and descriptor ownership. The original feature commits are preserved; prior review and baseline reproduction evidence remain available in #11154.

Qualified head bb2022f8c incorporates main 552d1c710, including the merged shared CI repair #11727. It also explicitly includes the missing-installation JVM-probe repair #11732; that prerequisite requires review. The new comparison drops the shared fixes already accepted upstream.

Executed validation

Linux, Node 24.22.1 / npm 11.9.0:

  • npm run test:focused -- tests/boundary/cli/doctorCancellation.test.ts tests/boundary/filesystem/fileHandleChunks.test.ts tests/boundary/filesystem/inesCancellation.test.ts — Test Files 3 passed (3); Tests 65 passed (65); required build passed.
  • npm run check:fast, normal commit/pre-push hooks, and git diff --check passed.
  • Merging the latest main changed ancestry only; the qualified source tree was identical.
  • fix(ghidra): avoid Java probes for missing installations #11732 separately passed 129 Ghidra/historical-summary tests (1 platform skip). The merged shared repair passed 101 tests (9 platform skips) and 148 real mitmproxy cases.

Hosted CI is running for this replacement. Native Windows/macOS and the complete monolithic suite were not run locally. Checked-in independent producer witnesses were exercised by the selected tests; producer generation was not rerun unless named above.

Author readiness

Human owner: @ShuaixinHuang

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

The initial readiness declaration is carried from #11154; the repository permits later corrective pushes without a new initial declaration.

ShuaixinHuang and others added 23 commits November 14, 2026 14:39
…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
@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-16T12:02:09.511683Z
We couldn’t complete this review. Comment @codex review to try again.
bb2022f 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 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no new blocking issue was established.

Summary

The PR keeps iNES reads and final source checks owned until they finish.

  • iNES readers stop region streams before releasing owned file handles.
  • File reads keep physical I/O errors when cancellation races delivery.
  • Ghidra inspection skips Java when application properties are missing.
  • Cancellation tests wait for signal handling and find cleanup progress by its label.

No new actionable findings were established. Review was source-based; no tests were run. Whether this PR has been superseded could not be verified because GitHub access required authentication.

Diagram

sequenceDiagram
  participant Caller
  participant Reader as InesArtifactReader
  participant Scope as ArtifactResourceScope
  participant Stream as Region stream
  participant File as Owned descriptor
  Caller->>Reader: close()
  Reader->>Reader: Stop admission and abort lifecycle
  Reader->>Scope: close()
  Scope->>Stream: Wait for producer completion and readable retirement
  Note over Scope: Also wait for admitted source checks
  Scope-->>Reader: Work retired
  opt Reader owns descriptor
    Reader->>File: close()
  end
  Reader-->>Caller: Shutdown complete
Loading

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@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