HomeDocsDignities & Sect

Dignities & Sect

Essential dignity doctrine, sect and phase geometry, explicit policy controls, scoring, and provenance boundaries.

Moira Dignities Backend Standard

Governing Principle

The Moira dignities backend is a sovereign computational subsystem. Its definitions, layer boundaries, terminology, invariants, failure doctrine, and determinism rules are stated here and are frozen until explicitly superseded by a revision to this document.

This document reflects current implementation truth as of Phase 11. It describes the subsystem that actually exists in moira/dignities.py; it does not describe aspirational future capabilities.


Part I - Architecture Standard

1. Authoritative Computational Definitions

1.1 Core dignity computation

A planetary dignity result in Moira is:

The authoritative per-planet output of DignitiesService.calculate_dignities, computed for a planet admitted by the active essential doctrine from normalised sign state, house placement, sect context, solar proximity, and doctrine admitted under DignityComputationPolicy.

The computational core remains the authority for:

  • essential dignity scoring
  • accidental dignity scoring
  • sect and hayz truth
  • solar condition truth
  • admitted mutual-reception scoring
  • total score composition

Later layers may classify, preserve, aggregate, or inspect this truth. They may not recompute the doctrine independently.

1.2 Essential dignity

An essential dignity in Moira is:

A typed composition of independently evaluated domicile, exaltation, triplicity, bound, face, detriment, fall, and peregrine components.

ElementDefinition
doctrine tablesDOMICILE, MODERN_DOMICILE, EXALTATION, Egyptian bounds, Chaldean faces, DETRIMENT, MODERN_DETRIMENT, FALL
subject setClassic 7 by default; Classic 7 plus Uranus, Neptune, Pluto under MODERN_CO_RULERS
component sourcesign, chart sect, exact longitude, Egyptian-bound ruler, and Chaldean-face ruler
compatibility prioritydomicile > exaltation > triplicity > bound > face > detriment > fall > peregrine
compatibility score sourceSCORE_DOMICILE, SCORE_EXALTATION, SCORE_TRIPLICITY, SCORE_BOUND, SCORE_FACE, SCORE_DETRIMENT, SCORE_FALL, SCORE_PEREGRINE

The returned essential_dignity string and essential_score integer remain the legacy single-label compatibility projection. essential_truth.components is the authoritative non-erasing receipt and may preserve simultaneous positive and negative facts that the compatibility label cannot express.

1.3 Accidental dignity

An accidental dignity in Moira is:

The sum of doctrine-admitted accidental conditions attached to one planet, where each admitted condition contributes a fixed signed score and explicit preserved truth.

The currently embodied accidental dimensions are:

  • house strength
  • motion state
  • solar condition
  • admitted mutual reception
  • sect / hayz truth
  • planetary joy
  • oriental / occidental solar-relative phase
  • malefic besieging

Every condition admitted by the active accidental policy is assembled as an explicit AccidentalDignityCondition before it contributes to accidental_score. The underlying PlanetarySolarPhaseTruth, SolarProximityTruth, and BesiegingTruth are preserved independently of whether policy admits a compatibility condition or the required chart dependencies are complete.

1.4 Reception

A reception in Moira is:

A directed relational truth in which one planet occupies a sign belonging to another planet under an admitted reception basis.

Reception is formalised with three distinct layers of meaning:

TermDefinition
all_receptionsall doctrine-detected directed receptions for the planet
admitted_receptionsthe subset of all_receptions allowed by the current policy
scored_receptionsthe subset of admitted_receptions that contributes to current accidental dignity scoring

The current default doctrine admits domicile and exaltation reception bases. The current default scoring semantics use only the admitted mutual subset.

1.5 Planetary condition profile

A planetary condition profile in Moira is:

A backend-only integrated structural summary derived from one PlanetaryDignity, combining preserved truth and classifications across the essential, accidental, sect, solar, and reception layers.

PlanetaryConditionProfile is a consumer of dignity truth, not a second dignity engine.

1.6 Chart condition profile

A chart condition profile in Moira is:

A deterministic chart-wide aggregation of per-planet condition profiles, reporting structural counts and totals without adding interpretation.

It includes at least:

  • ordered per-planet profiles
  • reinforced / mixed / weakened counts
  • strengthening / weakening / neutral totals
  • strongest / weakest planets under existing structural criteria

1.7 Condition network profile

A condition network profile in Moira is:

A deterministic directed graph projection over admitted reception truth and integrated per-planet condition profiles.

It includes at least:

  • one node per planet profile
  • one directed edge per admitted reception relation
  • unilateral vs mutual edge visibility
  • incoming / outgoing / mutual counts per node
  • isolated planets
  • direct-degree connectivity summaries

This graph is a structural projection only. It is not an interpretive network layer.


2. Layer Structure

The backend is organised into one computational core plus ten formalised post-core layers. Each layer consumes outputs already produced below it. No layer reaches upward.

Core      - Authoritative dignity computation (`calculate_dignities`)
Phase  1  - Truth preservation
Phase  2  - Classification
Phase  3  - Inspectability and vessel hardening
Phase  4  - Doctrine / policy surface
Phase  5  - Reception formalisation
Phase  6  - Reception inspectability / hardening
Phase  7  - Integrated planetary condition
Phase  8  - Chart-wide condition intelligence
Phase  9  - Reception / condition network intelligence
Phase 10  - Full-subsystem hardening
Phase 11  - Architecture freeze / validation codex

Layer boundary rules

A layer above the core:

  • may consume preserved truth from lower layers
  • may classify or aggregate earlier truth
  • may add invariant checks that reject internally inconsistent vessels
  • may not recompute dignity doctrine independently
  • may not alter legacy scoring semantics by reclassification
  • may not mutate an earlier-layer vessel in place
  • may not introduce interpretation, recommendation, or UI concerns

3. Delegated Assumptions

The dignity backend delegates to external modules without redefining them:

ConcernDelegated toConvention
zodiac sign orderingmoira.constants.SIGNSordered list of 12 sign names
almuten support scoringmoira.longevity.dignity_score_atimported lazily
phasis ephemeris lookupmoira.planets.planet_atimported lazily

Changes to those delegated sources propagate into the dignity subsystem. This document does not freeze their independent doctrine.


4. Doctrine Surface

4.1 Essential doctrine

The default essential doctrine is the classic fixed-table model encoded in:

  • DOMICILE
  • EXALTATION
  • DETRIMENT
  • FALL

EssentialDignityPolicy makes this doctrine explicit without changing the default result.

The admitted opt-in modern doctrine is:

  • EssentialDignityDoctrine.MODERN_CO_RULERS

This doctrine extends domicile and detriment only:

Modern planetDomicileDetriment
UranusAquariusLeo
NeptunePiscesVirgo
PlutoScorpioTaurus

The modern doctrine is co-rulership, not replacement. Saturn still holds Aquarius, Jupiter still holds Pisces, and Mars still holds Scorpio under this policy. No modern exaltation or fall table is admitted by the current engine.

4.2 Accidental doctrine

The accidental doctrine surface is explicit through:

  • AccidentalDignityPolicy
  • SolarConditionPolicy
  • MutualReceptionPolicy
  • SectHayzPolicy

The default policy is normative:

DignityComputationPolicy() preserves the currently admitted, named doctrine. It must not preserve a legacy behavior after that behavior has been shown to contradict the admitted source.

The accidental inclusion controls include:

Policy fieldDefaultGoverns
AccidentalDignityPolicy.include_oriental_occidentalTrueOriental/Occidental phase classification and its score contribution
SectHayzPolicy.doctrineAL_QABISI_BONATTI_DYKES_2007Named Halb/Hayz lineage
SectHayzPolicy.include_hayzTrueFull-Hayz condition and score contribution
SectHayzPolicy.include_halbTrueSect-relative hemisphere condition and score contribution

Setting one of these fields to False removes that admitted condition from labels, the condition list, and additive scoring without changing the underlying sign, sect, house, or longitude inputs. Atomic truth remains preserved when it can be evaluated independently of policy. Hayz and Halb are separately selectable; when both are enabled, full Hayz takes precedence in the additive label/score while the underlying in_halb truth remains preserved.

4.3 Sect, hayz, and halb doctrine

