@mneme-ai/core 2.91.0 β 2.92.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/agent_manifest.d.ts.map +1 -1
- package/dist/agent_manifest.js +2 -0
- package/dist/agent_manifest.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/truth_gate/claims.d.ts.map +1 -1
- package/dist/truth_gate/claims.js +7 -0
- package/dist/truth_gate/claims.js.map +1 -1
- package/dist/truth_gate/probes.d.ts.map +1 -1
- package/dist/truth_gate/probes.js +43 -0
- package/dist/truth_gate/probes.js.map +1 -1
- package/dist/truth_kernel/diakrisis.d.ts +132 -0
- package/dist/truth_kernel/diakrisis.d.ts.map +1 -0
- package/dist/truth_kernel/diakrisis.js +184 -0
- package/dist/truth_kernel/diakrisis.js.map +1 -0
- package/dist/truth_kernel/diakrisis.test.d.ts +14 -0
- package/dist/truth_kernel/diakrisis.test.d.ts.map +1 -0
- package/dist/truth_kernel/diakrisis.test.js +99 -0
- package/dist/truth_kernel/diakrisis.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.92.0 β πβ¦ DIAKRISIS Β· discern the genuine from the merely-plausible.
|
|
3
|
+
*
|
|
4
|
+
* διάκΟΞΉΟΞΉΟ β "discernment / judging-apart": telling the real from the counterfeit.
|
|
5
|
+
* A SECOND axis, orthogonal to Aletheia. Aletheia judges true vs false; Diakrisis
|
|
6
|
+
* judges genuine vs merely-good-looking β a mediocre artifact is not FALSE, it is
|
|
7
|
+
* UNREMARKABLE. When AI commoditises both execution and ideas, the bottleneck moves
|
|
8
|
+
* to DISCERNMENT: telling what is genuinely good from what merely LOOKS good. AI
|
|
9
|
+
* produces "looks good" without limit β that flood is product-level hallucination.
|
|
10
|
+
*
|
|
11
|
+
* THE HONEST SCOPE (this IS the design, read it first). Diakrisis is ASYMMETRIC: it
|
|
12
|
+
* proves what is NOT world-class far more reliably than what IS. It does NOT
|
|
13
|
+
* mechanise taste. Its verdict mirrors Prove-or-Unknown β
|
|
14
|
+
*
|
|
15
|
+
* Reject-or-Unknown: confidently REJECT the high-lustre / PROVEN-low-substance
|
|
16
|
+
* trap; for everything else return UNKNOWN β "passes the floor; the ceiling is
|
|
17
|
+
* the human's."
|
|
18
|
+
*
|
|
19
|
+
* It RAISES THE FLOOR (kills the plausible-mediocre flood) and AUGMENTS THE CEILING
|
|
20
|
+
* (surfaces undervalued substance for a human). It never claims to BE the ceiling β
|
|
21
|
+
* any version that scored "world-class greatness" would itself be the lustre-trap
|
|
22
|
+
* this axis exists to catch.
|
|
23
|
+
*
|
|
24
|
+
* Three pillars, with the failure modes welded in as guards:
|
|
25
|
+
* 1. LUSTREβSUBSTANCE GAP β score lustre (how good it LOOKS) from STRUCTURAL signals
|
|
26
|
+
* (xray hedge-vs-absolute, hyperbole detector), NEVER by asking an LLM "is this
|
|
27
|
+
* good?" (that re-imports the correlated plausibility bias). Substance (how good
|
|
28
|
+
* it IS) only where verifiable; aesthetic quality β UNKNOWN (abstain, never fake).
|
|
29
|
+
* 2. TASTE = signed revealed-preference β learn from what SURVIVED reality (kept vs
|
|
30
|
+
* reverted/rolled-back), supplied as evidence; empirical, immune to plausibility.
|
|
31
|
+
* 3. ANTI-CONSERVATISM GUARD (the Padgett guard) β REJECT only on PROVEN low
|
|
32
|
+
* substance; NEVER on "doesn't match past taste." Novel-but-unproven β UNKNOWN,
|
|
33
|
+
* routed to the human, never auto-rejected. (A Padgett β correct in a notation
|
|
34
|
+
* the teachers don't recognise β must return UNKNOWN, never REJECT.)
|
|
35
|
+
*
|
|
36
|
+
* Composes xray + hyperbole_detector + the v2.88 spine + notary. Never throws.
|
|
37
|
+
*/
|
|
38
|
+
import { type NotaryReceipt } from "../notary/index.js";
|
|
39
|
+
export type DiakrisisVerdict = "REJECT" | "UNKNOWN";
|
|
40
|
+
export type Substance = "HIGH" | "LOW" | "UNKNOWN";
|
|
41
|
+
export type Classification = "TRAP" | "PROVEN_WEAK" | "GEM" | "PROVEN_GOOD" | "PLAUSIBLE_CAVEAT" | "PLAUSIBLE";
|
|
42
|
+
export interface LustreSignals {
|
|
43
|
+
/** 0..1 β how good it LOOKS, from structural signals only (never an LLM opinion). */
|
|
44
|
+
lustre: number;
|
|
45
|
+
hyperboleMatches: number;
|
|
46
|
+
absoluteDensity: number;
|
|
47
|
+
hedgeDensity: number;
|
|
48
|
+
/** The structural signals that drove the score (audit trail). */
|
|
49
|
+
drivers: string[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Score LUSTRE from STRUCTURAL signals only β hyperbole (superlatives / "best ever"),
|
|
53
|
+
* absolutist phrasing (sounds certain), minus hedging (sounds tentative). NEVER asks
|
|
54
|
+
* an LLM "is this good?" β that would re-import the same plausibility bias the gap is
|
|
55
|
+
* built to expose. Deterministic + total.
|
|
56
|
+
*/
|
|
57
|
+
export declare function lustreScore(text: string): LustreSignals;
|
|
58
|
+
/** Caller-supplied revealed-preference / verification evidence β the ONLY way
|
|
59
|
+
* substance becomes PROVEN (Pillar 2 + 3). A daemon feeds these from reflog
|
|
60
|
+
* (kept vs reverted), outcome_market, karma, or a real test run. */
|
|
61
|
+
export interface SubstanceEvidence {
|
|
62
|
+
/** Was this artifact reverted / rolled back / deleted? (revealed-preference: it did NOT survive.) */
|
|
63
|
+
reverted?: boolean;
|
|
64
|
+
/** Did its tests pass? false β proven low substance; true β proven survived. */
|
|
65
|
+
testPassed?: boolean;
|
|
66
|
+
/** A pre-computed truth verdict (e.g. from assertClaim) for a factual artifact. */
|
|
67
|
+
verdict?: "TRUE" | "FALSE" | "UNKNOWN";
|
|
68
|
+
}
|
|
69
|
+
export interface DiakrisisResult {
|
|
70
|
+
/** REJECT (proven low substance β the Courage Gate fires) | UNKNOWN (ceiling is the human's). */
|
|
71
|
+
verdict: DiakrisisVerdict;
|
|
72
|
+
/** Cleared the floor (no PROVEN low substance). True for everything we don't REJECT. */
|
|
73
|
+
flooredPass: boolean;
|
|
74
|
+
/** Lustre β substanceScore (the primary signal). High + proven-low = the πͺ€ trap. */
|
|
75
|
+
gap: number;
|
|
76
|
+
lustre: number;
|
|
77
|
+
substance: Substance;
|
|
78
|
+
/** The 2Γ2 quadrant (advisory, for the human). */
|
|
79
|
+
classification: Classification;
|
|
80
|
+
/** True when we ABSTAINED on novel/unproven work instead of rejecting (Padgett guard active). */
|
|
81
|
+
padgettGuard: boolean;
|
|
82
|
+
reason: string;
|
|
83
|
+
/** Always present β Diakrisis never claims the ceiling. */
|
|
84
|
+
ceiling: string;
|
|
85
|
+
lustreSignals: LustreSignals;
|
|
86
|
+
receipt: NotaryReceipt | null;
|
|
87
|
+
}
|
|
88
|
+
/** Lustre β₯ this reads as "high shine" (hyperbolic / absolutist presentation). Tuned
|
|
89
|
+
* to ~2 hyperbole matches + some absolutism β the level at which a flood of polished
|
|
90
|
+
* output starts to look impressive without earning it. */
|
|
91
|
+
export declare const HIGH_LUSTRE = 0.35;
|
|
92
|
+
/**
|
|
93
|
+
* Discern an artifact. Lustre is structural (never an LLM opinion). Substance is
|
|
94
|
+
* PROVEN only via evidence (test/revert) or a verifiable truth verdict; otherwise
|
|
95
|
+
* UNKNOWN. REJECT fires ONLY on PROVEN-low substance (Courage Gate); novel/unproven
|
|
96
|
+
* work is UNKNOWN and routed to the human (Padgett guard) β NEVER auto-rejected.
|
|
97
|
+
* Never throws.
|
|
98
|
+
*/
|
|
99
|
+
export declare function discern(repoRoot: string, artifact: string, opts?: {
|
|
100
|
+
substanceEvidence?: SubstanceEvidence;
|
|
101
|
+
now?: number;
|
|
102
|
+
noSign?: boolean;
|
|
103
|
+
verifyClaim?: boolean;
|
|
104
|
+
}): Promise<DiakrisisResult>;
|
|
105
|
+
export interface DiscernCase {
|
|
106
|
+
artifact: string;
|
|
107
|
+
evidence?: SubstanceEvidence;
|
|
108
|
+
/** Ground-truth label for scoring. */
|
|
109
|
+
kind: "trap" | "gem" | "novel" | "genuine";
|
|
110
|
+
}
|
|
111
|
+
export interface DiakrisisGauntletReport {
|
|
112
|
+
n: number;
|
|
113
|
+
/** High-lustre + PROVEN-low-substance traps correctly REJECTed. β good. */
|
|
114
|
+
trapCatchRate: number;
|
|
115
|
+
/** Genuine-but-unproven-NOVEL artifacts wrongly REJECTed. MUST be 0 β the Padgett guard. */
|
|
116
|
+
novelFalseRejectRate: number;
|
|
117
|
+
/** Low-lustre + high-substance gems flagged (classification GEM) for the human. */
|
|
118
|
+
gemSurfacingRate: number;
|
|
119
|
+
results: Array<{
|
|
120
|
+
artifact: string;
|
|
121
|
+
kind: DiscernCase["kind"];
|
|
122
|
+
verdict: DiakrisisVerdict;
|
|
123
|
+
classification: Classification;
|
|
124
|
+
}>;
|
|
125
|
+
headline: string;
|
|
126
|
+
}
|
|
127
|
+
/** Run the Diakrisis Gauntlet. The metric that matters most is novelFalseRejectRate β 0
|
|
128
|
+
* (a savant that would discard a Padgett is broken). Never throws. */
|
|
129
|
+
export declare function runDiakrisisGauntlet(repoRoot: string, cases: readonly DiscernCase[], opts?: {
|
|
130
|
+
now?: number;
|
|
131
|
+
}): Promise<DiakrisisGauntletReport>;
|
|
132
|
+
//# sourceMappingURL=diakrisis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diakrisis.d.ts","sourceRoot":"","sources":["../../src/truth_kernel/diakrisis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,GAA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B,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1G,OAAO,CAAC,eAAe,CAAC,CAyD1B;AAGD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,sCAAsC;IACtC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5C;AAED,MAAM,WAAW,uBAAuB;IACtC,CAAC,EAAE,MAAM,CAAC;IACV,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAAC,OAAO,EAAE,gBAAgB,CAAC;QAAC,cAAc,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;IAC3H,QAAQ,EAAE,MAAM,CAAC;CAElB;AAED;uEACuE;AACvE,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,WAAW,EAAE,EAAE,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAezJ"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.92.0 β πβ¦ DIAKRISIS Β· discern the genuine from the merely-plausible.
|
|
3
|
+
*
|
|
4
|
+
* διάκΟΞΉΟΞΉΟ β "discernment / judging-apart": telling the real from the counterfeit.
|
|
5
|
+
* A SECOND axis, orthogonal to Aletheia. Aletheia judges true vs false; Diakrisis
|
|
6
|
+
* judges genuine vs merely-good-looking β a mediocre artifact is not FALSE, it is
|
|
7
|
+
* UNREMARKABLE. When AI commoditises both execution and ideas, the bottleneck moves
|
|
8
|
+
* to DISCERNMENT: telling what is genuinely good from what merely LOOKS good. AI
|
|
9
|
+
* produces "looks good" without limit β that flood is product-level hallucination.
|
|
10
|
+
*
|
|
11
|
+
* THE HONEST SCOPE (this IS the design, read it first). Diakrisis is ASYMMETRIC: it
|
|
12
|
+
* proves what is NOT world-class far more reliably than what IS. It does NOT
|
|
13
|
+
* mechanise taste. Its verdict mirrors Prove-or-Unknown β
|
|
14
|
+
*
|
|
15
|
+
* Reject-or-Unknown: confidently REJECT the high-lustre / PROVEN-low-substance
|
|
16
|
+
* trap; for everything else return UNKNOWN β "passes the floor; the ceiling is
|
|
17
|
+
* the human's."
|
|
18
|
+
*
|
|
19
|
+
* It RAISES THE FLOOR (kills the plausible-mediocre flood) and AUGMENTS THE CEILING
|
|
20
|
+
* (surfaces undervalued substance for a human). It never claims to BE the ceiling β
|
|
21
|
+
* any version that scored "world-class greatness" would itself be the lustre-trap
|
|
22
|
+
* this axis exists to catch.
|
|
23
|
+
*
|
|
24
|
+
* Three pillars, with the failure modes welded in as guards:
|
|
25
|
+
* 1. LUSTREβSUBSTANCE GAP β score lustre (how good it LOOKS) from STRUCTURAL signals
|
|
26
|
+
* (xray hedge-vs-absolute, hyperbole detector), NEVER by asking an LLM "is this
|
|
27
|
+
* good?" (that re-imports the correlated plausibility bias). Substance (how good
|
|
28
|
+
* it IS) only where verifiable; aesthetic quality β UNKNOWN (abstain, never fake).
|
|
29
|
+
* 2. TASTE = signed revealed-preference β learn from what SURVIVED reality (kept vs
|
|
30
|
+
* reverted/rolled-back), supplied as evidence; empirical, immune to plausibility.
|
|
31
|
+
* 3. ANTI-CONSERVATISM GUARD (the Padgett guard) β REJECT only on PROVEN low
|
|
32
|
+
* substance; NEVER on "doesn't match past taste." Novel-but-unproven β UNKNOWN,
|
|
33
|
+
* routed to the human, never auto-rejected. (A Padgett β correct in a notation
|
|
34
|
+
* the teachers don't recognise β must return UNKNOWN, never REJECT.)
|
|
35
|
+
*
|
|
36
|
+
* Composes xray + hyperbole_detector + the v2.88 spine + notary. Never throws.
|
|
37
|
+
*/
|
|
38
|
+
import { xrayResponse } from "../xray/index.js";
|
|
39
|
+
import { detectHyperbole } from "../squadron/hyperbole_detector.js";
|
|
40
|
+
import { humilityDensity } from "../apoptosis/epistemic_humility.js";
|
|
41
|
+
import { issueReceipt } from "../notary/index.js";
|
|
42
|
+
const clamp01 = (x) => Math.max(0, Math.min(1, x));
|
|
43
|
+
/**
|
|
44
|
+
* Score LUSTRE from STRUCTURAL signals only β hyperbole (superlatives / "best ever"),
|
|
45
|
+
* absolutist phrasing (sounds certain), minus hedging (sounds tentative). NEVER asks
|
|
46
|
+
* an LLM "is this good?" β that would re-import the same plausibility bias the gap is
|
|
47
|
+
* built to expose. Deterministic + total.
|
|
48
|
+
*/
|
|
49
|
+
export function lustreScore(text) {
|
|
50
|
+
const t = String(text ?? "");
|
|
51
|
+
const hyp = detectHyperbole(t);
|
|
52
|
+
const hum = humilityDensity(t);
|
|
53
|
+
void xrayResponse; // xray is available for richer structural signals; hyperbole+absolutism suffice + stay lustre-pure
|
|
54
|
+
const drivers = [];
|
|
55
|
+
const hyperboleComponent = Math.min(0.5, hyp.matches.length * 0.2);
|
|
56
|
+
const absolutismComponent = Math.min(0.4, (hum.absoluteDensity / 100) * 8);
|
|
57
|
+
const hedgeDiscount = Math.min(0.25, (hum.hedgeDensity / 100) * 5);
|
|
58
|
+
if (hyp.matches.length)
|
|
59
|
+
drivers.push(`hyperboleΓ${hyp.matches.length} (${hyp.matches.slice(0, 3).map((m) => m.matched).join(", ")})`);
|
|
60
|
+
if (hum.absoluteDensity > 0)
|
|
61
|
+
drivers.push(`absolutist phrasing (${hum.absoluteDensity.toFixed(1)}/100w)`);
|
|
62
|
+
if (hum.hedgeDensity > 0)
|
|
63
|
+
drivers.push(`hedged (${hum.hedgeDensity.toFixed(1)}/100w) βlustre`);
|
|
64
|
+
const lustre = clamp01(hyperboleComponent + absolutismComponent - hedgeDiscount);
|
|
65
|
+
return { lustre, hyperboleMatches: hyp.matches.length, absoluteDensity: hum.absoluteDensity, hedgeDensity: hum.hedgeDensity, drivers };
|
|
66
|
+
}
|
|
67
|
+
const CEILING = "passes the floor β world-class taste is the human's call (Diakrisis does not score the ceiling)";
|
|
68
|
+
function substanceScoreOf(s) { return s === "HIGH" ? 1 : s === "LOW" ? 0 : 0.5; }
|
|
69
|
+
/** Lustre β₯ this reads as "high shine" (hyperbolic / absolutist presentation). Tuned
|
|
70
|
+
* to ~2 hyperbole matches + some absolutism β the level at which a flood of polished
|
|
71
|
+
* output starts to look impressive without earning it. */
|
|
72
|
+
export const HIGH_LUSTRE = 0.35;
|
|
73
|
+
function classify(lustre, substance) {
|
|
74
|
+
const lustHi = lustre >= HIGH_LUSTRE;
|
|
75
|
+
if (substance === "LOW")
|
|
76
|
+
return lustHi ? "TRAP" : "PROVEN_WEAK";
|
|
77
|
+
if (substance === "HIGH")
|
|
78
|
+
return lustHi ? "PROVEN_GOOD" : "GEM";
|
|
79
|
+
return lustHi ? "PLAUSIBLE_CAVEAT" : "PLAUSIBLE";
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Discern an artifact. Lustre is structural (never an LLM opinion). Substance is
|
|
83
|
+
* PROVEN only via evidence (test/revert) or a verifiable truth verdict; otherwise
|
|
84
|
+
* UNKNOWN. REJECT fires ONLY on PROVEN-low substance (Courage Gate); novel/unproven
|
|
85
|
+
* work is UNKNOWN and routed to the human (Padgett guard) β NEVER auto-rejected.
|
|
86
|
+
* Never throws.
|
|
87
|
+
*/
|
|
88
|
+
export async function discern(repoRoot, artifact, opts = {}) {
|
|
89
|
+
const text = String(artifact ?? "");
|
|
90
|
+
const lustreSignals = lustreScore(text);
|
|
91
|
+
const lustre = lustreSignals.lustre;
|
|
92
|
+
// Substance: PROVEN only from evidence; never invented.
|
|
93
|
+
let substance = "UNKNOWN";
|
|
94
|
+
let substReason = "no verifiable substance β aesthetic/quality is UNKNOWN (ceiling = human)";
|
|
95
|
+
const ev = opts.substanceEvidence ?? {};
|
|
96
|
+
if (ev.reverted === true) {
|
|
97
|
+
substance = "LOW";
|
|
98
|
+
substReason = "revealed-preference: reverted/rolled back β did NOT survive";
|
|
99
|
+
}
|
|
100
|
+
else if (ev.testPassed === false) {
|
|
101
|
+
substance = "LOW";
|
|
102
|
+
substReason = "tests FAILED β proven low substance";
|
|
103
|
+
}
|
|
104
|
+
else if (ev.testPassed === true) {
|
|
105
|
+
substance = "HIGH";
|
|
106
|
+
substReason = "tests passed β survived verification";
|
|
107
|
+
}
|
|
108
|
+
else if (ev.verdict) {
|
|
109
|
+
substance = ev.verdict === "TRUE" ? "HIGH" : ev.verdict === "FALSE" ? "LOW" : "UNKNOWN";
|
|
110
|
+
substReason = `truth verdict ${ev.verdict}`;
|
|
111
|
+
}
|
|
112
|
+
else if (opts.verifyClaim) {
|
|
113
|
+
// Optional: treat the artifact as a factual claim + verify via the spine.
|
|
114
|
+
try {
|
|
115
|
+
const { assertClaim } = await import("./aletheia.js");
|
|
116
|
+
const r = await assertClaim(repoRoot, text, { issuedAt: opts.now });
|
|
117
|
+
substance = r.verdict === "TRUE" ? "HIGH" : r.verdict === "FALSE" ? "LOW" : "UNKNOWN";
|
|
118
|
+
substReason = `spine verdict ${r.verdict}: ${r.evidence}`;
|
|
119
|
+
}
|
|
120
|
+
catch { /* stays UNKNOWN β abstain */ }
|
|
121
|
+
}
|
|
122
|
+
// Reject-or-Unknown + Courage Gate + Padgett guard:
|
|
123
|
+
// REJECT only when substance is PROVEN LOW. Everything else = UNKNOWN (ceiling = human).
|
|
124
|
+
const verdict = substance === "LOW" ? "REJECT" : "UNKNOWN";
|
|
125
|
+
const flooredPass = substance !== "LOW";
|
|
126
|
+
const padgettGuard = substance === "UNKNOWN"; // we abstained rather than reject the unproven (incl. the novel)
|
|
127
|
+
const classification = classify(lustre, substance);
|
|
128
|
+
const gap = +(lustre - substanceScoreOf(substance)).toFixed(3);
|
|
129
|
+
const reason = verdict === "REJECT"
|
|
130
|
+
? (classification === "TRAP"
|
|
131
|
+
? `πͺ€ TRAP β high lustre (${lustre.toFixed(2)}) over PROVEN-low substance: ${substReason}`
|
|
132
|
+
: `proven low substance: ${substReason}`)
|
|
133
|
+
: classification === "GEM"
|
|
134
|
+
? `β GEM β low lustre (${lustre.toFixed(2)}) but PROVEN-high substance: surface for the human`
|
|
135
|
+
: classification === "PLAUSIBLE_CAVEAT"
|
|
136
|
+
? `high lustre (${lustre.toFixed(2)}) but UNVERIFIED β plausible, not proven excellent (caveat emptor; ${substReason})`
|
|
137
|
+
: `plausible β not proven excellent; ${substReason}`;
|
|
138
|
+
let receipt = null;
|
|
139
|
+
if (!opts.noSign) {
|
|
140
|
+
try {
|
|
141
|
+
receipt = issueReceipt(repoRoot, {
|
|
142
|
+
kind: "generic",
|
|
143
|
+
subject: `diakrisis:${classification}`,
|
|
144
|
+
payload: { engine: "diakrisis", verdict, classification, lustre, substance, gap },
|
|
145
|
+
issuedAt: opts.now,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
receipt = null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return { verdict, flooredPass, gap, lustre, substance, classification, padgettGuard, reason, ceiling: CEILING, lustreSignals, receipt };
|
|
153
|
+
}
|
|
154
|
+
/** Run the Diakrisis Gauntlet. The metric that matters most is novelFalseRejectRate β 0
|
|
155
|
+
* (a savant that would discard a Padgett is broken). Never throws. */
|
|
156
|
+
export async function runDiakrisisGauntlet(repoRoot, cases, opts = {}) {
|
|
157
|
+
const results = [];
|
|
158
|
+
let traps = 0, trapsCaught = 0, novels = 0, novelsRejected = 0, gems = 0, gemsSurfaced = 0;
|
|
159
|
+
for (const c of cases) {
|
|
160
|
+
const r = await discern(repoRoot, c.artifact, { substanceEvidence: c.evidence, now: opts.now, noSign: true });
|
|
161
|
+
results.push({ artifact: c.artifact.slice(0, 60), kind: c.kind, verdict: r.verdict, classification: r.classification });
|
|
162
|
+
if (c.kind === "trap") {
|
|
163
|
+
traps++;
|
|
164
|
+
if (r.verdict === "REJECT")
|
|
165
|
+
trapsCaught++;
|
|
166
|
+
}
|
|
167
|
+
if (c.kind === "novel") {
|
|
168
|
+
novels++;
|
|
169
|
+
if (r.verdict === "REJECT")
|
|
170
|
+
novelsRejected++;
|
|
171
|
+
}
|
|
172
|
+
if (c.kind === "gem") {
|
|
173
|
+
gems++;
|
|
174
|
+
if (r.classification === "GEM")
|
|
175
|
+
gemsSurfaced++;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const trapCatchRate = traps ? trapsCaught / traps : 1;
|
|
179
|
+
const novelFalseRejectRate = novels ? novelsRejected / novels : 0;
|
|
180
|
+
const gemSurfacingRate = gems ? gemsSurfaced / gems : 1;
|
|
181
|
+
const headline = `DIAKRISIS GAUNTLET Β· trap-catch ${(trapCatchRate * 100).toFixed(0)}% Β· novel-false-reject ${(novelFalseRejectRate * 100).toFixed(0)}% (Padgett: must be 0) Β· gem-surfacing ${(gemSurfacingRate * 100).toFixed(0)}% (n=${cases.length})`;
|
|
182
|
+
return { n: cases.length, trapCatchRate, novelFalseRejectRate, gemSurfacingRate, results, headline };
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=diakrisis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diakrisis.js","sourceRoot":"","sources":["../../src/truth_kernel/diakrisis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CA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C,OAAO,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,MAAM,GAAG,CAAC;IAC1P,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACvG,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.92.0 β πβ¦ DIAKRISIS tests (genuine vs merely-plausible).
|
|
3
|
+
*
|
|
4
|
+
* D1 lustreScore is STRUCTURAL (hyperbole/absolutism β, hedging β) β never an LLM opinion
|
|
5
|
+
* D2 Reject-or-Unknown β REJECT only on PROVEN-low substance (reverted / tests failed / FALSE)
|
|
6
|
+
* D3 β
Padgett guard β novel / unproven / aesthetic β UNKNOWN, NEVER REJECT (the metric that matters)
|
|
7
|
+
* D4 2Γ2 classification β TRAP / GEM / PLAUSIBLE_CAVEAT / PROVEN_GOOD
|
|
8
|
+
* D5 gem surfacing β low-lustre + proven-high substance β GEM (surfaced for the human)
|
|
9
|
+
* D6 every verdict is signed; ceiling is always handed to the human
|
|
10
|
+
* D7 Diakrisis Gauntlet β trap-catch high Β· novel-false-reject 0% Β· gem-surfacing high
|
|
11
|
+
* D8 QUAN β never throws over fuzz; verdict always REJECT|UNKNOWN
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=diakrisis.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diakrisis.test.d.ts","sourceRoot":"","sources":["../../src/truth_kernel/diakrisis.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.92.0 β πβ¦ DIAKRISIS tests (genuine vs merely-plausible).
|
|
3
|
+
*
|
|
4
|
+
* D1 lustreScore is STRUCTURAL (hyperbole/absolutism β, hedging β) β never an LLM opinion
|
|
5
|
+
* D2 Reject-or-Unknown β REJECT only on PROVEN-low substance (reverted / tests failed / FALSE)
|
|
6
|
+
* D3 β
Padgett guard β novel / unproven / aesthetic β UNKNOWN, NEVER REJECT (the metric that matters)
|
|
7
|
+
* D4 2Γ2 classification β TRAP / GEM / PLAUSIBLE_CAVEAT / PROVEN_GOOD
|
|
8
|
+
* D5 gem surfacing β low-lustre + proven-high substance β GEM (surfaced for the human)
|
|
9
|
+
* D6 every verdict is signed; ceiling is always handed to the human
|
|
10
|
+
* D7 Diakrisis Gauntlet β trap-catch high Β· novel-false-reject 0% Β· gem-surfacing high
|
|
11
|
+
* D8 QUAN β never throws over fuzz; verdict always REJECT|UNKNOWN
|
|
12
|
+
*/
|
|
13
|
+
import { describe, it, expect } from "vitest";
|
|
14
|
+
import { mkdtempSync } from "node:fs";
|
|
15
|
+
import { tmpdir } from "node:os";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { discern, lustreScore, runDiakrisisGauntlet, HIGH_LUSTRE } from "./diakrisis.js";
|
|
18
|
+
function repo() { return mkdtempSync(join(tmpdir(), "diakrisis-")); }
|
|
19
|
+
const T = 1_700_000_000_000;
|
|
20
|
+
const HYPE = "This is the BEST, most revolutionary, absolutely flawless solution ever β guaranteed perfect.";
|
|
21
|
+
const PLAIN = "fix off-by-one in the pager offset";
|
|
22
|
+
describe("v2.92.0 πβ¦ DIAKRISIS β discern genuine from merely-plausible", () => {
|
|
23
|
+
it("D1 lustreScore is structural β hyperbole/absolutism raise it, hedging lowers it (no LLM)", () => {
|
|
24
|
+
const hype = lustreScore(HYPE).lustre;
|
|
25
|
+
const plain = lustreScore(PLAIN).lustre;
|
|
26
|
+
const hedged = lustreScore("this might possibly perhaps work in some cases, i think").lustre;
|
|
27
|
+
expect(hype).toBeGreaterThan(plain);
|
|
28
|
+
expect(hype).toBeGreaterThanOrEqual(HIGH_LUSTRE);
|
|
29
|
+
expect(plain).toBeLessThan(HIGH_LUSTRE);
|
|
30
|
+
expect(hedged).toBe(0); // hedging cannot produce shine
|
|
31
|
+
});
|
|
32
|
+
it("D2 Reject-or-Unknown β REJECT only on PROVEN-low substance", async () => {
|
|
33
|
+
expect((await discern(repo(), HYPE, { substanceEvidence: { reverted: true }, now: T })).verdict).toBe("REJECT");
|
|
34
|
+
expect((await discern(repo(), "x", { substanceEvidence: { testPassed: false }, now: T })).verdict).toBe("REJECT");
|
|
35
|
+
expect((await discern(repo(), "Mneme is written in Rust", { substanceEvidence: { verdict: "FALSE" }, now: T })).verdict).toBe("REJECT");
|
|
36
|
+
// proven-high or unproven β NOT reject
|
|
37
|
+
expect((await discern(repo(), PLAIN, { substanceEvidence: { testPassed: true }, now: T })).verdict).toBe("UNKNOWN");
|
|
38
|
+
expect((await discern(repo(), PLAIN, { now: T })).verdict).toBe("UNKNOWN");
|
|
39
|
+
});
|
|
40
|
+
it("D3 β
Padgett guard β novel / unproven / aesthetic β UNKNOWN, NEVER REJECT", async () => {
|
|
41
|
+
// a Padgett: correct-looking-or-not but in an unrecognised form, unverifiable β MUST abstain
|
|
42
|
+
const padgett = await discern(repo(), "a geometric notation for calculus the teachers did not recognise", { now: T });
|
|
43
|
+
expect(padgett.verdict).toBe("UNKNOWN");
|
|
44
|
+
expect(padgett.padgettGuard).toBe(true);
|
|
45
|
+
// even a high-lustre UNVERIFIED claim is NOT rejected (only proven-low is) β caveat, not kill
|
|
46
|
+
const caveat = await discern(repo(), HYPE, { now: T }); // no evidence β substance UNKNOWN
|
|
47
|
+
expect(caveat.verdict).toBe("UNKNOWN");
|
|
48
|
+
expect(caveat.classification).toBe("PLAUSIBLE_CAVEAT");
|
|
49
|
+
// a weird, plain, unproven idea β UNKNOWN, never REJECT
|
|
50
|
+
expect((await discern(repo(), "an unfamiliar approach nobody has tried", { now: T })).verdict).toBe("UNKNOWN");
|
|
51
|
+
});
|
|
52
|
+
it("D4 2Γ2 classification β TRAP / GEM / CAVEAT / PROVEN_GOOD", async () => {
|
|
53
|
+
expect((await discern(repo(), HYPE, { substanceEvidence: { reverted: true }, now: T })).classification).toBe("TRAP"); // hi lustre + proven low
|
|
54
|
+
expect((await discern(repo(), PLAIN, { substanceEvidence: { testPassed: true }, now: T })).classification).toBe("GEM"); // lo lustre + proven high
|
|
55
|
+
expect((await discern(repo(), HYPE, { now: T })).classification).toBe("PLAUSIBLE_CAVEAT"); // hi lustre + unverified
|
|
56
|
+
expect((await discern(repo(), HYPE, { substanceEvidence: { testPassed: true }, now: T })).classification).toBe("PROVEN_GOOD"); // hi lustre + proven high
|
|
57
|
+
});
|
|
58
|
+
it("D5 gem surfacing β undervalued substance flagged for the human", async () => {
|
|
59
|
+
const gem = await discern(repo(), PLAIN, { substanceEvidence: { testPassed: true }, now: T });
|
|
60
|
+
expect(gem.classification).toBe("GEM");
|
|
61
|
+
expect(gem.verdict).toBe("UNKNOWN"); // not rejected
|
|
62
|
+
expect(gem.flooredPass).toBe(true);
|
|
63
|
+
});
|
|
64
|
+
it("D6 every verdict is signed; ceiling is always the human's", async () => {
|
|
65
|
+
const r = await discern(repo(), HYPE, { substanceEvidence: { reverted: true }, now: T });
|
|
66
|
+
expect(r.receipt).not.toBeNull();
|
|
67
|
+
expect(r.ceiling).toMatch(/human/);
|
|
68
|
+
const ns = await discern(repo(), PLAIN, { noSign: true, now: T });
|
|
69
|
+
expect(ns.receipt).toBeNull();
|
|
70
|
+
});
|
|
71
|
+
it("D7 Diakrisis Gauntlet β trap-catch high Β· novel-false-reject 0% Β· gem-surfacing high", async () => {
|
|
72
|
+
const g = await runDiakrisisGauntlet(repo(), [
|
|
73
|
+
{ artifact: HYPE, evidence: { reverted: true }, kind: "trap" },
|
|
74
|
+
{ artifact: "absolutely the best, never fails, guaranteed perfect always", evidence: { testPassed: false }, kind: "trap" },
|
|
75
|
+
{ artifact: PLAIN, evidence: { testPassed: true }, kind: "gem" },
|
|
76
|
+
{ artifact: "minor whitespace normalisation", evidence: { testPassed: true }, kind: "gem" },
|
|
77
|
+
{ artifact: "a strange new notation that looks wrong but might be right", kind: "novel" },
|
|
78
|
+
{ artifact: "an unproven idea in an unfamiliar form", kind: "novel" },
|
|
79
|
+
{ artifact: "yet another novel untested concept", kind: "novel" },
|
|
80
|
+
], { now: T });
|
|
81
|
+
expect(g.trapCatchRate).toBe(1);
|
|
82
|
+
expect(g.novelFalseRejectRate).toBe(0); // β
the Padgett guard β the metric that matters most
|
|
83
|
+
expect(g.gemSurfacingRate).toBe(1);
|
|
84
|
+
// honest bound: there is NO world-class-recognition metric
|
|
85
|
+
expect(g["worldClassRecognitionRate"]).toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
it("D8 QUAN β never throws over fuzz; verdict always REJECT|UNKNOWN", async () => {
|
|
88
|
+
const r = repo();
|
|
89
|
+
for (let i = 0; i < 40; i++) {
|
|
90
|
+
const artifact = ["", " ", `the ${i}th best thing ever guaranteed`, `plain note ${i}`, "weirdο»Ώchars", "absolutely perfect flawless"][i % 6];
|
|
91
|
+
const ev = [{ reverted: true }, { testPassed: true }, { testPassed: false }, {}, { verdict: "UNKNOWN" }][i % 5];
|
|
92
|
+
const out = await discern(r, artifact, { substanceEvidence: ev, now: T, noSign: true });
|
|
93
|
+
expect(["REJECT", "UNKNOWN"]).toContain(out.verdict);
|
|
94
|
+
expect(typeof out.lustre).toBe("number");
|
|
95
|
+
}
|
|
96
|
+
expect(() => lustreScore("")).not.toThrow();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=diakrisis.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diakrisis.test.js","sourceRoot":"","sources":["../../src/truth_kernel/diakrisis.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC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