Add CommunityActivity ontology + optional responseOptions on CalendarEvent#1091
Conversation
📝 WalkthroughWalkthroughThe ontology schemas are updated to support calendar event response options, and a new draft-07 ChangesOntology schema updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
services/ontology/schemas/calendarEvent.json (2)
128-136: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider enforcing
additionalProperties: falseand usingconst.Since the root
CalendarEventschema strictly disallows additional properties, applying the same strictness to theresponseOptionsitems will prevent arbitrary properties from being injected into the response objects. Additionally, in JSON Schema Draft-07, usingconstis more idiomatic than a single-itemenum.♻️ Proposed refactor
"kind": { "type": "string", - "enum": [ - "choice" - ], + "const": "choice", "default": "choice" } - } + }, + "additionalProperties": false }🤖 Prompt for 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. In `@services/ontology/schemas/calendarEvent.json` around lines 128 - 136, Update the responseOptions item schema around the kind property to set additionalProperties to false, matching the strictness of the root CalendarEvent schema, and replace the single-value kind enum with const while preserving its default value of choice.
109-111: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAdd
responseOptionsto the clientCalendarEventtype.platforms/calendar/client/components/calendar/calendar-types.tsstill omits the new schema field, so typed consumers can’t access it.🤖 Prompt for 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. In `@services/ontology/schemas/calendarEvent.json` around lines 109 - 111, Add the responseOptions field to the client CalendarEvent type in calendar-types.ts, matching the schema’s optional array shape and response option item structure so typed consumers can access it.
🤖 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 `@services/ontology/schemas/communityActivity.json`:
- Around line 10-13: Update the activityType enum in the community activity
schema to use canonical ActivityStreams names with standard capitalization:
Announce, Question, Offer, and Invite. Remove acknowledge, and preserve the
existing field and description unless the implementation instead explicitly
renames the field to indicate a project-local mapping.
---
Nitpick comments:
In `@services/ontology/schemas/calendarEvent.json`:
- Around line 128-136: Update the responseOptions item schema around the kind
property to set additionalProperties to false, matching the strictness of the
root CalendarEvent schema, and replace the single-value kind enum with const
while preserving its default value of choice.
- Around line 109-111: Add the responseOptions field to the client CalendarEvent
type in calendar-types.ts, matching the schema’s optional array shape and
response option item structure so typed consumers can access it.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4cccb895-ef9f-449e-9e50-d9cdf16d21e1
📒 Files selected for processing (2)
services/ontology/schemas/calendarEvent.jsonservices/ontology/schemas/communityActivity.json
| "activityType": { | ||
| "type": "string", | ||
| "enum": ["announce", "question", "offer", "invite", "acknowledge"], | ||
| "description": "W3C ActivityStreams verb — the semantics of the activity" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '1,120p' services/ontology/schemas/communityActivity.jsonRepository: MetaState-Prototype-Project/prototype
Length of output: 3342
🌐 Web query:
W3C ActivityStreams activity type vocabulary Announce Question Offer Invite Acknowledge
💡 Result:
In the W3C ActivityStreams 2.0 vocabulary, the types Announce, Question, Offer, Invite, and Acknowledge are handled as follows: Announce: This is a defined Activity type [1][2]. It indicates that the actor is calling attention to the object [1]. It inherits all properties from the base Activity type [1][3]. Question: This is a defined Activity type [1][2]. It represents a question being asked [3]. It inherits all properties from the base Activity type [1][4]. Offer: This is a defined Activity type [1][2]. It indicates that the actor is offering the object [1]. If specified, the target indicates the entity to which the object is being offered [1]. It inherits all properties from the base Activity type [1]. Invite: This is a defined Activity type [1][2]. It is a specialization of the Offer activity type [1][3]. It indicates that the actor is extending an invitation for the object to the target [1]. It inherits all properties from the Offer activity type [1]. Acknowledge: This activity type is not part of the W3C ActivityStreams 2.0 vocabulary [1][5][6]. All Activity types in the W3C ActivityStreams 2.0 vocabulary inherit from the base Activity type, which itself is derived from the Object type [1][7]. Specific specializations exist, such as Invite being a form of Offer [1][2].
Citations:
- 1: https://www.w3.org/TR/activitystreams-vocabulary/
- 2: https://www.w3.org/TR/2017/REC-activitystreams-vocabulary-20170523/
- 3: https://w3c.github.io/activitystreams/vocabulary/
- 4: https://www.w3.org/TR/2016/CR-activitystreams-vocabulary-20161215/
- 5: https://www.w3.org/ns/activitystreams/v1
- 6: https://w3c.github.io/activitystreams/activitystreams-vocabulary/
- 7: https://www.w3.org/TR/activitystreams-core/
Use canonical ActivityStreams activity names.
activityType claims W3C ActivityStreams semantics, but the enum uses project-local lowercase slugs and includes acknowledge, which is not a W3C ActivityStreams activity type. If this field is meant to interoperate, use the standard terms (Announce, Question, Offer, Invite) and drop acknowledge, or rename the field to make the mapping explicit.
🤖 Prompt for 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.
In `@services/ontology/schemas/communityActivity.json` around lines 10 - 13,
Update the activityType enum in the community activity schema to use canonical
ActivityStreams names with standard capitalization: Announce, Question, Offer,
and Invite. Remove acknowledge, and preserve the existing field and description
unless the implementation instead explicitly renames the field to indicate a
project-local mapping.
What
Adds the
CommunityActivityontology and an optionalresponseOptionsfield onCalendarEvent, both used by the Meshenger post-platform.communityActivity.json(new)A generic, domain-level "a platform posted something to a community that members see and may respond to". Deliberately not a presentation/UI object —
activityTypefollows W3C ActivityStreams (announce|question|offer|invite|acknowledge) and carries the meaning; the renderer decides the look. It doubles as the generic fallback a renderer uses for any envelope it doesn't specifically know but that carriessummary+responseOptions. Responses are recorded as separateRelationenvelopes (predicaterespond) authored by the responder — never written back into the activity.calendarEvent.json(+ optionalresponseOptions)An optional RSVP-style choice array (
{id,label,value?,kind:"choice"}). A tap is recorded as arespondRelation (object = the event's uri, value = chosen).Poll/Votemodel options natively and intentionally do not use this mixin.CalendarEventisadditionalProperties: false, so the field must be declared here to validate.Note for maintainers
reminder.jsondoes not appear to exist inservices/ontology/schemas/(onlytask/taskNote/taskReference). If reminders are meant to flow through AaaS awareness, areminder.jsonmay need publishing here too — happy to follow up separately.🤖 Generated with Claude Code
Summary by CodeRabbit