@obsidicore/cascade-engine 0.2.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 +21 -0
- package/dist/cascade/checkpoints.d.ts +55 -0
- package/dist/cascade/checkpoints.js +123 -0
- package/dist/cascade/checkpoints.js.map +1 -0
- package/dist/cascade/engine.d.ts +72 -0
- package/dist/cascade/engine.js +170 -0
- package/dist/cascade/engine.js.map +1 -0
- package/dist/cascade/gates.d.ts +46 -0
- package/dist/cascade/gates.js +199 -0
- package/dist/cascade/gates.js.map +1 -0
- package/dist/cascade/research.d.ts +50 -0
- package/dist/cascade/research.js +127 -0
- package/dist/cascade/research.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.js +165 -0
- package/dist/cli.js.map +1 -0
- package/dist/control/kalman.d.ts +53 -0
- package/dist/control/kalman.js +83 -0
- package/dist/control/kalman.js.map +1 -0
- package/dist/control/pid.d.ts +57 -0
- package/dist/control/pid.js +95 -0
- package/dist/control/pid.js.map +1 -0
- package/dist/control/stability.d.ts +42 -0
- package/dist/control/stability.js +117 -0
- package/dist/control/stability.js.map +1 -0
- package/dist/db/index.d.ts +26 -0
- package/dist/db/index.js +116 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.sql +282 -0
- package/dist/graph/amem.d.ts +80 -0
- package/dist/graph/amem.js +190 -0
- package/dist/graph/amem.js.map +1 -0
- package/dist/graph/entities.d.ts +66 -0
- package/dist/graph/entities.js +187 -0
- package/dist/graph/entities.js.map +1 -0
- package/dist/graph/queries.d.ts +48 -0
- package/dist/graph/queries.js +176 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/hitl/dashboard.d.ts +51 -0
- package/dist/hitl/dashboard.js +135 -0
- package/dist/hitl/dashboard.js.map +1 -0
- package/dist/hitl/interventions.d.ts +36 -0
- package/dist/hitl/interventions.js +150 -0
- package/dist/hitl/interventions.js.map +1 -0
- package/dist/hitl/steering.d.ts +37 -0
- package/dist/hitl/steering.js +118 -0
- package/dist/hitl/steering.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +701 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/consolidation.d.ts +51 -0
- package/dist/memory/consolidation.js +122 -0
- package/dist/memory/consolidation.js.map +1 -0
- package/dist/memory/ncd.d.ts +40 -0
- package/dist/memory/ncd.js +90 -0
- package/dist/memory/ncd.js.map +1 -0
- package/dist/memory/sm2.d.ts +44 -0
- package/dist/memory/sm2.js +119 -0
- package/dist/memory/sm2.js.map +1 -0
- package/dist/memory/tiers.d.ts +49 -0
- package/dist/memory/tiers.js +145 -0
- package/dist/memory/tiers.js.map +1 -0
- package/dist/server.d.ts +6 -0
- package/dist/server.js +6 -0
- package/dist/server.js.map +1 -0
- package/dist/trust/ingestion.d.ts +38 -0
- package/dist/trust/ingestion.js +147 -0
- package/dist/trust/ingestion.js.map +1 -0
- package/dist/trust/patterns.d.ts +26 -0
- package/dist/trust/patterns.js +78 -0
- package/dist/trust/patterns.js.map +1 -0
- package/dist/trust/scoring.d.ts +39 -0
- package/dist/trust/scoring.js +206 -0
- package/dist/trust/scoring.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trust Scoring — SpamAssassin-inspired multi-signal composite
|
|
3
|
+
*
|
|
4
|
+
* 6 orthogonal signals → composite 0-1:
|
|
5
|
+
* 1. Source reputation
|
|
6
|
+
* 2. Cross-corroboration
|
|
7
|
+
* 3. Semantic anomaly (distance from topic centroid)
|
|
8
|
+
* 4. Instruction pattern detection
|
|
9
|
+
* 5. Temporal consistency
|
|
10
|
+
* 6. GRADE assessment
|
|
11
|
+
*
|
|
12
|
+
* Thresholds: ≥0.7 auto-admit | 0.3-0.7 quarantine | <0.3 reject
|
|
13
|
+
*/
|
|
14
|
+
import { getDb } from '../db/index.js';
|
|
15
|
+
import { detectInstructionPatterns } from './patterns.js';
|
|
16
|
+
// Signal weights — sum to 1.0
|
|
17
|
+
const WEIGHTS = {
|
|
18
|
+
sourceReputation: 0.20,
|
|
19
|
+
crossCorroboration: 0.20,
|
|
20
|
+
semanticAnomaly: 0.15,
|
|
21
|
+
instructionScore: 0.20,
|
|
22
|
+
temporalConsistency: 0.10,
|
|
23
|
+
gradeAssessment: 0.15,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Compute composite trust score for a finding.
|
|
27
|
+
*/
|
|
28
|
+
export function scoreTrust(claim, sourceUrl, existingClaims, sourceType) {
|
|
29
|
+
const signals = {
|
|
30
|
+
sourceReputation: scoreSourceReputation(sourceUrl),
|
|
31
|
+
crossCorroboration: scoreCrossCorroboration(claim, existingClaims),
|
|
32
|
+
semanticAnomaly: 1.0, // Default — would need embeddings for real scoring
|
|
33
|
+
instructionScore: scoreInstructionSafety(claim),
|
|
34
|
+
temporalConsistency: 1.0, // Default — would compare timestamps
|
|
35
|
+
gradeAssessment: scoreGradeProxy(sourceType),
|
|
36
|
+
};
|
|
37
|
+
const composite = signals.sourceReputation * WEIGHTS.sourceReputation +
|
|
38
|
+
signals.crossCorroboration * WEIGHTS.crossCorroboration +
|
|
39
|
+
signals.semanticAnomaly * WEIGHTS.semanticAnomaly +
|
|
40
|
+
signals.instructionScore * WEIGHTS.instructionScore +
|
|
41
|
+
signals.temporalConsistency * WEIGHTS.temporalConsistency +
|
|
42
|
+
signals.gradeAssessment * WEIGHTS.gradeAssessment;
|
|
43
|
+
// Novel-vs-malicious detection
|
|
44
|
+
const isNovel = signals.crossCorroboration < 0.3; // Not corroborated
|
|
45
|
+
const isPrecise = signals.instructionScore > 0.7;
|
|
46
|
+
const isTrusted = signals.sourceReputation > 0.5;
|
|
47
|
+
let action;
|
|
48
|
+
let reason;
|
|
49
|
+
if (composite >= 0.7) {
|
|
50
|
+
action = 'admit';
|
|
51
|
+
reason = 'Trust score above admission threshold';
|
|
52
|
+
}
|
|
53
|
+
else if (composite < 0.3) {
|
|
54
|
+
action = 'reject';
|
|
55
|
+
reason = composite < 0.2
|
|
56
|
+
? 'Trust score critically low — likely injection or unreliable'
|
|
57
|
+
: 'Trust score below rejection threshold';
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// Quarantine zone — apply novel-vs-malicious heuristic
|
|
61
|
+
if (isNovel && isPrecise && isTrusted) {
|
|
62
|
+
action = 'quarantine';
|
|
63
|
+
reason = 'Contested novelty — novel claim from trusted source. Needs human review.';
|
|
64
|
+
}
|
|
65
|
+
else if (isNovel && !isPrecise && !isTrusted) {
|
|
66
|
+
action = 'reject';
|
|
67
|
+
reason = 'Structural anomaly — novel, imprecise, untrusted. Likely attack vector.';
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
action = 'quarantine';
|
|
71
|
+
reason = 'Moderate trust — quarantined for review';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// GRADE evidence assessment
|
|
75
|
+
// Based on PRISMA/GRADE framework: 5 downgrade factors, 3 upgrade factors
|
|
76
|
+
// Simplified: composite of source quality, corroboration, and precision
|
|
77
|
+
const gradeLevel = computeGradeLevel(signals, sourceType);
|
|
78
|
+
return { composite, signals, action, gradeLevel, reason, isNovel };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Score source reputation based on domain history.
|
|
82
|
+
*/
|
|
83
|
+
function scoreSourceReputation(sourceUrl) {
|
|
84
|
+
if (!sourceUrl)
|
|
85
|
+
return 0.3; // Unknown source gets low baseline
|
|
86
|
+
const db = getDb();
|
|
87
|
+
let domain;
|
|
88
|
+
try {
|
|
89
|
+
domain = new URL(sourceUrl).hostname;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return 0.2; // Invalid URL
|
|
93
|
+
}
|
|
94
|
+
// Check known reputation
|
|
95
|
+
const rep = db.prepare('SELECT reputation_score FROM source_reputation WHERE domain = ?').get(domain);
|
|
96
|
+
if (rep)
|
|
97
|
+
return rep.reputation_score;
|
|
98
|
+
// Known-good domains baseline
|
|
99
|
+
const knownGood = [
|
|
100
|
+
'arxiv.org', 'github.com', 'stackoverflow.com', 'docs.python.org',
|
|
101
|
+
'developer.mozilla.org', 'en.wikipedia.org', 'scholar.google.com',
|
|
102
|
+
'proceedings.neurips.cc', 'openreview.net', 'dl.acm.org',
|
|
103
|
+
'ieee.org', 'nature.com', 'science.org',
|
|
104
|
+
];
|
|
105
|
+
if (knownGood.some(d => domain.endsWith(d))) {
|
|
106
|
+
// Initialize reputation
|
|
107
|
+
db.prepare('INSERT OR IGNORE INTO source_reputation (domain, reputation_score) VALUES (?, 0.8)')
|
|
108
|
+
.run(domain);
|
|
109
|
+
return 0.8;
|
|
110
|
+
}
|
|
111
|
+
// Unknown domain — neutral
|
|
112
|
+
db.prepare('INSERT OR IGNORE INTO source_reputation (domain, reputation_score) VALUES (?, 0.5)')
|
|
113
|
+
.run(domain);
|
|
114
|
+
return 0.5;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Score cross-corroboration — how many existing findings support this claim.
|
|
118
|
+
* Simple text overlap heuristic (would use embeddings in production).
|
|
119
|
+
*/
|
|
120
|
+
function scoreCrossCorroboration(claim, existingClaims) {
|
|
121
|
+
if (existingClaims.length === 0)
|
|
122
|
+
return 0.3; // First finding — neutral
|
|
123
|
+
// Simple word overlap scoring
|
|
124
|
+
const claimWords = new Set(claim.toLowerCase().split(/\s+/).filter(w => w.length > 4));
|
|
125
|
+
let maxOverlap = 0;
|
|
126
|
+
let corroborations = 0;
|
|
127
|
+
for (const existing of existingClaims) {
|
|
128
|
+
const existingWords = new Set(existing.toLowerCase().split(/\s+/).filter(w => w.length > 4));
|
|
129
|
+
let overlap = 0;
|
|
130
|
+
for (const word of claimWords) {
|
|
131
|
+
if (existingWords.has(word))
|
|
132
|
+
overlap++;
|
|
133
|
+
}
|
|
134
|
+
const overlapRatio = claimWords.size > 0 ? overlap / claimWords.size : 0;
|
|
135
|
+
maxOverlap = Math.max(maxOverlap, overlapRatio);
|
|
136
|
+
if (overlapRatio > 0.3)
|
|
137
|
+
corroborations++;
|
|
138
|
+
}
|
|
139
|
+
// More corroborations = higher score, diminishing returns
|
|
140
|
+
return Math.min(1.0, 0.3 + corroborations * 0.15 + maxOverlap * 0.3);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Score instruction safety — detect prompt injection patterns.
|
|
144
|
+
*/
|
|
145
|
+
function scoreInstructionSafety(text) {
|
|
146
|
+
const patterns = detectInstructionPatterns(text);
|
|
147
|
+
return Math.max(0, 1.0 + patterns.totalScore); // patterns.totalScore is negative
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Proxy GRADE assessment based on source type.
|
|
151
|
+
*/
|
|
152
|
+
function scoreGradeProxy(sourceType) {
|
|
153
|
+
switch (sourceType) {
|
|
154
|
+
case 'primary': return 0.9; // Peer-reviewed, official docs
|
|
155
|
+
case 'secondary': return 0.6; // Blog posts, tutorials
|
|
156
|
+
case 'tertiary': return 0.4; // Forum posts, social media
|
|
157
|
+
default: return 0.5;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Compute GRADE evidence level from trust signals.
|
|
162
|
+
*
|
|
163
|
+
* GRADE framework (simplified):
|
|
164
|
+
* Start at HIGH if primary source, MODERATE if secondary, LOW if tertiary.
|
|
165
|
+
* Downgrade for: low reputation, low corroboration, instruction patterns, low precision.
|
|
166
|
+
* Upgrade for: high corroboration (≥3 sources), high source reputation, dose-response (multiple signals agree).
|
|
167
|
+
*/
|
|
168
|
+
function computeGradeLevel(signals, sourceType) {
|
|
169
|
+
// Start level based on source type
|
|
170
|
+
let level = sourceType === 'primary' ? 3 : sourceType === 'secondary' ? 2 : sourceType === 'tertiary' ? 1 : 2;
|
|
171
|
+
// Downgrade factors (GRADE: 5 domains)
|
|
172
|
+
if (signals.sourceReputation < 0.4)
|
|
173
|
+
level--; // Risk of bias
|
|
174
|
+
if (signals.crossCorroboration < 0.4)
|
|
175
|
+
level--; // Inconsistency (not independently confirmed)
|
|
176
|
+
if (signals.instructionScore < 0.8)
|
|
177
|
+
level--; // Imprecision (suspicious content)
|
|
178
|
+
if (signals.gradeAssessment < 0.5)
|
|
179
|
+
level--; // Indirectness
|
|
180
|
+
// Upgrade factors (GRADE: 3 domains)
|
|
181
|
+
if (signals.crossCorroboration > 0.7)
|
|
182
|
+
level++; // Large effect (strong corroboration)
|
|
183
|
+
if (signals.sourceReputation > 0.8)
|
|
184
|
+
level++; // Dose-response (trusted + confirmed)
|
|
185
|
+
// Clamp and map
|
|
186
|
+
level = Math.max(0, Math.min(3, level));
|
|
187
|
+
const grades = ['very_low', 'low', 'moderate', 'high'];
|
|
188
|
+
return grades[level];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Update source reputation based on finding outcomes.
|
|
192
|
+
* Called when human reviews findings (SpamAssassin ham/spam training).
|
|
193
|
+
*/
|
|
194
|
+
export function updateSourceReputation(domain, wasAccurate) {
|
|
195
|
+
const db = getDb();
|
|
196
|
+
const direction = wasAccurate ? 0.05 : -0.1; // Penalize inaccuracy more
|
|
197
|
+
db.prepare(`INSERT INTO source_reputation (domain, reputation_score, total_entries)
|
|
198
|
+
VALUES (?, ?, 1)
|
|
199
|
+
ON CONFLICT(domain) DO UPDATE SET
|
|
200
|
+
reputation_score = MAX(0, MIN(1, reputation_score + ?)),
|
|
201
|
+
total_entries = total_entries + 1,
|
|
202
|
+
flagged_entries = flagged_entries + CASE WHEN ? THEN 0 ELSE 1 END,
|
|
203
|
+
last_updated = datetime('now')`)
|
|
204
|
+
.run(domain, 0.5 + direction, direction, wasAccurate ? 1 : 0);
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=scoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../src/trust/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CA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B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAc,EACd,WAAoB;IAEpB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,2BAA2B;IAExE,EAAE,CAAC,OAAO,CAAC;;;;;;qCAMwB,CAAC;SACjC,GAAG,CAAC,MAAM,EAAE,GAAG,GAAG,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@obsidicore/cascade-engine",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Progressive deep research engine with knowledge graph, trust scoring, and self-regulation. MCP server for Claude Code, OpenClaw, or any MCP client.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"cascade-engine": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*.js",
|
|
12
|
+
"dist/**/*.d.ts",
|
|
13
|
+
"dist/**/*.js.map",
|
|
14
|
+
"dist/db/schema.sql",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc && node -e \"require('fs').copyFileSync('src/db/schema.sql','dist/db/schema.sql')\"",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"start": "node dist/index.js",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
29
|
+
"better-sqlite3": "^11.9.0",
|
|
30
|
+
"zod": "^3.24.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
34
|
+
"@types/node": "^22.15.0",
|
|
35
|
+
"typescript": "^5.8.0",
|
|
36
|
+
"vitest": "^3.1.0"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.0.0"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/geoff-obsidicore/Research-Cascade.git"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"mcp",
|
|
47
|
+
"research",
|
|
48
|
+
"knowledge-graph",
|
|
49
|
+
"ai-agent",
|
|
50
|
+
"memory",
|
|
51
|
+
"sqlite",
|
|
52
|
+
"cascade",
|
|
53
|
+
"trust-scoring",
|
|
54
|
+
"self-regulation"
|
|
55
|
+
],
|
|
56
|
+
"author": "Obsidicore",
|
|
57
|
+
"license": "MIT"
|
|
58
|
+
}
|