nx_doc_census.nx
buildroot/runtime/nx_doc_census.nx
about
nx_doc_census.nx -- D1 stone of NISHI_DOCS_DOCTRINE_ROADMAP V2.
Bits-up classifier for substrate documentation files. Operation-
alizes the V2 header schema introduced in docs doctrine V2:
**Quadrant:** (Diátaxis)
**Topic Type:** (DITA)
**Status:** (lifecycle)
**Trust State:** (composes nx_trust_state cardinal)
**Competitive State:** (composes nx_competitive_state cardinal)
Per [[feedback-docs-above-book-hyper-efficient-structured-delivery]]
+ [[feedback-audits-are-ecosystem-citizens-not-islands]] cardinals:
this audit measures the substrate's own docs against the V2 KPI
surface + emits NxEtgEntry into the substrate's attestation chain.
Composes:
nx_grep (S1; substring pattern detection in doc bytes)
nx_string_ops (helpers)
nx_etg (NxEtgEntry attestation)
nx_trust_state (composed: docs themselves have trust state)
nx_competitive_state (composed: docs decay too)
**Quadrant:** REFERENCE + EXPLANATION (Diátaxis)
**Topic Type:** REFERENCE (DITA)
**Status:** DRAFT (D1 first stone)
**Trust State:** WRITTEN_UNTESTED (this file is brand-new; not yet
KAT-passed; per the never-trust-just-written cardinal)
**Competitive State:** UNCLASSIFIED (no benchmark vs Diátaxis-
linter / Vale.sh / textlint incumbents yet)
dependencies 6 imports · 5 importers
imports: nx_syscalls.nxnx_string_ops.nxnx_grep.nxnx_grep_rt.nxnx_etg.nxnx_dir.nx
imported by: nx_doc_census_real_audit_test.nxnx_doc_census_real_listing_test.nxnx_doc_census_run_test.nxnx_doc_census_test.nxnx_librarian.nx
structs
| 195 | struct NxDocV2Record |
| 232 | struct NxDocCensusCounts |
consts
| 52 | const NX_MAGIC_65536: i64 = 65536 |
| 53 | const NX_MAGIC_1024: i64 = 1024 |
| 57 | const NX_DOC_Q_NONE: i64 = 0 |
| 58 | const NX_DOC_Q_TUTORIAL: i64 = 1 |
| 59 | const NX_DOC_Q_HOW_TO: i64 = 2 |
| 60 | const NX_DOC_Q_REFERENCE: i64 = 3 |
| 61 | const NX_DOC_Q_EXPLANATION: i64 = 4 |
| 62 | const NX_DOC_Q_MIXED: i64 = 5 |
| 63 | const NX_DOC_Q_N: i64 = 6 |
| 83 | const NX_DOC_T_NONE: i64 = 0 |
| 84 | const NX_DOC_T_CONCEPT: i64 = 1 |
| 85 | const NX_DOC_T_TASK: i64 = 2 |
| 86 | const NX_DOC_T_REFERENCE: i64 = 3 |
| 87 | const NX_DOC_T_PATTERN: i64 = 4 |
| 88 | const NX_DOC_T_EXPLANATION: i64 = 5 |
| 89 | const NX_DOC_T_N: i64 = 6 |
| 109 | const NX_DOC_S_NONE: i64 = 0 |
| 110 | const NX_DOC_S_DRAFT: i64 = 1 |
| 111 | const NX_DOC_S_CANONICAL: i64 = 2 |
| 112 | const NX_DOC_S_SUPERSEDED: i64 = 3 |
| 113 | const NX_DOC_S_DEPRECATED: i64 = 4 |
| 114 | const NX_DOC_S_N: i64 = 5 |
functions
| 65 | func nx_doc_q_is_valid(q: i64) -> i64 called by 1: main |
| 71 | func nx_doc_q_name(q: i64) -> *u8 |
| 91 | func nx_doc_t_is_valid(t: i64) -> i64 called by 1: main |
| 97 | func nx_doc_t_name(t: i64) -> *u8 |
| 116 | func nx_doc_s_is_valid(s: i64) -> i64 called by 1: main |
| 122 | func nx_doc_s_name(s: i64) -> *u8 |
| 137 | func nx_doc_classify_quadrant(content: *u8, n: i64) -> i64 |
| 147 | func nx_doc_classify_topic_type(content: *u8, n: i64) -> i64 |
| 156 | func nx_doc_classify_status(content: *u8, n: i64) -> i64 |
| 166 | func nx_doc_has_trust_state(content: *u8, n: i64) -> i64 |
| 171 | func nx_doc_has_competitive_state(content: *u8, n: i64) -> i64 |
| 179 | func nx_doc_has_websearch_provenance(content: *u8, n: i64) -> i64 |
| 188 | func nx_doc_has_bidirectional_links(content: *u8, n: i64) -> i64 |
| 206 | func nx_doc_classify( |
| 245 | func nx_doc_census_init(c: *NxDocCensusCounts) |
| 258 | func nx_doc_census_accumulate(c: *NxDocCensusCounts, r: *NxDocV2Record) -> i64 |
| 274 | func nx_doc_census_pct_compliance(c: *NxDocCensusCounts) -> i64 |
| 291 | func nx_doc_census_to_etg_outcome(c: *NxDocCensusCounts) -> i64 called by 4: nx_doc_census_attestnx_doc_census_report_stdoutmainmain calls 1: nx_doc_census_pct_compliance |
| 299 | func nx_doc_census_attest( called by 3: mainmainmain calls 3: nx_doc_census_to_etg_outcomenx_doc_census_pct_compliancenx_etg_entry_init |
| 330 | func _doccensus_path_join( |
| 362 | func nx_doc_census_walk_dir( called by 3: mainmainmain calls 10: sys_mmapnx_dir_listnx_dir_row_atnx_str_ends_with_doccensus_path_joinsys_openat_rd+4 |
| 463 | func _docc_write_kv(label: *u8, n_label: i64, value: i64) |
| 473 | func _docc_write_outcome(outcome: i64) |
| 488 | func nx_doc_census_report_stdout(c: *NxDocCensusCounts) |
| 513 | func _docc_write_doc_line(name: *u8, n_name: i64, score: i64) |
| 528 | func nx_doc_census_walk_dir_listing( called by 1: main calls 12: sys_mmapnx_dir_listsys_writenx_dir_row_atnx_str_ends_with_doccensus_path_join+6 |