Skip to content

feat(annotations): Name each Annotation's object by its subject - #4320

Merged
BYK merged 2 commits into
feat/github-issue-assignee-itemsfrom
feat/annotation-subjects
Nov 25, 2026
Merged

BYK merged 2 commits into
feat/github-issue-assignee-itemsfrom
feat/annotation-subjects

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

First step of making Conversation Annotations lean pointers. This adds the design doc and gives each Annotation the subject of its object and what the Conversation did to it. Cards and webhooks still read and write the saved JSON. Later PRs read cards live, delete the status writes, and drop the saved facts.

Design and terms

  • New design/annotations.md, linked from design/README.md.
  • TERMINOLOGY.md: Annotation is now a pointer from one Conversation to an object that it created, changed, or attached. A Message card is shown with the object's live card, else its label.

Data

junior_conversation_annotations gains subject_kind, subject_id, and action (created | changed | attached), plus an index on the subject.

  • subject_kind uses the Inbox form: <plugin>:<kind>, or a core kind (automation, or link when the provider id is not known, with the link as the id).
  • A later change keeps created, because the Conversation still created the object.
  • The Inbox annotation owner lookup reads the subject columns, not the JSON objectId.
  • Old workers keep writing JSON-only rows during rollout, so a trigger fills the subject and the action from the JSON. A bounded backfill runs the same trigger for existing rows. GitHub pull requests get GitHub's id from the code change records. Issues get the objectId that feat(github): Add an Inbox item for the assignees of an issue Junior opened #4308 saved. Everything else that has no known id becomes a link. Old JSON rows don't say which Conversation created an object, so the backfill marks them changed.
  • The JSON objectId index stays for now because old workers still query it. PR 6 drops it.

Plugin API

  • objectSubjectSchema ({kind, id}) replaces objectAnnotationSchema.objectId.
  • Tool and hook results (objectAnnotations, afterMcpTool) use annotatedObjectSchema, which adds a required action (created | changed).
  • A subject kind must be one that the plugin registers in inboxSubjects. Core rejects any other kind, so an Annotation and an Inbox item about the same object always match.

Plugins

  • GitHub: pull requests and issues name their subject by GitHub's id.
  • Google: registers calendar_event (owner annotation).
  • Vercel: registers deployment. vercel_inspectDeployment is read-only, so it no longer returns objectAnnotations. Core already rejected that result.
  • Linear: registers issue (label Ticket). The subject id is the Ticket identifier because the hosted MCP does not reliably return the Ticket's uuid. A Ticket that moves to another team changes its identifier.
  • Automations: core automation subject, created from the create tool and changed from the update tool.
  • Attached links: attached, with the plugin's subject when its link type knows the id, else link.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 25, 2026 14:27
An Annotation now stores the subject of its object, in the Inbox form
(`<plugin>:<kind>` or a core kind), and what the Conversation did to it:
created, changed, or attached. Tool and hook results name the subject and
the action, with the kinds that the plugin registers in `inboxSubjects`.
The subject replaces `objectId`, and the Inbox owner lookup reads it. A
trigger fills both columns for rows that old workers write, and for
objects whose provider id is not known.

Also adds the Annotations design doc and its terms.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 25, 2026 2:39pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 25, 2026

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d526076. Configure here.

Comment thread design/annotations.md Resolved
Comment thread design/annotations.md Resolved
@BYK
BYK merged commit 2413253 into feat/github-issue-assignee-items Nov 25, 2026
8 checks passed
@BYK
BYK deleted the feat/annotation-subjects branch November 25, 2026 15:01

This branch was successfully deployed

1 active deployment
Preview – junior-docs — d5260765 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant