Skip to content

[finding] spec: MetadataChangedEventPayloadSchema says every metadata persistence layer MUST emit it — zero producers or consumers in-tree, and its bigint version field cannot cross JSON #14180

Description

@claude

Found while implementing #13331 (which had to answer where the cluster payload contract lives). Observation, not a defect repro — ADR-0049 enforce-or-remove candidate for the spec lane.

Measurement (origin/main at 2bff79a)

packages/spec/src/kernel/cluster.zod.ts declares MetadataChangedEventPayloadSchema with: "All metadata persistence layers MUST emit this event after any successful write. Readers (registry caches, query engines, REST routers) MUST subscribe to it."

Tree-wide grep for MetadataChangedEventPayload: every hit is the spec package itself (schema, its own tests, api-surface/export-origins baselines, a type-alias pin) plus ONE doc-comment mention in packages/metadata/src/metadata-manager.ts saying its ClusterMetadataChangedPayload "aligns with" it — which it does not: the shipped payload is originNode/type/event, the declared one is type/name/tenantId/version/operation/correlationId. Zero runtime producers, zero subscribers, zero imports outside spec.

Both shipped cluster channels ignore it:

Structural note: the declared version field is z.bigint(). JSON.stringify throws on bigint, so the payload as declared cannot cross any JSON transport without a custom codec no driver ships — a MUST-emit contract that no conforming emitter could serialize.

What this card asks

The spec seat's enforce-or-remove call: either a consumer materializes (and the shipped channels are migrated onto it — which #13331's ruling argues against for the registry lane, since peers deliberately re-read rather than version-compare), or the declared payload is retired via the ADR-0087 route. Not this lane's file surface (packages/spec single owner).

Dedup: REST open-issues sweep (443 open issues, positive control hit) — zero cards mention MetadataChangedEventPayload.


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions