@ruso-0/nreki 8.0.2 → 8.3.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/README.md +44 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://img.shields.io/npm/v/@ruso-0/nreki?style=for-the-badge&color=blue" alt="npm version">
|
|
5
|
-
<img src="https://img.shields.io/badge/Tests-
|
|
5
|
+
<img src="https://img.shields.io/badge/Tests-713-brightgreen?style=for-the-badge" alt="713 Tests">
|
|
6
6
|
<img src="https://img.shields.io/badge/AHI-9.7%2F10-brightgreen?style=for-the-badge" alt="AHI 9.7/10">
|
|
7
7
|
<img src="https://img.shields.io/badge/Languages-TS%20%7C%20JS%20%7C%20Go%20%7C%20Python-blue?style=for-the-badge" alt="Multi-language">
|
|
8
8
|
<img src="https://img.shields.io/badge/Cloud-Zero-orange?style=for-the-badge" alt="Zero Cloud">
|
|
@@ -24,7 +24,7 @@ AI proposes edit -> NREKI intercepts in RAM -> Compiler/LSP validates
|
|
|
24
24
|
| Some remain? ------> Full rollback. Disk untouched. Errors returned to agent.
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
3 tools.
|
|
27
|
+
3 tools. 713 tests. 4 languages. Works with any MCP-compatible agent. Apache 2.0.
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
@@ -147,6 +147,47 @@ True topological circuit rank via Union-Find on the type constraint graph. `beta
|
|
|
147
147
|
|
|
148
148
|
---
|
|
149
149
|
|
|
150
|
+
## What's New in v8.3
|
|
151
|
+
|
|
152
|
+
### Kernel Decomposition (v8.1)
|
|
153
|
+
|
|
154
|
+
The 2,080-line God Object `nreki-kernel.ts` was decomposed into 4 focused modules:
|
|
155
|
+
|
|
156
|
+
- `mutex.ts` — AsyncMutex FIFO with timeout protection
|
|
157
|
+
- `types.ts` — All interfaces + IoC contracts (`TsHealingContext`, `LspHealingContext`)
|
|
158
|
+
- `ttrd.ts` — Pure functions: `extractRawSignatures`, `detectSignatureRegression`, `isToxicType`
|
|
159
|
+
- `healer.ts` — Both healers rewritten with Inversion of Control — healers no longer touch VFS, vfsClock, or tsBackend directly. Testable in isolation.
|
|
160
|
+
|
|
161
|
+
### Production Hardening (v8.2)
|
|
162
|
+
|
|
163
|
+
- **Token Drift Heartbeat** — Replaced call-count heuristic (15 calls) with token-physics (15,000 tokens default). ENV override: `NREKI_DRIFT_THRESHOLD`. Telemetry injected into header: `(Drift: X tokens | Limit: Y)`.
|
|
164
|
+
- **Search Engine Segregation** — `VectorIndex` and `KeywordIndex` extracted to `src/search/`. Pure JavaScript, zero SQLite coupling. Ready for `node:sqlite` migration in v9.0.
|
|
165
|
+
- **Handler Barrel Pattern** — 1,119-line `handlers/code.ts` split into `code/kernel-bridge.ts`, `code/read.ts`, `code/edit.ts`, `code/utils.ts`. Rate limiter stays in router (correct layer separation).
|
|
166
|
+
- **WASM Deps Frozen** — `sql.js` and `tree-sitter-wasms` pinned to exact versions. No silent breakage from upstream updates.
|
|
167
|
+
|
|
168
|
+
### Rayleigh Residual Guard (v8.3)
|
|
169
|
+
|
|
170
|
+
Added a 4th defense layer to the spectral power iteration. Post-convergence, the solver computes `||Mv - μv||∞` and dies with `NaN` if the residual exceeds `1e-3`. This traps silent IEEE 754 drift that slips past the 3 existing guards (thermal, divergence, numerical sanity firewall).
|
|
171
|
+
|
|
172
|
+
### interceptAtomicBatch Phase Extraction (v8.3)
|
|
173
|
+
|
|
174
|
+
The 520-line ACID orchestrator was flattened into 3 private methods within `NrekiKernel`:
|
|
175
|
+
|
|
176
|
+
- `phase1_injectVfs` — Path jail + VFS injection
|
|
177
|
+
- `phase2_validateSidecars` — Go/Python LSP validation
|
|
178
|
+
- `phase4_healingCascade` — Dual healer cascade (TS CodeFix API + LSP codeAction)
|
|
179
|
+
|
|
180
|
+
Catch path untouched. ACID rollback semantics intact. The orchestrator now reads like a document.
|
|
181
|
+
|
|
182
|
+
### engine.ts Flattening (v8.3)
|
|
183
|
+
|
|
184
|
+
- **SessionTracker class** — Session state (`sessionSavings`) encapsulated. Saves one `Embedder.estimateTokens(content)` call per compression.
|
|
185
|
+
- **`indexFile` split** — 124-line method → 28-line orchestrator + `indexPlaintextFallback` + `indexAstChunks`.
|
|
186
|
+
- **`search` split** — 93-line method → 27-line orchestrator + `applyTectonicRelevanceScoring`.
|
|
187
|
+
- **DB Facade grouping** — Delegation wrappers visually grouped under explicit `Facade` section headers.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
150
191
|
## The Architecture
|
|
151
192
|
|
|
152
193
|
NREKI has 3 validation layers with multi-language support:
|
|
@@ -324,7 +365,7 @@ Re-injects 4-layer session state every ~15 tool calls to survive context compact
|
|
|
324
365
|
|
|
325
366
|
| Metric | Value |
|
|
326
367
|
|--------|-------|
|
|
327
|
-
| Tests |
|
|
368
|
+
| Tests | 713 (44 suites) |
|
|
328
369
|
| Architecture Health Index | 9.7/10 (self-scored) |
|
|
329
370
|
| Languages | 4 (TypeScript, JavaScript, Go, Python) |
|
|
330
371
|
| Failure modes sealed | 32 (P1-P32) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruso-0/nreki",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "MCP plugin that validates AI agent edits in RAM before they touch disk. Spectral clustering, architecture diffs, bridge detection, dead code oracle, and cross-file semantic checks for TypeScript, Go (gopls), and Python (pyright). Zero cloud dependencies.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
61
61
|
"chokidar": "^4.0.3",
|
|
62
62
|
"picomatch": "^4.0.3",
|
|
63
|
-
"sql.js": "
|
|
64
|
-
"tree-sitter-wasms": "
|
|
63
|
+
"sql.js": "1.14.1",
|
|
64
|
+
"tree-sitter-wasms": "0.1.13",
|
|
65
65
|
"web-tree-sitter": "^0.24.7",
|
|
66
66
|
"zod": "^3.24.2"
|
|
67
67
|
},
|