Skip to content

Use the Miscellaneous Terms context instead of declaring the terms - #3704

Open
pfefferle wants to merge 2 commits into
trunkfrom
add/miscellany-context
Open

Use the Miscellaneous Terms context instead of declaring the terms#3704
pfefferle wants to merge 2 commits into
trunkfrom
add/miscellany-context

Conversation

@pfefferle

Copy link
Copy Markdown
Member

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, manuallyApprovesFollowers and movedTo were declared inline in the actor context, Hashtag and sensitive in the object context. All five are dropped in favour of https://purl.archive.org/miscellany.
  • Nothing changes on the wire. The property names are the same, and the context maps them to the same IRIs, so implementations that never resolve a context see no difference at all.

I checked the definitions against the published document before removing ours, because movedTo is the one that could have differed:

"Hashtag": "as:Hashtag",
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
"sensitive": { "@id": "as:sensitive" }

movedTo carries "@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: and dcterms: definitions stay where they are. The unversioned URL is what the spec recommends for most implementers, and it matches how we already include purl.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:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Request an actor with Accept: application/activity+json and confirm https://purl.archive.org/miscellany is in @context and manuallyApprovesFollowers is still there.
  • Post something with a hashtag and a content warning, then check the outgoing object still carries tag with Hashtag and sensitive.
  • Run npm run env-test.

Changelog entry

The entry is part of the branch.

Copilot AI lite review requested due to automatic review settings September 1, 2026 09:22
@pfefferle pfefferle added the Enhancement New feature or request label Sep 1, 2026
@pfefferle pfefferle self-assigned this Sep 1, 2026
@pfefferle
pfefferle requested a review from a team September 1, 2026 09:22

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

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/miscellany to the @context arrays for objects and actors, and removed inline declarations for Hashtag, sensitive, manuallyApprovesFollowers, and movedTo.
  • 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.md and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants