feat(admin): live admin commands in trace 5 (schema 63)
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 4m44s
Foundation / image (push) Successful in 5m33s

The admin portal can now spawn wildlife, add bubbles, add to or release the
spent pool, remove a cell and grant a cell's reserve on a running rules-13
region (ADR-0182 section 10). No new owner format or region opening.

- Trace 5: trace 4 plus 64-byte command records counted in the tick header's
  last word; a batch without commands stays trace 4 (older builds replay it).
  Bundle 15 admits trace 5.
- CellularLives::admin_candidate applies a tick's commands after its births,
  each on a copy kept only when it applies and closes: imports through the
  boundary ledger, removals into the spent pool with a new `removed` corpse
  cause, spawned roots via the ADR-0180 seed (now a shared helper) funded by
  an exact import. Refused commands change nothing.
- Schema 63: the immutable admin_commands queue (spawn identities from the
  life allocator), pending/history reads, and binding of every recorded
  command exactly once inside both cellular publishers; the SQL trace parsers
  read trace 5 through its trace-4 normal form.
- The region polls pending commands every 2 s and appends up to 16 per tick;
  the admin API and portal gain region actions, per-cell Remove/Grant and the
  command history.
- Fixes an existing test that did not advance its head after a tick commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-27 17:14:04 -04:00
co-authored by Claude Opus 5.5
parent b075198040
commit b1cc3b121b
32 changed files with 1487 additions and 138 deletions
@@ -149,7 +149,7 @@ bool prepared_is_canonical(const CellularPreparedCommit& prepared,
const auto encoded_trace = server::encode_cellular_batch(trace);
const auto digest = sha256(prepared.trace);
const bool trace_version_matches =
trace.format_version == cellular_checkpoint_trace_format(manifest.cellular_versions);
cellular_checkpoint_trace_admits(manifest.cellular_versions, trace.format_version);
return manifest.profile == CheckpointProfile::cellular_lives_v1 && trace_version_matches &&
manifest.key == prepared.key && manifest.commit == prepared.commit &&
manifest.sequence > 0 && manifest.batch.trace_bytes == prepared.trace.size() && digest &&
@@ -561,7 +561,9 @@ publish_cellular_batch(Postgres& db, const FilesystemObjectStore& objects, const
const auto previous = decode_manifest(predecessor.manifest);
const auto predecessor_digest = sha256(predecessor.manifest);
auto committed_batch = batch;
if (previous)
if (previous && !(committed_batch.format_version == server::cellular_batch_admin_format &&
cellular_checkpoint_trace_admits(previous->cellular_versions,
committed_batch.format_version)))
committed_batch.format_version =
cellular_checkpoint_trace_format(previous->cellular_versions);
const auto trace = server::encode_cellular_batch(committed_batch);
@@ -834,7 +836,7 @@ recover_cellular_loaded(Postgres& db, const FilesystemObjectStore& objects, Regi
auto trace = server::decode_cellular_batch(*trace_bytes);
if (!trace)
return fail_with(RecoveryError::tail);
if (trace->format_version != cellular_checkpoint_trace_format(manifest->cellular_versions))
if (!cellular_checkpoint_trace_admits(manifest->cellular_versions, trace->format_version))
return fail_with(RecoveryError::tail);
if (trace->header.world != key.world || trace->header.region != key.region ||
trace->header.frame != manifest->frame ||