Skip to content

fix(config): harden resolved path serialization - #692

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/688-config-path-serialization
Aug 10, 2026
Merged

fix(config): harden resolved path serialization#692
github-actions[bot] merged 2 commits into
mainfrom
fix/688-config-path-serialization

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

Closes #688.

Harden coven config paths --json so its version 1 contract never labels lossy or relative path strings as resolved.

  • resolve Windows drive-relative inputs with platform-aware semantics
  • fail closed when a path cannot become absolute or cannot be represented exactly as UTF-8
  • fail closed atomically for multi-path surfaces instead of returning partial output
  • preserve environment/configuration source attribution on unresolved rows
  • remove lossy HOMEDRIVE + HOMEPATH source comparison
  • document the UTF-8 and multi-path behavior

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --locked
  • cargo test -p coven-cli config_paths::tests --locked
  • cargo test -p coven-cli --test config_paths --locked
  • python3 scripts/check-secrets.py
  • python3 scripts/check-coven-privacy.py --range origin/main...HEAD

All passed at 14fcf57. The full workspace suite was rerun from a short exact-head worktree because two unrelated memory-import socket tests exceed Unix SUN_LEN under the longer familiar workspace path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 04:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the coven config paths --json (schema coven.config.paths v1) output so that “resolved” paths are always absolute and losslessly representable as UTF-8, failing closed for single- and multi-path surfaces when that contract can’t be met.

Changes:

  • Replace lossy Path::display().to_string() serialization with a lossless to_str() gate, reporting affected surfaces as unresolved when UTF-8 cannot be represented exactly.
  • Make multi-path surfaces fail closed atomically (no partial paths output) and preserve the originating source when failing.
  • Update CLI documentation and add integration coverage for non-Unicode environment-provided paths.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
docs/reference/cli-config.md Documents the UTF-8 losslessness rule, atomic failure for multi-path surfaces, and platform-aware relative resolution semantics.
crates/coven-cli/tests/config_paths.rs Adds an integration test ensuring non-Unicode env paths cause unresolved output without partial/lossy paths.
crates/coven-cli/src/config_paths.rs Implements lossless resolved path serialization, atomic multi-path handling, source-preserving unresolved rows, and Windows drive-relative resolution via platform semantics.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/coven-cli/src/config_paths.rs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BunsDev BunsDev self-assigned this Aug 9, 2026
@github-actions
github-actions Bot merged commit 130d0c4 into main Aug 10, 2026
13 checks passed
@github-actions
github-actions Bot deleted the fix/688-config-path-serialization branch August 10, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): harden resolved path serialization

2 participants