Skip to content

M2: Canonicalize web.endpoint URLs in canonicalize_url to prevent duplicate PIKs #89

Done

Description

@h45sh

Parent

Part of #25

What to build

web.endpoint URLs are canonicalized at the Primary Identity Key (PIK) boundary per ADR 0021 so http://192.0.2.10, http://192.0.2.10/, and http://192.0.2.10//api-docs/swagger.json resolve to a single deterministic web.endpoint Finding rather than minting duplicate nodes across adapters.

Acceptance criteria

  • canonicalize_url normalizes an empty root path ("") to "/" so root URLs with and without a trailing slash produce identical PIKs.
  • canonicalize_url collapses consecutive path slashes (// to /) and strips default scheme ports (:80 for http, :443 for https).
  • canonicalize_url remains idempotent and passes Hypothesis property tests and WebEndpoint PIK deduplication tests.
  • No duplicate web.endpoint nodes are created when ingesting http://192.0.2.10 and http://192.0.2.10/ into an in-memory Entity Graph.

Blocked by

None (can start immediately).

Activity

  1. added
    type:bug
    area:graph
    priority:P1
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:graphpriority:P1ready-for-agenttype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions