fix(process)!: retain partial filesystem snapshot observations

Keep expected readlink and follow-up lstat failures as typed entry omissions,
including the observed path and errno. Retain directory metadata and sibling
observations, distinguish known identity replacements, and keep cancellation
and unexpected I/O failures terminal. Reuse admitted root metadata and test
cancellation by descriptor state rather than a count of named lookups.

Adapt the symlink race handling proposed in #4587 at fae4e25539.

Closes #4575

BREAKING CHANGE: Filesystem enumeration omission reasons now also include
entry_unavailable and identity_changed. Clients validating the old literal
reason must accept the expanded capture schema.

Co-authored-by: rudrakshagarwal4200-ai <rudrakshagarwal4200@gmail.com>
This commit is contained in:
morlutoandrudrakshagarwal4200-ai committed 2026-10-19 08:34:39 +08:00
1 parent 95c8f57aa2
commit c85b44e1b1
8 files changed
+826 -61

No files matched your search

+8 -3
View File
@@ -11,6 +11,12 @@ const byteRetentionSchema = z.strictObject({
unknown_size_frames: z.number().int().nonnegative().optional(),
});
const enumerationOmissionReasonSchema = z.enum([
"identity_changed",
"directory_unavailable",
"entry_unavailable",
]);
/** Filesystem enumeration and whole-file digest coverage for one checkpoint. */
export const filesystemCoverageSchema = z.strictObject({
files_limit: z.number().int().nonnegative(),
@@ -20,14 +26,13 @@ export const filesystemCoverageSchema = z.strictObject({
z.enum([
"files_limit",
"depth_limit",
"identity_changed",
"directory_unavailable",
...enumerationOmissionReasonSchema.options,
]),
),
enumeration_omissions: z.array(
z.strictObject({
path: z.string(),
reason: z.literal("directory_unavailable"),
reason: enumerationOmissionReasonSchema,
system_code: z.string().nullable(),
}),
),