nx_flatstore_flip.nx
buildroot/runtime/nx_flatstore_flip.nx
about
nx_flatstore_flip.nx -- the GENERIC store-law flip primitive (operator: "we arent supposed to be using .tsv").
Three hand-copied flips (nx_raci_sov, nx_adversarial_sov, nx_searchcompet_sov) proved the migrate/verify/read
pattern is BOILERPLATE -> this DRYs it (rule 15) into ONE parameterized lib so every remaining flat-file debt
(the 655 the dataplane census measures) becomes a few-line caller: import + fsf_read_all(store,keyprefix,...)
with a self-seeding fallback. The store IS the SSOT; the flat file survives only as migrate-source.
The line-store contract: one text line per store row, keyed "<keyprefix><idx>", '#' comments + blank lines
skipped, CRLF tolerated -> fsf_read_all reconstructs the data lines byte-compatibly so a consumer flips its
file-read to a store-read with a ONE-LINE swap. license_tier: ORIGINAL module: nishi-core.architect.flatstore_flip
dependencies 2 imports · 3 importers
imports: nx_seg_store.nxnx_syscalls.nx
imported by: nx_cap_census.nxnx_flatstore_flip_gate.nxnx_frontier_watch.nx
structs
| none |
consts
| 11 | const K_MAGIC_4096: i64 = 4096 |
functions
| 14 | func fsf_key(keyprefix: *u8, k: i64, out: *u8) -> i64 |
| 24 | func fsf_migrate(conf: *u8, store: *u8, keyprefix: *u8, totp: *i64, verp: *i64) -> i64 called by 5: cap_census_onecap_verify_onecap_judge_onemainmain calls 9: sys_mmapss_readallss_beginfsf_keyss_addss_commit+3 |
| 59 | func fsf_row(store: *u8, keyprefix: *u8, k: i64, out: *u8, cap: i64) -> i64 |
| 77 | func fsf_count(store: *u8, keyprefix: *u8) -> i64 |
| 91 | func fsf_read_all(store: *u8, keyprefix: *u8, out: *u8, cap: i64) -> i64 |