fix(reference)!: preserve symlink races and root failure facts

Classify replacement EINVAL at the readlink syscall so the reader and importer
retain sibling observations. Give an admitted root's enumeration failure its
own typed field, use it for unresolved symlink coverage, and project it as a
graph limitation instead of an invalid dot-path child entry. Keep admission,
cancellation and cleanup failures distinct.

Closes #5135
Closes #5136

BREAKING CHANGE: Partial reference-source reader results report failed root
enumeration in rootFailure instead of a failed directory child at path ".".
Historical source graphs preserve the root failure as a top-level limitation.
This commit is contained in:
morluto committed 2026-10-19 08:36:53 +08:00
1 parent c85b44e1b1
commit 6296fdf560
8 files changed
+312 -42

No files matched your search

@@ -61,8 +61,15 @@ export type ReferenceSourceEntry =
readonly size?: number;
};
/** A failure enumerating an already admitted root, separate from its children. */
export interface ReferenceSourceRootFailure {
readonly code: ReferenceSourceFailureCode;
readonly message: string;
}
export interface ReferenceSourceRead {
readonly root: string;
readonly rootFailure?: ReferenceSourceRootFailure;
readonly entries: readonly ReferenceSourceEntry[];
readonly bytesRead: number;
/** Node exposes no portable openat traversal; pathname identity is checked around each operation. */
@@ -98,6 +105,7 @@ export type TraversalState = {
readonly kind: ReferenceSourceExclusionKind;
}>;
readonly pending: PendingDirectory[];
rootFailure?: ReferenceSourceRootFailure;
bytesRead: number;
};