Repository navigation
Commit 06513bc
test(spec): the deleted-baseline reachability pin measures descent below the unregistered connector root again (#29831)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBY61hHdLdFdzwXbxaNtv58y)_
Fixes #29668
## 维护者速读
- 改了什么:`build-schemas-check-mode.deleted-baseline.test.ts` 的 #17356
用例在原有的根自身 def(`integration/DeclarativeConnectorEntry`)旁,新增一个挂在未注册根
`connector` 之下的
def:`integration/ConnectorInstanceBearerAuth`(`connector.auth` → 实例鉴权联合
→ `bearer` 分支),并加夹具诚实守卫。仅测试,+97/−1。
- 为什么改:#29573 把该用例的样本移到根自身 def 后,实测它已不能判别 #17356 缺陷:根集合收窄回已注册类型时,它经共享的
`_lock` 等记账键实例被读成 derived-clone,删除照样被拒;新样本此时读 `null`,会被 proof 2
豁免,正是该缺陷的形态。
- 风险与回滚:不改任何生成器或 schema,不动任何接受集合;回滚即 revert 本 PR。
- 先看:测试文件中 `DELETED_BENEATH_UNREGISTERED_KIND_DEF` 的文档注释,再看 `beforeAll`
里 #29668 守卫和 #17356 用例中新增的四条断言。
- 两分钟验证:`pnpm --filter @objectstack/spec exec vitest run --project repo
scripts/build-schemas-check-mode.deleted-baseline.test.ts -t
17356`,预期通过;把 `computeSurfaceReachability()` 的 BFS
改为不下探未注册根,预期本用例在新断言处变红,下方两次消融均已实测。
- 需要你做的:无,席位落地。
Clause-②: no
Metadata-protocol: none
## What changes
- **Depth specimen.** The #17356 case seeds a third deleted base line,
`integration/ConnectorInstanceBearerAuth:zzBeneathAnUnregisteredRoot29668`,
and asserts that check (c) refuses it: in the eager regime it reads `def
reachable from the metadata-type roots; … was LIVE`, in the lazy regime
`def … was LIVE (never tombstoned)`, and in neither does it read `def
not reachable from the …` (the proof-2 waiver). The existing specimen
and its assertions are unchanged. It runs in the same spawned run as the
existing specimen, so no new spawn and no test-budget change.
- **Fixture guard.** `beforeAll` holds the def beneath `connector` and
beneath no other root. It reads the def the way the gate does, on both
routes: its own instance in a BFS closure (`zodChildSchemas`), and a
shape entry (same name, same instance) held by a visited object node
(`zodShapeOf`). It also checks the def is still emitted with authorable
keys. Imports added for the guard only: `getMetadataTypeSchema`,
`ConnectorInstanceBearerAuthSchema`, `zodChildSchemas` and `zodShapeOf`.
- **Docblock.** The constant's docblock says why the root's own def no
longer discriminates, gives the measurement, and lists the nine sibling
arms that qualify the same way.
## Why
#29573 moved the #17356 specimen from `integration/RetryConfig` to the
connector root's own def. The card asks for a specimen beneath that root
again. Measuring which one qualifies on `main` turned up more than the
card said: the root's own def no longer catches the defect at all.
Every metadata document carries the shared bookkeeping keys (`_lock`,
`_lockReason`, …) as the same schema instances. So with the roots
narrowed back to `listMetadataTypeSchemaTypes()` (the #17356 defect),
`integration/DeclarativeConnectorEntry` resolves as `derived-clone`
through any registered root's `_lock`, and check (c) still refuses its
deletion. Only the wording changes. The existing pin goes red on that
wording, but the waiver it was written against no longer happens to it.
## Measurement (on `main` at 0e4b0fa)
A one-off probe, deleted before commit, ran the gate's own walk
(`zodChildSchemas` closure plus the shape-entry bridge) over every
Integration/Shared/… namespace export, in both schema regimes. Defs that
read `root-graph` from `connector` and not from the other 32 roots:
| def | without `connector` | on the surface |
|---|---|---|
|
`integration/ConnectorInstance{NoAuth,BearerAuth,APIKeyAuth,BasicAuth,OAuth2AuthorizationCodeAuth,OAuth2ClientCredentialsAuth,AppCredentialAuth,SignedAlipayV3Auth,SignedAliyunAcs3Auth,SignedTencentCloudTc3Auth}`
| `null` | yes (10) |
| `integration/ConnectorInstance{Auth,OAuth2Auth,SignedAuth}` (unions) |
`null` | no keys |
| `integration/DeclarativeConnectorEntry` (the root's own def) |
`derived-clone` | yes |
With the registered set alone (30 roots, the pre-#17356 roots):
`DeclarativeConnectorEntry` gives `derived-clone`,
`ConnectorInstanceBearerAuth` gives `null`, in both regimes. `bearer`
was picked as the plainest arm.
## Ablations (the new assertion, red; then restored)
Each ablation edited `packages/spec/scripts/build-schemas.ts`, ran
`vitest run --project repo … -t 17356` under `os-verify-lock`, and was
restored with `git checkout`. The committed tree has no generator
change.
1. **Stop the walk at the unregistered roots.** The root stays visited,
but the BFS does not push its children. Exit 1, red at the new eager
assertion (`:617`). The gate printed:
-
`integration/ConnectorInstanceBearerAuth:zzBeneathAnUnregisteredRoot29668
— def not reachable from the 33 metadata-type roots` (waived)
-
`integration/DeclarativeConnectorEntry:zzOnlyRootIsAnUnregisteredKind17356
— def reachable from the metadata-type roots; … was LIVE (never
tombstoned).` (the existing assertions held)
Only the new specimen measures the descent.
2. **Narrow the roots back to the registered set** (the #17356 defect:
drop the `listUnregisteredKindSchemaTypes()` line from
`reachabilityRootTypes()`). Exit 1, red at the existing wording
assertion (`:606`). The gate printed:
- `ConnectorInstanceBearerAuth:… — def not reachable from the 30
metadata-type roots` (waived)
- `DeclarativeConnectorEntry:… — def authorable through a derived clone
of a root-reachable schema; … was LIVE` (still refused)
This confirms the docblock's claim with the real gate.
## Item 1 (ruled, already on `main`)
Item 1 was ruled by the maintainer on PR #29573 (comment 6593804783, 「显式
{} 就清掉,带前提」), and #29573 built it and is merged. The HTTP-door pin is on
`main`:
`packages/qa/dogfood/test/connector-meta-door-url-and-nested-keys.dogfood.test.ts`,
test "`retryConfig: {}` replaces the stored one whole: the next read of
the stored row no longer has the undeclared key", in the CARRY-FORWARD
describe. It is a `PUT /meta/connector/:name` of the served form with
`retryConfig: {}` over a seeded row holding `retryConfig.secret`. It
asserts a `withheld-key-dropped` advisory at
`connectors[0].retryConfig.secret`, the stored row's `retryConfig` equal
to `{}`, and a control that a withheld position outside `retryConfig` is
still carried forward. The served-object variant is in
`connector-meta-door-undeclared-keys-withheld.dogfood.test.ts`. This PR
adds no dogfood pin.
## Verification
All under `scripts/pm/os-verify-lock.sh` on head `d1cdcbe1`, shared box:
- `pnpm --filter @objectstack/spec build`: exit 0 (93 s).
- `pnpm --filter @objectstack/spec test`: exit 0, 23961 passed, 1 todo.
- `pnpm --filter @objectstack/spec test:repo`: exit 0, 89 files, 1522
tests (the deleted-baseline file runs here: 15/15, 186 s alone).
- `pnpm --filter @objectstack/spec check:test-typecheck` and
`check:scripts-typecheck`: exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands`: 58 families, each run
and recorded. `--ran` exits 0 with 56 run, 2 NOT MEASURED, 0 unrun. NOT
MEASURED: `check:dual-build-cjs-loads` and `check:lean-entry-closure`,
both exit 3 because they need every package's `dist` and only spec was
built. CI's Build Core runs them, and a test file under
`packages/spec/scripts/` moves no dist. `check-plugin-teardown-shape
--self-test` first exited 3 on the shallow clone; after `git fetch
origin 621a487` it exited 0.
- `node scripts/check-commit-card-trailers.mjs --range
origin/main..HEAD`: exit 0.
## Acceptance notes
- **Changeset: none, label `skip-changeset`.** AGENTS.md (Post-Task
Checklist 3) reserves the label for "a diff that publishes nothing from
any released package". `packages/spec/package.json` `files` does not
include `scripts/`, so this test file publishes nothing.
- `Clause-②: no` and `Metadata-protocol: none`: no accept set and no
authorable surface moves (the diff is one test file).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufzeePBUouzbRj7MtDva
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2c881fb commit 06513bc
1 file changed
Lines changed: 102 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
129 | 166 | | |
130 | 167 | | |
131 | 168 | | |
| |||
215 | 252 | | |
216 | 253 | | |
217 | 254 | | |
| 255 | + | |
218 | 256 | | |
219 | 257 | | |
220 | 258 | | |
| |||
274 | 312 | | |
275 | 313 | | |
276 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
277 | 361 | | |
278 | 362 | | |
279 | 363 | | |
| |||
502 | 586 | | |
503 | 587 | | |
504 | 588 | | |
505 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
506 | 592 | | |
507 | 593 | | |
508 | 594 | | |
| |||
520 | 606 | | |
521 | 607 | | |
522 | 608 | | |
523 | | - | |
524 | | - | |
525 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
526 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
527 | 623 | | |
528 | 624 | | |
529 | 625 | | |
| |||
544 | 640 | | |
545 | 641 | | |
546 | 642 | | |
| 643 | + | |
| 644 | + | |
547 | 645 | | |
548 | 646 | | |
549 | 647 | | |
| |||
0 commit comments