Skip to content

GoToSocial interaction controls vocabulary#622

Merged
dahlia merged 5 commits intofedify-dev:mainfrom
dahlia:vocab/gts-interaction-controls
Mar 17, 2026
Merged

GoToSocial interaction controls vocabulary#622
dahlia merged 5 commits intofedify-dev:mainfrom
dahlia:vocab/gts-interaction-controls

Conversation

@dahlia
Copy link
Member

@dahlia dahlia commented Mar 15, 2026

Summary

  • Add type-safe vocabulary support for GoToSocial's interaction controls, which allow post authors to specify who can like, reply to, or announce their posts and to approve interactions.
  • Update the preloaded https://gotosocial.org/ns JSON-LD context in @fedify/vocab-runtime to match the current GoToSocial v0.21+ namespace.

New types

  • InteractionPolicy and InteractionRule — typeless embedded value objects (like Endpoints) for expressing interaction sub-policies
  • LikeRequest, ReplyRequest, AnnounceRequest — Activity subtypes for requesting interaction approval
  • LikeAuthorization, ReplyAuthorization, AnnounceAuthorization — Object subtypes for proving approved interactions (with interactingObject and interactionTarget properties)

New properties on Object

  • interactionPolicy — the interaction policy for a post
  • approvedBy — URI referencing an authorization object
  • getLikeAuthorization()/likeAuthorizationId, getReplyAuthorization()/replyAuthorizationId, getAnnounceAuthorization()/announceAuthorizationId — references to authorization objects proving approved interactions

Closes #453.

Test plan

  • mise run codegen succeeds
  • mise run check passes
  • mise run test:deno passes (all 28710 tests, 0 failures)
  • mise run test:bun passes

dahlia and others added 5 commits March 15, 2026 01:02
The preloaded `https://gotosocial.org/ns` JSON-LD context was outdated,
containing only the deprecated property names (`always`,
`approvalRequired`).  Update it to match the current GoToSocial v0.21+
namespace, which includes:

 -  New type terms: `LikeRequest`, `ReplyRequest`, `AnnounceRequest`,
    `LikeAuthorization`, `ReplyAuthorization`, `AnnounceAuthorization`,
    `QuoteRequest`, `QuoteAuthorization`
 -  New property terms: `automaticApproval`, `manualApproval`,
    `interactingObject`, `interactionTarget`, `likeAuthorization`,
    `replyAuthorization`, `announceAuthorization`, `canQuote`,
    `quoteAuthorization`
 -  Boolean properties: `hidesToPublicFromUnauthedWeb`,
    `hidesCcPublicFromUnauthedWeb`
 -  Deprecated terms retained for backward compatibility

Part of fedify-dev#453

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add type-safe vocabulary support for GoToSocial's interaction controls,
which allow post authors to specify who can like, reply to, or announce
their posts and to approve interactions.

New typeless embedded types (like Endpoints):

 -  InteractionPolicy: attached to posts via interactionPolicy, contains
    canLike, canReply, and canAnnounce sub-policies
 -  InteractionRule: each sub-policy with automaticApproval and
    manualApproval URI lists

New Activity subtypes for requesting interaction approval:

 -  LikeRequest, ReplyRequest, AnnounceRequest

New Object subtypes for proving approved interactions:

 -  LikeAuthorization, ReplyAuthorization, AnnounceAuthorization
    (with interactingObject and interactionTarget properties)

New properties on Object:

 -  interactionPolicy, approvedBy, likeAuthorization,
    replyAuthorization, announceAuthorization

