Skip to content

Fix indexed profile matching for broad source keys - #34

Merged
stackoverfloweth merged 1 commit into
mainfrom
codex/fix-indexed-profile-source-keys
Oct 1, 2026
Merged

stackoverfloweth merged 1 commit into
mainfrom
codex/fix-indexed-profile-source-keys

Conversation

@pleek91

@pleek91 pleek91 commented Sep 30, 2026

Copy link
Copy Markdown
Member

Description

Fixes map and mapMany accepting unrelated source/destination pairs when a registered profile has a string source key. The index introduced in #32 can combine entries in that case, allowing 'b' → 'y' when only 'a' → 'y' is registered.

The source and destination type helpers now check the requested source key after looking up the profile in the index. This rejects the invalid calls while keeping the indexed lookup and leaving runtime behavior unchanged. Regression tests cover both methods, valid broad keys, literal and union keys, and async results.

A synthetic benchmark using TypeScript 5.6.3, 160 profiles, and 960 mapping calls measured 1,648,393 type instantiations versus 1,646,407 for #32 (+0.12%). Median check time across three runs was 0.30s for both. These are local benchmark results, not measurements from the app used in #32.

npm run types, npm run lint, npx vitest run --typecheck (12 tests), and npm run build pass. The new invalid-pair assertions fail against #32. Also removes an extra blank line in profile.ts that caused lint to fail on the current base.

@netlify

netlify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kitbag-mapper ready!

Name Link
🔨 Latest commit 13b2050
🔍 Latest deploy log https://app.netlify.com/projects/kitbag-mapper/deploys/6abd7f5713e4f80008856786
😎 Deploy Preview https://deploy-preview-34--kitbag-mapper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@stackoverfloweth
stackoverfloweth merged commit ee970a6 into main Oct 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants