D02 ACCEPTED / CONTRACT REGISTRY V1

一个 schema,约束全部生产者与消费者

把六个核心仓里的 Auth、App、Release、Event、Media、Order、MarketSlice 与 Run 收敛为可查询、可生成、可做破坏性 diff 的契约面;数值枚举只留在显式 legacy adapter。

PREVIOUSD0123 repository manifests · accepted
THIS KNIFED028 contracts · 16 fixtures · 3 bindings
ACCEPTEDD03UI Foundation · accepted
·
REMAINING33of 36 implementation knives

CONTRACT CONTROL PLANE

8 个领域契约、9 份 schema、0 个已知破坏变更

稳定性与生产部署分开表达:QuantRun 已有 TARGET 合同,但 quant-platform 仍没有生产运行时,页面不会把 schema 当成已实现能力。

CONTRACTS8

跨 Identity、Open、Release、Realtime、Resource、Booking、Market Data、Quant。

SCHEMAS9

8 个领域对象 + 1 个统一 ErrorEnvelope。

FIXTURES16

每个契约各有 producer / consumer fixture。

LANGUAGES3

TypeScript、Go、Swift 由同一注册表生成。

DEPRECATION180d

删除字段、枚举或语义前的最短兼容窗。

BREAKING DIFF0

required、type 与 enum baseline Gate 当前通过。

PRODUCER → REGISTRY → CONSUMER

契约是跨仓边界,不是某个仓里的私有类型

Owner 决定语义;生产者提交 fixture;消费者用同一 schema 校验;生成器输出三种语言;破坏性改动默认 fail closed。

PRODUCERS · 6reits-authminiapp-open-platformim-corereits-mediapublic-booking-platformtrading-data-sourcequant-platform
CANONICAL REGISTRYcontract-registry/v1JSON Schemaowner + versiondeprecation windowErrorEnvelope
CONSUMERS · 10miniapp-open-platformpublic-booking-platformim-corematrix-x-chat-iosdeveloper-portalreits-mediareits-auth
CI GATEproducer fixture+consumer fixture+baseline diff+generated driftPASS

ENUM CONFLICT CLOSED

普通 / 企业不再由 0 和 1 猜测

REITS 数据库和 XTalk 参考代码的历史映射方向相反。公共 API 只允许 ordinary / enterprise;数值只能在具名 adapter 内翻译。

PUBLIC API · CANONICALSAFE

AppType

ordinaryenterprise

numeric values: forbidden

reits-db-v1ADAPTER ONLY

miniapp-open-platform database only

0
ordinary
1
enterprise

不得从该边界继续传播 raw number。

xtalk-reference-v1ADAPTER ONLY

xtalk-open-source import only

0
enterprise
1
ordinary

不得从该边界继续传播 raw number。

SEARCHABLE REGISTRY

按契约、Owner、仓库和成熟度检索

展开一条契约即可查看 exact source、consumer、schema、fixture、兼容规则与 machine dossier。

8OF 8 CONTRACTS
契约 / 版本Owner / ProducerConsumers兼容与弃用
IdentityAuthSessionauth-session · v1.0.0Identity Platformreits-auth157b8590e4623 consumersminiapp-open-platform · public-booking-platform · im-coreSTABLEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/auth-session.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEreits-authinternal/store/session.go

157b8590e4625ad2fda802410303461a69a74bd3

FIXTURE PAIRproducer + consumerauth-session

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • required field removal
  • field type change
  • enum value removal
  • session state semantic change
Open PlatformDeveloperAppdeveloper-app · v1.0.0Developer Platformminiapp-open-platform00c4ae2baaa43 consumersminiapp-open-platform · matrix-x-chat-ios · developer-portalSTABLEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/developer-app.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEminiapp-open-platformservices/developer-api/internal/contract/app_type.go

00c4ae2baaa44abb4ed9f31832686883cca703e8

FIXTURE PAIRproducer + consumerdeveloper-app

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • named enum removal
  • public numeric enum exposure
  • required field removal
  • owner semantics change
