Skip to content

feat(data): tarot meanings + bazi timezone/true-solar-time - #31

Merged
sapuyou45-bit merged 2 commits into
mainfrom
feat/data-layer
Aug 12, 2026
Merged

sapuyou45-bit merged 2 commits into
mainfrom
feat/data-layer

Conversation

@sapuyou45-bit

Copy link
Copy Markdown
Owner

V8.1 data layer, part 1 (of 2). Part 2 will add I Ching judgment/line texts.

Tarot: audited meanings in output

Every drawn card now carries a meanings object so the model interprets data, not memory:

  • Major arcana: keywords_upright + shadow (reversed cue) + question — structured from skills/tarot/references/cards.md
  • Minor arcana: composed from rank theme + suit themes
  • reading_cue honors reversal orientation
  • Data is inlined in tarot.py to preserve the single-file standalone fallback design
  • schemas/tarot-draw.schema.json + packaged copy updated

Bazi: timezone + true solar time

  • --timezone (IANA name, stdlib zoneinfo, no new deps)
  • --longitude enables true-solar-time correction (4 min per degree off the standard meridian); the correction is reported in the output — auditable by design
  • MCP bazi_cast exposes both parameters
  • schemas/bazi-cast.schema.json + packaged copy updated

Tests

95 tests + 35 subtests pass, including new contract tests for meanings, DST-aware timezone handling (China 1986–1991 DST covered), and the Urumqi true-solar correction case.

… layer part 1)

- tarot: every drawn card now carries audited meanings (upright keywords,
  shadow/question for majors, composed suit+rank themes for minors,
  reading_cue honoring reversal); data inlined in tarot.py to preserve
  the single-file standalone design; schema + packaged copy updated
- bazi: optional --timezone (IANA) and --longitude (true solar time
  correction, 4 min/degree off the standard meridian; correction reported
  in output for auditability); MCP bazi_cast exposes both; schema updated
- tests: meanings contract test, timezone/DST-aware tests, true-solar
  correction test (Urumqi case), bazi added to standalone sync test
- 95 tests + 35 subtests pass
…cation

The flagged print(json.dumps(result)) is the product output itself: the
user explicitly requests their own chart on their own terminal. No logging
infrastructure exists; nothing is persisted or transmitted.
@sapuyou45-bit
sapuyou45-bit merged commit 1c5d40f into main Aug 12, 2026
7 checks passed
@sapuyou45-bit
sapuyou45-bit deleted the feat/data-layer branch August 12, 2026 19:49
sapuyou45-bit added a commit that referenced this pull request Aug 12, 2026
Part 2 of the data layer (part 1 = #31: tarot meanings + bazi timezone).
Completes 'the model interprets data, not memory'.

## What
- **Classical Zhou Yi texts** (卦辭/爻辭, public domain via Chinese
Wikisource) embedded for all 64 hexagrams, keyed by binary string
- `primary_hexagram.texts` / `resulting_hexagram.texts`: judgment + line
labels + line texts + source
- `changing_line_texts`: the moving lines actually read, with 初九/九二…
labels
- Schema updated (`$defs.hexagram.texts` + top-level
`changing_line_texts`), packaged copy synced

## Provenance decision
Wilhelm-Bayes (the popular English translation) is still under copyright
— deliberately avoided. Classical Chinese text is public domain;
open-iching's JSON was evaluated and rejected after spotting
transcription errors (见龙~~再~~在田); Wikisource parsed per-hexagram
instead, with format-variant handling (名 glued to text, comma
separators) and two hand-verified patches (習坎/恆).

## Tests
96 tests + 35 subtests pass, incl. anchored 困之節 contract test.

Co-authored-by: sophiew <246639359+sapuyou45-bit@users.noreply.github.com>
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.

1 participant