Skip to content

Epic: implement ADR-0087 — metadata protocol upgrade contract (handshake · conversion · migration chain) #2643

Closed
4 of 4 issues completed

Description

@os-zhuang

Tracking epic for landing ADR-0087 (accepted in #2582). The ADR designs how externally developed, AI-agent-maintained metadata apps upgrade stably across protocol majors — arriving from any past version — instead of crashing on a deliberate, gated, documented break.

Why (the problem the ADR closes)

ADR-0059 already guarantees a breaking change cannot leave this repo silently (frozen witnesses + pre-publish hotcrm smoke). What is missing is the consumer side: a package built against protocol N loaded by an N+2 runtime is never told "incompatible — here is the migration"; it runs until some deep .parse() or renderer contract fails. And PluginEnginesSchema.protocol (packages/spec/src/kernel/manifest.zod.ts) — the field that should gate this — is declared, documented, and checked nowhere, an ADR-0078 "declarable-but-inert" violation.

The preference ladder (design, not restated here — see the ADR)

  • L0 — don't break: ADR-0059's gates, unchanged.
  • L1 — break invisibly: a versioned load-time conversion layer (most breaks need zero consumer action). → P1
  • L2 — break executably: a permanent, fixture-tested migration chain, migrate meta --from N replays any past major → current. → P2
  • L3 — break loudly & structurally: enforce the engines.protocol handshake with a machine-actionable diagnostic. → P0
  • verify: the consumer's own validate && typecheck && test loop is the acceptance test.

Governing constraint: timeliness is never load-bearing (a cross-major consumer was never present for any warning window), and the consumer's maintainer is an AI agent (machine-executability + structure beat human notification).

Phases (independently shippable, evidence-gated)

Do not parallelize: P1 depends on P0's PROTOCOL_VERSION + handshake seam; P2/P3 depend on P1. The ADR gates each phase on evidence from the previous.

Boundaries

  • Nothing in ADR-0059 changes; the conversion layer converts at load and never rewrites consumer source (that is P2's explicit migrate meta only).
  • The consumer-side autonomous-upgrade agent is out of scope (belongs to consumers / ADR-0033 toolchain); this epic makes it possible.

Existing momentum (already in the ADR-0087 direction)

Live deprecation windows to route through the new pipeline (not the old hand-migration path)

These are the first real test subjects for P1/P2 — retire them via a conversion-table entry + chain step, not a bespoke tombstone:

Refs: ADR-0087, ADR-0059, ADR-0078, ADR-0025 §3.2/§3.10.

Activity

  1. added theissue type on Jul 5, 2026
  2. os-zhuang commented on Jul 15, 2026

    @os-zhuang
    ContributorAuthor

    Epic 状态更新(评估 + 收尾开发,#2972):

    #2972 合并后建议:勾选本 epic 的 P0/P1/P2 三项,P3 一项保持未勾(由 #2648 记录 deferred 状态),然后可以关闭本 epic 或保留至 P3 决策。


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions