Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
777b04a
feat(artifacts): add dry-run extraction plan without destination writ…
hannesstrydom664-hash Oct 25, 2026
47f478c
fix(artifacts): address dry-run extraction plan review feedback (#5489)
hannesstrydom664-hash Oct 25, 2026
93c3ab3
fix(artifacts): preserve unknown mount case sensitivity and use desti…
hannesstrydom664-hash Oct 26, 2026
74029e0
fix(artifacts): handle hardlinked entries and leave non-ASCII case fo…
hannesstrydom664-hash Oct 26, 2026
77f9884
fix(artifacts): bound case-sensitivity probes and observe Windows dir…
hannesstrydom664-hash Oct 26, 2026
545c4e3
fix(artifacts): verify dry-run directory freshness, over-limit paths,…
hannesstrydom664-hash Oct 26, 2026
20ae0c4
fix(artifacts): resolve canonical output path limits and full Unicode…
hannesstrydom664-hash Oct 26, 2026
a0bf542
fix(artifacts): revalidate unpacked ASAR companions and qualify unres…
hannesstrydom664-hash Oct 26, 2026
8f417b4
fix(artifacts): reconcile non-file entries against the inventory snap…
hannesstrydom664-hash Oct 26, 2026
041f0ef
fix(artifacts): scope non-file reconciliation to active reader and ve…
hannesstrydom664-hash Oct 26, 2026
f2305a1
fix(artifacts): distinguish limitation-only non-file drift and select…
hannesstrydom664-hash Oct 26, 2026
4c411c0
fix(artifacts): reject unpaired UTF-16 destination paths and probe co…
hannesstrydom664-hash Oct 26, 2026
38a8e9d
docs(artifacts): document dry_run extraction planning and share limit…
hannesstrydom664-hash Oct 26, 2026
e37d5ef
fix(extraction): revalidate dry-run ZIP bytes, bound component probes…
hannesstrydom664-hash Oct 26, 2026
2f987e4
fix(extraction): guard transferred ZIP source and cancel after final …
hannesstrydom664-hash Oct 27, 2026
e29807d
fix(artifacts): unify dry-run plan paging cache, byte budgets, and po…
hannesstrydom664-hash Oct 27, 2026
8facdbb
fix(artifacts): budget raw dry-run occurrence limitations and skip en…
hannesstrydom664-hash Oct 27, 2026
0ffad06
Merge remote-tracking branch 'origin/main' into feat/artifact-extract…
hannesstrydom664-hash Nov 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(artifacts): reconcile non-file entries against the inventory snap…
…shot in dry-run
  • Loading branch information
hannesstrydom664-hash committed Oct 27, 2026
commit 8f417b44a03871b057a33107428cfc1b25b73319
30 changes: 30 additions & 0 deletions src/artifacts/extraction/ArtifactExtraction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,36 @@ it("plans dry-run extraction with unresolved/unsupported entries and labeled byt
expect(planned.extraction_manifest.selected_occurrence_ids).toEqual(
materialized.extraction_manifest.selected_occurrence_ids,
);
expect(planned.limitations).not.toContain(
"Non-file inventory entries were not fully reconciled with the live reader; affected directory, symlink, and metadata facts remain unresolved.",
);
} finally {
await resourceScope.close();
}
});

