nx_pushback_lib.nx
buildroot/runtime/nx_pushback_lib.nx
about
nx_pushback_lib.nx -- COMMUNITY PUSH-BACK WITH LICENCE, PROVENANCE AND THE REFEREE GRADE ATTACHED (/compare/modding MD23
pushback_publish, 2026-09-06). Our own models go back to the communities as ONE bundle per community target: the sovereign
mod manifest (nx_mod_manifest_lib, MD18) copied byte-for-byte, the package archived by the estate's own 7z writer
(nx_sevenz_lib sz_write_copy, MD29), the content id, magnet, download url and index row from the ONE transport addresser
(nx_dist_publish), and a publish row carrying the licence row, the member count, the manifest and archive digests and the
referee grade. Every door this lib composes is fail-closed and it adds no second ruler: the manifest must VERIFY against
the files as they are (mm_verify), the package licence is re-read from the ONE rights table (a hand-edited id is refused
LICENCE-UNKNOWN), every journaled member is re-asked from the ONE asset journal at publish time (a rip whose licence class
is unknown is refused PROVENANCE by name -- the rung's own words), the community's redistribution floor is applied to the
package and to every journaled member, and an UNGRADED package never publishes (the operator's law: presence is not
completion; a push-back without a referee grade is a poorly-done cut shipped to strangers). The community targets are DATA
(knowledge/modding_communities.conf); the same manifest bytes land in every bundle, which is the invariant the gate proves.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 2 importers
imports: nx_syscalls.nxnx_mod_manifest_lib.nxnx_sevenz_lib.nxnx_dist_publish.nx
imported by: nx_pushback_publish.nxnx_pushback_publish_gate.nx
structs
| none |
consts
| 19 | const PB_CONF_DEFAULT: *u8 = "knowledge/modding_communities.conf" |
| 20 | const PB_GRADE_DEFAULT_NAME: *u8 = "referee.grade" |
| 21 | const PB_OUTDIR_DEFAULT_NAME: *u8 = "pushback" |
| 22 | const PB_TAG: *u8 = "community" |
| 23 | const PB_GRADE_TAG: *u8 = "grade" |
| 24 | const PB_KIND_DIST_S: *u8 = "dist" |
| 25 | const PB_KIND_APIDESC_S: *u8 = "api-desc" |
| 26 | const PB_MANIFEST_EXT: *u8 = ".nxmod" |
| 27 | const PB_ARCHIVE_EXT: *u8 = ".7z" |
| 28 | const PB_INDEX_FILE: *u8 = "index.row" |
| 29 | const PB_ROW_FILE: *u8 = "publish.row" |
| 30 | const PB_TRANSPORT_DIST: *u8 = "dist-index" |
| 31 | const PB_TRANSPORT_DESC: *u8 = "descriptor-awaiting-keyed-door" |
| 32 | const PB_DASH_S: *u8 = "-" |
| 33 | const PB_SEP: i64 = 124 |
| 34 | const PB_NL: i64 = 10 |
| 35 | const PB_HASH: i64 = 35 |
| 36 | const PB_DASH: i64 = 45 |
| 37 | const PB_SLASH: i64 = 47 |
| 38 | const PB_DIR_MODE: i64 = 493 |
| 39 | const PB_FILE_MODE: i64 = 420 |
| 40 | const PB_PATH_CAP: i64 = 1024 |
| 41 | const PB_ROW_CAP: i64 = 8192 |
| 42 | const PB_ARCHIVE_SLACK: i64 = 4096 |
| 43 | const PB_PER_MEMBER_SLACK: i64 = 512 |
| 44 | const PB_PERMIL_MAX: i64 = 1000 |
| 45 | const PB_MAX_COMMUNITIES: i64 = 64 |
| 46 | const PB_MAX_IDS: i64 = 64 |
| 48 | const PB_C_ID: i64 = 0 |
| 49 | const PB_C_KIND: i64 = 1 |
| 50 | const PB_C_ENDPOINT: i64 = 2 |
| 51 | const PB_C_MINREDIST: i64 = 3 |
| 52 | const PB_C_NOTE: i64 = 4 |
| 53 | const PB_C_SLOTS: i64 = 6 |
| 54 | const PB_KIND_UNKNOWN: i64 = 0 |
| 55 | const PB_KIND_DIST: i64 = 1 |
| 56 | const PB_KIND_APIDESC: i64 = 2 |
| 58 | const PB_OK: i64 = 0 |
| 59 | const PB_ERR_CONF_UNREADABLE: i64 = 0 - 1 |
| 60 | const PB_ERR_NO_SUCH_COMMUNITY: i64 = 0 - 2 |
| 61 | const PB_ERR_MANIFEST_UNREADABLE: i64 = 0 - 3 |
| 62 | const PB_ERR_MANIFEST_REFUSED: i64 = 0 - 4 |
| 63 | const PB_ERR_LICENCE_UNKNOWN: i64 = 0 - 5 |
| 64 | const PB_ERR_NON_REDISTRIBUTABLE: i64 = 0 - 6 |
| 65 | const PB_ERR_PROVENANCE: i64 = 0 - 7 |
| 66 | const PB_ERR_UNGRADED: i64 = 0 - 8 |
| 67 | const PB_ERR_OUT_UNWRITABLE: i64 = 0 - 9 |
| 68 | const PB_ERR_ARCHIVE: i64 = 0 - 10 |
| 69 | const PB_ERR_MEMBER_UNREADABLE: i64 = 0 - 11 |
| 70 | const PB_ERR_TABLE_UNREADABLE: i64 = 0 - 12 |
| 71 | const PB_ERR_KIND_UNKNOWN: i64 = 0 - 13 |
| 73 | const PB_R_RC: i64 = 0 |
| 74 | const PB_R_KIND: i64 = 1 |
| 75 | const PB_R_ARCHIVE_BYTES: i64 = 2 |
| 76 | const PB_R_CID: i64 = 3 // *u8 65 |
| 77 | const PB_R_MANIFEST_SHA: i64 = 4 // *u8 65, hashed from the WRITTEN copy |
| 78 | const PB_R_OUTDIR: i64 = 5 // *u8 the bundle directory |
| 79 | const PB_R_MEMBER_IDX: i64 = 6 // the member that refused, or -1 |
| 80 | const PB_R_REASON: i64 = 7 // the pv reason, the mm verdict, or the redist level that fell below the floor |
| 81 | const PB_R_N: i64 = 8 |
| 83 | const PB_G_PERMIL: i64 = 0 |
| 84 | const PB_G_JUDGE: i64 = 1 |
| 85 | const PB_G_DATE: i64 = 2 |
| 86 | const PB_G_N: i64 = 4 |
| 88 | const PB_S_REQUESTED: i64 = 0 |
| 89 | const PB_S_PUBLISHED: i64 = 1 |
| 90 | const PB_S_REFUSED: i64 = 2 |
| 91 | const PB_S_IDENTICAL: i64 = 3 |
| 92 | const PB_S_RC: i64 = 4 |
| 93 | const PB_S_CONF_ROWS: i64 = 5 |
| 94 | const PB_S_MEMBERS: i64 = 6 |
| 95 | const PB_S_PERMIL: i64 = 7 |
| 96 | const PB_S_N: i64 = 8 |
functions
| 98 | func pb_write_file(path: *u8, b: *u8, n: i64) -> i64 |
| 106 | func pb_sep(row: *u8, o: i64) -> i64 { row[o] = PB_SEP as u8; return o + 1 } called by 1: pb_publish_one |
| 107 | func pb_kind_code(s: *u8) -> i64 |
| 112 | func pb_kind_name(k: i64) -> *u8 called by 1: main |
| 117 | func pb_transport_name(k: i64) -> *u8 |
| 121 | func pb_err_name(rc: i64) -> *u8 called by 1: main |
| 139 | func pb_conf_load(path: *u8, tbl: *i64, cap: i64) -> i64 |
| 169 | func pb_find(tbl: *i64, n: i64, id: *u8) -> i64 |
| 175 | func pb_grade_read(path: *u8, g: *i64) -> i64 |
| 208 | func pb_publish_one(root: *u8, mb: *u8, mn: i64, m: *i64, crow: *i64, outdir: *u8, g: *i64, jrnl: *u8, r: *i64) -> i64 called by 1: pb_publish calls 19: pb_kind_codesys_mmapmm_verifylg_ctxlg_find_licenselg_lic_redist+13 |
| 350 | func pb_publish(root: *u8, mpath: *u8, ids_csv: *u8, outdir: *u8, gradepath: *u8, confpath: *u8, jrnl: *u8, sum: *i64, rows: *i64) -> i64 called by 1: pushback_publish calls 9: sys_mmappb_conf_loadsys_read_filemm_parsepb_grade_readmm_split_csv+3 |
| 406 | func pushback_publish(root: *u8, mpath: *u8, ids_csv: *u8, outdir: *u8, gradepath: *u8, confpath: *u8, jrnl: *u8, sum: *i64, rows: *i64) -> i64 |