prism-mcp-server 9.4.1 β 9.4.2
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 +25 -23
- package/dist/utils/git.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# π§ Prism MCP β The Mind Palace for AI Agents
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/prism-mcp-server)
|
|
4
|
-
[](https://
|
|
5
|
-
[](https://glama.ai/mcp/servers
|
|
6
|
-
[](https://smithery.ai)
|
|
4
|
+
[](https://github.com/modelcontextprotocol/servers)
|
|
5
|
+
[](https://glama.ai/mcp/servers?query=prism-mcp)
|
|
6
|
+
[](https://smithery.ai/server/@dcostenco/prism-mcp)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
[](https://www.typescriptlang.org/)
|
|
9
9
|
[](CONTRIBUTING.md)
|
|
@@ -25,23 +25,23 @@ https://github.com/dcostenco/prism-mcp/raw/main/docs/prism_mcp_demo.mp4
|
|
|
25
25
|
## π Table of Contents
|
|
26
26
|
|
|
27
27
|
- [Why Prism?](#why-prism)
|
|
28
|
-
- [Quick Start](
|
|
29
|
-
- [The Magic Moment](
|
|
30
|
-
- [Setup Guides](
|
|
31
|
-
- [Universal Import: Bring Your History](
|
|
32
|
-
- [What Makes Prism Different](
|
|
28
|
+
- [Quick Start](#-quick-start)
|
|
29
|
+
- [The Magic Moment](#-the-magic-moment)
|
|
30
|
+
- [Setup Guides](#-setup-guides)
|
|
31
|
+
- [Universal Import: Bring Your History](#-universal-import-bring-your-history)
|
|
32
|
+
- [What Makes Prism Different](#-what-makes-prism-different)
|
|
33
33
|
- [Cognitive Architecture (v7.8)](#-cognitive-architecture-v78)
|
|
34
|
-
- [Data Privacy & Egress](
|
|
35
|
-
- [Use Cases](
|
|
36
|
-
- [What's New](
|
|
37
|
-
- [How Prism Compares](
|
|
34
|
+
- [Data Privacy & Egress](#-data-privacy-egress)
|
|
35
|
+
- [Use Cases](#-use-cases)
|
|
36
|
+
- [What's New](#-whats-new)
|
|
37
|
+
- [How Prism Compares](#-how-prism-compares)
|
|
38
38
|
- [CLI Reference](#-cli-reference)
|
|
39
|
-
- [Tool Reference](
|
|
39
|
+
- [Tool Reference](#-tool-reference)
|
|
40
40
|
- [Environment Variables](#environment-variables)
|
|
41
41
|
- [Architecture](#architecture)
|
|
42
|
-
- [Scientific Foundation](
|
|
43
|
-
- [Milestones & Roadmap](
|
|
44
|
-
- [Troubleshooting FAQ](
|
|
42
|
+
- [Scientific Foundation](#-scientific-foundation)
|
|
43
|
+
- [Milestones & Roadmap](#-milestones-roadmap)
|
|
44
|
+
- [Troubleshooting FAQ](#-troubleshooting-faq)
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
@@ -59,7 +59,7 @@ Prism has three pillars:
|
|
|
59
59
|
|
|
60
60
|
2. **π Multi-Hop Reasoning** β When your agent searches for "Error X", Prism doesn't just find logs mentioning "Error X". Spreading activation traverses the causal graph and brings back "Workaround Y", which is connected to "Architecture Decision Z" β a literal train of thought. *(See [Cognitive Architecture](#-cognitive-architecture-v78).)*
|
|
61
61
|
|
|
62
|
-
3. **π Autonomous Execution (Dark Factory)** β When you're ready, Prism can run coding tasks end-to-end with a fail-closed pipeline where an adversarial evaluator catches bugs the generator missed β before you ever see the PR. *(See [Dark Factory](#-dark-factory
|
|
62
|
+
3. **π Autonomous Execution (Dark Factory)** β When you're ready, Prism can run coding tasks end-to-end with a fail-closed pipeline where an adversarial evaluator catches bugs the generator missed β before you ever see the PR. *(See [Dark Factory](#-dark-factory-adversarial-autonomous-pipelines).)*
|
|
63
63
|
|
|
64
64
|
---
|
|
65
65
|
|
|
@@ -438,7 +438,7 @@ Prism can be deployed natively to cloud platforms like [Render](https://render.c
|
|
|
438
438
|
> ```
|
|
439
439
|
> At the start of every conversation, call session_load_context with project "my-project" before doing any work.
|
|
440
440
|
> ```
|
|
441
|
-
> Claude Code users can use the `.clauderules` auto-load hook shown in the [Setup Guides](
|
|
441
|
+
> Claude Code users can use the `.clauderules` auto-load hook shown in the [Setup Guides](#-setup-guides). Prism also has a **server-side fallback** (v5.2.1+) that auto-pushes context after 10 seconds if no load is detected.
|
|
442
442
|
|
|
443
443
|
---
|
|
444
444
|
|
|
@@ -826,9 +826,10 @@ The Generator strips the `console.log`, resubmits, and the next `EVALUATE` retur
|
|
|
826
826
|
|
|
827
827
|
## π What's New
|
|
828
828
|
|
|
829
|
-
> **Current release: v9.4.
|
|
829
|
+
> **Current release: v9.4.2 β Shell Injection Fix (Git Drift Detection)**
|
|
830
830
|
|
|
831
|
-
- π **v9.4.
|
|
831
|
+
- π **v9.4.2 β Shell Injection Fix:** Deep code review found shell injection in `getGitDrift()` β `oldSha` was interpolated into `execSync` template string. Fixed with SHA format validation + `execFileSync` (no shell). Defense-in-depth.
|
|
832
|
+
- π **v9.4.1 β Security Hardening & Bidirectional Sync:** Two-pass adversarial audit found 18 vulnerabilities (4C/5H/9M) β 17 fixed. Critical: fail-closed rate limiter, path traversal guards, error sanitization. High: plan name alignment (revenue fix), CORS allowlist, settings injection prevention. New: bidirectional `prism sync push` CLI command pushes local SQLite β Supabase, JWT enrichment eliminates N+1 DB queries, concurrency counter guaranteed via `try/finally`, 10MB request body limits.
|
|
832
833
|
- π― **v9.3.0 β TurboQuant ResidualNorm Tiebreaker:** Configurable ranking optimization for Tier-2 search. When compressed cosine scores are within Ξ΅ of each other, prefers the candidate with lower `residualNorm` (more trustworthy compressed representation). `PRISM_TURBOQUANT_TIEBREAKER_EPSILON=0.005` gives +2pp R@1, +1pp R@5. Empirically validated at N=5K with A/B test. 1066 tests, 0 regressions. Inspired by [@m13v's suggestion](https://github.com/xiaowu0162/LongMemEval/issues/31).
|
|
833
834
|
- π **v9.2.7 β Security Hardening:** Typed `PrototypePollutionError` class (replaces generic `Error` in `sanitizeForMerge()` β enables catch-site discrimination and forensic logging with `offendingKey`), explicit null-byte path injection guard in `SafetyController.validateActionsInScope()` (C-string truncation attack vector), and corrected CRDT merge semantics documentation (Remove-Wins-from-Either, not Add-Wins). 1055 tests, 0 regressions.
|
|
834
835
|
- πͺ **v9.2.6 β Windows CI Timeout Fix:** CLI integration tests timed out on Windows + Node 22.x GitHub Actions runners. Added `{ timeout: 30_000 }` to the describe block. 6 new residual distribution tests validating TurboQuant's QJL correction stability (zero R@5 delta between P50 and P95 residual vectors at d=128, 2K corpus).
|
|
@@ -914,7 +915,7 @@ prism load my-project --level deep # Full context with all enrichmen
|
|
|
914
915
|
prism load my-project --level quick --json # Machine-readable JSON
|
|
915
916
|
prism load my-project --role dev --json # Role-scoped loading
|
|
916
917
|
|
|
917
|
-
# Bidirectional sync (v9.4.
|
|
918
|
+
# Bidirectional sync (v9.4.1)
|
|
918
919
|
prism sync push # Push local SQLite β Supabase
|
|
919
920
|
prism sync push --json # Machine-readable output
|
|
920
921
|
|
|
@@ -1238,6 +1239,7 @@ Prism has evolved from smart session logging into a **cognitive memory architect
|
|
|
1238
1239
|
| **v9.0** | Surprisal Gate β vector-based novelty pricing: high-surprisal saves cost 0.5Γ tokens, low-surprisal 2.0Γ; forces LLM data compression | Information-theoretic surprisal (Shannon), predictive coding | β
Shipped |
|
|
1239
1240
|
| **v9.0** | Cognitive Budget β per-project token economy with passive UBI recovery (+100 tokens/hr); agents that over-save enter Cognitive Debt | Resource-bounded rationality (Simon, 1955) | β
Shipped |
|
|
1240
1241
|
| **v9.1** | Task Router v2 β 6-signal weighted heuristic engine routing tasks between cloud host and local LLM based on file-type complexity, scope, and multi-step detection | Heuristic classification, cognitive load theory | β
Shipped |
|
|
1242
|
+
| **v9.4** | Shell Injection Fix β `execSync` β `execFileSync` + SHA format validation in git drift detection | Defense-in-depth, secure subprocess execution | β
Shipped |
|
|
1241
1243
|
| **v9.2** | Cross-Backend Reconciliation β automatic Supabase β SQLite sync with idempotent dedup and 5s timeout | Eventual consistency, crdt-style reconciliation | β
Shipped |
|
|
1242
1244
|
| **v9.2** | Split-Brain Drift Detection β dual-backend version comparison with prominent divergence warnings at load time | Byzantine fault detection, split-brain resolution | β
Shipped |
|
|
1243
1245
|
| **v9.2** | TurboQuant QJL Validation β zero R@5 delta between P50 and P95 residual vectors (d=128, N=2K); CV=0.038 at d=768 proves no long tail | QJL estimator (ICLR 2026), Householder orthogonal rotation | β
Shipped |
|
|
@@ -1275,7 +1277,7 @@ Prism MCP is open-source and free for individual developers. For teams and enter
|
|
|
1275
1277
|
|
|
1276
1278
|
## π¦ Milestones & Roadmap
|
|
1277
1279
|
|
|
1278
|
-
> **Current: v9.
|
|
1280
|
+
> **Current: v9.4.1** β Adversarial Security Hardening & Bidirectional Sync ([CHANGELOG](CHANGELOG.md))
|
|
1279
1281
|
|
|
1280
1282
|
| Release | Headline |
|
|
1281
1283
|
|---------|----------|
|
|
@@ -1324,7 +1326,7 @@ A: Run `npm run build && npm test`, then open the Mind Palace dashboard (`localh
|
|
|
1324
1326
|
### π‘ Known Limitations & Quirks
|
|
1325
1327
|
|
|
1326
1328
|
- **LLM-dependent features require an API key.** Semantic search, Morning Briefings, auto-compaction, and VLM captioning need a `GOOGLE_API_KEY` (your Gemini API key) or equivalent provider key. Without one, Prism falls back to keyword-only search (FTS5).
|
|
1327
|
-
- **Auto-load is model- and client-dependent.** Session auto-loading relies on both the LLM following system prompt instructions *and* the MCP client completing tool registration before the model's first turn. Prism provides platform-specific [Setup Guides](
|
|
1329
|
+
- **Auto-load is model- and client-dependent.** Session auto-loading relies on both the LLM following system prompt instructions *and* the MCP client completing tool registration before the model's first turn. Prism provides platform-specific [Setup Guides](#-setup-guides) and a server-side fallback (v5.2.1) that auto-pushes context after 10 seconds.
|
|
1328
1330
|
- **MCP client race conditions.** Some MCP clients may not finish tool enumeration before the model generates its first response, causing transient `unknown_tool` errors. This is a client-side timing issue β Prism's server completes the MCP handshake in ~60ms. Workaround: the server-side auto-push fallback and the startup skill's retry logic.
|
|
1329
1331
|
- **No real-time sync without Supabase.** Local SQLite mode is single-machine only. Multi-device or team sync requires a Supabase backend.
|
|
1330
1332
|
- **Embedding quality varies by provider.** Gemini `text-embedding-004` and OpenAI `text-embedding-3-small` produce high-quality 768-dim vectors. Prism passes `dimensions: 768` via the Matryoshka API for OpenAI models (native output is 1536-dim; this truncation is lossless and outperforms ada-002 at full 1536 dims). Ollama embeddings (e.g., `nomic-embed-text`) are usable but may reduce retrieval accuracy.
|
package/dist/utils/git.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* "M src/schema.ts" β no token explosion.
|
|
22
22
|
* βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
23
23
|
*/
|
|
24
|
-
import { execSync } from "child_process";
|
|
24
|
+
import { execSync, execFileSync } from "child_process";
|
|
25
25
|
/**
|
|
26
26
|
* Get the current Git branch and HEAD commit SHA.
|
|
27
27
|
* Returns { isRepo: false } gracefully if not a Git repo.
|
|
@@ -55,8 +55,16 @@ export function getCurrentGitState(projectPath = process.cwd()) {
|
|
|
55
55
|
* Returns null if the SHA is invalid (rebased, force-pushed, etc.).
|
|
56
56
|
*/
|
|
57
57
|
export function getGitDrift(oldSha, projectPath = process.cwd()) {
|
|
58
|
+
// SECURITY: Validate SHA format before passing to git.
|
|
59
|
+
// Without this, a corrupted DB entry like "; rm -rf /" would be
|
|
60
|
+
// shell-injected via the old template string approach.
|
|
61
|
+
if (!/^[0-9a-f]{4,40}$/i.test(oldSha)) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
58
64
|
try {
|
|
59
|
-
|
|
65
|
+
// Use execFileSync (no shell) to prevent injection even if
|
|
66
|
+
// validation is somehow bypassed. Args are passed as array.
|
|
67
|
+
const diff = execFileSync("git", ["diff", "--name-status", oldSha, "HEAD"], {
|
|
60
68
|
cwd: projectPath,
|
|
61
69
|
stdio: "pipe",
|
|
62
70
|
timeout: 10000,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prism-mcp-server",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.2",
|
|
4
4
|
"mcpName": "io.github.dcostenco/prism-mcp",
|
|
5
5
|
"description": "The Mind Palace for AI Agents β a true Cognitive Architecture with Hebbian learning (episodicβsemantic consolidation), ACT-R spreading activation (multi-hop causal reasoning), uncertainty-aware rejection gates (agents that know when they don't know), adversarial evaluation (anti-sycophancy), fail-closed Dark Factory pipelines, persistent memory (SQLite/Supabase), multi-agent Hivemind, time travel & visual dashboard. Zero-config local mode.",
|
|
6
6
|
"module": "index.ts",
|