@ruso-0/nreki 10.0.0 → 10.1.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.
Files changed (2) hide show
  1. package/README.md +77 -9
  2. package/package.json +1 -1
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-713-brightgreen?style=for-the-badge" alt="713 Tests">
5
+ <img src="https://img.shields.io/badge/Tests-729-brightgreen?style=for-the-badge" alt="729 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">
@@ -11,7 +11,7 @@
11
11
 
12
12
  **MCP plugin that validates AI agent edits in RAM before they touch disk.** When Claude Code, Cursor, or Copilot changes a function signature in one file and breaks 30 others, NREKI catches it in milliseconds — the file is never written. If the error is structural (missing import, forgotten `await`), NREKI auto-fixes it in RAM. Zero tokens wasted on fix-retry doom loops.
13
13
 
14
- **v8: Antigravity** — NREKI now understands your architecture. Spectral clustering partitions your repo into natural domains, detects structural bridges (load-bearing walls), shows real-time architecture diffs on every batch edit, and hunts dead code via transitive reachability analysis.
14
+ **v10: Exocortex** — NREKI now remembers. Save long-term insights about any symbol (`engram`). They auto-surface in every future outline and auto-delete the moment the code changes — zero hallucinations. Add Oracle type introspection (`type_shape`) and a full Cognitive Heatmap in outline (risk triage per symbol). On top of v9's Phantom Scalpel (pressure-aware engine, CognitiveEnforcer, CLI Hook installer), Spectral Architecture, and TFC-Ultra compression.
15
15
 
16
16
  ```
17
17
  AI proposes edit -> NREKI intercepts in RAM -> Compiler/LSP validates
@@ -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. 713 tests. 4 languages. Works with any MCP-compatible agent. Apache 2.0.
27
+ 3 tools. 23 actions. 729 tests. 4 languages. Works with any MCP-compatible agent. Apache 2.0.
28
28
 
29
29
  ---
30
30
 
@@ -85,6 +85,72 @@ Under the hood, NREKI doesn't just read text; it builds a mathematical graph of
85
85
 
86
86
  ---
87
87
 
88
+ ## What's New in v10 (Exocortex)
89
+
90
+ ### Engrams — Persistent Symbol Memory
91
+
92
+ Save a long-term insight about any symbol and it will auto-surface in every future `outline` call:
93
+
94
+ ```
95
+ nreki_guard action:"engram"
96
+ path:"src/router.ts"
97
+ symbol:"applyContextHeartbeat"
98
+ text:"Re-injects session state every 50K tokens. Do not remove the heartbeat call."
99
+ ```
100
+
101
+ The next time you outline `src/router.ts`, that function will show:
102
+
103
+ ```
104
+ - **function** `applyContextHeartbeat` [MED — biz logic] - L104-L178
105
+ `export function applyContextHeartbeat(...)`
106
+ [Engram]: Re-injects session state every 50K tokens. Do not remove the heartbeat call.
107
+ ```
108
+
109
+ **Auto-invalidation:** NREKI hashes the symbol's raw source at save time. If the code mutates between sessions, the engram is silently deleted and the outline shows `[Engram invalidated: code mutated since memory was saved]` — zero hallucinations from stale memory.
110
+
111
+ ### Cognitive Heatmap in Outline (v9.2)
112
+
113
+ Every symbol in `outline` is now tagged with a risk score computed from its raw body:
114
+
115
+ ```
116
+ - **function** `batchSemanticEdit` [HIGH — >50L, 12 branches, biz logic] - L347-L579
117
+ - **function** `detectMode` [LOW] - L50-L80
118
+ - **function** `getClaudeMdContent` [LOW] - L163-L168
119
+ ```
120
+
121
+ Risk is derived from: lines of code, branch count (if/else/switch/ternary), external call count, mutation count, and business-logic naming patterns. Thresholds are fixed — no configuration.
122
+
123
+ ### Oracle: Type Shape (v10)
124
+
125
+ Resolve the exact TypeScript type of any symbol without reading the file:
126
+
127
+ ```
128
+ nreki_navigate action:"type_shape"
129
+ path:"src/router.ts"
130
+ symbol:"RouterDependencies"
131
+ ```
132
+
133
+ ```typescript
134
+ type RouterDependencies = { engine: NrekiEngine; monitor: TokenMonitor; ... }
135
+ ```
136
+
137
+ Uses `checker.typeToString` with `NoTruncation | InTypeAlias` flags — the same resolution VS Code uses. Requires a TypeScript project with `tsconfig.json`.
138
+
139
+ ### CLI Hook Installer (v9.1)
140
+
141
+ `npx @ruso-0/nreki init` now installs the PreToolUse guard hook automatically:
142
+
143
+ - Creates `.claude/hooks/nreki-enforcer.mjs`
144
+ - Writes `.claude/settings.json` with 9 matchers (Read, Write, Edit, and variants)
145
+ - Blocks native file reads/writes on >100L files at the Claude Code hooks layer
146
+ - Idempotent — safe to run multiple times
147
+
148
+ ### Phantom Scalpel — Pressure-Aware Engine (v9.0)
149
+
150
+ Context pressure is tracked in real time (0.0–1.0). When pressure is high, NREKI automatically tightens compression, blocks non-essential reads, and pre-empts context overflow. The `status` action now includes a pressure gauge.
151
+
152
+ ---
153
+
88
154
  ## What's New in v8 (Antigravity)
89
155
 
90
156
  ### Spectral Clustering
@@ -302,10 +368,11 @@ NREKI has 3 validation layers with multi-language support:
302
368
  | `search` | T-RAG: Topology-Aware search that ranks results by blast radius, not just text similarity |
303
369
  | `definition` | Go-to-definition by symbol name with auto-injected dependency signatures |
304
370
  | `references` | Find all references cross-project |
305
- | `outline` | List all symbols in a file with signatures |
371
+ | `outline` | List all symbols with risk triage tags (`[LOW]`/`[MED]`/`[HIGH]`) and inline Engram memories |
306
372
  | `map` | Spectral repo map: files grouped by cluster (bridge/domain A/domain B/orphan) with lambda_2 |
307
373
  | `prepare_refactor` | Predictive blast radius: shows every file that breaks if you rename a symbol |
308
374
  | `orphan_oracle` | Mark-and-Sweep dead code detection via transitive reachability from framework roots |
375
+ | `type_shape` | Oracle: invoke TS compiler for exact resolved type shape (requires tsconfig.json) |
309
376
 
310
377
  ### `nreki_code` -- Read, write, and validate code
311
378
 
@@ -329,6 +396,7 @@ NREKI has 3 validation layers with multi-language support:
329
396
  | `set_plan` | Anchor a plan file -- survives context compaction via Context Heartbeat |
330
397
  | `memorize` | Save progress notes to NREKI's active scratchpad |
331
398
  | `audit` | Architecture Health Index: 5-signal deterministic score (1-10) with recovery plan |
399
+ | `engram` | Anchor a long-term insight to a symbol -- auto-surfaces in outline, auto-deletes if code mutates |
332
400
 
333
401
  ---
334
402
 
@@ -450,7 +518,7 @@ Re-injects 4-layer session state every ~15 tool calls to survive context compact
450
518
 
451
519
  | Metric | Value |
452
520
  |--------|-------|
453
- | Tests | 713 (44 suites) |
521
+ | Tests | 729 (45 suites) |
454
522
  | Architecture Health Index | 9.7/10 (self-scored) |
455
523
  | **Max TFC-Ultra Compression** | **98.2% (55x)** |
456
524
  | **TFC LRU Cache Speedup** | **34x avg (11.7ms latency)** |
@@ -461,7 +529,7 @@ Re-injects 4-layer session state every ~15 tool calls to survive context compact
461
529
  | Spectral benchmark | 11 projects, 55/55 correct, 0 false positives |
462
530
  | OpenDota benchmark | 6/6 correct verdicts |
463
531
  | VSCode (5,584 files) | JIT boot 1.94s, total 3.32s |
464
- | Router | 3 facades, 20 actions |
532
+ | Router | 3 facades, 23 actions |
465
533
  | Tool overhead | ~660 tokens (3 tools replace 16) |
466
534
 
467
535
  ---
@@ -503,10 +571,10 @@ NrekiKernel (Orchestrator)
503
571
  +-- Union-Find beta_1 cyclomatic complexity
504
572
  +-- Architecture Diff (pre/post topology comparison)
505
573
 
506
- Router (3 facades, 20 actions)
507
- +-- nreki_navigate -> handlers/navigate.ts (7 actions)
574
+ Router (3 facades, 23 actions)
575
+ +-- nreki_navigate -> handlers/navigate.ts (8 actions)
508
576
  +-- nreki_code -> handlers/code.ts (6 actions)
509
- +-- nreki_guard -> handlers/guard.ts (8 actions + Context Heartbeat)
577
+ +-- nreki_guard -> handlers/guard.ts (9 actions + Context Heartbeat)
510
578
 
511
579
  RepoMap (Spectral Clustering)
512
580
  +-- PageRank tier classification (core/logic/leaf)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruso-0/nreki",
3
- "version": "10.0.0",
3
+ "version": "10.1.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",