code wiki / _hdl_build / nx_consolidate.nx

nx_consolidate.nx

buildroot/runtime/_hdl_build/nx_consolidate.nx

8101 B181 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_consolidate.nx -- ATLAS-DRIVEN CONSOLIDATION ARCHITECT (operator 2026-07-20: "use the atlas to consolidate and architect so we get object oriented without losing functionalities but always growing"). Composes the atlas dup census (nx_dup_source_check output): for each cross-tree dup basename it BYTE-COMPARES the two copies and proposes a DRY consolidation -- IDENTICAL -> SAFE-COLLAPSE to one canonical (functionality preserved BY CONSTRUCTION: same bytes; the byte-equal proof IS the behaviour-preserving gate, rule 25 "never strip features") DIVERGENT -> HAZARD: the copies differ, so collapsing WOULD change behaviour for one consumer (the seq284 stale-nx_syscalls class) -> flagged for seat/PM resolution, NEVER auto-collapsed. Output = the consolq- staging plane (a DERIVED VIEW re-seeded per run = idempotent + self-clearing: when a dup is reconciled it drops off the next run). It never edits a source -- propose, prove, and let a seat apply the gated collapse. Weight: DIVERGENT=CD_W_HAZARD (latent bug) > IDENTICAL. argv: <dupcensus-capture> <consolq-prefix> Report: NX-CONSOLIDATE pairs=N identical=N divergent=N missing=N + one PROPOSE line per pair. exit 0 = ran (proposals are data). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 0 importers

nx_seat_drive_lib.nx nx_store_seed_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_syscalls.nx nx_consolidate.nx

imports: nx_seat_drive_lib.nxnx_store_seed_lib.nxnx_seg_store.nxnx_deploy_lib.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sd_w sys_write sys_exit sys_mmap dp_read sys_openat_rd sys_read sys_close cd_find cd_join cd_readf sys_openat_rd ↻ sys_read ↻ sys_close ↻ sd_cat sd_num sys_mmap ↻ sts_seed ss_begin_cap sys_mmap ↻ sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_catn ↻ ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn ↻ sys_write ↻

structs

none

consts

20const CD_MAGIC_1024: i64 = 1024
22const CD_CAP: i64 = 1048576
23const CD_FILE_CAP: i64 = 2097152
24const CD_W_HAZARD: i64 = 8
25const CD_W_SAFE: i64 = 5

functions

28func cd_readf(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
39func cd_join(out: *u8, tree: *u8, ts: i64, te: i64, name: *u8, ns: i64, ne: i64) -> i64
called by 1: main
52func cd_find(buf: *u8, from: i64, n: i64, lit: *u8) -> i64
called by 1: main
66func main(argc: i64, argv: *i64) -> i64