Repository navigation
fix(process)!: retain observed cleanup intervention - #8043
wunianze666-netizen wants to merge 5 commits into
Conversation
Preserve the ownership cleanup signal fact through successful and partial capture finalization, without changing signal policy or resource ownership. BREAKING CHANGE: A quiesced process capture may report cleanup_outcome cleaned when owned cleanup sent termination signals. Refresh MCP tool schemas or update pinned readers to accept that combination; prior valid captures remain readable without rewriting.
[Medium impact] The PR appears safe to merge; no new actionable issue was found. SummaryRetains observed cleanup signals when a later signal or ownership check fails.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Observe settlement] --> B[Clean up owned processes]
B --> C[Retain observed signals]
B --> D[Retain cleanup result]
C --> E[Project capture facts]
D --> E
E --> F[Complete capture]
E --> G[Partial observations and original failure]
Reviews (3) · Last reviewed commit: "fix(process): retain signals when owned ..." · Reviewed by Greptile |
|
I tested this PR at
In both cases the child's log shows only its start line, so the descendant was still ended. The Evidence now says so, which is what #8032 asked for. Settlement stays One related observation, outside this PR's scope. #8032 left the case of a child in the root's own process group untested, so I tested it. I used a probe that blocks signals across |
* fix(process)!: retain observed cleanup intervention Process capture derived `settlement.cleanup_outcome` from the settlement state alone in three places, so a quiesced capture reported `not_required` even after final owned-process cleanup SIGKILLed a live token-owned descendant. `cleanupOwnedProcessGroup` already knew it had signaled, but the capture lifecycle discarded that fact. Carry the observed signal out of ownership cleanup (also on failure paths), accumulate it across cleanup retries as true/false/unknown, and derive settlement and the intervention residual unknown once in `processCaptureCleanupFacts` for full, partial and harness results. BREAKING CHANGE: a quiesced settlement may now report `cleanup_outcome: "cleaned"`. Saved captures stay valid; readers that accepted only `not_required` for quiesced settlements must accept `cleaned`. Fixes #8032 Squashed from #8043 and rebased onto main (adapted to the resource-scope release API and the inspection-failure cleanup path). Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(process): keep a sent signal when cleanup throws an inspection failure Final ownership verification can rethrow a typed inspection failure (for example cancellation) after SIGKILL succeeded. The capture owner then recorded the attempt as unknown and dropped the intervention fact. cleanupOwnedProcessGroup now marks a failure it throws after signaling, without changing the failure's identity, and the capture owner keeps the signal for such failures. Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: wunianze666-netizen <[email protected]> Co-authored-by: gensokyo-dev <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Fixes #8032, reported by @jgt87. Process settlement and cleanup intervention are separate facts: a quiesced capture can still require termination of token-owned descendants.
The ownership producer retains observed signals across later failures, the resource owner accumulates intervention across retries, and the capture projection carries it through success, partial Evidence and pre-result failures. Cancellation retains its opaque caller reason independently. Failed cleanup resources remain owned for retry. Historical saved captures remain accepted.
Breaking output-contract correction: quiesced captures may report cleaned rather than not_required; strict pinned readers must accept this and optional incomplete-observation residual_unknowns. Process-signaling authority is unchanged.
Historical maintainer-reported validation on head 791b746: 129 focused ownership, cleanup, harness, schema and capture tests passed. This includes real descendant cleanup, deadlines, CLI signals, post-exit MCP cancellation and final-cleanup cancellation, plus controlled intervention/cancellation combinations. check:fast, docs:check and test discovery passed. Windows cases use controlled fixtures; real Windows behavior and the full repository gate were not verified in this follow-up. Draft status and human readiness declarations remain unchanged.
Current CI follow-up
The failed built-test job selected CommonJS while two route fixtures asserted unisolated-script behavior. This follow-up changes only
tests/acceptance/javascriptRoutesCli.test.ts(12 additions / 2 deletions), reusing this contributor's repair fromfe099ea23. It preserves the original unknown/partial assertions, selects JSX sources whose runtime remains unproven, and adds a package-CommonJS control using the same source text. Node's module wrapper keeps the original.jsfixture's program variables local.The parent remains maintainer head
791b746b5227c4d808ae273e6efedfa88402a641; its additional commits are preserved. The repair is made in a separate E-side worktree branch and pushed normally to this PR's existing head branch. The active C-side checkout is not changed. No Promise/FileHandle implementation from another unmerged branch is included.Contract and boundary impact
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): no package, lock, version, SDK or install-policy change in this follow-up.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
42602703034, attempt 1, head791b746b5227c4d808ae273e6efedfa88402a641; shard 3 job129159615705has 2 failed / 2,008 passed / 32 skipped. Both failures are the route fixture cases; no timeout caused those failures.dc46d9508b63e1cce5765a2c3ba02acb021f1c7a, parentsf20f05536e3cebff3f31a67954664c40d8c4c3dd+ the old PR head, tree53cb2d6319453333d54def49b3fe6e877f20e6a2. That tree equals the preserved maintainer parent used for this fix.For evidence-bearing changes:
Validation performed
npm run build:cached: matching-parent build passed.node scripts/run-exact-tests.mjs run tests/acceptance/javascriptRoutesCli.test.ts: 7 passed / 3 original-deadline SDK timeouts, no skip or name filtering; the three directly affected fixture/control cases pass.npm run check:ci:fast,npm run docs:checkandgit diff --check: passed; README consistency 9 passed. Full optional chain and unrelated suites were not run for this fixture-only follow-up.6e44e7aedcb53593f111c9d9f997a89159d5e030.Compatibility, safety, and release
The original process-reporting contract correction and its limitations remain as stated above. This follow-up changes test fixtures only; it adds no target execution, injection, process-signaling, installation or protection-recovery authority. No timeout, skip, schema check, assertion or resource allowance is removed or raised.
Author readiness
Human owner: @wunianze666-netizen
Before merge
type(scope): outcome.