Skip to content

Add FEP-7aa9 vocabulary support#914

Open
dahlia wants to merge 3 commits into
fedify-dev:mainfrom
dahlia:vocab/fep-7aa9
Open

Add FEP-7aa9 vocabulary support#914
dahlia wants to merge 3 commits into
fedify-dev:mainfrom
dahlia:vocab/fep-7aa9

Conversation

@dahlia

@dahlia dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member

This adds vocabulary support for FEP-7aa9, so Fedify can read and write featured recommendation collections without treating the FEP terms as opaque JSON-LD.

The implementation keeps the FEP context in packages/vocab-runtime/src/contexts/fep-7aa9.json matching the published context at https://w3id.org/fep/7aa9. That matters because the context is preloaded as a remote-document substitute, not as a Fedify-specific extension point. The published context does not define featuredCollections, so the actor vocab schemas add that mapping inline in their default contexts. This lets actor documents compact featuredCollections while still keeping the preloaded FEP context faithful to the source document.

The four FEP-defined entity types are modeled as normal generated vocab types: FeaturedCollection, FeaturedItem, FeatureRequest, and FeatureAuthorization. FeaturedCollection extends OrderedCollection because the FEP uses it as a dedicated ordered collection of recommendation items. FeaturedItem carries the featured object and its authorization, while FeatureRequest reuses the existing ActivityStreams object and instrument properties instead of adding duplicate schema fields.

InteractionPolicy.canFeature is added beside the existing GoToSocial interaction policy properties because the FEP builds on the same interaction rule shape. The default context for InteractionPolicy now includes both the GoToSocial namespace and the FEP-7aa9 context, so standalone policy objects can compact canFeature without relying on an enclosing actor context.

Tests cover compacted JSON-LD output and round trips for the new types, the actor featuredCollections property, and canFeature. The fixture copy of the FEP context lets those tests use the same mock document loader pattern as the rest of packages/vocab.

Closes #810.

@dahlia dahlia added this to the Fedify 2.4 milestone Jul 1, 2026
@dahlia dahlia requested a review from Copilot July 1, 2026 02:06
@dahlia dahlia self-assigned this Jul 1, 2026
@dahlia dahlia requested a review from 2chanhaeng as a code owner July 1, 2026 02:06
@dahlia dahlia added the component/vocab Activity Vocabulary related label Jul 1, 2026
@dahlia dahlia added activitypub/compliance Specification compliance activitypub/mastodon Mastodon compatibility labels Jul 1, 2026
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema canceled.

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

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

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: 46faf625-c4da-4d76-aaea-10b764d36c61

📥 Commits

Reviewing files that changed from the base of the PR and between b42dca8 and f305b25.

📒 Files selected for processing (3)
  • packages/fixture/src/fixtures/w3id.org/fep/7aa9.json
  • packages/vocab-runtime/src/contexts/fep-7aa9.json
  • packages/vocab/src/vocab.test.ts
💤 Files with no reviewable changes (2)
  • packages/vocab-runtime/src/contexts/fep-7aa9.json
  • packages/fixture/src/fixtures/w3id.org/fep/7aa9.json

📝 Walkthrough

Walkthrough

Adds FEP-7aa9 vocabulary support: new entity schemas, a preloaded JSON-LD context, featuredCollections properties on actor types, an InteractionPolicy canFeature sub-policy, tests, and documentation updates.

Changes

FEP-7aa9 Vocabulary

Layer / File(s) Summary
New entity schema definitions
packages/vocab/src/featureauthorization.yaml, packages/vocab/src/featuredcollection.yaml, packages/vocab/src/featureditem.yaml, packages/vocab/src/featurerequest.yaml
Defines FeatureAuthorization, FeaturedCollection, FeaturedItem, and FeatureRequest vocab types with their properties, ranges, and default contexts.
JSON-LD context registration and fixture
packages/vocab-runtime/src/contexts.ts, packages/vocab-runtime/src/contexts/fep-7aa9.json, packages/fixture/src/fixtures/w3id.org/fep/7aa9.json
Adds the fep-7aa9 JSON-LD context document, registers it in preloadedContexts, and adds a matching test fixture.
featuredCollections wiring on actor types
packages/vocab/src/application.yaml, packages/vocab/src/group.yaml, packages/vocab/src/organization.yaml, packages/vocab/src/person.yaml, packages/vocab/src/service.yaml, packages/vocab/src/interactionpolicy.yaml
Adds featuredCollections context mappings and property definitions to Application, Group, Organization, Person, Service, and canFeature to InteractionPolicy.
Vocabulary and federation tests
packages/vocab/src/vocab.test.ts, packages/fedify/src/federation/handler.test.ts
Adds imports, context constants, updated Person and actor serialization assertions, and round-trip tests for the new feature vocabulary.
Documentation updates
CHANGES.md, FEDERATION.md
Documents the new FEP-7aa9 vocabulary support and lists the new types, properties, and URL references.

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

Possibly related PRs

  • fedify-dev/fedify#679: Updates InteractionPolicy with another functional sub-policy, so it is directly related to the schema pattern used here.

Suggested labels: component/federation, component/collections, activitypub/interop

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding FEP-7aa9 vocabulary support.
Description check ✅ Passed The description is directly related to the FEP-7aa9 vocabulary changes in this PR.
Linked Issues check ✅ Passed The PR adds all requested FEP-7aa9 types, properties, context support, and tests, matching issue #810's vocabulary-only scope.
Out of Scope Changes check ✅ Passed The changes stay focused on FEP-7aa9 vocabulary, context preload, docs, fixtures, and tests without unrelated additions.
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.

@dahlia

dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI 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.

Pull request overview

Adds first-class vocabulary (schemas, contexts, and tests) for FEP-7aa9 so Fedify can compact/expand and round-trip “featured recommendation” collections and related consent artifacts without treating them as opaque JSON-LD.

Changes:

  • Added generated vocab schemas/types for FeaturedCollection, FeaturedItem, FeatureRequest, and FeatureAuthorization, plus actor featuredCollections and InteractionPolicy.canFeature.
  • Added the FEP-7aa9 JSON-LD context to @fedify/vocab-runtime preloaded contexts and to the fixture document loader.
  • Expanded test coverage and snapshots to validate JSON-LD compaction/expansion and round-trips for the new terms.

Reviewed changes

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

Show a summary per file
File Description
packages/vocab/src/vocab.test.ts Adds JSON-LD round-trip tests and expected contexts for the new FEP-7aa9 vocab terms.
packages/vocab/src/snapshots/vocab.test.ts.snap Updates snapshots for new generated properties/types.
packages/vocab/src/featuredcollection.yaml Defines the FeaturedCollection entity and its topic/discoverable properties.
packages/vocab/src/featureditem.yaml Defines the FeaturedItem entity and its featuredObject/featureAuthorization properties.
packages/vocab/src/featurerequest.yaml Defines the FeatureRequest activity entity (reusing AS object/instrument).
packages/vocab/src/featureauthorization.yaml Defines the FeatureAuthorization entity (reusing GoToSocial interaction authorization fields).
packages/vocab/src/interactionpolicy.yaml Adds InteractionPolicy.canFeature and includes the FEP-7aa9 context in the default context list.
packages/vocab/src/application.yaml Adds actor-level featuredCollections context mapping and property.
packages/vocab/src/group.yaml Adds actor-level featuredCollections context mapping and property.
packages/vocab/src/organization.yaml Adds actor-level featuredCollections context mapping and property.
packages/vocab/src/person.yaml Adds actor-level featuredCollections context mapping and property.
packages/vocab/src/service.yaml Adds actor-level featuredCollections context mapping and property.
packages/vocab-runtime/src/contexts/fep-7aa9.json Adds the preloaded FEP-7aa9 JSON-LD context document.
packages/vocab-runtime/src/contexts.ts Registers the FEP-7aa9 context in the preloaded context registry.
packages/fixture/src/fixtures/w3id.org/fep/7aa9.json Adds a fixture copy of the FEP-7aa9 context for mock document loader usage in tests.
FEDERATION.md Documents FEP-7aa9 as supported and links the new vocab types in the ActivityPub listings.
CHANGES.md Adds changelog entries for @fedify/vocab and @fedify/vocab-runtime updates related to FEP-7aa9.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGES.md

@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 implements vocabulary support for FEP-7aa9, introducing new entities such as FeaturedCollection, FeaturedItem, FeatureRequest, and FeatureAuthorization, along with properties like featuredCollections for actors and canFeature for InteractionPolicy. It also preloads the FEP-7aa9 JSON-LD context and updates the corresponding tests and snapshots. The review feedback suggests improving test coverage in vocab.test.ts by adding explicit assertions to verify the correct deserialization of the newly introduced canFeature policy and FeaturedCollection properties.

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/src/vocab.test.ts
Comment thread packages/vocab/src/vocab.test.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: 61c1a35ec1

ℹ️ 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/src/featureditem.yaml
Comment thread packages/vocab-runtime/src/contexts/fep-7aa9.json
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
packages/vocab-runtime/src/contexts.ts 100.00% <100.00%> (ø)

... 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.

