fix(core): resolve root wikilinks by filename - #1272
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06755ff1bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
06755ff to
c6f4b07
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6f4b07b47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
c6f4b07 to
9bc6f25
Compare
Why
Root-level WikiLinks written as filename stems never reached the existing
.mdfallback. Directly edited vaults also commonly use hyphens, underscores, or different case in links, leaving otherwise valid relations unresolved when a note has a descriptive title and permalink.Closes #1253.
What changed
.mdfile-path retry for root-level identifiers, including uppercase extensionsImplementation notes
Exact permalink, title, and file-path identities retain precedence. The new alias lookup is deliberately last among strict link identity matches and does not guess when two canonical paths normalize to the same alias. Single resolution compares lightweight identity rows in Python because SQLite and Postgres do not share the same Unicode
lower()behavior; bulk resolution builds the equivalent project index once.Create-or-update writes use exact repository lookups only. This prevents a requested
alpha-note.mdcreate from moving or overwriting an existingalpha_note.mdnote before the alias collision exists.Testing
.venv/bin/python -m pytest -q --no-cov tests/services/test_upsert_entity_optimization.py tests/services/test_entity_service_disable_permalinks.py tests/services/test_link_resolver.py tests/services/test_bulk_link_resolver.py— 71 passedjust fast-checkjust doctorRisks and rollback
The link behavior is additive for previously unresolved links. Exact identifiers and canonical write identity are unchanged, and ambiguous aliases fail closed. Rollback is the single signed-off commit in this PR.