test(data-objectstack): pin listImportMappings against the measured GET /meta/mapping body - #7738
Merged
zhuangjianguo merged 1 commit intoSep 5, 2026
Conversation
…meta/mapping body
objectui#14026 hypothesised that GET /api/v1/meta/mapping serves publish
envelopes, so the adapter's top-level `targetObject` filter would read
`undefined` on every item and the wizard's saved-mapping selector could never
appear. Measured on the framework's real REST list door over a registered
`mapping` artifact: items are raw spec documents carrying `targetObject` at
the top level, inside the `{ type, items }` envelope. The adapter's filter is
correct against that body.
This pin feeds that verbatim body through a `fetch` stub so the real
`@objectstack/client` `meta.getItems` and the adapter's filter both run, and
asserts the artifact targeting the object comes back as served. Test only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Contributor
✅ 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
|
zhuangjianguo
marked this pull request as ready for review
September 5, 2026 14:04
zhuangjianguo
deleted the
claude/issue-14026-import-mapping-selector-probe
branch
September 5, 2026 14:19
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of objectstack-ai/objectstack#14026 — measurement round; no runtime code changes.
What was measured
The card's working hypothesis was that
GET /api/v1/meta/mappingserves publish envelopes ({ name, packageId, state, metadata }), so the adapter's top-leveltargetObjectfilter would read nothing on every item and the wizard's saved-mapping selector could never appear on any deployment.Executed against the framework at objectstack
132742f10(packages/rest, the same harness asimport-integration.test.ts: realObjectQL+ sqlite:memory:+ realObjectStackProtocolImplementation+RestServer's registered route table), with amappingartifact registered through each of the three producer paths — manifestmappings:viaregisterApp, directregistry.registerItem, andMetadataManager.registerinstalled as themetadataservice (the file-based artifact loader's registrar). The list door answers{ "type": "mapping", "items": [ ... ] }, and every item is the raw document withtargetObjectat the top level, decorated with_packageId/_provenance/_diagnostics; no item carries a nestedmetadatamember.GET /api/v1/meta/typeslistsmappingin the live set, so the door does not refuse the kind. The hypothesis is dead; the adapter's filter is correct against the served body, and the wizard is unchanged because it was already correct.What this PR adds
packages/data-objectstack/src/listImportMappings.test.tsfeeds that verbatim body through afetchstub, so the real@objectstack/clientmeta.getItemsand the adapter's own filter both run, and asserts that the artifact targeting the object comes back as served — with the fields the wizard'sasSavedMappingpredicate needs — while an artifact targeting another object does not.Red-then-green, stated plainly: the pin is green on the current code on its first run (2 passed, exit 0), because the code is right. Ablating the filter to the hypothesised envelope depth (
m.metadata?.targetObject; mutation confirmed on disk by anchored grep counts, original 1 to 0 and mutant 0 to 1) turns it red —AssertionError: expected [] to deeply equal [ 'task_feed_import' ], 1 failed, exit 1. Restore to HEAD is proven by an emptygit diff HEADand a matching HEAD blob hash; the re-run is 2 passed, exit 0.Changeset: empty frontmatter (test only, nothing released).
Checks run, exit codes captured before any pipe, all at
6cbaed1pnpm exec vitest run packages/data-objectstack/src/listImportMappings.test.ts— 2 passed, exit 0pnpm exec vitest run packages/data-objectstack/— 56 files, 739 tests passed, exit 0pnpm --filter @object-ui/data-objectstack type-check— exit 0;tsc --listFilesshows the new test file in the population (1 hit)pnpm --filter @object-ui/data-objectstack lint— 0 errors, 424 pre-existing warnings, exit 0node scripts/check-control-bytes.mjs— OK, exit 0node scripts/check-changeset-presence.mjs— exit 0;node scripts/check-changeset-no-major.mjs— exit 0Session:
https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ🤖 Generated with Claude Code
https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Generated by Claude Code