fix(providers): preserve artifact producer cancellation facts

Wire sigrok and tshark finalization to the effective signal. Services and file-failure adapters retain exact opaque reasons and completed Evidence instead of guessing from error names. Preserve typed primary outcomes through failed cleanup and recovery.

Validation: latest per-file coverage is 114 passing tests across nine selected files with 14 explicit Linux-only skips; core foundation passes independently. check:fast, docs and discovery pass. Four finalization controls failed before the signal ownership fix. Bounded completed authored-producer service workflows have identical Evidence with no performance improvement claim. Real sigrok/tshark and native Linux/Windows were not verified.

Closes #4858
This commit is contained in:
morluto committed 2026-10-18 02:38:30 +08:00
1 parent 147ae9718a
commit 8a247fc70f
7 files changed
+341 -18

No files matched your search

@@ -49,7 +49,9 @@ export class PacketCaptureService {
): Promise<Result<Evidence, AnalysisError>> {
const operation = "inspect_packet_capture";
if (options?.signal?.aborted)
return err(new AnalysisCancelledError(operation));
return err(
new AnalysisCancelledError(operation, { cause: options.signal.reason }),
);
const input = inspectPacketCaptureInputSchema.safeParse(raw);
if (!input.success)
return err(
@@ -92,7 +94,9 @@ export class PacketCaptureService {
): Promise<Result<Evidence, AnalysisError>> {
const operation = "inspect_packet_fields";
if (options?.signal?.aborted)
return err(new AnalysisCancelledError(operation));
return err(
new AnalysisCancelledError(operation, { cause: options.signal.reason }),
);
const input = inspectPacketFieldsInputSchema.safeParse(raw);
if (!input.success)
return err(
@@ -139,6 +143,7 @@ export class PacketCaptureService {
return options?.signal?.aborted
? err(
new AnalysisCancelledError(operation, {
cause: options.signal.reason,
partialObservation: evidence,
}),
)