@ruso-0/nreki 8.3.0 → 8.6.1
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 +73 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -147,6 +147,79 @@ 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.6 (TFC-Ultra)
|
|
151
|
+
|
|
152
|
+
**Topological Foveal Compression** — Hyper-causal context sculpting for frontier LLMs. Point TFC-Ultra at a specific method or function inside a file, and it extracts the target symbol at 100% resolution plus its causal dependencies (upstream callers, downstream deps, resolved imports, blast radius), while annihilating orthogonal "dark matter" code.
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
nreki_code action:"compress" path:"src/huge-file.ts" focus:"criticalMethod"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Empirical results (benchmarked against NREKI src/ — 5 files, 15 focus probes + 15 boundary probes)
|
|
159
|
+
|
|
160
|
+
**Operational case** (methods of medium-to-large size):
|
|
161
|
+
|
|
162
|
+
| Metric | Value |
|
|
163
|
+
|--------|-------|
|
|
164
|
+
| **Avg compression** | **82.2%** (~5.6x) |
|
|
165
|
+
| **p50 compression** | **84.8%** |
|
|
166
|
+
| **p95 compression** | **89.9%** (~10x) |
|
|
167
|
+
| **Advantage vs legacy tier-3** | **+9.8pp** (consistent) |
|
|
168
|
+
| **Fovea fidelity** | **100%** — target symbol preserved verbatim for zero-loss reasoning |
|
|
169
|
+
| **True LRU AST cache** | **34x avg speedup**, **137x in extreme cases** (1,819ms → 13.3ms on 82 KB file) |
|
|
170
|
+
| **Fallback rate (Density Shield)** | **13.3%** — when TFC can't beat 15% compression, falls through to legacy aggressive |
|
|
171
|
+
|
|
172
|
+
**Best case boundary** (theoretical ceiling — small focus inside large file):
|
|
173
|
+
|
|
174
|
+
| Metric | Value |
|
|
175
|
+
|--------|-------|
|
|
176
|
+
| **Max compression observed** | **98.2%** (**55x**) |
|
|
177
|
+
| **Context** | focus `isBooted` (3-line getter) inside `nreki-kernel.ts` (82 KB, 1,640 lines) |
|
|
178
|
+
| **Boundary probes** | 15 (top-3 smallest symbols per file), **0 fallbacks**, compression range: **30x–55x** |
|
|
179
|
+
|
|
180
|
+
### The Amdahl law of focused compression
|
|
181
|
+
|
|
182
|
+
TFC compression ratio follows an asymptotic limit:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Ratio ≈ 1 − (Preamble + Fovea + Markov_Mantle_O(1)) / TotalFileSize
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- When the Fovea is a small getter (3 lines) inside a 1,640-line file, the numerator is minuscule vs. the denominator. **Ratio approaches 100%. Empirical ceiling: 98.2% (55x).**
|
|
189
|
+
- When the Fovea is a large operational method (500 lines), the numerator grows. **Ratio drops to 70-80%.** Still preserves 100% of the causal information the agent needs.
|
|
190
|
+
- When the Fovea is a God Class (entire file), the numerator **exceeds** the denominator due to parafovea overhead. **The Density Shield detects this and falls through to legacy aggressive**, guaranteeing the output is never worse than baseline.
|
|
191
|
+
|
|
192
|
+
**This is not marketing. This is physics.** See [BENCH-TFC.md](BENCH-TFC.md) for the raw dogfooding benchmark with per-file breakdowns.
|
|
193
|
+
|
|
194
|
+
### How it works
|
|
195
|
+
|
|
196
|
+
- **Fovea**: the target symbol is preserved byte-for-byte at 100% resolution
|
|
197
|
+
- **Upstream vectorial collapse** (O(1)): N local callers condensed to a single line of names
|
|
198
|
+
- **Downstream event horizon** (O(1)): top-10 local dependencies + `cleanSignature` to strip JSDoc waste
|
|
199
|
+
- **External parafovea**: BM25-resolved signatures of imported symbols used inside the fovea
|
|
200
|
+
- **Blast radius**: dependents from the project-wide import graph
|
|
201
|
+
- **Dark matter**: everything else in the file is omitted as a single annotation line
|
|
202
|
+
- **Density Shield 0.85**: if TFC can't achieve ≥15% real compression (e.g. when the agent aims at a God Class and pulls the entire file into the fovea), the compressor returns `null` and the system falls through to the legacy aggressive compressor — **mathematically guarantees you never perform worse than baseline**
|
|
203
|
+
|
|
204
|
+
### TFC-Pro Enforcer (auto-guard on `read`)
|
|
205
|
+
|
|
206
|
+
When a file exceeds 3,000 tokens and the agent tries to read it raw, NREKI's hook intercepts the call and instructs the agent to use outline + focus-driven compression instead. This eliminates context-window suicide before it happens.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## What's New in v8.5 (Engine Decomposition)
|
|
211
|
+
|
|
212
|
+
The 878-line `engine.ts` God Object was decomposed into a clean facade pattern:
|
|
213
|
+
|
|
214
|
+
- `engine-types.ts` — shared type definitions (SearchResult, EngineConfig, SessionReport, IndexStats)
|
|
215
|
+
- `engine/indexer.ts` — `IndexPipeline` class (write side: AST parsing, embedding, batch storage)
|
|
216
|
+
- `engine/searcher.ts` — `SearchEngine` class (read side: T-RAG Tectonic Relevance Scoring)
|
|
217
|
+
- `engine.ts` — thin orchestrator facade (~520 lines)
|
|
218
|
+
|
|
219
|
+
Zero API changes. All 28 public methods on `NrekiEngine` preserved. `sql.js` intentionally kept (migration to `node:sqlite` postponed to v9.0 to avoid breaking users on Node 20 LTS or forcing the `--experimental-sqlite` flag).
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
150
223
|
## What's New in v8.3
|
|
151
224
|
|
|
152
225
|
### Kernel Decomposition (v8.1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruso-0/nreki",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.1",
|
|
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",
|