mirror of
https://github.com/morluto/rea
synced 2026-10-27 22:45:19 -04:00
fix(process): preserve partial evidence and verify detached cleanup (#1011)
* test(ci): allow transport delivery in source identity regression * fix(process): preserve partial evidence and verify detached cleanup * fix(process): scope Linux token sweeps by stable process identity * fix(process): retain environment permission failure codes * fix(process): wait for signaled processes before verifying cleanup * fix(process): verify sampled detached groups during cleanup * fix(electron): preserve prelaunch identities through cleanup * fix(process): retry growing Darwin process table snapshots * fix(process): retain compatibility with saved v3 capture evidence * fix(process): migrate saved v3 captures during reconstruction verification * fix(process): preserve cancellation during Darwin helper compilation * fix(process): propagate cancellation through ownership baselines * perf(javascript): cache canonical export comparison sort keys * fix(process): cancel provider ownership preparation before spawn * fix(process): isolate native compiler waiter cancellation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { tmpdir } from "node:os";
|
||||
import { prepareProcessOwnershipInspection } from "../ProcessOwnershipObservation.js";
|
||||
|
||||
export type ProcessCaptureCapability =
|
||||
| { readonly available: true; readonly backend: "node-pty" }
|
||||
@@ -20,6 +21,7 @@ export const processCaptureOwnershipUnavailableReason = (
|
||||
export interface ProcessCaptureProbeOptions {
|
||||
readonly platform?: NodeJS.Platform;
|
||||
readonly loadPty?: () => Promise<typeof import("@lydell/node-pty")>;
|
||||
readonly prepareOwnershipInspector?: () => Promise<void>;
|
||||
}
|
||||
|
||||
/** Probe the native PTY seam and explain loader failures at their source. */
|
||||
@@ -56,6 +58,22 @@ export const probeProcessCaptureCapability = async (
|
||||
backend: "node-pty",
|
||||
reason: ownershipReason,
|
||||
};
|
||||
if (platform === "darwin") {
|
||||
try {
|
||||
await (
|
||||
options.prepareOwnershipInspector ?? prepareProcessOwnershipInspection
|
||||
)();
|
||||
} catch (cause: unknown) {
|
||||
return {
|
||||
available: false,
|
||||
backend: "node-pty",
|
||||
reason:
|
||||
cause instanceof Error
|
||||
? cause.message
|
||||
: "macOS process ownership inspection could not be prepared",
|
||||
};
|
||||
}
|
||||
}
|
||||
try {
|
||||
const { spawn } = await (
|
||||
options.loadPty ?? (() => import("@lydell/node-pty"))
|
||||
|
||||
Reference in New Issue
Block a user