code wiki / (root) / nx_mvault_reclaim.nx

nx_mvault_reclaim.nx

buildroot/runtime/nx_mvault_reclaim.nx

2388 B55 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind librarytopic mvault
docsdependenciesstructsconstsfunctions

about

nx_mvault_reclaim.nx -- storage VALUE / RECLAMATION engine. WHY (operator 2026-07-17): "i saved too much large media so we want to see if there is value or if we can recover terabytes." The CID content-address gives EXACT DEDUP for free: two saved copies of the same bytes => the same nxc1-sha256 CID. During the in-place migrate the reindexer asks the seg-store whether a CID already exists (mv_store_get); if so the second copy is a DUPLICATE whose bytes are RECLAIMABLE (keep one). This is the streaming accumulator over that signal + a large-file surfacer for value review. It only MEASURES -- actual reclamation is a separate, confirmed, soft-delete/quarantine op (rule 13 never-lose; nothing auto-deletes). license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_syscalls.nx nx_mvault_reclaim.nx nx_mvault_reclaim_gate.nx nx_mvault_reindex.nx nx_mvault_reindex_gate.nx nx_mvault_walk.nx

imports: nx_syscalls.nx

imported by: nx_mvault_reclaim_gate.nxnx_mvault_reindex.nxnx_mvault_reindex_gate.nxnx_mvault_walk.nx

structs

none

consts

17const RC_TOTAL: i64 = 0 // items seen
18const RC_UNIQUE: i64 = 1 // distinct CIDs (kept)
19const RC_DUP: i64 = 2 // duplicate copies (reclaimable)
20const RC_TOTBYTES: i64 = 3 // bytes of the kept/unique set
21const RC_RECLAIM: i64 = 4 // bytes recoverable (duplicate copies)
22const RC_LARGE: i64 = 5 // kept items >= large_thresh
23const RC_LARGEBYTES: i64 = 6 // bytes held in large kept items
24const RC_NFIELDS: i64 = 7

functions

26func mv_reclaim_new() -> *i64
called by 3: mainmainmw_run calls 1: sys_mmap
34func mv_reclaim_add(st: *i64, size: i64, is_dup: i64, large_thresh: i64) -> i64
50func mv_reclaim_total(st: *i64) -> i64 { return st[RC_TOTAL] }
called by 2: mainmain
51func mv_reclaim_unique(st: *i64) -> i64 { return st[RC_UNIQUE] }
called by 3: mainmainmw_run
52func mv_reclaim_dupcount(st: *i64) -> i64 { return st[RC_DUP] }
called by 3: mainmainmw_run
53func mv_reclaim_reclaimable(st: *i64) -> i64 { return st[RC_RECLAIM] }
called by 3: mainmainmw_run
54func mv_reclaim_large(st: *i64) -> i64 { return st[RC_LARGE] }
called by 1: main
55func mv_reclaim_largebytes(st: *i64) -> i64 { return st[RC_LARGEBYTES] }
called by 1: main