code wiki / _hdl_build / nx_lineage_deep.nx

nx_lineage_deep.nx

buildroot/runtime/_hdl_build/nx_lineage_deep.nx

10330 B189 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind librarytopic lineage
docsdependenciesstructsconstsfunctions

about

nx_lineage_deep.nx -- LIB: DEEPER provenance (R-DEEP). Two real-world traceability gaps closed: (1) MULTI-PARENT CROSSES -- a hybrid traces to BOTH parents (parent_a x parent_b), and a cross is detected as such. nx_lineage stored parent_b but only walked parent_a; this reads both. (2) HARVEST-LOT SPLITTING -- one harvest is a LOT that splits into many child lots (sauce, fresh, seed, jars, plates), each linked to its parent lot. ANY leaf (a jar on the table) traces back through the split chain to the harvest -> the plant -> its full seed-to-feed lineage + genetics. "One harvest -> many plates, each individually traceable to the exact plant and its seed." Conservation: a lot can't be split beyond what remains. Additive (rule 13). Same bio- store as nx_lineage. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_lineage.nx nx_seg_store.nx nx_syscalls.nx nx_lineage_deep.nx nx_lineage_deep_gate.nx

imports: nx_lineage.nxnx_seg_store.nxnx_syscalls.nx

imported by: nx_lineage_deep_gate.nx

structs

none

consts

none

functions

13func ld_put(prefix: *u8, key: *u8, val: *u8) -> i64
24func ld_parents(prefix: *u8, id: *u8, out_a: *u8, out_b: *u8) -> i64
30func ld_is_cross(prefix: *u8, id: *u8) -> i64
41func ld_cross_label(prefix: *u8, id: *u8, out: *u8) -> i64
61func ld_lot_key(lotid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "lot:" as *u8); o = as_append(out, o, lotid); out[o] = 0 as u8; return o }
62func ld_alloc_key(lotid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "lot:alloc:" as *u8); o = as_append(out, o, lotid); out[o] = 0 as u8; return o }
called by 2: ld_allocld_split_lot calls 1: as_append
64func ld_lot_str(prefix: *u8, lotid: *u8, f: i64, out: *u8) -> i64
71func ld_lot_int(prefix: *u8, lotid: *u8, f: i64) -> i64
77func ld_lot_exists(prefix: *u8, lotid: *u8) -> i64
85func ld_create_lot(prefix: *u8, lotid: *u8, org_id: *u8, quantity: i64, unit: *u8, day: i64) -> i64
96func ld_alloc(prefix: *u8, lotid: *u8) -> i64
103func ld_lot_remaining(prefix: *u8, lotid: *u8) -> i64 { return ld_lot_int(prefix, lotid, 2) - ld_alloc(prefix, lotid) }
called by 2: ld_split_lotmain calls 2: ld_lot_intld_alloc
105func ld_split_lot(prefix: *u8, parent_lotid: *u8, child_lotid: *u8, quantity: i64, unit: *u8, purpose: *u8, day: i64) -> i64
124func ld_lot_trace(prefix: *u8, lotid: *u8, out: *u8) -> i64
150func ld_lot_origin_org(prefix: *u8, lotid: *u8, out: *u8) -> i64
167func ld_render_lot(prefix: *u8, lotid: *u8, out: *u8) -> i64