Repository navigation
fix(lifecycle): preserve observations and cleanup ownership - #4274
Conversation
Keep completed Evidence after finalization and through CLI/MCP delivery. Preserve output and cleanup failure precedence. Refs #4254.
Keep startup group-owned while each caller has an independent abortable wait. Await final-owner cleanup and preserve cleanup facts before retrying. Reuse the shared abortable promise helper. Refs #3983.
Retain repeated event requests while unresolved owners need cleanup, and unregister only after success. Verify coalescing and failed-owner retry. Refs #4253.
Always close after attempted verification and keep unexpected primary failures and cleanup details visible. Exercise the production script with controlled imports, including null and undefined throws. Refs #4260.
Use the retained ChildProcess handle for IPC cancellation and parent disconnection. Keep the SQLite lock until observed child close, and include native Windows regressions in the curated CI lane. Native Windows results remain pending. Refs #4258.
Compare resolved targets with resolved repository and site roots. Accept directory aliases while preserving escape checks and keep fixtures within their temporary owner. Refs #4264.
Clarify validation-before-cancellation, independent startup waiter controls, producer and adapter coverage, and repeated shutdown events.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90846dc7da
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[High impact] The latest changes appear safe to merge; no new blocking issue was found. SummaryThis PR preserves completed observations, original failures, and resource ownership when cancellation races cleanup.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Provider work finishes] --> B[Close owned child resources]
B --> C[Close containing workspace]
C --> D{Caller cancelled?}
D -->|Yes| E[Keep abort reason and completed Evidence]
D -->|No| F[Keep original result]
E --> G{Cleanup failed?}
F --> G
G -->|Yes| H[Return error bound to retained owner]
H --> I[Retry exact owner]
I --> J[Confirmed release clears pending cleanup]
G -->|No| K[Return completed outcome]
Reviews (10) · Last reviewed commit: "test(mcp): use the shared budget for ses..." · Reviewed by Greptile |
|
Merged current Resolved overlapping completion/delivery and file-resource ownership implementations, retained upstream CDP/runner/publisher/JADX cleanup improvements, and removed a duplicate scenario cancellation check introduced by the automatic merge. Reconciled typed Electron partial expectations and retry/concurrency fixture assumptions. Final Node 24.18.0 checks passed: static checks, build, docs; 8,477 source tests; 803 MCP tests; 351 ownership/provider/verifier tests; 595 browser/scenario/CLI tests; fresh stdio exercise with 207 tools and 414 valid schemas; and real Chrome 155 CLI/MCP verification with owned cleanup complete. Groups overlap and counts are not additive. Native platform skips remain documented in the PR. CI for the pushed revision is queued. New automated review threads on the prior revision remain open; they are separate from this conflict resolution. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bc5810825
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Main (#4274) moved KunaTargetCommands#run behind command admission and cleanup leases. Keep main's structure and pass the configured deadline in place of reportedTimeoutMs; give main's new hash-owner tests typed deadlines. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main (morluto#4274) rewrote the active-action cancellation test for its new cancellation semantics (partial observation on AnalysisCancelledError). This branch had only adjusted that test around main's earlier red run, so take main's version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Integrate upstream PR morluto#4274, retaining its resource-owner implementations and our distinct process-ownership regressions. Bind the deadline-test fallback to the running phase and preserve validated host cleanup uncertainty alongside filesystem and clock observations.
Expose exact-path, selected-property, paged reads of retained JavaScript application facts through the shared CLI/MCP analysis view. Preserve original identities, complete row Evidence and partial coverage; retain reproducible real-Joplin and actual-agent measurements, including negative cost results. Fixes #4190. Part of #4027. Code mode remains deferred by #4091. Integrate main after #4274. Validation: 114 distinct focused cases across documented invocations, 106 Python cases, full static/docs checks and 18 version-labelled real-application workflows with 9 complete CLI/MCP view parity controls. Preserve two local fixture deadline failures and the unchanged test passing on an available single CPU. Final-head CI passed all 36 jobs after one Windows timeout retry without source changes; both exact-head automated reviews are clear and all review threads resolved. Downloadable apps and raw large Evidence/transcripts are excluded. Co-authored-by: Kaoru0822 <[email protected]>
Main (morluto#4274) moved KunaTargetCommands#run behind command admission and cleanup leases. Keep main's structure and pass the configured deadline in place of reportedTimeoutMs; give main's new hash-owner tests typed deadlines.
Summary
Preserve completed observations, primary failures, and cleanup ownership when cancellation or a failed close races finalization. Fixes #3923, #3927, #3983, #4255, #4256, #4257, #4258, #4260, #4261, #4264, #4266, #4277, and #4289. Related audit: #4227. Raw-partial recovery design follow-up: #4276.
Changes
Validation
Local toolchain: Node 24.18.0 on macOS arm64. Native CI is identified below.
Resultcontract.Historical real Ghidra 12.1.4/JDK21 verification at
ea790d43bpassed 373 CLI/MCP calls and 52 expected refusals; it was not rerun at the final revision.Fault-injection regressions use controlled processes and filesystem faults. Native Kuna/JADX and physical ADB were not exercised locally. No complete token/CPU/process-family-memory benchmark was performed. Final-head CI for
9b58709f8passed all 36 jobs, including all five boundary shards, source/static/docs checks, real browser/Apple workflows, and Windows/macOS/Linux package lanes. The separate real packet-capture, signal-recording, and Go-metadata workflows also passed.Author readiness
Human owner: @morluto
Before merge