Docs Concepts
How a reading is represented.
Six digits describe a whole reading. This page explains the digits, how lines change, how to cast them, and the three things that make a result checkable: releases, citations and refusals.
PreviewThese pages show how the documentation will read. The dataset and the MCP server arrive with the first release. The two example readings are verified. {release} is a placeholder for a release ID, and the licence and sources values are illustrative until then.
Line values
A hexagram has six lines. Each is yang (solid) or yin (broken), and each is either stable or changing. Four digits cover the four cases.
| Digit | Line | Primary | Resulting |
|---|---|---|---|
6 | Old yin, changing | Yin | Yang |
7 | Young yang | Yang | Yang |
8 | Young yin | Yin | Yin |
9 | Old yang, changing | Yang | Yin |
Lines are always written bottom line first. In 977777 the 9 is the first line, at the bottom of the figure.
Changing lines
A reading is a primary hexagram, the lines that change, and the hexagram those changes produce. Four values across six lines give 4,096 readings, and the dataset contains every one.
Inside data, changing lists the changing positions, numbered 1 to 6 from the bottom line. When no line changes it is [], and resulting is null.
{
"release": "{release}",
"licence": "CC BY 4.0",
"sources": { "…": "one per field" },
"data": {
"lines": "777777",
"primary": {
"number": 1,
"name": "乾",
"pinyin": "Qián"
},
"changing": [],
"resulting": null
}
}Casting
The dataset is static files, so it has no cast endpoint. To cast a reading yourself, draw six line values, bottom line first, then read the matching file. The two traditional methods give the four values with different probabilities.
| Digit | Line | Coin method | Yarrow method |
|---|---|---|---|
6 | Old yin, changing | 1/8 | 1/16 |
7 | Young yang | 3/8 | 5/16 |
8 | Young yin | 3/8 | 7/16 |
9 | Old yang, changing | 1/8 | 3/16 |
Each line is drawn independently. Agents do not need the tables: the iching_cast tool on the MCP server casts the six lines for them.
Releases
Every path sits under an immutable release, /v1/releases/{release}/, so an answer can be found again for as long as its release is kept: twelve months. /v1/current.json names the current release. Pin the release you build against; corrections arrive as a new release. Each release has a manifest.json listing every file with its SHA-256, licences and citations.
Citations
Each file’s sources holds a citation for every field in data, and licence states the terms. Keep citations with the values when you store or display them; they are how your own users can check you.
Refusals
If a method is not released, or the sources do not settle a question, the engine returns a refusal with a reason. Treat a refusal as a valid result and show it as one. Do not retry it into an answer.
{
"status": "refused",
"method": "bazi",
"reason": "method_not_released",
"detail": "Not released. Nothing was computed."
}