Sect, Hayz, and Halb doctrine is embodied by:

  • SECT
  • PREFERRED_HEMISPHERE
  • PREFERRED_GENDER
  • HalbHayzDoctrine.AL_QABISI_BONATTI_DYKES_2007
  • the explicit Mercury phase model

Under the admitted al-Qabisi/Bonatti lineage, Halb is not an exact-two-of-three approximation to Hayz. It is the planet's sect-relative hemisphere condition:

Planetary sectDay chartNight chart
DiurnalAbove horizonBelow horizon
NocturnalBelow horizonAbove horizon

Hayz is Halb plus placement in a sign of the planet's own gender. The admitted gender table treats Sun, Jupiter, and Saturn as masculine; Moon, Venus, and Mars as feminine; and Mercury as neutral. Because no source-owned Mercury gender assignment is admitted, Mercury can receive explicit sect and Halb truth but hayz_evaluable=False and no invented Hayz judgment.

Mercury sect is phase-dependent. Standalone Mercury sect/Halb calls require an explicit mercury_rises_before_sun value. Chart-level dignity computation derives that phase only when both Sun and Mercury are present. It never substitutes a conjunction or another synthetic value for a missing Mercury. Exact Mercury/Sun conjunction returns typed not_evaluable phase, sect, Halb, and Hayz components rather than a false nocturnal default. An explicit Sun is mandatory because chart sect and solar conditions cannot be computed truthfully without it.

DignityHorizonFrame carries the actual Ascendant and Midheaven. When present, the engine identifies the open ecliptic semicircle containing the Midheaven as above the horizon, independently of house-system cusp numbering. Bodies on the Ascendant or Descendant receive typed not_evaluable Halb/Hayz truth; a Sun on that boundary fails chart-sect computation closed. Raw legacy callers that do not yet supply a horizon frame remain explicitly identified by HorizonComputationMethod.LEGACY_HOUSE_NUMBER.

This truth is preserved and classified explicitly even where it does not affect the current additive score.

4.4 Oriental / occidental phase doctrine

planetary_solar_phase_truth() is the governing object for the admitted longitude-only phase model. It applies to Mercury, Venus, Mars, Jupiter, and Saturn and preserves the forward zodiacal arc from the planet to the Sun.

  • an arc strictly between 0 and 180 degrees is oriental;
  • an arc strictly between 180 and 360 degrees is occidental;
  • exact conjunction and exact opposition are direction boundaries and return typed not_evaluable truth;
  • luminaries and bodies outside the admitted five-body set return typed not_evaluable truth rather than a fabricated phase.

oriental_occidental() remains the compatibility projection and returns None for every non-evaluable receipt. An Oriental/Occidental condition and score may be assembled only from an evaluated receipt and only when include_oriental_occidental=True. Disabling that policy suppresses the condition and score but does not erase evaluated geometric truth.

4.5 Solar-condition doctrine

solar_proximity_truth() is the governing raw geometric object. It computes the minimum angular distance from the body to the Sun and assigns exactly one exclusive band:

Raw bandExclusive angular-distance intervalCompatibility score when admitted
cazimi0 through 0.283 degrees, inclusiveSCORE_CAZIMI
combustgreater than 0.283 through 8 degrees, inclusiveSCORE_COMBUST
under_sunbeamsgreater than 8 through 17 degrees, inclusiveSCORE_SUNBEAMS
cleargreater than 17 degreesno solar-condition score

The raw truth is independent of policy admission. The Sun returns typed not_evaluable because solar proximity is not applicable to the Sun itself. The Moon receives raw geometric truth, but the default accidental policy does not assemble a solar condition for either luminary. Explicit include_for_luminaries=True may admit a Moon condition; it never turns the Sun into its own Cazimi condition.

Compatibility assembly retains the historical policy fall-through: if a narrower condition is disabled, the same distance may be admitted by an enabled wider condition. This does not alter the exclusive raw band preserved in SolarProximityTruth. Inclusive boundary comparisons use a 1e-12-degree arithmetic tolerance solely to contain floating-point subtraction error; it is not an observational or doctrinal orb.

4.6 Besieging doctrine

besieging_truth() is the governing enclosure object. It requires the complete Classic 7 longitude set plus an explicit or uniquely inferable target identity. It then preserves the nearest distinct classical body in each directed zodiacal direction.

  • missing required bodies or target identity return typed not_evaluable;
  • a body conjunct the target, a tied nearest neighbour, or an unresolved direction boundary returns typed not_evaluable;
  • an evaluated result is besieged only when the two directional neighbours are Mars and Saturn and each is within the configured orb;
  • directed neighbour distances occupy (0, 360) degrees; the independently configured eligibility orb remains limited to (0, 180] degrees;
  • an evaluated False remains distinct from incomplete dependencies or ambiguous geometry;
  • only evaluated True truth may assemble the besieged condition and score.

is_besieged() remains the flattened compatibility projection and therefore returns None for both evaluated absence and non-evaluable truth. Consumers that need to distinguish those states must use besieging_truth().

4.7 Reception doctrine

The formal reception basis currently supported is limited to what the engine already computes cleanly:

  • domicile reception
  • exaltation reception

No other reception basis is implied by this document.


5. Public Surface

The following public backend entry points are authoritative:

SurfaceRole
PlanetaryDignitycanonical per-planet dignity vessel
PlanetaryReceptioncanonical directed reception relation
PlanetaryConditionProfilecanonical integrated per-planet condition vessel
ChartConditionProfilecanonical chart-wide condition aggregation
ConditionNetworkNodecanonical node-level network summary
ConditionNetworkEdgecanonical directed network edge
ConditionNetworkProfilecanonical network aggregation
DignityComputationPolicycanonical explicit doctrine/policy surface
DignityHorizonFrameactual Asc/MC zodiacal geometry for house-system-independent sect truth
EssentialDignityComponentTruthone atomic essential-dignity receipt
PlanetarySolarPhaseTruth / planetary_solar_phase_truth()typed oriental/occidental geometry and its governing computation
SolarProximityTruth / solar_proximity_truth()typed exclusive solar-distance band before policy assembly
BesiegingDependencyCompletenessTruthtyped required, supplied, and missing chart-body dependencies for enclosure evaluation
BesiegingTruth / besieging_truth()typed directional-neighbour enclosure truth and its governing computation
HorizonTruth / MercuryPhaseTruth / SectComponentTruthtyped component receipts with explicit evaluation status
DignitiesService.calculate_dignitiesauthoritative core computation
DignitiesService.calculate_receptionsauthoritative formal reception projection
DignitiesService.calculate_condition_profilesauthoritative per-planet condition integration
DignitiesService.calculate_chart_condition_profileauthoritative chart-wide condition aggregation
DignitiesService.calculate_condition_network_profileauthoritative network aggregation
module-level wrappers of the aboveconvenience entry points mirroring the service

No caller should reconstruct hidden doctrine from flattened labels when a structured truth or classification field already exists.


6. Terminology Freeze

The following terminology is normative and must not drift casually:

TermMeaning
truthstructured preservation of already-computed doctrine
classificationtyped description of preserved truth; never scoring logic
inspectabilityderived convenience access that does not add doctrine
policyexplicit control over already-supported doctrine admission
all receptionsall detected directed reception relations
admitted receptionspolicy-allowed subset of detected receptions
scored receptionsadmitted mutual subset contributing to accidental score
reinforced / mixed / weakenedstructural condition labels derived from existing polarity counts only

In particular:

  • classification must remain descriptive, not interpretive
  • inspectability helpers must remain derived only
  • condition profiles must remain integrative, not doctrinally independent
  • network profiles must remain structural, not interpretive

7. Failure Doctrine

The dignity subsystem follows a strict split:

  • bad external inputs fail with ValueError
  • internally inconsistent result vessels fail with ValueError at construction
  • invariant drift is treated as an implementation defect, not a recoverable state

The subsystem may not silently coerce malformed dignity inputs into a valid chart representation.


8. Explicit Non-Goals

The dignity backend does not, in this frozen phase:

  • perform interpretation
  • provide recommendation logic
  • build reception-network topology beyond direct structural graphing
  • perform chart-wide interpretive synthesis
  • redefine doctrine outside the explicit policy surface

Part II - Validation Codex

9. Validation Environment

PropertyValue
authoritative runtimeproject .venv
test runner.venv\Scripts\python.exe -m pytest
primary test filetests/unit/test_moira_dignities_and_lots.py
source-owned Hellenistic goldentests/unit/test_hellenistic_source_goldens.py
dignity regression seamtests/unit/test_rule_engine_validation.py -k dignity
focused baseline34 dignity/lots tests + 1 dignity rule-engine regression
acceptable result0 failures, 0 errors

No dignity test may be modified to make the implementation pass. A failing test is treated as an implementation defect unless the test itself is proven wrong.


10. Test Surface Register

FileScopeFocus
tests/unit/test_moira_dignities_and_lots.pysubsystem-focusedlegacy score preservation, truth/classification consistency, policy, reception, condition, chart-wide aggregation, network, malformed input, deterministic failure behavior
tests/unit/test_rule_engine_validation.py -k dignitycross-subsystem regression seamdignity result compatibility with the rule-engine validation surface
tests/unit/test_hellenistic_source_goldens.pyindependent source evidenceEgyptian/Ptolemaic/Chaldaean bounds and planetary joys; policy-derived accidental conditions remain outside that source claim

11. Validation Doctrine

11.1 What must be validated per layer

LayerMust test
core dignity computationtotal_score == essential_score + accidental_score; legacy labels and scores remain unchanged under default policy
truth preservationessential, accidental, sect, solar phase/proximity, besieging, and mutual-reception truth align with the compatibility result fields they preserve
classificationevery classification field aligns with its source truth and remains deterministic
inspectabilityconvenience properties are derived only and add no new doctrine or scoring
policydefault policy preserves historical behavior exactly; narrower policy changes only its explicit admission surface
receptionunilateral vs mutual are distinguished; basis is explicit; admitted subset is policy-governed; scored subset matches current accidental scoring doctrine
planetary conditioncondition state is derived only from existing polarity counts; profile fields align with source dignity truth
chart-wide conditioncounts, totals, strongest/weakest summaries, and ordering align with source profiles
networknode counts, edge counts, mutual/unilateral counts, isolated planets, and degree summaries align with admitted reception truth
hardeningmalformed inputs fail clearly; vessel invariant drift fails clearly; same input yields same ordered output

11.2 What validation must not do

  • treat a changed score as acceptable because the structured truth became richer
  • bypass the policy surface to test an unsupported doctrine
  • assert interpretive meaning from structural labels
  • accept non-deterministic ordering in profiles, summaries, or network outputs
  • weaken failure behavior to make malformed inputs appear tolerated

12. Invariant Register

This register is the normative source of truth for subsystem invariants.

INV-CORE - Core dignity invariants

CodeInvariant
D-1total_score == essential_score + accidental_score for every PlanetaryDignity
D-2essential_dignity and essential_score are the deterministic compatibility projection of component truth
D-3accidental_dignities labels and accidental_score remain the authority for current accidental scoring semantics
D-4component truth may correct historical collapse or omission while the compatibility projection remains deterministic

INV-TRUTH - Truth preservation invariants

CodeInvariant
T-1essential_truth.label == essential_dignity when essential_truth is present
T-2essential_truth.score == essential_score when essential_truth is present
T-3accidental truth labels preserve the same condition labels exposed in accidental_dignities
T-4sect, Halb, Hayz, horizon, Mercury phase, planetary solar phase, solar proximity, besieging, solar condition, and reception truth preserve atomic evaluation status rather than fabricating defaults
T-5an Oriental/Occidental condition exists only when its PlanetarySolarPhaseTruth is evaluated and names the same phase
T-6a solar condition can be assembled only from evaluated SolarProximityTruth; policy suppression never erases or changes the exclusive raw band
T-7a besieged condition exists only when BesiegingTruth is evaluated True with complete dependencies and Mars/Saturn as the two directional neighbours

INV-CLASS - Classification invariants

CodeInvariant
C-1each classification field is fully derivable from its paired truth field
C-2classification does not alter scoring, admission, or rule priority
C-3the same truth yields the same classification across calls

INV-REC - Reception invariants

CodeInvariant
R-1PlanetaryReception.receiving_planet != PlanetaryReception.host_planet
R-2receiving_sign in host_matching_signs
R-3admitted_receptions is a subset of all_receptions
R-4scored_receptions equals the admitted mutual subset exactly
R-5scored reception truth remains backward compatible with accidental dignity scoring

