main.bend checks
raw source on the hub · import 0x0e024c0379406f469e12da1d8267c06e/main.bend as Main
WhiteMagic & Mandala Governance Kernel -- Executable Implementation in Bend 2
Models five core WhiteMagic / Mandala / I Ching mechanisms: 1. Violet Scope Token monotonic capability attenuation (read, write, exec, net) 2. Mandala Gate-Lite single-use pass consumption & replay rejection 3. Constitutional ParetoGate tri-fold evolutionary adjudication (Promote / Retire / Quarantine) 4. 64-Hexagram Yin/Yang line polarity involution (King Wen / Yijing line mutation) 5. Sutra PRAY-phase denotation merging & Citta Crystal monotonic epoch progression
1 import
import Base
Types
type Cap source · line 12 · raw
Data
CapReadCap
CapWriteCap
CapExecCap
CapNetCap
type ScopeToken source · line 18 · raw
Data
Scope@read:Bool -> @write:Bool -> @exec:Bool -> @net:Bool -> ScopeToken
type PassSlot source · line 21 · raw
Data
Slot@consumed:Bool -> @exec_count:Nat -> PassSlot
type Fate source · line 24 · raw
Data
PromoteFate
RetireFate
QuarantineFate
type Hexagram6 source · line 29 · raw
Data
Hex@l1:Bool -> @l2:Bool -> @l3:Bool -> @l4:Bool -> @l5:Bool -> @l6:Bool -> Hexagram6
type PrayMask source · line 32 · raw
Data
Pray@perceive:Bool -> @resonate:Bool -> @act:Bool -> @yield_p:Bool -> PrayMask
type Sigma22Lens source · line 35 · raw
Data
Lens@motif_id:Nat -> @basin_k8:Nat -> Sigma22Lens
Definitions
def attenuate source · line 39 · raw
@parent:ScopeToken -> @mask:ScopeToken -> ScopeToken
1. Capability attenuation
def consume_pass source · line 47 · raw
@slot:PassSlot -> PassSlot
2. Mandala single-use pass execution
def adjudicate source · line 57 · raw
@has_regression:Bool -> @fitness_gain:Bool -> @provenance_ok:Bool -> Fate
3. Constitutional ParetoGate adjudication
def flip_line source · line 77 · raw
@b:Bool -> Bool
4. 64-Hexagram Yijing line mutation (Invert / Changing Lines)
def invert_hex source · line 80 · raw
@h:Hexagram6 -> Hexagram6
def merge_pray source · line 86 · raw
@a:PrayMask -> @b:PrayMask -> PrayMask
5. Sutra PRAY-Phase Denotation & Monotonic Epoch Step
def superopt_step source · line 93 · raw
@g:PrayMask -> @rest:PrayMask -> PrayMask
def advance_epoch source · line 96 · raw
@rev:Nat -> Nat
def render_sigma22_symbol source · line 100 · raw
@lens:Sigma22Lens -> ScopeToken
6. Wave 2 Law 10: Sigma_22 Non-Dispatching Spectrometer (Symbols render, never dispatch)
def resolve_authority source · line 106 · raw
@from_recalled_memory:Bool -> @live_lease:ScopeToken -> ScopeToken
7. Wave 2 Law 11: Zero Endogenous Authorization Laundering (Memory cannot confer live authority)
def mmmbaby_vitality source · line 114 · raw
@f1:Bool -> @f2:Bool -> @f3:Bool -> @f4:Bool -> @f5:Bool -> @f6:Bool -> Bool
8. Wave 2 Law 12: MMMBABY Non-Compensatory Geometric Vitality Veto
def cleave_prodrug source · line 118 · raw
@node_matches:Bool -> @epoch_valid:Bool -> @seal_valid:Bool -> Bool
9. Wave 2 Law 13: 1Fe-LSD Prodrug Receptor Cleavage Exclusivity
def y1_actuate source · line 126 · raw
@wm_actuation_enabled:Bool -> @currently_armed:Bool -> @above_enter:Bool -> @above_exit:Bool -> Bool
10. Wave 3 Law 14: Y1 Hysteresis WM_ACTUATION=0 Global Disarm Invariant
def claim_strict_os_isolation source · line 138 · raw
@runner_is_strict:Bool -> @os_egress_active:Bool -> @landlock_enforced:Bool -> Bool
11. Wave 3 Law 15: Runner Class Non-Conflation & Egress Truth Discipline
def ratify_cpr06_receipt source · line 150 · raw
@authority_grant_present:Bool -> @chain_head_matches:Bool -> @pq_sig_valid:Bool -> Bool
12. Wave 3 Law 16: CPR 0.6 Authority Grant & Chain-Head Truncation Guard
def check_read_cap source · line 161 · raw
@tok:ScopeToken -> Bool
def check_unconsumed source · line 166 · raw
@slot:PassSlot -> Bool
def check_promoted source · line 171 · raw
@fate:Fate -> Bool
def bool_to_nat source · line 180 · raw
@ok:Bool -> Nat
def main source · line 187 · raw
Nat