Breaking Changes

This document tracks every breaking change in dazzle_filekit. If you are updating a downstream tool across filekit versions, read this file top-to- bottom and apply each migration in order.

The rule for landing a breaking change is: never casually. A break requires

  1. A justification line in the relevant version section below.

  2. A migration path (new-alongside-old, deprecation warning, or compat shim).

  3. A grep across C:\code\ (and C:\code\claude-projects\) to find every caller, plus a commit updating each one in the same release window.

  4. An update to docs/api-stability.md removing the old symbol from the Locked tables (or adding the replacement).

  5. An update to tests/test_import_stability.py reflecting the new surface.

The session-logger incident on 2026-04-10 is the cautionary tale we keep citing: a rename of normalize_cross_platform_path silently broke four copies of log-command.py across claude-session-logger/. Do not repeat.


v0.5.0 – v0.5.3 (one behaviour change; otherwise additive)

Summary: No names removed and no signatures tightened. One function now does what its name always said, which changes its result for trees that hold junctions.

  • 0.5.0 – copy_tree_preserving_links keeps junctions. Through 0.4.3 it was shutil.copytree(symlinks=True), which keeps symlinks but treats a Windows junction as an ordinary folder: it walked in and copied whatever the junction pointed at. With the new default links="keep", a junction is recreated at the destination as a junction with the same target, and nothing behind it is read. If one cannot be recreated the copy raises shutil.Error, so a caller that removes the source after a successful copy never does so after a partial one.

    • Justification: the old result contradicted the function’s name and docstring. A tree holding a junction to a large folder (or a drive root) was copied in full, and the copy was no longer a link to it.

    • Migration: pass links="follow" to copy the contents as before; links="skip" leaves links out.

    • Callers (searched C:\code\ on 2026-11-19): one live consumer, dazzlecmd-lib’s safedel (core/safedel/_platform.py, _recover.py), which uses the default and relies on links being kept. The other hits are archived copies of dazzlecmd, not installed code.

  • 0.5.0 added portable (portable path keys), batch_layout.plan_batch, and normalize_cross_platform_path(expand=False) – additive.

  • 0.5.1 made PortablePathError also derive from dazzle-lib’s FileOperationError (it is still a ValueError, so except ValueError keeps working), and fixed \\?\UNC\... normalising to a relative path.

  • 0.5.2 fixed create_dest_path(path_style="absolute") for UNC sources; drive-letter destinations are byte-identical to 0.5.1.

  • 0.5.3 added locking.exclusive_lock / LockTimeoutError and portable.current_flavor() – additive.


v0.4.0 – v0.4.2 (additive, no breaks)

Summary: No names removed, no signatures tightened, no behaviour removed. Downstream tools need no changes.

  • 0.4.0 added the longpath module (Windows MAX_PATH shims via on-demand junctions). It went to a minor rather than a patch for risk class, not compatibility: it is the first module that creates and deletes filesystem objects, and a consumer taking a patch bump should not discover it can mint reparse points on their system drive. Nothing existing changed.

  • 0.4.1 was test- and guard-only: @win_only gating for POSIX CI legs, and a widened exception guard in shim_path. No API change.

  • 0.4.2 added is_device_path / POSIX_DEVICE_PATHS / WINDOWS_INVALID_NAMES, and fixed is_valid_path rejecting every forward-slash path on Windows. That fix is a behaviour correction, not a break — C:/code/project was previously reported invalid and now is not. A caller relying on the old (wrong) rejection would be relying on a bug.

Pinning note. docs/preservelib-integration.md previously advised dazzle-filekit>=0.3.0,<0.4 on the reasoning that “a future 0.4.0 may break again”. That prediction did not hold, and the cap now excludes every current release for no compatibility reason. Anything written against 0.3.x runs unchanged on 0.4.x.


v0.3.0 (clean break — migrations required)

Summary: 0.3.0 removed and renamed locked symbols without deprecation shims, and migrated every in-tree consumer in the same cycle. This was a deliberate exception to the rule at the top of this file: the rubric was coverage-completeness over backward-compatibility, and 0.3.0 had not shipped to PyPI when the changes landed, so no released contract broke mid-stream.

If you are updating a downstream tool from 0.2.x, these are the migrations:

Removed / renamed

Replacement

Notes

paths.normalize_path(p)

normalize_cross_platform_path(p, resolve=True)

link-following behaviour

paths.normalize_path_no_resolve(p)

normalize_cross_platform_path(p)

the default resolve=False is link-safe

paths.get_path_type(p)

paths.classify_fs_object(p)

identical behaviour, clearer name

utils.compat.get_drive_mappings()

unctools.converter.get_mappings() or UNCConverter().get_reverse_mappings()

folded into unctools ≥0.2.2 (stack V9); was never exported

Behaviour change, not a removal: is_unc_path became platform-independent — //server/share now returns True on every platform, where previously the forward-slash spelling was recognized only on some. This is a superset of the old behaviour, so no caller broke.

