code wiki / _hdl_build / nx_consolidate.nx
nx_consolidate.nx
buildroot/runtime/_hdl_build/nx_consolidate.nx
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
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
structs
| none |
consts
| 20 | const CD_MAGIC_1024: i64 = 1024 |
| 22 | const CD_CAP: i64 = 1048576 |
| 23 | const CD_FILE_CAP: i64 = 2097152 |
| 24 | const CD_W_HAZARD: i64 = 8 |
| 25 | const CD_W_SAFE: i64 = 5 |
functions
| 28 | func cd_readf(path: *u8, buf: *u8, cap: i64) -> i64 |
| 39 | func cd_join(out: *u8, tree: *u8, ts: i64, te: i64, name: *u8, ns: i64, ne: i64) -> i64 called by 1: main |
| 52 | func cd_find(buf: *u8, from: i64, n: i64, lit: *u8) -> i64 called by 1: main |
| 66 | func main(argc: i64, argv: *i64) -> i64 |