Skip to content

Canonicalize and compare portable ActivityPub URIs#924

Merged
dahlia merged 12 commits into
fedify-dev:mainfrom
dahlia:feat/fep-ef61/ap-uris
Jul 8, 2026
Merged

Canonicalize and compare portable ActivityPub URIs#924
dahlia merged 12 commits into
fedify-dev:mainfrom
dahlia:feat/fep-ef61/ap-uris

Conversation

@dahlia

@dahlia dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member

Closes #828.

What changed

This adds canonicalizePortableUri() and arePortableUrisEqual() to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URI identifiers.

It also documents the new helpers in docs/manual/vocab.md, exports them from packages/vocab-runtime/src/mod.ts, adds regression coverage in packages/vocab-runtime/src/url.test.ts, and records the change in CHANGES.md.

How it works

The new canonicalization helper reuses the existing portable IRI parser in packages/vocab-runtime/src/url.ts instead of introducing a second parser. That keeps validation behavior aligned with the URI handling added for #826: both ap: and ap+ef61: inputs are accepted, decoded and percent-encoded DID authorities are normalized through the same code path, malformed portable authorities are rejected consistently, and JavaScript URL instances using URL-safe authorities work the same way as string inputs.

For comparison, the helper emits a string form with the ap+ef61: scheme, a decoded DID authority, no query component, and the original path and fragment. Removing the query component follows FEP-ef61’s comparison rule, which treats query parameters such as gateways as location hints rather than object identity. Preserving the path and fragment keeps the identity boundary strict where the URI syntax still carries object-specific meaning.

The canonicalization also normalizes only the leading DID scheme from DID: to did:. It deliberately does not lowercase the whole DID authority, because DID method-specific identifiers may have their own case-sensitive rules. This matches the existing portable-origin comparison behavior while avoiding a broader transformation than the runtime already relies on.

arePortableUrisEqual() is intentionally a thin wrapper over canonicalizePortableUri(). That keeps the public API simple and makes equality semantics auditable from a single canonical form rather than duplicating comparison logic.

Why this approach

FEP-ef61 distinguishes serialization from comparison. Fedify already serializes portable IRIs with formatIri(), and serialization needs to preserve query hints because they can help consumers find a portable actor through gateways. Object identity comparison has a different rule: query hints must be ignored. Adding a separate comparison helper avoids changing serialization behavior for generated vocabulary classes while still giving callers a spec-aware way to compare portable identifiers.

The implementation stays scoped to issue #828. It does not convert compatible HTTP gateway identifiers, dereference gateways, resolve DID documents, verify FEP-8b32 proofs, or extend FEP-fe34 cryptographic origin checks. Those concerns depend on gateway and trust-model behavior outside this issue, while the comparison helper is a small runtime primitive that later work can build on.

The tests cover decoded and encoded authorities, both supported schemes, query stripping, path and fragment preservation, DID-internal percent escapes, DID scheme casing, non-equivalent authorities, non-equivalent paths, non-equivalent fragments, and unsupported or malformed inputs. These cases are intended to pin down the boundary between accepted portable URI spellings and the narrower canonical form used for comparison.

Verification

  • mise run test:deno packages/vocab-runtime/src/url.test.ts
  • mise run check-each vocab-runtime
  • mise run check:md
  • mise run test-each vocab-runtime

mise run test-each vocab-runtime completed successfully. The selected package reported that it has no test:bun script.

Add vocab-runtime helpers for canonicalizing and comparing FEP-ef61
portable URI identifiers.  The comparison form accepts both ap: and
ap+ef61:, decodes DID authorities, strips query hints, and preserves
path and fragment identity.

Document the helper behavior and cover decoded, encoded, query,
fragment, casing, and rejection cases in the URL runtime tests.

Closes fedify-dev#828

Assisted-by: Codex:gpt-5.5
@dahlia dahlia added this to the Fedify 2.4 milestone Jul 7, 2026
@dahlia dahlia self-assigned this Jul 7, 2026
@dahlia dahlia requested review from 2chanhaeng and sij411 as code owners July 7, 2026 12:14
@dahlia dahlia added component/vocab Activity Vocabulary related activitypub/compliance Specification compliance labels Jul 7, 2026
@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema canceled.

