Skip to content

fix(rules): schema/entity-conflicts excuses a verified localized url alias (#1615) - #1622

Closed
nc9 wants to merge 2 commits into
mainfrom
fix/entity-conflicts-localized-alias-1615
Closed

nc9 wants to merge 2 commits into
mainfrom
fix/entity-conflicts-localized-alias-1615

Conversation

@nc9

@nc9 nc9 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

What

One Service @id declared on reciprocal hreflang alternates, with the page's own url on each page, was reported as a url conflict. schema/entity-conflicts now excuses a url disagreement only when all of these hold (conservative, identity never inferred from names):

  • url is the node's only disagreement (besides @type, owned by entity-type-drift). A differing name, telephone, legal identifier or anything else keeps every row for that entity.
  • each url value is the address of one of the declaring pages;
  • every pair of pages with different values lists each other as hreflang alternates (reciprocal, any language, neither canonicalised elsewhere), read from the pages (v1) or the SiteQuery rows (streaming);
  • the node's provider, brand, publisher, creator, author, worksFor and member edges are on every one of those pages, to the same target;
  • no declaring page is hidden behind the map's page cap.

A verified alias is counted in details.localizedUrlAliases. Without reciprocal alternates the pair still warns.

Decision for review: legal identifiers

The entity map only compared nine properties, so a divergent vatID or legalName was never visible to this rule (it warned only through whatever else differed). To keep "divergent legal identifiers still warn" true once url is excused, the builder (packages/audit-engine/src/entity-map/build.ts) now also compares legalName, vatID, taxID, leiCode, duns and iso6523Code per node as extra conflicts properties (like @type, a free string; they are not stored in properties, no schema change). Registry numbers are compared without case, spaces, dots or hyphens; a page that omits one is not a disagreement. Side effect: those divergences now also show as their own entity-conflicts rows on any site. Say if you would rather keep that out and drop the legal-identifier part (the alias would then be blind to them).

Tests

  • packages/rules/tests/entity-conflicts-localized-alias-1615.test.ts (both the pages and SiteQuery paths): alias passes; no hreflang, one-way, canonical elsewhere, differing telephone, divergent provider, provider on one page only, divergent legal identifier, differing name, foreign url, page cap all still warn; cross-language alternates pass.
  • packages/audit-engine/tests/entity-map-builder.test.ts and entity-rules-golden.test.ts: the real builder and rule end to end.
  • Also ran the other entity-map tests, schema-entity-rules, docs-rule-pages, the canonical golden, make validate, oxlint on the new code, tsgo on packages/rules and packages/audit-engine. Fixtures use invented hosts and text.

Docs: docs/rules/schema/entity-conflicts.mdx, docs/guides/entity-map/format.mdx and mcp.mdx. CHANGELOG bullet under Unreleased. The squirrelscan agent skill does not need a change.

Closes #1615

nc9 added 2 commits November 7, 2026 11:23
…alias; entity map compares legal identifiers #1615

Signed-off-by: Nik Cubrilovic <[email protected]>
…alues, raw legal identifier display, indexed edges, docs and tests #1615

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9

nc9 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Landed via #1624 (rebase-merged, commits on main from f6787b4 to f2775ee: 902f93a and f6787b4 for #1617, 2361aa4 and ce40f50 for #1616, 383183e, 04e984e, 0f79f70 for #1615). Closing this draft as superseded.

nik

@nc9 nc9 closed this Nov 7, 2026
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.

schema/entity-conflicts treats localized URL aliases of one Service as exclusive values

1 participant