Skip to content

Add TM8b summaryVersion on MessageAnnotations#482

Draft
AndyTWF wants to merge 1 commit into
mainfrom
summary-version
Draft

Add TM8b summaryVersion on MessageAnnotations#482
AndyTWF wants to merge 1 commit into
mainfrom
summary-version

Conversation

@AndyTWF
Copy link
Copy Markdown
Contributor

@AndyTWF AndyTWF commented May 26, 2026

Summary

Adds summaryVersion to MessageAnnotations so SDKs surface an identifier for the summary itself, distinct from the referenced message's serial/timestamp/version.

Motivation

The existing fields on Message all refer to the message being annotated, not to the summary delivered alongside it. That leaves consumers with no way to:

  • order two successive summaries of the same referenced message, or
  • reason about when a particular summary was produced (as opposed to when the underlying message was published).

This is especially important because the summary version advances on every summary publish — including ones that produce an empty summary — so the version is the only reliable ordering signal for summary updates.

Changes

  • features.md:
    • New spec items TM8b, TM8b1, TM8b2, TM8b3 under MessageAnnotations.
    • IDL updated with summaryVersion: SummaryVersion? on MessageAnnotations and a new SummaryVersion class.
  • api-docstrings.md:
    • summaryVersion row added to MessageAnnotations.
    • New class SummaryVersion section with serial and timestamp.

TM8b3 is explicit that the SDK MUST populate summaryVersion from the wire when present (regardless of whether summary is empty) and MUST NOT synthesise a default when absent — leaving it unset (e.g. null) instead. This avoids SDKs inventing version identifiers that could collide or mislead consumers.

Test plan

  • Spec linter passes ((cd build && npm run lint)) — confirmed locally.
  • Reviewer confirms TM8b* IDs do not collide with any in-flight PRs.
  • IDL block matches the new spec items.

🤖 Generated with Claude Code

Successive annotation summaries on the same referenced message need an
identifier that is independent of the referenced message's `serial`,
`timestamp`, and `version` (which all refer to the message being
annotated, not to the summary). Without this, consumers cannot order
two summaries of the same message, or tell when a summary itself was
produced.

Introduces `MessageAnnotations.summaryVersion` (TM8b) and a new
`SummaryVersion` class with `serial` (TM8b1) and `timestamp` (TM8b2).
TM8b3 spells out that the SDK populates it from the wire when present
(including when `summary` is empty, since the version advances on
every summary publish) and must not synthesise a default when absent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant