interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

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