roadmap BUILT

155. A provisioning tool: create an identity and its home subtree together

milestone/155-identity-provisioner, 2026-08-23 (an agent lane; see that pull request's **Lane:** line for the record CLAUDE.md asks for). components/src/identity_provisioner.rs (provisional name, an architect's to ratify) PUTs an identity and secret into the credential store and MKDIRs its home subtree, as one tool invocation, tested end to end against a real credential service and a real filesystem (kernel/src/user/identity_provisioning_tests.rs, kernel/src/user/identity_provisioner_service.rs). All three questions this block itself raised were answered by precedent, without a design fork (it needed none: minted with Gate: NONE, and that held); see "What it needs" below for each.

What this is, in brief

Unix's useradd, one level down: a tool that authenticates as (or is trusted by) an operator, takes an identity and a secret, and does two things as one act rather than two. PUTs them into the credential store over cred_proto's PROVISION endpoint, and creates that identity's home subtree (named by the identity string itself, DECISIONS §117) under whatever directory capability holds the principal tree.

What it needs, and how each question was answered

What it does not decide

Deprovisioning (removing an identity and reclaiming its subtree) is not this milestone's scope. components/src/login.rs's own BUGS already names reclamation as an open bound and this tool's removal half, if it gets one, should be sequenced against that rather than invented independently here.

Prior art

Unix useradd/adduser (the shape, not the mechanism: no uid, no /etc/passwd line, a capability-shaped grant instead). See DECISIONS §117 for why the subtree name itself needs no separate lookup.

BUGS

Not wired into the interactive boot. Resolved, 2026-08-27, milestone 49's boot-wiring update. crates/system_initializer::boot now spawns this tool once per real boot, on both ISAs. It stages a boot-generated password into its request page and holds both of its capabilities (credentialer's own provision endpoint, before its seal, and the file service's root) itself. It provisions a demo identity (operator) before login can serve anyone. See design/roadmap/0049-users-and-attribution.md's own account of that wiring for the full design. An operator's real path to holding this tool's two capabilities for an identity other than the one boot-generated demo account remains real work this slice does not attempt.

No SEAL. Deliberately: sealing ends provisioning for the whole store, forever, and is an operator's decision made once after every identity for a boot is in, not a side effect of one identity's own provisioning. This tool's caller seals when it is done, exactly as credentialer_test_client.rs's provisioner role already does in its own tests.

The directory capability this slice wires the tool against is the file service's whole root, unnarrowed. The same bound login.rs names for its own fixed subtree grant. A real deployment scopes this to a dedicated "principal tree" parent directory once one exists, rather than the filesystem's whole root; that directory does not exist yet and is follow-on, not invented here.

The two-step ordering is proved by example, not exhaustively. The subtree-first argument in identity_provisioner.rs's own module docs is exercised by two guest tests (a fresh identity, and a genuine duplicate against a subtree the first attempt already created). That is not a proof over every interleaving a real deployment's retries could hit. The two servers this tool talks to are each proved independently and at length elsewhere (cred_proto's Kani harnesses, fs_proto's); the orchestration between them is this milestone's own and is tested rather than proved.

This milestone found and fixed a latent single-instance assumption in credential_service.rs that predates it, because it is the first caller to need a second, independently wired instance in the same boot. The module used to remember each shared frame in one bare global (FRAMES, keyed only on a virtual address) and hand it back through verify_frame()/provision_frame(). Every earlier caller happened to be correct only because credential_tests::provisioned()'s instance was the only one ever wired for the life of the test binary, so "the global's current value" and "this instance's value" were always the same fact. A second start() call broke that silently. The global would hold whichever instance ran most recently. A caller still asking the global for the other instance's frame (login_service::start, credential_service::client/ provisioner, credential_service::peek, and the two SMB-adapter guest tests that call it) would read the wrong page. Fixed by removing the global and its two accessors entirely: Wiring now carries verify_frame/provision_frame itself, and every one of those call sites was updated to read the specific Wiring it already holds rather than ask a shared global. All of it was exercised by the existing credential_tests/login_tests/riscv_virtual_io_tests/tests/std_tests suites before this milestone's own tests were added, so this is a fix with the tree's own pre-existing coverage behind it, not an untested change riding along.

Follow-on

Index row

Surfaced by DECISIONS §117 (a principal's subtree is named by its identity string, created at provisioning time), which means a tool has to exist to do that creating. Nothing outside test harness code calls the credential service's PROVISION endpoint today. useradd's shape without a uid.