nx_tool_census.nx
buildroot/runtime/nx_tool_census.nx
about
nx_tool_census.nx -- bits-up tool-census classification primitive.
Composes [[nx_grep.nx]] (S1 of shell-replacement) + nx_string_ops.nx
to classify a substrate-file's HEADER bytes into one of:
AUTO_GENERATED (template-shape test corpus; excluded from gate)
HAND_WRITTEN_DECLARED (lineage declared: Composes / Supersedes /
Distinct / Canonical / genealogy_id)
HAND_WRITTEN_UNDECLARED (no lineage metadata)
TEST (file ending in "_test.nx" -- excluded from gate)
OFFC (file prefix "_offc" -- excluded from gate)
FIRST STONE NOTE: this primitive ships the CLASSIFICATION LOGIC.
The directory-walker wrapper (reading every runtime/*.nx file +
aggregating counts) lands at S5 when nx_find ships. Until then
bench/nx_tool_census.sh remains the .sh harness; the .nx primitive
underneath is what does the substantive classification work.
Per [[feedback-bits-up-shell-replace-linux-brother-tools]]: this
is the substrate's first cardinal-demonstrating audit primitive
where the LOGIC moves from grep/awk/sed bash plumbing into a
bits-up NishiLang function. When nx_find ships at S5, swapping
the .sh wrapper for an .nx executor closes the cardinal end-to-end
for this one tool.
Composes:
[[NISHI_SHELL_REPLACEMENT_ROADMAP]] S1.5 (post-nx_grep audit primitive)
nx_grep.nx (S1 canonical pattern search; nx_grep_any for lineage detection)
nx_string_ops.nx (nx_str_ends_with for filename suffix matching;
nx_str_starts_with for offc-prefix detection)
[[feedback-no-tool-proliferation-consolidate-or-justify]] +
[[feedback-no-tool-proliferation-bit-level]] (this primitive's
classification IS the cardinal's enforcement primitive)
[[feedback-substrate-genealogy-dedupe-mapper]] (lineage-declared
classification is the genealogy's own truth source)
dependencies 6 imports · 2 importers
imports: nx_syscalls.nxnx_string_ops.nxnx_grep.nxnx_grep_rt.nxnx_etg.nxnx_dir.nx
imported by: nx_tool_census_run_test.nxnx_tool_census_test.nx
structs
| 182 | struct NxToolCensusCounts |
consts
| 58 | const NX_TOOL_CENSUS_NONE: i64 = 0 |
| 59 | const NX_TOOL_CENSUS_TEST: i64 = 1 |
| 60 | const NX_TOOL_CENSUS_OFFC: i64 = 2 |
| 61 | const NX_TOOL_CENSUS_AUTO_GENERATED: i64 = 3 |
| 62 | const NX_TOOL_CENSUS_HAND_WRITTEN_DECLARED: i64 = 4 |
| 63 | const NX_TOOL_CENSUS_HAND_WRITTEN_UNDECLARED: i64 = 5 |
| 64 | const NX_TOOL_CENSUS_N: i64 = 6 |
functions
| 66 | func nx_tool_census_kind_is_valid(k: i64) -> i64 |
| 72 | func nx_tool_census_kind_name(k: i64) -> *u8 |
| 87 | func nx_tool_census_kind_counts_toward_gate(k: i64) -> i64 called by 1: main |
| 98 | func _census_name_is_test(name: *u8, n_name: i64) -> i64 |
| 103 | func _census_name_is_offc(name: *u8, n_name: i64) -> i64 |
| 115 | func _census_content_is_autogen(content: *u8, n_content: i64) -> i64 |
| 129 | func _census_content_has_lineage(content: *u8, n_content: i64) -> i64 |
| 157 | func nx_tool_census_classify( |
| 192 | func nx_tool_census_counts_init(c: *NxToolCensusCounts) called by 1: main |
| 202 | func nx_tool_census_accumulate(c: *NxToolCensusCounts, kind: i64) -> i64 |
| 221 | func nx_tool_census_pct_declared(c: *NxToolCensusCounts) -> i64 |
| 231 | func _census_path_join( called by 1: nx_tool_census_walk_dir |
| 268 | func nx_tool_census_walk_dir( called by 1: main calls 9: sys_mmapnx_dir_listnx_dir_row_at_census_path_joinsys_openat_rdnx_tool_census_accumulate+3 |
| 357 | func nx_tool_census_to_etg_outcome(counts: *NxToolCensusCounts) -> i64 |
| 376 | func nx_tool_census_attest( |
| 401 | func nx_tool_census_signal_clear_goals(counts: *NxToolCensusCounts) -> i64 calls 1: nx_tool_census_pct_declared |