|
| 1 | +# 人生密码 / Rensheng Mima |
| 2 | + |
| 3 | +Local-first Chinese metaphysics computation toolkit and web MVP. |
| 4 | + |
| 5 | +人生密码是一个本地优先的中文命理结构化计算工具。它把八字、紫微斗数、文墨天机兼容文字盘解析、格局识别和融合报告拆成可测试的工程模块,并提供一个 React/Vite 本地网页入口。 |
| 6 | + |
| 7 | +> This project is for cultural research, structured rule-engine experiments, and personal reflection. It is not medical, legal, financial, or psychological advice. |
| 8 | +
|
| 9 | +## Why This Exists |
| 10 | + |
| 11 | +Traditional Chinese metaphysics tools often mix calculation, interpretation, private records, and product UI in one opaque bundle. 人生密码 tries to make that stack more transparent: |
| 12 | + |
| 13 | +- deterministic chart computation and parser outputs |
| 14 | +- privacy-preserving local execution |
| 15 | +- fixture-based regression tests |
| 16 | +- clear boundaries between rules, renderers, and web UI |
| 17 | +- cautious wording with explicit disclaimers |
| 18 | + |
| 19 | +## Features |
| 20 | + |
| 21 | +- BaZi engine with true-solar-time correction, ten-god analysis, weighted five-elements scoring, day-master strength, useful-god strategy, and luck-cycle summaries |
| 22 | +- Zi Wei Dou Shu engine using a C5FYC-style rule path, palace maps, major stars, support stars, transformations, and boundary-sensitive double-chart handling |
| 23 | +- Wenmo-compatible text parser for private local regression workflows |
| 24 | +- Pattern detectors for Zi Wei chart structures |
| 25 | +- Fusion layer for BaZi, Zi Wei, MBTI, zodiac, and blood-type modules |
| 26 | +- Local web MVP with free summary, mock checkout flow, privacy page, pricing page, and report deletion |
| 27 | + |
| 28 | +## Privacy Boundary |
| 29 | + |
| 30 | +No real user birth records, names, generated reports, private notes, logs, tokens, or agent state are included in this public package. |
| 31 | + |
| 32 | +The public `xiashensuan_core/fixtures/wenmo_cases/manifest.json` is intentionally empty. Maintainers can keep private fixture records locally under `private_records/`, which is ignored by Git. |
| 33 | + |
| 34 | +## Quick Start |
| 35 | + |
| 36 | +```bash |
| 37 | +python3 -m venv .venv |
| 38 | +source .venv/bin/activate |
| 39 | +pip install -r requirements.txt |
| 40 | +python3 scripts/xiashensuan.py 1990 1 15 14 --minute 30 --gender 男 --place 北京 --mode life |
| 41 | +``` |
| 42 | + |
| 43 | +Run the local web MVP: |
| 44 | + |
| 45 | +```bash |
| 46 | +python3 web/server.py |
| 47 | +``` |
| 48 | + |
| 49 | +Open `http://127.0.0.1:8765`. |
| 50 | + |
| 51 | +## Frontend |
| 52 | + |
| 53 | +```bash |
| 54 | +cd web/frontend |
| 55 | +npm install |
| 56 | +npm run build |
| 57 | +``` |
| 58 | + |
| 59 | +After building, restart `python3 web/server.py`; the server will serve `web/frontend/dist/` first and fall back to `web/static/` if no build exists. |
| 60 | + |
| 61 | +## Tests |
| 62 | + |
| 63 | +```bash |
| 64 | +python3 -B scripts/ziweiwenmotests.py |
| 65 | +python3 -B scripts/xiashensuantests.py |
| 66 | +python3 -B scripts/ziwei_patterns_tests.py |
| 67 | +python3 -B scripts/wenmo_text_scan.py --record-dir private_records |
| 68 | +``` |
| 69 | + |
| 70 | +Private Wenmo fixture tests are skipped when no private fixtures exist. |
| 71 | + |
| 72 | +## Repository Scope |
| 73 | + |
| 74 | +Included: |
| 75 | + |
| 76 | +- rule engines |
| 77 | +- local web MVP source |
| 78 | +- deterministic tests |
| 79 | +- privacy and contribution docs |
| 80 | + |
| 81 | +Excluded: |
| 82 | + |
| 83 | +- real case records |
| 84 | +- generated reports |
| 85 | +- private agent files |
| 86 | +- `.openclaw` or local runtime state |
| 87 | +- `node_modules` |
| 88 | +- frontend build artifacts |
| 89 | + |
| 90 | +## Roadmap |
| 91 | + |
| 92 | +- Add synthetic public fixtures that do not come from real users |
| 93 | +- Split the engine into a proper Python package |
| 94 | +- Add typed JSON schema for chart outputs |
| 95 | +- Add GitHub Pages demo screenshots |
| 96 | +- Add CI coverage for frontend build and backend smoke tests |
| 97 | +- Add privacy review checklist for contribution review |
| 98 | + |
| 99 | +## License |
| 100 | + |
| 101 | +MIT. |
| 102 | + |
0 commit comments