sqlite_graphrag/constants.rs
1//! Compile-time constants shared across the crate.
2//!
3//! Grouped into embedding configuration, length and size limits, SQLite
4//! pragmas and retrieval tuning knobs. Values are taken from the PRD and
5//! must stay in sync with the migrations under `migrations/`.
6//!
7//! ## Dynamic concurrency permit calculation
8//!
9//! The maximum number of simultaneous instances can be adjusted at runtime
10//! using the formula:
11//!
12//! ```text
13//! permits = min(cpus, available_memory_mb / LLM_WORKER_RSS_MB) * 0.5
14//! ```
15//!
16//! where `available_memory_mb` is obtained via `sysinfo::System::available_memory()`
17//! converted to MiB. The result is capped at `MAX_CONCURRENT_CLI_INSTANCES`
18//! and floored at 1.
19
20/// Default embedding vector dimensionality.
21///
22/// Restored to 384 to match the production corpus: existing vectors were
23/// generated against `multilingual-e5-small` (384 dims), so a lower default
24/// would silently mismatch live data. With the OpenRouter REST backend the
25/// Matryoshka (MRL, arXiv 2205.13147) truncation happens server-side, so
26/// 384 dims carry no per-float autoregressive output cost. Legacy databases
27/// keep their recorded dimensionality via `schema_meta.dim`; the active dim
28/// follows the precedence env > database > default (see [`embedding_dim`]).
29pub const DEFAULT_EMBEDDING_DIM: usize = 384;
30
31/// Default OpenRouter chat completions endpoint (override via XDG
32/// `network.openrouter.chat_url` or alias `network.chat_url`).
33pub const DEFAULT_OPENROUTER_CHAT_URL: &str =
34 "https://openrouter.ai/api/v1/chat/completions";
35
36/// Default OpenRouter embeddings endpoint (override via XDG
37/// `network.openrouter.embeddings_url` or alias `network.embed_url`).
38pub const DEFAULT_OPENROUTER_EMBEDDINGS_URL: &str =
39 "https://openrouter.ai/api/v1/embeddings";
40
41/// Fail-fast probe budget for LLM backends before spawning (ms).
42/// Override via XDG `llm.probe_timeout_ms`.
43pub const DEFAULT_LLM_PROBE_TIMEOUT_MS: u64 = 800;
44
45/// Per-call timeout for query embedding (recall/hybrid Auto chain).
46/// Short budget so dead OAuth falls back to FTS quickly (GAP-E2E-06).
47/// Override via XDG `llm.query_embed_timeout_secs`.
48pub const DEFAULT_QUERY_EMBED_TIMEOUT_SECS: u64 = 3;
49
50/// Active embedding dimensionality for this process. `0` means unresolved.
51static ACTIVE_EMBEDDING_DIM: std::sync::atomic::AtomicUsize =
52 std::sync::atomic::AtomicUsize::new(0);
53
54/// Resolves the active embedding dimensionality (single source of truth).
55///
56/// Precedence (G-T-XDG-04):
57/// 1. CLI `--embedding-dim` / XDG `embedding.dim` via [`crate::runtime_config`];
58/// 2. the value recorded via [`set_active_embedding_dim`] — from `schema_meta`;
59/// 3. [`DEFAULT_EMBEDDING_DIM`].
60pub fn embedding_dim() -> usize {
61 if let Some(dim) = embedding_dim_from_runtime() {
62 return dim;
63 }
64 let active = ACTIVE_EMBEDDING_DIM.load(std::sync::atomic::Ordering::Acquire);
65 if active != 0 {
66 return active;
67 }
68 DEFAULT_EMBEDDING_DIM
69}
70
71/// Reads CLI/XDG override. Values outside [8, 4096] are rejected.
72pub fn embedding_dim_from_runtime() -> Option<usize> {
73 let n = crate::runtime_config::embedding_dim_override()? as usize;
74 if (8..=4096).contains(&n) {
75 Some(n)
76 } else {
77 tracing::warn!(
78 value = n,
79 "embedding.dim override invalid (expected [8, 4096]); ignoring"
80 );
81 None
82 }
83}
84
85/// Backward-compatible alias (no product env).
86pub fn embedding_dim_from_env() -> Option<usize> {
87 embedding_dim_from_runtime()
88}
89
90/// Records the dimensionality found in the opened database
91/// (`schema_meta.dim`). Out-of-range values are ignored. The env var,
92/// when set, always wins over this value (see [`embedding_dim`]).
93pub fn set_active_embedding_dim(dim: usize) {
94 if (8..=4096).contains(&dim) {
95 ACTIVE_EMBEDDING_DIM.store(dim, std::sync::atomic::Ordering::Release);
96 }
97}
98
99// G46: FASTEMBED_MODEL_DEFAULT removed — the fastembed model was deleted in
100// v1.0.76 (LLM-only build); `schema_meta.model` now records the CLI version.
101
102/// Batch size for `fastembed` encoding calls.
103pub const FASTEMBED_BATCH_SIZE: usize = 32;
104
105/// Maximum byte length for a memory `name` field in kebab-case.
106pub const MAX_MEMORY_NAME_LEN: usize = 80;
107
108/// Maximum byte length for an `ingest`-derived kebab-case name.
109///
110/// Stricter than `MAX_MEMORY_NAME_LEN` (80) to leave headroom for collision
111/// suffixes (`-2`, `-10`, ...) when multiple files derive to the same base.
112/// Used exclusively by `src/commands/ingest.rs`.
113pub const DERIVED_NAME_MAX_LEN: usize = 60;
114
115/// Maximum character length for a memory `description` field.
116pub const MAX_MEMORY_DESCRIPTION_LEN: usize = 500;
117
118/// Hard upper bound on memory `body` length in bytes.
119pub const MAX_MEMORY_BODY_LEN: usize = 512_000;
120
121/// Body character count above which the body is split into chunks.
122pub const MAX_BODY_CHARS_BEFORE_CHUNK: usize = 8_000;
123
124/// Maximum attempts when a statement returns `SQLITE_BUSY`.
125pub const MAX_SQLITE_BUSY_RETRIES: u32 = 5;
126
127/// Base delay in milliseconds for the first SQLITE_BUSY retry.
128///
129/// Each subsequent attempt doubles the delay (exponential backoff):
130/// 300 ms → 600 ms → 1200 ms → 2400 ms → 4800 ms (≈ 9.3 s total).
131pub const SQLITE_BUSY_BASE_DELAY_MS: u64 = 300;
132
133/// Query timeout applied to statements in milliseconds.
134pub const QUERY_TIMEOUT_MILLIS: u64 = 5_000;
135
136/// Jaccard threshold above which two memories are considered fuzzy duplicates.
137pub const DEDUP_FUZZY_THRESHOLD: f64 = 0.8;
138
139/// Cosine distance threshold below which two memories are semantic duplicates.
140pub const DEDUP_SEMANTIC_THRESHOLD: f32 = 0.1;
141
142/// Maximum number of hops allowed in graph traversals.
143pub const MAX_GRAPH_HOPS: u32 = 2;
144
145/// Minimum relationship weight required for traversal inclusion.
146pub const MIN_RELATION_WEIGHT: f64 = 0.3;
147
148/// Default traversal depth for `related` when `--hops` is omitted.
149pub const DEFAULT_MAX_HOPS: u32 = 2;
150
151/// Default minimum weight filter applied during graph traversal.
152pub const DEFAULT_MIN_WEIGHT: f64 = 0.3;
153
154/// Default weight assigned to newly created relationships.
155pub const DEFAULT_RELATION_WEIGHT: f64 = 0.5;
156
157/// Default `k` used by `recall` when the caller omits `--k`.
158pub const DEFAULT_K_RECALL: usize = 10;
159
160/// Default `k` for memory KNN searches when the caller omits `--k`.
161pub const K_MEMORIES_DEFAULT: usize = 10;
162
163/// Default `k` for entity KNN searches during graph expansion.
164pub const K_ENTITIES_SEARCH: usize = 5;
165
166/// Default upper bound on distinct entities persisted per memory.
167///
168/// Bumped from 30 → 50 in v1.0.43 to reduce semantic loss on rich documents.
169/// Configurable at runtime via `SQLITE_GRAPHRAG_MAX_ENTITIES_PER_MEMORY`.
170pub const MAX_ENTITIES_PER_MEMORY: usize = 50;
171
172/// Resolves the per-memory entity cap, honouring the env-var override.
173///
174/// v1.0.43: makes the cap (default 50) configurable via `SQLITE_GRAPHRAG_MAX_ENTITIES_PER_MEMORY`.
175/// Stress tests showed inputs with 33-46 candidates being truncated at the old cap of 30.
176/// Values outside [1, 1000] fall back to the default.
177pub fn max_entities_per_memory() -> usize {
178 let n = crate::runtime_config::max_entities_per_memory(MAX_ENTITIES_PER_MEMORY);
179 if (1..=1_000).contains(&n) {
180 n
181 } else {
182 MAX_ENTITIES_PER_MEMORY
183 }
184}
185
186/// Upper bound on distinct relationships persisted per memory.
187pub const MAX_RELATIONSHIPS_PER_MEMORY: usize = 50;
188
189/// Resolves the per-memory relationship cap, honouring the env-var override.
190///
191/// v1.0.22: makes the cap (default 50) configurable via `SQLITE_GRAPHRAG_MAX_RELATIONS_PER_MEMORY`.
192/// Audit found that rich documents silently hit the cap; users with dense technical corpora
193/// can raise it via env. Values outside [1, 10000] fall back to the default.
194pub fn max_relationships_per_memory() -> usize {
195 let n = crate::runtime_config::max_relations_per_memory(MAX_RELATIONSHIPS_PER_MEMORY);
196 if (1..=10_000).contains(&n) {
197 n
198 } else {
199 MAX_RELATIONSHIPS_PER_MEMORY
200 }
201}
202
203/// Character length of the description preview shown in `list` output.
204pub const TEXT_DESCRIPTION_PREVIEW_LEN: usize = 100;
205
206/// `PRAGMA busy_timeout` value applied on every connection.
207pub const BUSY_TIMEOUT_MILLIS: i32 = 5_000;
208
209/// `PRAGMA cache_size` value in kibibytes (negative means KiB).
210pub const CACHE_SIZE_KB: i32 = -64_000;
211
212/// `PRAGMA mmap_size` value in bytes applied to each connection.
213pub const MMAP_SIZE_BYTES: i64 = 268_435_456;
214
215/// `PRAGMA wal_autocheckpoint` threshold in pages.
216pub const WAL_AUTOCHECKPOINT_PAGES: i32 = 1_000;
217
218/// Default `k` constant used by Reciprocal Rank Fusion in `hybrid-search`.
219pub const RRF_K_DEFAULT: u32 = 60;
220
221/// Chunk size expressed in tokens for body splitting.
222pub const CHUNK_SIZE_TOKENS: usize = 400;
223
224/// Token overlap between consecutive chunks.
225pub const CHUNK_OVERLAP_TOKENS: usize = 50;
226
227/// Explicit operational guard for multi-chunk documents in `remember`.
228///
229/// The multi-chunk path uses serial embeddings to avoid ONNX memory amplification.
230/// This limit preserves a clear operational ceiling for agents and scripts.
231pub const REMEMBER_MAX_SAFE_MULTI_CHUNKS: usize = 512;
232
233/// Ceiling on chunks per controlled micro-batch in `remember`.
234///
235/// The `fastembed` runtime uses `BatchLongest` padding, so oversized batches amplify
236/// the cost of the longest chunk. This ceiling keeps batches small even when chunks are short.
237pub const REMEMBER_MAX_CONTROLLED_BATCH_CHUNKS: usize = 4;
238
239/// Maximum padded-token budget per controlled micro-batch in `remember`.
240///
241/// The budget uses `max_tokens_no_batch * batch_size`, approximating the real cost of
242/// `BatchLongest` padding. Values exceeding this fall back to smaller batches or serialisation.
243pub const REMEMBER_MAX_CONTROLLED_BATCH_PADDED_TOKENS: usize = 512;
244
245/// Prefix prepended to bodies before embedding as required by E5 models.
246pub const PASSAGE_PREFIX: &str = "passage: ";
247
248/// Prefix prepended to queries before embedding as required by E5 models.
249pub const QUERY_PREFIX: &str = "query: ";
250
251/// Crate version string sourced from `CARGO_PKG_VERSION` at build time.
252pub const SQLITE_GRAPHRAG_VERSION: &str = env!("CARGO_PKG_VERSION");
253
254/// PRD-canonical regex that validates names and namespaces. Allows 1 char `[a-z0-9]`
255/// OR a 2-80 char string starting with a letter and ending with a letter/digit,
256/// containing only `[a-z0-9-]`. Rejects the `__` prefix (internal reserved).
257pub const NAME_SLUG_REGEX: &str = r"^[a-z][a-z0-9-]{0,78}[a-z0-9]$|^[a-z0-9]$";
258
259static NAME_SLUG_RE: std::sync::OnceLock<regex::Regex> = std::sync::OnceLock::new();
260
261/// Returns a reference to the compiled [`NAME_SLUG_REGEX`] pattern.
262/// Compiled once on first call, cached via `OnceLock`.
263// expect_used (audited v1.0.97): NAME_SLUG_REGEX is a const literal; a parse
264// failure would be a compile-reproducible bug, never a runtime condition.
265#[allow(clippy::expect_used)]
266pub fn name_slug_regex() -> &'static regex::Regex {
267 NAME_SLUG_RE.get_or_init(|| {
268 regex::Regex::new(NAME_SLUG_REGEX).expect("NAME_SLUG_REGEX is a valid pattern")
269 })
270}
271
272/// Default retention period (days) used by `purge` when `--retention-days` is omitted.
273pub const PURGE_RETENTION_DAYS_DEFAULT: u32 = 90;
274
275/// Maximum number of simultaneously active namespaces (deleted_at IS NULL). Exit 5 when exceeded.
276pub const MAX_NAMESPACES_ACTIVE: u32 = 100;
277
278/// Maximum tokens accepted by an embedding input before chunking.
279pub const EMBEDDING_MAX_TOKENS: usize = 512;
280
281/// Maximum token count for a SINGLE embedding request input (GAP-SG-02).
282///
283/// The `qwen/qwen3-embedding-8b` model used by the OpenRouter backend accepts
284/// roughly 32K tokens of context. This ceiling rejects an input above a safe
285/// margin BEFORE the HTTP request, using the conservative cl100k_base proxy in
286/// [`crate::tokenizer::count_tokens`] (which emits at least as many tokens as
287/// Qwen for the same text). Distinct from [`EMBEDDING_MAX_TOKENS`] (512), which
288/// is the per-chunk ceiling that drives chunking.
289pub const EMBEDDING_REQUEST_MAX_TOKENS: usize = 30_000;
290
291/// Initial `max_tokens` budget sent on an `enrich` chat-completion request
292/// (GAP-SG-70/71).
293///
294/// Chosen well below [`ENRICH_MAX_TOKENS_CEILING`] so a well-formed response
295/// completes in one attempt for the common case; only bodies that need more
296/// room trigger the growth loop below.
297pub const ENRICH_INITIAL_MAX_TOKENS: u32 = 4_096;
298
299/// Multiplier applied to `max_tokens` each time OpenRouter reports
300/// `finish_reason: "length"` on an `enrich` chat-completion (GAP-SG-70/71).
301pub const ENRICH_MAX_TOKENS_GROWTH_FACTOR: u32 = 2;
302
303/// Upper bound on `max_tokens` growth for an `enrich` chat-completion
304/// (GAP-SG-70/71).
305///
306/// Kept with margin under the ~32K-token context ceiling of
307/// `deepseek/deepseek-v4-flash:nitro` (see [`EMBEDDING_REQUEST_MAX_TOKENS`]
308/// for the equivalent embedding-side ceiling) so growth never requests a
309/// budget the model cannot honour.
310pub const ENRICH_MAX_TOKENS_CEILING: u32 = 16_384;
311
312/// Maximum number of `max_tokens`-growth re-attempts after a truncated
313/// (`finish_reason: "length"`) `enrich` chat-completion, before giving up and
314/// returning the truncation as an error (GAP-SG-70/71).
315pub const ENRICH_MAX_LENGTH_RETRIES: u32 = 2;
316
317/// Byte budget for one auto-split partition (sub-memory) in `ingest`
318/// (GAP-SG-04/07).
319///
320/// Chosen below the 127 KB body margin so each partition also stays under
321/// [`REMEMBER_MAX_SAFE_MULTI_CHUNKS`] chunks and [`EMBEDDING_REQUEST_MAX_TOKENS`]
322/// tokens, even for multibyte/CJK text (~1 cl100k token per UTF-8 char, so
323/// 80 KiB / 3 bytes-per-char yields about 27K tokens, below the 30K ceiling).
324pub const AUTOSPLIT_PARTITION_MAX_BYTES: usize = 80 * 1024;
325
326/// Maximum result count from the recursive graph CTE in `recall`.
327pub const K_GRAPH_MATCHES_LIMIT: usize = 20;
328
329/// Default `--limit` for `list` when omitted.
330pub const K_LIST_DEFAULT_LIMIT: usize = 100;
331
332/// Default `--limit` for `graph entities` when omitted.
333pub const K_GRAPH_ENTITIES_DEFAULT_LIMIT: usize = 50;
334
335/// Default `--limit` for `related` when omitted.
336pub const K_RELATED_DEFAULT_LIMIT: usize = 10;
337
338/// Default `--limit` for `history` when omitted.
339pub const K_HISTORY_DEFAULT_LIMIT: usize = 20;
340
341/// Default weight for the vector contribution in the `hybrid-search` RRF formula.
342pub const WEIGHT_VEC_DEFAULT: f64 = 1.0;
343
344/// Default weight for the BM25 text contribution in the `hybrid-search` RRF formula.
345pub const WEIGHT_FTS_DEFAULT: f64 = 1.0;
346
347/// Character size of the body preview emitted in text/markdown formats.
348pub const TEXT_BODY_PREVIEW_LEN: usize = 200;
349
350/// Default value injected into ORT_NUM_THREADS when not set by the user.
351pub const ORT_NUM_THREADS_DEFAULT: &str = "1";
352
353/// Default value injected into ORT_INTRA_OP_NUM_THREADS when not set.
354pub const ORT_INTRA_OP_NUM_THREADS_DEFAULT: &str = "1";
355
356/// Default value injected into OMP_NUM_THREADS when not set by the user.
357pub const OMP_NUM_THREADS_DEFAULT: &str = "1";
358
359/// Exit code for partial batch failure (PRD line 1822). Conflicts with DbBusy in v1.x;
360/// in v2.0.0 DbBusy migrates to 15 and this code takes 13 per PRD.
361pub const BATCH_PARTIAL_FAILURE_EXIT_CODE: i32 = 13;
362
363/// Exit code for DbBusy in v2.0.0 (migrated from 13 to free 13 for batch failure).
364pub const DB_BUSY_EXIT_CODE: i32 = 15;
365
366/// Polling interval in milliseconds used by `--wait-lock` between `try_lock_exclusive` attempts.
367pub const CLI_LOCK_POLL_INTERVAL_MS: u64 = 500;
368
369/// Process exit code returned when the lock is busy and no wait was requested (EX_TEMPFAIL).
370pub const CLI_LOCK_EXIT_CODE: i32 = 75;
371
372/// Maximum number of CLI instances running simultaneously.
373///
374/// Limits the counting
375/// semaphore in [`crate::lock`] to prevent memory overload when multiple parallel
376/// v1.0.75 (G18 solution): removed the rigid 4-slot ceiling. The adaptive
377/// `calculate_safe_concurrency` function in [`crate::lock`]` now reports
378/// the dynamic limit. This constant is preserved as a *legacy fallback*
379/// when the dynamic calculation cannot be performed (e.g. when `sysinfo`
380/// cannot read `/proc/meminfo`).
381///
382/// Operators should prefer passing `--max-concurrency` explicitly OR
383/// letting the runtime compute the limit. The default ceiling is intentionally
384/// higher (16) so the legacy 4-slot hard cap does not silently reappear.
385pub const MAX_CONCURRENT_CLI_INSTANCES: usize = 16;
386
387/// G28-B (v1.0.68): polling interval in milliseconds used by
388/// `acquire_job_singleton` between retry attempts when another invocation
389/// already holds the singleton for `(job_type, namespace)`.
390pub const JOB_SINGLETON_POLL_INTERVAL_MS: u64 = 1000;
391
392/// Minimum available memory in MiB required before starting model loading.
393///
394/// If `sysinfo::System::available_memory() / 1_048_576` falls below this value,
395/// the invocation is aborted with [`crate::errors::AppError::LowMemory`]
396/// (exit code [`LOW_MEMORY_EXIT_CODE`]).
397pub const MIN_AVAILABLE_MEMORY_MB: u64 = 2_048;
398
399/// Maximum process RSS in MiB before aborting embedding operations.
400/// Users can override via `--max-rss-mb`. Set to 8 GiB by default.
401pub const DEFAULT_MAX_RSS_MB: u64 = 8_192;
402
403/// Maximum time in seconds an instance waits to acquire a concurrency slot.
404///
405/// Passed as the default for `--max-wait-secs` in the CLI. After exhausting this limit,
406/// the invocation returns [`crate::errors::AppError::AllSlotsFull`] with exit code
407/// [`CLI_LOCK_EXIT_CODE`] (75).
408pub const CLI_LOCK_DEFAULT_WAIT_SECS: u64 = 300;
409
410/// v1.0.75 (G18 + G23): expected RSS in MiB for an LLM-only worker that
411/// spawns a `claude -p` or `codex exec` subprocess. Much lower than the
412/// embedding cost because the ONNX model is not loaded per-worker.
413pub const LLM_WORKER_RSS_MB: u64 = 350;
414
415/// Process exit code returned when available memory is below [`MIN_AVAILABLE_MEMORY_MB`].
416///
417/// Value `77` is `EX_NOPERM` in glibc sysexits, reused here to indicate
418/// "insufficient system resource to proceed".
419pub const LOW_MEMORY_EXIT_CODE: i32 = 77;
420
421/// Process exit code returned when a duplicate memory or entity is detected (exit 9).
422///
423/// Moved from `2` to `9` in v1.0.52 to free exit code `2` for future use and align
424/// with the PRD exit code contract. Shell callers and LLM agents must use `9` from
425/// this version onwards.
426pub const DUPLICATE_EXIT_CODE: i32 = 9;
427
428/// Process exit code returned when shutdown is requested via SIGINT/SIGTERM/SIGHUP
429/// (v1.0.82, GAP-002 final).
430///
431/// The shell sees this code INSTEAD of the legacy `128 + signal` (130/143/129) so
432/// that LLM agents and orchestrators can branch on a single deterministic value
433/// when the operation was cancelled by the user. The signal name is preserved in
434/// the JSON envelope emitted before exit (`{"code":19,"signal":"SIGINT",...}`).
435pub const SHUTDOWN_EXIT_CODE: i32 = 19;
436
437/// Canonical value of `PRAGMA user_version` written after migrations.
438///
439/// **Why 50 instead of `CURRENT_SCHEMA_VERSION` (15)?**
440/// `user_version` is a 32-bit integer that SQLite reserves for application use.
441/// We deliberately set it to a project-specific marker (50 = decimal) so external
442/// inspection tools (`sqlite3 db.sqlite "PRAGMA user_version"`, the `file` command,
443/// SQLite browser GUIs) can distinguish a sqlite-graphrag database from a generic
444/// SQLite file at a glance. The application-level schema version (15, matching
445/// `CURRENT_SCHEMA_VERSION`) is stored in the `schema_meta` table and exposed via
446/// `health --json`/`stats --json`. Bumping migrations does NOT change this constant.
447/// Refinery uses its own `refinery_schema_history` table for migration bookkeeping.
448pub const SCHEMA_USER_VERSION: i64 = 50;
449
450/// Current schema version, equal to the highest migration number in `migrations/Vnnn__*.sql`.
451///
452/// Added in v1.0.27 as a runtime and test sanity check.
453/// Must be bumped in sync with new Refinery migrations; the unit test
454/// `schema_version_matches_migrations_count` validates this automatically.
455pub const CURRENT_SCHEMA_VERSION: u32 = 16;
456
457#[cfg(test)]
458mod tests_schema_version {
459 use super::CURRENT_SCHEMA_VERSION;
460
461 #[test]
462 fn schema_version_matches_migrations_count() {
463 let manifest_dir = env!("CARGO_MANIFEST_DIR");
464 let migrations_dir = std::path::Path::new(manifest_dir).join("migrations");
465 let count = std::fs::read_dir(&migrations_dir)
466 .expect("migrations directory must exist")
467 .filter_map(|entry| entry.ok())
468 .filter(|entry| entry.file_name().to_string_lossy().starts_with('V'))
469 .count() as u32;
470 assert_eq!(
471 CURRENT_SCHEMA_VERSION, count,
472 "CURRENT_SCHEMA_VERSION ({CURRENT_SCHEMA_VERSION}) must equal the number of V*.sql migrations ({count})"
473 );
474 }
475}