starkernel: item 4.1a -- quota granting, Hermes's one-time birth grant
Punch list §25 item 4.1a complete. New prerequisite item, found while scoping 4.2: no quota-granting mechanism existed at all. Adds stadium_grant_quota(new_vm_id, from_vm_id) -- a one-time initial grant at birth, distinct from item 1.3's still-unbuilt recurring capacity-transfer arbitration. Splits the donor's free list evenly by cell count, reassigns stadium_owner[] for every moved cell, and grants the new VM a fresh Q48_ONE reservoir (not a split of the donor's -- per-VM conservation, same pattern as Hera's own boot grant). Wired into every baby VM's birth in capsule_birth.c. Verified via a boot-time self-test in kernel_main.c using a synthetic identity (not the real UUID pool, not a real capsule birth -- item 0.1's Hera-alone pruning stays intact). All three architectures booted to ok> with identical output: grant OK, Hera reservoir=0 (already fully committed to resident words, correctly unchanged), test-vm reservoir=65536 (fresh Q48_ONE). dict_hash identical across all three and unchanged from item 4.1's baseline (0x3d4e1daf289da94f) -- confirms no dictionary word was added. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
edfc246579
commit
2981ada2a5
@@ -31,6 +31,7 @@
|
||||
#include "starkernel/capsule_run.h"
|
||||
#include "starkernel/kmalloc.h"
|
||||
#include "starkernel/console.h"
|
||||
#include "starkernel/vm/stadium.h" /* item 4.1a -- stadium_grant_quota() */
|
||||
#include "vm.h"
|
||||
#include "platform_alloc.h"
|
||||
#include "starforth_config.h" /* STADIUM_MAX_VM_COUNT */
|
||||
@@ -502,6 +503,15 @@ CapsuleRunResult capsule_birth_baby(
|
||||
|
||||
capsule_parity_log_birth(vm_id, cap->capsule_id, cap->content_hash, dict_hash);
|
||||
|
||||
/* item 4.1a: one-time initial quota grant, from Hera's free list. Placed
|
||||
* after a live birth is confirmed (not gating IDENTITY exec above) --
|
||||
* this baby can hold no Stadium resident until item 4.2's own work gives
|
||||
* her a reason to. Failure is not fatal: a VM with no quota today is the
|
||||
* status quo every VM had before this item existed, so she is simply
|
||||
* born without one and every stadium_word_dispatch() for her stays a
|
||||
* harmless refusal, same as any VM without a quota. */
|
||||
(void)stadium_grant_quota(vm_id, vm_uuid_hera());
|
||||
|
||||
if (out_vm_id) *out_vm_id = vm_id;
|
||||
if (out_vm_ctx) *out_vm_ctx = new_vm;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user