fix(reference)!: retain source and metadata cleanup owners

Require a caller-owned artifact resource scope for source traversal and Git metadata reads. Preserve cancellation, filesystem reasons, partial entries and bytes, and cleanup observations through import and the CLI. Transfer exact failed file owners at regular-file admission and close boundaries, including multiple failures encountered by Git reference resolution.

Validation: 169 focused tests passed across 26 files; two Windows-only cases skipped. Build, typecheck, lint, formatting, knip, architecture guards, discovery and docs checks passed.

BREAKING CHANGE: Reference source readers and imports require an ArtifactResourceScope. VCS metadata reads return Result, and CLI import failures include observed details and partial evidence.
This commit is contained in:
morluto
2026-10-11 06:10:10 +08:00
parent 215001a1ce
commit 53e7fadbd0
30 changed files with 1450 additions and 222 deletions
+7
View File
@@ -11,6 +11,13 @@ const referenceSourceImportFailureSchema = z.strictObject({
"execution_failure",
]),
message: z.string().min(1),
cleanup: z
.strictObject({
reason: z.string().min(1),
resources: z.array(z.string().min(1)),
})
.optional(),
partial: z.unknown().optional(),
});
/** Identify the historical-source import command's failed operation outputs. */