Skip to content

fix(consolidate): make slugified page paths pass ensure_portable - #1430

Merged
akitaonrails merged 4 commits into
akitaonrails:mainfrom
kevin9327:fix/slugify-portable-components
Oct 19, 2026
Merged

akitaonrails merged 4 commits into
akitaonrails:mainfrom
kevin9327:fix/slugify-portable-components

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

What changed

slugify_page_path (ai-memory-consolidate/src/path_sanitize.rs) now also fixes the two component shapes PagePath::ensure_portable refuses that character replacement doesn't cover:

Model path main now
notes/v2./roadmap.md notes/v2./roadmap.md (ends with a dot) notes/v2/roadmap.md
notes/q3 plan /roadmap.md unchanged (ends with a space) notes/q3 plan/roadmap.md
decisions/why? /x decisions/why- /x.md decisions/why-/x.md
concepts/aux.md unchanged (DOS device aux) concepts/aux-.md
CON/notes.md unchanged CON-/notes.md

Trailing dots/spaces are trimmed (a component made only of dots or spaces is left for PagePath::new to reject, as before). A DOS device stem gets a - after the stem, using ai_memory_core::ids::is_dos_device_name, the same check ensure_portable applies.

Why

The helper's doc says it cleans a model path "so it survives PagePath::new and ensure_portable", because Wiki::apply_batch is atomic: one path that fails ensure_portable aborts every page in a bootstrap or consolidation batch (#847, #848), and auto-improve turns it into an unapplyable proposal. Replacing <>:"|?*\ and control bytes left these two refusals reachable. Replacing ? can itself create one: why? becomes why- , which ends with a space.

Tests

New slugify_page_path_output_passes_ensure_portable asserts the cleaned path and that PagePath::new(..).ensure_portable() accepts it.

  • With the new mapping disabled: assertion left == right failed: "notes/v2./roadmap.md".
  • With the fix: cargo test -p ai-memory-consolidate --lib 509 passed; cargo fmt --check and cargo clippy --all-targets -D warnings clean on the crate.

CHANGELOG entry under Unreleased → Fixed.

AI assistance: this change was prepared with an AI coding assistant and reviewed and tested by me.

@akitaonrails
akitaonrails merged commit 116076e into akitaonrails:main Oct 19, 2026
27 checks passed
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.

2 participants