code wiki / (root) / nx_browser_profile_store.nx

nx_browser_profile_store.nx

buildroot/runtime/nx_browser_profile_store.nx

3404 B72 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind librarytopic browser
docsdependenciesstructsconstsfunctions

about

nx_browser_profile_store.nx -- the Nishi browser's PERSISTENT PROFILE STORE (lib, no main). Operator 2026-07-02: contacts/chat/settings "stored locally in nishi browser in a DIFFERENT cache than the history-clearing cache so that this more permanent info" survives; backup = nx_profile_backup. THE SPLIT (the whole point): TWO seg_store families under knowledge/store/ -- PROFILE prefix "knowledge/store/browser_profile-" = permanent (contacts/chat/settings). CACHE prefix "knowledge/store/browser_cache-" = clearable (http cache/history when they land). A history-clear deletes ONLY browser_cache-* files; it never touches browser_profile-*. The gate (nx_browser_profile_gate) proves this split mechanically: clear the cache family -> profile intact. Storage = nx_seg_store (append-only, content-addressed, crash-safe temp->rename, additive law: deletes are TOMBSTONES so history is never destroyed). Key scheme: "contact:<id>", "chat:<room>:<ts_us>", "setting:<name>". ⚠ each bp_put = one ss_commit = one new segment (manifest cap 256) -- BATCH bursty writers (chat) with bp_put2 pairs per commit or run ss_compact periodically. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_seg_store.nx nx_browser_profile_store.nx nx_browser_profile_gate.nx nx_profile_backup_run.nx

imports: nx_syscalls.nxnx_seg_store.nx

imported by: nx_browser_profile_gate.nxnx_profile_backup_run.nx

structs

none

consts

18const BP_PROFILE_PREFIX: *u8 = "knowledge/store/browser_profile-"
19const BP_CACHE_PREFIX: *u8 = "knowledge/store/browser_cache-"

functions

21func bp_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
24func bp_put(prefix: *u8, key: *u8, val: *u8, vlen: i64) -> i64
32func bp_put2(prefix: *u8, key1: *u8, val1: *u8, vlen1: i64, key2: *u8, val2: *u8, vlen2: i64) -> i64
41func bp_del(prefix: *u8, key: *u8) -> i64
50func bp_get(prefix: *u8, key: *u8, out: *u8, cap: i64) -> i64
called by 1: main calls 3: ss_opensys_mmapss_hget
65func bp_exists(prefix: *u8, key: *u8) -> i64
called by 1: main calls 3: ss_opensys_mmapss_hget