Name Link
🔨 Latest commit bb4c816
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a4d097016ee7b0008c5c0cc

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds canonicalizePortableUri() and arePortableUrisEqual() to @fedify/vocab-runtime for FEP-ef61 portable ActivityPub URI normalization and comparison. Exports, tests, changelog notes, and manual guidance are updated to match the new helpers.

Changes

Portable URI Comparison Feature

Layer / File(s) Summary
Canonicalization and equality implementation
packages/vocab-runtime/src/url.ts, packages/vocab-runtime/src/mod.ts
Adds portable URI canonicalization and equality helpers, including DID authority normalization, percent-encoding normalization, query removal, and package-level re-exports.
Tests for canonicalization and equality
packages/vocab-runtime/src/url.test.ts
Adds coverage for canonical forms, preserved path/fragment behavior, normalization edge cases, rejection of unsupported inputs, and equality comparisons across URI variants.
Changelog and documentation updates
CHANGES.md, docs/manual/vocab.md
Documents the new helpers and updates portable object ID guidance to use them for comparison.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Suggested reviewers: sij411

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: portable ActivityPub URI canonicalization and comparison.
Description check ✅ Passed The description is directly about the implemented URI helpers, docs, tests, and changelog updates.
Linked Issues check ✅ Passed The changes satisfy #828 by adding canonicalization and equality helpers, normalizing schemes/authorities, stripping queries, and covering the required cases in tests.
Out of Scope Changes check ✅ Passed The PR stays focused on portable URI comparison and related docs/tests without unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces canonicalizePortableUri() and arePortableUrisEqual() to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URIs. The review feedback highlights a potential issue where comparisons could fail if percent-encoded characters in the DID authority differ in casing (e.g., %2f vs %2F), and suggests normalizing these percent-encodings to uppercase to ensure robust comparisons.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/vocab-runtime/src/url.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b3123164f

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/vocab-runtime/src/url.ts`:
- Around line 66-85: Add a brief inline comment in canonicalizePortableUri near
the decodePortableAuthority(parsed.host) call explaining that parsed.host comes
from parsePortableIri as an encodeURIComponent-escaped authority, so this path
relies on the generic percent-decoding branch rather than the DID_SCHEME_PATTERN
branch. Mention that this is the inverse of the earlier encoding step and is
shared behavior with decodePortableAuthority.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 75db782a-828b-44b2-b517-245b6624fff6

📥 Commits

Reviewing files that changed from the base of the PR and between 1a6f31c and 2b31231.

📒 Files selected for processing (5)
  • CHANGES.md
  • docs/manual/vocab.md
  • packages/vocab-runtime/src/mod.ts
  • packages/vocab-runtime/src/url.test.ts
  • packages/vocab-runtime/src/url.ts

Comment thread packages/vocab-runtime/src/url.ts
Keep the comparison canonicalizer from using URL-normalized path
components, because FEP-ef61 treats portable URI paths as opaque object
identity strings.  Also normalize percent-encoding case in DID
authorities so equivalent authority spellings compare consistently.

fedify-dev#924 (comment)
fedify-dev#924 (comment)
fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new helper functions, canonicalizePortableUri() and arePortableUrisEqual(), to the @fedify/vocab-runtime package to facilitate the comparison of FEP-ef61 portable ActivityPub URIs. The changes include comprehensive unit tests and documentation updates. Feedback on the code suggests removing a redundant runtime null check in canonicalizePortableUri() since the URI format is already validated by a preceding helper function.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/vocab-runtime/src/url.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8b53a3a9a

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/vocab-runtime/src/url.test.ts`:
- Around line 258-279: Add a regression test in canonicalizePortableUri()
coverage for URL-object inputs with dot segments, since string-based cases
already cover opaque-path preservation but parseIri() / URL instances normalize
dot segments before canonicalizePortableUri() runs. Use the existing url.test.ts
suite and the canonicalizePortableUri() / arePortableUrisEqual() helpers to
assert the current behavior for a URL object with a path like a/../b, so the
behavior is explicit even if it differs from string inputs.

