evidential-protocol 2.0.0 → 3.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.
- package/dist/attestation.d.ts +80 -0
- package/dist/attestation.d.ts.map +1 -0
- package/dist/attestation.js +115 -0
- package/dist/attestation.js.map +1 -0
- package/dist/audit-ledger.d.ts +96 -0
- package/dist/audit-ledger.d.ts.map +1 -0
- package/dist/audit-ledger.js +152 -0
- package/dist/audit-ledger.js.map +1 -0
- package/dist/dormant.d.ts +59 -0
- package/dist/dormant.d.ts.map +1 -0
- package/dist/dormant.js +256 -0
- package/dist/dormant.js.map +1 -0
- package/dist/ergative.d.ts +75 -0
- package/dist/ergative.d.ts.map +1 -0
- package/dist/ergative.js +227 -0
- package/dist/ergative.js.map +1 -0
- package/dist/fingerprint.d.ts +126 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/fingerprint.js +315 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/provenance.d.ts +101 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +197 -0
- package/dist/provenance.js.map +1 -0
- package/dist/purity.d.ts +85 -0
- package/dist/purity.d.ts.map +1 -0
- package/dist/purity.js +124 -0
- package/dist/purity.js.map +1 -0
- package/dist/resilience.d.ts +63 -0
- package/dist/resilience.d.ts.map +1 -0
- package/dist/resilience.js +241 -0
- package/dist/resilience.js.map +1 -0
- package/dist/scoring.d.ts +87 -0
- package/dist/scoring.d.ts.map +1 -0
- package/dist/scoring.js +202 -0
- package/dist/scoring.js.map +1 -0
- package/dist/self-describing.d.ts +71 -0
- package/dist/self-describing.d.ts.map +1 -0
- package/dist/self-describing.js +153 -0
- package/dist/self-describing.js.map +1 -0
- package/dist/tests/kusunda.test.d.ts +2 -0
- package/dist/tests/kusunda.test.d.ts.map +1 -0
- package/dist/tests/kusunda.test.js +342 -0
- package/dist/tests/kusunda.test.js.map +1 -0
- package/package.json +49 -3
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EP-2: Root Provenance Tracing (Kusunda pre-family lineage)
|
|
3
|
+
*
|
|
4
|
+
* Traces any claim back through the full agent chain to its absolute
|
|
5
|
+
* origin. Supports depth queries, weakest-link analysis, compounding
|
|
6
|
+
* confidence degradation, and Mermaid diagram rendering.
|
|
7
|
+
*/
|
|
8
|
+
import { CLASS_STRENGTH } from "./types.js";
|
|
9
|
+
/** Generate a compact unique ID. */
|
|
10
|
+
function generateId() {
|
|
11
|
+
const ts = Date.now().toString(36);
|
|
12
|
+
const rand = Math.random().toString(36).slice(2, 8);
|
|
13
|
+
return `prov_${ts}_${rand}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Manages a directed acyclic provenance chain.
|
|
17
|
+
*
|
|
18
|
+
* Each node records a claim, its evidence, and a link to its parent.
|
|
19
|
+
* Root nodes represent original observations; leaves are terminal claims.
|
|
20
|
+
*/
|
|
21
|
+
export class ProvenanceChain {
|
|
22
|
+
nodes = new Map();
|
|
23
|
+
childrenIndex = new Map();
|
|
24
|
+
/** Total number of nodes in the chain. */
|
|
25
|
+
get size() {
|
|
26
|
+
return this.nodes.size;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Add a new node to the provenance chain.
|
|
30
|
+
*
|
|
31
|
+
* @param claim - The assertion being made.
|
|
32
|
+
* @param evidence - Evidence supporting the claim.
|
|
33
|
+
* @param producer - Agent or tool that produced this node.
|
|
34
|
+
* @param parentId - ID of the parent node (omit for root nodes).
|
|
35
|
+
* @returns The created ProvenanceNode.
|
|
36
|
+
* @throws If parentId is provided but does not exist in the chain.
|
|
37
|
+
*/
|
|
38
|
+
addNode(claim, evidence, producer, parentId) {
|
|
39
|
+
if (parentId !== undefined && !this.nodes.has(parentId)) {
|
|
40
|
+
throw new Error(`Parent node not found: ${parentId}`);
|
|
41
|
+
}
|
|
42
|
+
const node = {
|
|
43
|
+
id: generateId(),
|
|
44
|
+
claim,
|
|
45
|
+
evidence,
|
|
46
|
+
producer,
|
|
47
|
+
timestamp: new Date().toISOString(),
|
|
48
|
+
parent_id: parentId ?? null,
|
|
49
|
+
};
|
|
50
|
+
this.nodes.set(node.id, node);
|
|
51
|
+
if (parentId !== undefined) {
|
|
52
|
+
const children = this.childrenIndex.get(parentId);
|
|
53
|
+
if (children) {
|
|
54
|
+
children.push(node.id);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.childrenIndex.set(parentId, [node.id]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return node;
|
|
61
|
+
}
|
|
62
|
+
/** Get a node by ID, or undefined if not found. */
|
|
63
|
+
getNode(nodeId) {
|
|
64
|
+
return this.nodes.get(nodeId);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Walk back from a node to the absolute origin.
|
|
68
|
+
*
|
|
69
|
+
* @returns Array of nodes from the given node to the root (inclusive).
|
|
70
|
+
* @throws If nodeId does not exist.
|
|
71
|
+
*/
|
|
72
|
+
traceToRoot(nodeId) {
|
|
73
|
+
const path = [];
|
|
74
|
+
let currentId = nodeId;
|
|
75
|
+
while (currentId !== null) {
|
|
76
|
+
const node = this.nodes.get(currentId);
|
|
77
|
+
if (!node) {
|
|
78
|
+
throw new Error(`Node not found: ${currentId}`);
|
|
79
|
+
}
|
|
80
|
+
path.push(node);
|
|
81
|
+
currentId = node.parent_id;
|
|
82
|
+
}
|
|
83
|
+
return path;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the depth (number of hops from the root) for a node.
|
|
87
|
+
*
|
|
88
|
+
* Root nodes have depth 0.
|
|
89
|
+
* @throws If nodeId does not exist.
|
|
90
|
+
*/
|
|
91
|
+
getDepth(nodeId) {
|
|
92
|
+
// traceToRoot returns [node, ..., root], depth = length - 1
|
|
93
|
+
return this.traceToRoot(nodeId).length - 1;
|
|
94
|
+
}
|
|
95
|
+
/** Get all root nodes (original observations with no parent). */
|
|
96
|
+
getRoots() {
|
|
97
|
+
const roots = [];
|
|
98
|
+
for (const node of this.nodes.values()) {
|
|
99
|
+
if (node.parent_id === null) {
|
|
100
|
+
roots.push(node);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return roots;
|
|
104
|
+
}
|
|
105
|
+
/** Get all leaf nodes (terminal claims with no children). */
|
|
106
|
+
getLeaves() {
|
|
107
|
+
const leaves = [];
|
|
108
|
+
for (const node of this.nodes.values()) {
|
|
109
|
+
const children = this.childrenIndex.get(node.id);
|
|
110
|
+
if (!children || children.length === 0) {
|
|
111
|
+
leaves.push(node);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return leaves;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Find the weakest evidence class in the chain from a node to its root.
|
|
118
|
+
*
|
|
119
|
+
* @returns The lowest evidence class found along the path.
|
|
120
|
+
* @throws If nodeId does not exist.
|
|
121
|
+
*/
|
|
122
|
+
weakestLink(nodeId) {
|
|
123
|
+
const path = this.traceToRoot(nodeId);
|
|
124
|
+
let weakest = "direct";
|
|
125
|
+
for (const node of path) {
|
|
126
|
+
if (CLASS_STRENGTH[node.evidence.class] < CLASS_STRENGTH[weakest]) {
|
|
127
|
+
weakest = node.evidence.class;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return weakest;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Compute compounding confidence through the chain to root.
|
|
134
|
+
*
|
|
135
|
+
* Each hop multiplies confidence, modeling degradation: the further
|
|
136
|
+
* from the source, the lower the total confidence.
|
|
137
|
+
*
|
|
138
|
+
* @returns Compounded confidence score (0.0 - 1.0).
|
|
139
|
+
* @throws If nodeId does not exist.
|
|
140
|
+
*/
|
|
141
|
+
chainConfidence(nodeId) {
|
|
142
|
+
const path = this.traceToRoot(nodeId);
|
|
143
|
+
let confidence = 1.0;
|
|
144
|
+
for (const node of path) {
|
|
145
|
+
confidence *= node.evidence.confidence;
|
|
146
|
+
}
|
|
147
|
+
return Math.round(confidence * 10000) / 10000;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Render the entire provenance chain as a Mermaid flowchart.
|
|
151
|
+
*
|
|
152
|
+
* Direction: bottom-to-top (roots at bottom, leaves at top).
|
|
153
|
+
*/
|
|
154
|
+
toMermaid() {
|
|
155
|
+
const lines = ["graph BT"];
|
|
156
|
+
for (const node of this.nodes.values()) {
|
|
157
|
+
const label = this.escapeMermaid(`${node.claim}\\n[${node.evidence.class} | ${node.evidence.confidence}]\\n${node.producer}`);
|
|
158
|
+
lines.push(` ${node.id}["${label}"]`);
|
|
159
|
+
}
|
|
160
|
+
for (const node of this.nodes.values()) {
|
|
161
|
+
if (node.parent_id !== null) {
|
|
162
|
+
lines.push(` ${node.parent_id} --> ${node.id}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return lines.join("\n");
|
|
166
|
+
}
|
|
167
|
+
/** Serialize the chain to a JSON-safe snapshot. */
|
|
168
|
+
toJSON() {
|
|
169
|
+
return {
|
|
170
|
+
version: "1.0",
|
|
171
|
+
nodes: Array.from(this.nodes.values()),
|
|
172
|
+
created_at: new Date().toISOString(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/** Restore a chain from a serialized snapshot. */
|
|
176
|
+
static fromJSON(snapshot) {
|
|
177
|
+
const chain = new ProvenanceChain();
|
|
178
|
+
for (const node of snapshot.nodes) {
|
|
179
|
+
chain.nodes.set(node.id, node);
|
|
180
|
+
if (node.parent_id !== null) {
|
|
181
|
+
const children = chain.childrenIndex.get(node.parent_id);
|
|
182
|
+
if (children) {
|
|
183
|
+
children.push(node.id);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
chain.childrenIndex.set(node.parent_id, [node.id]);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return chain;
|
|
191
|
+
}
|
|
192
|
+
// ---- Internal helpers ----
|
|
193
|
+
escapeMermaid(text) {
|
|
194
|
+
return text.replace(/"/g, """);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAyB5C,oCAAoC;AACpC,SAAS,UAAU;IACjB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,OAAO,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAClB,KAAK,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC1C,aAAa,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEpD,0CAA0C;IAC1C,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CACL,KAAa,EACb,QAAkB,EAClB,QAAgB,EAChB,QAAiB;QAEjB,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,IAAI,GAAmB;YAC3B,EAAE,EAAE,UAAU,EAAE;YAChB,KAAK;YACL,QAAQ;YACR,QAAQ;YACR,SAAS,EAAE,IA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UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAC;IACJ,CAAC;IAED,kDAAkD;IAClD,MAAM,CAAC,QAAQ,CAAC,QAAiC;QAC/C,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;QACpC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YAClC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC/B,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACzD,IAAI,QAAQ,EAAE,CAAC;oBACb,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACzB,CAAC;qBAAM,CAAC;oBACN,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,6BAA6B;IAErB,aAAa,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF"}
|
package/dist/purity.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Contamination Detection (Kusunda loanword resistance)
|
|
3
|
+
*
|
|
4
|
+
* Kusunda is a language isolate that historically resisted borrowing
|
|
5
|
+
* from neighbouring Indo-Aryan and Tibeto-Burman languages. This module
|
|
6
|
+
* mirrors that principle: it detects when external or untrusted data
|
|
7
|
+
* enters a content pipeline and quantifies contamination.
|
|
8
|
+
*/
|
|
9
|
+
import { type EvidenceClass } from "./types.js";
|
|
10
|
+
/** Where a piece of content originated. */
|
|
11
|
+
export type SourceOrigin = "internal" | "external" | "cached" | "generated" | "unknown";
|
|
12
|
+
/** A discrete segment of content with known provenance. */
|
|
13
|
+
export interface ContentSegment {
|
|
14
|
+
/** The textual content of this segment. */
|
|
15
|
+
text: string;
|
|
16
|
+
/** Origin classification. */
|
|
17
|
+
origin: SourceOrigin;
|
|
18
|
+
/** Optional human-readable source identifier. */
|
|
19
|
+
source?: string;
|
|
20
|
+
/** Evidence class associated with this segment, if known. */
|
|
21
|
+
evidence_class?: EvidenceClass;
|
|
22
|
+
}
|
|
23
|
+
/** Result of a purity scan across a set of content segments. */
|
|
24
|
+
export interface PurityAnalysis {
|
|
25
|
+
/** Total number of segments scanned. */
|
|
26
|
+
total_segments: number;
|
|
27
|
+
/** Ratio of internal segments (0–1). */
|
|
28
|
+
internal_ratio: number;
|
|
29
|
+
/** Ratio of external segments (0–1). */
|
|
30
|
+
external_ratio: number;
|
|
31
|
+
/** Whether the content is considered contaminated. */
|
|
32
|
+
contaminated: boolean;
|
|
33
|
+
/** Contamination score (0 = pure, 1 = fully contaminated). */
|
|
34
|
+
contamination_score: number;
|
|
35
|
+
/** Segments flagged as external or unknown. */
|
|
36
|
+
flagged_segments: ContentSegment[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Compute a purity score from a set of content segments.
|
|
40
|
+
* Returns a value between 0 (fully contaminated) and 1 (pure).
|
|
41
|
+
*/
|
|
42
|
+
export declare function computePurityScore(segments: ContentSegment[]): number;
|
|
43
|
+
/**
|
|
44
|
+
* Scans content segments for contamination from external or unknown
|
|
45
|
+
* sources. Maintains a registry of known source patterns so that
|
|
46
|
+
* segments can be classified automatically.
|
|
47
|
+
*/
|
|
48
|
+
export declare class PurityScanner {
|
|
49
|
+
private readonly knownSources;
|
|
50
|
+
/**
|
|
51
|
+
* Register a source pattern and its origin classification.
|
|
52
|
+
* When a segment's `source` field matches the pattern (simple
|
|
53
|
+
* `includes` match), it will be classified accordingly.
|
|
54
|
+
*/
|
|
55
|
+
addKnownSource(pattern: string, origin: SourceOrigin): void;
|
|
56
|
+
/**
|
|
57
|
+
* Run a full purity scan. The raw `content` string is accepted for
|
|
58
|
+
* context but the analysis is driven by the structured `segments`.
|
|
59
|
+
*/
|
|
60
|
+
scan(_content: string, segments: ContentSegment[]): PurityAnalysis;
|
|
61
|
+
/**
|
|
62
|
+
* Convenience check: is the content pure enough?
|
|
63
|
+
*
|
|
64
|
+
* @param content - The raw content string (context).
|
|
65
|
+
* @param segments - Structured content segments.
|
|
66
|
+
* @param threshold - Maximum acceptable purity score (default 0.8).
|
|
67
|
+
* A purity score of 0.8 means at most 20% external.
|
|
68
|
+
*/
|
|
69
|
+
isPure(content: string, segments: ContentSegment[], threshold?: number): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Return only segments whose origin is `external` or `unknown`.
|
|
72
|
+
*/
|
|
73
|
+
flagExternalContent(segments: ContentSegment[]): ContentSegment[];
|
|
74
|
+
/**
|
|
75
|
+
* Wrap external/unknown segments with contamination warnings.
|
|
76
|
+
* Returns new segment objects; originals are not mutated.
|
|
77
|
+
*/
|
|
78
|
+
quarantine(segments: ContentSegment[]): ContentSegment[];
|
|
79
|
+
/**
|
|
80
|
+
* Attempt to resolve unknown origins using the known-source registry.
|
|
81
|
+
* Returns a new array; input segments are not mutated.
|
|
82
|
+
*/
|
|
83
|
+
private resolveOrigins;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=purity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity.d.ts","sourceRoot":"","sources":["../src/purity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAMhD,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAExF,2DAA2D;AAC3D,MAAM,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@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Contamination Detection (Kusunda loanword resistance)
|
|
3
|
+
*
|
|
4
|
+
* Kusunda is a language isolate that historically resisted borrowing
|
|
5
|
+
* from neighbouring Indo-Aryan and Tibeto-Burman languages. This module
|
|
6
|
+
* mirrors that principle: it detects when external or untrusted data
|
|
7
|
+
* enters a content pipeline and quantifies contamination.
|
|
8
|
+
*/
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Standalone utility
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
/**
|
|
13
|
+
* Compute a purity score from a set of content segments.
|
|
14
|
+
* Returns a value between 0 (fully contaminated) and 1 (pure).
|
|
15
|
+
*/
|
|
16
|
+
export function computePurityScore(segments) {
|
|
17
|
+
if (segments.length === 0)
|
|
18
|
+
return 1;
|
|
19
|
+
const internalCount = segments.filter((s) => s.origin === "internal" || s.origin === "generated").length;
|
|
20
|
+
return internalCount / segments.length;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Scans content segments for contamination from external or unknown
|
|
24
|
+
* sources. Maintains a registry of known source patterns so that
|
|
25
|
+
* segments can be classified automatically.
|
|
26
|
+
*/
|
|
27
|
+
export class PurityScanner {
|
|
28
|
+
knownSources = [];
|
|
29
|
+
/**
|
|
30
|
+
* Register a source pattern and its origin classification.
|
|
31
|
+
* When a segment's `source` field matches the pattern (simple
|
|
32
|
+
* `includes` match), it will be classified accordingly.
|
|
33
|
+
*/
|
|
34
|
+
addKnownSource(pattern, origin) {
|
|
35
|
+
this.knownSources.push({ pattern, origin });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Run a full purity scan. The raw `content` string is accepted for
|
|
39
|
+
* context but the analysis is driven by the structured `segments`.
|
|
40
|
+
*/
|
|
41
|
+
scan(_content, segments) {
|
|
42
|
+
const resolved = this.resolveOrigins(segments);
|
|
43
|
+
const total = resolved.length;
|
|
44
|
+
if (total === 0) {
|
|
45
|
+
return {
|
|
46
|
+
total_segments: 0,
|
|
47
|
+
internal_ratio: 1,
|
|
48
|
+
external_ratio: 0,
|
|
49
|
+
contaminated: false,
|
|
50
|
+
contamination_score: 0,
|
|
51
|
+
flagged_segments: [],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const flagged = this.flagExternalContent(resolved);
|
|
55
|
+
const internalCount = resolved.filter((s) => s.origin === "internal" || s.origin === "generated" || s.origin === "cached").length;
|
|
56
|
+
const externalCount = resolved.filter((s) => s.origin === "external" || s.origin === "unknown").length;
|
|
57
|
+
const internalRatio = internalCount / total;
|
|
58
|
+
const externalRatio = externalCount / total;
|
|
59
|
+
const contaminationScore = externalRatio;
|
|
60
|
+
return {
|
|
61
|
+
total_segments: total,
|
|
62
|
+
internal_ratio: internalRatio,
|
|
63
|
+
external_ratio: externalRatio,
|
|
64
|
+
contaminated: contaminationScore > 0.2,
|
|
65
|
+
contamination_score: contaminationScore,
|
|
66
|
+
flagged_segments: flagged,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Convenience check: is the content pure enough?
|
|
71
|
+
*
|
|
72
|
+
* @param content - The raw content string (context).
|
|
73
|
+
* @param segments - Structured content segments.
|
|
74
|
+
* @param threshold - Maximum acceptable purity score (default 0.8).
|
|
75
|
+
* A purity score of 0.8 means at most 20% external.
|
|
76
|
+
*/
|
|
77
|
+
isPure(content, segments, threshold = 0.8) {
|
|
78
|
+
const resolved = this.resolveOrigins(segments);
|
|
79
|
+
const score = computePurityScore(resolved);
|
|
80
|
+
return score >= threshold;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Return only segments whose origin is `external` or `unknown`.
|
|
84
|
+
*/
|
|
85
|
+
flagExternalContent(segments) {
|
|
86
|
+
const resolved = this.resolveOrigins(segments);
|
|
87
|
+
return resolved.filter((s) => s.origin === "external" || s.origin === "unknown");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Wrap external/unknown segments with contamination warnings.
|
|
91
|
+
* Returns new segment objects; originals are not mutated.
|
|
92
|
+
*/
|
|
93
|
+
quarantine(segments) {
|
|
94
|
+
return segments.map((seg) => {
|
|
95
|
+
if (seg.origin === "external" || seg.origin === "unknown") {
|
|
96
|
+
return {
|
|
97
|
+
...seg,
|
|
98
|
+
text: `[QUARANTINED: ${seg.origin} content] ${seg.text} [/QUARANTINED]`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return { ...seg };
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
// -----------------------------------------------------------------------
|
|
105
|
+
// Internal helpers
|
|
106
|
+
// -----------------------------------------------------------------------
|
|
107
|
+
/**
|
|
108
|
+
* Attempt to resolve unknown origins using the known-source registry.
|
|
109
|
+
* Returns a new array; input segments are not mutated.
|
|
110
|
+
*/
|
|
111
|
+
resolveOrigins(segments) {
|
|
112
|
+
return segments.map((seg) => {
|
|
113
|
+
if (seg.origin !== "unknown" || !seg.source)
|
|
114
|
+
return seg;
|
|
115
|
+
for (const entry of this.knownSources) {
|
|
116
|
+
if (seg.source.includes(entry.pattern)) {
|
|
117
|
+
return { ...seg, origin: entry.origin };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return seg;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=purity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity.js","sourceRoot":"","sources":["../src/purity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuCH,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA0B;IAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAEpC,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CACnC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC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,CAAC;IAED,0EAA0E;IAC1E,mBAAmB;IACnB,0EAA0E;IAE1E;;;OAGG;IACK,cAAc,CAAC,QAA0B;QAC/C,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAC1B,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,MAAM;gBAAE,OAAO,GAAG,CAAC;YAExD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtC,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;oBACvC,OAAO,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC1C,CAAC;YACH,CAAC;YAED,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resilience Module — Bus Factor / SPOF Detection
|
|
3
|
+
*
|
|
4
|
+
* Inspired by the Kusunda last-speaker problem: when knowledge
|
|
5
|
+
* lives in a single person, language death is one heartbeat away.
|
|
6
|
+
* This module identifies single points of failure across any system.
|
|
7
|
+
*/
|
|
8
|
+
/** A component within the system under analysis. */
|
|
9
|
+
export interface SystemComponent {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
category: "service" | "credential" | "process" | "knowledge" | "infrastructure";
|
|
13
|
+
operators: string[];
|
|
14
|
+
documentation_level: "none" | "minimal" | "adequate" | "comprehensive";
|
|
15
|
+
last_verified?: string;
|
|
16
|
+
restart_method?: "automatic" | "manual" | "unknown";
|
|
17
|
+
criticality: "low" | "medium" | "high" | "critical";
|
|
18
|
+
}
|
|
19
|
+
/** Results of a resilience analysis. */
|
|
20
|
+
export interface ResilienceReport {
|
|
21
|
+
total_components: number;
|
|
22
|
+
spof_count: number;
|
|
23
|
+
at_risk_count: number;
|
|
24
|
+
healthy_count: number;
|
|
25
|
+
overall_score: number;
|
|
26
|
+
spofs: SystemComponent[];
|
|
27
|
+
recommendations: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Analyzes a collection of system components for single points of failure,
|
|
31
|
+
* documentation gaps, and manual-restart risks.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ResilienceAnalyzer {
|
|
34
|
+
private components;
|
|
35
|
+
/** Register a component for analysis. */
|
|
36
|
+
addComponent(component: SystemComponent): void;
|
|
37
|
+
/** Get the bus factor (number of operators) for a component. */
|
|
38
|
+
getBusFactor(componentId: string): number;
|
|
39
|
+
/** Return all components with no documentation. */
|
|
40
|
+
getUndocumented(): SystemComponent[];
|
|
41
|
+
/** Return all components requiring manual restart. */
|
|
42
|
+
getManualRestarts(): SystemComponent[];
|
|
43
|
+
/** Return critical components with only one operator (bus factor = 1). */
|
|
44
|
+
getCriticalSpofs(): SystemComponent[];
|
|
45
|
+
/** Run the full resilience analysis. */
|
|
46
|
+
analyze(): ResilienceReport;
|
|
47
|
+
/**
|
|
48
|
+
* Generate a continuity document in Markdown covering every SPOF
|
|
49
|
+
* and concrete remediation steps.
|
|
50
|
+
*/
|
|
51
|
+
generateContinuityDoc(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Compute an overall resilience score from 0 (fragile) to 1 (robust).
|
|
54
|
+
* Weights each component by criticality, penalizes low bus factor
|
|
55
|
+
* and poor documentation.
|
|
56
|
+
*/
|
|
57
|
+
private computeOverallScore;
|
|
58
|
+
/** Build actionable recommendations from the analysis. */
|
|
59
|
+
private buildRecommendations;
|
|
60
|
+
/** Generate remediation advice for a single SPOF. */
|
|
61
|
+
private remediationFor;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=resilience.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resilience.d.ts","sourceRoot":"","sources":["../src/resilience.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAE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