Commit a7a06ed
committed
fix(compiler): resolve entity-page review findings (dangling links + dedup)
Addresses code-review findings on the entity-pages feature:
- Fix dangling wikilink after `openkb remove`: entity removal now strips
standalone `See also: [[summaries/{doc}]]` lines (the related-entity
backlink form), matching the concept path, and cli.py adds modified
entity pages to the lint sweep scope so surviving pages are cleaned.
- Unify the parallel concept/entity helpers into shared cores
(_backlink_summary_pages, _backlink_pages, _remove_doc_from_pages) with
thin per-type wrappers, so cleanup logic can no longer drift between the
two page types (this is what caused the dangling-link bug).
- Route related-entity cross-refs through _add_related_link (now page-type
aware) instead of an inline reimplementation — removes a duplicate file
read/write and keeps backlink creation symmetric with teardown.
- Centralize the entity-type enum: prompts derive their type list from a
single _ENTITY_TYPE_LIST source via import-time substitution.
- Count entity items in the "all dropped as malformed" plan warning.
- Drop the unreachable else branch in _update_index's entity loop.
- Add regression test for the See-also strip on a surviving entity page.
All 542 tests pass.1 parent ff3fafb commit a7a06ed
3 files changed
Lines changed: 165 additions & 149 deletions
0 commit comments