All Object subtypes now include the GoToSocial namespace context
(https://gotosocial.org/ns) in their defaultContext so that inherited
GTS properties serialize correctly in compact JSON-LD.

Part of fedify-dev#453

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add changelog entries for the new vocabulary types and properties added
for GoToSocial interaction controls (issue fedify-dev#453), under both the
@fedify/vocab and @fedify/vocab-runtime package sections.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change likeAuthorization, replyAuthorization, and announceAuthorization
properties on Object from anyURI (scalar) to their corresponding
Authorization types (non-scalar), enabling dereferencing accessors
(e.g., Object.getLikeAuthorization()).

Also fix the LikeAuthorization alias in the preloaded GTS context to
map to the actual type URI (gts:LikeApproval), and update the context
entry order to match the upstream GoToSocial namespace.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@issues-auto-labeler issues-auto-labeler bot added activitypub/gotosocial GoToSocial compatibility activitypub/interop Interoperability issues component/build Build system and packaging component/federation Federation object related labels Mar 15, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates GoToSocial's interaction control mechanisms into the Fedify framework, providing developers with the tools to manage and enforce interaction policies on posts. The changes involve extending the vocabulary with new types and properties, updating the JSON-LD context for GoToSocial, and ensuring compatibility with the latest Deno environment. This enhancement allows for more granular control over post interactions within federated applications.

Highlights

  • GoToSocial Interaction Controls: Added comprehensive type-safe vocabulary support for GoToSocial's interaction controls, enabling post authors to specify who can like, reply to, or announce their posts and to approve interactions.
  • New Vocabulary Types and Properties: Introduced new types such as InteractionPolicy, InteractionRule, LikeRequest, ReplyRequest, AnnounceRequest, LikeAuthorization, ReplyAuthorization, and AnnounceAuthorization. New properties like interactionPolicy and various authorization references were added to the Object type.
  • JSON-LD Context Update: Updated the preloaded https://gotosocial.org/ns JSON-LD context in @fedify/vocab-runtime to align with the current GoToSocial v0.21+ namespace, including new and deprecated terms for backward compatibility.
  • Dependency and Environment Updates: Updated the Deno version across configuration files (.github/actions/setup-deno/action.yaml, mise.toml, deno.lock) and added deno.temporal to the examples/fresh/deno.json compiler options.
Changelog
  • @fedify/vocab
    • Added GoToSocial interaction controls vocabulary for expressing who can like, reply to, or announce posts and for approving interactions. [[GoToSocial interaction policy vocabulary #453], [GoToSocial interaction controls vocabulary #622]]
    • Added InteractionPolicy and InteractionRule typeless value classes.
    • Added LikeRequest, ReplyRequest, and AnnounceRequest activity types for requesting interaction approval.
    • Added LikeAuthorization, ReplyAuthorization, and AnnounceAuthorization types for proving approved interactions.
    • Added Object.interactionPolicy, Object.approvedBy, Object.getLikeAuthorization()/Object.likeAuthorizationId, Object.getReplyAuthorization()/Object.replyAuthorizationId, and Object.getAnnounceAuthorization()/Object.announceAuthorizationId.
  • @fedify/vocab-runtime
Activity
  • mise run codegen succeeded.
  • mise run check passed.
  • mise run test:deno passed (all 28710 tests, 0 failures).
  • mise run test:bun passed.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dahlia dahlia requested a review from Copilot March 15, 2026 09:44
@dahlia
Copy link
Member Author

dahlia commented Mar 15, 2026

@codex review

@dahlia dahlia self-assigned this Mar 15, 2026
@dahlia dahlia added this to the Fedify 2.1 milestone Mar 15, 2026
@dahlia dahlia added activitypub/compliance Specification compliance component/vocab Activity Vocabulary related and removed component/build Build system and packaging labels Mar 15, 2026
Copy link
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 adds vocabulary support for GoToSocial's interaction controls, which is a valuable addition for interoperability. The changes are extensive, including new vocabulary definitions in YAML, updating the preloaded JSON-LD context, and adjusting tests accordingly. The code is well-structured and follows the project's patterns.

However, I've identified a significant inconsistency regarding the type URIs for ReplyAuthorization and AnnounceAuthorization. The current implementation seems to contradict the official GoToSocial documentation, which could lead to federation issues. I have provided detailed comments and suggestions on the relevant files to align the implementation with the documentation and ensure correctness.

Copy link

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

Adds GoToSocial “interaction controls” vocabulary support to @fedify/vocab and updates @fedify/vocab-runtime’s preloaded https://gotosocial.org/ns JSON-LD context to match current GoToSocial v0.21+ terms.

Changes:

  • Introduces new GoToSocial interaction policy / approval vocab types (policy/rule value objects, request activities, authorization objects) and wires them into Object.
  • Updates default JSON-LD contexts across generated vocab schemas/tests to include https://gotosocial.org/ns.
  • Updates the preloaded GoToSocial JSON-LD context (and fixtures) plus bumps Deno toolchain versions/configs.

Reviewed changes

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

Show a summary per file
File Description
packages/vocab/src/vocab.test.ts Updates JSON-LD context expectations and adjusts auto toJsonLd assertions for non-entity types.
packages/vocab/src/snapshots/vocab.test.ts.snap Updates snapshots to reflect new Object properties and new GoToSocial types.
packages/vocab/src/object.yaml Adds interactionPolicy, approvedBy, and authorization-related properties to Object; adds GoToSocial context.
packages/vocab/src/interactionpolicy.yaml Adds typeless InteractionPolicy value object schema.
packages/vocab/src/interactionrule.yaml Adds typeless InteractionRule value object schema.
packages/vocab/src/likerequest.yaml Adds LikeRequest activity type schema.
packages/vocab/src/replyrequest.yaml Adds ReplyRequest activity type schema.
packages/vocab/src/announcerequest.yaml Adds AnnounceRequest activity type schema.
packages/vocab/src/likeauthorization.yaml Adds LikeAuthorization (GoToSocial LikeApproval) object schema.
packages/vocab/src/replyauthorization.yaml Adds ReplyAuthorization object schema.
packages/vocab/src/announceauthorization.yaml Adds AnnounceAuthorization object schema.
packages/vocab/src/activity.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/accept.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/add.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/announce.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/application.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/arrive.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/article.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/audio.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/block.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/chatmessage.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/collection.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/collectionpage.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/create.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/delete.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/dislike.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/document.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/emojireact.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/event.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/flag.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/follow.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/group.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/ignore.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/image.yaml Expands Image defaultContext to include data-integrity + GoToSocial.
packages/vocab/src/intransitiveactivity.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/invite.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/join.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/leave.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/like.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/listen.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/move.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/note.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/offer.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/orderedcollection.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/orderedcollectionpage.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/organization.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/page.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/person.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/place.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/profile.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/question.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/read.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/reject.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/relationship.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/remove.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/service.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/tentativeaccept.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/tentativereject.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/tombstone.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/travel.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/undo.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/update.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/video.yaml Adds GoToSocial context to defaultContext.
packages/vocab/src/view.yaml Adds GoToSocial context to defaultContext.
packages/vocab-runtime/src/contexts.ts Updates preloaded https://gotosocial.org/ns JSON-LD context with newer GoToSocial terms and proper xsd:boolean typings.
packages/fixture/src/fixtures/gotosocial.org/ns.json Adds fixture JSON-LD context for https://gotosocial.org/ns matching the updated preloaded context.
packages/fedify/src/federation/handler.test.ts Updates expected JSON-LD contexts in handler tests to include GoToSocial namespace.
packages/fedify/src/sig/proof.test.ts Updates expected proof value for createProof() test vector.
mise.toml Bumps Deno tool version to 2.7.5.
.github/actions/setup-deno/action.yaml Keeps CI Deno version in sync with mise.toml (2.7.5).
examples/fresh/deno.json Adds deno.temporal to TS lib list for the Fresh example.
deno.lock Updates lockfile entries consistent with dependency/tooling changes.
CHANGES.md Documents new GoToSocial context update and vocab additions in the changelog.

@chatgpt-codex-connector
Copy link

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

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

codecov bot commented Mar 15, 2026

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

@dahlia
Copy link
Member Author

dahlia commented Mar 17, 2026

@jfietkau Could you look into this when you have some spare time?

Copy link
Contributor

@2chanhaeng 2chanhaeng left a comment

Choose a reason for hiding this comment

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

LGTM!
Btw, I have some questions and suggestions(not necessary).

"deno.ns",
"deno.unstable"
"deno.unstable",
"deno.temporal"
Copy link
Contributor

Choose a reason for hiding this comment

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

As I know, Temporal became stable in Deno version 2.7. Is there a reason why it was added back?

Copy link
Contributor

@2chanhaeng 2chanhaeng Mar 17, 2026

Choose a reason for hiding this comment

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

Oh, this is my mistake. I misread it. Sorry!

Copy link
Member Author

Choose a reason for hiding this comment

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

It's because Deno separated their deno.temporal library since Deno 2.7.5.

Copy link
Contributor

@sij411 sij411 left a comment

Choose a reason for hiding this comment

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

Looks good, but one thing that concerns me is the increased volume of the contexts. We could use conditional context in codegen? (for non-GTS users)

@dahlia
Copy link
Member Author

dahlia commented Mar 17, 2026

@sij411 Hmm, I guess we might be able to implement conditional contexts, but it's probably rather overkill to determine if a peer is using GoToSocial or not…

@dahlia dahlia merged commit e09fd1b into fedify-dev:main Mar 17, 2026
34 of 35 checks passed
@dahlia dahlia deleted the vocab/gts-interaction-controls branch March 17, 2026 08:25
@jfietkau
Copy link

Yeah, I don't see any problems here at a glance. Will have to try it out to see if it does anything unexpected.

It's true that the context could be slimmed down conditionally. However, doing that based on the remote server's software makes little sense to me either – especially since this vocabulary is already used by other implementations besides GoToSocial (currently WAFRN). Maybe that wasn't what was suggested.

If anything, you could remove unused context definitions if none of the corresponding vocabulary is used in the current payload. It's up to you whether that benefit is worth the additional processing time.

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

Labels

activitypub/compliance Specification compliance activitypub/gotosocial GoToSocial compatibility activitypub/interop Interoperability issues component/federation Federation object related component/vocab Activity Vocabulary related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GoToSocial interaction policy vocabulary

5 participants