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:
morluto
2026-10-08 04:46:46 +08:00
committed by GitHub
parent 63ba7424c0
commit 63cf28fd8f
51 changed files with 5506 additions and 316 deletions
+56 -4
View File
@@ -23,6 +23,7 @@ const source = (
digit: string,
authority: "controlled-replay" | "shipped-artifact",
confidence: "observed" | "derived" = "observed",
captureResult: JsonValue = EMPTY_PROCESS_CAPTURE_EXAMPLE,
): Evidence =>
createEvidence(
{
@@ -41,16 +42,26 @@ const source = (
? "capture_process_scenario"
: "inventory_artifact",
parameters: {},
result:
authority === "controlled-replay"
? EMPTY_PROCESS_CAPTURE_EXAMPLE
: { digit },
result: authority === "controlled-replay" ? captureResult : { digit },
confidence,
authority,
environment: authority === "controlled-replay" ? environment : null,
},
);
const legacyV3Capture = () => {
const {
selected_executable_sha256: _selectedDigest,
executable_identity: _executableIdentity,
executable_sha256,
...legacyManifest
} = EMPTY_PROCESS_CAPTURE_EXAMPLE.manifest;
return {
...EMPTY_PROCESS_CAPTURE_EXAMPLE,
manifest: { ...legacyManifest, executable_sha256 },
};
};
const processResult = (
terminal: "unchanged" | "changed" | "unknown" = "unchanged",
): JsonValue => ({
@@ -275,7 +286,48 @@ describe("reconstruction verification", () => {
]),
);
});
});
describe("saved v3 reconstruction capture compatibility", () => {
it("verifies saved v3 process captures and rejects a malformed legacy digest", () => {
const legacy = legacyV3Capture();
const left = source("1", "controlled-replay", "observed", legacy);
const right = source("2", "controlled-replay");
const comparison = processComparison(left, right, processResult());
const bundle = createEvidenceBundle([comparison, left, right]);
expect(
verifyReconstruction(behavioralSpec(comparison), bundle),
).toMatchObject({
status: "pass",
summary: { total: 1, passed: 1, failed: 0, unknown: 0 },
});
const malformedLegacy = {
...legacy,
manifest: { ...legacy.manifest, executable_sha256: null },
};
const malformedLeft = source(
"3",
"controlled-replay",
"observed",
malformedLegacy,
);
const malformedComparison = processComparison(
malformedLeft,
right,
processResult(),
);
expect(() =>
verifyReconstruction(
behavioralSpec(malformedComparison),
createEvidenceBundle([malformedComparison, malformedLeft, right]),
),
).toThrow();
});
});
describe("reconstruction verification outcomes", () => {
it("fails an authoritative observed disagreement", () => {
const left = source("1", "controlled-replay");
const right = source("2", "controlled-replay");