Skip to content

Normalize outgoing JSON-LD for Pixelfed interop#721

Merged
dahlia merged 13 commits intofedify-dev:mainfrom
dahlia:pixelfed-workaround
Apr 24, 2026
Merged

Normalize outgoing JSON-LD for Pixelfed interop#721
dahlia merged 13 commits intofedify-dev:mainfrom
dahlia:pixelfed-workaround

Conversation

@dahlia
Copy link
Copy Markdown
Member

@dahlia dahlia commented Apr 24, 2026

Summary

  • Adds a dedicated outgoing JSON-LD compatibility layer in packages/fedify/src/compat/outgoing-jsonld.ts.
  • Moves the existing public audience workaround into that layer so outgoing activities still avoid compacting public addressing to as:Public.
  • Adds a Pixelfed compatibility workaround that preserves attachment as an array when compact JSON-LD would otherwise collapse a single item to a scalar.
  • Applies the same outgoing JSON-LD normalization before sending activities and before creating object integrity proofs, so signed bytes match the wire representation.

Rationale

Fedify already had an interoperability workaround for Lemmy because compacting public addressing to as:Public can cause problems with some implementations. Pixelfed has a similar representation-level interoperability issue with attachment: when a JSON-LD processor compacts a single-element array, the result can become a scalar value, but Pixelfed expects attachment to remain an array.

This cannot be handled by activity transformers because they operate on Activity objects rather than the serialized JSON-LD document. The new compatibility layer runs after JSON-LD serialization, where Fedify can adjust the outgoing document shape without changing the vocabulary object model.

The attachment workaround is guarded by JSON-LD canonicalization. Fedify compares the document before and after wrapping scalar attachments and skips the rewrite if the canonicalized semantics would change, which avoids altering custom local contexts that redefine attachment.

Testing

  • Added coverage for outgoing JSON-LD normalization in packages/fedify/src/compat/outgoing-jsonld.test.ts.
  • Added regression coverage for send and proof paths in packages/fedify/src/federation/middleware.test.ts and packages/fedify/src/sig/proof.test.ts.
  • Ran deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel packages/fedify/src/compat/outgoing-jsonld.test.ts packages/fedify/src/sig/proof.test.ts packages/fedify/src/federation/middleware.test.ts.
  • Ran mise run check-each fedify.
  • Ran mise run test-each fedify.

References

References pixelfed/pixelfed#6588.

Move outgoing JSON-LD compatibility adjustments into a dedicated layer
so send and proof creation use the same wire representation.  Keep the
existing public audience workaround and add attachment array preservation
for Pixelfed compatibility, while skipping attachment rewrites that would
change JSON-LD semantics.

Document the distinction from activity transformers and cover the new
normalization behavior in send and proof tests.

pixelfed/pixelfed#6588

Assisted-by: Codex:gpt-5.5
@dahlia dahlia added this to the Fedify 2.2 milestone Apr 24, 2026
@dahlia dahlia requested a review from Copilot April 24, 2026 16:50
@dahlia dahlia self-assigned this Apr 24, 2026
@dahlia dahlia added type/bug Something isn't working component/federation Federation object related activitypub/interop Interoperability issues labels Apr 24, 2026
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

@codex review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cbbf1190-84c7-4ec6-8af6-f8b6f2e47436

📥 Commits

Reviewing files that changed from the base of the PR and between ae6f220 and 359d113.

📒 Files selected for processing (3)
  • packages/fedify/src/compat/outgoing-jsonld.test.ts
  • packages/fedify/src/compat/outgoing-jsonld.ts
  • packages/fedify/src/sig/proof.ts

📝 Walkthrough

Walkthrough

Adds outgoing JSON‑LD normalization that ensures ActivityStreams attachment serializes as arrays for interoperability (Pixelfed), integrates normalization into signing/verification and middleware/queue flows, introduces normalizeExistingProofs option, and updates docs and tests.

Changes

