code wiki / (root) / nx_hunter.nx

nx_hunter.nx

buildroot/runtime/nx_hunter.nx

10678 B297 linesdepth 2pulls 2 transitivereach 9 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_hunter.nx -- outward-axis collection primitive. Per [[feedback-hunter-gatherer-meta-primitives-outward-inward-axes]] CARDINAL: "nx_hunter (outward — collect/kill bugs+features+feedback+ threats+competitor LOSE-axes)." Hunter is the racing-crew arm of the substrate: it goes OUT, finds threats and opportunities, and either KILLS them (bugs fixed, EXCEED-axis shipped) or CARRIES them home (feedback absorbed, cardinals updated). THE STRATEGIC PRIMITIVE per user 2026-05-17: "hunting being the collection and 'killing' of bugs features feedback etc as part of the racing crew team." Every session must emit at least one hunt event (a target scouted, an active hunt logged, or a kill recorded) or the session was a non-session per the cardinal's audit gate. Composes: nx_hunt_journal -- append-only event log; what was hunted, when nx_gatherer -- the inward-axis dual; hunter and gatherer together form the session-audit gate nx_xenocell -- a threat actor caught = a hunt KILL event nx_antibody -- detection signature derived from a kill nx_provenance_chain -- the kill is a transform; chain-logged nx_pollinate -- federation-ready kills propagate to peers (community-shared hunt intelligence) V1 ships: - sealed enum NxHuntKind (5 target classes from cardinal) - sealed enum NxHuntStatus (4 states: scouted/active/killed/archived) - sealed enum NxKillPillar (4 kill-classes from cardinal) - struct NxHuntTarget + NxHunter container - scout/promote/kill/archive verbs - count_by_status + count_kills_by_pillar queries Gap list (V1 honest perf verdict): - target descriptions are caller-supplied byte buffers (V2 adds structured taxonomy via content-addressed schema) - no per-pillar specialized lifecycle (V2 differentiates) - no automatic federation-readiness predicate (V2 composes with pollinate per kill-pillar policy) - no time-windowed metrics (V2 adds rolling-window kill rate)

dependencies 2 imports · 8 importers

nx_syscalls.nx nx_tier.nx nx_hunter.nx nx_gather_journal_test.nx nx_hunt_evidence.nx nx_hunt_evidence_test.nx nx_hunt_journal.nx nx_hunt_journal_test.nx nx_hunter_test.nx nx_session_audit_compose_test.nx nx_substrate_closure_compose_test.

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_gather_journal_test.nxnx_hunt_evidence.nxnx_hunt_evidence_test.nxnx_hunt_journal.nxnx_hunt_journal_test.nxnx_hunter_test.nxnx_session_audit_compose_test.nxnx_substrate_closure_compose_test.nx

structs

103struct NxHuntTarget
115struct NxHunter

consts

64const NX_HK_COMPETITOR_PRODUCT: nx_int = 0
65const NX_HK_BUG_CLASS: nx_int = 1
66const NX_HK_USER_FEEDBACK: nx_int = 2
67const NX_HK_THREAT_ACTOR: nx_int = 3
68const NX_HK_MISSING_FEATURE: nx_int = 4
69const NX_HK_N_KINDS: nx_int = 5
73const NX_HS_SCOUTED: nx_int = 0 // target identified, not yet engaged
74const NX_HS_ACTIVE: nx_int = 1 // active hunt in progress
75const NX_HS_KILLED: nx_int = 2 // hunt succeeded (one of 4 pillars)
76const NX_HS_ARCHIVED: nx_int = 3 // closed without kill; learning kept
77const NX_HS_N_STATES: nx_int = 4
84const NX_KP_NONE: nx_int = 0
85const NX_KP_BUG_FIXED: nx_int = 1
86const NX_KP_EXCEED_AXIS_SHIPPED: nx_int = 2
87const NX_KP_THREAT_HARDENED: nx_int = 3
88const NX_KP_CARDINAL_ABSORBED: nx_int = 4
89const NX_KP_N_PILLARS: nx_int = 5
93const NX_HUNTER_OK: nx_int = 0
94const NX_HUNTER_ERR_FULL: nx_int = 1
95const NX_HUNTER_ERR_BAD_KIND: nx_int = 2
96const NX_HUNTER_ERR_BAD_STATUS: nx_int = 3
97const NX_HUNTER_ERR_BAD_PILLAR: nx_int = 4
98const NX_HUNTER_ERR_NOT_FOUND: nx_int = 5
99const NX_HUNTER_ERR_BAD_TRANSITION: nx_int = 6
122const NX_HUNT_TARGET_BYTES: nx_size = 56

functions

126func nx_hk_is_valid(k: nx_int) -> nx_int
called by 2: nx_hunter_scoutmain
132func nx_hs_is_valid(s: nx_int) -> nx_int
138func nx_kp_is_valid(p: nx_int) -> nx_int
called by 2: nx_hunter_killmain
146func nx_hunter_new(capacity: nx_size) -> *NxHunter
called by 3: mainmainmain calls 1: sys_mmap
158func _hunter_at(h: *NxHunter, idx: nx_size) -> *NxHuntTarget
164func _hunter_find(h: *NxHunter, target_id: nx_int) -> nx_int
179func nx_hunter_scout(h: *NxHunter,
205func nx_hunter_engage(h: *NxHunter, target_id: nx_int, now_us: nx_size) -> nx_int
called by 2: mainmain calls 2: _hunter_find_hunter_at
221func nx_hunter_kill(h: *NxHunter,
244func nx_hunter_archive(h: *NxHunter, target_id: nx_int, now_us: nx_size) -> nx_int
called by 1: main calls 2: _hunter_find_hunter_at
256func nx_hunter_count_by_status(h: *NxHunter, status: nx_int) -> nx_int
267func nx_hunter_count_kills_by_pillar(h: *NxHunter, pillar: nx_int) -> nx_int
called by 2: mainmain calls 1: _hunter_at
280func nx_hunter_total_kills(h: *NxHunter) -> nx_int
284func nx_hunter_count(h: *NxHunter) -> nx_size
294func nx_hunter_session_emitted(h: *NxHunter) -> nx_int
called by 2: mainmain