Repository navigation
refactor(console): re-key the API Console storage catalog to the canonical storage slot - #10498
Conversation
…nical `storage` slot `@objectstack/spec` now publishes `storage` in `CoreServiceName`, so the service-gated endpoint catalog is keyed by the canonical slot. The console-side alias table and the special-cased lookup in `discover()` are removed: the page reads `services.storage` and nothing else. The tripwire block in `useApiDiscovery.test.ts` now pins the canonical key and pins the deprecated `file-storage` alias as never read. Claude-Session: https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN Co-authored-by: Claude <noreply@anthropic.com>
… patch Claude-Session: https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN Co-authored-by: Claude <noreply@anthropic.com>
✅ 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: Branch check: ① Derived judgmentsWhich released objectstack versions announce Does the console still support 17.0.0 backends. No documented server-version floor exists: Stop condition versus the no-staged-window posture. Read literally, the stop condition fires: a released GA server (
Tests, read not run. Head file: 11 Other readers. ② Semver level
Changeset prose, sentence by sentence: keyed by ③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
Fixes #5291
Clause-②: no — a console-internal catalog is re-keyed to the spec's canonical slot name. No library export, schema or accept set moves.
Dispatched by the
domain:uiseat 2 PM loop, sessionhttps://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN(os-dev,mode:subagent).What changed
apps/console/src/pages/developer/hooks/useApiDiscovery.ts: the Storage entry ofSERVICE_ENDPOINT_CATALOGis keyedstorage, the canonicalCoreServiceNameslot, and no longer the deprecatedfile-storage.DEPRECATED_SERVICE_SLOT_ALIASESand the special-cased lookup indiscover()are removed. The lookup isdiscoveredServices[serviceName]again, so the page reads the canonical key and nothing else.useApiDiscovery.test.ts:SERVICE_ENDPOINT_CATALOG.storageas defined,SERVICE_ENDPOINT_CATALOG['file-storage']as undefined, andstorageas aCoreServiceNamemember.file-storagerow alone renders no group.routes.storageis used when the service row carries noroute.storage..changeset/5291-api-console-storage-slot.md:@object-ui/consolepatch.Premise check (base
cdefa2a06, theorigin/mainthis branch was cut from)apps/console:node -e "process.exit(require('@objectstack/spec/system').CoreServiceName.options.includes('storage')?0:1)";@objectstack/spec@17.4.0;CoreServiceName.optionslists bothstorageandfile-storage;'file-storage'and the alias table was present.CHANGELOG.md(entry593c4bf, under its 17.1.0 heading) says: "Discovery reports the service under the canonicalstoragekey and mirrors the row verbatim under thefile-storagekey for the alias's v17 lifetime".origin/maincorroborates this in both producers.packages/runtime/src/http-dispatcher.tsbuilds thestorageand'file-storage'entries from the samesvcAvailable(routes.storage, ...)expression.packages/metadata-protocol/src/protocol.tsassignsservices['file-storage'] = { ...services['storage'] }.git grep -n -E "file-storage|fileStorage|file_storage"over the whole tree, excludingCHANGELOG.mdfiles and the lockfile, hits only the two touched files.git grep -c DEPRECATED_SERVICE_SLOT_ALIASES -- apps packageshits both files on base.useApiDiscoveryhas one importer,ApiConsolePage.tsx, which uses only the hook.Verification
The final head is
b609d15dc. The changeset commit on top of3e11bd3cftouches no code, so the touched test file has the same bytes at both commits.Red on base, green on head: the touched test file.
Head:
pnpm exec vitest run apps/console/src/pages/developer/hooks/useApiDiscovery.test.tsprintedTests 14 passed (14). The lock printedVERDICT command-exit 0.Base leg: the source file was replaced on disk by the base blob, and the new test file was kept.
git hash-objectequalled the base blob0d878ff02.DEPRECATED_SERVICE_SLOT_ALIASESwent from 0 to 4 occurrences, and the canonical-key linestorage: {went from 1 to 0.Tests 3 failed | 11 passed (14)and exited 1.git checkout HEAD --on that path, with a trap. The disk blob then equalled the HEAD blob18ed1d6c8, andgit diff HEADwas empty.The three cases that failed on base:
does not read the deprecated file-storage alias: "expected { key: 'Storage', ... } to be undefined".falls back to routes.storage when the service row advertises no route: got/api/v1/storage/...instead of/api/v2/files/.... On base theroutesmap was indexed withfile-storage, a keyApiRoutesSchemadoes not have.the storage group is keyed by the canonical slot, never by the deprecated alias: "catalog must be keyed by the canonical storage slot: expected undefined to be defined".Green on both, by design:
SLOTS.has('storage')asserts the installed spec, not the source.Package suite:
pnpm exec vitest run --maxWorkers=2 apps/console/atb609d15dcprintedTest Files 116 passed (116)andTests 1270 passed (1270). The lock printedVERDICT command-exit 0. The 116 files equal the tracked test-file count underapps/console, which includes the touched one.Typecheck:
turbo run build --filter="@object-ui/console^..." --concurrency=2printed34 successful, 34 total.pnpm --filter @object-ui/console type-check(bothtsclegs) exited 0 with 0error TS, and the lock printedVERDICT command-exit 0.tsc --noEmit --listFilesOnlyinapps/consolelists both touched files, among 3793 files in the program.Lint:
pnpm --filter @object-ui/console exec eslint . --format jsoncovered 220 files with 0 errors. The warnings are pre-existingno-explicit-any/set-state-in-effect; the touched test file has 0.Gates. The base is pinned with
--base cdefa2a06/OS_CHANGESET_BASE. Each verdict line is quoted.check-changeset-presence2 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s): .changeset/5291-api-console-storage-slot.md.check-changeset-claimsNo pending changeset names a file this change touches.check-changeset-no-majormajorbump.check-changeset-overwriteNo pre-existing changeset was modified or deleted.check-changeset-fixedAll workspace packages are in the changeset fixed group.check:new-line-citationsVERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0check:control-bytescheck-control-bytes: OKcheck:i18n-driftNo en value changed in this range.check:spec-symbolsnothing cites a key its spec symbol does not declare.check:unreferenced-sourcesOK Every shipped source file in every covered package is reachable.check:test-path-rootscheck-test-path-roots: OKcheck:vi-mock-specifierscheck-vi-mock-specifiers: OKcheck:vi-mock-inheritcheck-vi-mock-inherit: OKcheck:vi-mock-override-shapecheck-vi-mock-override-shape: OKcheck:installed-pin-claimsOKcheck:pending-changeset-literalsNo test source names a pending changeset.NOT MEASURED:
check:readme-exports. Reason: prerequisite not met locally, because it needs every package'sdistand printed "543 self-import(s) could not be judged ... run pnpm build first". Its population ispackages/*/README.mdagainst package type entries, and this diff touches neither. CI owns it.Acceptance notes
file-storage. Against such a backend the API Console now hides the Storage group, fail-closed like any slot absent from/discovery. Every backend that carries the mirror renders the same group as before. The card and its re-queue scope the retirement of the console-side alias to now, not staged. The changeset states this behaviour change.http-dispatcher.tsandprotocol.ts) have comments that name objectui's console endpoint catalog as a reader of thefile-storagekey. Once this lands, that is no longer true. This is comment drift with no behavioural consequence. Noted, not filed. Carrier: whoever retires the alias at the next major.Generated by Claude Code