Skip to content

fix(artifact): refuse file and directory ZIP collisions - #406

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-362-directory-collision-diagnostic
Oct 14, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-362-directory-collision-diagnostic

Conversation

@StepenkoAnatoli

@StepenkoAnatoli StepenkoAnatoli commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Fixes #362.

what changed: ZIP inspection detects a regular file used as another entry's directory prefix, independent of entry order, before inflation or materialization. Explicit file/directory name collisions are refused with ZIP-PATH-COLLISION.

why: A readable, structurally contradictory package was reported as BLOCKED after a raw EEXIST during extraction, exposing a temporary path and suggesting a kit bug. It now receives a stable FAIL with a package-path diagnostic.

what it touched: artifact-zip, two artifact-validator collision fixtures, the architecture map, changelog and test inventory.

what you verified: verified — the two new fixtures reproduced the defect; all 47 artifact-validator tests passed after the fix, including diagnostics free of private paths and raw filesystem errors. Architecture-map passed 21 tests. Handoff, preflight and doctor passed. The normal full commit gate allowed 40f7f7f. All seven GitHub CI jobs passed on this exact head: offline-suite run.

what you got wrong and fixed: mistake — the initial diagnostic assertion used the wrong temporary-directory prefix. where — artifact-validator collision regression. impact — it did not independently catch the real extraction path; the status and collision-code assertions still caught the baseline defect, and no delivered PR was affected. cause — the prefix was assumed. fix — check the actual rk-artifact- prefix, scratch path and raw EEXIST/ENOTDIR wording. verified — all 47 validator tests passed.

what changed: ZIP inspection now detects a regular file used as another entry's parent directory, independent of entry order, before any inflation or materialization. Explicit file/directory name collisions also receive ZIP-PATH-COLLISION. Added two validator fixtures with stable FAIL results and diagnostics that contain no private temp path or raw filesystem error.

why: A readable, self-contradictory archive should be FAIL; it previously threw EEXIST during materialization and became BLOCKED with a temporary path and a misleading kit-bug remedy (#362). This applies the existing structural ZIP refusal boundary. No alternative design was set aside.

what it touched: artifact-zip inspection, artifact-validator fixtures, the artifact-zip architecture row, changelog and README test inventory. No schema, public option or exit-code mapping changed.

what you verified: verified - red-first 45 passed and two expected collision failures; then 47 artifact-validator tests passed. The final strengthened diagnostics assertion passed in 35.2 seconds. Architecture-map 21 passed; handoff OK (33 ledger entries, 27 evidence rows), preflight PASS (28 passing, one warning, no blockers), doctor READY collector/firecrawl-cli. The issue's artifact-zip test group has no file in this tree; its ZIP regressions are in artifact-validator. The required full offline suite runs in the commit gate before acceptance.

what you got wrong and fixed: mistake - the initial temp-path assertion searched for research-kit-artifact- instead of the actual rk-artifact- prefix. where - artifact-validator.test.mjs collision diagnostic assertion. impact - the assertion did not independently detect the real private extraction path; the FAIL/status and ZIP-PATH-COLLISION checks still caught the baseline defect, and no delivered PR was affected. cause - the prefix was written without checking materializeProject. fix - check the actual scratch directory and rk-artifact- prefix, plus EEXIST/ENOTDIR, in all diagnostic messages and remedies. verified - all 47 artifact-validator tests passed in 35.2 seconds.
@StepenkoAnatoli
StepenkoAnatoli merged commit 0dc3ff0 into main Oct 14, 2026
7 checks passed
@StepenkoAnatoli
StepenkoAnatoli deleted the fix/issue-362-directory-collision-diagnostic branch October 14, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A package holding a file and a directory of the same name is BLOCKED with a raw EEXIST naming the temp path and 'report this package'

1 participant