In `@packages/vocab-runtime/src/url.ts`:
- Around line 76-95: The canonicalization logic in canonicalizePortableUri is
inconsistent for string versus URL inputs because reading input.href on a URL
object can already normalize dot segments and change the preserved portable IRI
identity. Update canonicalizePortableUri to accept only raw string input or
explicitly document this limitation in the helper’s API/docs, and make sure the
behavior around parsePortableIri, PORTABLE_IRI_PATTERN, and the raw
path/fragment handling stays consistent with that choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6203fb9f-8d07-461a-8b41-9163e4e6ef01

📥 Commits

Reviewing files that changed from the base of the PR and between 2b31231 and e8b53a3.

📒 Files selected for processing (2)
  • packages/vocab-runtime/src/url.test.ts
  • packages/vocab-runtime/src/url.ts

Comment thread packages/vocab-runtime/src/url.test.ts
Comment thread packages/vocab-runtime/src/url.ts Outdated
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.85507% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/vocab-runtime/src/url.ts 89.55% 4 Missing and 3 partials ⚠️
Files with missing lines Coverage Δ
packages/vocab-runtime/src/mod.ts 100.00% <100.00%> (ø)
packages/vocab-runtime/src/url.ts 90.15% <89.55%> (-0.13%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Make the portable URI comparison helpers accept raw strings only, since
URL objects may already have normalized opaque path segments before the
helpers can compare identity.  Keep the redundant pattern check out of the
validated path and document the string-only comparison contract.

fedify-dev#924 (comment)
fedify-dev#924 (comment)
fedify-dev#924 (comment)
fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces canonicalizePortableUri() and arePortableUrisEqual() to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URI strings, along with associated documentation and tests. The review feedback highlights two key improvement opportunities: first, arePortableUrisEqual should handle non-portable URIs gracefully by falling back to direct string comparison instead of throwing a TypeError to prevent runtime crashes; second, canonicalizePortableUri should normalize percent-encoding casing in the path and fragment components as well as the authority component to ensure compliance with RFC 3986.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/vocab-runtime/src/url.ts
Comment thread packages/vocab-runtime/src/url.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a6b24ac8c

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/vocab-runtime/src/url.ts (1)

92-95: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Percent-encoding case normalization is authority-only; path/fragment are byte-compared.

normalizePercentEncoding is applied to the decoded authority but not to match[3] (path) or match[5] (fragment), so two portable URIs differing only in pct-encoding hex casing within the path/fragment (e.g. %2f vs %2F) will not be treated as equal by arePortableUrisEqual, unlike equivalent authority differences which are normalized. This appears intentional given the opaque-path-preservation design and existing tests, but a short comment noting the asymmetry would help future maintainers avoid assuming full pct-encoding normalization.

Also applies to: 104-109

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vocab-runtime/src/url.ts` around lines 92 - 95, Add a short
explanatory comment in arePortableUrisEqual/normalizePortableUriUri handling
near the authority reconstruction in url.ts to note that
normalizePercentEncoding is intentionally applied only to the authority, while
match[3] and match[5] (path and fragment) are compared byte-for-byte and keep
pct-encoding case differences significant; use the existing
decodePortableAuthority and normalizePercentEncoding logic as the reference
point.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/vocab-runtime/src/url.ts`:
- Around line 92-95: Add a short explanatory comment in
arePortableUrisEqual/normalizePortableUriUri handling near the authority
reconstruction in url.ts to note that normalizePercentEncoding is intentionally
applied only to the authority, while match[3] and match[5] (path and fragment)
are compared byte-for-byte and keep pct-encoding case differences significant;
use the existing decodePortableAuthority and normalizePercentEncoding logic as
the reference point.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 065bf493-88bd-4127-8a69-eebfe92b8bbb

📥 Commits

Reviewing files that changed from the base of the PR and between e8b53a3 and 5a6b24a.

📒 Files selected for processing (4)
  • CHANGES.md
  • docs/manual/vocab.md
  • packages/vocab-runtime/src/url.test.ts
  • packages/vocab-runtime/src/url.ts

dahlia added 2 commits July 7, 2026 21:52
Clarify that portable URI comparison normalizes percent-encoding case only
for the DID authority.  Path and fragment components remain byte-for-byte
from the raw match because FEP-ef61 treats portable object paths as opaque
identity strings.

fedify-dev#924 (review)

Assisted-by: Codex:gpt-5.5
Normalize percent-escape hex casing in preserved path and fragment
components, while still reading those components from the raw URI string so
URL dot-segment normalization cannot collapse portable object identity.

Also make arePortableUrisEqual() fall back to direct string comparison for
non-portable strings.  Portable-looking inputs still use the strict portable
URI parser, so malformed portable authorities continue to fail instead of
being silently accepted.

fedify-dev#924 (comment)
fedify-dev#924 (comment)
fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the canonicalizePortableUri() and arePortableUrisEqual() helper functions to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URI strings. These helpers normalize ap: and ap+ef61: schemes, decode DID authorities, handle percent-encoding normalization, and strip query hints such as gateways. The changes also include comprehensive unit tests and updated documentation. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c6cc4c25c

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts Outdated
Validate path and fragment percent escapes before canonicalizing portable URI
components.  This keeps malformed inputs from being normalized into the same
canonical form as a different valid URI string during equality checks.

fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new helper functions, canonicalizePortableUri() and arePortableUrisEqual(), to the @fedify/vocab-runtime package. These helpers facilitate the comparison of FEP-ef61 portable ActivityPub URI strings by normalizing schemes, decoding DID authorities, and ignoring query hints such as gateways. The changes include implementation, extensive unit tests, and updated documentation. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8478f3b7ea

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts Outdated
Normalize over-encoded unreserved characters in portable DID authorities so
URL-safe spellings compare equal to their decoded form.  Reserved DID-internal
escapes such as encoded slashes and colons remain percent-encoded to preserve
existing authority identity semantics.

fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces canonicalizePortableUri() and arePortableUrisEqual() to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URI strings, along with corresponding documentation and comprehensive unit tests. The review feedback highlights an issue in normalizePortableComponent where percent-encoded unreserved characters in the path and fragment components are not decoded, potentially causing false negatives during URI comparison. A code suggestion is provided to decode these unreserved characters to ensure RFC 3986 compliance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/vocab-runtime/src/url.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca7b4eec40

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts Outdated
Normalize percent-encoded unreserved characters in portable URI paths and
fragments so escaped and decoded spellings compare equal.  Reserved escapes
remain percent-encoded, and raw dot segments are still preserved instead of
being collapsed through URL pathname normalization.

fedify-dev#924 (comment)
fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces canonicalizePortableUri() and arePortableUrisEqual() helper functions to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URI strings. It also includes documentation updates and comprehensive unit tests. The reviewer suggested simplifying the regular expression and conditional checks in normalizePortableComponent() since invalid percent-encodings are already validated and rejected at the start of the function.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/vocab-runtime/src/url.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: db0b49c6e9

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: db0b49c6e9

ℹ️ 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".

Remove the redundant bare-percent branch from portable component
normalization.  Invalid percent escapes are already rejected before matching,
so percent matches are always complete escape triplets.

fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces canonicalizePortableUri() and arePortableUrisEqual() to @fedify/vocab-runtime for comparing FEP-ef61 portable ActivityPub URI strings, along with corresponding documentation and comprehensive unit tests. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faeab95d5e

ℹ️ 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".

Comment thread packages/vocab-runtime/src/url.ts
Raw portable URI paths and fragments can contain unpaired UTF-16
surrogates when they arrive from decoded JSON strings.  Convert the
URIError from encodeURI() into the same TypeError used for other invalid
portable components so canonicalization and comparison keep their public
contracts.

fedify-dev#924 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces canonicalizePortableUri() and arePortableUrisEqual() to the @fedify/vocab-runtime package to facilitate the comparison of FEP-ef61 portable ActivityPub URI strings. These helpers normalize URIs to the ap+ef61: scheme, decode DID authorities, and ignore query hints such as gateways. The changes include comprehensive unit tests and documentation updates. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: bb4c816dfe

ℹ️ 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".

@dahlia dahlia merged commit 7b19967 into fedify-dev:main Jul 8, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub/compliance Specification compliance component/vocab Activity Vocabulary related

Development

Successfully merging this pull request may close these issues.

Canonicalize and compare ap:/ap+ef61: URIs

1 participant