# Spid3r Native Runtime Artifact & ABI (`SH-6`)

This document specifies the formal interface, packaging, provenance, and
checksum-pinning contract for Spid3r's native AOT runtime static library
(`spid3r_lang.lib` on Windows MSVC; `libspid3r_lang.a` on Linux/macOS).

It satisfies **Phase 9.1** of the self-hosting program ([SELFHOST.md](SELFHOST.md)) and
implements architecture decision **SH-6** ([SELFHOST.md](SELFHOST.md)):

- Compilers built by Stage 1/Stage 2 (`selfhost/main.matrix`) never invoke
  `cargo` or `rustc` — they emit native machine code via LLVM-C (`selfhost/codegen.matrix`)
  and link the prebuilt, versioned, SHA-256-pinned runtime staticlib (`selfhost/link.matrix`).
- Per **Phase 9.2 (ADR in [SELFHOST.md](SELFHOST.md))**, the ~2.2k-line trampoline layer
  (`src/native/rt.rs`) stays in Rust inside the pinned runtime staticlib rather
  than being ported to Spid3r, keeping `Value`, `vm_eval_binary`, `value::collections`,
  `stdlib::builtin_defs()`, and `Scheduler` behind a single semantic source of truth.

---

## 1. Versioned Release Artifact

### Filenames

| Platform / Triple | Staticlib filename | Legacy alias | Versioned archive |
|---|---|---|---|
| `*-pc-windows-msvc` | `spid3r_lang.lib` | `spid3r.lib` | `spid3r-runtime-<version>-<target>.tar.gz` |
| `*-unknown-linux-gnu` | `libspid3r_lang.a` | `libspid3r.a` | `spid3r-runtime-<version>-<target>.tar.gz` |
| `*-apple-darwin` | `libspid3r_lang.a` | `libspid3r.a` | `spid3r-runtime-<version>-<target>.tar.gz` |

Current crate version (`Cargo.toml`): `1.1.0` (`LANGUAGE_VERSION = 1.0`, `SPID3R_RUNTIME_SCHEMA = 1`, `SPID3R_RUNTIME_ABI = 2`).

### Bundle layout (`tools/runtime_artifact.sh package`)

A formalized runtime artifact directory / tarball contains:

```
<staticlib>                     # spid3r_lang.lib or libspid3r_lang.a
<staticlib>.sha256              # standard sha256sum line: "<64-hex>  <staticlib>"
runtime-manifest.json           # schema-1 manifest with SHA-256 & provenance
<staticlib>.manifest.json       # sidecar copy of runtime-manifest.json
RUNTIME_ABI.md                  # this interface specification
```

And the release archive carries its companion digest file:
`spid3r-runtime-<version>-<target>.tar.gz.sha256`.

---

## 2. Provenance & Manifest Schema (`runtime-manifest.json`)

Generated by `tools/runtime_artifact.sh package`:

```json
{
  "schema": 1,
  "package": "spid3r",
  "version": "1.1.0",
  "language_version": "1.0",
  "abi_version": 1,
  "target": "x86_64-pc-windows-msvc",
  "profile": "release",
  "artifact_name": "spid3r-runtime-1.1.0-x86_64-pc-windows-msvc.tar.gz",
  "staticlib_name": "spid3r_lang.lib",
  "staticlib_sha256": "<64 lowercase hex chars>",
  "size_bytes": 100924994,
  "provenance": {
    "git_commit": "<40-char commit sha>",
    "git_dirty": false,
    "llvm_version": "23.1.0",
    "rustc_version": "rustc 1.99.1 ..."
  },
  "interface": {
    "trampolines": 93,
    "stdlib_natives": 257
  },
  "created_at_utc": "2026-11-15T00:00:00Z"
}
```

