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
+9
View File
@@ -1,5 +1,14 @@
# Project status and next steps
## Admin commands: spawn wildlife, resources, remove and grant - 2026-10-27
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, live. Commands are queued in SQL (schema 63) and
the region applies each once, recording it in its history (trace 5) so replay and recovery
reproduce it. Imports are counted in the region's boundary ledger. No new region is needed.
See [ADR-0182](adr/0182-admin-portal-and-world-tuning.md) section 10 and
[validation](engineering/VALIDATION.md).
## Session windows from the admin portal - 2026-10-27
The dev session window now lives in SQL (schema 62) instead of Git: the admin portal opens,
@@ -175,6 +175,38 @@ revoked from the runtime group. The admin API logs in with its own login in that
Writes go through POST without a body (`?minutes=M&reason=R`); the bearer token in the
`Authorization` header, never a cookie, is the only credential.
### 10. Admin commands (delivered, schema 63, trace 5)
The commands of section 3 are delivered without a new owner format or region opening:
- **Trace 5.** A rules-13 batch may record operator commands: trace 4 plus 64-byte records
(id, kind, count, target, energy and four matter amounts) counted in the tick header's last
word, which trace 4 keeps zero. A batch without commands stays trace 4, so builds before
this one still replay it; only commits that carry commands need this build or later.
Bundle 15 admits trace 5 (`cellular_checkpoint_trace_admits`); the manifest is unchanged.
- **Application.** `CellularLives::admin_candidate` applies a tick's commands after its
births, by ascending id, each on a copy kept only if it applies and still closes:
`remove_cell` (body and reserve to the spent pool, a corpse with the new `removed` cause;
a player's life then ends as any death does), `grant_reserve`, `add_bubbles` and
`add_pool` (imports in the boundary ledger), `release_pool` (moves at most what the pool
holds into bubbles) and `spawn_wildlife` (1-64 randomized founder roots, the ADR-0180 seed
with an exact import for their reserve, body and construction). A command whose target is
gone, or that does not fit (region cap, deposit limit, a taken identity), is refused and
changes nothing.
- **Queue and binding.** `admin_enqueue_command_v1` (admin role) stores the exact command;
spawning reserves its identities from the world's life allocator. The region reads
`load_pending_admin_commands_v1` every 2 s and appends up to 16 per tick. Both cellular
publishers bind every recorded command to its queue row exactly once, in the publishing
transaction; a differing or already-applied command refuses the publication. The SQL trace
parsers read a trace 5 through its trace-4 normal form, after binding the real trace to
the manifest.
- **Portal.** Region actions (spawn wildlife, add bubbles, add to or release the spent pool),
per-cell Remove and Grant reserve, and the command history with the tick each applied at.
Amounts are entered in µJ and ng.
Still pending from this ADR: drip/source settings (section 4), tuning amendments
(sections 1-2), data-defined mutations (section 5), bans and time played (section 6).
## Delivery order
1. Read-only portal: login, accounts (from existing data), regions, region view (schema 61,
+33
View File
@@ -10508,3 +10508,36 @@ Limits: no live region has read a SQL window yet, and no process test drives the
window through a real session; the elapsed-time guard of the 2026-10-08 clock amendment is
still pending. Applying it needs the DEV `aevolution_admin` role and the admin portal's own
login first.
## 2026-10-27 - Admin commands in trace 5 (schema 63)
Scope: ADR-0182 section 10. Operators queue commands in the admin portal (remove a cell,
grant a reserve, add bubbles, add to or release the spent pool, spawn wildlife); the
cellular region applies each once after a tick's births and records it in trace 5, which
bundle 15 admits beside trace 4. Publication binds each recorded command to its queue row
in the same transaction. No owner format, rules, manifest bundle, genome, wire version or
golden changed; a corpse may carry the new `removed` cause (refused by older readers).
The ADR-0180 seeding loop moved into a shared helper with identical draws.
Executed (WSL Ubuntu, GCC 14.2 Release/NDEBUG, build/m97-postgres):
- `cellular-revamp-owner-contracts`: new case applying all six kinds plus a refused one
(missing target): results, closure through the boundary ledger, the exact spent pool,
bubble counts, the removed corpse, spawned wildlife, restore, determinism, trace-5
round trip and replay equality, trace 4 refusing commands; the existing starting-wildlife
and trace cases still pass after the seeding refactor.
- `tools/ci/postgres-check.sh --full` passed (637 s, every phase). New PostgreSQL cases: on
the starting-wildlife region, commands queued through `admin_enqueue_command_v1` (spawn
identities from the life allocator), a tampered trace-5 batch refused by the binding, the
exact batch published with three bindings at its tick and no pending commands left,
recovery equal to the applied state, and a second publication of the same commands
refused; admin API command endpoints (shape refusals, unknown region, author/reason,
history order, runtime role limited to the pending read, rows immutable).
- An existing test bug surfaced: the starting-wildlife publication test did not advance its
head after its tick commit; it now does before the command batch.
- clang-tidy 19 (warnings as errors) on the changed sources after narrowing the command kind
to a byte (the trace keeps a u16 and refuses values over 255); clang-format 19.1.5;
`node --check` on the portal script.
Limits: no live region has applied a command yet; the portal's command forms were not
driven in a browser.