Skip to content

fix: correct category field mapping in baozi normalizer#587

Merged
realfishsam merged 1 commit into
mainfrom
fix/540-baozi-category
May 24, 2026
Merged

fix: correct category field mapping in baozi normalizer#587
realfishsam merged 1 commit into
mainfrom
fix/540-baozi-category

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #540

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: VERIFIED

What This Does

Corrects the Baozi normalizer's category field mapping: changes category from layerName(market.layer) (e.g., "official", "lab") to undefined, and moves the layer info into tags with a tier: prefix (e.g., tier:official, tier:lab). The rationale is that Baozi's "layer" concept is a trust tier, not a topic category.

Blast Radius

  • Baozi exchange: utils.ts (mapBooleanToUnified, mapRaceToUnified) -- both market type mappers updated
  • Tests: exchange-normalizers-3.test.ts -- 6 assertion updates matching the new behavior
  • No SDK, OpenAPI, or other exchange changes

Findings

  1. Tests updated and consistent -- all 3 test assertions (boolean category, boolean tags, race category) are updated to match the new behavior. Test descriptions are also updated to explain the reasoning.
  2. Semantic improvement -- using category for a trust tier was arguably a misuse of the field. Moving it to tags with a tier: prefix is cleaner and avoids polluting category-based filtering.
  3. Breaking change for consumers -- any downstream code filtering Baozi markets by category === 'official' or category === 'lab' will break. Since category becomes undefined, and tags change from ['official', ...] to ['tier:official', ...], both access patterns are affected.
  4. No migration path -- there is no deprecation warning or documentation of this change for SDK consumers.

PMXT Pipeline Check

  • Field propagation: OK -- category and tags are already in all 3 pipeline layers
  • OpenAPI sync: N/A
  • Type safety: OK

Semver Impact

minor -- changes the semantics of category and tags for Baozi markets; consumers relying on the old values will need to update

Risk

Consumers filtering by category or tag values for Baozi markets will silently get different results. No verification that SDK consumers are unaffected.

@realfishsam realfishsam merged commit e0296e7 into main May 24, 2026
11 of 12 checks passed
@realfishsam realfishsam deleted the fix/540-baozi-category branch May 24, 2026 17:04
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.

Spec drift: baozi — category field returns tier (official/lab/private) instead of topic category

1 participant