Repository navigation
fix(types,layout,plugin-designer)!: the app wizard saves only keys the spec AppSchema declares; the top-level favicon retires (objectui#10842) - #10863
Conversation
…e spec AppSchema declares; the top-level favicon retires (objectui#10842) wizardDraftToAppSchema wrote top-level type, title, favicon and layout, which @objectstack/spec's strict AppSchema refuses, so the metadata door answered 422 INVALID_METADATA. It now writes name, label, description, icon, branding and navigation only. AppComponentSchema.favicon retires to branding.favicon on both faces (the objectui#10827 rule), and AppSchemaRenderer reads branding.favicon. EditAppPage keeps only keys the spec's AppSchema declares from the served app, and its pre-fill reads no retired spelling. Claude-Session: https://claude.ai/code/session_01MCg3z5cGrV51xEddpGcxEY Co-authored-by: Claude <noreply@anthropic.com>
…t move with the converter The ablation that re-adds a top-level `title` to wizardDraftToAppSchema turned the CONTROL red as well as the pins, because the control spread the converter's output and the refused keys' order moved with it. The control now writes the old output out as a literal and compares the refused keys as a set. Claude-Session: https://claude.ai/code/session_01MCg3z5cGrV51xEddpGcxEY Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: 286/286 Read: card objectui#10842 body and its thread (carried findings ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
Fixes #10842
Clause-②: yes
Corrected from
noby the seat after the at-tier review: a published accept set on@object-ui/typesnarrows (faviconretires on both faces) andwizardDraftToAppSchema's return type changes; the at-tier PASS is on record on this PR.The Studio's "create app" and "edit app" pages now save an app document that
@objectstack/spec's strictAppSchemaaccepts. The app favicon has one spelling,branding.favicon.Door measurement
Measured:
422 INVALID_METADATA. The base wizard's create payload is refused at the save door. This is the p1 trigger named in the triage.How it was measured:
origin/mainde091b50, in a throwawaygit worktreeunder this run's scratch directory. It was never committed, and the shared objectstack checkout was not edited. The@objectstack/restdependency closure (26 packages) was built there.PUT /api/v1/meta/:type/:nameandGET /api/v1/meta/:typeroute handlers ofRestServer. Under them sit the realObjectStackProtocolImplementation, a realObjectQLengine and in-memory SQLite. This is the harness of objectstack'smeta-view-overlay-options-bag.test.ts. It runs in-process, not on a booted server, and the auth context is stubbed (resolveExecCtx).client.meta.saveItemsendsPUT /api/v1/meta/app/NAMEwith the document as the body (read from the installed@objectstack/client17.4.0).wizardDraftToAppSchemafrom base4aebea0on a draft shaped the wayAppCreationWizardbuilds one: an object entry, a group and a branding block.INVALID_METADATA, one issue:unrecognized_keysat the root, "Unrecognized key(s) on this app:type,title,favicon,layout. Did you meantitle→label? …"GET, merged the old way with the base outputsys_metadatadirectly with the old wizard's keys:GETservestype,title,favicon,layoutandlogobackEditAppPagemerge)The list door also serves a read decoration,
_diagnostics. The save door strips it (stripReadDecorations), so echoing it is harmless: the served item saved back unchanged answers 200.What this does
@object-ui/types,wizardDraftToAppSchema. It returns only keys the spec'sAppSchemadeclares:name,label(the draft title),description,icon,brandingandnavigation. It writes notype(the renderer-node discriminator), notitle, no top-levelfaviconand nolayout. Its return type is now the spec'sAppinput shape with objectui'sNavigationItem[]asnavigation, instead ofAppComponentSchema. No export is added:Appwas already imported as a type inapp.ts.@object-ui/types, one favicon spelling.AppComponentSchema.faviconisneveron the TypeScript face. The zod mirror refuses a top-levelfaviconby name throughaliasKeyRefusal, answering "Did you meanfavicon→branding?". This is the objectui#10827 pattern from PR objectui#10849, applied to the favicon.@object-ui/layout.AppSchemaRendererhandsAppShellthe favicon frombranding.favicon. The console already reads that spelling throughConsoleLayout.@object-ui/plugin-designer,EditAppPage. The save keeps the keys the wizard does not maintain, but only keys the spec'sAppSchemadeclares. The list comes fromObject.keys(AppSchema.shape), computed on first use, the same way app-shell'sObjectViewreadsListViewSchema(getListViewConfigKeys). The pre-fill no longer falls back onto a top-levellogo,faviconortitle. It readsbranding.logo,branding.faviconandlabel.content/docs/core/app-schema.mdxexamples and the properties table usebranding.favicon.The key mapping, checked against the spec (W2)
objectstack
origin/mainde091b50(packages/spec/src/ui/app.zod.ts) and the installed@objectstack/spec17.4.0 agree on each point:AppSchemais a strict object.labelis declared and required.titleis in the alias table, and that entry is a refusal hint ("did you meantitle→label?"). The spec does not foldtitleintolabel.faviconis declared only onAppBrandingSchema.typeandlayoutare declared nowhere on an app.The installed schema's declared top-level keys were read off
AppSchema.shape.Census: top-level app
favicon(the W3 stop gate)This census was read at base
4aebea0overpackages/**,apps/**,examples/**andcontent/docs/**, with CHANGELOGs excluded.wizardDraftToAppSchema, the only production writer. This PR removes the write.app-schema.mdxexamples and its table row (moved tobranding.favicon);phase2-schemas.test.ts(moved);app-creation-types.test.ts(rewritten);page-app-dashboard-spec-parity.test.ts(the key removed from it);AppSchemaRenderer(moved) andEditAppPage's pre-fill fallback (dropped). The runner'sLayoutRendererreads no favicon.AppShellBranding.favicon.ConsoleLayoutalready feeds it fromactiveApp.branding.favicon, and theconsole-architecture.mdexample documents that prop.branding.faviconUrlinruntime-config.ts,index.htmlandmain.tsx.⇒ No writer outside the wizard exists, so the stop condition does not fire.
File surface outside the claim
packages/plugin-designer/package.jsonandpnpm-lock.yaml.EditAppPagereads the declared-key list from@objectstack/spec/uiat runtime. That is the W4 route "ONE list sourced from the spec", and a restated list was not needed because the spec exports one. plugin-designer's build externalizes every bare import, so the package now declares@objectstack/spec^17.4.0, the range@object-ui/typesdeclares.check:phantom-deps,check:unused-deps,check:lockfile-integrityandcheck:lockfile-dedupeare green.app-logo-one-spelling-10827.test.ts, pin (c). The wizard output is a saved document, not a renderer node, so it no longer carriestype: 'app', and the renderer-node mirror cannot judge it. Pin (c) now parses the output with the spec'sAppSchema, which is the judge at the door. Its intent is unchanged: no top-levellogo, and the output is accepted.Verification (all at
7356c90)packages/types/src/__tests__/app-declared-keys-10842.test.ts:AppSchema, and carries no key outsideAppSchema.shape;labelandbrandingcarry the draft's values, and none oftype,title,favicon,layoutorlogois present;unrecognized_keysnaming exactly those four keys;favicon(invalid_typeatfavicon, message namingbranding), andbranding.faviconparses on both schemas;favicon(@ts-expect-error).packages/layout/src/__tests__/AppSchemaRenderer.brandingFavicon-10842.test.tsx:branding.faviconreaches the#faviconlink;hrefalone;packages/plugin-designer/src/__tests__/EditAppPage.declaredKeys-10842.test.tsx. It mounts the realEditAppPage, with the wizard stubbed to complete with the page's own pre-fill:_diagnosticsare dropped, andrequiredPermissionsandisDefaultare kept;logo,faviconandtitle;branding.logoandbranding.faviconare pre-filled.pnpm exec vitest run --maxWorkers=2 packages/types/ packages/layout/ packages/plugin-designer/ packages/runner/:Test Files 311 passed (311),Tests 5905 passed (5905).pnpm --workspace-concurrency=2 --filter @object-ui/types --filter @object-ui/layout --filter @object-ui/plugin-designer --filter @object-ui/runner run type-checkexits 0. Each script is echoed (packages/X type-check$ tsc --noEmit && … tsc -p tsconfig.test.json), and each endsDone. It ran after a turbo build of the dependency closure.tsc -p tsconfig.test.json --listFilesOnlylists each new test in its own package.plugin-designer/srcprobe wrote{ type: 'app', favicon: '/x.ico' }.tsc --noEmitexited 2 withTS2322: Type 'string' is not assignable to type 'undefined'at the probe. The probe was removed, andgit statusis clean.scripts/ablation-replace.mjsin WRAP mode, on a committed tree.title: the anchorlabel: draft.title,becomestitle: draft.title, label: String(draft.title),. The anchor count went 1 → 0, and the blob went0a6753d4dc1a→e07a339ac23a.4 failed | 15 passed (19). The three converter pins and the objectui#10827 pin (c) went red. The CONTROL stayed green, which is the expected direction.0a6753d4dc1a), andgit diff HEADis empty.3aec465, also turned the CONTROL red, because the control spread the converter's output. Commit7356c90rewrote the control as a literal, and the ablation was run again with the result above.7356c90, all exit 0. Each is listed with its own verdict line:check-changeset-presence: "11 source file(s) of 3 released package(s) changed, and this change declares 1 changeset(s)";check-changeset-no-major,check-changeset-fixed,check-changeset-overwrite;check:changeset-claims: 13 pending changesets name files touched here. Each paragraph was read, and none speaks of the app favicon, the wizard or these keys;check:pending-changeset-literals.check:new-line-citations("0 new citation(s)") andcheck:control-bytes.check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shapeandcheck:test-path-roots.check:phantom-deps,check:unused-deps,check:self-import,check:lockfile-integrity,check:lockfile-dedupe,check:installed-pin-claimsandcheck:pre-install-import-graph.check:spec-symbols,check:metadata-write-doors,check:handler-key-reads,check:unreferenced-sources,check:designer-field-key-parity,check:component-surface-parity(report-only),check:esm-specifiersandcheck:readme-exports.check:doc-snippets: "678 of 678 block(s) judged, 0 failed";check:doc-examples,check:doc-types,check:doc-fences,check:doc-example-ids,check:doc-example-readers,check-doc-expression-carriageanddocs:check-links.check-governed-queue-guard --teston the 15 paths:NOT GOVERNED.check:spec-floorsexits 1, and none of its findings is in a package this PR touches:floor-too-lowfindings in@object-ui/app-shell(its^17.3.0range against 17.4.0 symbols in itspreviewsdist);no-artifactforplugin-tree, which was not built.plugin-designer(^17.4.0, new here) andlayouthave no finding.eslint.config.jsmatch**/*.{ts,tsx}. The.md,.mdx,package.jsonand lockfile changes are outside it.eslint --format jsonover the 11 touched.ts/.tsxfiles gives 11 files, 0 errors and 7 warnings. None of the warnings falls on an added line.eslint.config.jssets noparserOptions.projectorprojectService, so no type-aware linting runs, and this diff cannot move a verdict on a file it does not touch.@object-ui/app-shelltests and type-check. This PR changes no app-shell file. The public type changes reach app-shell only throughAppComponentSchema.faviconand the wizard's return type, and agit grepfinds no read of either in app-shell. CI runs the full set.Acceptance notes
LayoutRendererreads thelayoutof its own app JSON). Before this PR, the key blocked the whole save. The Layout radio inAppCreationWizardnow changes nothing that persists. Whether to retire that step, or to takelayoutto the spec, is a decision named in the report. It is not taken here.addNavItem('separator')writeslabel: '', and the spec's separator branch declares nolabel. Measured at the same door, the control document plus one wizard separator answers 422unrecognized_keysatnavigation.2. This is the divergence theapp.tsheader already records as blocker 3 (objectui'sNavigationItemrequireslabel), so it is not changed here.EditAppPagedrops a storedbranding.accentColoron every edit. Its pre-fill copies onlylogo,primaryColorandfaviconinto the draft, and the wizard'sbrandingreplaces the stored one. Measured with the new page harness: a stored{ primaryColor, accentColor }saves as{ logo: '', primaryColor, favicon: '' }. This loses a declared key, which is a different class from this card, so it is left as is.AppComponentSchemastill declares its localtitleandlayout, the renderer-node vocabulary.AppSchemaRendererreadstitle, notlabel. W3 names only the favicon, so those two are not retired here.EditAppPagestill readsappToEdit.layoutinto the wizard's draft. Nothing saves it.version,homePageId, …) are members ofAppSchema.shapeas tombstones. A legacy row carrying one would be kept by the filter, and the door would refuse it with the spec's own prescription. No such row was measured.Changeset
.changeset/10842-wizard-app-declared-keys.md:@object-ui/typesminor, with the break stated:wizardDraftToAppSchema's return shape changed, andAppComponentSchema.faviconisneverand refused by name;@object-ui/layoutpatch;@object-ui/plugin-designerpatch.This PR was made in session
https://claude.ai/code/session_01MCg3z5cGrV51xEddpGcxEY(seatdomain:ui#4).Generated by Claude Code