From 24fe206b567f3e10a71dcddba58cef6ea70850b0 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Mon, 27 Jul 2026 17:42:52 +1000 Subject: [PATCH] G-126 progress: directory-mtime restoration landed upstream (v2.3.1) Upstream punkzip 0882f03 fixes the long-standing dir-mtime limitation via a deferred post-extraction stamping pass (windows direct CreateFileW BACKUP_SEMANTICS + SetFileTime; Io best-effort elsewhere), pinned by tests at the stored epoch including the -d route and the build roundtrip. Notes bullet updated from proven-fixable to fixed. Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com --- goals/G-126-punkzip-accelerator.md | 39 +++++++++++++++++------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/goals/G-126-punkzip-accelerator.md b/goals/G-126-punkzip-accelerator.md index e42e6b14..ec4a2def 100644 --- a/goals/G-126-punkzip-accelerator.md +++ b/goals/G-126-punkzip-accelerator.md @@ -172,23 +172,24 @@ working tree; one now exists. synchronous and unaffected. - Timestamp behaviour on extraction, measured 2026-07-27 (info-zip fixture, stored DOS - time 2021-10-06 01:50:08): FILE mtimes are preserved exactly (epoch 1633485008, - identical between the current v2.3.0 exe and the old Nov-2024 v2.1.0 exe - no - regression through the 0.15/0.16 ports; the set-timestamps-before-write order does - not get stomped on Windows). File atimes and DIRECTORY mtimes are NOT preserved - (both read as extraction time; the dir case is the long-standing zig limitation the - extract output flags with "UNABLE TO SET MTIME ON FOLDER" - zig 0.16 Io still cannot - do it: read-only dir handles lack FILE_WRITE_ATTRIBUTES and write-mode dir opens - return error.IsDir). PROVEN FIXABLE in punkzip: direct - CreateFileW(FILE_FLAG_BACKUP_SEMANTICS, FILE_WRITE_ATTRIBUTES) + SetFileTime on the - directory works (verified read-back exact); a proper fix stamps directories in a - deferred pass AFTER their contents are extracted, since creating children updates - the parent's mtime. SEMANTICS NOTE for the parity suite: punkzip interprets the - zone-less DOS timestamp as UTC (deterministic, tz-free, and build->extract - roundtrips exactly); bsdtar instead honours Info-ZIP's UT extra field (true UTC), - so third-party comparisons can differ by the creator's tz offset (2h on this - fixture, made in UTC+2). Compare mtimes via the raw dostime or via punkzip's - UTC-interpretation convention, never via a local-time conversion. + time 2021-10-06 01:50:08): FILE mtimes preserved exactly (epoch 1633485008, + identical between the v2.3.x exes and the old Nov-2024 v2.1.0 exe - no regression + through the 0.15/0.16 ports; the set-timestamps-before-write order does not get + stomped on Windows). File atimes read as extraction time (cosmetic). DIRECTORY + mtimes were NOT preserved - the long-standing zig limitation ("UNABLE TO SET MTIME + ON FOLDER"; zig 0.16 Io still cannot do it: read-only dir handles lack + FILE_WRITE_ATTRIBUTES and write-mode dir opens return error.IsDir) - and this is + now FIXED in punkzip v2.3.1 (upstream 0882f03, user-directed): directory members + are stamped in a deferred pass AFTER their contents exist (child creation bumps the + parent's mtime), on windows via direct CreateFileW(FILE_FLAG_BACKUP_SEMANTICS, + FILE_WRITE_ATTRIBUTES) + SetFileTime, best-effort via Io elsewhere; pinned by tests + at the stored epoch, including through the -d joined-path route and the + build->extract roundtrip (DOS 2-second granularity). SEMANTICS NOTE for the parity + suite: punkzip interprets the zone-less DOS timestamp as UTC (deterministic, + tz-free, and build->extract roundtrips exactly); bsdtar instead honours Info-ZIP's + UT extra field (true UTC), so third-party comparisons can differ by the creator's + tz offset (2h on this fixture, made in UTC+2). Compare mtimes via the raw dostime + or via punkzip's UTC-interpretation convention, never via a local-time conversion. ## Progress @@ -237,6 +238,10 @@ working tree; one now exists. directories - the scanner's file-vs-dir probe silently recorded directories as empty files until opens passed `.allow_directory = false` (guard also added to list/extract file opens). +- 2026-07-27 directory-mtime restoration landed upstream (user-directed; commit + 0882f03, punkzip v2.3.1, suite 130/130): extract now restores directory mtimes via + the deferred stamping pass described in Notes; the "(Making dir: ...)" output line + lost its UNABLE-TO-SET-MTIME suffix and the CLI tests pin the restored times. - Remaining for acceptance: vendor into `src/tools/punkzip/` with provenance (upstream commit id), re-vendor procedure and licence records; make.tcl tool build step (zig OPTIONAL - absence reported, not fatal; test gate keys on exit code, not