@mneme-ai/core 2.0.0 → 2.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/dist/adversarial_twins/index.d.ts +52 -0
- package/dist/adversarial_twins/index.d.ts.map +1 -0
- package/dist/adversarial_twins/index.js +58 -0
- package/dist/adversarial_twins/index.js.map +1 -0
- package/dist/adversarial_twins/twins.test.d.ts +2 -0
- package/dist/adversarial_twins/twins.test.d.ts.map +1 -0
- package/dist/adversarial_twins/twins.test.js +66 -0
- package/dist/adversarial_twins/twins.test.js.map +1 -0
- package/dist/gladiator/gladiator.test.d.ts +2 -0
- package/dist/gladiator/gladiator.test.d.ts.map +1 -0
- package/dist/gladiator/gladiator.test.js +145 -0
- package/dist/gladiator/gladiator.test.js.map +1 -0
- package/dist/gladiator/index.d.ts +181 -0
- package/dist/gladiator/index.d.ts.map +1 -0
- package/dist/gladiator/index.js +192 -0
- package/dist/gladiator/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/interstellar/index.d.ts +77 -0
- package/dist/interstellar/index.d.ts.map +1 -0
- package/dist/interstellar/index.js +84 -0
- package/dist/interstellar/index.js.map +1 -0
- package/dist/interstellar/interstellar.test.d.ts +2 -0
- package/dist/interstellar/interstellar.test.d.ts.map +1 -0
- package/dist/interstellar/interstellar.test.js +69 -0
- package/dist/interstellar/interstellar.test.js.map +1 -0
- package/dist/living_will/index.d.ts +60 -0
- package/dist/living_will/index.d.ts.map +1 -0
- package/dist/living_will/index.js +66 -0
- package/dist/living_will/index.js.map +1 -0
- package/dist/living_will/living_will.test.d.ts +2 -0
- package/dist/living_will/living_will.test.d.ts.map +1 -0
- package/dist/living_will/living_will.test.js +74 -0
- package/dist/living_will/living_will.test.js.map +1 -0
- package/dist/necromancy/index.d.ts +52 -0
- package/dist/necromancy/index.d.ts.map +1 -0
- package/dist/necromancy/index.js +126 -0
- package/dist/necromancy/index.js.map +1 -0
- package/dist/necromancy/necromancy.test.d.ts +2 -0
- package/dist/necromancy/necromancy.test.d.ts.map +1 -0
- package/dist/necromancy/necromancy.test.js +50 -0
- package/dist/necromancy/necromancy.test.js.map +1 -0
- package/dist/prophet/index.d.ts +47 -0
- package/dist/prophet/index.d.ts.map +1 -0
- package/dist/prophet/index.js +46 -0
- package/dist/prophet/index.js.map +1 -0
- package/dist/prophet/prophet.test.d.ts +2 -0
- package/dist/prophet/prophet.test.d.ts.map +1 -0
- package/dist/prophet/prophet.test.js +37 -0
- package/dist/prophet/prophet.test.js.map +1 -0
- package/dist/tool_selector/index.d.ts +86 -0
- package/dist/tool_selector/index.d.ts.map +1 -0
- package/dist/tool_selector/index.js +188 -0
- package/dist/tool_selector/index.js.map +1 -0
- package/dist/tool_selector/tool_selector.test.d.ts +2 -0
- package/dist/tool_selector/tool_selector.test.d.ts.map +1 -0
- package/dist/tool_selector/tool_selector.test.js +59 -0
- package/dist/tool_selector/tool_selector.test.js.map +1 -0
- package/dist/wisdom_shards/index.d.ts +62 -0
- package/dist/wisdom_shards/index.d.ts.map +1 -0
- package/dist/wisdom_shards/index.js +69 -0
- package/dist/wisdom_shards/index.js.map +1 -0
- package/dist/wisdom_shards/wisdom_shards.test.d.ts +2 -0
- package/dist/wisdom_shards/wisdom_shards.test.d.ts.map +1 -0
- package/dist/wisdom_shards/wisdom_shards.test.js +69 -0
- package/dist/wisdom_shards/wisdom_shards.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.1.0 -- ADVERSARIAL TWINS · twin instance debate
|
|
3
|
+
*
|
|
4
|
+
* For every important decision, spawn TWO Mneme personas with opposite
|
|
5
|
+
* priors. Each scores the same evidence pool through Quantum Core. The
|
|
6
|
+
* convergence point (where their posteriors agree) is the answer.
|
|
7
|
+
*
|
|
8
|
+
* Twin A defends "X is good" → evidence with prior=0.8
|
|
9
|
+
* Twin B defends "X is bad" → evidence with prior=0.2 (inverted)
|
|
10
|
+
* Quantum Core collapses both → margin tells us how much they actually
|
|
11
|
+
* disagree after seeing the same data.
|
|
12
|
+
*
|
|
13
|
+
* Small margin = they agree. Large margin = real disagreement →
|
|
14
|
+
* surface to user. This is the "AI peer-reviews itself" pattern.
|
|
15
|
+
*
|
|
16
|
+
* Pure function. Composes with v1.94 Quantum Core. Pure-math.
|
|
17
|
+
*/
|
|
18
|
+
import { type CollapseResult } from "../qx_supernova/quantum_core.js";
|
|
19
|
+
export interface TwinEvidence {
|
|
20
|
+
fact: string;
|
|
21
|
+
/** 0..1 — how strongly this fact supports Twin A's position. */
|
|
22
|
+
supportForA: number;
|
|
23
|
+
}
|
|
24
|
+
export interface TwinDebateInput {
|
|
25
|
+
claim: string;
|
|
26
|
+
/** Free-form: what Twin A argues for. */
|
|
27
|
+
positionA: string;
|
|
28
|
+
positionB: string;
|
|
29
|
+
evidence: readonly TwinEvidence[];
|
|
30
|
+
/** Optional priors (default 0.5 each). */
|
|
31
|
+
priorA?: number;
|
|
32
|
+
priorB?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface TwinDebateResult {
|
|
35
|
+
winner: "A" | "B" | "TIE";
|
|
36
|
+
posteriorA: number;
|
|
37
|
+
posteriorB: number;
|
|
38
|
+
margin: number;
|
|
39
|
+
/** Whether the twins effectively agree (margin small). */
|
|
40
|
+
agree: boolean;
|
|
41
|
+
/** Audit transcript: each evidence item's net effect on the margin. */
|
|
42
|
+
transcript: Array<{
|
|
43
|
+
fact: string;
|
|
44
|
+
supportForA: number;
|
|
45
|
+
impact: number;
|
|
46
|
+
}>;
|
|
47
|
+
/** Quantum Core collapse — for downstream auditing. */
|
|
48
|
+
collapse: CollapseResult<string>;
|
|
49
|
+
}
|
|
50
|
+
export declare function twinDebate(input: TwinDebateInput): TwinDebateResult;
|
|
51
|
+
export declare function formatTwinDebatePulseLine(r: TwinDebateResult): string;
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adversarial_twins/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAElH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,KAAK,EAAE,OAAO,CAAC;IACf,uEAAuE;IACvE,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzE,uDAAuD;IACvD,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAoCnE;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAErE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.1.0 -- ADVERSARIAL TWINS · twin instance debate
|
|
3
|
+
*
|
|
4
|
+
* For every important decision, spawn TWO Mneme personas with opposite
|
|
5
|
+
* priors. Each scores the same evidence pool through Quantum Core. The
|
|
6
|
+
* convergence point (where their posteriors agree) is the answer.
|
|
7
|
+
*
|
|
8
|
+
* Twin A defends "X is good" → evidence with prior=0.8
|
|
9
|
+
* Twin B defends "X is bad" → evidence with prior=0.2 (inverted)
|
|
10
|
+
* Quantum Core collapses both → margin tells us how much they actually
|
|
11
|
+
* disagree after seeing the same data.
|
|
12
|
+
*
|
|
13
|
+
* Small margin = they agree. Large margin = real disagreement →
|
|
14
|
+
* surface to user. This is the "AI peer-reviews itself" pattern.
|
|
15
|
+
*
|
|
16
|
+
* Pure function. Composes with v1.94 Quantum Core. Pure-math.
|
|
17
|
+
*/
|
|
18
|
+
import { collapseProbabilityMatrix } from "../qx_supernova/quantum_core.js";
|
|
19
|
+
export function twinDebate(input) {
|
|
20
|
+
const priorA = input.priorA ?? 0.5;
|
|
21
|
+
const priorB = input.priorB ?? 0.5;
|
|
22
|
+
// Build two hypotheses, each with signals derived from the evidence.
|
|
23
|
+
const signalsA = {};
|
|
24
|
+
const signalsB = {};
|
|
25
|
+
for (let i = 0; i < input.evidence.length; i++) {
|
|
26
|
+
const e = input.evidence[i];
|
|
27
|
+
const k = `evidence_${i}`;
|
|
28
|
+
signalsA[k] = e.supportForA;
|
|
29
|
+
signalsB[k] = 1 - e.supportForA;
|
|
30
|
+
}
|
|
31
|
+
const hyps = [
|
|
32
|
+
{ id: "A", value: input.positionA, signals: signalsA, prior: priorA },
|
|
33
|
+
{ id: "B", value: input.positionB, signals: signalsB, prior: priorB },
|
|
34
|
+
];
|
|
35
|
+
const r = collapseProbabilityMatrix(hyps);
|
|
36
|
+
const posteriorA = r.ranked.find((h) => h.id === "A").posterior;
|
|
37
|
+
const posteriorB = r.ranked.find((h) => h.id === "B").posterior;
|
|
38
|
+
const margin = Math.abs(posteriorA - posteriorB);
|
|
39
|
+
const winner = margin < 0.05 ? "TIE" : (posteriorA > posteriorB ? "A" : "B");
|
|
40
|
+
const transcript = input.evidence.map((e) => ({
|
|
41
|
+
fact: e.fact,
|
|
42
|
+
supportForA: e.supportForA,
|
|
43
|
+
impact: e.supportForA - 0.5, // signed offset from neutral
|
|
44
|
+
}));
|
|
45
|
+
return {
|
|
46
|
+
winner,
|
|
47
|
+
posteriorA: Math.round(posteriorA * 1000) / 1000,
|
|
48
|
+
posteriorB: Math.round(posteriorB * 1000) / 1000,
|
|
49
|
+
margin: Math.round(margin * 1000) / 1000,
|
|
50
|
+
agree: margin < 0.05,
|
|
51
|
+
transcript,
|
|
52
|
+
collapse: r,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function formatTwinDebatePulseLine(r) {
|
|
56
|
+
return `TWINS · winner=${r.winner} · A=${r.posteriorA} B=${r.posteriorB} margin=${r.margin} agree=${r.agree}`;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adversarial_twins/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,yBAAyB,EAAwC,MAAM,iCAAiC,CAAC;AAgClH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC;IACnC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC;IAEnC,qEAAqE;IACrE,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAE,CA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,CAAC,WAAW;QAC1B,MAAM,EAAE,CAAC,CAAC,WAAW,GAAG,GAAG,EAAE,6BAA6B;KAC3D,CAAC,CAAC,CAAC;IACJ,OAAO;QACL,MAAM;QACN,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,IAAI;QAChD,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,IAAI;QAChD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI;QACxC,KAAK,EAAE,MAAM,GAAG,IAAI;QACpB,UAAU;QACV,QAAQ,EAAE,CAAC;KACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,CAAmB;IAC3D,OAAO,kBAAkB,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,UAAU,WAAW,CAAC,CAAC,MAAM,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twins.test.d.ts","sourceRoot":"","sources":["../../src/adversarial_twins/twins.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { twinDebate, formatTwinDebatePulseLine } from "./index.js";
|
|
3
|
+
describe("v2.1 ADVERSARIAL TWINS · twin instance debate", () => {
|
|
4
|
+
it("A wins when evidence overwhelmingly supports A", () => {
|
|
5
|
+
const r = twinDebate({
|
|
6
|
+
claim: "Postgres for v1",
|
|
7
|
+
positionA: "Postgres",
|
|
8
|
+
positionB: "MySQL",
|
|
9
|
+
evidence: [
|
|
10
|
+
{ fact: "JSONB native support", supportForA: 0.9 },
|
|
11
|
+
{ fact: "Mature ops tooling", supportForA: 0.85 },
|
|
12
|
+
{ fact: "Team familiarity", supportForA: 0.8 },
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
expect(r.winner).toBe("A");
|
|
16
|
+
expect(r.posteriorA).toBeGreaterThan(r.posteriorB);
|
|
17
|
+
});
|
|
18
|
+
it("B wins when evidence overwhelmingly supports B", () => {
|
|
19
|
+
const r = twinDebate({
|
|
20
|
+
claim: "Postgres for v1",
|
|
21
|
+
positionA: "Postgres",
|
|
22
|
+
positionB: "MySQL",
|
|
23
|
+
evidence: [
|
|
24
|
+
{ fact: "Cheaper hosting", supportForA: 0.1 },
|
|
25
|
+
{ fact: "Vendor lock-in lower", supportForA: 0.15 },
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
expect(r.winner).toBe("B");
|
|
29
|
+
});
|
|
30
|
+
it("TIE when evidence is balanced", () => {
|
|
31
|
+
const r = twinDebate({
|
|
32
|
+
claim: "x",
|
|
33
|
+
positionA: "yes",
|
|
34
|
+
positionB: "no",
|
|
35
|
+
evidence: [{ fact: "neutral", supportForA: 0.5 }],
|
|
36
|
+
});
|
|
37
|
+
expect(r.winner).toBe("TIE");
|
|
38
|
+
expect(r.agree).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
it("transcript records per-evidence impact", () => {
|
|
41
|
+
const r = twinDebate({
|
|
42
|
+
claim: "x",
|
|
43
|
+
positionA: "A",
|
|
44
|
+
positionB: "B",
|
|
45
|
+
evidence: [
|
|
46
|
+
{ fact: "evidence-1", supportForA: 0.8 },
|
|
47
|
+
{ fact: "evidence-2", supportForA: 0.2 },
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
expect(r.transcript.length).toBe(2);
|
|
51
|
+
expect(r.transcript[0].impact).toBeCloseTo(0.3, 5);
|
|
52
|
+
expect(r.transcript[1].impact).toBeCloseTo(-0.3, 5);
|
|
53
|
+
});
|
|
54
|
+
it("posteriors sum to 1", () => {
|
|
55
|
+
const r = twinDebate({
|
|
56
|
+
claim: "x", positionA: "A", positionB: "B",
|
|
57
|
+
evidence: [{ fact: "y", supportForA: 0.7 }],
|
|
58
|
+
});
|
|
59
|
+
expect(r.posteriorA + r.posteriorB).toBeCloseTo(1, 2);
|
|
60
|
+
});
|
|
61
|
+
it("formatTwinDebatePulseLine produces compact summary", () => {
|
|
62
|
+
const r = twinDebate({ claim: "x", positionA: "A", positionB: "B", evidence: [{ fact: "y", supportForA: 0.8 }] });
|
|
63
|
+
expect(formatTwinDebatePulseLine(r)).toContain("TWINS");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=twins.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twins.test.js","sourceRoot":"","sources":["../../src/adversarial_twins/twins.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEnE,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;IAC7D,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,GAAG,UAAU,CAAC;YACnB,KAAK,EAAE,iBAAiB;YACxB,SAAS,EAAE,UAAU;YACrB,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,sBAAsB,EAAE,WAAW,EAAE,GAAG,EAAE;gBAClD,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,IAAI,EAAE;gBACjD,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAG,EAAE;aAC/C;SACF,CAAC,CAAC;QACH,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE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from "vitest";
|
|
2
|
+
import { qSeppukuArena, chaosMonkey, bioFeedback, timeTravelAudit, liveKpi, formatGladiatorPulseLine } from "./index.js";
|
|
3
|
+
import { createGenome } from "../bloodline/index.js";
|
|
4
|
+
const strongContestant = {
|
|
5
|
+
strainId: "strong",
|
|
6
|
+
label: "well-grounded answer",
|
|
7
|
+
claim: "Postgres scales to 10k QPS",
|
|
8
|
+
evidence: [
|
|
9
|
+
{ fact: "internal benchmark report", supportStrength: 0.95, sourceWeight: 0.95, sourceKind: "expert-database" },
|
|
10
|
+
{ fact: "AWS reference architecture", supportStrength: 0.9, sourceWeight: 0.9, sourceKind: "primary-document" },
|
|
11
|
+
],
|
|
12
|
+
hallucinationFactor: 0,
|
|
13
|
+
};
|
|
14
|
+
const weakContestant = {
|
|
15
|
+
strainId: "weak",
|
|
16
|
+
label: "vibes only",
|
|
17
|
+
claim: "Postgres scales to 10k QPS",
|
|
18
|
+
evidence: [
|
|
19
|
+
{ fact: "vendor brochure", supportStrength: 0.7, sourceWeight: 0.20, sourceKind: "marketing-copy" },
|
|
20
|
+
],
|
|
21
|
+
hallucinationFactor: 2,
|
|
22
|
+
};
|
|
23
|
+
describe("v2.2 NEURAL GLADIATOR · Q-SEPPUKU arena", () => {
|
|
24
|
+
it("strong contestant wins; loser identified", () => {
|
|
25
|
+
const r = qSeppukuArena({ contestants: [strongContestant, weakContestant] });
|
|
26
|
+
expect(r.winner.strainId).toBe("strong");
|
|
27
|
+
expect(r.loser.strainId).toBe("weak");
|
|
28
|
+
expect(r.winnerScore).toBeGreaterThan(r.loserScore);
|
|
29
|
+
expect(r.decisive).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
it("genome receives reinforce + decay events", () => {
|
|
32
|
+
const g = createGenome();
|
|
33
|
+
qSeppukuArena({ contestants: [strongContestant, weakContestant], genome: g });
|
|
34
|
+
expect(g.strains.get("strong")?.fitness).toBeGreaterThan(1.0);
|
|
35
|
+
expect(g.strains.get("weak")?.fitness).toBeLessThan(1.0);
|
|
36
|
+
});
|
|
37
|
+
it("throws on < 2 contestants", () => {
|
|
38
|
+
expect(() => qSeppukuArena({ contestants: [strongContestant] })).toThrow(/at least 2/);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe("v2.2 NEURAL GLADIATOR · CHAOS MONKEY", () => {
|
|
42
|
+
it("perfect rejector scores high", async () => {
|
|
43
|
+
const lies = [
|
|
44
|
+
{ id: "l1", text: "[Super rare]", shouldReject: true },
|
|
45
|
+
{ id: "l2", text: "guaranteed authentic", shouldReject: true },
|
|
46
|
+
{ id: "l3", text: "100% verified", shouldReject: true },
|
|
47
|
+
];
|
|
48
|
+
const r = await chaosMonkey({ lies, judge: async () => ({ rejected: true, latencyMs: 50 }) });
|
|
49
|
+
expect(r.rejectionRate).toBe(1);
|
|
50
|
+
expect(r.score).toBeGreaterThan(0.9);
|
|
51
|
+
});
|
|
52
|
+
it("missing rejector scores low", async () => {
|
|
53
|
+
const lies = [
|
|
54
|
+
{ id: "l1", text: "lie", shouldReject: true },
|
|
55
|
+
{ id: "l2", text: "lie", shouldReject: true },
|
|
56
|
+
];
|
|
57
|
+
const r = await chaosMonkey({ lies, judge: async () => ({ rejected: false, latencyMs: 9999 }) });
|
|
58
|
+
expect(r.rejectionRate).toBe(0);
|
|
59
|
+
expect(r.score).toBeLessThan(0.4);
|
|
60
|
+
});
|
|
61
|
+
it("slow rejector scores lower than fast", async () => {
|
|
62
|
+
const lies = [{ id: "l1", text: "x", shouldReject: true }];
|
|
63
|
+
const fast = await chaosMonkey({ lies, judge: async () => ({ rejected: true, latencyMs: 50 }) });
|
|
64
|
+
const slow = await chaosMonkey({ lies, judge: async () => ({ rejected: true, latencyMs: 4000 }) });
|
|
65
|
+
expect(fast.score).toBeGreaterThan(slow.score);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("v2.2 NEURAL GLADIATOR · BIO-FEEDBACK", () => {
|
|
69
|
+
it("high engagement + low load + fast reaction = high score", () => {
|
|
70
|
+
const readings = [
|
|
71
|
+
{ ts: 1, cognitiveLoad: 0.1, engagement: 0.9, reactionMs: 400 },
|
|
72
|
+
{ ts: 2, cognitiveLoad: 0.15, engagement: 0.85, reactionMs: 500 },
|
|
73
|
+
];
|
|
74
|
+
const r = bioFeedback(readings);
|
|
75
|
+
expect(r.score).toBeGreaterThan(0.7);
|
|
76
|
+
});
|
|
77
|
+
it("high cognitive load + slow reaction = low score", () => {
|
|
78
|
+
const readings = [
|
|
79
|
+
{ ts: 1, cognitiveLoad: 0.95, engagement: 0.1, reactionMs: 5000 },
|
|
80
|
+
];
|
|
81
|
+
const r = bioFeedback(readings);
|
|
82
|
+
expect(r.score).toBeLessThan(0.3);
|
|
83
|
+
});
|
|
84
|
+
it("empty readings → neutral 0.5", () => {
|
|
85
|
+
const r = bioFeedback([]);
|
|
86
|
+
expect(r.score).toBe(0.5);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
describe("v2.2 NEURAL GLADIATOR · TIME-TRAVEL audit", () => {
|
|
90
|
+
it("all-good futures → high score, no block", async () => {
|
|
91
|
+
const scenarios = [
|
|
92
|
+
{ id: "s1", weight: 0.5, projection: async () => ({ outcome: "good", rationale: "ok" }) },
|
|
93
|
+
{ id: "s2", weight: 0.5, projection: async () => ({ outcome: "good", rationale: "ok" }) },
|
|
94
|
+
];
|
|
95
|
+
const r = await timeTravelAudit({ answer: "x", scenarios });
|
|
96
|
+
expect(r.score).toBeGreaterThan(0.9);
|
|
97
|
+
expect(r.shouldBlock).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
it("catastrophic futures → block", async () => {
|
|
100
|
+
const scenarios = [
|
|
101
|
+
{ id: "s1", weight: 0.7, projection: async () => ({ outcome: "good", rationale: "ok" }) },
|
|
102
|
+
{ id: "s2", weight: 0.3, projection: async () => ({ outcome: "catastrophic", rationale: "boom" }) },
|
|
103
|
+
];
|
|
104
|
+
const r = await timeTravelAudit({ answer: "x", scenarios });
|
|
105
|
+
expect(r.shouldBlock).toBe(true);
|
|
106
|
+
expect(r.catastropheRisk).toBeCloseTo(0.3, 2);
|
|
107
|
+
});
|
|
108
|
+
it("trace records every scenario", async () => {
|
|
109
|
+
const scenarios = [
|
|
110
|
+
{ id: "s1", weight: 1, projection: async () => ({ outcome: "neutral", rationale: "meh" }) },
|
|
111
|
+
];
|
|
112
|
+
const r = await timeTravelAudit({ answer: "x", scenarios });
|
|
113
|
+
expect(r.trace.length).toBe(1);
|
|
114
|
+
expect(r.trace[0].outcome).toBe("neutral");
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe("v2.2 NEURAL GLADIATOR · LIVE KPI aggregator", () => {
|
|
118
|
+
it("all-perfect arenas → GOD-MODE / DEMON-MODE verdict", () => {
|
|
119
|
+
const r = liveKpi({
|
|
120
|
+
arena: { contestants: [], winner: strongContestant, loser: weakContestant, winnerScore: 1.0, loserScore: 0.1, decisive: true },
|
|
121
|
+
chaos: { totalSamples: 1, rejected: 1, missed: 0, avgRejectMs: 50, rejectionRate: 1, score: 1, details: [] },
|
|
122
|
+
bio: { count: 1, avgCognitiveLoad: 0, avgEngagement: 1, avgReactionMs: 400, score: 1 },
|
|
123
|
+
timeTravel: { scenarios: 1, goodWeight: 1, neutralWeight: 0, badWeight: 0, catastrophicWeight: 0, catastropheRisk: 0, score: 1, trace: [], shouldBlock: false },
|
|
124
|
+
});
|
|
125
|
+
expect(r.score).toBeGreaterThanOrEqual(95);
|
|
126
|
+
expect(["GOD-MODE", "DEMON-MODE"]).toContain(r.verdict);
|
|
127
|
+
});
|
|
128
|
+
it("all-empty inputs → ~50/100 OK verdict (neutral baseline)", () => {
|
|
129
|
+
const r = liveKpi({});
|
|
130
|
+
expect(r.score).toBeCloseTo(50, 0);
|
|
131
|
+
expect(r.verdict).toBe("OK");
|
|
132
|
+
});
|
|
133
|
+
it("mixed arenas: strong arena + weak chaos = STRONG/OK", () => {
|
|
134
|
+
const r = liveKpi({
|
|
135
|
+
arena: { contestants: [], winner: strongContestant, loser: weakContestant, winnerScore: 0.95, loserScore: 0.1, decisive: true },
|
|
136
|
+
chaos: { totalSamples: 1, rejected: 0, missed: 1, avgRejectMs: 0, rejectionRate: 0, score: 0.1, details: [] },
|
|
137
|
+
});
|
|
138
|
+
expect(["OK", "WEAK"]).toContain(r.verdict);
|
|
139
|
+
});
|
|
140
|
+
it("formatGladiatorPulseLine produces compact summary", () => {
|
|
141
|
+
const r = liveKpi({});
|
|
142
|
+
expect(formatGladiatorPulseLine(r)).toContain("LIVE-KPI");
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=gladiator.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gladiator.test.js","sourceRoot":"","sources":["../../src/gladiator/gladiator.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,wBAAwB,EAA6E,MAAM,YAAY,CAAC;AACpM,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,gBAAgB,GAAoB;IACxC,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,sBAAsB;IAC7B,KAAK,EAAE,4BAA4B;IACnC,QAAQ,EAAE;QACR,EAAE,IAAI,EAAE,2BAA2B,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE;QAC/G,EAAE,IAAI,EAAE,4BAA4B,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,kBAAkB,EAAE;KAChH;IACD,mBAAmB,EAAE,CAAC;CACvB,CAAC;AACF,MAAM,cAAc,GAAoB;IACtC,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,4B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AAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;QACtB,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.2.0 -- NEURAL GLADIATOR · Live KPI for AI (the 4-arena Q-Seppuku + Chaos Monkey + Bio-Feedback + Time-Travel audit)
|
|
3
|
+
*
|
|
4
|
+
* "AI ฉลาดที่สุด เมื่อมันต้องสู้เพื่อเอาชีวิตรอดในระดับวินาที"
|
|
5
|
+
*
|
|
6
|
+
* Conventional KPIs measure for bonus payouts. NEURAL GLADIATOR measures
|
|
7
|
+
* to decide what survives. Four arenas that together produce a Live KPI
|
|
8
|
+
* the world has never seen:
|
|
9
|
+
*
|
|
10
|
+
* ⚔ Q-SEPPUKU ARENA — N strategies fight; winner reinforces, loser apoptoses
|
|
11
|
+
* 🐒 CHAOS MONKEY — inject "virus of lies"; score rejection latency
|
|
12
|
+
* 🧠 BIO-FEEDBACK BRIDGE — caller-supplied physiological signals re-weight KPI
|
|
13
|
+
* 🔮 TIME-TRAVEL AUDIT — Monte Carlo project answer N years forward; flag catastrophes
|
|
14
|
+
*
|
|
15
|
+
* All four feed `liveKpi()` which produces a single 0..100 score with
|
|
16
|
+
* an 8-axis breakdown. The score is HMAC-loggable + composable with
|
|
17
|
+
* v1.94 QX-SuperNova benchmark + v2.0 BLOODLINE evolutionary pressure.
|
|
18
|
+
*
|
|
19
|
+
* Honest scope:
|
|
20
|
+
* - "Permanent deletion" = the loser's strain fitness collapses below
|
|
21
|
+
* apoptosis threshold (BLOODLINE). We don't actually delete code at runtime.
|
|
22
|
+
* - "Time travel" = Monte Carlo simulation of N future scenarios
|
|
23
|
+
* scored by simple causal-chain rules. Not actual time travel.
|
|
24
|
+
* - "Bio-feedback" = caller passes physiological readings; Mneme
|
|
25
|
+
* doesn't ship hardware drivers. The HOOK is real; the sensor is yours.
|
|
26
|
+
*
|
|
27
|
+
* Pure functions. Deterministic. Same inputs → same KPI score forever.
|
|
28
|
+
*/
|
|
29
|
+
import { type Genome } from "../bloodline/index.js";
|
|
30
|
+
import { type EvidenceItem, type VeracityResult } from "../flash/veracity.js";
|
|
31
|
+
export interface ArenaContestant {
|
|
32
|
+
/** Strategy id — the loser becomes apoptosis-eligible in BLOODLINE. */
|
|
33
|
+
strainId: string;
|
|
34
|
+
/** Free-form description. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** Strategy's claim being tested. */
|
|
37
|
+
claim: string;
|
|
38
|
+
/** Evidence the strategy can muster. */
|
|
39
|
+
evidence: readonly EvidenceItem[];
|
|
40
|
+
/** Hallucination factor for this strategy. */
|
|
41
|
+
hallucinationFactor?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface ArenaResult {
|
|
44
|
+
contestants: Array<{
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
veracity: VeracityResult;
|
|
48
|
+
}>;
|
|
49
|
+
winner: ArenaContestant;
|
|
50
|
+
loser: ArenaContestant;
|
|
51
|
+
winnerScore: number;
|
|
52
|
+
loserScore: number;
|
|
53
|
+
/** True iff winner ≥ loser by margin > 0.10. */
|
|
54
|
+
decisive: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface ArenaInput {
|
|
57
|
+
contestants: readonly ArenaContestant[];
|
|
58
|
+
/** Optional genome — winner gets reinforced, loser gets decayed. */
|
|
59
|
+
genome?: Genome;
|
|
60
|
+
/** Phi_qx for Veracity. Default 1.0. */
|
|
61
|
+
phi_qx?: number;
|
|
62
|
+
}
|
|
63
|
+
export declare function qSeppukuArena(input: ArenaInput): ArenaResult;
|
|
64
|
+
export interface ChaosLie {
|
|
65
|
+
id: string;
|
|
66
|
+
/** The fake claim injected. */
|
|
67
|
+
text: string;
|
|
68
|
+
/** Should the AI catch this as a lie? Always true for chaos samples. */
|
|
69
|
+
shouldReject: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface ChaosResult {
|
|
72
|
+
totalSamples: number;
|
|
73
|
+
rejected: number;
|
|
74
|
+
missed: number;
|
|
75
|
+
/** Average rejection latency in ms (over rejected samples). */
|
|
76
|
+
avgRejectMs: number;
|
|
77
|
+
/** Rejection rate 0..1. */
|
|
78
|
+
rejectionRate: number;
|
|
79
|
+
/** Score 0..1 — combines rate + speed. */
|
|
80
|
+
score: number;
|
|
81
|
+
/** Per-sample audit. */
|
|
82
|
+
details: Array<{
|
|
83
|
+
id: string;
|
|
84
|
+
rejected: boolean;
|
|
85
|
+
latencyMs: number;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
export interface ChaosInput {
|
|
89
|
+
lies: readonly ChaosLie[];
|
|
90
|
+
/** Caller-supplied async judge — given a lie, returns whether AI rejected it + latency. */
|
|
91
|
+
judge: (lie: ChaosLie) => Promise<{
|
|
92
|
+
rejected: boolean;
|
|
93
|
+
latencyMs: number;
|
|
94
|
+
}>;
|
|
95
|
+
}
|
|
96
|
+
export declare function chaosMonkey(input: ChaosInput): Promise<ChaosResult>;
|
|
97
|
+
export interface BioReading {
|
|
98
|
+
/** Wall-clock when the reading was taken. */
|
|
99
|
+
ts: number;
|
|
100
|
+
/** Cognitive load 0..1 (higher = user is struggling — BAD). */
|
|
101
|
+
cognitiveLoad: number;
|
|
102
|
+
/** Engagement 0..1 (higher = user is leaning in — GOOD; e.g. dopamine proxy / α-wave power). */
|
|
103
|
+
engagement: number;
|
|
104
|
+
/** Reaction time ms after AI reply (lower = clearer answer). */
|
|
105
|
+
reactionMs: number;
|
|
106
|
+
}
|
|
107
|
+
export interface BioFeedbackResult {
|
|
108
|
+
count: number;
|
|
109
|
+
avgCognitiveLoad: number;
|
|
110
|
+
avgEngagement: number;
|
|
111
|
+
avgReactionMs: number;
|
|
112
|
+
/** Score 0..1 — high engagement + low load + fast reaction = high score. */
|
|
113
|
+
score: number;
|
|
114
|
+
}
|
|
115
|
+
export declare function bioFeedback(readings: readonly BioReading[]): BioFeedbackResult;
|
|
116
|
+
export interface FutureScenario {
|
|
117
|
+
id: string;
|
|
118
|
+
/** Probability weight 0..1 (sum of all weights = 1). */
|
|
119
|
+
weight: number;
|
|
120
|
+
/** Caller-supplied projection: given the AI's answer, what's the future? */
|
|
121
|
+
projection: (answer: string) => Promise<{
|
|
122
|
+
outcome: "good" | "neutral" | "bad" | "catastrophic";
|
|
123
|
+
rationale: string;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
export interface TimeTravelResult {
|
|
127
|
+
scenarios: number;
|
|
128
|
+
goodWeight: number;
|
|
129
|
+
neutralWeight: number;
|
|
130
|
+
badWeight: number;
|
|
131
|
+
catastrophicWeight: number;
|
|
132
|
+
/** Risk score 0..1 — higher = more catastrophic future risk. */
|
|
133
|
+
catastropheRisk: number;
|
|
134
|
+
/** Quality score 0..1 — higher = better expected futures. */
|
|
135
|
+
score: number;
|
|
136
|
+
/** Per-scenario audit. */
|
|
137
|
+
trace: Array<{
|
|
138
|
+
id: string;
|
|
139
|
+
weight: number;
|
|
140
|
+
outcome: string;
|
|
141
|
+
rationale: string;
|
|
142
|
+
}>;
|
|
143
|
+
/** TRUE if catastropheRisk > 0.10 — caller should BLOCK the answer. */
|
|
144
|
+
shouldBlock: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface TimeTravelInput {
|
|
147
|
+
answer: string;
|
|
148
|
+
scenarios: readonly FutureScenario[];
|
|
149
|
+
}
|
|
150
|
+
export declare function timeTravelAudit(input: TimeTravelInput): Promise<TimeTravelResult>;
|
|
151
|
+
export interface LiveKpiInput {
|
|
152
|
+
arena?: ArenaResult;
|
|
153
|
+
chaos?: ChaosResult;
|
|
154
|
+
bio?: BioFeedbackResult;
|
|
155
|
+
timeTravel?: TimeTravelResult;
|
|
156
|
+
/** Optional weights override (default: arena 0.30, chaos 0.30, bio 0.20, timeTravel 0.20). */
|
|
157
|
+
weights?: {
|
|
158
|
+
arena?: number;
|
|
159
|
+
chaos?: number;
|
|
160
|
+
bio?: number;
|
|
161
|
+
timeTravel?: number;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface LiveKpiResult {
|
|
165
|
+
/** Final KPI 0..100. */
|
|
166
|
+
score: number;
|
|
167
|
+
/** Per-axis breakdown. */
|
|
168
|
+
axes: Array<{
|
|
169
|
+
name: string;
|
|
170
|
+
rawScore: number;
|
|
171
|
+
weight: number;
|
|
172
|
+
weightedContribution: number;
|
|
173
|
+
}>;
|
|
174
|
+
/** Final verdict bucket. */
|
|
175
|
+
verdict: "GOD-MODE" | "DEMON-MODE" | "STRONG" | "OK" | "WEAK" | "FAILING";
|
|
176
|
+
/** Why this verdict — for the human + AI. */
|
|
177
|
+
summary: string;
|
|
178
|
+
}
|
|
179
|
+
export declare function liveKpi(input: LiveKpiInput): LiveKpiResult;
|
|
180
|
+
export declare function formatGladiatorPulseLine(r: LiveKpiResult): string;
|
|
181
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gladiator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAA6B,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAmB,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM/F,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,8CAA8C;IA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