Repository navigation
feat(investigation)!: retain records across engine cleanup - #8361
Conversation
Keep authenticated investigation facts and complete Unknown histories across engine cleanup. Add explicit serialized checkpoint/reset and terminal runtime disposal, with bounded atomic record retention and consistent admission. BREAKING CHANGE: close_binary preserves in-memory investigation records. Use reset_investigation to clear them; save_path checkpoints the complete bundle before clearing. Engine replay snapshots remain target/profile bound. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Allow the existing binary_session query in isolated lifecycle trials so a checkpoint continuation can inspect session state before restoring facts. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Merge main d54a466 while preserving retained investigation records and the new conditional close cleanup retry. Reset also drains candidate-owned cleanup without retiring a healthy client. Align recovery guidance and native workflow instructions with explicit investigation reset. Validated upstream cleanup retry and investigation boundaries (61 tests), registry reset controls, typing, lint, formatting, architecture and docs. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Pin real application coverage, healthy Ghidra reset, independent bundle and Unknown history audits, whole-task measurements and all model partial runs. Distinguish latest-main qualification from earlier performance comparisons. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[High impact] The reviewed changes appear safe to merge; no actionable issue remains from this review. SummaryThis PR separates engine cleanup from investigation history.
DiagramsequenceDiagram
participant Client
participant Request as MCP request
participant Session
participant File as Checkpoint
Client->>Request: Run analysis
Request->>Session: Hold original admission
Session-->>Request: Result
Client->>Session: reset_investigation
Session->>Session: Wait for earlier admissions
Request-->>Client: Send reply
Request->>Session: Release admission after cleanup and send
opt save_path supplied
Session->>File: Save complete bundle
File-->>Session: Publication and cleanup complete
end
Session->>Session: Clear investigation records
Session-->>Client: Reset receipt
Reviews (6) · Last reviewed commit: "docs(investigation): qualify final reque..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83ba265cfc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Keep oversized SDK error retention and publication inside the shared session admission. Retry both server-owned artifact and process cleanup before reset, preserving failed owners and investigation records. Bound controlled lifecycle waits, use canonical error facts and formatter delivery, and update CLI/Go lifecycle assertions. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Keep retained prompt identifiers available after engine cleanup and clear them after explicit investigation reset. Record current-runtime multi-domain, Codex CLI and healthy Ghidra verification, with separate historical measurements and verification limits. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
|
@greptileai please review the latest commit a809ff4. The previous transport-admission, artifact-cleanup, bounded-wait and wording findings were fixed in 6d875b3, with regression evidence replied in each thread. The final verification report also records current-runtime multi-domain, local Codex CLI and real Ghidra checks. Please check the final changes for remaining issues. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0f99adb2a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Own handler cleanup and physical response publication in one request scope. Borrow its original session admission across nested work so a queued reset cannot clear successful or error Evidence before the reply settles. Distinguish outgoing server request IDs and handle SDK-suppressed cancellation without releasing an already-started send. Cover blocked successful sends, SDK/handler failures and cancellation. Keep the 1500-file JavaScript timeout case within a measured finite parent retention budget while preserving the separate memory-pressure case and worker limit. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Pin the final runtime and genuine multi-domain, local Codex terra/high, fresh-process checkpoint and Ghidra session-reuse results. Preserve earlier measurements, partial attempts, bounded regression evidence and resource limits. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Take main 6e9ee97. morluto#8228's ESP flash inputs join D1's load selection: resolver, session and CLI options carry `loadSelection` and `espFlash`, and `formatHint` comes from the selection. `inspect-artifact` and `extract-artifact` now pass `--target-format esp-flash-image` as a load selection; built from spreads, the old `formatHint` key compiled but was dropped. The open_binary description keeps D1's M-profile sentence and morluto#8361's investigation-record ending. Tests from main move to D1's inputs, as embedded-integration did: morluto#7481's raw vocabulary target carries `rawLoad`, morluto#8228's flash resolver tests pass `loadSelection`, morluto#8229's raw scope case names its entry, and the pairing grid adds esp-flash-image's four rows while the other sixteen keep d6f88be's hash.
) Separate engine cleanup, investigation reset and terminal disposal in the shared application owner. Keep stable Evidence IDs and full Unknown revision history through engine close and target changes; serialize reset with all record writers and cleanup owners, optionally acknowledging a complete checkpoint before clearing. Bound retained representation without eviction. Validation: 43 focused files / 533 distinct tests, source/type/lint/schema/documentation checks, nine genuine source cases across eight families, real Ghidra session identity and cleanup, and nine actual local Codex CLI terra/high runs with independent full-result and checkpoint audits. See docs/verification/investigation-lifecycle.md for measurements, partial attempts and verification limits. Fixes morluto#8347. BREAKING CHANGE: close_binary retains investigation records. Use reset_investigation to clear them. Cross-process recovery requires an explicitly acknowledged Evidence bundle checkpoint. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Summary
close_binaryused to erase investigation Evidence and Unknown history, including target-free closes and cleanup failures. It now releases engine/replay state while retaining investigation references.reset_investigationexplicitly ends that history, optionally acknowledging a complete checkpoint before clearing.Fixes #8347.
Problem and expected behavior
A/B comparison and resumed investigations should reuse authenticated facts after engine cleanup. Closing an engine must preserve their IDs and full Unknown revision chains. Explicit reset must drain earlier work, block later work, retain a healthy target, and preserve records on save/cancellation/cleanup failure.
Change and scope
Separate engine, investigation and terminal runtime cleanup in the shared application layer. Add atomic retention admission with a heap-derived representation allowance, O(1) status counters and no eviction. Reuse canonical authenticated bundle import and synchronized atomic publication for explicit checkpoints.
Breaking: callers that used
close_binaryto discard records should callreset_investigation. Automatic journaling remains #4809.Contract and boundary impact
InvestigationRecords/EvidenceLedger;BinarySessionserializes reset and retirement. Remove the old combined record-clearing close path and redundant authenticated-payload reserialization.reset_investigationand compactbinary_session.investigationstatistics.Evidence and regression coverage
Executed verification, measurements, model partials and limitations.
40ec9fe79/ manifestf4e55abd…: 9 genuine source cases across 8 families, 313 MCP calls and 19 CLI checks, complete original results and Unknown histories restored into fresh processes.gpt-6.1-terra/high: 9 actual runs, default full discovery plus scoped multi-domain tasks; independent bundle/result/answer audits. All failed/partial attempts and continuation costs are included.Selected fields from the full-discovery native Codex task’s
reset_investigationreply:{"cleared_evidence_records":14,"cleared_unknown_revisions":3,"cleared_unknown_heads":2,"retained_target":false}. Import restored the original comparison ID and both Unknown heads.Validation performed
Author readiness
Human owner: @gensokyo-dev
The owner explicitly delegated readiness completion and review submission to Codex for this task. Codex performed implementation, diff review and validation under that delegation.
Before merge