@mneme-ai/core 0.25.0 → 0.26.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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/index.d.ts +34 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +51 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/mpe.d.ts +83 -0
- package/dist/pipeline/mpe.d.ts.map +1 -0
- package/dist/pipeline/mpe.js +259 -0
- package/dist/pipeline/mpe.js.map +1 -0
- package/dist/pipeline/mpe.test.d.ts +2 -0
- package/dist/pipeline/mpe.test.d.ts.map +1 -0
- package/dist/pipeline/mpe.test.js +196 -0
- package/dist/pipeline/mpe.test.js.map +1 -0
- package/dist/pipeline/pipeline.integration.test.d.ts +2 -0
- package/dist/pipeline/pipeline.integration.test.d.ts.map +1 -0
- package/dist/pipeline/pipeline.integration.test.js +99 -0
- package/dist/pipeline/pipeline.integration.test.js.map +1 -0
- package/dist/pipeline/super-pipeline.d.ts +38 -0
- package/dist/pipeline/super-pipeline.d.ts.map +1 -0
- package/dist/pipeline/super-pipeline.js +247 -0
- package/dist/pipeline/super-pipeline.js.map +1 -0
- package/dist/pipeline/super-pipeline.test.d.ts +2 -0
- package/dist/pipeline/super-pipeline.test.d.ts.map +1 -0
- package/dist/pipeline/super-pipeline.test.js +130 -0
- package/dist/pipeline/super-pipeline.test.js.map +1 -0
- package/dist/pipeline/superscalar.d.ts +36 -0
- package/dist/pipeline/superscalar.d.ts.map +1 -0
- package/dist/pipeline/superscalar.js +130 -0
- package/dist/pipeline/superscalar.js.map +1 -0
- package/dist/pipeline/superscalar.test.d.ts +2 -0
- package/dist/pipeline/superscalar.test.d.ts.map +1 -0
- package/dist/pipeline/superscalar.test.js +130 -0
- package/dist/pipeline/superscalar.test.js.map +1 -0
- package/dist/pipeline/types.d.ts +104 -0
- package/dist/pipeline/types.d.ts.map +1 -0
- package/dist/pipeline/types.js +15 -0
- package/dist/pipeline/types.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export * as quant from "./quant/index.js";
|
|
|
13
13
|
export * as guardian from "./guardian/index.js";
|
|
14
14
|
export * as forensics from "./forensics/index.js";
|
|
15
15
|
export * as htc from "./htc/index.js";
|
|
16
|
+
export * as pipeline from "./pipeline/index.js";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,4 +13,5 @@ export * as quant from "./quant/index.js";
|
|
|
13
13
|
export * as guardian from "./guardian/index.js";
|
|
14
14
|
export * as forensics from "./forensics/index.js";
|
|
15
15
|
export * as htc from "./htc/index.js";
|
|
16
|
+
export * as pipeline from "./pipeline/index.js";
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AACh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@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Super Pipeline Engine — barrel.
|
|
3
|
+
*
|
|
4
|
+
* Public surface for Mneme v0.26.0:
|
|
5
|
+
* - types.ts — PipelineStage, PipelineConfig, PipelineEvent
|
|
6
|
+
* - super-pipeline.ts — runPipeline (the deeply-pipelined runtime)
|
|
7
|
+
* - superscalar.ts — superscalar / reorderBySeq / speculatePrefetch
|
|
8
|
+
* - mpe.ts — Multi-stage Pipelined Eigentrust
|
|
9
|
+
*
|
|
10
|
+
* The novel contribution: MPE composes Eigentrust (P2P reputation) with
|
|
11
|
+
* pipeline scheduling (CPU architecture) and adds latency-weighted success.
|
|
12
|
+
* Mneme is the first CLI memory layer to use this combination.
|
|
13
|
+
*/
|
|
14
|
+
export * from "./types.js";
|
|
15
|
+
export * from "./super-pipeline.js";
|
|
16
|
+
export * from "./superscalar.js";
|
|
17
|
+
export * from "./mpe.js";
|
|
18
|
+
import type { PipelineConfig, PipelineStage } from "./types.js";
|
|
19
|
+
/**
|
|
20
|
+
* Run any sequence of stages as a deeply-pipelined superscalar engine and
|
|
21
|
+
* return the outputs in INPUT ORDER. Auto-tunes via MPE if `mpe` is set.
|
|
22
|
+
*
|
|
23
|
+
* For streaming use cases (or when input order doesn't matter) prefer
|
|
24
|
+
* runPipeline directly — it yields out-of-order with seq tags.
|
|
25
|
+
*/
|
|
26
|
+
export declare function runDeepPipeline<I, O>(cfg: PipelineConfig, inputs: AsyncIterable<I> | Iterable<I>): Promise<O[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Build a PipelineStage from a plain function + id. Convenience for tests
|
|
29
|
+
* and for ad-hoc pipelines where defining a class is overkill.
|
|
30
|
+
*/
|
|
31
|
+
export declare function defineStage<I, O>(id: string, description: string, fn: (input: I) => O | Promise<O>, opts?: {
|
|
32
|
+
targetMs?: number;
|
|
33
|
+
}): PipelineStage<I, O>;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAW,MAAM,YAAY,CAAC;AAIzE;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,CAAC,EACxC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GACrC,OAAO,CAAC,CAAC,EAAE,CAAC,CASd;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAC9B,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAChC,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CASrB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Super Pipeline Engine — barrel.
|
|
3
|
+
*
|
|
4
|
+
* Public surface for Mneme v0.26.0:
|
|
5
|
+
* - types.ts — PipelineStage, PipelineConfig, PipelineEvent
|
|
6
|
+
* - super-pipeline.ts — runPipeline (the deeply-pipelined runtime)
|
|
7
|
+
* - superscalar.ts — superscalar / reorderBySeq / speculatePrefetch
|
|
8
|
+
* - mpe.ts — Multi-stage Pipelined Eigentrust
|
|
9
|
+
*
|
|
10
|
+
* The novel contribution: MPE composes Eigentrust (P2P reputation) with
|
|
11
|
+
* pipeline scheduling (CPU architecture) and adds latency-weighted success.
|
|
12
|
+
* Mneme is the first CLI memory layer to use this combination.
|
|
13
|
+
*/
|
|
14
|
+
export * from "./types.js";
|
|
15
|
+
export * from "./super-pipeline.js";
|
|
16
|
+
export * from "./superscalar.js";
|
|
17
|
+
export * from "./mpe.js";
|
|
18
|
+
import { runPipeline } from "./super-pipeline.js";
|
|
19
|
+
import { reorderBySeq } from "./superscalar.js";
|
|
20
|
+
/**
|
|
21
|
+
* Run any sequence of stages as a deeply-pipelined superscalar engine and
|
|
22
|
+
* return the outputs in INPUT ORDER. Auto-tunes via MPE if `mpe` is set.
|
|
23
|
+
*
|
|
24
|
+
* For streaming use cases (or when input order doesn't matter) prefer
|
|
25
|
+
* runPipeline directly — it yields out-of-order with seq tags.
|
|
26
|
+
*/
|
|
27
|
+
export async function runDeepPipeline(cfg, inputs) {
|
|
28
|
+
const out = [];
|
|
29
|
+
// runPipeline yields SeqItem<O> in completion order; reorderBySeq
|
|
30
|
+
// restores input order before we collect.
|
|
31
|
+
const ordered = reorderBySeq(runPipeline(cfg, inputs));
|
|
32
|
+
for await (const item of ordered) {
|
|
33
|
+
out.push(item.value);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build a PipelineStage from a plain function + id. Convenience for tests
|
|
39
|
+
* and for ad-hoc pipelines where defining a class is overkill.
|
|
40
|
+
*/
|
|
41
|
+
export function defineStage(id, description, fn, opts = {}) {
|
|
42
|
+
return {
|
|
43
|
+
id,
|
|
44
|
+
description,
|
|
45
|
+
targetMs: opts.targetMs,
|
|
46
|
+
async process(input) {
|
|
47
|
+
return await fn(input);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AAGzB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAmB,EACnB,MAAsC;IAEtC,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,kEAAkE;IAClE,0CAA0C;IAC1C,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAO,GAAG,EAAE,MAAM,CAA8B,CAAC,CAAC;IAC1F,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QACjC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,EAAU,EACV,WAAmB,EACnB,EAAgC,EAChC,OAA8B,EAAE;IAEhC,OAAO;QACL,EAAE;QACF,WAAW;QACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,CAAC,OAAO,CAAC,KAAK;YACjB,OAAO,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** Per-stage trust eigenvector. Updates after every pipeline run. */
|
|
2
|
+
export interface MpeState {
|
|
3
|
+
trust: Map<string, number>;
|
|
4
|
+
successCount: Map<string, number>;
|
|
5
|
+
failureCount: Map<string, number>;
|
|
6
|
+
totalLatencyMs: Map<string, number>;
|
|
7
|
+
callCount: Map<string, number>;
|
|
8
|
+
/** Soft target latency per stage — used in latency weighting. */
|
|
9
|
+
targetMs: Map<string, number>;
|
|
10
|
+
/** PageRank-style decay term. */
|
|
11
|
+
decay: number;
|
|
12
|
+
/** Last update ISO ts. */
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Single observation produced by the pipeline runtime. */
|
|
16
|
+
export interface StageResult {
|
|
17
|
+
stage: string;
|
|
18
|
+
ok: boolean;
|
|
19
|
+
latencyMs: number;
|
|
20
|
+
/** Optional target latency for the stage. Defaults to whatever's already
|
|
21
|
+
* recorded in MpeState.targetMs (or 100ms if neither is present). */
|
|
22
|
+
targetMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Recommend an action for the next pipeline run based on trust. */
|
|
25
|
+
export interface MpeRecommendation {
|
|
26
|
+
/** Stages to allocate MORE workers to (high trust + bottleneck). */
|
|
27
|
+
scaleUp: string[];
|
|
28
|
+
/** Stages to allocate FEWER workers to (low trust, save resources). */
|
|
29
|
+
scaleDown: string[];
|
|
30
|
+
/** Stages where speculative pre-fetch is unsafe (low trust). */
|
|
31
|
+
noSpeculate: string[];
|
|
32
|
+
/** Updated trust ranking, top-down. */
|
|
33
|
+
ranking: Array<{
|
|
34
|
+
stage: string;
|
|
35
|
+
trust: number;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/** Build an empty MpeState with the given decay (default 0.85). */
|
|
39
|
+
export declare function emptyMpeState(decay?: number): MpeState;
|
|
40
|
+
/**
|
|
41
|
+
* Apply one Eigentrust-style update step to `state` given the latest
|
|
42
|
+
* batch of stage observations. The function is pure — it returns a new
|
|
43
|
+
* MpeState rather than mutating the input.
|
|
44
|
+
*
|
|
45
|
+
* The math is:
|
|
46
|
+
*
|
|
47
|
+
* prior_i = 1 / numStages
|
|
48
|
+
* e_i = sum over results in stage i of (ok ? exp(-lat / target) : 0) / count
|
|
49
|
+
* T'_i = α × e_i × T_i + (1 - α) × prior_i
|
|
50
|
+
*
|
|
51
|
+
* After computing the raw vector we renormalize so it sums to 1, which
|
|
52
|
+
* makes it a probability distribution (proper eigenvector form).
|
|
53
|
+
*/
|
|
54
|
+
export declare function updateMpe(state: MpeState, results: StageResult[]): MpeState;
|
|
55
|
+
/**
|
|
56
|
+
* Power iteration helper — repeatedly applies updateMpe with the SAME batch
|
|
57
|
+
* of results until the eigenvector converges (L1 distance < tol or maxIter).
|
|
58
|
+
* Useful in tests and when you want a stable ranking without waiting for
|
|
59
|
+
* many real pipeline runs.
|
|
60
|
+
*/
|
|
61
|
+
export declare function powerIterate(state: MpeState, results: StageResult[], opts?: {
|
|
62
|
+
maxIter?: number;
|
|
63
|
+
tol?: number;
|
|
64
|
+
}): MpeState;
|
|
65
|
+
/**
|
|
66
|
+
* Compute a recommendation from the current trust state.
|
|
67
|
+
*
|
|
68
|
+
* Heuristics (deliberately simple — the runtime can override):
|
|
69
|
+
* - scaleUp: top-third of stages by trust AND average latency above
|
|
70
|
+
* target (likely bottlenecks worth more workers).
|
|
71
|
+
* - scaleDown: bottom-third of stages by trust AND failure rate > 30%.
|
|
72
|
+
* - noSpeculate: trust below speculateThreshold (default 0.3 / numStages).
|
|
73
|
+
*/
|
|
74
|
+
export declare function recommendFromMpe(state: MpeState, opts?: {
|
|
75
|
+
speculateThreshold?: number;
|
|
76
|
+
}): MpeRecommendation;
|
|
77
|
+
export declare function serializeMpeState(state: MpeState): string;
|
|
78
|
+
export declare function deserializeMpeState(text: string): MpeState;
|
|
79
|
+
/** Read .mneme/mpe.json. Returns an empty state if the file does not exist. */
|
|
80
|
+
export declare function readMpeState(repoRoot: string): MpeState;
|
|
81
|
+
/** Write .mneme/mpe.json (creates parent dir if needed). */
|
|
82
|
+
export declare function writeMpeState(repoRoot: string, state: MpeState): void;
|
|
83
|
+
//# sourceMappingURL=mpe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpe.d.ts","sourceRoot":"","sources":["../../src/pipeline/mpe.ts"],"names":[],"mappings":"AA4CA,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,EA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AAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5C,QAAQ,CAcV;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,IAAI,GAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO,GACzC,iBAAiB,CAiCnB;AA4BD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAYzD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAY1D;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAQvD;AAED,4DAA4D;AAC5D,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAIrE"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MPE — Multi-stage Pipelined Eigentrust.
|
|
3
|
+
*
|
|
4
|
+
* The novel formula. Three ingredients composed:
|
|
5
|
+
*
|
|
6
|
+
* 1. Eigentrust (Kamvar, Schlosser, Garcia-Molina 2003) — P2P reputation
|
|
7
|
+
* via power iteration on a stochastic trust matrix.
|
|
8
|
+
* 2. PageRank-style decay — preserves recency bias and prevents the
|
|
9
|
+
* eigenvector from collapsing onto one dominant stage.
|
|
10
|
+
* 3. Latency-weighted success — fast successful stages contribute more
|
|
11
|
+
* to the trust update than slow successful stages.
|
|
12
|
+
*
|
|
13
|
+
* The update at iteration n:
|
|
14
|
+
*
|
|
15
|
+
* T_n = α × E_n × T_{n-1} + (1 - α) × prior
|
|
16
|
+
*
|
|
17
|
+
* where:
|
|
18
|
+
* T_n trust eigenvector at iteration n (Map<stage, [0..1]>)
|
|
19
|
+
* E_n stage success matrix at iteration n (diagonal — each
|
|
20
|
+
* stage's contribution is independent; latency-discounted)
|
|
21
|
+
* α decay (PageRank teleport probability) default 0.85
|
|
22
|
+
* prior uniform exploration term 1 / numStages
|
|
23
|
+
*
|
|
24
|
+
* E_n is built from per-stage StageResult observations:
|
|
25
|
+
*
|
|
26
|
+
* e_i = ok ? exp(-latency / target) : 0
|
|
27
|
+
*
|
|
28
|
+
* so a fast success ≈ 1, a slow success approaches 0, a failure is exactly 0.
|
|
29
|
+
* The exponential decay is the latency weighting referenced above.
|
|
30
|
+
*
|
|
31
|
+
* After enough iterations (or just one, if initial trust is uniform) the
|
|
32
|
+
* eigenvector ranks stages by recency × success × speed. The runtime uses
|
|
33
|
+
* this ranking to:
|
|
34
|
+
* 1. Allocate more workers to high-trust bottlenecks (scaleUp)
|
|
35
|
+
* 2. Reclaim workers from low-trust noisy stages (scaleDown)
|
|
36
|
+
* 3. Suppress speculative pre-fetch when trust < speculateThreshold
|
|
37
|
+
*
|
|
38
|
+
* Mneme is the first CLI memory layer to compose Eigentrust with deep
|
|
39
|
+
* pipeline scheduling. The persistence file is .mneme/mpe.json so the
|
|
40
|
+
* trust ranking carries across runs and adapts to each repo + user.
|
|
41
|
+
*/
|
|
42
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
43
|
+
import { dirname, join } from "node:path";
|
|
44
|
+
/** Build an empty MpeState with the given decay (default 0.85). */
|
|
45
|
+
export function emptyMpeState(decay = 0.85) {
|
|
46
|
+
return {
|
|
47
|
+
trust: new Map(),
|
|
48
|
+
successCount: new Map(),
|
|
49
|
+
failureCount: new Map(),
|
|
50
|
+
totalLatencyMs: new Map(),
|
|
51
|
+
callCount: new Map(),
|
|
52
|
+
targetMs: new Map(),
|
|
53
|
+
decay,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Apply one Eigentrust-style update step to `state` given the latest
|
|
58
|
+
* batch of stage observations. The function is pure — it returns a new
|
|
59
|
+
* MpeState rather than mutating the input.
|
|
60
|
+
*
|
|
61
|
+
* The math is:
|
|
62
|
+
*
|
|
63
|
+
* prior_i = 1 / numStages
|
|
64
|
+
* e_i = sum over results in stage i of (ok ? exp(-lat / target) : 0) / count
|
|
65
|
+
* T'_i = α × e_i × T_i + (1 - α) × prior_i
|
|
66
|
+
*
|
|
67
|
+
* After computing the raw vector we renormalize so it sums to 1, which
|
|
68
|
+
* makes it a probability distribution (proper eigenvector form).
|
|
69
|
+
*/
|
|
70
|
+
export function updateMpe(state, results) {
|
|
71
|
+
// Defensive: clone all maps so callers can keep using the previous state.
|
|
72
|
+
const trust = new Map(state.trust);
|
|
73
|
+
const successCount = new Map(state.successCount);
|
|
74
|
+
const failureCount = new Map(state.failureCount);
|
|
75
|
+
const totalLatencyMs = new Map(state.totalLatencyMs);
|
|
76
|
+
const callCount = new Map(state.callCount);
|
|
77
|
+
const targetMs = new Map(state.targetMs);
|
|
78
|
+
// Step 1 — fold observations into the running counters.
|
|
79
|
+
// Group results by stage so we can compute a per-stage e_i.
|
|
80
|
+
const perStageContribs = new Map();
|
|
81
|
+
for (const r of results) {
|
|
82
|
+
successCount.set(r.stage, (successCount.get(r.stage) ?? 0) + (r.ok ? 1 : 0));
|
|
83
|
+
failureCount.set(r.stage, (failureCount.get(r.stage) ?? 0) + (r.ok ? 0 : 1));
|
|
84
|
+
totalLatencyMs.set(r.stage, (totalLatencyMs.get(r.stage) ?? 0) + r.latencyMs);
|
|
85
|
+
callCount.set(r.stage, (callCount.get(r.stage) ?? 0) + 1);
|
|
86
|
+
if (r.targetMs !== undefined)
|
|
87
|
+
targetMs.set(r.stage, r.targetMs);
|
|
88
|
+
const target = targetMs.get(r.stage) ?? 100;
|
|
89
|
+
// Latency-weighted success contribution.
|
|
90
|
+
// exp(-lat / target) ∈ (0, 1]; equals 1 at lat=0, ~0.37 at lat=target,
|
|
91
|
+
// ~0.05 at lat=3*target. A failure contributes 0.
|
|
92
|
+
const e = r.ok ? Math.exp(-Math.max(r.latencyMs, 0) / Math.max(target, 1)) : 0;
|
|
93
|
+
const cur = perStageContribs.get(r.stage) ?? { sum: 0, n: 0 };
|
|
94
|
+
cur.sum += e;
|
|
95
|
+
cur.n += 1;
|
|
96
|
+
perStageContribs.set(r.stage, cur);
|
|
97
|
+
}
|
|
98
|
+
// Make sure every known stage exists in trust with a starting value.
|
|
99
|
+
// Stages not seen in this batch keep their previous trust (decay applied
|
|
100
|
+
// implicitly — they get the (1-α)*prior nudge but no e_i contribution).
|
|
101
|
+
const allStages = new Set([
|
|
102
|
+
...trust.keys(),
|
|
103
|
+
...successCount.keys(),
|
|
104
|
+
...failureCount.keys(),
|
|
105
|
+
...perStageContribs.keys(),
|
|
106
|
+
]);
|
|
107
|
+
const numStages = Math.max(allStages.size, 1);
|
|
108
|
+
const prior = 1 / numStages;
|
|
109
|
+
const alpha = state.decay;
|
|
110
|
+
// Step 2 — apply the Eigentrust update.
|
|
111
|
+
for (const stage of allStages) {
|
|
112
|
+
const contrib = perStageContribs.get(stage);
|
|
113
|
+
const e = contrib ? contrib.sum / Math.max(contrib.n, 1) : 0;
|
|
114
|
+
// Bootstrap: if the stage has no prior trust, seed it with the prior so
|
|
115
|
+
// the first observation can move it.
|
|
116
|
+
const tPrev = trust.get(stage) ?? prior;
|
|
117
|
+
const tNew = alpha * e * tPrev + (1 - alpha) * prior;
|
|
118
|
+
trust.set(stage, tNew);
|
|
119
|
+
}
|
|
120
|
+
// Step 3 — renormalize so the eigenvector sums to 1.
|
|
121
|
+
let total = 0;
|
|
122
|
+
for (const v of trust.values())
|
|
123
|
+
total += v;
|
|
124
|
+
if (total > 0) {
|
|
125
|
+
for (const [k, v] of trust)
|
|
126
|
+
trust.set(k, v / total);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
trust,
|
|
130
|
+
successCount,
|
|
131
|
+
failureCount,
|
|
132
|
+
totalLatencyMs,
|
|
133
|
+
callCount,
|
|
134
|
+
targetMs,
|
|
135
|
+
decay: state.decay,
|
|
136
|
+
updatedAt: new Date().toISOString(),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Power iteration helper — repeatedly applies updateMpe with the SAME batch
|
|
141
|
+
* of results until the eigenvector converges (L1 distance < tol or maxIter).
|
|
142
|
+
* Useful in tests and when you want a stable ranking without waiting for
|
|
143
|
+
* many real pipeline runs.
|
|
144
|
+
*/
|
|
145
|
+
export function powerIterate(state, results, opts = {}) {
|
|
146
|
+
const maxIter = opts.maxIter ?? 50;
|
|
147
|
+
const tol = opts.tol ?? 1e-6;
|
|
148
|
+
let cur = state;
|
|
149
|
+
for (let i = 0; i < maxIter; i++) {
|
|
150
|
+
const next = updateMpe(cur, results);
|
|
151
|
+
let l1 = 0;
|
|
152
|
+
for (const k of next.trust.keys()) {
|
|
153
|
+
l1 += Math.abs((next.trust.get(k) ?? 0) - (cur.trust.get(k) ?? 0));
|
|
154
|
+
}
|
|
155
|
+
cur = next;
|
|
156
|
+
if (l1 < tol)
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
return cur;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Compute a recommendation from the current trust state.
|
|
163
|
+
*
|
|
164
|
+
* Heuristics (deliberately simple — the runtime can override):
|
|
165
|
+
* - scaleUp: top-third of stages by trust AND average latency above
|
|
166
|
+
* target (likely bottlenecks worth more workers).
|
|
167
|
+
* - scaleDown: bottom-third of stages by trust AND failure rate > 30%.
|
|
168
|
+
* - noSpeculate: trust below speculateThreshold (default 0.3 / numStages).
|
|
169
|
+
*/
|
|
170
|
+
export function recommendFromMpe(state, opts = {}) {
|
|
171
|
+
const ranking = [...state.trust.entries()]
|
|
172
|
+
.map(([stage, trust]) => ({ stage, trust }))
|
|
173
|
+
.sort((a, b) => b.trust - a.trust);
|
|
174
|
+
const numStages = ranking.length || 1;
|
|
175
|
+
const third = Math.max(1, Math.floor(numStages / 3));
|
|
176
|
+
const top = new Set(ranking.slice(0, third).map((r) => r.stage));
|
|
177
|
+
const bottom = new Set(ranking.slice(-third).map((r) => r.stage));
|
|
178
|
+
// Threshold defaults to (speculateThreshold || 0.3) × prior so it scales
|
|
179
|
+
// naturally with stage count.
|
|
180
|
+
const prior = 1 / numStages;
|
|
181
|
+
const noSpecCutoff = (opts.speculateThreshold ?? 0.3) * prior;
|
|
182
|
+
const scaleUp = [];
|
|
183
|
+
const scaleDown = [];
|
|
184
|
+
const noSpeculate = [];
|
|
185
|
+
for (const { stage, trust } of ranking) {
|
|
186
|
+
const calls = state.callCount.get(stage) ?? 0;
|
|
187
|
+
const fails = state.failureCount.get(stage) ?? 0;
|
|
188
|
+
const totalLat = state.totalLatencyMs.get(stage) ?? 0;
|
|
189
|
+
const target = state.targetMs.get(stage) ?? 100;
|
|
190
|
+
const avgLat = calls > 0 ? totalLat / calls : 0;
|
|
191
|
+
const failRate = calls > 0 ? fails / calls : 0;
|
|
192
|
+
if (top.has(stage) && avgLat > target)
|
|
193
|
+
scaleUp.push(stage);
|
|
194
|
+
if (bottom.has(stage) && failRate > 0.3)
|
|
195
|
+
scaleDown.push(stage);
|
|
196
|
+
if (trust < noSpecCutoff)
|
|
197
|
+
noSpeculate.push(stage);
|
|
198
|
+
}
|
|
199
|
+
return { scaleUp, scaleDown, noSpeculate, ranking };
|
|
200
|
+
}
|
|
201
|
+
function mapToObj(m) {
|
|
202
|
+
const o = {};
|
|
203
|
+
for (const [k, v] of m)
|
|
204
|
+
o[k] = v;
|
|
205
|
+
return o;
|
|
206
|
+
}
|
|
207
|
+
function objToMap(o) {
|
|
208
|
+
const m = new Map();
|
|
209
|
+
if (!o)
|
|
210
|
+
return m;
|
|
211
|
+
for (const k of Object.keys(o))
|
|
212
|
+
m.set(k, o[k]);
|
|
213
|
+
return m;
|
|
214
|
+
}
|
|
215
|
+
export function serializeMpeState(state) {
|
|
216
|
+
const json = {
|
|
217
|
+
trust: mapToObj(state.trust),
|
|
218
|
+
successCount: mapToObj(state.successCount),
|
|
219
|
+
failureCount: mapToObj(state.failureCount),
|
|
220
|
+
totalLatencyMs: mapToObj(state.totalLatencyMs),
|
|
221
|
+
callCount: mapToObj(state.callCount),
|
|
222
|
+
targetMs: mapToObj(state.targetMs),
|
|
223
|
+
decay: state.decay,
|
|
224
|
+
updatedAt: state.updatedAt,
|
|
225
|
+
};
|
|
226
|
+
return JSON.stringify(json, null, 2);
|
|
227
|
+
}
|
|
228
|
+
export function deserializeMpeState(text) {
|
|
229
|
+
const json = JSON.parse(text);
|
|
230
|
+
return {
|
|
231
|
+
trust: objToMap(json.trust),
|
|
232
|
+
successCount: objToMap(json.successCount),
|
|
233
|
+
failureCount: objToMap(json.failureCount),
|
|
234
|
+
totalLatencyMs: objToMap(json.totalLatencyMs),
|
|
235
|
+
callCount: objToMap(json.callCount),
|
|
236
|
+
targetMs: objToMap(json.targetMs),
|
|
237
|
+
decay: json.decay ?? 0.85,
|
|
238
|
+
updatedAt: json.updatedAt,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** Read .mneme/mpe.json. Returns an empty state if the file does not exist. */
|
|
242
|
+
export function readMpeState(repoRoot) {
|
|
243
|
+
const p = join(repoRoot, ".mneme", "mpe.json");
|
|
244
|
+
if (!existsSync(p))
|
|
245
|
+
return emptyMpeState();
|
|
246
|
+
try {
|
|
247
|
+
return deserializeMpeState(readFileSync(p, "utf8"));
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
return emptyMpeState();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** Write .mneme/mpe.json (creates parent dir if needed). */
|
|
254
|
+
export function writeMpeState(repoRoot, state) {
|
|
255
|
+
const p = join(repoRoot, ".mneme", "mpe.json");
|
|
256
|
+
mkdirSync(dirname(p), { recursive: true });
|
|
257
|
+
writeFileSync(p, serializeMpeState(state), "utf8");
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=mpe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpe.js","sourceRoot":"","sources":["../../src/pipeline/mpe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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