Skip to content

[finding] hono UI auto-discovery: the slug-from-name fallback and the staticPath guard are unreachable through kernel.use() once PluginSchema requires both keys (#16334) #16599

Description

@huangyiirene

Observation from #16334 (spec half of #16049), filed unassigned. Sub-issue of #15638 because it is the same block and the same class — an arm of the auto-discovery block in packages/plugins/plugin-hono-server/src/hono-plugin.ts (around line 508) that no object can reach any more.

What is dead, and since when

Evidence. The two pins that exercised those branches through the real kernel — "derives the slug from the last path segment of the plugin name when none is declared" and "a ui type with no staticPath mounts nothing" in src/ui-plugin-auto-discovery.pin.test.ts — had to be inverted into refusal pins on the #16334 PR (#16598): with the schema tightened, kernel.use() throws PLUGIN_CONTRACT_VIOLATION … at 'slug' / at 'staticPath' before start() ever runs. The it.todo for case C in that file still narrates a boot path that "never calls PluginSchema", which stopped being true at #16363.

Left out of #16334 by scope. Retiring the two arms is a plugin-hono-server change with its own verification surface, and #15638 already owns the third arm of the same guard. Suggested shape, for whoever lands it: read plugin.slug and plugin.staticPath as the contract now guarantees them, drop the fallback and the guard, and rewrite the case-C todo against the post-#16363 boot path. The same block also reads an isDefault alias beside default (plugin.default || plugin.isDefault); isDefault is not a PluginSchema key and is worth a look in the same pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions