dimgigov
652ed1b477
feat: add ID generators, fix 6 forum-discovered deficiencies
...
ID Generators:
- AUTO_INCREMENT for INTEGER columns
- SERIAL / BIGSERIAL as syntactic sugar
- gen_random_uuid() / uuid() for UUID v4 generation
- nextval() / currval() for sequence support
- snowflake_id(node_id) for distributed 64-bit IDs
- RETURNING clause for INSERT
Deficiency Fixes:
- Comma join: FROM t1, t2 now works as implicit CROSS JOIN
- DEFAULT in restoreSchema: defaults survive server restart
- Duplicate column names: t.id instead of id in joins
- Empty result sets: always send column metadata to client
- GROUP BY non-agg columns: return first row value instead of empty
- Aggregate column names: count(*) instead of count()
Bug fix: PK uniqueness check now uses correct key format
2026-05-16 02:57:30 +03:00
dimgigov
406dcf4f4e
docs(ormin): clarify transaction and returning support
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- Top-level BEGIN/COMMIT/ROLLBACK work (server-side)
- SAVEPOINT (nested tx) does not work — BaraDB server limitation
- RETURNING parsed but ignored by BaraDB executor — server limitation
2026-05-15 22:56:45 +03:00
dimgigov
4ac147dc6c
Add Docker support for Ormin + BaraDB dev stack
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- docker-compose.ormin.yml: BaraDB + Ormin dev environment
- clients/nim/ormin/docker/Dockerfile: dev image with Nim 2.2.10
- clients/nim/ormin/docker/entrypoint.sh: auto-install deps
- docker-compose.test.yml: add Ormin compile test
2026-05-15 22:23:45 +03:00
dimgigov
4e54075078
Add Ormin ORM support for BaraDB (Nim client)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-15 21:49:08 +03:00
dimgigov
2e945c1dcb
release: bump version to 1.1.2 (forum-tested, nested SQL fixes)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-15 18:34:47 +03:00
dimgigov
2fbafb11bd
docs: add GitHub stars badge and thank you note
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
2026-05-15 18:30:10 +03:00
dimgigov
3453d3cae7
feat: add forum Nim client improvements and SQLite adaptor
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-15 18:12:01 +03:00
dimgigov
00e9ea7484
Merge branch 'main' of ssh://git.invoicing.top:222/baraba/Baradb
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-15 18:01:25 +03:00
dimgigov
c5751b4a0c
fix: clean up compiler warnings and unused variables
2026-05-15 18:01:11 +03:00
dimgigov
bf374b28f7
chore: ignore docker export tarballs
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
2026-05-15 17:46:53 +03:00
dimgigov
92e6b99df2
Merge pull request 'feat: subquery IN/NOT IN, datetime functions, scanAll refactor, INSERT/UPDATE eval improvements' ( #1 ) from master into main
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
Reviewed-on: #1
2026-05-15 14:35:06 +00:00
dimgigov
f8d466d8f3
feat: subquery IN/NOT IN, datetime functions, scanAll refactor, INSERT/UPDATE eval improvements
CI / test (pull_request) Has been cancelled
CI / verify (pull_request) Has been cancelled
Clients CI / build-server (pull_request) Has been cancelled
Clients CI / test-python (pull_request) Has been cancelled
Clients CI / test-javascript (pull_request) Has been cancelled
Clients CI / test-nim (pull_request) Has been cancelled
Clients CI / test-rust (pull_request) Has been cancelled
2026-05-15 17:33:54 +03:00
dimgigov
40616ad3c0
Update repository URLs from GitHub to Codeberg
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-15 12:11:00 +03:00
dimgigov
8c29e700c7
Revert "Update repository URLs from GitHub to Codeberg"
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
This reverts commit 956066631e .
2026-05-15 12:10:36 +03:00
dimgigov
956066631e
Update repository URLs from GitHub to Codeberg
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-15 12:03:11 +03:00
dimgigov
d11e99ab5a
ci(clients): install Python dev dependencies for pytest-asyncio
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-05-14 23:41:19 +03:00
dimgigov
359f945170
fix(clients): repair Python & Rust tests, add container test orchestration
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- Python: fix wire protocol test method names (bool_val -> bool, etc.)
- Python: make integration tests and example fully async with pytest-asyncio
- Rust: add tokio dev-dependency and convert integration tests to async/await
- Rust: update ping_test example to async
- Nim: remove committed ELF build artifact
- Docker: add BARADB_HOST/BARADB_PORT env vars to test containers
- Docker: fix docker-compose.test.yml usage (remove --abort-on-container-exit)
- Add scripts/test-clients.sh for sequential client test runs
- Remove docker-compose.test.yml from .gitignore so it is tracked
- Fix repository URLs in Python and Rust READMEs
2026-05-14 23:35:45 +03:00
dimgigov
c55d3080cf
Update documentation and clients for v1.1.0
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
Documentation updates:
- Fix v0.1.0 → v1.1.0 version numbers in en, ru, fa, zh docs
- Add missing Window Functions, Multi-Tenant ERP, Supported Keywords sections
to ru, fa, zh baraql.md (~105 lines each)
- Expand Turkish and Arabic baraql.md (110 → 268 lines)
- Expand Turkish and Arabic installation.md (62 → 307 lines)
- Add new Bulgarian documentation files (18 new files)
Client updates:
- Python: Full async/await rewrite with asyncio, request queueing
- Rust: Full async/await rewrite with tokio, async examples
- Nim: Update README to v1.1.0
- All clients now support async patterns consistently
2026-05-14 23:05:47 +03:00
dimgigov
f7d4961125
feat: Multi-tenant ERP support via session variables + RLS
...
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- SET var = value / current_setting('var') for session-scoped variables
- current_user / current_role SQL keywords with auth bridge
- server.nim + httpserver.nim populate ExecutionContext.currentUser/currentRole
- RLS policies can reference current_setting('app.tenant_id') for tenant isolation
- Fixed evalExpr to propagate ctx recursively (fixes current_user in sub-expressions)
- Fixed GROUPING SETS execution (lowerSelect checks selGroupingSetsKind)
- Fixed FTS CREATE INDEX docId mismatch (hash of tableName.$key)
- Fixed all test suites to use isolated temp directories
- Added 5 multi-tenant tests (355 total, all green)
- Updated docs: PLAN_SQL_ADVANCED.md, baraql.md, changelog.md
2026-05-14 16:28:41 +03:00
dimgigov
b0978812cb
docs(en): Update English docs for Vector SQL Integration
...
- docs/en/vector.md — add SQL usage section (CREATE TABLE VECTOR,
distance functions, <-> operator, CREATE INDEX USING hnsw)
- docs/en/baraql.md — update vector search section with real SQL syntax,
add VECTOR(n) to data types, update keyword table
- docs/en/changelog.md — add Vector SQL Integration and bugfixes to [Unreleased]
- docs/ARCHITECTURE.md — add SQL Integration bullet to Vector Engine
- README.md — update vector engine section with SQL examples,
add Vector SQL to roadmap, bump test count to 340+
2026-05-14 14:20:57 +03:00
dimgigov
d076cfde3b
feat(sql): Vector SQL Integration + test isolation fixes
...
- Add VECTOR(n) column type support in CREATE TABLE
- Add CREATE INDEX ... USING hnsw/ivfpq for vector indexes
- Add cosine_distance(), euclidean_distance(), inner_product(), l1/l2_distance()
SQL functions in expression evaluator
- Add <-> nearest-neighbor operator
- Fix ORDER BY with non-projected columns (move irpkSort before irpkProject)
- Fix execInsert to escape comma-containing values (vector literals)
- Fix MERGE tests by using unique temp dirs per test suite
- Add 8 Vector SQL Integration tests (all passing)
- Update PLAN_SQL_ADVANCED.md
2026-05-14 14:14:13 +03:00
dimgigov
96dfaaecb1
feat(sql): Advanced SQL — LATERAL, GROUP BY/HAVING, FILTER, aggregates, PIVOT, SQL/PGQ
...
- LATERAL JOIN: correlated subquery strategy (scan + merge + filter/sort/limit)
- GROUP BY: SUM/AVG/MIN/MAX evaluation inside groups, HAVING filter
- FILTER (WHERE ...): conditional aggregates for COUNT/SUM/AVG
- ARRAY_AGG / STRING_AGG: multi-argument aggregate functions
- GROUPING SETS / ROLLUP / CUBE: powerset generation for multi-level aggregation
- PIVOT / UNPIVOT: row-to-column and column-to-row transformation
- SQL/PGQ Property Graph: GRAPH_TABLE MATCH parser + executor skeleton
- 330 tests passing, all 4 modalities (SQL/JSON/Vector/Graph) integrated
2026-05-14 13:14:10 +03:00
dimgigov
e2a526df6f
feat(sql): Window Functions + MERGE statement + REST bridge plan
...
- Add Window Functions: ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG,
FIRST_VALUE, LAST_VALUE, NTILE with PARTITION BY, ORDER BY,
ROWS/RANGE frame specifications
- Add MERGE/UPSERT statement with WHEN MATCHED UPDATE and
WHEN NOT MATCHED INSERT
- Add SQL/PGQ Property Graph long-term plan in PLAN_SQL_ADVANCED.md
- Add 7 new tests for Window Functions and MERGE
- Update baraql.md documentation
2026-05-14 11:02:09 +03:00
dimgigov
18f3c16b2a
Fix/nodebara compatibility ( #2 )
2026-05-14 02:33:46 +03:00
dimgigov
71dcffecce
fix(gossip): use async UDP socket to avoid blocking the event loop
...
The gossip listener used synchronous newSocket + recvFrom,
which blocks the async event loop and prevents other async
operations from running while waiting for UDP packets.
Switch to newAsyncSocket + async recvFrom so the loop can
continue processing other tasks between gossip rounds.
2026-05-14 02:22:07 +03:00
dimgigov
398769ff97
feat(client): add TCP request queue for safe concurrency
...
The previous implementation allowed multiple concurrent async calls
(query, execute, ping) to interleave writes on the same socket,
which corrupted the binary protocol framing when NodeBB fired
parallel database operations.
Add an internal _requestQueue and _requestLock so that all TCP
requests are serialized: each async operation enqueues a task,
and tasks are drained one at a time via setImmediate().
2026-05-14 02:22:07 +03:00
dimgigov
8fb5dde858
fix(protocol): serialize float32/float64/fkVector in big-endian
...
The JavaScript client reads floats via readFloatBE/readDoubleBE,
which expect IEEE-754 values in big-endian byte order.
The Nim server was writing them with copyMem in native byte order,
so on little-endian machines (x86_64) the JS side deserialized
FLOAT64 values as garbage (e.g. 1.0 became 3.03865e-319).
Fix serialization by casting to int32/int64 and using bigEndian32/
bigEndian64, mirroring the existing big-endian handling for ints.
Apply the same fix to deserialization and to fkVector elements.
2026-05-14 02:22:07 +03:00
dimgigov
a0d2ca7776
Merge release/v1.1.0 into main
2026-05-13 15:07:44 +03:00
dimgigov
4e7e568525
release: v1.1.0 — bug fixes, Docker, clients, SCRAM auth
...
- Bump version to 1.1.0 across all components
- Remove debug CI artifacts (debug.yml, test_all.nim.bak, test_lock)
- Update CHANGELOG with v1.1.0 release notes
- Bug fixes: irNeg, distributed txn, sharding, Raft majority, MVCC,
LSM-Tree, auth (JWT + SCRAM-SHA-256), wire protocol, SQL injection,
ReDoS, graph, vector, FTS, build warnings
- Client SDKs: JS/TS, Python, Nim, Rust with tests and examples
- Docker: production + source + test compose configs
- TLA+: crossmodal, backup, recovery specs with symmetry reduction
2026-05-13 15:05:59 +03:00
dimgigov
6665ee7e0a
fix: irNeg (unary minus) evaluation in query executor
...
- Added missing irNeg case in evalExpr (query/executor.nim)
- Unary minus previously fell through to else: return 'false'
- Added 2 tests: SELECT expression and WHERE condition
2026-05-13 14:23:28 +03:00
dimgigov
42c675224c
fix: distributed transaction and sharding bugs
...
- disttxn: rollback now correctly updates participant state (was modifying a copy)
- disttxn: bare except replaced with CatchableError
- sharding: migrateData condition was always false, now correctly migrates data
- sharding: unsafe cast[string] replaced with manual byte-to-char conversion
- sharding: bare except replaced with CatchableError
- server: parseUInt replaced with parseBiggestUint for uint64 portability
2026-05-13 14:01:13 +03:00
dimgigov
45849cbe5c
fix(tests): use less common ports 29001-29003 in Raft network transport test
2026-05-13 13:53:07 +03:00
dimgigov
ac84474789
debug(ci): keep only Enhanced Migrations onwards in test_all.nim
2026-05-13 13:50:03 +03:00
dimgigov
92af288d06
debug(ci): keep only Row-Level Security onwards in test_all.nim
2026-05-13 13:46:54 +03:00
dimgigov
baf2b1a504
debug(ci): keep only TLS/SSL onwards in test_all.nim
2026-05-13 13:43:46 +03:00
dimgigov
8d600a6f23
debug(ci): keep only last quarter of test_all.nim
2026-05-13 13:40:38 +03:00
dimgigov
ca87acb120
debug(ci): comment out first half of test_all.nim
2026-05-13 13:36:58 +03:00
dimgigov
d84033984a
debug(ci): keep only second half of test_all.nim
2026-05-13 13:34:05 +03:00
dimgigov
1923aa225b
debug(ci): truncate test_all.nim to first half of suites
2026-05-13 13:31:15 +03:00
dimgigov
9777b73e7c
fix(tests): add missing import std/tables in join_tests.nim
2026-05-13 13:27:34 +03:00
dimgigov
ab2522657f
debug(ci): add lock/lsm test to isolate failure
2026-05-13 13:22:06 +03:00
dimgigov
adf5937198
debug(ci): add timeout to join_tests
2026-05-13 13:10:39 +03:00
dimgigov
113d7faafa
debug(ci): run join_tests and tla_faithfulness separately
2026-05-13 13:07:32 +03:00
dimgigov
15a905bdd1
debug(ci): emit notice with 0x0.st URL for test_all.log
2026-05-13 13:02:14 +03:00
dimgigov
14791d8be6
debug(ci): remove || true mask from test_all run
2026-05-13 12:59:26 +03:00
dimgigov
dbe92fab9d
debug(ci): always upload test_all.log to branch
2026-05-13 12:55:48 +03:00
dimgigov
d9835fe696
debug(ci): remove || echo mask from test_all binary run
2026-05-13 12:52:25 +03:00
dimgigov
1111fbf359
debug(ci): upload logs to new branch on failure
2026-05-13 12:48:05 +03:00
dimgigov
1ed9f90852
debug(ci): add nim version check step before minimal test
2026-05-13 12:40:31 +03:00
dimgigov
dea4870d87
debug(ci): try iffy/install-nim instead of jiro4989/setup-nim-action
2026-05-13 12:38:17 +03:00
dimgigov
2926701f8c
fix(ci): explicitly install openssl and ca-certificates in all workflows
2026-05-13 12:35:43 +03:00
dimgigov
fb2bd1769d
debug(ci): remove -d:ssl from minimal test to isolate issue
2026-05-13 12:33:15 +03:00
dimgigov
cde443679e
debug(ci): simplify debug workflow to isolate failure
2026-05-13 12:29:39 +03:00
dimgigov
e0037ae817
debug(ci): add debug workflow to isolate test failure
2026-05-13 12:23:50 +03:00
dimgigov
aaa4f37c77
debug(ci): post test log as commit comment on failure
2026-05-13 12:16:56 +03:00
dimgigov
25ba9911b7
debug(ci): emit notice annotation with 0x0.st URL
2026-05-13 12:11:52 +03:00
dimgigov
8e56ff721c
debug(ci): upload test log to 0x0.st on failure
2026-05-13 12:11:28 +03:00
dimgigov
942910fae5
debug(ci): print nim version, nimble packages, system info
2026-05-13 12:05:49 +03:00
dimgigov
f50cbd1555
debug(ci): upload test_output.log as artifact on failure
2026-05-13 12:04:59 +03:00
dimgigov
6978097768
debug(ci): capture test output to log for debugging GitHub Actions failure
2026-05-13 12:02:01 +03:00
dimgigov
f6781c107e
fix(ci): add --threads:on to all nim c commands
...
Commit 6aaabb5 added std/locks usage in vector/engine.nim (HNSW thread-safety).
std/locks requires --threads:on. Local builds worked because /etc/nim/nim.cfg
had threads:on, but GitHub Actions runners (setup-nim-action) compile without
threads by default, causing the test job to fail silently at runtime.
Also updated baradadb.nimble tasks for consistency.
Fixes GitHub Actions CI failure on test / clients-ci workflows.
2026-05-13 11:57:09 +03:00
dimgigov
c0bd3dff86
feat: distributed gaps filled — gossip UDP transport, sharding data migration, inter-module wiring (raft-disttxn, gossip-sharding, replication-disttxn)
2026-05-13 11:11:53 +03:00
dimgigov
2a8d2a6cb4
docs: update PLAN.md and BUG_AUDIT.md for v1.0.0 release
...
- Final metrics: 294 tests, 10 TLA+ specs, 32 bugs fixed
- Mark all critical/high/medium/config bugs as resolved
- Document SCRAM-SHA-256, crossmodal.tla, symmetry reduction
- List remaining post-v1.0.0 non-critical tasks
2026-05-13 09:54:00 +03:00
dimgigov
ac55237b72
feat: real SCRAM-SHA-256 authentication (Option C)
...
Security:
- New scram.nim module with full SCRAM-SHA-256 per RFC 7677
* PBKDF2-HMAC-SHA-256 key derivation
* HMAC-SHA-256 with multiple overloads for bytes/strings
* Secure nonce/salt generation via /dev/urandom
* Client/server message parsing and proof verification
AuthManager updates:
- registerScramUser(): stores salted credentials (salt + iterations + storedKey + serverKey)
- startScram(): initiates challenge-response handshake
- finishScram(): verifies client proof and returns server signature
- Legacy amSCRAMSHA256 path kept for backward compatibility
HTTP endpoints:
- POST /auth/scram/start — accepts client-first-message, returns server-first
- POST /auth/scram/finish — accepts client-final-message, returns server-final
Tests:
- SCRAM-SHA-256 full handshake test (register → start → compute proof → finish)
- SCRAM-SHA-256 invalid proof rejection test
Build: 0 warnings, all tests pass
2026-05-13 09:50:07 +03:00
dimgigov
422df08ab9
feat: clean build + crossmodal.tla + TLA+ symmetry (v1.0.0-prep)
...
Build warnings cleanup (0 warnings):
- Suppress threadpool deprecation warning (baradadb.nim)
- Remove unused 'os' import (logging.nim)
- Fix ImplicitDefaultValue for newNode params (ast.nim)
- Add explicit cstring cast for posix.open (wal.nim)
- Fix HoleEnumConv for MsgKind parsing (server.nim)
TLA+ Formal Verification:
- Add symmetry reduction (Permutations) to all 9 existing specs
- Add SYMMETRY directive to all .cfg files
- New crossmodal.tla: cross-modal consistency spec
* MetadataVectorConsistency, HybridResultValid
* CommittedAtomicity, AbortedAtomicity, TxnStateValid
- New models/crossmodal.cfg
Tests:
- Add Cross-Modal TLA+ Faithfulness tests (4 tests)
Docs:
- Update PLAN.md and BUG_AUDIT.md with completed tasks
2026-05-13 09:24:04 +03:00
dimgigov
d08de7a062
Update BUG_AUDIT.md and PLAN.md: mark all bugs fixed, add session 6-7, plan for tomorrow
...
- BUG_AUDIT.md: 34 bugs documented (32 fixed + 2 auth hardening), all metrics green
- PLAN.md: backup.tla and recovery.tla marked complete, 3 options for tomorrow
- Option A: Clean build (warnings + symmetry reduction)
- Option B: crossmodal.tla
- Option C: True SCRAM-SHA-256
- Cleared 26GB of TLC state files from formal-verification/states/
2026-05-13 00:17:06 +03:00
dimgigov
c0596d6ba1
Update PLAN.md: mark backup.tla and recovery.tla as completed
2026-05-13 00:12:15 +03:00
dimgigov
32b38675a9
Add TLA+ formal verification specs for backup and recovery
...
- backup.tla: models backup/restore/verify/cleanup with properties:
BackupSnapshotsValid, RestoreIntegrity, VerifyIntegrity,
RetentionInvariant, HistoryConsistency, BackupIdValid
- recovery.tla: models WAL replay REDO/UNDO with properties:
RedoCommitted, RecoveryCompleteness, WalIntegrity
- Added models/backup.cfg and models/recovery.cfg with bounded constants
- Updated run_all.sh to include both new specs
- All 9 TLA+ specs pass TLC model checking
2026-05-13 00:06:45 +03:00
dimgigov
5e27a987dd
fix: auth token expiration + constant-time JWT signature comparison
...
- createToken() добавя exp/iat/nbf в JWT payload
- verifyToken() parse-ва exp/iat/nbf и проверява expiration
- verifyToken() използва constantTimeCompare() за timing-attack resistance
- Добавен import std/times
292 теста, 0 failure-а.
2026-05-12 23:36:17 +03:00
dimgigov
a6aeb7801b
docs: обновен BUG_AUDIT.md — всички критични/високи/средни бъгове поправени
2026-05-12 23:31:51 +03:00
dimgigov
a72e17f063
fix: последните 4 критични/средни бъга — LSM-Tree, MVCC, DistTxn, Raft
...
Поправени проблеми:
- LSM-Tree: WAL write вече е извън db.lock (отделен walLock) → по-добра concurrency
- MVCC: добавен compactVersions() който се изпълнява на всеки 100 commits
Премахва стари overwritten версии, които не са видими за active транзакции
- DistTxn: commit() вече НЕ rollback-ва commit-нали participants
Ако някой participant е commit-нал, транзакцията се маркира като committed
- Raft: добавен disk persistence за currentTerm, votedFor, log
saveState() при всяка промяна; loadState() при стартиране
292 теста, 0 failure-а.
2026-05-12 23:30:58 +03:00
dimgigov
750746eb18
docs: обновен BUG_AUDIT.md със статус на всички поправки
...
- Отбелязани 28 поправени бъга (✅ )
- Отбелязани 4 оставащи бъга (❌ )
- Актуализиран план с 4 завършени спринта
- Актуализирани метрики
2026-05-12 23:24:01 +03:00
dimgigov
5e585dd347
fix: deadlock detector, graph/query/lexer бъгове
...
Поправени проблеми:
- Deadlock detector: cycle reconstruction вече проверява пълен цикъл
- Graph cypher: executeCypher acquire-ва lock при четене
- Graph engine: loadFromFile acquire-ва lock при зареждане
- Graph engine: lock поле е exported за външен достъп
- Query: parseRowData поддържа escape-ване на , и = в стойности
- Query: execUpdateRow escape-ва стойности при сериализация
- Lexer: readNumber спира при втора точка (1.2.3 вече не е валиден float)
- Lexer: skipBlockComment хвърля ValueError при незатворен коментар
292 теста, 0 failure-а.
2026-05-12 23:21:29 +03:00
dimgigov
80d57a36bd
fix: rate limiter, graph/vector/query/server бъгове
...
Поправени проблеми:
- Rate limiter: globalRate вече се enforce-ва; cleanupStaleClients() за memory leak
- Graph engine: addEdge проверява дали src/dst nodes съществуват
- Vector engine: distance() хвърля ValueError при dimension mismatch
- Query: aggregate + * на empty result вече не crash-ва
- Query: exprToSql funcCall вече работи с 0 аргумента
- Query: INSERT trigger вече не crash-ва при празни VALUES
- Server: recvWithTimeout() за всички network reads
- Server: защита от negative activeConnections
292 теста, 0 failure-а.
2026-05-12 23:15:09 +03:00
dimgigov
6aaabb518d
fix: високо и средно приоритетни бъгове в query, protocol, storage, vector, fts
...
Поправени проблеми:
- Wire protocol: bounds checking, max length limits, recursion depth limit
- SQL injection: escape-ване на quotes в exprToSql string literals
- ReDoS: escape-ване на regex metachars в LIKE/ILIKE
- Stale BTree indexes: добавен BTree.remove() + изтриване при UPDATE/DELETE
- SSL: quoteShell за всички shell команди с пътища
- Boolean literals: parser вече разпознава tkTrue/tkFalse
- Unary minus: lowerExpr map-ва ukNeg към irNeg (вместо irNot)
- Non-aggregate UDFs: lowerExpr създава irekFuncCall вместо NULL literal
- UTF-8 FTS: tokenize използва runes вместо байтове
- HNSW: добавен Lock за thread-safe insert/search
292 теста, 0 failure-а.
2026-05-12 23:02:54 +03:00
dimgigov
131541a0e5
fix: критични бъгове в storage, MVCC, auth, Raft, query executor
...
Поправени проблеми:
- MVCC: aborted транзакции вече не стават видими (добавено abortedTxns множество)
- LSM-Tree: поправена загуба на данни при immutable memtable overwrite
- LSM-Tree: поправена SSTable search order (сортиране по id вместо minKey)
- WAL: sync()/close() вече извикват posix.fsync()
- Auth: simpleHash (djb2) заменен с HMAC-SHA256
- Recovery: summary() вече не мутира базата данни
- Raft: поправена majority calculation за четен брой нодове
- Query: EXISTS subqueries вече изпълняват подзаявката
- Nimble: поправен build (-d:ssl) и bench task
Добавен BUG_AUDIT.md с пълен доклад и план за подобрения.
292 теста, 0 failure-а.
2026-05-12 22:45:50 +03:00
dimgigov
3396ba4d63
Remove nimbling directory
2026-05-08 09:44:49 +03:00
dimgigov
fecb52dca8
Remove reddit_post_draft.md
2026-05-08 01:32:47 +03:00
dimgigov
c4b374e1db
Initial commit
2026-05-08 01:13:54 +03:00
dimgigov
8f4299614d
ci(clients): use docker healthcheck instead of nc
2026-05-08 00:38:19 +03:00
dimgigov
33194937db
ci(clients): fix rust setup and nim server wait
2026-05-08 00:25:57 +03:00
dimgigov
13c2e94fb1
ci(clients): build Nim binaries in CI before Docker image
2026-05-08 00:21:31 +03:00
dimgigov
ae2e07e626
feat(clients): professional clients with tests, CI/CD, and examples
...
- Python: pyproject.toml, pytest suite (unit + integration), README, examples
- JavaScript: package.json, TypeScript definitions, node:test suite, README, examples
- Nim: integration tests, examples, README, improved nimble tasks
- Rust: fixed nodelay/localhost IPv6 bug, integration tests, examples, README
- Added GitHub Actions CI for all 4 clients against Docker server
- Added docker-compose.test.yml for local integration testing
- Added .gitignore for each client
2026-05-08 00:18:34 +03:00
dimgigov
e9d3c7e9de
docs: add multi-language documentation (ru, fa, zh, tr, ar)
2026-05-07 23:42:55 +03:00
dimgigov
abb382c419
feat(clients): sync all client drivers with current wire protocol
...
- Python: fix column types read order, add auth/ping/query_params, proper recv
- JavaScript: wire up real TCP socket, add auth/ping/query_params, WireValue class
- Rust: add WireValue enum with structured types, fix type fidelity for ARRAY/OBJECT/VECTOR, add auth/query_params, fix ping/error parsing
- Nim: add missing MsgKind values, makeQueryParamsMessage, auth/ping, fix forward decl
All clients now support AUTH (0x09), QUERY_PARAMS (0x03), PING (0x08)
and align with server.nim + wire.nim protocol definitions.
2026-05-07 22:38:09 +03:00
dimgigov
09247ffcad
docs: add version badge at the top of README
2026-05-07 22:18:26 +03:00
dimgigov
8d39d633cf
chore: update version strings to v1.0.0 in Docker and Nim code
...
- Dockerfile, Dockerfile.source: LABEL version=1.0.0
- Dockerfile.source: update Nim base image 2.2.2 -> 2.2.10
- src/baradadb.nim, src/barabadb/core/httpserver.nim: v0.1.0 -> v1.0.0
- Rebuild baradadb binary with v1.0.0
2026-05-07 22:06:04 +03:00
dimgigov
157775794d
Release v1.0.0
...
- 7 TLA+ specs formally verified (~69M states, 0 errors)
- 283+ Nim tests, all passing
- Raft: leader election + log replication + step-down on partition
- 2PC: coordinator crash/recovery + participant timeout
- MVCC: snapshot isolation + write skew detection
- Gossip: SWIM-like membership with strength-based gossip
- Replication: async/sync/semi-sync LSN tracking
- Sharding: consistent hashing with virtual nodes
- Deadlock detection: cycle detection in wait-for graph
- TLA+ faithfulness tests bridging specs to Nim code
- CI: GitHub Actions with automated TLC verification
2026-05-07 22:01:43 +03:00
dimgigov
8f87491eca
FV-14: TLA+ faithfulness tests for Nim state machines
...
Add tests/tla_faithfulness.nim verifying Nim code against TLA+ invariants:
- Raft: ElectionSafety, LogMatching, CommittedIndexValid
- MVCC: NoDirtyReads, CommittedMustStart
- 2PC: Atomicity, RecoveryConsistency
Documented gap: Nim MVCC allows multiple committed versions per key,
while TLA+ spec enforces first-committer-wins (WriteWriteConflict).
This test ensures future changes to Nim code maintain alignment with specs.
Update PLAN.md (FV-14 done), CHANGELOG.md, test_all.nim includes new suite.
2026-05-07 21:59:06 +03:00
dimgigov
4791434cea
FV-2: Raft leader step-down on partition loss
...
- Add heartbeatReceived variable tracking last term with heartbeat
- Add Heartbeat action: leader sends keep-alive; recipient steps down on higher term
- Add HeartbeatTimeout: follower starts election if no heartbeat in current term
- Add LeaderLeaseExpired: leader steps down if it loses quorum connectivity
- Add LeaderHasSelfHeartbeat invariant: every leader must have valid heartbeat
- raft.tla now models realistic partition behavior (38M states verified)
- Update CHANGELOG -> v1.2.0, VERSION -> 1.2.0, PLAN.md, README.md
2026-05-07 21:48:03 +03:00
dimgigov
181e7d7019
docs: update README with FV v1.1.0 stats and all 7 specs
2026-05-07 21:22:06 +03:00
dimgigov
f9e5169c3d
FV-6: Liveness properties + fairness constraints
...
- mvcc.tla: Add CommitProgress liveness (verified with WF_vars)
- raft/twopc/mvcc/gossip: Add Spec definitions with WF_vars(Next)
- gossip.tla: Fix LearnViaGossip strength-based filtering
(prevents overwriting Dead/Suspect with weaker state)
- twopc.tla: Add DecideCommitAction/DecideAbortAction for SF fairness
- Update all .cfg files to use SPECIFICATION Spec
- Update CHANGELOG.md -> v1.1.0, VERSION -> 1.1.0, PLAN.md
2026-05-07 21:21:22 +03:00
dimgigov
112ed4764d
FV-7: MVCC write skew detection
...
- mvcc.tla: Add NoWriteSkew invariant
- mvcc.tla: CommitTxn checks for circular read-write dependencies
- models/mvcc.cfg: Add NoWriteSkew to checked invariants
- Update PLAN.md, ANALYSIS.md, README.md
2026-05-07 19:43:58 +03:00
dimgigov
39e07b542d
FV-3, FV-4: 2PC coordinator crash/recovery + participant timeout
...
- twopc.tla: Add coordinatorLog (persistent WAL for decisions)
- twopc.tla: Add CrashCoordinator action
- twopc.tla: Add RecoverCoordinator action (reads from coordinatorLog)
- twopc.tla: Add ParticipantTimeout (only if coordinatorLog = Nil)
- twopc.tla: Add RecoveryConsistency invariant
- models/twopc.cfg: Add RecoveryConsistency to checked invariants
- Update PLAN.md, ANALYSIS.md, README.md with new metrics
2026-05-07 19:40:09 +03:00
dimgigov
54711d0190
FV-1, FV-13: Raft prevLogIndex/prevLogTerm + CI fix
...
- raft.tla: Add HasCompatiblePrefix check (prevLogIndex/prevLogTerm)
- raft.tla: Add RejectAppendEntries action for follower rejection
- raft.tla: Add conflict truncation + commitIndex/matchIndex adjustment
- raft.tla: Restore LogMatching invariant
- raft.tla: Guard AppendEntry to prevent term gaps in leader log
- models/raft.cfg: Add LogMatching to checked invariants
- .github/workflows/ci.yml: Replace container with setup-java + cache
- run_all.sh: Use -workers auto and -XX:+UseParallelGC
- Update PLAN.md, PLAN_DONE.md, ANALYSIS.md, README.md
2026-05-07 19:21:01 +03:00
dimgigov
ce3b078979
docs: unified improvement plan for verification + software (53 tasks)
...
Covers both TLA+ specs and Nim code:
- P1: Raft prevLogIndex/LogMatching, replication data transfer,
sharding migration (14 tasks)
- P2: backup.tla, crossmodal.tla, recovery.tla + Nim tests (14 tasks)
- P3: Liveness properties, write skew, 2PC crash recovery (12 tasks)
- P4: CI fixes, symmetry reduction, missing tests, inter-module
integration (13 tasks)
Ties verification improvements directly to code improvements.
2026-05-07 18:39:59 +03:00
dimgigov
e715454c4e
docs(verify): add detailed improvement plan with 13 tasks across 4 priorities
...
Covers Raft prevLogIndex fix, 2PC recovery, MVCC write skew,
liveness properties, backup.tla, crossmodal.tla, CI fixes,
symmetry reduction, and Apalache migration.
2026-05-07 18:31:20 +03:00
dimgigov
19d0ff7366
feat(verify): expand formal verification to 7 specs, add versioning, CI integration
...
Added 3 new TLA+ specs:
- gossip.tla — SWIM gossip membership & failure detection
- deadlock.tla — wait-for graph deadlock detection
- sharding.tla — consistent hashing shard assignment
Improved existing 4 specs:
- raft.tla: added CommittedIndexValid invariant
- twopc.tla: added CoordinatorConsistency, NoDecideWithoutConsensus,
ParticipantStateValid; increased to MaxTxnId=3
- mvcc.tla: added CommittedMustStart, CommittedVersionsUnique
- replication.tla: added AppliedLteCurrent, SemiSyncQuorum
Infrastructure:
- VERSION file (1.0.0)
- CHANGELOG.md
- ANALYSIS.md (weak spots & improvement plan)
- run_all.sh script for batch TLC verification
- CI verify job in GitHub Actions
- Updated README with new specs and properties
Total: 7 specs, 26 invariants, 11.6M states checked, 0 errors
2026-05-07 18:26:55 +03:00
dimgigov
215df1cdf3
docs: update README and all docs with formal verification, new BaraQL features, OpenTelemetry tracing
...
- Add Formal Verification section to README and architecture docs
- Document TLA+ specs for Raft, 2PC, MVCC, Replication
- Add new BaraQL features: JSON path (->, ->>), FTS @@, CREATE INDEX USING FTS,
RECOVER TO TIMESTAMP, UNION/INTERSECT/EXCEPT
- Add OpenTelemetry tracing example to README
- Update Quick Start to use nimble test/bench
- Update EN and BG documentation
2026-05-07 16:06:13 +03:00
dimgigov
e73bfb450c
feat: formal verification suite — TLA+ specs for Raft, 2PC, MVCC, Replication
...
Verified with TLC model checker:
- Raft: 475k states, ElectionSafety + StateMachineSafety
- 2PC: 22k states, Atomicity + NoOrphanBlocks
- MVCC: 177k states, NoDirtyReads + ReadOwnWrites + WriteWriteConflict
- Replication: 3.6M states, MonotonicLsn + AcksRemovePending
2026-05-07 15:57:33 +03:00