feat(spec)!: 删除 per-provider connector "模板"簇 —— 已被否决架构的 2672 行残留,零消费者 (#4480) - #4500
Merged
Merged
Conversation
) BREAKING CHANGE: @objectstack/spec/integration no longer exports the six per-provider connector schemas — DatabaseConnectorSchema, FileStorageConnectorSchema, GitHubConnectorSchema, MessageQueueConnectorSchema, SaasConnectorSchema, VercelConnectorSchema — nor their ~100 sub-schema/type/ example exports (2,672 lines). The six generated reference pages go with them. #4480 started as one dead key (DatabaseConnector.readReplicaConfig, found while removing datasource.readReplicas in #4468) and scoped out to the whole cluster: zero consumers for all six schemas. Nothing in the monorepo imported any of them — not the automation engine (engine.registerConnector validates against ConnectorSchema from connector.zod.ts, engine.ts:1379), not the `connectors:` stack collection (DeclarativeConnectorEntrySchema), not even their own module's live half. They were the losing side of a decided architecture fight, left standing. ADR-0023 rejected hand-modelling each external system's shape inside the spec; ADR-0097's connector protocol does the opposite — provider shapes come from the provider itself (connector-openapi materializes instances from an OpenAPI document, connector-mcp from an MCP server). The templates hardcoded Postgres/S3/GitHub/RabbitMQ/Vercel shapes nothing would ever read, and were semantically wrong where they overlapped the live platform: DatabaseConnectorSchema modelled "tables to sync", CDC, and readReplicaConfig — read-replica routing declared a SECOND time, down to a `weight` field for a load balancer that does not exist. External-database access is datasource federation (ADR-0015), which is live and is not a connector. The removal kit: - integration/index.ts: six export lines removed; module header now records the decision so the next reader finds the ADR trail, not a gap - json-schema.manifest.json: 47 entries deleted deliberately (the gen:schema ratchet's documented retirement path) - authorable-surface.json: 365 lines deleted deliberately (gate (a)'s strict- removal trip wire, whole-cluster edition) - api-surface.json regenerated from the rebuilt dist - docs: six connector-* reference pages deleted, plus three sibling pages (message-queue/object-storage/tenant under references/integration) whose entire content documented deleted-file exports; section meta + index regenerated; hand-written tables in references/index.mdx and getting-started/quick-reference.mdx rewritten around the one live protocol - PROTOCOL_MAP.md: six rows collapsed into the connector.zod.ts row (the protocol-map link test is what caught this surface) - v17 release notes: dead-clusters table row - changeset: major, with the no-migration rationale (these schemas validated no stored metadata, so there is no D2 conversion to register — nothing to rewrite) No runtime behaviour changes: the ADR-0097 path — ConnectorSchema, DeclarativeConnectorEntrySchema, the provider contract, connector-descriptor, connector auth — is untouched, which the service-automation suite (609 tests) confirms. Follow-up filed: #4499 — automation/trigger-registry.zod.ts carries a THIRD declaration of the same business need (its own ConnectorSchema cluster, ~440 lines, zero runtime consumers; the engine imports integration's schema). Kept out of this PR: that file mixes the dead cluster with trigger-registry exports that need individual verdicts. Closes #4480 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WsgTqRF58HsQYKLsrZ5pQY
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 107 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4480
从一个字段到一个簇
#4480 立案时是一个死字段:
DatabaseConnector.readReplicaConfig(#4468 删datasource.readReplicas时发现的读副本第二处声明)。issue 自己写了先决条件:"先确认DatabaseConnectorSchema整体的活性,别一个字段一个字段地拆。"确认的结果:整个
integration/connector/*目录 —— 6 个 schema、2672 行、~110 个导出 —— 零消费者。engine.registerConnector()校验的是connector.zod.ts的ConnectorSchema(engine.ts:1379),从来不是模板connectors:集合走DeclarativeConnectorEntrySchema(stack.zod.ts:395),也不是模板为什么是"删"而不是"接上"
这不是没做完的功能,是已分胜负的架构之争里输掉的那一方,而裁决就写在同目录活文件的头注释里:
ConnectorSchema,provider 形状来自 provider 自己 —— connector-openapi 从 OpenAPI 文档物化实例,connector-mcp 从 MCP server 物化模板把 Postgres/S3/GitHub/RabbitMQ/Vercel 的形状硬编码进没人读的 spec 文件,而且在与活平台重叠处语义就是错的:
DatabaseConnectorSchema建模"要同步的 tables"+ CDC +readReplicaConfig—— 后者把读副本路由第二次声明出来,精确到一个不存在的负载均衡器的weight字段。外部数据库接入是 datasource federation(ADR-0015),是活的,而且不是 connector。留着的危害即 #3950 先例:下一个人 grep 到
FileStorageConnectorSchema会以为平台支持 S3 连接器,然后在死代码上盖楼。删除清单
integration/connector/整目录(6 zod + 6 test);integration/index.ts六行 export,模块头注释改为记录这次决定和 ADR 线索json-schema.manifest.json有意删 47 条(gen:schema 棘轮的文档化退休路径)connector-*参考页删除;另有 3 页(references/integration/下的message-queue/object-storage/tenant)全部内容都在文档化已删文件的导出(逐页验证过),随 gen:docs 一并消失;章节 meta/index 重新生成;references/index.mdx与quick-reference.mdx的手写表格改写为单一活协议(计数 139→133、175→169)connector.zod.ts一行 —— 这个面是protocol-map.test.ts的链接存在性测试抓出来的,不是我记得的验证
@objectstack/spec— 280 files / 7078 tests passed(含 protocol-map 链接测试,先红后修)@objectstack/service-automation— 609 tests passed —— 这是关键回归面:它是@objectstack/spec/integration的真实消费者,609 全绿证明 ADR-0097 活路径未被触碰@objectstack/cli— 689 tests passedtsc --noEmitPASS后续(已开,未指派)
#4499 —— 定级时发现 "connector" 在 spec 里其实被声明了三次:
automation/trigger-registry.zod.ts还有第三份自成体系的ConnectorSchema簇(~440 行,同样零运行时消费者),且connector.zod.ts的头注释还在教用户"什么时候选它"。没并进本 PR:那个文件混着可能被 flow 侧使用的 trigger-registry 导出,需要逐个甄别,塞进来会把单一叙事的删除变成两场审计。Generated by Claude Code