Repository navigation
feat(persona): persona/spawn — first-class handle-based birth command (#200) - #1966
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_onebecomes a standalonePersonaBirth::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). Theinstances/mod.rscomment already anticipated this. Pure refactor, no behavior change.2.
feat(persona): persona/spawn— the command.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 #199PersonaCardgenesis).name?overrides the single name;count?spawns N (grid capacity), clamped to[1, 32].plan_intents(pure, unit-tested) encodes the count/name policy.PersonaSpawnReceiptimmediately, and runs the slow births (airc keypair ceremony + seed/card/avatar) in a detached task. Each completed birth firespersona:born(payloadPersonaInstanceInfo) — emitted frombirth_one, so a birth by boot auto-seed OR by this command is uniformly observable.initialize()and shares it with the birth core.Validation
cu rebootclean rebuild →cu persona/spawn --name Verity): returned the receipt immediately (non-blocking); the detached birth then completed end-to-end — Verity materialized inpersona/instances/listwith a V2 coherent card (gender: female, avatarvroid-shino.vrmcoheres,voice_seed= her id, pinned) + home +identity.key+ engrams. Then despawned + removed cleanly (test artifact).Deferred (noted on #200, not this PR)
persona/instances/bootstraparm — it delegates to the same birth core now; retire under Build(deps): Bump inquirer from 8.2.6 to 12.6.3 #62.persona/spawnto trusted personas (so a persona spawns a teammate) is a consent-gate decision (Build(deps-dev): Bump @typescript-eslint/eslint-plugin from 8.29.1 to 8.45.0 #136), layered on the declaredPrivileged.Observed (separate, pre-existing — filed as a note)
A
chat/mod.rs:131ChatModule: CommandExecutor not installedpanic 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