Use the Miscellaneous Terms context instead of declaring the terms - #3704
Open
pfefferle wants to merge 2 commits into
Open
Use the Miscellaneous Terms context instead of declaring the terms#3704pfefferle wants to merge 2 commits into
pfefferle wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR switches the plugin’s JSON-LD contexts to reference the published ActivityPub Miscellaneous Terms context (https://purl.archive.org/miscellany) instead of redeclaring those terms inline, keeping on-the-wire JSON semantics unchanged while avoiding local overrides that could mask future upstream refinements.
Changes:
- Added
https://purl.archive.org/miscellanyto the@contextarrays for objects and actors, and removed inline declarations forHashtag,sensitive,manuallyApprovesFollowers, andmovedTo. - Updated PHPUnit expectations and added a test to ensure the misc context is included and the inline copies are not.
- Documented the extension in
FEDERATION.mdand added a changelog entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
includes/activity/class-base-object.php |
Adds Miscellany context and removes inline Hashtag/sensitive term declarations from the object context. |
includes/activity/class-actor.php |
Adds Miscellany context and removes inline Miscellany term declarations from the actor context. |
tests/phpunit/tests/includes/collection/class-test-outbox.php |
Updates expected outbox JSON to include the Miscellany context URL in @context. |
tests/phpunit/tests/includes/activity/class-test-base-object.php |
Adds a unit test asserting Miscellany context inclusion and absence of inline Hashtag/sensitive. |
FEDERATION.md |
Documents support for ActivityPub Miscellaneous Terms and the included context URL. |
.github/changelog/add-miscellany-context |
Adds an end-user-facing changelog entry describing the change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes:
The plugin already implements all four terms from ActivityPub Miscellaneous Terms, it just declared them itself. This points at the published context instead.
Hashtag,manuallyApprovesFollowersandmovedTowere declared inline in the actor context,Hashtagandsensitivein the object context. All five are dropped in favour ofhttps://purl.archive.org/miscellany.I checked the definitions against the published document before removing ours, because
movedTois the one that could have differed:movedTocarries"@type": "@id"there, the same as our inline version did, so expansion is unchanged. The other three are the string spelling of the same mapping.We keep the inline terms for everything the context does not cover, so the
toot:,gts:,schema:anddcterms:definitions stay where they are. The unversioned URL is what the spec recommends for most implementers, and it matches how we already includepurl.archive.org/socialweb/webfinger.Keeping both the context and the inline copies would have been the worse option: the inline object comes last and wins, so a later refinement of one of these definitions would be silently masked.
Other information:
Testing instructions:
Accept: application/activity+jsonand confirmhttps://purl.archive.org/miscellanyis in@contextandmanuallyApprovesFollowersis still there.tagwithHashtagandsensitive.npm run env-test.Changelog entry
The entry is part of the branch.