Commit Graph

7 Commits

Author SHA1 Message Date
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 a6aeb7801b docs: обновен BUG_AUDIT.md — всички критични/високи/средни бъгове поправени 2026-05-12 23:31:51 +03:00
dimgigov 750746eb18 docs: обновен BUG_AUDIT.md със статус на всички поправки
- Отбелязани 28 поправени бъга ()
- Отбелязани 4 оставащи бъга ()
- Актуализиран план с 4 завършени спринта
- Актуализирани метрики
2026-05-12 23:24:01 +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