Cohort / File(s) Summary
Documentation
CHANGES.md, docs/manual/send.md
Changelog and manual updated to document Pixelfed compatibility and to describe automatic post-serialization JSON‑LD wire-format fixes and the normalizeExistingProofs option.
Outgoing JSON‑LD Compatibility
packages/fedify/src/compat/outgoing-jsonld.ts, packages/fedify/src/compat/outgoing-jsonld.test.ts, packages/fedify/src/compat/preloaded-context-loader.ts, packages/fedify/src/compat/public-audience.ts
New normalizer exports normalizeAttachmentArrays and normalizeOutgoingActivityJsonLd; bounded-depth traversal to wrap scalar attachment into arrays, preloaded-only context loader, canonicalization gating with optional contextLoader, and comprehensive tests (proto-pollution, deep-nesting, @list/@value avoidance).
Signature & Proof Pipeline
packages/fedify/src/sig/proof.ts, packages/fedify/src/sig/proof.test.ts
Signing and verification now use normalizeOutgoingActivityJsonLd; verification flow refactored to try on-wire first then normalized fallback; tests updated for normalized attachment shapes and context-loader safety.
Middleware, Context & Queue
packages/fedify/src/federation/middleware.ts, packages/fedify/src/federation/middleware.test.ts, packages/fedify/src/federation/queue.ts, packages/fedify/src/federation/context.ts
Middleware switched to new normalizer; introduced normalizeExistingProofs in send options and FanoutMessage, propagated through fanout/queue and preserved in queued messages; tests assert attachment shapes and verification behavior across signing modes.
Integration Tests / Behavior
packages/fedify/src/federation/middleware.test.ts, packages/fedify/src/sig/proof.test.ts
Added/updated tests covering RSA and Ed25519 scenarios, canonicalization for Data Integrity proofs, behavior when normalizeExistingProofs is toggled, and deterministic canonicalization in tests.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ContextImpl
    participant Middleware
    participant Normalizer
    participant Signer
    participant FanoutQueue
    participant Remote

    Client->>ContextImpl: sendActivity(activity, options)
    ContextImpl->>Middleware: sendActivityInternal(activity, { ..., normalizeExistingProofs? })
    Middleware->>Normalizer: normalizeOutgoingActivityJsonLd(compactJsonLd, contextLoader)
    alt normalization applied (no existing proof OR proofCreated OR normalizeExistingProofs)
        Normalizer-->>Middleware: normalizedJsonLd
        Middleware->>Signer: createProof(normalizedJsonLd)
    else skip normalization (preserve existing proof bytes)
        Middleware->>Signer: forward originalWireBytes or createProof(original)
    end
    Signer-->>Middleware: signedActivity
    Middleware->>FanoutQueue: enqueue FanoutMessage (includes normalizeExistingProofs flag)
    FanoutQueue->>Middleware: dequeue/deliver per recipient
    Middleware->>Remote: POST signedActivity (attachments normalized as arrays)
    Remote-->>Middleware: response
    Middleware-->>ContextImpl: result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

component/signatures

Suggested reviewers

  • 2chanhaeng
  • sij411
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: introducing JSON-LD normalization specifically for Pixelfed interoperability.
Description check ✅ Passed The description is well-structured and directly related to the changeset, covering summary, rationale, testing, and references.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces an outgoing JSON-LD normalization layer for ActivityPub interoperability (notably Pixelfed), ensuring the JSON-LD bytes that get signed match what is sent on the wire.

Changes:

  • Added normalizeOutgoingActivityJsonLd() to apply outgoing JSON-LD wire-format compatibility fixes (public audience + attachment array shape).
  • Applied outgoing JSON-LD normalization consistently in both the send pipeline and eddsa-jcs-2022 proof creation/verification fallback paths.
  • Added tests + documentation + changelog entry covering the new behavior and regressions.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/fedify/src/compat/outgoing-jsonld.ts New outgoing JSON-LD normalization layer, including Pixelfed attachment array workaround.
