code wiki / _hdl_build / nx_apistack_idempotency.nx

nx_apistack_idempotency.nx

buildroot/runtime/_hdl_build/nx_apistack_idempotency.nx

3109 B67 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic apistack
docsdependenciesstructsconstsfunctions

about

nx_apistack_idempotency.nx -- CAP-API-IDEMPOTENCY: exactly-once writes over /api. A control plane's write actions (deploy/rollback/restart) MUST be safe to retry -- a dropped response must not double-execute. Answer: an append-only Idempotency-Key ledger (key<TAB>result). On a keyed write: if the key is SEEN, return the CACHED result and SKIP execution; else execute then record. Deterministic, first-write-wins, replay-safe by construction. (IETF Idempotency-Key draft, done sovereign + append-only.) license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_site_lock_lib.nx nx_apistack_idempotency.nx nx_apistack_idempotency_gate.nx

imports: nx_syscalls.nxnx_site_lock_lib.nx

imported by: nx_apistack_idempotency_gate.nx

structs

none

consts

8const K_MAGIC_262144: i64 = 262144
9const K_MAGIC_4096: i64 = 4096

functions

11func id_read_file(path: *u8, out: *u8, cap: i64) -> i64
27func id_lookup(ledger_path: *u8, key: *u8, key_n: i64, out: *u8, cap: i64) -> i64
52func id_seen(ledger_path: *u8, key: *u8, key_n: i64) -> i64
called by 1: main calls 2: sys_mmapid_lookup
60func id_record(ledger_path: *u8, key: *u8, key_n: i64, result: *u8, result_n: i64) -> i64