nedb-engine 2.8.5 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,65 +1,21 @@
1
- Business Source License 1.1
2
-
3
- Licensor: Interchained LLC, VibeCode 101, and/or the applicable copyright holders of NEDB
4
-
5
- Licensed Work: NEDB, including all source code, documentation, examples, tests, build scripts, specifications, APIs, SDKs, packages, binaries, and derivative works distributed from or based on the NEDB repository.
6
-
7
- Copyright: Copyright (c) 2026 Interchained LLC, VibeCode 101, and contributors. All rights reserved.
8
-
9
- Change Date: Four years after the first publicly available distribution of each specific version of the Licensed Work under this License.
10
-
11
- Change License: GNU Affero General Public License v3.0 or later.
12
-
13
- Additional Use Grant:
14
-
15
- You may use the Licensed Work only for non-production purposes, including evaluation, development, testing, research, local experimentation, security review, benchmarking, and personal learning.
16
-
17
- No production use is granted automatically.
18
-
19
- For clarity, the following uses are not permitted unless you have prior written permission from the Licensor:
20
-
21
- 1. Using the Licensed Work in production.
22
- 2. Using the Licensed Work to store, process, serve, index, replicate, query, or manage production data.
23
- 3. Offering the Licensed Work, or any derivative work, as a hosted, managed, embedded, bundled, white-labeled, commercial, paid, revenue-generating, or customer-facing product or service.
24
- 4. Offering database-as-a-service, storage-as-a-service, cache-as-a-service, search-as-a-service, analytics-as-a-service, AI-memory-as-a-service, agent-memory-as-a-service, blockchain-indexing-as-a-service, or any substantially similar service using the Licensed Work.
25
- 5. Using the Licensed Work to compete with NEDB, Interchained LLC, VibeCode 101, AiAssist Secure, or any affiliated product, service, infrastructure platform, database engine, AI runtime, agent platform, or hosted developer infrastructure.
26
- 6. Embedding the Licensed Work into commercial software, SaaS products, internal business systems, enterprise systems, hosted infrastructure, blockchain infrastructure, AI-agent infrastructure, or customer deliverables.
27
- 7. Removing, hiding, modifying, or misrepresenting this License, copyright notices, attribution notices, authorship notices, repository references, or licensing notices.
28
- 8. Circumventing license checks, access controls, paid licensing requirements, commercial-use restrictions, attribution requirements, or technical protections included with the Licensed Work.
29
- 9. Using the Licensed Work in a way that implies endorsement, partnership, sponsorship, certification, or approval by the Licensor without written permission.
30
- 10. Reselling, relicensing, sublicensing, renting, leasing, or otherwise commercially exploiting the Licensed Work except as expressly authorized in writing.
31
-
32
- Additional production, commercial, hosted, enterprise, embedded, OEM, resale, white-label, managed-service, competitive, or otherwise restricted use grants are available only by separate written permission from the Licensor.
33
-
34
- Written permission must be obtained from at least one of the following authorized licensing contacts:
35
-
36
- [founders@vibecode-101.com](mailto:founders@vibecode-101.com)
37
- [dev@interchained.org](mailto:dev@interchained.org)
38
-
39
- Permission is valid only if it is expressly granted in writing by an authorized representative of the Licensor and specifically identifies the permitted use, scope, duration, parties, and any applicable commercial terms.
40
-
41
- A general email conversation, informal message, pull request, issue comment, social media message, verbal discussion, repository access, package download, or contribution acceptance does not create a production, commercial, hosted, enterprise, resale, or competitive use license.
42
-
43
- Terms:
44
-
45
- The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
46
-
47
- Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
48
-
49
- If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase or obtain a separate commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
50
-
51
- All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work, and the Change Date may vary for each version of the Licensed Work released by Licensor.
52
-
53
- You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
54
-
55
- Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
56
-
57
- This License does not grant you any right in any trademark, service mark, trade name, logo, domain name, brand identity, product name, project name, or other identifier of Licensor or its affiliates, except as expressly required to preserve legally required notices.
58
-
59
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, TITLE, SECURITY, ACCURACY, AVAILABILITY, DATA INTEGRITY, PERFORMANCE, AND FITNESS FOR PRODUCTION USE.
60
-
61
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR SHALL NOT BE LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, COSTS, EXPENSES, BUSINESS INTERRUPTION, LOST PROFITS, LOST REVENUE, LOST DATA, SECURITY INCIDENTS, SERVICE OUTAGES, OR OTHER LIABILITY ARISING FROM OR RELATED TO THE LICENSED WORK OR YOUR USE OF THE LICENSED WORK.
62
-
63
- Notice:
64
-
65
- The Business Source License is not an Open Source license. However, each version of the Licensed Work will become available under the Change License on the applicable Change Date, or on the fourth anniversary of the first publicly available distribution of that version under this License, whichever comes first.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Interchained LLC and VibeCode 101
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -13,13 +13,96 @@ One Rust core → ships to **PyPI** and **npm** from a single source.
13
13
  [![CI](https://img.shields.io/github/actions/workflow/status/Eth-Interchained/nedb/release.yml?label=CI&color=34d399)](https://github.com/Eth-Interchained/nedb/actions)
14
14
  [![nedb-engine-client PyPI](https://img.shields.io/pypi/v/nedb-engine-client?label=nedb-engine-client&color=34d399)](https://pypi.org/project/nedb-engine-client/)
15
15
  [![nedb-engine-client npm](https://img.shields.io/npm/v/nedb-engine-client?label=nedb-engine-client&color=34d399)](https://www.npmjs.com/package/nedb-engine-client)
16
+ [![License: MIT](https://img.shields.io/badge/license-MIT-22c55e?logo=opensourceinitiative&logoColor=white)](https://github.com/Eth-Interchained/nedb/blob/master/LICENSE)
16
17
 
17
18
  **[Studio → studio.interchained.org](https://studio.interchained.org)** · **[nedb.aiassist.net](https://nedb.aiassist.net)**
18
19
 
20
+ > ## 🟢 MIT Licensed — free for any use, including commercial & production
21
+ > NEDB is licensed under the **MIT License** — use it in production, embed it in commercial
22
+ > products, ship it in closed-source software, fork it, sell it. No restrictions, no royalties,
23
+ > no copyleft. See [`LICENSE`](LICENSE). The database is free; the moat is what you build on it.
24
+
19
25
  </div>
20
26
 
21
27
  ---
22
28
 
29
+ ## ⚠️ New in 2.8.6 — Durability & Recovery (read this if you store anything you care about)
30
+
31
+ Three defects found by killing a real engine at every persistence boundary and by filling a real
32
+ filesystem to zero free blocks. All three are fixed. **If you are on 2.8.5 or earlier, upgrade.**
33
+
34
+ ### 1. A failed flush silently discarded acknowledged writes
35
+
36
+ `IdIndex::flush_write_buf` cleared every buffered entry regardless of whether its disk write
37
+ succeeded. So a flush that hit `ENOSPC` threw the entry away, and no later flush retried it.
38
+
39
+ Reproduced on a full 22 MiB filesystem: **30 rows acknowledged by `put() -> Ok`, then `list()`
40
+ returned 0 after reopen — while `verify()` reported all 30 objects healthy.** The content-addressed
41
+ objects were durable; the id-index entries that make them findable were gone.
42
+
43
+ ```
44
+ before: try_flush_all() -> (no return value) reopen -> 0 rows, verify() = 30 ok
45
+ after: try_flush_all() -> Err("id-index leaf rows/buf_25: No space left on device (os error 28)")
46
+ ...free space, retry -> Ok reopen -> 30 rows
47
+ ```
48
+
49
+ **Fixed:** an entry leaves the WAL only when its write actually landed. Failures stay buffered and
50
+ retry on the next flush.
51
+
52
+ ### 2. Flush errors were unobservable — new `try_flush_all()`
53
+
54
+ `flush_all()` returns `()` and logged fsync failures to stderr, so a caller could not tell a durable
55
+ flush from a failed one. Anything that takes a destructive or externally-visible action on the
56
+ strength of a persisted record needs to know.
57
+
58
+ ```rust
59
+ // Use this when the outcome matters:
60
+ db.try_flush_all()?; // Result<()> — id-index WAL + segment sync + MANIFEST
61
+
62
+ // Still available, still logs, nowhere to propagate (ticker / Drop):
63
+ db.flush_all();
64
+ ```
65
+
66
+ Also new: `Db::try_flush_manifest()` and `IdIndex::try_flush_write_buf()`.
67
+
68
+ ### 3. `repair` could not repair, and `since()` claimed "caught up" while behind
69
+
70
+ The cold scan rebuilt `seq_index`, per-collection tips, the Merkle head and `MANIFEST` — but **never
71
+ the id index**. A database whose WAL never reached disk came back with every object verifying and
72
+ `list()` empty, and `nedb-cli repair` printed success without fixing it, because
73
+ `start_cold_scan()` is a deliberate no-op on a warm store.
74
+
75
+ ```bash
76
+ nedb-cli repair ./data
77
+ # repaired: 203 id-index entr(ies) rebuilt, 203 node(s) verified, flushed
78
+ ```
79
+
80
+ ```rust
81
+ let restored = db.repair()?; // rebuild id index from objects; highest seq wins
82
+ ```
83
+
84
+ Every object carries its own `coll`, `id` and `seq`, so the id index is fully derivable — a lost WAL
85
+ is recoverable and nothing is invented. `repair()` also recomputes head and tips, so a repaired
86
+ database reopens **warm** instead of coming back up cold with an empty head.
87
+
88
+ Separately, `since()` set `has_more = hit_limit` alone. On a warm boot the seq index is empty **by
89
+ design** (that is why warm start is O(1)), so every lookup missed and `since()` returned zero nodes
90
+ with `has_more = false` — indistinguishable from genuinely up to date. A consumer following the
91
+ documented drain loop stopped one call in, with every record unread.
92
+
93
+ **Fixed:** `has_more` is true whenever the cursor is behind the log head. `ScanStatus` gains
94
+ **`seq_index_ready`** — replication consumers should gate on that, not on `scan_complete`, which is
95
+ true on a warm boot precisely because the scan was skipped.
96
+
97
+ ### Known sharp edge (documented, not changed)
98
+
99
+ `since()`'s cursor is **exclusive** and seqs start at 0, so `since(0, _)` returns `(0, head]` and the
100
+ very first write in a database (seq 0) is unreachable through any cursor value. Ten writes drain as
101
+ nine records. Changing the convention would break existing consumers; a replica seeded from
102
+ `since()` alone starts one record short.
103
+
104
+ ---
105
+
23
106
  ## NEDB v2.8.0 — Production Stable
24
107
 
25
108
  **Current stable: 2.8.0** — NEDB ships as **three version-aligned distributions** on one tag — `nedb-engine` (flagship), `crypto-database` (verifiable v2/v3 DAG), and `aof-db` (fast append-only) — across npm / PyPI / crates.io with full mac + linux + windows native addons (see [**Releasing**](#releasing) below). All native wheels (Linux + Windows on GitHub Actions; macOS arm64 + x86_64 on Codemagic M2 Mac Minis) **plus** the universal pure-Python wheel ship from a single `v*` tag, with the `nedbd-v2` binary bundled inside `pip install nedb-engine`.
@@ -822,7 +905,8 @@ Requires `GITHUB_TOKEN` (`repo` + `workflow` scope) in the environment. It never
822
905
 
823
906
  ## License
824
907
 
825
- See `LICENSE` file. · © INTERCHAINED, LLC [interchained.org](https://interchained.org)
908
+ **MIT License** free for any use, including commercial and production. See [`LICENSE`](LICENSE).
909
+ © 2026 INTERCHAINED LLC — [interchained.org](https://interchained.org)
826
910
 
827
911
  ---
828
912
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nedb-engine",
3
- "version": "2.8.5",
3
+ "version": "3.0.0",
4
4
  "description": "NEDB — hash-chained, time-traveling, bi-temporal embedded database with Rust native core. SQL, Redis, MongoDB adapters. Causal Write Provenance. RESP2 wire protocol.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "README.md",
24
24
  "LICENSE"
25
25
  ],
26
- "license": "GPL-3.0-or-later",
26
+ "license": "MIT",
27
27
  "homepage": "https://github.com/aiassistsecure/nedb#readme",
28
28
  "repository": {
29
29
  "type": "git",