# kcode-k1-persons-store
`Store` solely owns the current SQLite v1 materialization for the K1 persons projection at `root/persons.sqlite3`. It creates a strict fresh schema, validates complete current-format state on open, and replaces malformed or semantically inconsistent derived state with an empty database. Filesystem, open, and operational SQLite failures are returned without recovery. There is no migration, authorization, discovery, networking, retry, or background work.
## API
`PersonId` and `TxId` are reexported. `StoredPerson` and `StoredSnapshot` are cloneable owned value views with private fields. `StoreChange` is a cloneable private-representation value constructed by `create`, `update`, or `resolve`.
- `StoredPerson::id` returns the person creation identity with bounded constant work and no allocation or I/O.
- `StoredPerson::root` returns the direct class-root identity with bounded constant work and no allocation or I/O.
- `StoredPerson::name` returns the direct root's name, or `None` for an alias, with bounded constant work and no allocation or I/O.
- `StoredSnapshot::checkpoint` returns the optional ordering checkpoint with bounded constant work and no allocation or I/O.
- `StoredSnapshot::persons` borrows the complete loaded person slice with bounded constant work and no allocation or I/O.
- `StoreChange::create` moves one identity and name into a change with bounded constant work and no package-owned allocation or I/O.
- `StoreChange::update` moves one identity and name into a change with bounded constant work and no package-owned allocation or I/O.
- `StoreChange::resolve` records two identities and an expected class size with bounded constant work and no allocation or I/O.
- `Store::open(root, ordering)` creates or validates the database and returns the store plus a complete owned snapshot. It performs O(P) work and ordering lookups for P persons; the 10,000-person fixture, including a 5,000-person class, completes within five seconds.
- `Store::commit(callback, change)` uses one immediate transaction. Create, update, and checkpoint-only work is indexed and bounded per row, while resolve is O(class); local lock acquisition may wait up to five seconds and there is no retry.
- `Store::clear` deletes all persons and clears the checkpoint in one immediate transaction with O(P) local work; local lock acquisition may wait up to five seconds and there is no retry.
Names are stored unchanged. Create inserts one direct root, update changes one direct-root name, resolve redirects exactly the expected source class and clears its former root name, and a change-free commit only advances the checkpoint. Unexpected row counts fail and roll back. `clear` returns the database to an empty snapshot state.
SQLite uses WAL, synchronous FULL, foreign keys, and a five-second busy timeout. Recovery removes the WAL, shared-memory, and database files in that order before recreating an empty v1 database. `Store` is `Send` by construction; callers do not coordinate library-private locks.