packages/fedify/src/compat/outgoing-jsonld.test.ts Unit coverage for attachment wrapping, semantics-guarding, and safety cases.
packages/fedify/src/sig/proof.ts Normalizes compact JSON-LD before signing; verification tries both on-wire and normalized forms.
packages/fedify/src/sig/proof.test.ts Regression coverage ensuring proof bytes align with outgoing normalized JSON-LD.
packages/fedify/src/federation/middleware.ts Normalizes JSON-LD before LD signature creation and sending.
packages/fedify/src/federation/middleware.test.ts Regression coverage ensuring posted activities preserve attachment as an array.
docs/manual/send.md Documents the post-serialization, internal outgoing JSON-LD compatibility step.
CHANGES.md Changelog entry for Pixelfed interoperability improvement and reference links.

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts
Comment thread packages/fedify/src/compat/outgoing-jsonld.ts Outdated
Copy link
Copy Markdown
Contributor

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

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 a compatibility layer to improve interoperability with ActivityPub implementations like Pixelfed by ensuring that outgoing activity 'attachment' fields are serialized as arrays, even when containing a single item. The changes include a new utility module for JSON-LD normalization, updates to the federation middleware and signature verification logic to incorporate these normalization steps, and comprehensive regression tests. I have no further feedback to provide as the reviewer's comment regarding performance refactoring correctly identifies that such optimizations should be deferred to a separate PR to maintain scope and reduce risk.

@chatgpt-codex-connector
Copy link
Copy Markdown

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

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

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

Files with missing lines Patch % Lines
packages/fedify/src/compat/outgoing-jsonld.ts 83.40% 18 Missing and 23 partials ⚠️
Files with missing lines Coverage Δ
...ages/fedify/src/compat/preloaded-context-loader.ts 100.00% <100.00%> (ø)
packages/fedify/src/compat/public-audience.ts 94.40% <100.00%> (-0.40%) ⬇️
packages/fedify/src/federation/middleware.ts 95.81% <100.00%> (+0.16%) ⬆️
packages/fedify/src/sig/proof.ts 75.59% <100.00%> (+0.51%) ⬆️
packages/fedify/src/compat/outgoing-jsonld.ts 83.40% <83.40%> (ø)

... and 2 files 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.

Skip the JSON-LD canonicalization equivalence check when scalar
attachment wrapping runs under an ActivityStreams-only context without
nested context scopes.  Also make the fallback log messages context
neutral, since the helper can run from proof verification as well as
send paths.

References fedify-dev#721 (comment)
References fedify-dev#721 (comment)

Assisted-by: Codex:gpt-5
@dahlia dahlia requested a review from Copilot April 24, 2026 17:29
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 implements internal JSON-LD wire-format compatibility fixes to improve interoperability with ActivityPub implementations like Pixelfed, which require the attachment field to be an array even for single items. It introduces a normalizeOutgoingActivityJsonLd utility that wraps scalar attachments while ensuring JSON-LD semantics are preserved via canonicalization. The federation middleware and signature modules have been updated to apply these fixes before activities are signed and sent. I have no feedback to provide as the review comment suggested improvements that were already implemented in the code.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts Outdated
Comment thread packages/fedify/src/compat/outgoing-jsonld.ts Outdated
Copy link
Copy Markdown

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

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: 895f30ed47

ℹ️ 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/fedify/src/compat/outgoing-jsonld.ts Outdated
Keep the fast path semantics-preserving by leaving JSON-LD list
objects unwrapped, since array-wrapping list objects can change their
meaning.  Broaden the known-safe context check to allow additional
preloaded contexts alongside ActivityStreams, and avoid allocating a
replacement object until the attachment walker actually changes a
subtree.

References fedify-dev#721 (comment)
References fedify-dev#721 (comment)
References fedify-dev#721 (comment)

Assisted-by: Codex:gpt-5
@dahlia dahlia requested a review from Copilot April 24, 2026 17:50
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

