nx_hunter.nx
buildroot/runtime/nx_hunter.nx
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
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
| 103 | struct NxHuntTarget |
| 115 | struct NxHunter |
consts
| 64 | const NX_HK_COMPETITOR_PRODUCT: nx_int = 0 |
| 65 | const NX_HK_BUG_CLASS: nx_int = 1 |
| 66 | const NX_HK_USER_FEEDBACK: nx_int = 2 |
| 67 | const NX_HK_THREAT_ACTOR: nx_int = 3 |
| 68 | const NX_HK_MISSING_FEATURE: nx_int = 4 |
| 69 | const NX_HK_N_KINDS: nx_int = 5 |
| 73 | const NX_HS_SCOUTED: nx_int = 0 // target identified, not yet engaged |
| 74 | const NX_HS_ACTIVE: nx_int = 1 // active hunt in progress |
| 75 | const NX_HS_KILLED: nx_int = 2 // hunt succeeded (one of 4 pillars) |
| 76 | const NX_HS_ARCHIVED: nx_int = 3 // closed without kill; learning kept |
| 77 | const NX_HS_N_STATES: nx_int = 4 |
| 84 | const NX_KP_NONE: nx_int = 0 |
| 85 | const NX_KP_BUG_FIXED: nx_int = 1 |
| 86 | const NX_KP_EXCEED_AXIS_SHIPPED: nx_int = 2 |
| 87 | const NX_KP_THREAT_HARDENED: nx_int = 3 |
| 88 | const NX_KP_CARDINAL_ABSORBED: nx_int = 4 |
| 89 | const NX_KP_N_PILLARS: nx_int = 5 |
| 93 | const NX_HUNTER_OK: nx_int = 0 |
| 94 | const NX_HUNTER_ERR_FULL: nx_int = 1 |
| 95 | const NX_HUNTER_ERR_BAD_KIND: nx_int = 2 |
| 96 | const NX_HUNTER_ERR_BAD_STATUS: nx_int = 3 |
| 97 | const NX_HUNTER_ERR_BAD_PILLAR: nx_int = 4 |
| 98 | const NX_HUNTER_ERR_NOT_FOUND: nx_int = 5 |
| 99 | const NX_HUNTER_ERR_BAD_TRANSITION: nx_int = 6 |
| 122 | const NX_HUNT_TARGET_BYTES: nx_size = 56 |
functions
| 126 | func nx_hk_is_valid(k: nx_int) -> nx_int |
| 132 | func nx_hs_is_valid(s: nx_int) -> nx_int |
| 138 | func nx_kp_is_valid(p: nx_int) -> nx_int |
| 146 | func nx_hunter_new(capacity: nx_size) -> *NxHunter |
| 158 | func _hunter_at(h: *NxHunter, idx: nx_size) -> *NxHuntTarget |
| 164 | func _hunter_find(h: *NxHunter, target_id: nx_int) -> nx_int |
| 179 | func nx_hunter_scout(h: *NxHunter, |
| 205 | func nx_hunter_engage(h: *NxHunter, target_id: nx_int, now_us: nx_size) -> nx_int |
| 221 | func nx_hunter_kill(h: *NxHunter, |
| 244 | func nx_hunter_archive(h: *NxHunter, target_id: nx_int, now_us: nx_size) -> nx_int |
| 256 | func nx_hunter_count_by_status(h: *NxHunter, status: nx_int) -> nx_int |
| 267 | func nx_hunter_count_kills_by_pillar(h: *NxHunter, pillar: nx_int) -> nx_int |
| 280 | func nx_hunter_total_kills(h: *NxHunter) -> nx_int |
| 284 | func nx_hunter_count(h: *NxHunter) -> nx_size |
| 294 | func nx_hunter_session_emitted(h: *NxHunter) -> nx_int |