Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/apps/interplane-forge/collab/native/json.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / apps / interplane-forge / collab / native / json.om` 447 lines ยท 6137 bytes Raw Blame History 1 note ---- issues of the native store (collab/co5iss.om): forge/issues/1 and forge/issue/1. An imported 2 note issue has "author": null and an "imported" object naming its GitHub source and login (plain data, 3 note never an account or a DID of this forge); the first comment is the issue body, as on the page. 4 text tnjimp "imported" 5 text tnjdid "did" 6 text tnjnm "name" 7 text tnjfrom "from" 8 text tnjgh "github" 9 text tnjown "owner" 10 text tnjrepo "repo" 11 text tnjurl "url" 12 text tnjlog "login" 13 text tnjkind "kind" 14 text tnjclos "closed" 15 text tnjline "line" 16 text tnjurlk "\"url\":\"" 17 fn nijlist to long 18 if not niidx 19 ret 500 20 end 21 f = nifilt 22 nipagen f 23 fyrhead tcjsis 24 fyk tcstn 25 cojsn 2 f 26 fyk tcjsts 27 cojtabs 2 28 fyk tcjtr 29 paged = ne get gnpaged 0 0 30 fybool and not paged gt get gnmatch 0 NILEG 31 if paged 32 fyk tnpkey 33 fnum get gnpage 0 34 fyk tnpp 35 fnum NIPAGE 36 nijnav f 37 end 38 fyk tcjisss 39 fputc 91 40 if not nijrows f paged 41 ret 500 42 end 43 fputc 93 44 fyk tcnwr 45 niwnewjson 46 fputc 10 47 fyend 48 ret 200 49 end 50 fn nijrows f ulong paged bool to bool 51 m = ulong 0 52 skip = ulong 0 53 count = NILEG 54 if paged 55 skip = mul sub get gnpage 0 1 NIPAGE 56 count = NIPAGE 57 end 58 n = get gnn 0 59 for j ulong n bound NIROWS 60 k = j 61 if paged 62 k = sub sub n 1 j 63 end 64 s = nistate k 65 if or eq f 9 eq f s 66 if ge m skip 67 if gt m skip 68 fputc 44 69 end 70 fputc 10 71 if not nijrow k s 72 ret false 73 end 74 end 75 m = add m 1 76 if eq m add skip count 77 break 78 end 79 end 80 end 81 ret true 82 end 83 fn nijnav f ulong to void 84 p = get gnpage 0 85 fyk tnprev 86 if gt p 1 87 cojq 88 nipageurl f sub p 1 false 89 cojq 90 else 91 fynull 92 end 93 fyk tnnext 94 if gt get gnmatch 0 mul p NIPAGE 95 cojq 96 nipageurl f add p 1 false 97 cojq 98 else 99 fynull 100 end 101 end 102 fn nijid k ulong to void 103 cojq 104 for i ulong 16 105 fputc get gnix add mul k 17 i 106 end 107 cojq 108 end 109 fn nijtitle k ulong to void 110 n = nismall k tnfttl 111 fjtb 112 for i ulong n bound 65536 113 fjtc get gnf i 114 end 115 fjstr 116 end 117 fn nijrow k ulong s ulong to bool 118 fputc 123 119 fyk0 tcid 120 nijid k 121 fyk tcjtitl 122 nijtitle k 123 fyk tcstn 124 cojsn 2 s 125 nigh k 126 fyk tcjauth 127 nijauthor 128 nijimp k 129 if not nithr k 130 ret false 131 end 132 fyk tcjupd 133 nijupd 134 fyk tcjcoms 135 fnum nicount 136 fyk tcjverd 137 fynull 138 fyk tcjpath 139 cojq 140 nilink k 141 cojq 142 fputc 125 143 ret true 144 end 145 fn nijauthor to void 146 if eq get gnative 0 0 147 fynull 148 ret 149 end 150 fputc 123 151 fyk0 tnjdid 152 nijgh tniwdid 153 fyk tnjnm 154 fynull 155 fputc 125 156 end 157 note nijgh t: the gh value t as a JSON string (null when "-" or absent) 158 fn nijgh t view uchar * to void 159 o = nighv t 160 n = get gnr 15 161 if or eq n 0 and eq n 1 eq get gngh o 45 162 fynull 163 ret 164 end 165 fjtb 166 for i ulong n bound 65536 167 fjtc get gngh add o i 168 end 169 fjstr 170 end 171 note nijsv t: in gnf (a source.json), the string value after t as a JSON string 172 fn nijsv t view uchar * to void 173 fjtb 174 n = get gnfl 0 175 for s ulong n bound 65536 176 if nijat s t 177 p = add s len t 178 while lt p n bound 65536 179 c = get gnf p 180 if eq c 34 181 break 182 end 183 fjtc c 184 p = add p 1 185 end 186 break 187 end 188 end 189 fjstr 190 end 191 note nighnum: imported issue number as a bounded decimal; invalid or missing is zero 192 fn nighnum to ulong 193 o = nighv tnghn 194 n = get gnr 15 195 if gt n 18 196 ret 0 197 end 198 v = ulong 0 199 for i ulong n bound 18 200 c = get gngh add o i 201 if not fisdig c 202 ret 0 203 end 204 v = add mul v 10 ulong sub c 48 205 end 206 ret v 207 end 208 note nijimp k: ,"imported":{"from":"github","owner","repo","number","url","login"} (gh must be loaded) 209 fn nijimp k ulong to void 210 x = nismall k tnfsrc 211 fyk tnjimp 212 if eq get gnative 0 1 213 fynull 214 ret 215 end 216 fputc 123 217 fyk0 tnjfrom 218 fysv tnjgh 219 fyk tnjown 220 nijsv tnjow 221 fyk tnjrepo 222 nijsv tnjrp 223 fyk tcjnum 224 fnum nighnum 225 fyk tnjurl 226 nijsv tnjurlk 227 fyk tnjlog 228 nijgh tnghl 229 fputc 125 230 end 231 note nijupd: the newest of the opened and closed times and the loaded thread's record times 232 fn nijupd to void 233 o = nighv tnghop 234 if ne get gnr 15 20 235 fynull 236 ret 237 end 238 for i ulong 20 239 put gnf i get gngh add o i 240 end 241 c = nighv tnghcl 242 if eq get gnr 15 20 243 if nighlt 0 c 244 for i ulong 20 245 put gnf i get gngh add c i 246 end 247 end 248 end 249 p = ulong 0 250 n = get gnthl 0 251 while lt p n bound `16777216` 252 p = nirec p 253 if and ne get gnr 0 0 eq get gnr 2 20 254 if nithlt get gnr 1 255 for i ulong 20 256 put gnf i get gnth add get gnr 1 i 257 end 258 end 259 end 260 end 261 fjtb 262 for i ulong 20 263 fjtc get gnf i 264 end 265 fjstr 266 end 267 note nighlt a c: gnf[a, a+20) sorts before gngh[c, c+20) 268 fn nighlt a ulong c ulong to bool 269 for i ulong 20 270 x = get gnf add a i 271 y = get gngh add c i 272 if ne x y 273 ret lt x y 274 end 275 end 276 ret false 277 end 278 fn nithlt c ulong to bool 279 for i ulong 20 280 x = get gnf i 281 y = get gnth add c i 282 if ne x y 283 ret lt x y 284 end 285 end 286 ret false 287 end 288 note nijraw a: gnth[gnr a, + gnr a+1) as a JSON string 289 fn nijraw a ulong to void 290 fjtb 291 o = get gnr a 292 for i ulong get gnr add a 1 bound `16777216` 293 fjtc get gnth add o i 294 end 295 fjstr 296 end 297 fn nijone to long 298 if not niidx 299 ret 500 300 end 301 k = niref 302 if ge k get gnn 0 303 ret 404 304 end 305 s = nistate k 306 fyrhead tcjsi 307 fyk tcid 308 nijid k 309 fyk tcjtitl 310 nijtitle k 311 fyk tcstn 312 cojsn 2 s 313 nigh k 314 fyk tcjauth 315 nijauthor 316 nijimp k 317 fyk tcjopen 318 nijgh tnghop 319 fyk tnjclos 320 nijgh tnghcl 321 fyk tcjpath 322 cojq 323 nilink k 324 cojq 325 fyk tcjreas 326 nijgh tnghre 327 nijlabs k 328 fyk tcjasg 329 fputc 91 330 fputc 93 331 if not nithr k 332 ret 500 333 end 334 if not nijcoms k 335 ret 500 336 end 337 fyend 338 ret 200 339 end 340 fn nijlabs k ulong to void 341 fyk tcjlabs 342 fputc 91 343 n = nismall k tnflab 344 s = ulong 0 345 c = ulong 0 346 for i ulong n bound 65536 347 if eq get gnf i 10 348 if gt c 0 349 fputc 44 350 end 351 fjtb 352 for j ulong sub i s bound 65536 353 fjtc get gnf add s j 354 end 355 fjstr 356 c = add c 1 357 s = add i 1 358 end 359 end 360 fputc 93 361 end 362 note nijcoms k: "comments": the body first (author null, the GitHub login, opened), then the thread 363 fn nijcoms k ulong to bool 364 fyk tcjcoms 365 fputc 91 366 fputc 10 367 fputc 123 368 fyk0 tcjauth 369 nijauthor 370 fyk tnjlog 371 nijgh tnghl 372 fyk tnjkind 373 fysv tcjtcom 374 fyk tcjtime 375 nijgh tnghop 376 fyk tcjbody 377 nipf k tnfdsc 378 r = frdall 379 if lt r 0 380 r = 0 381 end 382 if ne get fxotr 0 0 383 ret false 384 end 385 fjfx 0 ulong r 386 fyk tcjred 387 fybool false 388 fputc 125 389 p = ulong 0 390 n = get gnthl 0 391 while lt p n bound `16777216` 392 p = nirec p 393 if ne get gnr 0 0 394 fputc 44 395 fputc 10 396 nijcom 397 end 398 end 399 fputc 93 400 ret true 401 end 402 fn nijcom to void 403 k = get gnr 0 404 fputc 123 405 fyk0 tcjauth 406 if eq k 4 407 fputc 123 408 fyk0 tnjdid 409 nijraw 3 410 fyk tnjnm 411 fynull 412 fputc 125 413 fyk tnjlog 414 fynull 415 else 416 fynull 417 fyk tnjlog 418 nijraw 3 419 end 420 fyk tnjkind 421 if or eq k 1 eq k 4 422 fysv tcjtcom 423 end 424 if eq k 2 425 fysv tcjtrvw 426 fyk tcstn 427 nijraw 5 428 end 429 if eq k 3 430 fysv tnrrc 431 fyk tcjpath 432 nijraw 8 433 fyk tnjline 434 fnum get gnr 7 435 end 436 fyk tcjtime 437 if eq get gnr 2 20 438 nijraw 1 439 else 440 fynull 441 end 442 fyk tcjbody 443 nijraw 10 444 fyk tcjred 445 fybool false 446 fputc 125 447 end