feat(logging): route all core binaries to shared native log dir#315
Merged
Conversation
Replace three independent log-dir implementations with one shared helper, `uffs_security::log_dir`. Fixes the broken `~/bin/uffs/logs` default in uffs-mft (writing logs under the installed `uffs` binary file failed with "Not a directory"), and moves uffsd / uffsmcp / mcp-gateway off the cache dir onto per-OS native log locations: - macOS: ~/Library/Logs/uffs (read by Console.app) - Windows: %LOCALAPPDATA%\uffs\logs (== data_local_dir) - Linux: $XDG_STATE_HOME/uffs/logs, else ~/.local/state/uffs/logs `UFFS_LOG_DIR` overrides the directory for every binary (matches the products-repo TUI); MCP's explicit `UFFS_LOG_FILE` still takes precedence as a finer-grained knob. All binaries share one base dir, each keeping its distinct filename, so logs co-locate in Console.app / journald. The helper lives in uffs-security because it is the sole common dependency of all three log writers and already owns platform-path logic (keystore, runtime_dir) plus the dirs_next dep. uffs-mcp drops its now-unused direct dirs-next dep and gains a direct uffs-security dep. Linux XDG state home is resolved by hand (no dirs_next state_dir), honoring absolute XDG_STATE_HOME only, per the XDG spec. Verified: workspace clippy --all-features clean; 424 tests pass (incl. new log_dir tests); runtime check on macOS confirms uffsd writes ~/Library/Logs/uffs/uffsd.log, data/PID files stay in App Support, and UFFS_LOG_DIR redirects as expected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ut criterion met) Flip the first §3 cut criterion to checked and fill the bake-day log table (Day 1–14, 2026-05-15 → 05-28) with per-day Mac/Windows results and RPC-timing means. Two single-step transient flakes (05-16 mac N6 tier, 05-17 win forget) logged-and-continued per §2; neither repeated, so the bake clock held. Seven both-platforms-green days reached (05-18, 19, 22, 24, 25, 27, 28). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces three independent, divergent log-directory implementations in the core binaries with a single shared helper,
uffs_security::log_dir. Fixes the broken~/bin/uffs/logsdefault (writinglogs/under the installeduffsbinary file failed withNot a directory), and moves all binaries onto per-OS native log locations.uffs-mft~/bin/uffs/logs❌uffsd<data_local_dir>/uffs/uffsd.log<native>/uffsd.loguffsmcp<data_local_dir>/uffs/uffs_mcp.log<native>/uffs_mcp.loguffs-mcp-http<data_local_dir>/uffs/mcp-gateway.log<native>/mcp-gateway.logNative per-OS locations (the directory each OS expects for logs):
~/Library/Logs/uffs(read by Console.app)%LOCALAPPDATA%\uffs\logs(==dirs data_local_dir)$XDG_STATE_HOME/uffs/logs, else~/.local/state/uffs/logsDesign
uffs-security— the sole common dependency of all three log writers, already owns platform-path logic (keystore,runtime_dir) and thedirs_nextdep. No new dependency edges exceptuffs-mcpswapping its now-unused directdirs-nextfor a directuffs-security.UFFS_LOG_DIRoverrides the directory for every binary (identical to the products-repo TUI). MCP's explicitUFFS_LOG_FILE(a full file path) still takes precedence as a finer-grained knob. Precedence:UFFS_LOG_FILE>UFFS_LOG_DIR> native >./logs.dirs_next::state_dir()), honoring absoluteXDG_STATE_HOMEonly, per the XDG spec. The pure decision is split into a testablexdg_state_home(raw, home)to avoidunsafeenv mutation in tests.Verification
cargo clippy --workspace --all-featurescleanlog_dirtests asserting the exact~/Library/Logs/uffspath)uffsdwrites~/Library/Logs/uffs/uffsd.log; data/PID files correctly stay in App Support;UFFS_LOG_DIRredirects as expected.Note: unrelated doc commit included
This branch carries one unrelated commit —
docs(soak): record 7 consecutive both-platforms-green bake-days— a pre-existing uncommitted working-tree change for the memory-tiering bake gate that was sitting in the repo when this work started. It is intentionally a separate, clearly-labeled commit; it does not touch any code.🤖 Generated with Claude Code