fed-sx-m2: Step 2c — bootstrap_actor/4 + actor_lifecycle integration
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 30s

New nx_kernel:bootstrap_actor/4(ActorId, Profile, KeySpec, State)
single-call entry that adds an actor bucket and immediately publishes
a Create{Person|Service|Group} envelope as the bucket's first activity:

  - Profile carries :type, :name, :preferredUsername, :summary, :icon,
    :public_keys. :type defaults to person if unset.
  - Kernel AS proplist built from Profile's :public_keys (falls back
    to []).
  - Create object built from Profile fields (Step 2b actor_state
    fold picks the same field set).

gen_server variant bootstrap_actor/3 for live-kernel use plus a new
handle_call branch.

15/15 in next/tests/actor_lifecycle.sh covering pure + gen_server +
actor_state projection capture for all three actor types:

  - Pure: bootstrap_actor advances log_tip = 1, Create has
    object.type = person
  - Pure: two actors share a kernel with independent log tips
  - Pure: duplicate bootstrap_actor -> already_present
  - Pure: typeless profile defaults to person
  - Pure: empty public_keys handled
  - gen_server: bootstrap_actor/3 against a live registered kernel
  - actor_state projection captures Person, Service, Group profiles
  - profile carries :preferredUsername + :public_keys from the
    Create object

Closes Step 2 (2a Person/Service/Group genesis files,
2b actor_state projection fold, 2c bootstrap_actor + integration).

Conformance 761/761. 146/146 across 10 Step-2-adjacent suites
(actor_lifecycle, actor_state_pure, nx_kernel_multi, nx_kernel_server,
bootstrap_start, smoke_app_pure, smoke_pin_pure, define_registry_pure,
projection_server, outbox_publish).
This commit is contained in:
2026-06-06 12:32:16 +00:00
parent bcfbd9a528
commit 1fd85e10e6
3 changed files with 235 additions and 6 deletions

View File

@@ -188,11 +188,17 @@ publicKey rotation history, profile fields, follower counts, etc.
`find_keyed/has_keyed/set_keyed` helpers (same gap as 1a — no
`lists:keyfind`/`keymember` in the substrate). 19 cases in
`actor_state_pure.sh`.
- [ ] **2c** — `nx_kernel:bootstrap_actor/4(ActorId, Profile,
KeySpec, State)` — publishes `Create{Person{...}}` as the actor's
first activity, exercising the full pipeline. Integration test
in `actor_lifecycle.sh` ties 2a artefacts (SX files), 2b
projection, and 2c bootstrap together.
- [x] **2c** — `nx_kernel:bootstrap_actor/4(ActorId, Profile,
KeySpec, State)` — adds an actor bucket and publishes
`Create{Person|Service|Group}` as the bucket's first activity in
one call. Profile carries `:type` (defaults to `person`), `:name`,
`:preferredUsername`, `:summary`, `:icon`, `:public_keys`; the
function builds the Create's `:object` from the profile and the
kernel-side AS from `:public_keys`. gen_server variant
`bootstrap_actor/3` for live-kernel use; integration test in
`actor_lifecycle.sh` ties 2a artefacts, 2b projection, and 2c
bootstrap together end-to-end (pure + gen_server + projection
capture for all three actor types). 15/15.
**Acceptance:** `bash next/tests/actor_lifecycle.sh` passes 10+ cases.
@@ -700,6 +706,21 @@ proceed.
Newest first.
- **2026-06-06** — Step 2c (closes Step 2): `bootstrap_actor/4` +
end-to-end `actor_lifecycle.sh`. New pure-functional export
`nx_kernel:bootstrap_actor/4(ActorId, Profile, KeySpec, State)`
adds an actor bucket via `add_actor/4`, derives the kernel AS
proplist from `Profile`'s `:public_keys`, builds a Create
envelope wrapping the profile's `:type` (defaults `person`) +
field set, and calls `publish/3`. gen_server variant
`bootstrap_actor/3` for live-kernel use plus a corresponding
`handle_call` branch. `actor_lifecycle.sh` 15/15 covers pure
bootstrap (log_tip advances, Create-shape, dup detection),
two-actor independence, gen_server bootstrap, and
`actor_state` projection capture for Person + Service + Group.
Step 2 fully closed (2a + 2b + 2c). Conformance 761/761.
146/146 across 10 Step-2-adjacent suites.
- **2026-06-06** — Step 2b: actor-state projection Erlang module.
New `next/kernel/actor_state.erl` with `fold/2` over Create / Update
/ Move activities. Profile is a property list of `:type / :name /