Skip to content

feat(paths): coordinate XDG-first Zi defaults and legacy migration #553

Description

@ss-o

Outcome

Make Zi resolve fresh/default storage through the XDG Base Directory model while preserving existing legacy installations and coordinating every affected repository.

Current evidence

  • z-shell/zi next at 6f0eda7158289c0d6bd8f29ea589691f6a34d80e chooses $HOME/.zi whenever HOME exists. Its cache and config selection can also override explicitly set XDG variables based on directory existence.
  • z-shell/src main at 5f527697e82534d07227f1be79ba0eb85c3fcec6 already defaults to ${XDG_DATA_HOME:-$HOME/.local/share}/zi, ${XDG_CACHE_HOME:-$HOME/.cache}/zi, and ${XDG_CONFIG_HOME:-$HOME/.config}/zi.
  • The canonical wiki documents the XDG data-home default.
  • An isolated Zsh diagnostic confirmed that sourcing the core directly and loading through the published loader select different roots under the same environment.
  • No open issue or pull request explicitly tracking this unification was found on 2026-08-28.

Approved design boundary

  1. Explicit ZI[...] path values remain highest precedence.
  2. A detected legacy installation remains on $HOME/.zi; no automatic relocation occurs.
  3. Fresh/default resolution uses valid absolute XDG variables and the specification defaults.
  4. Zi creates missing destination directories instead of requiring their parents to exist.
  5. Relative XDG values are invalid and ignored.
  6. ZDOTDIR is not used as an application data, cache, or configuration root.
  7. XDG_ZI_* compatibility outputs must not become a second ambiguous input API.
  8. Migration, persistent state/log classification, installer alignment, documentation, and zpmod compatibility remain explicitly tracked deliverables.

Target defaults

Zi field Default
ZI[HOME_DIR] ${XDG_DATA_HOME:-$HOME/.local/share}/zi
ZI[CACHE_DIR] ${XDG_CACHE_HOME:-$HOME/.cache}/zi
ZI[CONFIG_DIR] ${XDG_CONFIG_HOME:-$HOME/.config}/zi
ZPFX ${ZI[HOME_DIR]}/polaris
ZI[ZCOMPDUMP_PATH] ${ZI[CACHE_DIR]}/.zcompdump

Coordination requirements

  • Use native sub-issues for each repository-owned deliverable.
  • Preserve installer security validation and self-update/reload behavior.
  • Add observable path-resolution coverage, including legacy-only, XDG-only, both-present, unset/empty, invalid-relative, missing-parent, spaces, and explicit override cases.
  • Treat this as a public behavior change and document migration before release.
  • Keep source implementation, commits, pushes, pull requests, and release work separately authorized.

Next action

Finalize the core resolver contract in the Zi implementation sub-issue, then implement it with focused behavior tests before reconciling dependent repositories.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:metaOrganization-wide policy, templates, or meta-repo work.area:ziZi core behavior, APIs, or documentation.breaking-changeBreaks backward compatibility or changes a public contract.meta:org-trackedIndicates this issue has cross-repository tracking implications (synced to Linear).type:featureA request for new behavior or capability.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions