aien-architecture-mv
Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.
Brought by drakestapleton
aien-architecture-mv / evidence / ECOSYSTEM303 / independent / mutant3-core.om
| 1 | note EC303 v1 structural admission. This does not authenticate or approve evidence. |
| 2 | note Forty fixed capability families; 20 fields per row. See FORMAT.md. |
| 3 | global EC ulong 800 |
| 4 | global Seen ulong 40 |
| 5 | global Reach ulong 1600 |
| 6 | |
| 7 | fn ecrequire id ulong to ulong |
| 8 | if or eq id 15 or eq id 16 or eq id 19 eq id 20 |
| 9 | ret 7 |
| 10 | end |
| 11 | if or eq id 8 or eq id 13 eq id 14 |
| 12 | ret 3 |
| 13 | end |
| 14 | if or eq id 18 and ge id 21 le id 23 |
| 15 | ret 3 |
| 16 | end |
| 17 | if or eq id 27 and ge id 30 le id 35 |
| 18 | ret 3 |
| 19 | end |
| 20 | if or eq id 12 eq id 24 |
| 21 | ret 2 |
| 22 | end |
| 23 | if or and ge id 4 le id 7 eq id 9 |
| 24 | ret 1 |
| 25 | end |
| 26 | if or eq id 17 and ge id 36 le id 38 |
| 27 | ret 1 |
| 28 | end |
| 29 | ret 0 |
| 30 | end |
| 31 | |
| 32 | fn ecfield row ulong col ulong to ulong |
| 33 | ret get EC add mul row 20 col |
| 34 | end |
| 35 | |
| 36 | fn ecvalidate version ulong count ulong to ulong |
| 37 | if ne version 1 |
| 38 | ret 1 |
| 39 | end |
| 40 | if ne count 40 |
| 41 | ret 2 |
| 42 | end |
| 43 | for i ulong 40 |
| 44 | put Seen i 0 |
| 45 | end |
| 46 | for i ulong 1600 |
| 47 | put Reach i 0 |
| 48 | end |
| 49 | for i ulong 40 |
| 50 | id = ecfield i 0 |
| 51 | if or lt id 1 gt id 40 |
| 52 | ret 3 |
| 53 | end |
| 54 | if ne get Seen sub id 1 0 |
| 55 | ret 3 |
| 56 | end |
| 57 | put Seen sub id 1 add i 1 |
| 58 | if or lt ecfield i 1 1 gt ecfield i 1 4 |
| 59 | ret 4 |
| 60 | end |
| 61 | if or eq ecfield i 2 0 eq ecfield i 3 0 |
| 62 | ret 4 |
| 63 | end |
| 64 | state = ecfield i 4 |
| 65 | tier = ecfield i 5 |
| 66 | needs = ecfield i 6 |
| 67 | if or gt state 4 or gt tier 3 gt needs 7 |
| 68 | ret 5 |
| 69 | end |
| 70 | if ne and needs ecrequire id ecrequire id |
| 71 | ret 19 |
| 72 | end |
| 73 | deps = ecfield i 7 |
| 74 | if gt deps 1099511627775 |
| 75 | ret 6 |
| 76 | end |
| 77 | if ne and deps shl 1 sub id 1 0 |
| 78 | ret 6 |
| 79 | end |
| 80 | for j ulong 40 |
| 81 | if ne and deps shl 1 j 0 |
| 82 | put Reach add mul sub id 1 40 j 1 |
| 83 | end |
| 84 | end |
| 85 | if gt state 0 |
| 86 | if or eq ecfield i 8 0 eq ecfield i 9 0 |
| 87 | ret 7 |
| 88 | end |
| 89 | end |
| 90 | if ge state 2 |
| 91 | if or eq tier 0 or eq ecfield i 10 0 eq ecfield i 11 0 |
| 92 | ret 8 |
| 93 | end |
| 94 | if or eq ecfield i 18 0 eq ecfield i 18 ecfield i 3 |
| 95 | ret 9 |
| 96 | end |
| 97 | if eq ecfield i 16 0 |
| 98 | ret 10 |
| 99 | end |
| 100 | if ne and needs 1 0 |
| 101 | if eq ecfield i 17 0 |
| 102 | ret 11 |
| 103 | end |
| 104 | end |
| 105 | if ne and needs 2 0 |
| 106 | if eq ecfield i 15 0 |
| 107 | ret 12 |
| 108 | end |
| 109 | end |
| 110 | if ne and needs 4 0 |
| 111 | if ne tier 3 |
| 112 | ret 13 |
| 113 | end |
| 114 | end |
| 115 | end |
| 116 | if ge state 3 |
| 117 | if or eq ecfield i 12 0 eq ecfield i 14 0 |
| 118 | ret 14 |
| 119 | end |
| 120 | end |
| 121 | if eq state 4 |
| 122 | if eq ecfield i 13 2 |
| 123 | ret 15 |
| 124 | end |
| 125 | end |
| 126 | if ne ecfield i 19 0 |
| 127 | ret 16 |
| 128 | end |
| 129 | end |
| 130 | note Transitive closure detects cycles even in entirely pending rows. |
| 131 | for k ulong 40 |
| 132 | for i ulong 40 |
| 133 | if ne get Reach add mul i 40 k 0 |
| 134 | for j ulong 40 |
| 135 | if ne get Reach add mul k 40 j 0 |
| 136 | put Reach add mul i 40 j 1 |
| 137 | end |
| 138 | end |
| 139 | end |
| 140 | end |
| 141 | end |
| 142 | for i ulong 40 |
| 143 | if ne get Reach add mul i 40 i 0 |
| 144 | ret 17 |
| 145 | end |
| 146 | row = sub get Seen i 1 |
| 147 | if ge ecfield row 4 3 |
| 148 | for j ulong 40 |
| 149 | if ne get Reach add mul i 40 j 0 |
| 150 | dep = sub get Seen j 1 |
| 151 | if lt ecfield dep 4 3 |
| 152 | ret 18 |
| 153 | end |
| 154 | end |
| 155 | end |
| 156 | end |
| 157 | end |
| 158 | ret 0 |
| 159 | end |