/gemini review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread docs/manual/send.md Outdated
dahlia added 2 commits April 25, 2026 03:55
Share the preloaded-only context loader between outgoing JSON-LD
compatibility helpers so security-sensitive fallback behavior cannot drift.
Keep the proof verification fallback on that restricted loader instead of
reusing a caller-provided context loader for inbound JSON-LD.

Also document the attachment normalization loader contract, add safe
correlation metadata to the semantic-divergence warning, and tighten the
pathological nesting regression assertion.

fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)

Assisted-by: Codex:gpt-5
Add a public sendActivity option for callers that pre-sign activities with
Fedify and need the outgoing compact JSON-LD to match the normalized bytes
covered by the proof. Preserve existing proofs by default, and document that
trade-off in the send path, queue message type, and manual.

fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)

Assisted-by: Codex:gpt-5
Copy link
Copy Markdown
Member Author

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

Review feedback addressed.

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts
@dahlia dahlia requested a review from Copilot April 24, 2026 19:05
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

/gemini review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@packages/fedify/src/compat/outgoing-jsonld.ts`:
- Around line 123-146: Add a startup-time invariant check that verifies none of
the preloaded contexts in KNOWN_SAFE_CONTEXT_URLS redefine the "attachment" term
(or if present, that it maps exactly to the ActivityStreams definition:
"@type":"@id"), and fail-fast if any context violates this; implement this check
alongside module initialization so hasKnownSafeContext (and the jsonld.canonize
fast-path) remains safe. Locate the check to run before the fast-path relies on
KNOWN_SAFE_CONTEXT_URLS (reference symbols: KNOWN_SAFE_CONTEXT_URLS,
AS_CONTEXT_URL, hasKnownSafeContext, and the jsonld.canonize fast-path) and
ensure the startup assertion enumerates each preloaded context, inspects its
term definition for "attachment", and throws/logs an error if a conflicting
definition is found.

In `@packages/fedify/src/federation/middleware.test.ts`:
- Around line 3749-3780: Add a queued-fanout regression: create a pre-signed
activity (reuse signedWithNormalizedProof and actorEdKey) and call
ctx.sendActivity with fanout: "force" and normalizeExistingProofs: true so the
activity is queued rather than direct-sent; then simulate/replay the worker
delivery of the persisted FanoutMessage (the code path that consumes
FanoutMessage) and assert that after worker delivery the posted payload still
has object.attachment as an array
(assertEquals(Array.isArray(postedSignedObject.attachment), true)) and that
proof verification still succeeds (assertEquals(verified, ["proof"])), ensuring
the fanout serialization/propagation preserves the option and the normalized
proof.
🪄 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: 72aad9b2-9c22-47b3-a0e7-6fdf1a41fa4f

📥 Commits

Reviewing files that changed from the base of the PR and between 8ddd745 and 5cc2fbc.

📒 Files selected for processing (11)
  • docs/manual/send.md
  • packages/fedify/src/compat/outgoing-jsonld.test.ts
  • packages/fedify/src/compat/outgoing-jsonld.ts
  • packages/fedify/src/compat/preloaded-context-loader.ts
  • packages/fedify/src/compat/public-audience.ts
  • packages/fedify/src/federation/context.ts
  • packages/fedify/src/federation/middleware.test.ts
  • packages/fedify/src/federation/middleware.ts
  • packages/fedify/src/federation/queue.ts
  • packages/fedify/src/sig/proof.test.ts
  • packages/fedify/src/sig/proof.ts

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts
Comment thread packages/fedify/src/federation/middleware.test.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts
Comment thread packages/fedify/src/federation/context.ts Outdated
Copy link
Copy Markdown
Contributor

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

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 internal JSON-LD wire-format compatibility fixes to improve interoperability with platforms like Pixelfed, specifically by ensuring attachment fields are serialized as arrays. It adds a new normalizeExistingProofs option to sendActivity() to allow opting into these fixes for pre-signed activities and implements a restricted preloadedOnlyDocumentLoader for secure normalization. Feedback identifies a potential issue in the recursive traversal logic where inline @context objects might be processed, potentially leading to unintended modifications of term definitions.

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts
Copy link
Copy Markdown

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

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: 5cc2fbc3ff

ℹ️ 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/fedify/src/sig/proof.ts Outdated
Enforce the preloaded context invariant that keeps the attachment term
compatible with ActivityStreams before using the known-safe fast path.
Also keep JSON-LD value payloads out of the nested-context detector,
fix the newly added option's release annotation, and cover queued fanout
for pre-signed activities that opt into existing-proof normalization.

Addresses review comments:

fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)

Assisted-by: Codex:gpt-5
@dahlia dahlia requested a review from Copilot April 24, 2026 19:28
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

/gemini review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@packages/fedify/src/compat/outgoing-jsonld.ts`:
- Around line 51-64: assertPreloadedAttachmentContextInvariant currently only
examines objects yielded by getContextObjects() and misses scoped `@context`
nested inside term definitions; update the invariant to recursively descend into
any term definition objects and collect/visit their nested "@context" (or extend
getContextObjects to do this) so that any redefinition of the "attachment" term
inside scoped contexts is detected; specifically, when iterating context objects
in assertPreloadedAttachmentContextInvariant, for each property that is an
object check for and recurse into its "@context" (mirroring hasNestedContext's
traversal) before testing with isActivityStreamsAttachmentTerm so
wrapScalarAttachments's fast path remains safe.
🪄 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: 1f57ee10-48ba-4d5e-8e3e-fcfa9ea7de63

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc2fbc and ae6f220.

