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 authored and GitHub committed 2026-10-08 04:46:46 +08:00
1 parent 63ba7424c0
commit 63cf28fd8f
51 files changed
+5506 -316

No files matched your search

@@ -65,7 +65,7 @@ it("rejects altered v4 commitments and accepts canonical key reordering", () =>
executable_sha256: "f".repeat(64),
},
}),
).toThrow("executable_sha256");
).toThrow("executable_identity");
});
it("rejects settlement and cleanup combinations that cannot occur", () => {
@@ -142,6 +142,92 @@ it("accepts old captures without a journal and validates complete journals", ()
}
});
it("migrates persisted v3 executable digests without claiming a selected digest", () => {
const capture = emptyCapture();
const {
selected_executable_sha256: _selectedExecutableSha256,
executable_identity: _executableIdentity,
executable_sha256,
...legacyManifest
} = capture.manifest;
const legacyCapture = {
...capture,
manifest: { ...legacyManifest, executable_sha256 },
};
const migrated = parseProcessCapture(legacyCapture);
expect(migrated.manifest).toMatchObject({
selected_executable_sha256: null,
executable_sha256: null,
executable_identity: {
state: "unknown",
reason: expect.stringContaining("did not distinguish"),
},
legacy_executable_sha256: executable_sha256,
scenario: capture.manifest.scenario,
full_scenario_sha256: capture.manifest.full_scenario_sha256,
});
expect(compareProcessCaptures(migrated, migrated)).toMatchObject({
status: "unchanged",
});
const exported = JSON.stringify(migrated);
expect(parseProcessCapture(JSON.parse(exported))).toEqual(migrated);
expect(() =>
parseProcessCapture({
...legacyCapture,
manifest: {
...legacyCapture.manifest,
executable_sha256: "f".repeat(64),
},
}),
).toThrow("legacy_executable_sha256");
const nullDigestScenario = {
...legacyCapture.manifest.scenario,
executable_sha256: null,
};
const malformedLegacyBase = {
...legacyCapture,
manifest: {
...legacyCapture.manifest,
executable_sha256: null,
scenario: nullDigestScenario,
full_scenario_sha256: digestProcessCommitment(nullDigestScenario),
},
};
expect(() => parseProcessCapture(malformedLegacyBase)).toThrow();
expect(() =>
parseProcessCapture({
...malformedLegacyBase,
manifest: {
...malformedLegacyBase.manifest,
executable_sha256: "not-a-digest",
},
}),
).toThrow();
const {
executable_sha256: _missingLegacyDigest,
...manifestWithoutLegacyDigest
} = malformedLegacyBase.manifest;
expect(() =>
parseProcessCapture({
...malformedLegacyBase,
manifest: manifestWithoutLegacyDigest,
}),
).toThrow();
const { executable_identity: _missingIdentity, ...incompleteModernManifest } =
capture.manifest;
expect(() =>
parseProcessCapture({
...capture,
manifest: incompleteModernManifest,
}),
).toThrow();
});
it("requires compatible contracts and enforces capture age through a clock seam", () => {
const capture = emptyCapture();
expect(() =>