mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 14:26:07 +00:00
fix(filesystem): preserve failure provenance across cleanup owners
Carry descriptor outcomes, cancellation, retention and physical origin as named facts so wrappers cannot drop ownership context. Replace raw primary failure unwrapping with provenance facts across artifact consumers, and use Result for Kuna span reads including undefined rejections. Exercise actual descriptors, rollback, cancellation and cleanup retry; update brittle snapshot and completion fixtures to use their producing boundaries.
This commit is contained in:
1 parent
a062529bb2
commit
4610843efd
41 files changed
+1172
-412
No files matched your search
@@ -29,7 +29,7 @@ import { ArtifactReaderFailure } from "../artifacts/ArtifactReader.js";
|
||||
import {
|
||||
withArtifactRegularFile,
|
||||
bindArtifactFileCleanup,
|
||||
artifactFilePrimaryFailure,
|
||||
artifactFilePrimaryFacts,
|
||||
artifactFileCancellationCause,
|
||||
artifactFileCompletion,
|
||||
} from "../artifacts/ArtifactFileOperation.js";
|
||||
@@ -110,9 +110,10 @@ export class GpuCodeObjectsProvider implements GpuCodeObjectsPort {
|
||||
),
|
||||
);
|
||||
} catch (cause) {
|
||||
const primary = artifactFilePrimaryFailure(cause);
|
||||
const { cause: primary, origin } = artifactFilePrimaryFacts(cause);
|
||||
let error: AnalysisError;
|
||||
if (primary instanceof AnalysisError) error = primary;
|
||||
if (origin === "owned-or-classified" && primary instanceof AnalysisError)
|
||||
error = primary;
|
||||
else if (primary instanceof BinaryResourceFailure)
|
||||
error = new AnalysisResourceConstraintError(
|
||||
OPERATION,
|
||||
@@ -142,6 +143,7 @@ export class GpuCodeObjectsProvider implements GpuCodeObjectsPort {
|
||||
constraint: "file_format_rejected",
|
||||
});
|
||||
} else if (
|
||||
origin === "owned-or-classified" &&
|
||||
primary instanceof ArtifactReaderFailure &&
|
||||
primary.reason === "cancelled"
|
||||
)
|
||||
@@ -149,6 +151,7 @@ export class GpuCodeObjectsProvider implements GpuCodeObjectsPort {
|
||||
cause: artifactFileCancellationCause(primary),
|
||||
});
|
||||
else if (
|
||||
origin === "owned-or-classified" &&
|
||||
primary instanceof ArtifactReaderFailure &&
|
||||
primary.reason === "integrity"
|
||||
)
|
||||
@@ -172,6 +175,7 @@ export class GpuCodeObjectsProvider implements GpuCodeObjectsPort {
|
||||
else if (isSelectedRegularFileError(primary))
|
||||
error = new BinaryTargetError(input.path, primary.message, { cause });
|
||||
else if (
|
||||
origin === "owned-or-classified" &&
|
||||
primary instanceof ArtifactReaderFailure &&
|
||||
primary.reason === "limit"
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user