New required dependencies: dazzle-lib>=0.2.0 and unctools>=0.2.2. The optional [unctools] extra was removed. Note that unctools is declared but imported lazily — import dazzle_filekit still succeeds without it present.

Full per-symbol detail, including which external tool imported each one, is in docs/api-stability.md.


v0.2.4 (additive consolidation, no breaks)

Summary: Pure enrichment release. No names removed, no signatures tightened, no behavior removed. Downstream tools need no changes.

Added

  • utils.compat.is_wsl() – returns True when running inside WSL (checks WSL_DISTRO_NAME and /proc/version).

  • operations.atomic_write_text(path, content, *, encoding='utf-8') – tmp-file + os.replace atomic write.

  • operations.atomic_write_json(path, data, *, indent=2, sort_keys=False) – thin wrapper over atomic_write_text.

  • operations.copy_tree_preserving_links(src, dst, *, dirs_exist_ok=False) – shutil.copytree(symlinks=True) with reparse-point guard on Windows.

  • dazzle_filekit.metadata module – rich metadata capture/apply:

    • collect_file_metadata(path, *, include_acls=True, include_xattrs=True)

    • apply_file_metadata(path, metadata, *, skip_quarantine=True)

    • restore_windows_creation_time(path, ctime_float)

    • is_win32_available()

    • Internal _collect_unix_xattrs, _apply_unix_xattrs

  • platform.windows.detect_alternate_streams(path) – NTFS ADS enumeration via FindFirstStreamW (ctypes).

  • platform.windows.has_significant_ads(path) – returns True if any ADS exists that isn’t :Zone.Identifier.

  • New keyword-only parameters on existing functions (all default to the old behavior):

    • Phase 4 path functions – TBD during implementation.

Changed (behavior, not API)

  • collect_file_metadata(path) now returns a richer dict:

    • On Windows: includes security_descriptor_sddl, creation_time (high precision via pywin32.GetFileTime).

    • On Linux/macOS: includes xattrs dict.

    • Old fields (mode, mtime, atime, owner, group) unchanged.

    • Callers that read the dict by key are unaffected – new keys are additive.

  • apply_file_metadata(path, metadata) now honors the new fields when present. Old manifests without the new keys still restore correctly.

  • validation.is_junction(path) is fixed to use DeviceIoControl(FSCTL_GET_REPARSE_POINT) and correctly returns True only for mount-point reparse tags. Previously it silently returned False for everything (the win32file.FILE_ATTRIBUTE_REPARSE_POINT constant it referenced doesn’t exist, and the bare except clause swallowed the AttributeError). This is a bug fix, not an API break – no caller could have been relying on the broken behavior, because it was broken.

  • Path normalizers (normalize_path_no_resolve, normalize_cross_platform_path) each gain the capabilities the other had, unifying their feature sets. See Phase 4 target list below.

NOT changed (locked)

  • All top-level symbol names in docs/api-stability.md.

  • All positional parameters on existing functions.

  • All return types on existing functions (dicts may grow keys; callers reading specific keys are unaffected).

New dependency

  • pywin32 ; sys_platform == "win32" – required for SDDL ACL handling, SetFileTime ctime restoration, DeviceIoControl junction detection, and FindFirstStreamW ADS enumeration. pywin32 installs without admin for non-admin users.

Phase 4 path-normalization targets (fixpath edge-case catalog)

dazzlecmd/projects/core/fixpath/fixpath.py:fix_path() handles a superset of what filekit’s path normalizers do today. Phase 4 will pull the following into filekit’s normalize_path_no_resolve and normalize_cross_platform_path:

Edge case

Today in filekit?

Target

MSYS /c/Users/...

both functions

keep

WSL /mnt/c/Users/...

only normalize_cross_platform_path

add to normalize_path_no_resolve

MSYS-mangled WSL C:\Program Files\Git\mnt\c\...

no

add to both

Extended-length \\?\ prefix

only normalize_path_no_resolve

add to normalize_cross_platform_path

Extended UNC \\?\UNC\server\share

no

add

Forward-slash UNC //server/share

no

add

Tilde ~/foo

only normalize_path_no_resolve

add to normalize_cross_platform_path

Env vars %USERPROFILE%, $HOME

no

add to both (documented)

Relative path → absolute (no follow)

only normalize_path_no_resolve

add to normalize_cross_platform_path

os.path.normpath collapsing

only normalize_path_no_resolve

add to normalize_cross_platform_path

Surrounding quotes/backticks

no

NOT added (stays in fixpath’s CLI layer)

cmd.exe > prompt artifact

no

NOT added (CLI-layer concern)

URL-decoded %20

no

NOT added (CLI-layer concern)

PowerShell PS prefix

no

NOT added (CLI-layer concern)

Trailing shell artifacts $#

no

NOT added (CLI-layer concern)

The split rule: filekit handles cross-platform path formats; fixpath handles human input noise. Anything a program writes to disk or passes between systems belongs in filekit; anything a human pastes into a terminal stays in fixpath.


Future breaks (uncommitted)

None currently planned. Any future rename/removal must be proposed here with a migration plan before landing.