Files
deck_in_a_dash/interpreter/src/significance.h
T
ml 41422adf98 Add narrative text and a day-significance rank to the interpreter
Each of the day's top significant transits now gets a short sentence
describing what it classically means and which area of life its house
governs, condensed from Sepharial's Transits and Planetary Periods
(1920, public domain) plus a small table of traditional house
significations. The day-level line also shows its rank out of the 4
defined levels, e.g. "Notable (2/4)". Docs (CLAUDE.md, README,
docs/input-output-format.md, docs/reading.md) updated to match,
including a full worked example in docs/reading.md.
2026-07-05 21:05:53 +02:00

61 lines
2.2 KiB
C

#ifndef DECK_SIGNIFICANCE_H
#define DECK_SIGNIFICANCE_H
/* Header-only dependency on the engine: this module never compiles or
* links the engine's own .c files (or the vendored Astronomy Engine),
* only shares its struct/enum definitions. That's what makes it testable
* with a hand-built DailyReading instead of a real reading_generate()
* call - see interpreter/tests/significance_test.c. */
#include "../../engine/src/reading.h"
#include <stdbool.h>
#define MAX_SIGNIFICANT_ITEMS 5
/* Only aspects compete for the top-5 today. Kept as an explicit tag
* (rather than assuming "item == aspect") so a future kind - e.g. a
* notable moon phase or a house ingress - can be added without
* reshaping this struct. */
typedef enum {
ITEM_ASPECT = 0
} SignificantItemKind;
typedef struct {
SignificantItemKind kind;
Aspect aspect; /* valid when kind == ITEM_ASPECT */
double score; /* higher = more significant; no fixed upper bound */
} SignificantItem;
/* Overall classification of the day, derived from the top item's score.
* A small enum, not a raw number, so callers (rendering, i18n, "does
* this deserve Celtic Cross framing") don't each have to invent their
* own thresholds. */
typedef enum {
DAY_QUIET = 0,
DAY_NOTABLE,
DAY_SIGNIFICANT,
DAY_MAJOR,
DAY_SIGNIFICANCE_COUNT /* not a real level - the number of levels above,
* for callers that want to show day_level as a
* "rank out of N" (e.g. main.c's report). */
} DaySignificance;
typedef struct {
SignificantItem top_items[MAX_SIGNIFICANT_ITEMS];
int top_item_count; /* <= MAX_SIGNIFICANT_ITEMS; fewer if the day had
* fewer than 5 aspects in orb */
DaySignificance day_level;
} DailyInterpretation;
/* Reads reading->transits.aspects[] only - never touches natal/spread,
* and never calls back into the engine, so a hand-built DailyReading is
* a complete, valid input. */
void interpret_daily_reading(const DailyReading *reading, DailyInterpretation *out);
/* True once day_level reaches the threshold at which the Celtic Cross
* reading should get a "this matters" framing sentence naming
* interp->top_items[0]. */
bool interpretation_deserves_framing(const DailyInterpretation *interp);
#endif