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/core/mission/mission.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 / core / mission / mission.om` 825 lines ยท 12032 bytes Raw Blame History 1 note omega-mission, pure seeded Omega; compose after seed/trace/sha256.om. 2 global mb uchar 1024 3 global mn ulong 1 4 global mo ulong 13 5 global ml ulong 13 6 global eb uchar 1024 7 global en ulong 1 8 global jb uchar 4096 9 global jn ulong 1 10 global jo ulong 6 11 global jl ulong 6 12 global prev uchar 64 13 global saved uchar 131072 14 global slen ulong 128 15 global states ulong 128 16 global count ulong 1 17 global chosen ulong 1 18 global args uchar 16384 19 global alen ulong 32 20 global temp uchar 131072 21 global tn ulong 1 22 text hx "`0123456789abcdef`" 23 text zero "`0000000000000000000000000000000000000000000000000000000000000000`" 24 text err "mission: refused (usage=2 policy=3 evidence=4 chain=5 io=6)\n" 25 text stnames "PROPOSED CLAIMED RUNNING READY VERIFIED MERGED FAILED" 26 text t_ro "read-only" 27 text t_edit "local-edit" 28 text t_build "build-run" 29 text t_lease "lease" 30 text s_none "none" 31 text s_gpu "gb10" 32 text s_lease "spark-window-exclusive" 33 fn die code int to void 34 x = write 2 err 0 len err 35 exit code 36 end 37 fn argload to void 38 if gt argcnt 32 39 die 2 40 end 41 for i ulong ulong argcnt 42 r = argread i args mul i 512 512 43 if lt r 0 44 die 2 45 end 46 put alen i ulong r 47 end 48 end 49 fn aeq i ulong s view uchar * to bool 50 if ne get alen i len s 51 ret false 52 end 53 for z ulong len s 54 if ne get args add mul i 512 z get s z 55 ret false 56 end 57 end 58 ret true 59 end 60 fn meq i ulong s view uchar * to bool 61 if ne get ml i len s 62 ret false 63 end 64 for z ulong len s 65 if ne get mb add get mo i z get s z 66 ret false 67 end 68 end 69 ret true 70 end 71 fn fieldsame a ulong b ulong to bool 72 if ne get ml a get ml b 73 ret false 74 end 75 for z ulong get ml a 76 if ne get mb add get mo a z get mb add get mo b z 77 ret false 78 end 79 end 80 ret true 81 end 82 note Identities compare ASCII case-insensitively, so Reviewer and reviewer are one actor. 83 fn lowc c uchar to uchar 84 if and ge c 65 le c 90 85 ret uchar add c 32 86 end 87 ret c 88 end 89 fn idsame a ulong b ulong to bool 90 if ne get ml a get ml b 91 ret false 92 end 93 for z ulong get ml a 94 x = lowc get mb add get mo a z 95 y = lowc get mb add get mo b z 96 if ne x y 97 ret false 98 end 99 end 100 ret true 101 end 102 fn idchar c uchar to bool 103 if and ge c 65 le c 90 104 ret true 105 end 106 if and ge c 97 le c 122 107 ret true 108 end 109 if and ge c 48 le c 57 110 ret true 111 end 112 ret or eq c 45 or eq c 46 eq c 95 113 end 114 fn hexval c uchar to ulong 115 if and ge c 48 le c 57 116 ret ulong sub c 48 117 end 118 if and ge c 97 le c 102 119 ret ulong sub c 87 120 end 121 die 5 122 ret 0 123 end 124 fn msplits to void 125 p = ulong 0 126 q = ulong 0 127 for i ulong get mn 0 128 c = get mb i 129 if or lt c 32 gt c 126 130 die 2 131 end 132 if or eq c 34 eq c 92 133 die 2 134 end 135 if eq c 124 136 if or ge q 12 eq i p 137 die 2 138 end 139 put mo q p 140 put ml q sub i p 141 q = add q 1 142 p = add i 1 143 end 144 end 145 if or ne q 12 eq p get mn 0 146 die 2 147 end 148 put mo 12 p 149 put ml 12 sub get mn 0 p 150 end 151 fn tier to ulong 152 if meq 8 t_ro 153 ret 0 154 end 155 if meq 8 t_edit 156 ret 1 157 end 158 if meq 8 t_build 159 ret 2 160 end 161 if meq 8 t_lease 162 ret 3 163 end 164 die 2 165 ret 0 166 end 167 fn cores to void 168 p = get mo 5 169 lim = add p get ml 5 170 lo = ulong 0 171 v = ulong 0 172 digits = ulong 0 173 range = false 174 while le p lim bound 1024 175 c = uchar 44 176 if lt p lim 177 c = get mb p 178 end 179 if and ge c 48 le c 57 180 v = add mul v 10 ulong sub c 48 181 if gt v 255 182 die 2 183 end 184 digits = add digits 1 185 else 186 if eq digits 0 187 die 2 188 end 189 if eq c 45 190 if range 191 die 2 192 end 193 lo = v 194 range = true 195 else 196 if ne c 44 197 die 2 198 end 199 if not range 200 lo = v 201 end 202 if gt lo v 203 die 2 204 end 205 while le lo v bound 256 206 if or eq lo 3 or eq lo 7 eq lo 15 207 die 2 208 end 209 lo = add lo 1 210 end 211 range = false 212 end 213 v = 0 214 digits = 0 215 end 216 p = add p 1 217 end 218 end 219 note Command tokens are checked without executing them. 220 global cb uchar 2048 221 global cn ulong 1 222 global co ulong 64 223 global cl ulong 64 224 global nc ulong 1 225 fn ceq i ulong s view uchar * to bool 226 if ge i get nc 0 227 ret false 228 end 229 if ne get cl i len s 230 ret false 231 end 232 for z ulong len s 233 if ne get cb add get co i z get s z 234 ret false 235 end 236 end 237 ret true 238 end 239 fn cmdparse to void 240 put nc 0 0 241 p = ulong 0 242 while lt p get cn 0 bound 2048 243 if eq get cb p 32 244 p = add p 1 245 continue 246 end 247 beg = p 248 while lt p get cn 0 bound 2048 249 c = get cb p 250 if eq c 32 251 break 252 end 253 if not or idchar c or eq c 47 or eq c 61 or eq c 44 eq c 58 254 die 3 255 end 256 p = add p 1 257 end 258 n = get nc 0 259 if ge n 64 260 die 3 261 end 262 put co n beg 263 put cl n sub p beg 264 put nc 0 add n 1 265 end 266 if eq get nc 0 0 267 die 3 268 end 269 end 270 text c_git "git" 271 text c_rad "rad" 272 text c_gh "gh" 273 text c_push "push" 274 text c_merge "merge" 275 text c_sh "sh" 276 text c_status "status" 277 text c_diff "diff" 278 text c_log "log" 279 text c_show "show" 280 text c_cat "cat" 281 text c_pwd "pwd" 282 text c_mkdir "mkdir" 283 text c_touch "touch" 284 text c_omc "omc" 285 text c_miss "mission" 286 text c_verify "verify" 287 text c_plan "plan" 288 text c_spark "spark-window" 289 text c_open "open" 290 text c_gb "--gb10" 291 text c_excl "exclusive" 292 text c_quiet "--quiet" 293 text c_lflag "--lease" 294 text c_wait "--wait" 295 note Read/edit operands stay inside the slice planned paths: relative, no dot-dot, no option. 296 fn slicearg i ulong to void 297 b = get co i 298 n = get cl i 299 c0 = get cb b 300 if or eq c0 45 eq c0 47 301 die 3 302 end 303 for z ulong n 304 if eq get cb add b z 46 305 if lt add z 1 n 306 if eq get cb add add b z 1 46 307 die 3 308 end 309 end 310 end 311 end 312 if not inpaths b n 313 die 3 314 end 315 end 316 fn inpaths b ulong n ulong to bool 317 p = get mo 4 318 lim = add p get ml 4 319 st = p 320 while le p lim bound 1025 321 sep = eq p lim 322 if not sep 323 sep = eq get mb p 44 324 end 325 if sep 326 if pathpre b n st sub p st 327 ret true 328 end 329 st = add p 1 330 end 331 p = add p 1 332 end 333 ret false 334 end 335 fn pathpre b ulong n ulong st ulong pk ulong to bool 336 note Operand is a plan path or lies below one; a plan path of dot is the whole repo. 337 if eq pk 1 338 if eq get mb st 46 339 ret true 340 end 341 end 342 if lt n pk 343 ret false 344 end 345 for z ulong pk 346 if ne get cb add b z get mb add st z 347 ret false 348 end 349 end 350 if eq n pk 351 ret true 352 end 353 if eq get mb add st sub pk 1 47 354 ret true 355 end 356 ret eq get cb add b pk 47 357 end 358 fn relexec i ulong to void 359 note Token i names a repository-relative file: no PATH lookup, option, absolute path or dot-dot. 360 b = get co i 361 n = get cl i 362 c0 = get cb b 363 if or eq c0 45 eq c0 47 364 die 3 365 end 366 slash = false 367 for z ulong n 368 c = get cb add b z 369 if eq c 47 370 slash = true 371 end 372 if eq c 46 373 if lt add z 1 n 374 if eq get cb add add b z 1 46 375 die 3 376 end 377 end 378 end 379 end 380 if eq i 0 381 if not slash 382 die 3 383 end 384 end 385 end 386 note spark-window LEASE_MAX is 20 minutes for exclusive windows; admit only decimal 1..20. 387 fn leaseok to bool 388 n = get cl 8 389 p = get co 8 390 a = get cb p 391 if eq n 1 392 ret and ge a 49 le a 57 393 end 394 if ne n 2 395 ret false 396 end 397 b = get cb add p 1 398 if eq a 49 399 ret and ge b 48 le b 57 400 end 401 ret and eq a 50 eq b 48 402 end 403 fn cmdpolicy lvl ulong to void 404 cmdparse 405 for i ulong get nc 0 406 if or ceq i c_push ceq i c_merge 407 die 3 408 end 409 end 410 note Acceptance argv is verifier metadata, not worker execution permission. It is 411 note mission verify/status/plan, bare omc, or a repository-relative script or executable. 412 if eq lvl 99 413 if ceq 0 c_omc 414 if ne get nc 0 1 415 die 3 416 end 417 ret 418 end 419 if ceq 0 c_miss 420 if ne get nc 0 3 421 die 3 422 end 423 if or ceq 1 c_verify or ceq 1 c_status ceq 1 c_plan 424 ret 425 end 426 die 3 427 end 428 first = ulong 0 429 if ceq 0 c_sh 430 if lt get nc 0 2 431 die 3 432 end 433 first = 1 434 end 435 relexec first 436 ret 437 end 438 if ceq 0 c_git 439 if ne get nc 0 2 440 die 3 441 end 442 if or ceq 1 c_status or ceq 1 c_diff or ceq 1 c_log ceq 1 c_show 443 ret 444 end 445 die 3 446 end 447 if or ceq 0 c_rad ceq 0 c_gh 448 die 3 449 end 450 if ceq 0 c_pwd 451 if ne get nc 0 1 452 die 3 453 end 454 ret 455 end 456 if ceq 0 c_cat 457 if ne get nc 0 2 458 die 3 459 end 460 slicearg 1 461 ret 462 end 463 if ge lvl 1 464 if or ceq 0 c_mkdir ceq 0 c_touch 465 if ne get nc 0 2 466 die 3 467 end 468 slicearg 1 469 ret 470 end 471 end 472 if ge lvl 2 473 if ceq 0 c_omc 474 if ne get nc 0 1 475 die 3 476 end 477 ret 478 end 479 if ceq 0 c_miss 480 if ne get nc 0 3 481 die 3 482 end 483 if or ceq 1 c_verify or ceq 1 c_status ceq 1 c_plan 484 ret 485 end 486 die 3 487 end 488 end 489 if ceq 0 c_spark 490 if and ceq 1 c_status eq get nc 0 2 491 ret 492 end 493 if eq lvl 3 494 note A slice planned without a GPU never opens a GPU window. 495 if meq 6 s_none 496 die 3 497 end 498 if ne get nc 0 10 499 die 3 500 end 501 if not and ceq 1 c_open ceq 3 c_gb 502 die 3 503 end 504 if not and ceq 4 c_excl ceq 5 c_quiet 505 die 3 506 end 507 if not and ceq 6 s_none ceq 7 c_lflag 508 die 3 509 end 510 if not ceq 9 c_wait 511 die 3 512 end 513 if not leaseok 514 die 3 515 end 516 ret 517 end 518 end 519 die 3 520 end 521 fn mcommand fld ulong lvl ulong to void 522 put cn 0 get ml fld 523 for i ulong get ml fld 524 put cb i get mb add get mo fld i 525 end 526 cmdpolicy lvl 527 end 528 fn isgit p ulong to bool 529 if ne get mb p 46 530 ret false 531 end 532 if ne get mb add p 1 103 533 ret false 534 end 535 if ne get mb add p 2 105 536 ret false 537 end 538 ret eq get mb add p 3 116 539 end 540 fn nogit to void 541 note Plan paths never name the repository metadata directory .git as a segment. 542 o = get mo 4 543 l = get ml 4 544 for i ulong l 545 st = eq i 0 546 if not st 547 pc = get mb add o sub i 1 548 st = or eq pc 44 eq pc 47 549 end 550 if st 551 if le add i 4 l 552 if isgit add o i 553 e = add i 4 554 if eq e l 555 die 3 556 end 557 c = get mb add o e 558 if or eq c 44 eq c 47 559 die 3 560 end 561 end 562 end 563 end 564 end 565 end 566 fn validate to void 567 msplits 568 for f ulong 4 569 for i ulong get ml f 570 if not idchar get mb add get mo f i 571 die 2 572 end 573 end 574 end 575 if idsame 1 2 576 die 2 577 end 578 for i ulong get ml 4 579 c = get mb add get mo 4 i 580 if not or idchar c or eq c 47 eq c 44 581 die 2 582 end 583 if eq c 44 584 if or eq i 0 eq add i 1 get ml 4 585 die 2 586 end 587 next = get mb add add get mo 4 i 1 588 if or eq next 44 eq next 47 589 die 2 590 end 591 end 592 if eq c 46 593 if lt add i 1 get ml 4 594 if eq get mb add add get mo 4 i 1 46 595 die 2 596 end 597 end 598 end 599 end 600 if eq get mb get mo 4 47 601 die 2 602 end 603 nogit 604 cores 605 lvl = tier 606 if meq 6 s_none 607 if not meq 7 s_none 608 die 2 609 end 610 else 611 if not and meq 6 s_gpu meq 7 s_lease 612 die 2 613 end 614 if ne lvl 3 615 die 2 616 end 617 end 618 if ne get ml 9 40 619 die 2 620 end 621 for i ulong 40 622 c = get mb add get mo 9 i 623 if not or and ge c 48 le c 57 and ge c 97 le c 102 624 die 2 625 end 626 end 627 if fieldsame 10 11 628 die 2 629 end 630 mcommand 10 99 631 mcommand 11 99 632 mcommand 12 lvl 633 end 634 note IO helpers keep file reads bounded and reject one extra byte. 635 fn loadfile ai ulong to void 636 fd = fopen args mul ai 512 get alen ai 131072 0 637 if lt fd 0 638 die 6 639 end 640 put tn 0 0 641 while lt get tn 0 131072 bound 131072 642 r = read int fd temp get tn 0 sub 131072 get tn 0 643 if lt r 0 644 die 6 645 end 646 if eq r 0 647 break 648 end 649 put tn 0 add get tn 0 ulong r 650 end 651 x = fclose int fd 652 if eq get tn 0 131072 653 die 2 654 end 655 end 656 fn emit s view uchar * to void 657 i = ulong 0 658 while lt i len s bound 131072 659 r = write 1 s i sub len s i 660 if le r 0 661 die 6 662 end 663 i = add i ulong r 664 end 665 end 666 text jq0 "{\"id\":\"" 667 text jq1 "\",\"owner\":\"" 668 text jq2 "\",\"verifier\":\"" 669 text jq3 "\",\"repo\":\"" 670 text jq4 "\",\"paths\":\"" 671 text jq5 "\",\"cores\":\"" 672 text jq6 "\",\"gpu\":\"" 673 text jq7 "\",\"lease\":\"" 674 text jq8 "\",\"tier\":\"" 675 text jq9 "\",\"head\":\"" 676 text jq10 "\",\"acceptance\":\"" 677 text jq11 "\",\"negative\":\"" 678 text jq12 "\",\"command\":\"" 679 text jq13 "\"}\n" 680 text jsstate "\",\"state\":\"" 681 text state1 "PROPOSED" 682 text state2 "CLAIMED" 683 text state3 "RUNNING" 684 text state4 "READY" 685 text state5 "VERIFIED" 686 text state6 "MERGED" 687 text state7 "FAILED" 688 fn fieldout f ulong to void 689 x = write 1 mb get mo f get ml f 690 if ne x long get ml f 691 die 6 692 end 693 end 694 fn stateout n ulong to void 695 if eq n 1 696 emit state1 697 end 698 if eq n 2 699 emit state2 700 end 701 if eq n 3 702 emit state3 703 end 704 if eq n 4 705 emit state4 706 end 707 if eq n 5 708 emit state5 709 end 710 if eq n 6 711 emit state6 712 end 713 if eq n 7 714 emit state7 715 end 716 end 717 fn planout to void 718 emit jq0 719 fieldout 0 720 emit jq1 721 fieldout 1 722 emit jq2 723 fieldout 2 724 emit jq3 725 fieldout 3 726 emit jq4 727 fieldout 4 728 emit jq5 729 fieldout 5 730 emit jq6 731 fieldout 6 732 emit jq7 733 fieldout 7 734 emit jq8 735 fieldout 8 736 emit jq9 737 fieldout 9 738 emit jq10 739 fieldout 10 740 emit jq11 741 fieldout 11 742 emit jq12 743 fieldout 12 744 emit jq13 745 end 746 fn findslot to ulong 747 for s ulong get count 0 748 p = mul s 1024 749 same = true 750 for i ulong get ml 0 751 if ne get saved add p i get mb i 752 same = false 753 end 754 end 755 if ne get saved add p get ml 0 124 756 same = false 757 end 758 if same 759 ret s 760 end 761 end 762 ret 128 763 end 764 fn savem s ulong to void 765 for i ulong get mn 0 766 put saved add mul s 1024 i get mb i 767 end 768 put slen s get mn 0 769 end 770 fn restore s ulong to void 771 put mn 0 get slen s 772 for i ulong get mn 0 773 put mb i get saved add mul s 1024 i 774 end 775 msplits 776 end 777 fn addplan to void 778 validate 779 if ne findslot 128 780 die 2 781 end 782 s = get count 0 783 if ge s 128 784 die 2 785 end 786 savem s 787 put count 0 add s 1 788 end 789 fn loadplan ai ulong to void 790 loadfile ai 791 put mn 0 0 792 for i ulong get tn 0 793 c = get temp i 794 if eq c 10 795 if eq get mn 0 0 796 die 2 797 end 798 addplan 799 put mn 0 0 800 else 801 if ge get mn 0 1023 802 die 2 803 end 804 put mb get mn 0 c 805 put mn 0 add get mn 0 1 806 end 807 end 808 if or ne get mn 0 0 eq get count 0 0 809 die 2 810 end 811 end 812 fn target s ulong ai ulong to bool 813 if ge s get count 0 814 ret false 815 end 816 n = get alen ai 817 for i ulong n 818 a = get args add mul ai 512 i 819 b = get saved add mul s 1024 i 820 if ne a b 821 ret false 822 end 823 end 824 ret eq get saved add mul s 1024 n 124 825 end