Repository navigation
refactor(process): let Darwin helper cleanup errors read their owner's release - #10801
Merged
Merged
Conversation
…f pushing it to dependents AnalysisError.cleanupIncomplete becomes a getter over the error's own unresolved state and its bound dependencies. The WeakRef dependents graph and resolveCleanup's push propagation are removed, and subclasses mark their initial state through markCleanupIncomplete instead of overriding a public mutable field.
A composite whose dependencies had released but whose status was never read stayed incomplete when a later dependency was bound.
…resolving them (#10759) AnalysisCleanupLeaseGroup no longer calls resolveCleanup() on its error. The error holds the group as a release claim and reads cleanupReleased when asked, so completion follows the lease owner without a push.
… so they only shrink (#10763) * refactor(errors): let errors read a lease group's release instead of resolving them AnalysisCleanupLeaseGroup no longer calls resolveCleanup() on its error. The error holds the group as a release claim and reads cleanupReleased when asked, so completion follows the lease owner without a push. * chore(verify): count resolveCleanup and bindCleanupDependencies calls so they only shrink
…release OwnedWorkerRuntime's root epoch is now an AnalysisCleanupReleaseClaim. Errors bound to it read its release when asked instead of the epoch pushing resolveCleanup() through weak references, and a runtime without a retained root binds an already-released owner. Removes the OwnedWorkerCleanupFailure structural type and four resolveCleanup() pushes; the counted baseline shrinks accordingly.
…ease (#10792) Retained pcap commands, retained snapshot failures and snapshot completion descriptors now own their release and errors read it: commands and snapshot failures implement AnalysisCleanupReleaseClaim, and a failed completion-descriptor close is retried through an AnalysisCleanupLease bound to its error. Removes four resolveCleanup() pushes; the counted baseline shrinks accordingly.
…s release Darwin helper cache and run-token reader root cleanup now record an AnalysisCleanupRelease that every failure reports; a successful retry confirms it. Replaces the first-failure anchor that later failures depended on and the resolveCleanup() push. Removes two resolveCleanup() and two bindCleanupDependencies() calls; both counted baselines shrink.
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Medium impact] The reviewed changes appear safe to merge; no new blocking issue was found. SummaryReplaces retained cleanup errors with shared
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Cleanup fails] --> B[Bind error to owner release]
B --> C[Error reports incomplete]
C --> D[Owner retries cleanup]
D -->|Fails| B
D -->|Succeeds| E[Confirm release]
E --> F[Bound errors report complete]
E --> G[Use a fresh release for later cleanup]
Reviews (4) · Last reviewed commit: "Merge origin/main into refactor/darwin-h..." · Reviewed by Greptile |
This was referenced Nov 15, 2026
Merged
…ckpoint's release (#10802) GhidraClient and GhidraCheckpoint bind each cleanup failure to an AnalysisCleanupRelease and confirm it when a later close or retry releases everything, instead of keeping a set of failures and pushing resolveCleanup() to each. Removes two resolveCleanup() calls; the counted baseline shrinks.
morluto
changed the base branch from
refactor/worker-runtime-release-claim
to
main
November 15, 2026 09:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the Darwin ownership-helper cache and run-token reader root cleanup onto the read-side cleanup model from #10744. Failures now report a shared
AnalysisCleanupReleasethat the owner confirms when a retry succeeds, instead of later failures depending on a first-failure "anchor" error that the owner resolved withresolveCleanup(). Third owner-family slice of #10763's baseline.Problem and expected behavior
DarwinHelperCache.close()and the run-token reader'scleanupRoot()kept the first unresolvedProviderCleanupErroras an anchor, bound each later failure to it withbindCleanupDependencies(), and calledresolveCleanup()on the anchor after a successful retry. The anchor stood in for the owner's release. Expected behaviour is unchanged: every failure from one unreleased cleanup reports incomplete until a retry succeeds, then all report complete.Change and scope
src/domain/analysisCleanupRelease.ts:AnalysisCleanupRelease, anAnalysisCleanupReleaseClaimfor owners that retry cleanup in place rather than through oneclose();bind(error)andconfirm(). It lives in the domain layer becausesrc/processmay not importsrc/artifacts.DarwinHelperCacheandDarwinProcessRunTokenReaderkeep one release per unreleased cleanup, bind each failure to it, and confirm it on success.resolveCleanup()and twobindCleanupDependencies()calls; both counted baselines shrink.Stacked on #10789 (which now carries #10792), itself on #10744.
Contribution scope: not applicable (internal refactor within existing boundaries).
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
AnalysisError.cleanupIncompletereads it.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs):Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/analysisCleanupRelease.test.tsbinds two errors, confirms the release and requires both complete, plus an error bound after release. Existing Darwin cache and reader cleanup tests pin provider behaviour.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
npm run check:fast— passed (after moving the class fromsrc/artifactstosrc/domainto satisfy module layering).node scripts/verify/architecture-guards.mjs --shrink-baselines— passed (baselines lowered).npm run test:local -- src/domain/analysisCleanupRelease.test.ts src/process/DarwinHelperCache.ownership.test.ts src/process/DarwinProcessRunTokenReader.finalization.test.ts src/process/DarwinProcessRunTokenReader.timeout.test.ts src/process/DarwinCompilationRetirement.test.ts— 14 passed.npm run test:focused -- tests/boundary/process/darwinHelperCache.test.ts tests/boundary/process/darwinProcessRunTokenReader.test.ts tests/process-global/darwinCompilerCleanup.test.ts tests/process-global/darwinHelperCacheCleanup.test.ts— 68 passed.command— resultCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.