Commit 8649b39
feat(scripts): gate that kernel-reaching pages are declared in a discoverable shape (#12266)
What makes something a served page is membership in a manifest bundle's `pages:`
array -- verified against the kernel's own read path, not the card's prose: both
seams that admit a page (registerApp at the manifest, the nested-plugin seam in
registerPlugin) funnel into registerMetadataCollections, which reads
`source['pages']` and hands each entry to registerItem('page', ...). There is no
third entry route; definePage() is PageSchema.parse(), an authoring door whose
result still has to land in a `pages:` array.
The canonical-envelope gates (#11255 -> #11480) discover their population by
export shape instead (`export const X: Page =`), an approximation #11480
measured failing on a live page. Measuring the residual across the tree at
f11fc61 found the class still open in exactly one place: CONNECT_AGENT_PAGE
(packages/mcp), a bare `export const ... = { ... }` reaching the kernel through
CONNECT_AGENT_UI_BUNDLE.pages, in a package carrying no page gate.
check:page-declaration-shape makes the approximation exact by construction: every
IDENTIFIER entry in a `pages:` array must resolve to `export const X: Page =` or
`export const X = definePage(...)`. Judging identifier entries catches 100% of
the real population (34 entries) and admits 0% of the noise -- the 62 inline
literals are all migration fixtures in spec/conversions/registry.ts, and the 181
string entries are book/doc page-NAME lists. Comment masking is the shared
js-comment-mask.mjs, never a private stripComments.
CONNECT_AGENT_PAGE is annotated, the same type-level-only repair #11574 applied
to MarketplaceInstalledPage.
Claude-Session: https://claude.ai/code/session_01UjM2ia8Av1v5NqfqQEQmC6
Co-authored-by: Claude <noreply@anthropic.com>1 parent 071ec4e commit 8649b39
5 files changed
Lines changed: 537 additions & 1 deletion
File tree
- .changeset
- .github/workflows
- packages/mcp/src
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1171 | 1171 | | |
1172 | 1172 | | |
1173 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1174 | 1185 | | |
1175 | 1186 | | |
1176 | 1187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
0 commit comments