nx_mvault_reclaim.nx
buildroot/runtime/nx_mvault_reclaim.nx
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
imports: nx_syscalls.nx
imported by: nx_mvault_reclaim_gate.nxnx_mvault_reindex.nxnx_mvault_reindex_gate.nxnx_mvault_walk.nx
structs
| none |
consts
| 17 | const RC_TOTAL: i64 = 0 // items seen |
| 18 | const RC_UNIQUE: i64 = 1 // distinct CIDs (kept) |
| 19 | const RC_DUP: i64 = 2 // duplicate copies (reclaimable) |
| 20 | const RC_TOTBYTES: i64 = 3 // bytes of the kept/unique set |
| 21 | const RC_RECLAIM: i64 = 4 // bytes recoverable (duplicate copies) |
| 22 | const RC_LARGE: i64 = 5 // kept items >= large_thresh |
| 23 | const RC_LARGEBYTES: i64 = 6 // bytes held in large kept items |
| 24 | const RC_NFIELDS: i64 = 7 |
functions
| 26 | func mv_reclaim_new() -> *i64 |
| 34 | func mv_reclaim_add(st: *i64, size: i64, is_dup: i64, large_thresh: i64) -> i64 |
| 50 | func mv_reclaim_total(st: *i64) -> i64 { return st[RC_TOTAL] } |
| 51 | func mv_reclaim_unique(st: *i64) -> i64 { return st[RC_UNIQUE] } |
| 52 | func mv_reclaim_dupcount(st: *i64) -> i64 { return st[RC_DUP] } |
| 53 | func mv_reclaim_reclaimable(st: *i64) -> i64 { return st[RC_RECLAIM] } |
| 54 | func mv_reclaim_large(st: *i64) -> i64 { return st[RC_LARGE] } called by 1: main |
| 55 | func mv_reclaim_largebytes(st: *i64) -> i64 { return st[RC_LARGEBYTES] } called by 1: main |