The core engineering challenge here is converting *qualitative wisdom into quantitative data*—a problem I think many engineers dealing with unstructured data can relate to.
1. *Modeling Interpretation Logic:* How do we turn the qualitative rules of *Bazi* (Five Elements interaction) and *Ziwei Doushu* (star combinations across 12 Palaces) into clean, deterministic TSX code? We built a modular system where each traditional rule is represented as a data object, allowing the *AI algorithm* to traverse complex logic trees consistently.
2. *Consistency vs. Nuance:* The system ensures that if one user and another user input the exact same birth data, the "interpretation" logic generated for *Career, Wealth, or Marriage* is identical. This removes human bias while still preserving the multi-dimensional analysis required by these systems.
3. *Why TSX?* TypeScript’s strict typing was crucial for managing the hundreds of interconnected rules (stars, palaces, flying stars, etc.) in *Ziwei Doushu* without runtime errors.
We are actively working on open-sourcing the non-proprietary parts of our Bazi/Ziwei data structure for the community.
(Find the technical deep-dive on our GitHub project here: [suanmingzhun.com].