Repository navigation
Commit 3c48234
fix(plugin-hono-server): drop the retired ui-plugin arm from UI auto-discovery (#20086)
Fixes #15638
Clause-②: no
## What
This PR deletes the `plugin.type === 'ui-plugin'` disjunct and its
"Support legacy 'ui-plugin' and new 'ui' type" comment from the UI
auto-discovery block in `HonoServerPlugin.start()`
(`packages/plugins/plugin-hono-server/src/hono-plugin.ts:521-522` on
`66960564`). The condition is now `plugin.type === 'ui' &&
plugin.staticPath`.
This is item 1 of the maintainer ruling B+ (5557089123), carried out on
the director seat's execution terms (5644357902). Item 2, the boot seam
refusing the retired spelling, was delivered by #16049's enforcement.
This PR reads that refusal and does not re-implement it. There is no
hint specific to the retired spelling: the generic closed-set refusal is
the message.
This PR fills pin C of #16050 (the `it.todo` in
`ui-plugin-auto-discovery.pin.test.ts`). #16050 stays open here; the
seat handles it at landing.
## Reachability probe (the precondition, run before any edit)
A temporary probe (deleted, never committed) ran against the unmodified
tree at `66960564`. It drove the real `ObjectKernel.use()` and
`LiteKernel.use()`, then the real `HonoServerPlugin.init()` and
`start()`, and recorded the route registrations:
| input | ObjectKernel | LiteKernel |
|---|---|---|
| declared `type: 'ui-plugin'`, with `staticPath` and `slug` | refused:
`Failed to load plugin: NAME - PLUGIN_CONTRACT_VIOLATION: ... at
'type'`; not stored | refused: the same text, `code:
PLUGIN_CONTRACT_VIOLATION`; not stored |
| control: `type: 'ui'` | 4 routes (`/probe-console` and
`/probe-console/*`, two registrations each) | 4 routes |
| control: `type: 'driver'` | `[]` | `[]` |
| an admitted `ui` entry flipped to `ui-plugin` before `start()` | 4
routes | 4 routes |
Static census on the same tree:
- The arm iterates `ctx.getKernel().plugins`, and that map has exactly
two writers, both `registerPluginByName`:
- from `ObjectKernel.use()` (`kernel.ts:253`), after `loadPlugin`,
`validatePluginContract` and `assertPluginContract`;
- from `LiteKernel.use()` (`lite-kernel.ts:75`), after
`assertPluginContract`.
No other `plugins.set(` or `registerPluginByName(` call exists outside
tests.
- The CLI's config-object path wraps a bundle that has no `init` in
`AppPlugin`. `AppPlugin`'s `type = 'app'` is a class field and is never
copied from the bundle, and the wrapped object still enters through
`kernel.use()`.
- `type` values handed to `kernel.use()` in the repo:
- Class fields are only `standard`, `server`, `driver`, `objectql` and
`app`.
- The object-literal `type: 'plugin'` hits are `manifest.register(...)`
package manifests, not kernel plugins.
- No in-repo production code produces `ui-plugin` as a type value. The
three non-test, non-doc mentions are package names in comments.
- No in-repo code writes to a registered plugin's `type`.
**Reading.** No path admits a DECLARED `ui-plugin` to the map on either
kernel. The disjunct was unreachable through either kernel's `use()`,
which is the pin file's own reachability standard.
The one residual is the last table row. The contract validates at
`use()` and stores the object by reference, so an object admitted as
`ui` that later rewrites its own `type` did reach the arm. That is a
bypass of the contract, not a path through it: the same bypass works for
every key the contract checks, and nothing in the repo produces it. The
changeset names it, C2 pins it, and it is flagged for the contract
reviewer below.
## Clause-②
Declared from the delivered diff: `no`.
- No file under `packages/spec/src/**` is touched.
- No accept or reject verdict moves for any declared value: `ui-plugin`
was already refused at `use()` on both kernels before this diff.
- The only class whose outcome moves is the post-admission self-rewrite
above: mounted before, not mounted after. That object is off-contract by
the time `start()` reads it, so I read it as outside the conformance
limb. **Reviewer: please confirm or overturn that reading.**
No `**BREAKING**` banner and no ADR-0087 marker are carried.
## Pin C
These cases are in
`packages/plugins/plugin-hono-server/src/ui-plugin-auto-discovery.pin.test.ts`,
using the file's own harness:
- **C1** reads #16049's refusal. A declared `ui-plugin` fixture,
otherwise a complete `ui` fixture, is refused:
- by `LiteKernel.use()`, with `code: PLUGIN_CONTRACT_VIOLATION` at
`'type'`;
- by `ObjectKernel.use()`, with exactly that text behind the loader's
`Failed to load plugin: NAME - ` prefix. This is the F1/F2 parity shape.
- **C2** runs on both kernels. An admitted `ui` entry flipped to
`ui-plugin` before `start()` mounts `[]`. The same case carries a firing
control: same kernel, same fixture, no flip, 4 routes.
- `observe()` gains an optional `beforeStart` hook that receives the
kernel's own admitted entry. C2 is its only caller.
- B, E and F0 still pin the modern arm, and all three are green.
## Evidence (at `7363f0f4`)
- `pnpm --filter @objectstack/plugin-hono-server test`: 26 files, 314
tests passed.
- The pin file alone, verbose reporter: 20 passed, up from 17 plus 1
todo. C1, C2 on ObjectKernel and C2 on LiteKernel are listed by name.
- `pnpm --filter @objectstack/plugin-hono-server typecheck`: exit 0, and
`check:test-typecheck` reports OK. `tsconfig.test.json --listFilesOnly`
includes the pin file.
- **Ablation**, on the committed tree through
`scripts/ablation-replace.mjs` in wrap mode:
- Mutation: restore `(plugin.type === 'ui' || plugin.type ===
'ui-plugin') && plugin.staticPath`. The anchor went from 1 hit to 0 and
the blob from `201c5866` to `ca844899`.
- Result: 2 failed, 18 passed. Both failures are C2 (ObjectKernel and
LiteKernel), each with `expected [ '/console-fixture', …(3) ] to deeply
equal []`. The failure went the expected way (to red).
- Restore proven: the blob is back to `201c5866`, equal to HEAD, and
`git diff HEAD` is empty.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derives 60 commands, identical to the
dispatch list. All 60 ran and exit 0. `--ran` answers "60 derived, 60
run, 0 NOT-MEASURED, 0 UNRUN (a DERIVED zero)".
- `check:dual-build-cjs-loads`, `check:lean-entry-closure` and
`check:type-check-debt` first exited 3 (PREREQUISITE NOT MET). After
`turbo run build --filter='./packages/*' --filter='./packages/*/*'`
(72/72 tasks), all three exit 0.
- The roster families whose roster sits under a touched directory all
exit 0: `check-changeset-fixed`, `check:authz-resolver`,
`check:error-code-casing` and `check:filter-alias-parity`.
- `pnpm lint`, the full union: exit 0.
## Acceptance notes
- Two more parts of the same condition are also unreachable through
either kernel's `use()`: the `plugin.slug ||
plugin.name.split('/').pop()` derivation and the `&& plugin.staticPath`
conjunct. That is already recorded on #16721. This ruling does not cover
them, so they are left untouched.
- The post-admission rewrite residual follows from the documented
validation-only design (`packages/core/src/plugin-contract.ts`: the
parse output is discarded and the object is stored by reference). It
applies to every contract key, not only `type`, and it is not a defect
of this card.
- The `default`/`isDefault` redirect is still unpinned, as the pin
file's header already says.
- `packages/core/src/plugin-loader.ts` and `packages/spec/**` are not
touched. `CHANGELOG.md` and `package.json` are left to the Version
Packages PR.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01TnPAC1UsTGfHPXVUCL6iLn)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 338feda commit 3c48234
3 files changed
Lines changed: 112 additions & 44 deletions
File tree
- .changeset
- packages/plugins/plugin-hono-server/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
522 | | - | |
| 521 | + | |
523 | 522 | | |
524 | 523 | | |
525 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
264 | 268 | | |
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
270 | 285 | | |
271 | 286 | | |
272 | 287 | | |
| |||
280 | 295 | | |
281 | 296 | | |
282 | 297 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 298 | + | |
287 | 299 | | |
288 | 300 | | |
289 | 301 | | |
| |||
359 | 371 | | |
360 | 372 | | |
361 | 373 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 374 | + | |
371 | 375 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
377 | 383 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
383 | 401 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 402 | + | |
| 403 | + | |
396 | 404 | | |
397 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
398 | 456 | | |
399 | 457 | | |
400 | 458 | | |
| |||
0 commit comments