@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/src/featuredcollection.yaml`:
- Around line 16-19: Remove the unused sensitive term mapping from the
FeaturedCollection default context, since the schema only defines topic and
discoverable properties and does not expose a sensitive field. Update the
context block in featuredcollection.yaml near the existing
toot/discoverable/Hashtag entries, or if FeaturedCollection should support
sensitivity, add a matching sensitive property to the schema so the mapping is
actually used.

In `@packages/vocab/src/vocab.test.ts`:
- Around line 1609-1717: The test cases for FeaturedItem.toJsonLd(),
FeatureAuthorization.fromJsonLd(), and FeatureRequest.toJsonLd() repeat the same
`@context` entries, so extract a shared base context constant to remove
duplication. Define a reusable constant near the existing test helpers (similar
to FEATURED_COLLECTION_CONTEXT) and build each expected context array from it,
with FeatureRequest prepending its extra identity entry.
🪄 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: 8b9afdc1-3f56-4c6f-9c2a-7203427e7384

📥 Commits

Reviewing files that changed from the base of the PR and between e2224ef and 61c1a35.

⛔ Files ignored due to path filters (2)
  • packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap is excluded by !**/*.snap
  • packages/vocab/src/__snapshots__/vocab.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (16)
  • CHANGES.md
  • FEDERATION.md
  • packages/fixture/src/fixtures/w3id.org/fep/7aa9.json
  • packages/vocab-runtime/src/contexts.ts
  • packages/vocab-runtime/src/contexts/fep-7aa9.json
  • packages/vocab/src/application.yaml
  • packages/vocab/src/featureauthorization.yaml
  • packages/vocab/src/featuredcollection.yaml
  • packages/vocab/src/featureditem.yaml
  • packages/vocab/src/featurerequest.yaml
  • packages/vocab/src/group.yaml
  • packages/vocab/src/interactionpolicy.yaml
  • packages/vocab/src/organization.yaml
  • packages/vocab/src/person.yaml
  • packages/vocab/src/service.yaml
  • packages/vocab/src/vocab.test.ts

Comment thread packages/vocab/src/featuredcollection.yaml
Comment thread packages/vocab/src/vocab.test.ts
Add the FEP-7aa9 featured collection vocabulary to @fedify/vocab,
including feature request, authorization, item, and collection types
plus actor featuredCollections and canFeature policy support.

Preload the FEP-7aa9 context and add the fixture, documentation,
changelog entry, and JSON-LD round-trip coverage.

Closes fedify-dev#810

Assisted-by: Codex:gpt-5.5
Add the missing featuredCollections term to the preloaded FEP-7aa9
context and fixture so compact actors using that context deserialize the
actor collection link correctly.

Expand the FEP-7aa9 tests to assert deserialized interaction policies
and featured collection fields, share the repeated feature context in
fixtures, and drop an unused sensitive term from the featured collection
context.

fedify-dev#914 (comment)
fedify-dev#914 (comment)
fedify-dev#914 (comment)
fedify-dev#914 (comment)
fedify-dev#914 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@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: b42dca8de2

ℹ️ 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/src/featureditem.yaml

@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 vocabulary support for FEP-7aa9, adding new entities such as FeaturedCollection, FeaturedItem, FeatureRequest, and FeatureAuthorization, along with properties like featuredCollections for actors and canFeature for interaction policies. Feedback from the review highlights that featuredCollections is not defined in the published FEP-7aa9 context. Consequently, it should be removed from the preloaded context and fixture files to ensure accuracy, and tests should be updated to define this property inline to reflect realistic real-world usage.

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/contexts/fep-7aa9.json Outdated
Comment thread packages/fixture/src/fixtures/w3id.org/fep/7aa9.json Outdated
Comment thread packages/vocab/src/vocab.test.ts
The preloaded context and fixture should mirror the JSON-LD context served
from https://w3id.org/fep/7aa9.  Keep featuredCollections as an inline actor
term in the test case instead of treating it as part of that remote context.

fedify-dev#914 (comment)
fedify-dev#914 (comment)
fedify-dev#914 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia

dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

@dahlia

dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@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: f305b2550a

ℹ️ 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/src/featureditem.yaml
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@dahlia

dahlia commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@dahlia

dahlia commented Jul 1, 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 implements vocabulary support for FEP-7aa9, which introduces featuring recommendations using dedicated collections. It adds new vocabulary schemas for FeaturedCollection, FeaturedItem, FeatureRequest, and FeatureAuthorization, along with actor properties like featuredCollections and InteractionPolicy.canFeature. Additionally, the FEP-7aa9 JSON-LD context is preloaded into the runtime registry, and corresponding tests, snapshots, and documentation are updated. 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.

@dahlia dahlia requested a review from sij411 July 1, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub/compliance Specification compliance activitypub/mastodon Mastodon compatibility component/vocab Activity Vocabulary related

Development

Successfully merging this pull request may close these issues.

FEP-7aa9 vocabulary (FeaturedCollection, FeaturedItem, FeatureRequest, FeatureAuthorization)

2 participants