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/aienux/blob/main/docs/CONTINUOUS_EXISTENCE_AMENDMENT.md # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / docs / CONTINUOUS_EXISTENCE_AMENDMENT.md` 1005 lines · 21339 bytes Raw Blame History Rendered 1 # AIENOS Continuous-Existence Amendment 2 3 **Status:** Operator-approved governing amendment (2026-09-23) 4 **Authority:** Operator Directive 5 **Scope:** Lifecycle semantics and acceptance criteria across the locked 10-gate Systems-Integration Sequence 6 **Related:** [SYSTEMS_INTEGRATION_SEQUENCE.md](SYSTEMS_INTEGRATION_SEQUENCE.md), [ARCHITECTURE.md §1, §10](ARCHITECTURE.md), [ADR 0007](adr/0007-continuous-existence-provisioning-once.md), [ADR 0005](adr/0005-unified-memory-c1-cow-and-reservation-accounting.md), [ADR 0006](adr/0006-deterministic-recovery-core-and-offline-operator-authority.md) 7 8 This amendment does not add a new conceptual layer and does not change the locked 10-gate Systems-Integration Sequence. 9 10 It changes the lifecycle semantics and acceptance criteria applied across those gates. 11 12 The key architectural change is: 13 14 > **AIEN is provisioned once. After that, boot, reboot, sleep, model reload, kernel restart, hardware failure, and migration are execution-state transitions—not agent creation events.** 15 16 --- 17 18 ## 1. Governing invariant: AIEN exists continuously 19 20 AIENOS is designed around **continuous logical agent existence**. 21 22 The resident AIEN agent is not defined by: 23 24 - a running process; 25 - a loaded model; 26 - a KV cache; 27 - RAM contents; 28 - a kernel instance; 29 - a boot session; 30 - a particular physical machine. 31 32 Those are execution substrates. 33 34 AIEN's durable identity is logical and persistent. 35 36 The governing rule is: 37 38 > **AIEN is provisioned once. Physical execution may stop, migrate, sleep, fail, restart, or be reconstructed without implicitly creating a new agent.** 39 40 Therefore: 41 42 > **Cold boot initializes hardware. It does not create AIEN.** 43 44 And: 45 46 > **Loss of physical execution state may increase reconstruction cost, but must not by itself terminate logical identity.** 47 48 This generalizes the existing C1 rule: 49 50 > **Losing KV costs computation, not identity.** 51 52 into the system-wide rule: 53 54 > **Losing physical execution state costs recovery or computation, not identity.** 55 56 --- 57 58 ## 2. Provisioning is different from boot 59 60 AIENOS must distinguish **initial provisioning** from all later starts. 61 62 ### Initial provisioning 63 64 Only the initial creation of an AIEN identity may create a new durable `LogicalAgentId`. 65 66 Conceptually: 67 68 ```text 69 unprovisioned AIENOS 70 ↓ 71 operator explicitly provisions AIEN 72 ↓ 73 LogicalAgentId created 74 ↓ 75 durable agent root committed 76 ↓ 77 AIEN exists 78 ``` 79 80 After this point, that identity is persistent. 81 82 ### Every later machine start 83 84 ```text 85 power / reset / wake 86 ↓ 87 hardware initialization 88 ↓ 89 locate durable AIEN root 90 ↓ 91 verify committed state 92 ↓ 93 restore execution environment 94 ↓ 95 resume existing LogicalAgentId 96 ``` 97 98 A normal boot path must never silently generate a replacement `LogicalAgentId`. 99 100 If the persistent identity cannot be verified: 101 102 ```text 103 DO NOT CREATE A REPLACEMENT AGENT 104 ↓ 105 enter deterministic Recovery Core 106 ``` 107 108 The operator then chooses whether to restore, import, recover, or explicitly provision a new identity. 109 110 --- 111 112 ## 3. AIENOS lifecycle model 113 114 The normal lifecycle is not: 115 116 ```text 117 BOOT 118 ↓ 119 RUN 120 ↓ 121 SHUTDOWN 122 ``` 123 124 It is: 125 126 ```text 127 AIEN 128 │ 129 ┌───────────┼───────────┐ 130 │ │ │ 131 AWAKE QUIET SLEEP 132 │ │ │ 133 └───────────┼───────────┘ 134 │ 135 DEEP SLEEP 136 │ 137 COLD RECOVERY 138 only when needed 139 ``` 140 141 These names define semantic states, not mandatory implementation mechanisms. 142 143 The engineering agent may choose the most efficient implementation. 144 145 --- 146 147 ## 4. Power-state semantics 148 149 ### AWAKE 150 151 Full interactive operation. 152 153 Likely resources: 154 155 - CPU execution; 156 - required memory; 157 - active inference; 158 - required accelerator resources; 159 - operator interface; 160 - active capabilities; 161 - live Worlds. 162 163 No special restoration required. 164 165 ### QUIET 166 167 AIEN remains actively executing, but unused resources may be reduced or powered down. 168 169 Examples: 170 171 - display off; 172 - unused accelerator regions released; 173 - unnecessary devices suspended; 174 - background work reduced; 175 - model retained where useful. 176 177 Logical state is unchanged. 178 179 ### SLEEP 180 181 Execution is substantially suspended while sufficient volatile state remains available for rapid continuation. 182 183 The implementation may retain: 184 185 - RAM; 186 - selected inference state; 187 - model residency; 188 - scheduler structures; 189 - selected device state. 190 191 Wake should normally continue from preserved physical state. 192 193 ### DEEP SLEEP 194 195 AIEN's logical state remains durable while expensive volatile execution state may be discarded. 196 197 The system must preserve everything required to reconstruct the same logical agent. 198 199 Physical resources such as: 200 201 - KV pages; 202 - accelerator buffers; 203 - model residency; 204 - caches; 205 - temporary allocations; 206 207 may be discarded. 208 209 Wake reconstructs whatever physical state is missing. 210 211 ### COLD RECOVERY 212 213 Used when useful volatile state does not survive, including: 214 215 - complete power removal; 216 - kernel failure; 217 - hardware reset; 218 - severe corruption; 219 - machine replacement. 220 221 AIENOS initializes the execution substrate, locates the latest valid durable AIEN state, verifies it, and reconstructs execution. 222 223 Cold recovery is not agent creation. 224 225 --- 226 227 ## 5. State classes 228 229 Every important AIEN state object must be classified according to whether it defines identity or is merely an execution optimization. 230 231 ### Class A — durable semantic state 232 233 Loss changes who AIEN is, what it knows, what it has committed to, or what it is doing. 234 235 This state must survive according to the persistence contract. 236 237 Examples include: 238 239 ```text 240 LogicalAgentId 241 LogicalBranchId 242 canonical TokenHistory / branch history 243 branch lineage 244 Cortex committed state 245 provenance 246 World manifests 247 durable tasks 248 capability grants 249 operator policy 250 accepted decisions 251 conversation history where committed 252 effect history 253 execution lineage metadata 254 RNG coordinates required for deterministic continuation 255 persistent configuration 256 ``` 257 258 Class A must never depend solely on volatile memory. 259 260 ### Class B — reconstructible physical state 261 262 Loss costs time or computation but does not change logical identity. 263 264 Examples: 265 266 ```text 267 KV cache 268 accelerator buffers 269 compiled execution caches 270 temporary tensor residency 271 model pages cached in RAM 272 scheduler caches 273 prefix-cache materializations 274 derived indexes 275 ``` 276 277 Class B may be retained when economically useful. 278 279 It may be discarded under pressure or deep sleep. 280 281 It must be reconstructible from Class A state plus immutable artifacts. 282 283 ### Class C — ephemeral scratch state 284 285 State with no semantic requirement to survive. 286 287 Examples: 288 289 ```text 290 temporary buffers 291 intermediate activations 292 scratch allocations 293 temporary benchmark structures 294 uncommitted speculative work 295 ``` 296 297 Class C may disappear at any time consistent with transaction semantics. 298 299 --- 300 301 ## 6. Commit-before-observation rule 302 303 AIENOS must not rely on periodic "memory saves" as the primary continuity mechanism. 304 305 Durable semantic state should be committed transactionally as the system operates. 306 307 The governing principle is: 308 309 > **A state transition that future AIEN behavior depends upon must cross its required durability boundary before AIEN treats that transition as committed.** 310 311 For externally visible semantic events, prefer: 312 313 ```text 314 compute/propose transition 315 ↓ 316 commit required logical state 317 ↓ 318 make transition externally visible 319 ``` 320 321 Examples include: 322 323 - accepted conversation turns; 324 - committed Cortex updates; 325 - durable branch creation; 326 - durable task-state changes; 327 - accepted external effects; 328 - important operator decisions. 329 330 This does **not** require every neural activation or intermediate tensor to be persisted. 331 332 Transient model computation remains transient. 333 334 The persistent layer records semantic continuity, not every electrical detail of execution. 335 336 --- 337 338 ## 7. Wake is reconstruction, not revival 339 340 A wake event should follow this abstract decision tree: 341 342 ```text 343 wake event 344 ↓ 345 validate logical AIEN root 346 ↓ 347 what physical state survived? 348 │ 349 ├── sufficient state survives 350 │ ↓ 351 │ resume 352 │ 353 └── physical state missing 354 ↓ 355 reconstruct from durable state 356 ↓ 357 resume 358 ``` 359 360 The operator-facing result should be the same logical AIEN regardless of which path occurred. 361 362 The user should not need to know whether AIENOS: 363 364 - resumed RAM; 365 - rebuilt KV; 366 - reloaded model weights; 367 - replayed a journal; 368 - reconstructed branches; 369 - restarted the kernel; 370 - moved to another machine. 371 372 Those are substrate concerns. 373 374 --- 375 376 ## 8. Model lifecycle 377 378 The model is not AIEN's identity. 379 380 Therefore: 381 382 ```text 383 AIEN 384 ↓ 385 Model A 386 ``` 387 388 may become: 389 390 ```text 391 AIEN 392 ↓ 393 Model B 394 ``` 395 396 without creating another logical agent. 397 398 Likewise: 399 400 ```text 401 model unload 402 model reload 403 model corruption 404 model replacement 405 backend replacement 406 ``` 407 408 are execution events. 409 410 The durable AIEN state survives them. 411 412 Model corruption must prevent the corrupted model from loading. 413 414 It must not force creation of a new agent. 415 416 --- 417 418 ## 9. Kernel lifecycle 419 420 The kernel is also not AIEN's identity. 421 422 A maintenance restart may be: 423 424 ```text 425 AIEN logical state committed 426 ↓ 427 kernel stops 428 ↓ 429 new kernel starts 430 ↓ 431 durable state verified 432 ↓ 433 same AIEN continues 434 ``` 435 436 The same principle applies to kernel upgrades and A/B slot changes. 437 438 The Recovery Core verifies and restores the execution environment. 439 440 It does not invent a replacement AIEN. 441 442 --- 443 444 ## 10. Hardware lifecycle 445 446 Ultimately a physical machine is also not AIEN's identity. 447 448 Long-term: 449 450 ```text 451 Machine A fails 452 ↓ 453 durable AIEN state survives 454 ↓ 455 Machine B obtains authorized state 456 ↓ 457 required physical execution state reconstructed 458 ↓ 459 same LogicalAgentId continues 460 ``` 461 462 Hardware migration is therefore an extension of the same continuity semantics used for sleep and reboot. 463 464 This capability need not exist during the initial Spark milestones, but no early architecture should make it impossible. 465 466 --- 467 468 ## 11. Deterministic wake path 469 470 The earliest wake path must remain deterministic. 471 472 A neural model is not required to decide how the computer wakes. 473 474 The deterministic system is responsible for: 475 476 ```text 477 wake event detection 478 hardware restoration 479 integrity verification 480 persistent-state discovery 481 journal recovery 482 execution-state classification 483 reconstruction launch 484 recovery fallback 485 ``` 486 487 Only once a valid execution environment exists does the neural runtime resume. 488 489 AIEN may later optimize its sleep and wake policy. 490 491 It may not become necessary to recover from its own absence. 492 493 --- 494 495 ## 12. Power management objective 496 497 AIENOS should optimize for **continuous existence with minimum necessary resource residency**, not repeated full startup. 498 499 The scheduler/power manager may determine that a given period requires only: 500 501 ```text 502 timer 503 storage 504 network 505 crypto 506 ``` 507 508 without waking: 509 510 ```text 511 display 512 GPU 513 large model 514 interactive interface 515 ``` 516 517 Likewise an event requiring reasoning may progressively wake additional capabilities. 518 519 Conceptually: 520 521 ```text 522 event 523 ↓ 524 determine required capability set 525 ↓ 526 wake minimum required hardware/runtime 527 ↓ 528 perform work 529 ↓ 530 return unnecessary resources to lower-power state 531 ``` 532 533 This is an optimization policy. 534 535 The architecture does not prescribe the exact power-management mechanism. 536 537 --- 538 539 ## 13. Ordinary operator semantics 540 541 The normal operator vocabulary should eventually favor: 542 543 - **Wake** 544 - **Sleep** 545 - **Deep Sleep** 546 - **Restart Runtime** 547 - **Restart Kernel** 548 - **Power Off** 549 550 rather than treating shutdown/boot as the normal lifecycle. 551 552 `Power Off` remains available because the operator owns the machine. 553 554 It is an exceptional physical-state transition, not logical agent deletion. 555 556 --- 557 558 ## 14. Planned power-off 559 560 Before an intentional complete power-off, AIENOS should attempt to establish a clean continuity point: 561 562 ```text 563 stop accepting new semantic work 564 ↓ 565 commit pending durable state 566 ↓ 567 commit Cortex/WAL state 568 ↓ 569 record branch/task continuation information 570 ↓ 571 write continuity receipt/checkpoint 572 ↓ 573 verify persistent state 574 ↓ 575 power off 576 ``` 577 578 On the next cold start: 579 580 ```text 581 hardware bootstrap 582 ↓ 583 verify continuity state 584 ↓ 585 same LogicalAgentId 586 ↓ 587 reconstruct execution 588 ``` 589 590 --- 591 592 ## 15. Unexpected power loss 593 594 AIENOS must assume power can disappear without warning. 595 596 Therefore continuity cannot depend exclusively on orderly shutdown. 597 598 Recovery uses: 599 600 ```text 601 last valid checkpoint 602 + 603 durable WAL / journals 604 + 605 immutable object manifests 606 + 607 integrity hashes 608 ``` 609 610 Any uncommitted tail is discarded according to its subsystem's recovery rules. 611 612 Externally committed state must never depend on an uncommitted volatile-only transition. 613 614 --- 615 616 ## 16. Changes to the locked Systems-Integration Sequence 617 618 The ten gates remain unchanged. 619 620 Continuous-existence requirements are inserted into their acceptance criteria. 621 622 The gate-by-gate amendments are binding and are mirrored in [SYSTEMS_INTEGRATION_SEQUENCE.md](SYSTEMS_INTEGRATION_SEQUENCE.md) §2. 623 624 ### Gate 1 — Config A Reference Freeze 625 626 No structural change. 627 628 Add baseline measurements for: 629 630 - existing host cold-start behavior; 631 - model reload time; 632 - current state-restoration behavior where measurable. 633 634 Config A remains the historical comparison. 635 636 ### Gate 2 — Native Boot Spine 637 638 Purpose remains native execution from firmware. 639 640 Gate 2 does **not** prove persistent AIEN continuity yet. 641 642 Its semantics are now explicitly: 643 644 > The boot spine initializes the physical machine. It does not define or create an AIEN identity. 645 646 No `LogicalAgentId` should be minted merely because Gate 2 code starts. 647 648 ### Gate 3 — Integrate `aienos-kernel` 649 650 Kernel lifecycle structures must not assume that kernel lifetime equals agent lifetime. 651 652 Interfaces introduced here should allow durable logical state to outlive: 653 654 - kernel restart; 655 - scheduler reconstruction; 656 - allocator reconstruction. 657 658 No persistent agent identifier may be derived solely from volatile kernel identifiers. 659 660 ### Gate 4 — Native Storage Bring-Up 661 662 Gate 4 becomes the first major continuity foundation. 663 664 The AIEN System Store must be capable of persistently representing at least: 665 666 ```text 667 provisioned LogicalAgentId / agent root 668 committed logical state 669 Cortex checkpoints/WAL foundation 670 branch/state manifests 671 immutable artifact references 672 continuity metadata 673 ``` 674 675 Gate 4 qualification should prove that committed semantic data survives native storage round trips. 676 677 No model is required. 678 679 ### Gate 5 — Recovery Core 680 681 Add the following mandatory test. 682 683 #### Identity-loss refusal 684 685 Corrupt or remove the active execution environment while leaving a valid durable AIEN identity. 686 687 Recovery must: 688 689 1. locate the valid durable identity; 690 2. authenticate the operator; 691 3. restore or select the valid system state; 692 4. preserve the same `LogicalAgentId`. 693 694 If no valid durable AIEN identity can be recovered: 695 696 > Recovery must stop and ask the operator. 697 698 It must **not** silently create a new identity. 699 700 ### Gate 6 — Agent State + Cortex 701 702 This becomes the first empirical qualification of **continuous AIEN existence**. 703 704 Mandatory scenario: 705 706 ```text 707 native AIENOS 708 ↓ 709 provision/restore AIEN 710 ↓ 711 LogicalAgentId = X 712 ↓ 713 create Cortex state 714 create branch/task state 715 commit conversation/state 716 ↓ 717 full power cycle 718 ↓ 719 cold native AIENOS start 720 ↓ 721 recover state 722 ↓ 723 LogicalAgentId = X 724 ``` 725 726 The proof must demonstrate: 727 728 - same durable `LogicalAgentId`; 729 - preserved committed Cortex state; 730 - preserved branch lineage; 731 - preserved durable task/state metadata; 732 - uncommitted state handled according to WAL rules; 733 - no hidden creation of a replacement identity. 734 735 Only after this passes may the project claim: 736 737 > **AIEN logical identity survives a real Spark power cycle.** 738 739 ### Gate 7 — Inference Bring-Up 740 741 Add the following qualification: 742 743 ```text 744 AIEN identity X 745 ↓ 746 model loads 747 ↓ 748 conversation continues 749 ↓ 750 model unload/reboot/reload 751 ↓ 752 same AIEN identity X 753 ↓ 754 conversation/state continuity preserved 755 ``` 756 757 The model must be demonstrably replaceable/reloadable beneath the same logical agent. 758 759 This gate proves: 760 761 > **Inference execution can disappear and return without redefining AIEN.** 762 763 ### Gate 8 — AEGIS & J-Space Worlds 764 765 Durable authorization semantics must survive sleep/recovery correctly. 766 767 Persist what must persist. 768 769 Do not persist temporary authority that was explicitly scoped to a single volatile session unless its policy says otherwise. 770 771 A wake/restart must never accidentally broaden capability authority. 772 773 ### Gate 9 — C1 Physical Tree 774 775 Connect C1 directly to lifecycle semantics. 776 777 Mandatory cases should eventually include: 778 779 ```text 780 live branch 781 ↓ 782 physical KV discarded 783 ↓ 784 logical branch preserved 785 ↓ 786 KV reconstructed 787 ↓ 788 equivalence passes 789 ``` 790 791 and: 792 793 ```text 794 branch committed 795 ↓ 796 deep-sleep simulation 797 ↓ 798 all physical KV gone 799 ↓ 800 logical state restored 801 ↓ 802 branch reconstruction 803 ↓ 804 same LogicalBranchId 805 ``` 806 807 This empirically connects: 808 809 > Losing KV costs computation, not identity. 810 811 to the native OS lifecycle. 812 813 ### Gate 10 — Native Hardware Acceleration 814 815 Acceleration must not weaken continuity. 816 817 GPU/accelerator state is Class B reconstructible physical state unless explicitly proven otherwise. 818 819 Native acceleration should optimize: 820 821 - warm wake; 822 - model residency; 823 - branch residency; 824 - KV preservation; 825 - state reconstruction; 826 827 but AIEN's identity may never become dependent on preserving accelerator state. 828 829 --- 830 831 ## 17. Benchmark changes 832 833 The existing Config A/B/C comparison remains. 834 835 Add lifecycle metrics rather than replacing the existing boot metrics. 836 837 Measure separately: 838 839 ```text 840 cold hardware bootstrap → kernel ready 841 cold recovery → AIEN logical state restored 842 AIEN restored → model ready 843 wake from sleep → interactive 844 wake from deep sleep → interactive 845 model reconstruction latency 846 branch reconstruction latency 847 Cortex recovery latency 848 energy consumed while sleeping 849 idle residency cost 850 ``` 851 852 This prevents "boot time" from hiding fundamentally different paths. 853 854 Eventually the most important user-facing metric should become: 855 856 > **wake-to-continuation latency** 857 858 rather than merely boot-to-shell. 859 860 --- 861 862 ## 18. Continuity receipts 863 864 Important lifecycle transitions should produce verifiable continuity evidence. 865 866 A continuity receipt may record: 867 868 ```text 869 LogicalAgentId 870 previous committed state digest 871 new committed state digest 872 Cortex checkpoint/WAL position 873 branch-lineage digest 874 execution fingerprint 875 machine identity 876 transition type 877 transition epoch 878 reconstruction mode 879 integrity result 880 ``` 881 882 Transition types may include: 883 884 ```text 885 sleep 886 wake 887 deep_sleep 888 cold_recovery 889 runtime_restart 890 kernel_restart 891 model_replace 892 machine_migration 893 ``` 894 895 The exact schema may evolve. 896 897 The requirement is that continuity claims become auditable rather than inferred. 898 899 --- 900 901 ## 19. Failure semantics 902 903 AIENOS must fail toward preservation. 904 905 If the system cannot prove that a recovered logical state belongs to the existing AIEN: 906 907 ```text 908 STOP 909 ↓ 910 Recovery Core 911 ↓ 912 operator decision 913 ``` 914 915 Never: 916 917 ```text 918 state uncertain 919 ↓ 920 generate new agent automatically 921 ↓ 922 pretend continuity 923 ``` 924 925 False continuity is worse than refusing to continue. 926 927 --- 928 929 ## 20. Engineering-agent freedom 930 931 This amendment defines semantics, not implementation. 932 933 The engineering agent remains free to determine: 934 935 - low-power mechanisms; 936 - checkpoint strategy; 937 - memory residency strategy; 938 - wake implementation; 939 - firmware interaction; 940 - hardware power states; 941 - storage layout; 942 - serialization; 943 - reconstruction algorithms; 944 - device restoration; 945 - scheduling; 946 - cache persistence; 947 - model-residency policies. 948 949 The acceptance requirement is behavioral: 950 951 > **The same durable AIEN must emerge on the other side of the transition whenever valid committed state exists.** 952 953 --- 954 955 ## 21. Revised persistent-thing rule 956 957 The existing architecture statement: 958 959 > The persistent thing is AIEN itself. 960 961 is strengthened to: 962 963 > **AIEN is the persistent logical entity. Hardware, kernels, models, runtime processes, inference caches, interfaces, and Machines are replaceable execution substrates. Sleep changes residency. Reboot changes execution substrate. Failure triggers reconstruction. None of these events inherently terminates logical identity.** 964 965 --- 966 967 ## 22. Final lifecycle objective 968 969 The desired mature experience is: 970 971 ```text 972 operator presses power / wake 973 ↓ 974 machine restores required substrate 975 ↓ 976 AIEN continues 977 ``` 978 979 not: 980 981 ```text 982 operator powers machine 983 ↓ 984 system constructs a new assistant 985 ↓ 986 loads old memories into it 987 ``` 988 989 The distinction is architectural. 990 991 The target is therefore: 992 993 > **Power on the machine: AIEN wakes.** 994 995 not: 996 997 > **Power on the machine: AIEN is recreated.** 998 999 --- 1000 1001 ## 23. Project definition amendment 1002 1003 The one-line definition of the project is amended to: 1004 1005 > **AIENOS is an agent-native operating system designed around continuous logical agent existence: the agent persists while models, kernels, inference state, power states, and physical machines change beneath it.**