it("reconciles non-file directory and symlink entries against the inventory snapshot in dry-run mode", async () => {
const directory = await createTestTempDirectory(
"rea-extraction-dry-run-non-file-reconcile-",
);
const source = join(directory, "source");
await mkdir(join(source, "empty-dir"), { recursive: true });
await writeFile(join(source, "alpha.txt"), "alpha");
await symlink("alpha.txt", join(source, "alias.txt"));
const resourceScope = new ArtifactResourceScope();
try {
const stablePlan = await extractArtifact({
inputPath: source,
inputFormat: "asar",
outputRoot: join(directory, "stable-dry-out"),
dryRun: true,
environment: {},
integrityPolicy: "fail",
resourceScope,
});
expect(stablePlan.limitations).not.toContain(
"Non-file inventory entries were not fully reconciled with the live reader; affected directory, symlink, and metadata facts remain unresolved.",
);
} finally {
await resourceScope.close();
}
Expand Down
39 changes: 38 additions & 1 deletion src/artifacts/extraction/ArtifactExtraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ const materializeSelection = async ({
zipSource !== undefined || reader.prepareContainer !== undefined;
unresolvedPlan = await planSelectedEntries({
reader,
inventory,
outputRoot: resolvedOutputRoot,
platform,
caseSensitivity: destinationCaseSensitivity,
Expand Down Expand Up @@ -535,6 +536,7 @@ const verifyPlannedEntry = async (

const planSelectedEntries = async ({
reader,
inventory,
outputRoot,
platform,
caseSensitivity,
Expand All @@ -545,6 +547,7 @@ const planSelectedEntries = async ({
signal,
}: {
readonly reader: ArtifactReader;
readonly inventory: ArtifactInventorySnapshot;
readonly outputRoot: string;
readonly platform: NodeJS.Platform;
readonly caseSensitivity: DestinationCaseSensitivity;
Expand All @@ -562,10 +565,31 @@ const planSelectedEntries = async ({
readonly selectedItem: SelectedOccurrence;
readonly destinationPath: string;
}[] = [];
const inventoriedNonFile = new Map(
inventory.occurrences
.filter(
(occurrence) =>
occurrence.logical_path !== "." &&
(occurrence.entry_kind === "directory" ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude nested non-files from live reconciliation

When inventory expansion found a directory or metadata occurrence inside a nested ASAR/ZIP, this map includes it even though the active reader deliberately stops at the containing regular file. A stable second traversal can therefore never add that nested path to observedNonFile, and the result falsely reports that the entry disappeared and that non-file facts were not reconciled; restrict expected non-files to occurrences exposed by the active reader's ancestry.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

occurrence.entry_kind === "symlink" ||
occurrence.entry_kind === "metadata"),
)
.map((occurrence) => [occurrence.logical_path, occurrence] as const),
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
);
const observedNonFile = new Set<string>();
const nonFileMismatches: string[] = [];
for await (const entry of reader.entries(signal, traversal)) {
const path = normalizeArtifactPath(entry.path);
readerRegistry.add(path, entry.kind);
if (entry.kind !== "file" && entry.kind !== "slice") continue;
if (entry.kind !== "file" && entry.kind !== "slice") {
observedNonFile.add(path);
if (!inventoriedNonFile.has(path)) {
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare non-file kinds during reconciliation

When an empty directory source entry is replaced by a symlink at the same path between inventory and the dry-run traversal, this path-only has succeeds, so no mismatch is emitted and the plan silently retains the stale directory status while claiming reader entries were validated. Fresh evidence after the earlier add/remove report is that the new reconciliation stores only the path in observedNonFile; compare the live entry.kind with the snapshot kind and mark a mismatch unresolved.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

nonFileMismatches.push(
`Newly observed ${entry.kind} entry ${path} is not in the inventory snapshot.`,
);
}
continue;
}
const selectedItem = byPath.get(path);
if (selectedItem === undefined) {
throw new ArtifactReaderFailure(
Expand Down Expand Up @@ -608,6 +632,13 @@ const planSelectedEntries = async ({
"integrity",
`Inventoried regular artifact entries were not materialized: ${[...byPath.keys()].sort(compareUnicodeCodePoints).join(", ")}`,
);
for (const [path, occurrence] of inventoriedNonFile) {
if (!observedNonFile.has(path)) {
nonFileMismatches.push(
`Inventoried ${occurrence.entry_kind} entry ${path} was not observed by the live reader.`,
);
}
}
const unresolvedByOccurrenceId = new Map<string, string>();
const limitations: string[] = [];
let hasCaseLimitation = false;
Expand Down Expand Up @@ -661,6 +692,12 @@ const planSelectedEntries = async ({
? "Destination directory case sensitivity is unknown because the destination parent has no observable cased entry; case-colliding paths remain unresolved in the dry-run plan."
: "Non-ASCII case-folding paths depend on the destination filesystem case table and cannot be verified without creating files; affected paths remain unresolved in the dry-run plan.",
);
if (nonFileMismatches.length > 0) {
limitations.push(
...nonFileMismatches,
"Non-file inventory entries were not fully reconciled with the live reader; affected directory, symlink, and metadata facts remain unresolved.",
);
}
return { byOccurrenceId: unresolvedByOccurrenceId, limitations };
};

Expand Down