Commit Graph
6 Commits
Author SHA1 Message Date
terminarandClaude Opus 5.5 72b656262d TODO: point remaining application migrations at the meta-repo's TODO-pathchange.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:54:07 +02:00
terminarandClaude Sonnet 5 da2ec85381 Refine macOS/LogAlias platform tuning, fix a real WithRoot bug found on Windows
Platform tuning:
- macOS Desktop's RuntimeDir() now prefers $TMPDIR (the OS-managed,
  per-user ephemeral directory NSTemporaryDirectory() returns) over
  the previous ~/Library/Application Support/<App>/Runtime placeholder.
- Resolver.EnsureLogAlias() creates the optional LogAliasDir() symlink
  to LogDir(), idempotently, leaving any pre-existing entry alone.

Verified the SHGetKnownFolderPath fallback (knownfolders_windows.go)
on a real Windows host for the first time: with APPDATA/LOCALAPPDATA/
PROGRAMDATA all unset, it correctly resolves the real known folders.
go vet's one unsafeptr finding there is a documented, permanent,
unavoidable characteristic of this raw-syscall pattern, not a bug.

That same real-Windows run surfaced a genuine, previously-invisible
bug: WithRoot assumed root's own address family always matched the
*simulated* platform's, which silently broke (mixed separators, or an
outright invalid mid-path drive letter) whenever the real host's
native family differed from what WithPlatform was simulating -- e.g.
WithPlatform("linux") with WithRoot(t.TempDir()) on a real Windows
host. This was invisible on macOS/Linux, where t.TempDir() happens to
already share the simulated Unix family.

Fixed applyRoot (now applyRootRebase) to decompose the resolved path
into segments and re-join them onto root using root's own family,
inferred from its content like JoinDirFile already does, not from the
simulated platform. Two call sites chaining onto an already-rooted
value (logDirUnix, darwin.go's State/Runtime fallback) switched from a
hardcoded unixJoin to JoinDirFile for the same reason. core/config's
working-directory layer had the identical bug one level up; fixed via
a new paths.JoinDirFileFamily.

TODO.md/ARCHITECTURE.md/README.md updated accordingly; core/TODO.md's
remaining items are now all explicitly out-of-scope or deliberately
deprioritized, not open work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 16:37:30 +02:00
terminarandClaude Sonnet 5 e6b5324ad3 TODO: mark the yet core/paths migration done
yet's internal/store now resolves Home/CacheHome/BinDir via
core/paths (Application{Name: "yet", Kind: core.CLI}) instead of its
own $YETANO_HOME/os.UserConfigDir() logic, split across three
independently overridable categories. See yetano.dev/yetano/yet's
own commit for the actual migration and its new --system scope flag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 15:14:58 +02:00
terminarandClaude Sonnet 5 689469eb32 config: add WithExplicitPath for a CLI's own --config flag
A highest-priority, must-exist override layer above the working
directory -- the common "flag always wins, but a typo'd path should
fail loudly" pattern most Yetano CLIs need, generalized here instead
of reimplementing it in each application (first consumer: yet's own
--config flag, see the yet submodule).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 16:50:22 +02:00
terminar 13801bec11 Add platform-independent path/config resolution library
Implements core/paths (Config/Data/State/Cache/Runtime/Log/Bin
directory resolution with canonical-vs-search-dir separation, XDG on
Unix, native APPDATA/LOCALAPPDATA/PROGRAMDATA layering on Windows,
~/Library on macOS Desktop, injectable environment/platform for
deterministic cross-platform tests) and core/config (file search,
first-match resolution, layered YAML merging, safe ${VAR} expansion,
Explain/doctor introspection) on top of the shared Application/
Kind/Scope model in the core package.
2026-09-19 16:26:01 +02:00
terminar 027b327c3d Initial commit 2026-09-19 15:56:59 +02:00