Required fields enforced by consumers:
- `schema == 1`
- `version`: non-empty string
- `staticlib_name`: clean basename (no `/` or `\` or `..`)
- `staticlib_sha256`: exactly 64 hex characters
- `provenance.git_commit`: non-empty string
- `provenance.llvm_version`: non-empty string

---

## 3. Checksum Verification & Exit Contract (`SEC-B`)

When `selfhost/main.matrix` (`native` / `build` / `dist` / `verify-runtime`) resolves the runtime staticlib via `selfhost/link.matrix`:

1. **Pin sources (checked before invoking the system linker):**
   - `SPID3R_RUNTIME_MANIFEST`: explicit path to `runtime-manifest.json` / `<lib>.manifest.json`. Validates schema, provenance (`git_commit`, `llvm_version`), and `staticlib_sha256`. Unless `SPID3R_RUNTIME_LIB` overrides the library path, resolves `<manifest_dir>/<staticlib_name>`.
   - `SPID3R_RUNTIME_SHA256`: explicit 64-hex expected SHA-256 digest. If combined with a manifest or sidecar pin whose digest differs, fails with a pin-conflict error.
   - **Sidecars** next to the resolved staticlib `<sl>`: `<sl>.manifest.json`, `<dir>/runtime-manifest.json` (when `staticlib_name` matches basename of `<sl>`), and `<sl>.sha256`.
   - `SPID3R_RUNTIME_REQUIRE_PIN=1` (or `true`): fail-closed mode requiring at least one valid SHA-256 pin source.
2. **Failure codes:**
   - **Exit `4` (`error[corrupt]: ...`)**: SHA-256 mismatch on the staticlib, malformed or unreadable manifest JSON, malformed `.sha256`, missing required provenance fields, checksum pin conflict, or unpinned runtime when `SPID3R_RUNTIME_REQUIRE_PIN=1`. The linker is **never** invoked and no output binary is produced.
   - **Exit `2` (`error[usage]: ...`)**: missing staticlib file, missing MSVC/`clang`/`cc` linker, or invalid CLI flags.

---

## 4. C ABI Trampoline Interface (`src/native/rt.rs`)

Generated LLVM IR modules (`src/native/ir.rs` and `selfhost/codegen.matrix`) call **93** `#[no_mangle] pub extern "C"` symbols exported by `spid3r_lang`. Under `DP-1` Option A (`ValueV2`), values cross the boundary as 16-byte `{ tag: u64, payload: u64 }` structs (`*const ValueV2` / `out: *mut ValueV2`) with inline scalars and GC-reclaimed `TAG_HEAP` boxes; errors propagate via thread-local throw state (`THROWN`) or abort with exit code `70`.

### 4.1 Process Entry, Control & Exceptions (7)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_rt_start` | `(entry: extern "C" fn() -> *mut Value) -> i32` | Init runtime, install stdlib, run `entry` + `main`, drain tasks, return exit code |
| `spid3r_rt_start_freestanding` | `(entry: extern "C" fn() -> *mut Value) -> i32` | Minimal freestanding runtime entry (skips scheduler, net, tz, full stdlib) |
| `spid3r_throw` | `(v: *mut Value)` | Record user-thrown value into TLS `THROWN` |
| `spid3r_cancel_check` | `() -> u8` | Poll task cancellation flag; returns `1` and sets pending throw if cancelled |
| `spid3r_threw` | `() -> u8` | Return `1` if a throw is pending on current thread, else `0` |
| `spid3r_take_thrown` | `() -> *mut Value` | Consume and return pending thrown value (clears `THROWN` + `RUNTIME_ERROR`) |
| `spid3r_uncaught` | `() -> !` | Format uncaught exception / runtime error to stderr and exit non-zero (`1`) |

### 4.2 Value Construction & Primitive Extraction (16)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_value_int` | `(v: i64) -> *mut Value` | Box signed 64-bit integer |
| `spid3r_value_float` | `(v: f64) -> *mut Value` | Box IEEE 754 `f64` |
| `spid3r_value_bool` | `(v: u8) -> *mut Value` | Box boolean (`0` = false, non-zero = true) |
| `spid3r_value_null` | `() -> *mut Value` | Box `Value::Null` |
| `spid3r_value_from_cstr` | `(p: *const c_char) -> *mut Value` | Copy NUL-terminated UTF-8 C string into `Value::Str` (`Null` if `p == NULL`) |
| `spid3r_value_str` | `(ptr: *const u8, len: usize) -> *mut Value` | Construct `Value::Str` from raw byte slice |
| `spid3r_value_from_ptr` | `(p: *mut c_void) -> *mut Value` | Marshal opaque C pointer into `Value::Ptr(usize)` (`SH-7`) |
| `spid3r_to_i64` | `(v: *const Value) -> i64` | Unbox `Value::Int` (or numeric coercion; aborts/throws on mismatch) |
| `spid3r_is_int` | `(v: *const Value) -> i8` | Return `1` if `v` is `Value::Int`, else `0` |
| `spid3r_int_of` | `(v: *const Value) -> i64` | Fast unchecked extract when guarded by `spid3r_is_int` |
| `spid3r_to_f64` | `(v: *const Value) -> f64` | Unbox float/int to `f64` |
| `spid3r_cstr` | `(v: *const Value) -> *mut c_char` | Allocate NUL-terminated `CString` from `Value::Str`; free via `spid3r_cstr_free` |
| `spid3r_cstr_free` | `(p: *mut c_char)` | Reclaim `CString` allocated by `spid3r_cstr` or `spid3r_display` |
| `spid3r_to_ptr` | `(v: *const Value) -> *mut c_void` | Unbox `Value::Ptr` (or integer `0`/address) to C `void*` (`SH-7`) |
| `spid3r_display` | `(v: *const Value) -> *mut c_char` | Format value with Spid3r display semantics as `CString` |
| `spid3r_runtime_version` | `() -> *mut c_char` | Return crate version `CString` (`spid3r_version()`) |

### 4.3 Unboxed `i64` Overflow-Guarded Arithmetic (6)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_i64_add` | `(a: i64, b: i64) -> i64` | Checked `a + b`; raises VM-identical overflow throw on wrap |
| `spid3r_i64_sub` | `(a: i64, b: i64) -> i64` | Checked `a - b` |
| `spid3r_i64_mul` | `(a: i64, b: i64) -> i64` | Checked `a * b` |
| `spid3r_i64_div` | `(a: i64, b: i64) -> i64` | Checked `a / b` (handles division by zero & `i64::MIN / -1`) |
| `spid3r_i64_mod` | `(a: i64, b: i64) -> i64` | Checked `a % b` |
| `spid3r_i64_neg` | `(a: i64) -> i64` | Checked `-a` (`-i64::MIN` raises overflow throw) |

### 4.4 Boxed Operators & Truthiness (4)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_binop` | `(l: *const Value, r: *const Value, op: i64) -> *mut Value` | Delegate binary op (`vm_eval_binary`) |
| `spid3r_unop` | `(v: *const Value, op: i64) -> *mut Value` | Delegate unary op (`vm_eval_unary`) |
| `spid3r_truthy` | `(v: *const Value) -> u8` | VM truthiness (`1` / `0`) |
| `spid3r_eq` | `(l: *const Value, r: *const Value) -> u8` | VM structural equality (`values_equal`, `1` / `0`) |

### 4.5 Global Variable Table (5)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_global_get` | `(name: *const c_char) -> *mut Value` | Lookup global symbol |
| `spid3r_global_cached` | `(name: *const c_char, slot: *mut GlobalCacheSlot) -> *mut Value` | Generation-checked global lookup cache (invalidated on global write) |
| `spid3r_global_set` | `(name: *const c_char, v: *mut Value)` | Assign existing global symbol |
| `spid3r_global_def` | `(name: *const c_char, v: *mut Value)` | Define/bind global symbol |
| `spid3r_global_exists` | `(name: *const c_char) -> u8` | Predicate (`1` if defined, else `0`) |

### 4.6 Functions, Calls, Methods & Constructors (6)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_call` | `(f: *mut Value, argc: usize, argv: *const *mut Value) -> *mut Value` | Call `Cfn`, `Native`, `NativeClosure`, or class constructor |
| `spid3r_make_fn` | `(name: *const c_char, arity: usize, min_arity: usize, code: *const c_void, env: *mut c_void) -> *mut Value` | Allocate `Value::Cfn` closure handle |
| `spid3r_construct` | `(name: *const c_char, argc: usize, argv: *const *mut Value) -> *mut Value` | Builtin collection/type constructors (`list`, `map`, `set`, `ok`, `err`, etc.) |
| `spid3r_method` | `(obj: *mut Value, name: *const c_char, argc: usize, argv: *const *mut Value) -> *mut Value` | Method dispatch on instances and builtin values |
| `spid3r_method_slot` | `(obj: *mut Value, expected_class_id: u64, slot: i64, name: *const c_char, argc: usize, argv: *const *mut Value) -> *mut Value` | Monomorphic vtable-slot method dispatch (falls back by name on guard miss) |
| `spid3r_super_call` | `(recv: *mut Value, parent_name: *const c_char, method_name: *const c_char, argc: usize, argv: *const *mut Value) -> *mut Value` | Explicit superclass method invocation (`super.m(...)`) |

### 4.7 Indexing, Fields, Length & `for-in` Iteration (9)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_index_get` | `(obj: *const Value, idx: *const Value) -> *mut Value` | Index read (`a[i]`) via `value::collections` |
| `spid3r_list_len` | `(obj: *mut Value) -> *mut Value` | Direct `.len()` fast path for List/VecDyn/Str/Map/Bytes with method fallback (Track 3 RT-5) |
| `spid3r_list_push` | `(obj: *mut Value, val: *mut Value) -> *mut Value` | Direct `.push(x)` fast path for List/VecDyn with method fallback (Track 3 RT-5) |
| `spid3r_map_get_str` | `(out: *mut ValueV2, obj: *const ValueV2, key_ptr: *const u8, key_len: usize)` | Direct string-literal map lookup (`m["k"]`) without `Value::Str` allocation (Track 3 RT-5) |
| `spid3r_frame_enter` | `(slots: *const ValueV2, len: usize)` | Register compiled frame's `[len x ValueV2]` root array for GC (DP-1 / RT-2) |
| `spid3r_frame_exit` | `()` | Pop compiled frame's root array on return/unwind (DP-1 / RT-2) |
| `spid3r_gc_safepoint` | `()` | Sweep unreachable thread-local `AOT_HEAP` `TAG_HEAP` boxes (DP-1 / RT-2) |
| `spid3r_index_set` | `(obj: *const Value, idx: *const Value, v: *mut Value)` | Index write (`a[i] = v`) |
| `spid3r_field_get` | `(obj: *const Value, name: *const c_char) -> *mut Value` | Strict field access (`x.f`) |
| `spid3r_field_set` | `(obj: *const Value, name: *const c_char, v: *mut Value)` | Field mutation (`x.f = v`) |
| `spid3r_field_get_soft` | `(obj: *const Value, name: *const c_char) -> *mut Value` | Optional field access (`x?.f`, returns `Null` if null) |
| `spid3r_len` | `(v: *const Value) -> i64` | Length helper |
| `spid3r_forin_start` | `(obj: *const Value) -> *mut c_void` | Snapshot/allocate `for x in obj` iterator |
| `spid3r_forin_next` | `(iter: *mut c_void) -> *mut Value` | Advance iterator (`NULL` when exhausted) |
| `spid3r_forin_end` | `(iter: *mut c_void)` | Free iterator state |

### 4.8 Upvalue Cells & Closure Environments (6)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_cell_new` | `(initial: *mut Value) -> *mut UpvalueSlot` | Allocate heap `UpvalueSlot` cell |
| `spid3r_cell_get` | `(cell: *mut UpvalueSlot) -> *mut Value` | Read cell value |
| `spid3r_cell_set` | `(cell: *mut UpvalueSlot, v: *mut Value)` | Mutate cell value |
| `spid3r_env_alloc` | `(count: usize) -> *mut c_void` | Allocate closure environment slot array |
| `spid3r_env_slot` | `(env: *mut c_void, index: usize) -> *mut UpvalueSlot` | Fetch slot `env[index]` |
| `spid3r_env_set_slot` | `(env: *mut c_void, index: usize, cell: *mut UpvalueSlot)` | Bind captured cell into `env[index]` |

### 4.9 OOP Class Registration (7)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_class_register` | `(name: *const c_char, parent_name: *const c_char) -> *mut Value` | Register `CompiledClass` (optional superclass) |
| `spid3r_class_add_field` | `(class: *const Value, name: *const c_char, vis: u8)` | Declare field & visibility on class |
| `spid3r_class_add_method` | `(class: *const Value, name: *const c_char, arity: usize, min_arity: usize, code: *const c_void)` | Bind compiled method code pointer |
| `spid3r_class_set_ctor` | `(class: *const Value, arity: usize, min_arity: usize, code: *const c_void)` | Bind class constructor `init` |
| `spid3r_class_publish` | `(class: *const Value) -> u64` | Finalize class vtable and publish monotonic `class_id` |
| `spid3r_class_slot_of` | `(class_id: u64, name: *const c_char) -> i64` | Resolve vtable method slot index for `(class_id, name)` (`-1` if absent) |
| `spid3r_struct_box` | `(class_name: *const c_char, count: usize, field_names: *const *const c_char, field_vals: *const *mut Value) -> *mut Value` | Box returned C POD struct into a `VInstance`/`CInstance` |

### 4.10 I/O, Abort, Concurrency & Runtime FFI (9)

| Symbol | Signature | Purpose |
|---|---|---|
| `spid3r_print` | `(argc: usize, argv: *const *mut Value)` | Space-joined print |
| `spid3r_println` | `(argc: usize, argv: *const *mut Value)` | Space-joined print + newline |
| `spid3r_eprintln` | `(argc: usize, argv: *const *mut Value)` | Space-joined print to stderr + newline |
| `spid3r_abort` | `(msg: *const c_char) -> !` | Print `error[runtime]: <msg>` and exit `70` |
| `spid3r_spawn` | `(f: *mut Value) -> *mut Value` | Schedule compiled `Cfn` on shared `Scheduler`, return `Value::Task` |
| `spid3r_await` | `(v: *mut Value) -> *mut Value` | Join `Value::Task` or receive from `Value::Channel` |
| `spid3r_dl_open` | `(path: *mut Value) -> *mut Value` | Dynamic library load (`LoadLibraryA`/`dlopen`, gated by `--allow-dlopen`) |
| `spid3r_dl_sym` | `(handle: *mut Value, sym: *mut Value) -> *mut Value` | Resolve symbol address (`GetProcAddress`/`dlsym`, `--allow-dlopen`) |
| `spid3r_dl_close` | `(handle: *mut Value) -> *mut Value` | Close dynamic library handle (`FreeLibrary`/`dlclose`, `--allow-dlopen`) |

*(Plus the 10 `LLVM_Initialize*` helper shims in `src/native/llvm.rs`, compiled behind `--features native` for compiler binaries — not required by ordinary user executables.)*

---

## 5. Stdlib Native Table (`src/stdlib/mod.rs::builtin_defs()`)

At startup, `spid3r_rt_start` -> `rt_init()` installs all **257** builtin native entries from `src/stdlib/mod.rs::builtin_defs()` (132 core entries + 125 submodule entries across 20 submodules) into the AOT globals table. Per `docs/FFI.md` and `AGENTS.md` §3, `--sandbox` applies only to the script engines (`tree`/`vm`); AOT binaries run with full user authority via the same underlying Rust native implementations.

| Module (`src/stdlib/`) | Count | Registered natives |
|---|---|---|
| `mod.rs` (core I/O, fs, math, crypto, encodings, JSON/CSV/npy, regex, datetime, GC, introspection) | 132 | `print`, `println`, `assert`, `assert_eq`, `weak`, `deref`, `eprint`, `read_line`, `read_file`, `write_file`, `write_file_atomic`, `file_exists`, `file_delete`, `remove_file`, `rename`, `copy_file`, `list_dir`, `is_dir`, `is_file`, `file_size`, `file_mtime`, `cwd`, `chdir`, `exe_path`, `env_set`, `path_join`, `basename`, `dirname`, `path_ext`, `is_ok`, `is_err`, `dir_create`, `dir_remove`, `sleep_ms`, `now`, `env`, `args`, `gui_args`, `spawn_process`, `run_payload`, `run_payload_strict`, `exec_capture`, `yield`, `task_count`, `len`, `abs`, `sqrt`, `pow`, `min`, `max`, `clamp`, `floor`, `ceil`, `round`, `trunc`, `sign`, `exp`, `ln`, `log10`, `log2`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `is_nan`, `is_inf`, `atan2`, `hypot`, `float_or`, `nan`, `inf`, `random_float`, `random_normal`, `sha256`, `sha512`, `ed25519_keypair`, `ed25519_sign`, `ed25519_verify`, `hmac_sha256`, `pbkdf2_sha256`, `secure_compare`, `chr`, `ord`, `base64_encode`, `base64_decode`, `base64_url_encode`, `base64_url_decode`, `hex_encode`, `hex_decode`, `base32_encode`, `base32_decode`, `int`, `float`, `string`, `bool`, `bit_and`, `bit_or`, `bit_xor`, `shl`, `shr`, `random_int`, `json_parse`, `json_write`, `spid3rinfo`, `config_get`, `config_set`, `config_reload`, `type_of`, `is_failure`, `gc_collect`, `gc_live_cells`, `read_bytes`, `bytes_concat`, `write_bytes`, `save_npy`, `load_npy`, `read_csv`, `parse_csv`, `write_csv`, `regex_match`, `regex_find`, `regex_find_all`, `regex_replace`, `unix_time`, `now_ms`, `elapsed_ms`, `unix_ms`, `datetime_parts`, `datetime_from_parts`, `format_datetime` |
| `net.rs` | 41 | `tcp_listen`, `tcp_accept`, `tcp_accept_timeout`, `tls_listen`, `tls_accept`, `uds_listen`, `uds_connect`, `tcp_connect`, `tcp_read`, `tcp_write`, `tcp_close`, `tcp_local_addr`, `tcp_peer_addr`, `tcp_set_timeout`, `tcp_poll`, `tcp_read_exact`, `tcp_write_bytes`, `tcp_recv_to_file`, `tcp_send_file`, `ws_connect`, `ws_accept`, `ws_send`, `ws_send_bytes`, `ws_recv`, `ws_close`, `udp_bind`, `udp_join_multicast`, `udp_leave_multicast`, `udp_set_multicast_ttl`, `udp_set_broadcast`, `udp_local_addr`, `udp_send_to`, `udp_recv_from`, `udp_close`, `http_read_request`, `http_write_response`, `http_write_response_chunk`, `http_fetch`, `__http_fetch`, `url_decode`, `url_encode` |
| `compress.rs` | 11 | `crc32`, `adler32`, `deflate`, `inflate`, `gzip_compress`, `gunzip`, `zlib_compress`, `unzlib`, `zip_create`, `zip_read`, `zip_list` |
| `file.rs` | 11 | `file_open`, `file_read`, `file_read_line`, `file_write`, `file_seek`, `file_tell`, `file_flush`, `file_fsync`, `file_lock`, `file_unlock`, `file_close` |
| `eventloop.rs` | 6 | `event_loop_run`, `event_loop_stop`, `on_readable`, `on_writable`, `on_timer`, `event_loop_unwatch` |
| `media.rs` | 6 | `png_decode`, `png_encode`, `wav_decode`, `wav_encode`, `pdf_write`, `pdf_escape` |
| `serialize.rs` | 6 | `msgpack_encode`, `msgpack_decode`, `cbor_encode`, `cbor_decode`, `pb_encode`, `pb_decode` |
| `tz.rs` | 6 | `tz_names`, `tz_info`, `tz_parts`, `tz_from_parts`, `tz_format`, `tz_version` |
| `unicode.rs` | 6 | `unicode_normalize`, `unicode_is_normalized`, `unicode_casefold`, `unicode_strip_marks`, `unicode_combining_class`, `unicode_version` |
| `timer.rs` | 5 | `after_ms`, `every_ms`, `timer_cancel`, `timer_pending`, `timer_check` |
| `multipart.rs` | 4 | `multipart_parse`, `__multipart_parse`, `multipart_build`, `__multipart_build` |
| `mysql.rs` | 4 | `mysql_connect`, `mysql_query`, `mysql_exec`, `mysql_close` |
| `postgres.rs` | 4 | `pg_connect`, `pg_query`, `pg_exec`, `pg_close` |
| `shutdown.rs` | 4 | `shutdown_requested`, `request_shutdown`, `reset_shutdown`, `signal_requested` |
| `redis.rs` | 3 | `redis_connect`, `redis_command`, `redis_close` |
| `bcrypt.rs` | 2 | `bcrypt_hash`, `bcrypt_verify` |
| `signal.rs` | 2 | `fft`, `ifft` |
| `argon2.rs` | 1 | `argon2` |
| `db.rs` | 1 | `db_open` |
| `entropy.rs` | 1 | `random_bytes` |
| `kdf.rs` | 1 | `scrypt` |

Total: **257** registered entries (257 unique names, including convenience aliases `remove_file` -> `file_delete` and `elapsed_ms` -> `now_ms`).