ReleaseReleaseCandidaterelease-candidate · v1.0.0Release Platformminiapp-open-platform00c4ae2baaa43 consumersminiapp-open-platform · reits-media · developer-portalCANDIDATEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/release-candidate.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEminiapp-open-platformservices/developer-api/internal/handlers/api.go

00c4ae2baaa44abb4ed9f31832686883cca703e8

FIXTURE PAIRproducer + consumerrelease-candidate

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • release state removal
  • artifact checksum weakening
  • version identity change
RealtimeEventEnvelopeevent-envelope · v1.0.0Event Platformim-coredeea700b3a9e3 consumersmatrix-x-chat-ios · miniapp-open-platform · public-booking-platformCANDIDATEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/event-envelope.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEim-coreinternal/contract/envelope.go

deea700b3a9e970b1d1738ff381c4bc8b3e0a935

FIXTURE PAIRproducer + consumerevent-envelope

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • event identity removal
  • idempotency removal
  • trace context removal
  • payload type narrowing
ResourceMediaAssetmedia-asset · v1.0.0Media Platformreits-mediaportal-d01-o3 consumersminiapp-open-platform · im-core · public-booking-platformCANDIDATEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/media-asset.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEreits-mediaAPI upload and asset contracts

portal-d01-observed

FIXTURE PAIRproducer + consumermedia-asset

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • checksum removal
  • scan state removal
  • storage reference change
  • size type narrowing
BookingBookingOrderbooking-order · v1.0.0Booking Platformpublic-booking-platformcc2466284f283 consumerspublic-booking-platform · reits-auth · developer-portalSTABLEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/booking-order.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEpublic-booking-platformserver booking routes and persistence

cc2466284f28f77efc493338dccf0b12ac23a2a2

FIXTURE PAIRproducer + consumerbooking-order

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • order state removal
  • money precision change
  • idempotency removal
  • revision removal
Market DataMarketSlicemarket-slice · v1.0.0Market Datatrading-data-source55b1ad8271763 consumersquant-platform · matrixantai-backtest · developer-portalCANDIDATEbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/market-slice.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEtrading-data-sourceinternal/server/server.go

55b1ad827176b0937963d5694f411e901665fcfd

FIXTURE PAIRproducer + consumermarket-slice

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • time range semantic change
  • checksum removal
  • license class removal
  • status removal
QuantQuantRunquant-run · v1.0.0Quant Platformquant-platform535041b190403 consumersmatrix-quant-im-ios · matrixantai-backtest · developer-portalTARGETbackward · 180d minimum
CANONICAL SCHEMA/schemas/contracts/v1/quant-run.v1.schema.json

JSON Schema 2020-12 · additional fields fail closed where declared.

SOURCE EVIDENCEquant-platformREADME.md (target boundary; runtime absent)

535041b190403769364b0ce2853f0f7f7fbb5877

FIXTURE PAIRproducer + consumerquant-run

Both fixtures pass the same canonical schema in CI.

BREAKING DIFF RULES
  • provenance hash removal
  • run state removal
  • input slice removal
  • error contract removal
GENERATED BINDINGS

三种客户端不再手抄类型

生成物带 DO NOT EDIT 标记;注册表或 schema 改动后必须重新生成,CI 会拒绝 drift。

npm run contracts:generate
ERROR ENVELOPE

错误也属于契约

{
  "code": "invalid_request",
  "message": "request rejected",
  "traceId": "tr_01JY…",
  "retryable": false,
  "details": {}
}
打开 ErrorEnvelope schema →
BREAKING-CHANGE GATE

默认 fail closed

  1. required 字段不可静默删除
  2. 字段类型不可原位改变
  3. 命名 enum 值不可删除
  4. 生成物不可落后 schema
npm run contracts:verify
CURRENT KNIFE · D05 / 36

D02 契约已进入 D04 的全仓消费者证据 Gate

共享 UI 基础与 18 个核心仓的 Task Packet/consumer evidence 已验收;当前统一 release identity、制品、配置与 SecretRef,剩余 32 刀。