These docs are under active development and cover the v0.20 Kobicha security model.
§1.1 1 Introduction

Scope

This specification defines loregd (Local Registry Daemon), the primary registry source for the Peios operating system. loregd implements the Registry Source Interface (RSI) defined in the LCS v0.21 specification, providing persistent storage for one or more registry hives using SQLite.

loregd is the first and reference source implementation. Any process implementing the RSI contract can serve as a registry source; loregd is not architecturally special. It is operationally special: it is the source that provides the Machine\ and Users\ hives at boot, making it the critical path to a running system.

This specification covers:

  • The command-line interface and startup sequence
  • The SQLite database schema (one database per hive)
  • Volatile key storage via attached in-memory databases
  • Connection pool model and concurrency
  • Transaction handling and write serialisation
  • Crash recovery (orphaned GUID cleanup)
  • First-boot initialisation (hive root creation)
  • The RSI request processing loop
  • Case-insensitive storage via stored folded forms
  • Shutdown and hive unload behaviour

This specification does not cover:

  • LCS (the kernel subsystem) -- see the LCS v0.21 specification
  • The RSI binary protocol (wire format, message framing, op codes) -- defined in LCS v0.21
  • Registry key schemas (those belong to the subsystems that own them)
  • Other source implementations
  • peinit's service management of loregd
§1.2 1 Introduction

Terminology

Terms defined in the LCS v0.21 specification (LCS, RSI, hive, source, key, value, layer, SD, AccessCheck, token, SID, GUID, watch, TCB) are used here with the same meaning and are not redefined.

Additional terms specific to loregd:

  • Hive database: A SQLite database file backing one hive. Each hive registered by loregd has its own database file. The file path is provided on the command line.

  • Volatile store: A SQLite in-memory database (:memory:) ATTACHed to a hive database connection. Volatile keys are stored here. The volatile store is lost when loregd exits.

  • Folded name: The Unicode Simple Case Folded form of a key name, value name, or child name. Stored alongside the canonical (case-preserving) name for case-insensitive lookups.

  • Read connection: A SQLite connection used for read-only operations. Multiple read connections may be open concurrently (WAL mode).

  • Write connection: A SQLite connection used for mutating operations. Only one write connection exists per hive database. All writes are serialised through this connection.

§1.3 1 Introduction

Conventions

This specification uses the same normative keywords (MUST, SHOULD, MAY) as the LCS v0.21 specification, per RFC 2119.

SQL examples use SQLite syntax. Column types use SQLite's type affinity system (INTEGER, TEXT, BLOB, REAL). All SQL is illustrative -- the schema is normative, the exact DDL is guidance.

loregd is specified against SQLite. The specification names SQLite features (WAL mode, ATTACH, SAVEPOINT, PRAGMA) directly. An implementation using a different storage engine would need to provide equivalent semantics but is not the target of this spec.