Skip to content

Commit 3eff14f

Browse files
committed
chore: sync origin/main + 整体重生成 spec 基线;补 #5279 fixture 的落地路径
`git merge origin/main`(至 5aae790,无冲突),生成物按 os-regen 四步互保: generated 文件整体 checkout 回合并基线,再 wholesale 重生成,最后断言兄弟 PR 的条目仍在。 两处过程中发现并纠正的坑,记下来免得下一个人重踩: 1. `gen:api-surface` 读的是**构建产物**,不是源码。合并后没重建就重生成,会把 #5021(PR #5289)刚退役的 `AnimationSchema` / `ZIndexSchema` 四行**重新加 回去** —— 正是 AGENTS.md §9 的陈旧产物陷阱。重建 spec 后重生成才对 (4422 → 4418 exports)。 2. 第 2 步的 `git checkout origin/main -- <generated>` 必须用**你实际合并的那个 tip**,不是 `origin/main` 的当前值。main 在我合并与 checkout 之间又前进了, 于是把 #4938 的 http-server 生成文档拉了进来 —— 而我的源码里没有那个改动, 等于提交了一份源码产不出的生成物。改用合并基线 5aae790 后归零。 最终生成物 delta 相对合并基线只有 7 行,纯增量(ApiEndpoint 的保护信封键); #5021 的退役完好(Animation/ZIndex 确认缺席)。 `protocol-publish-drafts-endpoint-gate.test.ts`(#5279,已合入 main)的 ENDPOINT_SCHEMA 用例改了**落地路径**而非断言:该 draft 现在过不了 saveMetaItem 的 422(这正是 #5206「一处修,两面得」要的结果),所以 fixture 改为先按真实写 路径存一条合法 draft、再只污染其 body —— 让那条 backstop 分支仍然被真实覆盖, 而不是删掉用例留一条无测试的活分支。未改该 PR 的任何生产代码。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ErbEDVAg1No9gdg1pgDAGB
1 parent 8b56f11 commit 3eff14f

2 files changed

Lines changed: 31 additions & 22 deletions

File tree

packages/metadata-protocol/src/protocol-publish-drafts-endpoint-gate.test.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,30 @@ describe('publishPackageDrafts — the ADR-0121 endpoint publish gate (#5206 ste
318318
const { engine, rows } = makeStubEngine('showcase');
319319
const protocol = new ObjectStackProtocolImplementation(engine);
320320

321-
// `api` has no entry in BUILTIN_METADATA_TYPE_SCHEMAS (that half is
322-
// #5271, the spec lane), so the direct-write path stores arbitrary JSON
323-
// verbatim. Parsing is the gate's precondition: an unparseable
324-
// declaration cannot be judged and could never be served either.
325-
await saveApiDraft(protocol, 'garbage', { name: 'garbage', totally: 'not an endpoint' });
321+
// [#5271] This comment used to read "`api` has no entry in
322+
// BUILTIN_METADATA_TYPE_SCHEMAS (that half is #5271, the spec lane), so
323+
// the direct-write path stores arbitrary JSON verbatim" — and it minted
324+
// the garbage draft through `saveMetaItem`. That half has now landed:
325+
// `api` resolves `ApiEndpointSchema`, so this body is refused with a
326+
// 422 at the EARLIEST door and the draft can no longer be created at
327+
// all. That is the "一处修,两面得" outcome #5206 asked for, and it is
328+
// asserted on the spec lane's side (packages/objectql
329+
// /src/protocol-meta.test.ts, "refuses a spec-INVALID `api` item").
330+
//
331+
// The `ENDPOINT_SCHEMA` branch this case pins is therefore no longer
332+
// reachable from the Studio write path — it is exactly what the module
333+
// header calls it, a BACKSTOP, for a row that reached the store some
334+
// other way: a direct `metadata.register()`, a migration, or a row
335+
// written before #5271. Deleting the case would leave a live branch
336+
// with no test; re-spelling the body would only re-test the 422. So the
337+
// fixture PLANTS such a row instead of minting one — it saves a valid
338+
// draft through the real write path (so every bookkeeping column is
339+
// byte-for-byte what production writes) and then corrupts only the
340+
// stored body, which is the one thing the earlier door cannot police.
341+
await saveApiDraft(protocol, 'garbage', validEndpoint({ name: 'garbage' }));
342+
const planted = Array.from(rows.values()).find((r) => r.name === 'garbage' && r.state === 'draft');
343+
expect(planted, 'the valid draft must exist before it is corrupted').toBeDefined();
344+
planted!.metadata = JSON.stringify({ name: 'garbage', totally: 'not an endpoint' });
326345

327346
const res = await protocol.publishPackageDrafts({ packageId: PKG });
328347
expect(res).toMatchObject({ success: false, publishedCount: 0 });

packages/spec/authorable-surface.json

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6930,8 +6930,6 @@
69306930
"ui/AddRecordConfig:formView",
69316931
"ui/AddRecordConfig:mode",
69326932
"ui/AddRecordConfig:position",
6933-
"ui/Animation:duration",
6934-
"ui/Animation:timing",
69356933
"ui/App:_lock",
69366934
"ui/App:_lockDocsUrl",
69376935
"ui/App:_lockReason",
@@ -7901,7 +7899,7 @@
79017899
"ui/SyncConfig:maxRetries",
79027900
"ui/SyncConfig:retryInterval",
79037901
"ui/SyncConfig:strategy",
7904-
"ui/Theme:animation",
7902+
"ui/Theme:animation [RETIRED]",
79057903
"ui/Theme:borderRadius",
79067904
"ui/Theme:colors",
79077905
"ui/Theme:customVars",
@@ -7912,7 +7910,7 @@
79127910
"ui/Theme:name",
79137911
"ui/Theme:shadows",
79147912
"ui/Theme:typography",
7915-
"ui/Theme:zIndex",
7913+
"ui/Theme:zIndex [RETIRED]",
79167914
"ui/TimelineConfig:colorField",
79177915
"ui/TimelineConfig:endDateField",
79187916
"ui/TimelineConfig:groupByField",
@@ -7940,10 +7938,10 @@
79407938
"ui/TreeConfig:labelField",
79417939
"ui/TreeConfig:parentField",
79427940
"ui/Typography:fontFamily",
7943-
"ui/Typography:fontSize",
7944-
"ui/Typography:fontWeight",
7945-
"ui/Typography:letterSpacing",
7946-
"ui/Typography:lineHeight",
7941+
"ui/Typography:fontSize [RETIRED]",
7942+
"ui/Typography:fontWeight [RETIRED]",
7943+
"ui/Typography:letterSpacing [RETIRED]",
7944+
"ui/Typography:lineHeight [RETIRED]",
79477945
"ui/UrlNavItem:badge",
79487946
"ui/UrlNavItem:badgeVariant",
79497947
"ui/UrlNavItem:icon",
@@ -8044,14 +8042,6 @@
80448042
"ui/WidgetProperty:name",
80458043
"ui/WidgetProperty:required",
80468044
"ui/WidgetProperty:type",
8047-
"ui/WidgetProperty:validation",
8048-
"ui/ZIndex:base",
8049-
"ui/ZIndex:dropdown",
8050-
"ui/ZIndex:fixed",
8051-
"ui/ZIndex:modal",
8052-
"ui/ZIndex:modalBackdrop",
8053-
"ui/ZIndex:popover",
8054-
"ui/ZIndex:sticky",
8055-
"ui/ZIndex:tooltip"
8045+
"ui/WidgetProperty:validation"
80568046
]
80578047
}

0 commit comments

Comments
 (0)