📒 Files selected for processing (4)
  • packages/fedify/src/compat/outgoing-jsonld.test.ts
  • packages/fedify/src/compat/outgoing-jsonld.ts
  • packages/fedify/src/federation/context.ts
  • packages/fedify/src/federation/middleware.test.ts

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts Outdated
Copy link
Copy Markdown
Contributor

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

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 internal JSON-LD wire-format compatibility fixes to improve interoperability with ActivityPub implementations like Pixelfed, specifically by ensuring attachment fields are serialized as arrays. It adds the normalizeExistingProofs option to SendActivityOptions, allowing these fixes to be applied to pre-signed activities. The implementation includes safeguards such as traversal depth limits and semantic preservation checks via JSON-LD canonicalization. I have no feedback to provide.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread packages/fedify/src/compat/outgoing-jsonld.ts
Comment thread packages/fedify/src/sig/proof.ts Outdated
Build the known-safe preloaded context set by filtering contexts that keep
ActivityStreams attachment semantics intact instead of failing at module
load.  The check now descends into scoped context definitions so future
preloaded contexts cannot silently bypass canonicalization when they
redefine attachment locally.

Pass the restricted preloaded-only loader explicitly in proof verification
fallbacks so inbound JSON-LD normalization cannot start depending on a
network-capable default after future refactors.

Addresses review comments:

fedify-dev#721 (comment)
fedify-dev#721 (comment)
fedify-dev#721 (comment)

Assisted-by: Codex:gpt-5
@dahlia dahlia requested a review from Copilot April 24, 2026 19:40
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 24, 2026

/gemini review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

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

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 internal JSON-LD wire-format compatibility fixes to improve interoperability with platforms like Pixelfed, specifically by ensuring attachment fields are serialized as arrays. It also adds a normalizeExistingProofs option to SendActivityOptions to allow these fixes to be applied to pre-signed activities. The implementation includes security measures such as a restricted document loader to prevent SSRF and traversal depth limits to mitigate DoS risks. I have no feedback to provide.

@chatgpt-codex-connector
Copy link
Copy Markdown

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

ℹ️ 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 94d98c0 into fedify-dev:main Apr 24, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub/interop Interoperability issues activitypub/pixelfed Pixelfed compatibility component/federation Federation object related component/outbox Outbox related type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants