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
- Explicit
ZI[...] path values remain highest precedence.
- A detected legacy installation remains on
$HOME/.zi; no automatic relocation occurs.
- Fresh/default resolution uses valid absolute XDG variables and the specification defaults.
- Zi creates missing destination directories instead of requiring their parents to exist.
- Relative XDG values are invalid and ignored.
ZDOTDIR is not used as an application data, cache, or configuration root.
XDG_ZI_* compatibility outputs must not become a second ambiguous input API.
- 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
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/zinextat6f0eda7158289c0d6bd8f29ea589691f6a34d80echooses$HOME/.ziwheneverHOMEexists. Its cache and config selection can also override explicitly set XDG variables based on directory existence.z-shell/srcmainat5f527697e82534d07227f1be79ba0eb85c3fcec6already defaults to${XDG_DATA_HOME:-$HOME/.local/share}/zi,${XDG_CACHE_HOME:-$HOME/.cache}/zi, and${XDG_CONFIG_HOME:-$HOME/.config}/zi.Approved design boundary
ZI[...]path values remain highest precedence.$HOME/.zi; no automatic relocation occurs.ZDOTDIRis not used as an application data, cache, or configuration root.XDG_ZI_*compatibility outputs must not become a second ambiguous input API.Target defaults
ZI[HOME_DIR]${XDG_DATA_HOME:-$HOME/.local/share}/ziZI[CACHE_DIR]${XDG_CACHE_HOME:-$HOME/.cache}/ziZI[CONFIG_DIR]${XDG_CONFIG_HOME:-$HOME/.config}/ziZPFX${ZI[HOME_DIR]}/polarisZI[ZCOMPDUMP_PATH]${ZI[CACHE_DIR]}/.zcompdumpCoordination requirements
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