Skip to content

feat(kathodos): smart path sanitization for canonical storage (#160)#182

Merged
forkwright merged 1 commit intomainfrom
feat/kathodos-sanitization
Apr 13, 2026
Merged

feat(kathodos): smart path sanitization for canonical storage (#160)#182
forkwright merged 1 commit intomainfrom
feat/kathodos-sanitization

Conversation

@forkwright
Copy link
Copy Markdown
Owner

Summary

  • New sanitize module in kathodos with sanitize_component and sanitize_path matching the spec in docs/data/storage-layout.md
  • Unicode NFC normalization via unicode-normalization (already a transitive dep; added to workspace + kathodos deps)
  • Reserved chars (/ \ : * ? " < > |) replaced with -
  • Whitespace collapsed to single space, trimmed
  • Leading/trailing dots trimmed, leading dot removed (hidden file prevention)
  • 255-byte truncation at UTF-8 character boundaries (no split multi-byte chars)
  • Empty / all-whitespace / all-dots inputs fall back to "unnamed"
  • template.rs updated to use sanitize_component (replaces with - not _ as the old local fn did)
  • Pre-existing apotheke clippy violation fixed (bool-to-i64 using fallible conversion instead of infallible From)

Test plan

  • cargo test -p kathodos — 85 tests pass (20 new in sanitize module)
  • cargo clippy -p kathodos -- -D warnings — clean
  • cargo check --workspace — workspace compiles

Closes #160

Cross-platform filename sanitization: NFC normalization, reserved char
replacement, whitespace collapse, dot trimming, 255-byte truncation
with UTF-8 safety. Foundation for canonical import paths.

- New sanitize module with sanitize_component and sanitize_path
- unicode-normalization added as workspace dep (already transitive)
- template.rs updated to use sanitize_component (replaces with - not _)
- Pre-existing apotheke clippy violation fixed (bool→i64 infallible conv)

Closes #160
@forkwright forkwright force-pushed the feat/kathodos-sanitization branch from 2ce2401 to eeaa5c2 Compare April 13, 2026 06:53
@forkwright forkwright merged commit 8314d45 into main Apr 13, 2026
2 of 3 checks passed
@forkwright forkwright deleted the feat/kathodos-sanitization branch April 13, 2026 07:02
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.

taxis: smart path sanitization

1 participant