code wiki / (root) / nx_tool_census.nx

nx_tool_census.nx

buildroot/runtime/nx_tool_census.nx

16548 B408 linesdepth 7pulls 14 transitivereach 2 importersview sourcekind librarytopic tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_string_ops.nx nx_grep.nx nx_grep_rt.nx nx_etg.nx nx_dir.nx nx_tool_census.nx nx_tool_census_run_test.nx nx_tool_census_test.nx

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

182struct NxToolCensusCounts

consts

58const NX_TOOL_CENSUS_NONE: i64 = 0
59const NX_TOOL_CENSUS_TEST: i64 = 1
60const NX_TOOL_CENSUS_OFFC: i64 = 2
61const NX_TOOL_CENSUS_AUTO_GENERATED: i64 = 3
62const NX_TOOL_CENSUS_HAND_WRITTEN_DECLARED: i64 = 4
63const NX_TOOL_CENSUS_HAND_WRITTEN_UNDECLARED: i64 = 5
64const NX_TOOL_CENSUS_N: i64 = 6

functions

66func nx_tool_census_kind_is_valid(k: i64) -> i64
72func nx_tool_census_kind_name(k: i64) -> *u8
87func nx_tool_census_kind_counts_toward_gate(k: i64) -> i64
called by 1: main
98func _census_name_is_test(name: *u8, n_name: i64) -> i64
103func _census_name_is_offc(name: *u8, n_name: i64) -> i64
115func _census_content_is_autogen(content: *u8, n_content: i64) -> i64
called by 1: nx_tool_census_classify calls 1: nx_grep_any
129func _census_content_has_lineage(content: *u8, n_content: i64) -> i64
called by 1: nx_tool_census_classify calls 1: nx_grep_any
157func nx_tool_census_classify(
192func nx_tool_census_counts_init(c: *NxToolCensusCounts)
called by 1: main
202func nx_tool_census_accumulate(c: *NxToolCensusCounts, kind: i64) -> i64
221func nx_tool_census_pct_declared(c: *NxToolCensusCounts) -> i64
231func _census_path_join(
268func nx_tool_census_walk_dir(
357func nx_tool_census_to_etg_outcome(counts: *NxToolCensusCounts) -> i64
376func nx_tool_census_attest(
401func nx_tool_census_signal_clear_goals(counts: *NxToolCensusCounts) -> i64