Skip to content

feat(persona): persona/spawn — first-class handle-based birth command (#200) - #1966

Merged
joelteply merged 2 commits into
canaryfrom
feat/200-persona-spawn
Jul 19, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/200-persona-spawn

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What & why

Birth of a persona (an airc citizen) is now a first-class command any citizen can call — a human, another persona, a widget, or the grid capacity-scaler. Joel: "the spawn or birth of users is a command … handle based, event spawning, if anything is slow, parameters easy to use — a good command that your code then would call, or a widget, or any first class citizen." ([[persona-birth-is-a-first-class-handle-command]])

Two commits

1. refactor(persona): extract PersonaBirth — the single birth core.
The body of PersonaInstanceManagerModule::bootstrap_one becomes a standalone PersonaBirth::birth_one. So on-demand spawn and boot auto-seed are literally the same code path (spawner supervisor → bootstrap_planned → bootstrap_one → birth_one) — never a parallel spawn impl (compression). The instances/mod.rs comment already anticipated this. Pure refactor, no behavior change.

2. feat(persona): persona/spawn — the command.

  • Typed persona/spawn (Privileged). Params all optional: zero-arg births ONE persona with a random name and everything derived from her id (the Implement CRUD Sync Prototype with Real-Time Database Polling #199 PersonaCard genesis). name? overrides the single name; count? spawns N (grid capacity), clamped to [1, 32]. plan_intents (pure, unit-tested) encodes the count/name policy.
  • Handle-based / non-blocking / event-driven: mints the identities (fast), returns the names as a PersonaSpawnReceipt immediately, and runs the slow births (airc keypair ceremony + seed/card/avatar) in a detached task. Each completed birth fires persona:born (payload PersonaInstanceInfo) — emitted from birth_one, so a birth by boot auto-seed OR by this command is uniformly observable.
  • PIM captures the event bus (late-bound) in initialize() and shares it with the birth core.

Validation

  • Unit (12 green): spawn (name/path+access, zero-arg=1, explicit-name-single, count clamp, batch-random-unique-ids) + reassign + instance-manager regression. Lib compiles clean.
  • Live (cu reboot clean rebuild → cu persona/spawn --name Verity): returned the receipt immediately (non-blocking); the detached birth then completed end-to-end — Verity materialized in persona/instances/list with a V2 coherent card (gender: female, avatar vroid-shino.vrm coheres, voice_seed = her id, pinned) + home + identity.key + engrams. Then despawned + removed cleanly (test artifact).

Deferred (noted on #200, not this PR)

Observed (separate, pre-existing — filed as a note)

A chat/mod.rs:131 ChatModule: CommandExecutor not installed panic on a boot worker thread — a pre-existing executor-install race unrelated to these persona changes (core stayed up + served commands). Belongs with #196 / executor-install-timing.

🤖 Generated with Claude Code

joelteply and others added 2 commits July 19, 2026 00:09
…prep)

Factor the body of PersonaInstanceManagerModule::bootstrap_one into a standalone
`PersonaBirth` struct (registry + daemon_socket + default_room + default_room_name +
continuum_root + late-bound executor) with `birth_one(intent)`. PIM now delegates
bootstrap_one to it and exposes `birth() -> Arc<PersonaBirth>`.

Why: so the on-demand `persona/spawn` command reuses the EXACT birth path as boot
auto-seed (spawner supervisor → bootstrap_planned → bootstrap_one → birth_one) — one
birth core, never a parallel spawn implementation ([[persona-birth-is-a-first-class-
handle-command]], compression). The instances/mod.rs comment already anticipated this:
"bootstrap needs the module's full bootstrap capability … migrates under #62 once
those deps are threaded."

Pure refactor, no behavior change: the moved deps (daemon_socket/default_room/
default_room_name) leave PIM's struct (they live in PersonaBirth now, same Arc handles),
dropping them as dead fields; PIM keeps registry/continuum_root/executor for
registry()/commands()/install_executor. Lib compiles clean, zero new warnings.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…#200)

Birth a persona (an airc citizen) on demand, callable by any first-class citizen —
a human, another persona, a widget, or the grid capacity-scaler. Joel: "the spawn or
birth of users is a command … handle based, event spawning, if anything is slow,
parameters easy to use." ([[persona-birth-is-a-first-class-handle-command]])

- commands/persona/spawn.rs: typed `persona/spawn` (Privileged). Params ALL optional
  — zero-arg births ONE persona with a random name + everything derived from her id
  (the #199 PersonaCard genesis). `name?` overrides the single name; `count?` spawns N
  (grid capacity), clamped to [1, MAX_SPAWN=32]. `plan_intents` (pure, unit-tested)
  encodes the count/name policy.
- Non-blocking / event-driven: mints the identities (fast), returns the names as a
  PersonaSpawnReceipt IMMEDIATELY, and runs the slow births (airc keypair ceremony +
  seed/card/avatar) in a detached task. Each completed birth fires `persona:born`
  (payload PersonaInstanceInfo) — emitted from PersonaBirth::birth_one, so a birth by
  boot auto-seed OR by this command is uniformly observable.
- PIM captures the event bus (late-bound) in initialize() and shares it with the
  birth core; commands() hands the shared Arc<PersonaBirth> to the command so on-demand
  births go through the EXACT same path as boot (no parallel spawn impl).

The legacy `persona/instances/bootstrap` handle_command arm stays (delegates to the
same birth core) — retiring it is a #62 follow-up. Large-name-pool expansion (the
current pool is 119; collides at grid scale) is a noted #200 follow-up.

Tests: spawn (7 — name/path+access, zero-arg=1, explicit-name-single, count clamp,
batch-random-unique-ids), reassign + instance-mgr regression-green. ts-rs bindings for
PersonaSpawnParams/Receipt regenerated. Lib compiles clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 90e48c1 into canary Jul 19, 2026
4 checks passed
@joelteply
joelteply deleted the feat/200-persona-spawn branch July 19, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant