Skip to content

fix(glossary): same-id sources silently overwrite, hiding duplicates from validate and contradiction scan #24

@prakashUXtech

Description

@prakashUXtech

What

Two glossary sources whose basenames collide derive the same article id and write the same wiki/<id>.md, so the second build silently overwrites the first. Example: glossary/pocket.md and docs/glossary/pocket.md (or any glossary file without an explicit id) both derive id = "pocket".

Why it matters

glossary validate's duplicate-term check runs over listArticles, which only ever sees the survivor of an overwrite — so it cannot catch a same-id duplicate. The cross-source contradiction scan (#19) inherits the same blind spot: it dedupes candidates on nameKey + sourceID, and same-id candidates share a sourceID, so a genuine conflict hidden behind an id collision never surfaces.

The distinct-id case (two different ids, same Term) is caught by both validate and the contradiction scan — that's the common one. This issue is specifically the same-id silent-overwrite case, which is already documented in the build hook comment as a known gap.

Fix options

  • Warn at build time when two sources resolve to the same id, or
  • Namespace glossary ids by source path so colliding basenames stay distinct.

Either closes the blind spot for both validate and the contradiction scan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions