diff --git a/.gitignore b/.gitignore index 05fc769..0dad0f7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ tests/stress_test tests/test_lock tests/test_minimal tests/tla_faithfulness +tests/fuzz_test +tests/prop_test benchmarks/bench_all benchmarks/compare clients/nim/tests/test_client diff --git a/Dockerfile b/Dockerfile index 05f4ccf..3c14f29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,13 +10,16 @@ # docker build -t baradb:latest . # # Run: -# docker run -d -p 9472:9472 -p 9470:9470 -p 9471:9471 -v baradb_data:/data baradb:latest +# docker run -d -p 9472:9472 -p 9912:9912 -p 9913:9913 -v baradb_data:/data baradb:latest FROM debian:bookworm-slim +ARG BUILD_DATE +ARG VCS_REF + LABEL maintainer="BaraDB Team" LABEL description="BaraDB — Multimodal Database Engine" -LABEL version="1.1.4" +LABEL version="1.1.6" # Инсталираме runtime зависимости # libpcre3 — нужна за Nim regex (зарежда се динамично) diff --git a/Dockerfile.source b/Dockerfile.source index 54954cc..5763afe 100644 --- a/Dockerfile.source +++ b/Dockerfile.source @@ -13,13 +13,10 @@ # docker build -f Dockerfile.source -t baradb:latest . # ─── Stage 1: Builder ───────────────────────────────────── -FROM nimlang/nim:2.2.10-alpine AS builder +FROM nimlang/nim:2.2.10 AS builder WORKDIR /build -# Инсталираме build зависимости -RUN apk add --no-cache git gcc musl-dev openssl-dev pcre-dev - # Копираме nimble файл и инсталираме публични зависимости COPY baradadb.nimble . RUN nimble install -d -y || true @@ -33,21 +30,27 @@ COPY *.nim . RUN nim c -d:release --opt:speed -d:ssl -o:baradadb src/baradadb.nim # Компилираме backup tool -RUN nim c -d:release -o:backup src/barabadb/core/backup.nim +RUN nim c -d:release --path:src -o:backup src/barabadb/core/backup.nim # ─── Stage 2: Production Runtime ────────────────────────── -FROM alpine:3.19 +FROM ubuntu:24.04 LABEL maintainer="BaraDB Team" LABEL description="BaraDB — Multimodal Database Engine (source build)" -LABEL version="1.1.4" +LABEL version="1.1.6" # Инсталираме runtime зависимости -RUN apk add --no-cache ca-certificates su-exec wget pcre +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libpcre3 \ + ca-certificates \ + wget \ + gosu && \ + rm -rf /var/lib/apt/lists/* # Създаваме dedicated потребител за сигурност -RUN addgroup -g 1000 -S baradb && \ - adduser -u 1000 -S baradb -G baradb +RUN groupadd -r baradb && \ + useradd -r -g baradb baradb WORKDIR /app @@ -66,20 +69,20 @@ RUN mkdir -p /data && chown baradb:baradb /data && \ # Environment variables (defaults) ENV BARADB_ADDRESS=0.0.0.0 ENV BARADB_PORT=9472 -ENV BARADB_HTTP_PORT=9470 -ENV BARADB_WS_PORT=9471 +# Note: HTTP port = TCP port + 440 (9912 when TCP=9472) +# Note: WS port = TCP port + 441 (9913 when TCP=9472) ENV BARADB_DATA_DIR=/data ENV BARADB_LOG_LEVEL=info # Expose ports -EXPOSE 9472 9470 9471 +EXPOSE 9472 9912 9913 # Volume за persistent data VOLUME ["/data"] # Healthcheck HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \ - CMD wget -q --spider http://localhost:${BARADB_HTTP_PORT}/health || exit 1 + CMD wget -qO- http://localhost:9912/health >/dev/null 2>&1 || exit 1 # Стартираме чрез entrypoint ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/README.md b/README.md index a1f7b86..2179fc6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **A multimodal database engine written in Nim — 100% native, zero dependencies.** -[![Version](https://img.shields.io/badge/version-1.1.4-blue.svg)](baradadb.nimble) +[![Version](https://img.shields.io/badge/version-1.1.6-blue.svg)](baradadb.nimble) [![Documentation](https://img.shields.io/badge/docs-7_languages-blue.svg)](docs/index.md) [![Stars](https://img.shields.io/github/stars/katehonz/barabaDB?style=social)](https://github.com/katehonz/barabaDB) @@ -1456,7 +1456,7 @@ nim c -d:release -r benchmarks/bench_all.nim | Protocol (binary + HTTP + WS + pool + auth + ratelimit) | ✅ | 100% | v1.0.0 | | Schema (inheritance + computed + migrations) | ✅ | 100% | v1.0.0 | | Vector engine (HNSW + IVF-PQ + quant + SIMD + metadata) | ✅ | 100% | v1.0.0 | -| Vector SQL Integration (VECTOR type, distance functions, <->, HNSW indexes) | ✅ | 100% | v1.1.4 | +| Vector SQL Integration (VECTOR type, distance functions, <->, HNSW indexes) | ✅ | 100% | v1.1.6 | | Graph engine (all algorithms + pattern matching) | ✅ | 100% | v1.0.0 | | FTS (BM25 + TF-IDF + fuzzy + regex + multi-language) | ✅ | 100% | v1.0.0 | | CLI shell | ✅ | 100% | v1.0.0 | @@ -1464,13 +1464,13 @@ nim c -d:release -r benchmarks/bench_all.nim | Cross-modal queries | ✅ | 100% | v1.0.0 | | Backup & Recovery | ✅ | 100% | v1.0.0 | | Client SDKs (JS, Python, Nim, Rust) | ✅ | 100% | v1.0.0 | -| Graph SQL Integration (CREATE GRAPH, GRAPH_TABLE, Cypher) | ✅ | 100% | v1.1.4 | -| Hybrid RAG Search (vector + FTS + RRF reranking) | ✅ | 100% | v1.1.4 | -| AI Chunking & Auto-Embedding (`chunk()`, `embed_text()`) | ✅ | 100% | v1.1.4 | -| NL→SQL (`nl_to_sql()`, `schema_prompt()`) | ✅ | 100% | v1.1.4 | -| MCP Server (STDIO JSON-RPC for AI agents) | ✅ | 100% | v1.1.4 | -| LangChain Vector Store (Python + JS) | ✅ | 100% | v1.1.4 | -| Production Hardening (prop tests, fuzz tests, thread safety) | ✅ | 100% | v1.1.4 | +| Graph SQL Integration (CREATE GRAPH, GRAPH_TABLE, Cypher) | ✅ | 100% | v1.1.6 | +| Hybrid RAG Search (vector + FTS + RRF reranking) | ✅ | 100% | v1.1.6 | +| AI Chunking & Auto-Embedding (`chunk()`, `embed_text()`) | ✅ | 100% | v1.1.6 | +| NL→SQL (`nl_to_sql()`, `schema_prompt()`) | ✅ | 100% | v1.1.6 | +| MCP Server (STDIO JSON-RPC for AI agents) | ✅ | 100% | v1.1.6 | +| LangChain Vector Store (Python + JS) | ✅ | 100% | v1.1.6 | +| Production Hardening (prop tests, fuzz tests, thread safety) | ✅ | 100% | v1.1.6 | ## Current Limitations diff --git a/baradadb.nimble b/baradadb.nimble index 1715e19..043173d 100644 --- a/baradadb.nimble +++ b/baradadb.nimble @@ -1,5 +1,5 @@ # Package -version = "1.1.4" +version = "1.1.6" author = "BaraDB Team" description = "BaraDB — Multimodal database written in Nim" license = "Apache-2.0" diff --git a/benchmarks/bench_all.nim b/benchmarks/bench_all.nim index d97c8e4..f0a1a7c 100644 --- a/benchmarks/bench_all.nim +++ b/benchmarks/bench_all.nim @@ -1,7 +1,6 @@ ## BaraDB Benchmarks — performance tests for all engines import std/monotimes import std/times -import std/tables import std/random import std/strutils import std/os diff --git a/clients/javascript/package.json b/clients/javascript/package.json index 86f589e..81b77a3 100644 --- a/clients/javascript/package.json +++ b/clients/javascript/package.json @@ -1,6 +1,6 @@ { "name": "baradb", - "version": "1.1.4", + "version": "1.1.6", "description": "Official JavaScript/Node.js client for BaraDB — Multimodal Database Engine", "main": "baradb.js", "types": "baradb.d.ts", diff --git a/clients/nim/README.md b/clients/nim/README.md index 7b64850..9028702 100644 --- a/clients/nim/README.md +++ b/clients/nim/README.md @@ -15,7 +15,7 @@ Official Nim client for **BaraDB** — a multimodal database engine. Add to your `.nimble` file: ```nim -requires "baradb >= 1.1.4" +requires "baradb >= 1.1.6" ``` Or clone locally: diff --git a/clients/nim/baradb.nimble b/clients/nim/baradb.nimble index 7ec2fbd..142e748 100644 --- a/clients/nim/baradb.nimble +++ b/clients/nim/baradb.nimble @@ -1,6 +1,6 @@ # Package -version = "1.1.4" +version = "1.1.6" author = "BaraDB Team" description = "Official Nim client for BaraDB — async binary protocol client" license = "Apache-2.0" diff --git a/clients/python/baradb/__init__.py b/clients/python/baradb/__init__.py index bcb4c09..080c8b9 100644 --- a/clients/python/baradb/__init__.py +++ b/clients/python/baradb/__init__.py @@ -41,7 +41,7 @@ from .core import ( ResultFormat, ) -__version__ = "1.1.4" +__version__ = "1.1.6" __all__ = [ "Client", "QueryBuilder", diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml index 2d984a9..ed315c8 100644 --- a/clients/python/pyproject.toml +++ b/clients/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "baradb" -version = "1.1.4" +version = "1.1.6" description = "Official Python client for BaraDB — Multimodal Database Engine" readme = "README.md" license = { text = "Apache-2.0" } diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index 9c756b0..c279289 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "baradb" -version = "1.1.4" +version = "1.1.6" edition = "2021" authors = ["BaraDB Team "] description = "Official async Rust client for BaraDB — binary protocol client" diff --git a/docs/ar/installation.md b/docs/ar/installation.md index 1ae3aaa..7b6a842 100644 --- a/docs/ar/installation.md +++ b/docs/ar/installation.md @@ -143,7 +143,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# المتوقع: BaraDB v1.1.4 — Multimodal Database Engine +# المتوقع: BaraDB v1.1.6 — Multimodal Database Engine ``` ## تشغيل الاختبارات @@ -237,7 +237,7 @@ docker-compose up -d أضف إلى ملف `.nimble` الخاص بك: ```nim -requires "barabadb >= 1.1.4" +requires "barabadb >= 1.1.6" ``` استخدم في الكود: @@ -258,7 +258,7 @@ db.close() ./build/baradadb # المخرجات المتوقعة: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # الاختبار عبر HTTP API diff --git a/docs/bg/changelog.md b/docs/bg/changelog.md index 035134e..e9bc2a1 100644 --- a/docs/bg/changelog.md +++ b/docs/bg/changelog.md @@ -41,7 +41,7 @@ ### Добавки -- **Client SDKs v1.1.4** — Пълнофункционални клиенти за всички езици: +- **Client SDKs v1.1.6** — Пълнофункционални клиенти за всички езици: - JavaScript: TypeScript дефиниции, package.json, примери, unit и integration тестове - Python: Преструктуриран като пакет (`baradb/` с `__init__.py` и `core.py`), pyproject.toml, примери, тестове (query builder, wire protocol, integration) - Nim: Примери, integration тестове, README @@ -72,7 +72,7 @@ ### Промени - **Версията е вдигната до 1.1.0** във всички компоненти (сървър, Docker изображения, клиенти, CLI) -- **README** — Версионният badge е обновен; всички feature таблици вече реферират v1.1.4 +- **README** — Версионният badge е обновен; всички feature таблици вече реферират v1.1.6 - **TLA+ Формална Верификация** — Добавени `crossmodal.tla`, `backup.tla`, `recovery.tla`; symmetry reduction във всички 9 спецификации - **Чист build** — 0 компилаторни предупреждения на Nim 2.2.10 diff --git a/docs/bg/clients.md b/docs/bg/clients.md index 35dbf67..2718d8e 100644 --- a/docs/bg/clients.md +++ b/docs/bg/clients.md @@ -129,7 +129,7 @@ asyncio.run(main()) ```nim # Във вашия .nimble файл -requires "barabadb >= 1.1.4" +requires "barabadb >= 1.1.6" ``` ### Вградена Употреба diff --git a/docs/bg/configuration.md b/docs/bg/configuration.md index 31f6808..c16fd49 100644 --- a/docs/bg/configuration.md +++ b/docs/bg/configuration.md @@ -159,7 +159,7 @@ raft_peers = "node2:9001,node3:9001" ``` ``` -BaraDB v1.1.4 — Multimodal Database Engine +BaraDB v1.1.6 — Multimodal Database Engine Употреба: baradadb [опции] diff --git a/docs/bg/docker.md b/docs/bg/docker.md index ec25c91..42c5cfc 100644 --- a/docs/bg/docker.md +++ b/docs/bg/docker.md @@ -39,7 +39,7 @@ docker compose logs -f docker build -t baradb:latest . # С конкретна версия -docker build -t baradb:1.1.4 . +docker build -t baradb:1.1.6 . ``` ## Стартиране diff --git a/docs/bg/installation.md b/docs/bg/installation.md index ae4509b..02107ce 100644 --- a/docs/bg/installation.md +++ b/docs/bg/installation.md @@ -143,7 +143,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# Очакван резултат: BaraDB v1.1.4 — Multimodal Database Engine +# Очакван резултат: BaraDB v1.1.6 — Multimodal Database Engine ``` ## Стартиране на Тестове @@ -234,7 +234,7 @@ docker-compose up -d Добавете към вашия `.nimble` файл: ```nim -requires "barabadb >= 1.1.4" +requires "barabadb >= 1.1.6" ``` Използване в кода: @@ -255,7 +255,7 @@ db.close() ./build/baradadb # Очакван изход: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # Тестване с HTTP API diff --git a/docs/bg/monitoring.md b/docs/bg/monitoring.md index 4f4df93..c88140a 100644 --- a/docs/bg/monitoring.md +++ b/docs/bg/monitoring.md @@ -13,7 +13,7 @@ curl http://localhost:9470/health ```json { "status": "healthy", - "version": "1.1.4", + "version": "1.1.6", "uptime_seconds": 86400, "checks": { "storage": "ok", diff --git a/docs/bg/protocol.md b/docs/bg/protocol.md index e7be381..96bcf96 100644 --- a/docs/bg/protocol.md +++ b/docs/bg/protocol.md @@ -136,7 +136,7 @@ GET /health ```json { "status": "healthy", - "version": "1.1.4", + "version": "1.1.6", "uptime_seconds": 86400 } ``` diff --git a/docs/de/changelog.md b/docs/de/changelog.md index e16812f..34c425e 100644 --- a/docs/de/changelog.md +++ b/docs/de/changelog.md @@ -50,7 +50,7 @@ Alle bemerkenswerten Änderungen an BaraDB werden in dieser Datei dokumentiert. ### Hinzugefügt -- **Client SDKs v1.1.4** — Vollständige Clients für alle Sprachen: +- **Client SDKs v1.1.6** — Vollständige Clients für alle Sprachen: - JavaScript: TypeScript Definitionen, package.json, Beispiele, Unit & Integration Tests - Python: Umstrukturiert als proper Package (`baradb/` mit `__init__.py` und `core.py`), pyproject.toml, Beispiele, Tests - Nim: Beispiele, Integration Tests, README @@ -81,7 +81,7 @@ Alle bemerkenswerten Änderungen an BaraDB werden in dieser Datei dokumentiert. ### Geändert - **Version auf 1.1.0 erhöht** über alle Komponenten -- **README** — Version Badge aktualisiert; alle Feature-Tabellen referenzieren jetzt v1.1.4 +- **README** — Version Badge aktualisiert; alle Feature-Tabellen referenzieren jetzt v1.1.6 - **TLA+ Formal Verification** — `crossmodal.tla`, `backup.tla`, `recovery.tla` hinzugefügt; Symmetrie-Reduktion in allen 9 Specs - **Clean build** — 0 Compiler Warnings auf Nim 2.2.10 diff --git a/docs/de/configuration.md b/docs/de/configuration.md index ca6481b..e6ea6b2 100644 --- a/docs/de/configuration.md +++ b/docs/de/configuration.md @@ -156,7 +156,7 @@ raft_peers = "node2:9001,node3:9001" ``` ``` -BaraDB v1.1.4 — Multimodal Database Engine +BaraDB v1.1.6 — Multimodal Database Engine Usage: baradadb [options] diff --git a/docs/de/installation.md b/docs/de/installation.md index f2937bd..8bc79c1 100644 --- a/docs/de/installation.md +++ b/docs/de/installation.md @@ -40,7 +40,7 @@ docker compose up -d ```bash ./build/baradadb --version -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine ./build/baramcp --data-dir ./data & echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | ./build/baramcp diff --git a/docs/en/changelog.md b/docs/en/changelog.md index 9baaf70..b290cd8 100644 --- a/docs/en/changelog.md +++ b/docs/en/changelog.md @@ -65,7 +65,7 @@ All notable changes to BaraDB are documented in this file. ### Added -- **Client SDKs v1.1.4** — Full-featured clients for all languages: +- **Client SDKs v1.1.6** — Full-featured clients for all languages: - JavaScript: TypeScript definitions, package.json, examples, unit & integration tests - Python: Restructured as proper package (`baradb/` with `__init__.py` and `core.py`), pyproject.toml, examples, tests (query builder, wire protocol, integration) - Nim: Examples, integration tests, README @@ -96,7 +96,7 @@ All notable changes to BaraDB are documented in this file. ### Changed - **Version bumped to 1.1.0** across all components (server, Docker images, clients, CLI) -- **README** — Version badge updated; all feature tables now reference v1.1.4 +- **README** — Version badge updated; all feature tables now reference v1.1.6 - **TLA+ Formal Verification** — Added `crossmodal.tla`, `backup.tla`, `recovery.tla`; symmetry reduction in all 9 specs - **Clean build** — 0 compiler warnings on Nim 2.2.10 diff --git a/docs/en/configuration.md b/docs/en/configuration.md index e0ae705..094b569 100644 --- a/docs/en/configuration.md +++ b/docs/en/configuration.md @@ -158,7 +158,7 @@ raft_peers = "node2:9001,node3:9001" ``` ``` -BaraDB v1.1.4 — Multimodal Database Engine +BaraDB v1.1.6 — Multimodal Database Engine Usage: baradadb [options] diff --git a/docs/en/installation.md b/docs/en/installation.md index c961355..6189d4f 100644 --- a/docs/en/installation.md +++ b/docs/en/installation.md @@ -144,7 +144,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# Expected: BaraDB v1.1.4 — Multimodal Database Engine +# Expected: BaraDB v1.1.6 — Multimodal Database Engine ``` ## Running Tests @@ -259,7 +259,7 @@ db.close() ./build/baradadb # Expected output: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # Test with HTTP API diff --git a/docs/fa/installation.md b/docs/fa/installation.md index f3e5803..9eee320 100644 --- a/docs/fa/installation.md +++ b/docs/fa/installation.md @@ -144,7 +144,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# انتظار: BaraDB v1.1.4 — Multimodal Database Engine +# انتظار: BaraDB v1.1.6 — Multimodal Database Engine ``` ## اجرای تست‌ها @@ -259,7 +259,7 @@ db.close() ./build/baradadb # خروجی مورد انتظار: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # تست با HTTP API diff --git a/docs/ru/configuration.md b/docs/ru/configuration.md index 80f6e8b..dfa456d 100644 --- a/docs/ru/configuration.md +++ b/docs/ru/configuration.md @@ -156,7 +156,7 @@ raft_peers = "node2:9001,node3:9001" ``` ``` -BaraDB v1.1.4 — Multimodal Database Engine +BaraDB v1.1.6 — Multimodal Database Engine Usage: baradadb [options] diff --git a/docs/ru/installation.md b/docs/ru/installation.md index 4393922..95a261b 100644 --- a/docs/ru/installation.md +++ b/docs/ru/installation.md @@ -144,7 +144,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# Ожидается: BaraDB v1.1.4 — Multimodal Database Engine +# Ожидается: BaraDB v1.1.6 — Multimodal Database Engine ``` ## Запуск тестов @@ -259,7 +259,7 @@ db.close() ./build/baradadb # Ожидаемый вывод: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # Проверка через HTTP API diff --git a/docs/tr/installation.md b/docs/tr/installation.md index 9ea5be8..4c65084 100644 --- a/docs/tr/installation.md +++ b/docs/tr/installation.md @@ -143,7 +143,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# Beklenen: BaraDB v1.1.4 — Multimodal Database Engine +# Beklenen: BaraDB v1.1.6 — Multimodal Database Engine ``` ## Testleri Çalıştırma @@ -237,7 +237,7 @@ docker-compose up -d `.nimble` dosyanıza ekleyin: ```nim -requires "barabadb >= 1.1.4" +requires "barabadb >= 1.1.6" ``` Kodunuzda kullanın: @@ -258,7 +258,7 @@ db.close() ./build/baradadb # Beklenen çıktı: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # HTTP API ile test et diff --git a/docs/zh/configuration.md b/docs/zh/configuration.md index 442cece..f90db00 100644 --- a/docs/zh/configuration.md +++ b/docs/zh/configuration.md @@ -156,7 +156,7 @@ raft_peers = "node2:9001,node3:9001" ``` ``` -BaraDB v1.1.4 — Multimodal Database Engine +BaraDB v1.1.6 — Multimodal Database Engine Usage: baradadb [options] diff --git a/docs/zh/installation.md b/docs/zh/installation.md index 76e0e77..2ae02eb 100644 --- a/docs/zh/installation.md +++ b/docs/zh/installation.md @@ -144,7 +144,7 @@ strip build/baradadb ```bash ./build/baradadb --version -# 预期输出: BaraDB v1.1.4 — Multimodal Database Engine +# 预期输出: BaraDB v1.1.6 — Multimodal Database Engine ``` ## 运行测试 @@ -259,7 +259,7 @@ db.close() ./build/baradadb # 预期输出: -# BaraDB v1.1.4 — Multimodal Database Engine +# BaraDB v1.1.6 — Multimodal Database Engine # BaraDB TCP listening on 127.0.0.1:9472 # 使用 HTTP API 测试 diff --git a/formal-verification/README.md b/formal-verification/README.md index 4598d82..db2ba6c 100644 --- a/formal-verification/README.md +++ b/formal-verification/README.md @@ -21,7 +21,7 @@ This directory contains TLA+ specifications for core BaraDB distributed-systems - Java Runtime Environment (JRE) 8+ — the bundled `tla2tools.jar` contains TLC and SANY. - Or [TLA+ Toolbox](https://lamport.azurewebsites.net/tla/toolbox.html) (GUI + TLC model checker). -## Verified State Space (v1.1.4) +## Verified State Space (v1.1.6) | Spec | States Generated | Distinct States | Depth | |------|-----------------|-----------------|-------| diff --git a/formal-verification/run_all.sh b/formal-verification/run_all.sh index 1a7b42c..52d2a0d 100755 --- a/formal-verification/run_all.sh +++ b/formal-verification/run_all.sh @@ -22,7 +22,7 @@ run_tlc() { } echo "==============================================" -echo " BaraDB Formal Verification Suite v1.1.4" +echo " BaraDB Formal Verification Suite v1.1.6" echo " Running TLC model checker on all specs" echo "==============================================" echo "" diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index d7afd1e..0ba4a3f 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -29,7 +29,7 @@ docker run -d \ -e BARADB_PORT=9472 \ -e BARADB_DATA_DIR=/data \ -e BARADB_LOG_LEVEL=info \ - --health-cmd "wget -q --spider http://localhost:9470/health || exit 1" \ + --health-cmd "wget -q --spider http://localhost:9912/health || exit 1" \ --health-interval 15s \ --health-timeout 5s \ --health-retries 3 \ diff --git a/src/barabadb/cli/shell.nim b/src/barabadb/cli/shell.nim index 28e79be..447e934 100644 --- a/src/barabadb/cli/shell.nim +++ b/src/barabadb/cli/shell.nim @@ -5,7 +5,7 @@ import ../query/lexer import ../query/parser const - Version = "1.1.4" + Version = "1.1.6" Prompt = "bara> " ContinuationPrompt = " .. > " diff --git a/src/barabadb/core/httpserver.nim b/src/barabadb/core/httpserver.nim index c3c4f77..3a5e8fc 100644 --- a/src/barabadb/core/httpserver.nim +++ b/src/barabadb/core/httpserver.nim @@ -199,7 +199,7 @@ proc queryHandler(server: HttpServer): RequestHandler = proc healthHandler(): RequestHandler = return proc(request: Request) {.gcsafe.} = let ctx = newContext(request) - ctx.json(%*{"status": "ok", "version": "1.1.4"}) + ctx.json(%*{"status": "ok", "version": "1.1.6"}) proc metricsHandler(server: HttpServer): RequestHandler = return proc(request: Request) {.gcsafe.} = @@ -535,7 +535,7 @@ function showTab(idx){ } setInterval(() => { if(document.querySelectorAll('.panel')[4].classList.contains('active')) loadMetrics() }, 5000) -
BaraDB v1.1.4 — Multimodal Database Engine
+
BaraDB v1.1.6 — Multimodal Database Engine
""" request.respond(200, @[("Content-Type", "text/html; charset=utf-8")], html) diff --git a/src/barabadb/core/tracing.nim b/src/barabadb/core/tracing.nim index a8bcac0..324c1e0 100644 --- a/src/barabadb/core/tracing.nim +++ b/src/barabadb/core/tracing.nim @@ -116,7 +116,7 @@ proc exportOtlp*(tracer: Tracer, endpoint: string = "http://localhost:4318/v1/tr {"key": "service.name", "value": {"stringValue": "baradadb"}} ]}, "scopeSpans": [{ - "scope": {"name": "baradadb-tracer", "version": "1.1.4"}, + "scope": {"name": "baradadb-tracer", "version": "1.1.6"}, "spans": otlpSpans }] }] diff --git a/src/barabadb/mcp/server.nim b/src/barabadb/mcp/server.nim index 8bdf867..af08d1f 100644 --- a/src/barabadb/mcp/server.nim +++ b/src/barabadb/mcp/server.nim @@ -503,7 +503,7 @@ proc handleInitialize(params: JsonNode): JsonNode = "protocolVersion": "2024-11-05", "serverInfo": { "name": "BaraDB MCP Server", - "version": "1.1.4" + "version": "1.1.6" }, "capabilities": { "tools": {} @@ -690,7 +690,7 @@ proc processMessage(raw: string): string = # --------------------------------------------------------------------------- proc init*(dataDir: string = "./data"): McpServerCtx = - logToStderr("BaraDB MCP Server v1.1.4 initializing...") + logToStderr("BaraDB MCP Server v1.1.6 initializing...") let db = newLSMTree(dataDir) let ctx = newExecutionContext(db) ctx.txnManager = newTxnManager() diff --git a/src/barabadb/storage/bloom.nim b/src/barabadb/storage/bloom.nim index 0f2b038..b2c81f9 100644 --- a/src/barabadb/storage/bloom.nim +++ b/src/barabadb/storage/bloom.nim @@ -24,10 +24,10 @@ proc hash1*(bf: BloomFilter, data: openArray[byte]): uint64 = result = uint64(!$h) proc hash2*(bf: BloomFilter, data: openArray[byte]): uint64 = - var h: Hash = 5381 + var h: uint64 = 5381 for b in data: - h = ((h shl 5) + h) + Hash(b) - result = uint64(h) + h = ((h shl 5) + h) + uint64(b) + result = h proc getHashes(bf: BloomFilter, data: openArray[byte]): seq[int] = let h1 = bf.hash1(data) diff --git a/src/barabadb/storage/lsm.nim b/src/barabadb/storage/lsm.nim index fe523dd..ff98c2f 100644 --- a/src/barabadb/storage/lsm.nim +++ b/src/barabadb/storage/lsm.nim @@ -68,15 +68,17 @@ proc put*(mt: var MemTable, key: string, value: seq[byte], timestamp: uint64, de let entrySize = key.len + value.len + 16 if entrySize > mt.maxSize: return false - if mt.size + entrySize > mt.maxSize and mt.entries.len > 0: - return false let entry = Entry(key: key, value: value, timestamp: timestamp, deleted: deleted) let pos = mt.entries.lowerBound(entry, proc(a, b: Entry): int = cmp(a.key, b.key)) if pos < mt.entries.len and mt.entries[pos].key == key: + let oldSize = mt.entries[pos].key.len + mt.entries[pos].value.len + 16 mt.entries[pos] = entry + mt.size += entrySize - oldSize else: + if mt.size + entrySize > mt.maxSize and mt.entries.len > 0: + return false mt.entries.insert(entry, pos) - mt.size += entrySize + mt.size += entrySize return true proc get*(mt: MemTable, key: string): (bool, Entry) = diff --git a/src/baradadb.nim b/src/baradadb.nim index ac288d3..0ad6870 100644 --- a/src/baradadb.nim +++ b/src/baradadb.nim @@ -211,7 +211,7 @@ proc main() = # Init structured logger from config let logLvl = parseEnum[LogLevel]("ll" & capitalizeAscii(config.logLevel)) defaultLogger = newLogger(logLvl, config.logFile) - info("BaraDB v1.1.4 — Multimodal Database Engine") + info("BaraDB v1.1.6 — Multimodal Database Engine") # Security check: warn if JWT secret is not configured if config.jwtSecret.len == 0: diff --git a/tests/fuzz_test b/tests/fuzz_test deleted file mode 100755 index 4214575..0000000 Binary files a/tests/fuzz_test and /dev/null differ diff --git a/tests/fuzz_test.nim b/tests/fuzz_test.nim index c6ff50c..0f80878 100644 --- a/tests/fuzz_test.nim +++ b/tests/fuzz_test.nim @@ -4,6 +4,9 @@ import std/random import std/strutils import std/os import std/monotimes +import std/tables +import std/sets +import std/algorithm import barabadb/protocol/wire import barabadb/storage/lsm @@ -547,6 +550,7 @@ suite "Storage Fuzz": test "LSM delete removes key and get returns false": var rng = initRand(6002) let tmpDir = getTempDir() / "baradb_fuzz_lsm_del_" & $getCurrentProcessId() + removeDir(tmpDir) createDir(tmpDir) defer: removeDir(tmpDir) @@ -554,11 +558,14 @@ suite "Storage Fuzz": defer: db.close() var keys: seq[string] = @[] - for i in 0..<200: + var seen = initHashSet[string]() + while keys.len < 200: let k = randKey(rng, 1, 16) - let v = randValue(rng, 0, 64) - db.put(k, v) - keys.add(k) + if k notin seen: + seen.incl(k) + let v = randValue(rng, 0, 64) + db.put(k, v) + keys.add(k) # Delete half for i in 0..