1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! Native platform built-in procedures (`selene.*`).
//!
//! The first five procedures were relocated verbatim from the historical
//! procedure-pack built-ins into `selene-gql` and registered directly in the
//! native [`BuiltinProcedureRegistry`](crate::BuiltinProcedureRegistry) (STEP 3).
//! The historical `BuiltInMetadata` / `GraphProcedureBuiltIn` /
//! `MutationProcedureBuiltIn` trait indirection and the
//! `UNSTABLE_BUILTIN_CONTENT_HASH` sentinel are dropped — each procedure is a
//! concrete dispatch arm, with planner-visible metadata built from static
//! parameter/output tables (the same `StaticParameter`/`StaticOutputColumn` →
//! `ProcedureMetadata` conversion the pack registry performed). The vector
//! search, batched exact vector-search, candidate vector scoring, batched
//! candidate vector scoring, neighbor candidate vector scoring, batched neighbor
//! candidate vector scoring, expanded-candidate vector scoring, batched
//! expanded-candidate vector scoring, approximate vector-search, batched
//! approximate vector-search, ANN-expanded vector-search, batched ANN-expanded
//! vector-search, vector-index stats, vector-index procedures, maintained
//! text-index stats/procedures, BM25 text-search, candidate BM25 scoring,
//! batched candidate BM25 scoring, maintained-state BM25 scoring,
//! maintained-state node-composed BM25 scoring, maintained-state
//! graph-expanded BM25 batch scoring, Reciprocal Rank Fusion over ranked node lists, JSON containment
//! node search, JSON path search, and candidate-scoped JSON search are new
//! native engine functionality on the same concrete built-in dispatch path.
//!
//! Tiers and mutability are preserved exactly:
//! - `selene.health`, `selene.feature_status`, `selene.verify`, and
//! `selene.vector_search_nodes`, `selene.vector_search_nodes_batch`,
//! `selene.vector_score_nodes`, `selene.vector_score_nodes_batch`,
//! `selene.vector_score_neighbors`,
//! `selene.vector_score_neighbors_batch`,
//! `selene.vector_score_candidate_state`,
//! `selene.vector_score_candidate_state_nodes`,
//! `selene.vector_score_candidate_state_expanded`,
//! `selene.vector_score_candidate_state_expanded_batch`,
//! `selene.vector_candidate_states`,
//! `selene.vector_score_expanded_candidates`,
//! `selene.vector_score_expanded_candidates_batch`,
//! `selene.vector_search_nodes_ann`, `selene.vector_search_nodes_ann_batch`,
//! `selene.vector_search_expanded_candidates_ann`,
//! `selene.vector_search_candidate_state_expanded_ann`,
//! `selene.vector_search_expanded_candidates_ann_batch`,
//! `selene.vector_index_stats`, `selene.text_index_stats`,
//! `selene.json_contains_nodes`, `selene.json_path_exists_nodes`,
//! `selene.json_path_contains_nodes`, `selene.json_path_value_nodes`,
//! `selene.json_contains_candidate_nodes`,
//! `selene.json_path_exists_candidate_nodes`,
//! `selene.json_path_contains_candidate_nodes`,
//! `selene.json_path_value_candidate_nodes`,
//! `selene.compaction_stats`,
//! `selene.text_search_nodes`, `selene.text_score_nodes`,
//! `selene.text_score_nodes_batch`,
//! `selene.text_score_candidate_state`,
//! `selene.text_score_candidate_state_nodes`, and
//! `selene.text_score_candidate_state_expanded_batch`,
//! `selene.reciprocal_rank_fusion` are read-only
//! graph-tier ([`ProcedureTier::Graph`] + [`ProcedureMutability::Read`]);
//! they never mutate and never re-enter `begin_write`.
//! - `selene.create_index`, `selene.drop_index`, `selene.create_vector_index`,
//! `selene.drop_vector_index`, `selene.create_text_index`, and
//! `selene.drop_text_index` are mutation-tier
//! ([`ProcedureTier::Mutation`] + [`ProcedureMutability::SchemaWrite`]); they
//! route every write through [`MutationContext::mutator`] — emitting index
//! schema changes through the single mutation funnel (Hard Rule 11). They
//! never bypass the funnel and never re-enter `begin_write`.
//! - `selene.rebuild_vector_indexes`,
//! `selene.rebuild_recommended_vector_indexes`, and `selene.compact` are
//! maintenance-tier
//! ([`ProcedureTier::Maintenance`] +
//! [`ProcedureMutability::MaintenanceWrite`]); they rebuild derived vector
//! index state or compact dead graph rows through [`MaintenanceContext`]
//! without graph changes, WAL entries, or schema-version bumps.
//!
//! `pack_history` is **not** relocated: it read the pack-lifecycle audit, which
//! is removed in the teardown.
pub use ;
use crateProcedureResult;
/// Build a unit (single empty-row) result, mirroring the pack built-ins' return
/// shape for procedures with no output columns.
pub