INV-COND - Planetary condition invariants

CodeInvariant
P-1PlanetaryConditionProfile.state matches the derived polarity state from strengthening and weakening counts
P-2condition profiles consume dignity truth; they do not recompute doctrine
P-3inspectability flags like is_reinforced are derived only from state

INV-CHART - Chart-wide aggregation invariants

CodeInvariant
A-1reinforced, mixed, and weakened counts match the states of contained profiles
A-2strengthening, weakening, and neutral totals equal the sum across contained profiles
A-3reception participation total equals the sum of admitted receptions across contained profiles
A-4profile order is deterministic by planet order

INV-NET - Network invariants

CodeInvariant
N-1each node planet matches its bound profile planet
N-2total_degree == incoming_count + outgoing_count for every node
N-3mutual_count <= outgoing_count for every node
N-4mutual_edge_count and unilateral_edge_count match the actual edge set
N-5isolated planets are exactly the nodes with degree zero
N-6node order is deterministic by planet order

INV-POL - Policy invariants

CodeInvariant
PO-1DignityComputationPolicy() is valid and semantically default
PO-2unsupported explicit doctrine choices raise ValueError
PO-3policy governs admissibility; it does not redefine the lower-level truth model ad hoc

INV-IN - Input invariants

CodeInvariant
I-1duplicate classic-planet entries are rejected
I-2non-finite longitude input is rejected
I-3non-boolean is_retrograde is rejected
I-4duplicate house cusp numbers are rejected
I-5house cusp numbers outside 1..12 are rejected
I-6incomplete cusp sets are rejected

13. Determinism Register

The following ordering guarantees are normative:

SurfaceGuarantee
calculate_dignitiesplanets returned in deterministic traditional order
calculate_receptionsdirected reception relations returned deterministically for the same input
calculate_condition_profilesprofiles returned in deterministic planet order
calculate_chart_condition_profilestrongest and weakest summaries are deterministic under ties
calculate_condition_network_profilenodes and edges are deterministic for the same admitted reception truth

Input permutation must not change the semantic output of the public dignity surfaces.


14. Guaranteed Failure Conditions

The following inputs must always fail clearly and consistently.

Function / vesselBad input or driftError
calculate_dignitiesmissing Sun positionValueError
calculate_dignitiesduplicate classic planet entryValueError
calculate_dignitiesnon-finite longitudeValueError
calculate_dignitiesnon-boolean is_retrogradeValueError
calculate_dignitiesduplicate cusp numberValueError
calculate_dignitiesmissing cusp numbersValueError
calculate_dignitiescusp number outside 1..12ValueError
policy validationunsupported explicit essential doctrineValueError
PlanetaryDignitylegacy score / truth / classification inconsistencyValueError
PlanetaryReceptionself-reception or impossible host/sign relationValueError
PlanetaryConditionProfilestate or reception-subset driftValueError
ChartConditionProfileaggregate counts or order driftValueError
ConditionNetworkNodedegree-count inconsistencyValueError
ConditionNetworkProfileisolated-planet, edge-count, or order driftValueError

The exact message text may evolve for clarity, but the failure type and semantic reason must remain stable.


15. Validation Commands

The minimum validation commands for this subsystem freeze are:

.venv\Scripts\python.exe -m pytest tests\unit\test_moira_dignities_and_lots.py -q
.venv\Scripts\python.exe -m pytest tests\unit\test_rule_engine_validation.py -q -k dignity
.venv\Scripts\python.exe -m pytest tests\unit\test_hellenistic_source_goldens.py -q -k "bound or planetary_joy"

When implementation files change, syntax validation may also be run:

.venv\Scripts\python.exe -m py_compile moira\dignities.py tests\unit\test_moira_dignities_and_lots.py tests\unit\test_hellenistic_source_goldens.py

16. Freeze Rule

After this phase, any change to the dignity backend that alters:

  • default scores
  • default admission behavior
  • invariant meaning
  • failure semantics
  • ordering guarantees
  • terminology frozen in Section 6

must be treated as an explicit architecture change and accompanied by a documented revision to this standard.