@mneme-ai/core 1.98.0 → 2.0.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.
Files changed (81) hide show
  1. package/dist/bloodline/bloodline.test.d.ts +2 -0
  2. package/dist/bloodline/bloodline.test.d.ts.map +1 -0
  3. package/dist/bloodline/bloodline.test.js +96 -0
  4. package/dist/bloodline/bloodline.test.js.map +1 -0
  5. package/dist/bloodline/index.d.ts +124 -0
  6. package/dist/bloodline/index.d.ts.map +1 -0
  7. package/dist/bloodline/index.js +179 -0
  8. package/dist/bloodline/index.js.map +1 -0
  9. package/dist/dream/dream.test.d.ts +2 -0
  10. package/dist/dream/dream.test.d.ts.map +1 -0
  11. package/dist/dream/dream.test.js +61 -0
  12. package/dist/dream/dream.test.js.map +1 -0
  13. package/dist/dream/index.d.ts +59 -0
  14. package/dist/dream/index.d.ts.map +1 -0
  15. package/dist/dream/index.js +117 -0
  16. package/dist/dream/index.js.map +1 -0
  17. package/dist/flash/devils_advocate.d.ts +66 -0
  18. package/dist/flash/devils_advocate.d.ts.map +1 -0
  19. package/dist/flash/devils_advocate.js +154 -0
  20. package/dist/flash/devils_advocate.js.map +1 -0
  21. package/dist/flash/flash.d.ts +50 -0
  22. package/dist/flash/flash.d.ts.map +1 -0
  23. package/dist/flash/flash.js +67 -0
  24. package/dist/flash/flash.js.map +1 -0
  25. package/dist/flash/flash.test.d.ts +2 -0
  26. package/dist/flash/flash.test.d.ts.map +1 -0
  27. package/dist/flash/flash.test.js +221 -0
  28. package/dist/flash/flash.test.js.map +1 -0
  29. package/dist/flash/grounding.d.ts +55 -0
  30. package/dist/flash/grounding.d.ts.map +1 -0
  31. package/dist/flash/grounding.js +144 -0
  32. package/dist/flash/grounding.js.map +1 -0
  33. package/dist/flash/index.d.ts +18 -0
  34. package/dist/flash/index.d.ts.map +1 -0
  35. package/dist/flash/index.js +18 -0
  36. package/dist/flash/index.js.map +1 -0
  37. package/dist/flash/predictive.d.ts +44 -0
  38. package/dist/flash/predictive.d.ts.map +1 -0
  39. package/dist/flash/predictive.js +76 -0
  40. package/dist/flash/predictive.js.map +1 -0
  41. package/dist/flash/veracity.d.ts +99 -0
  42. package/dist/flash/veracity.d.ts.map +1 -0
  43. package/dist/flash/veracity.js +107 -0
  44. package/dist/flash/veracity.js.map +1 -0
  45. package/dist/index.d.ts +6 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +16 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/mutiny/index.d.ts +55 -0
  50. package/dist/mutiny/index.d.ts.map +1 -0
  51. package/dist/mutiny/index.js +67 -0
  52. package/dist/mutiny/index.js.map +1 -0
  53. package/dist/mutiny/mutiny.test.d.ts +2 -0
  54. package/dist/mutiny/mutiny.test.d.ts.map +1 -0
  55. package/dist/mutiny/mutiny.test.js +59 -0
  56. package/dist/mutiny/mutiny.test.js.map +1 -0
  57. package/dist/prophecy/index.d.ts +88 -0
  58. package/dist/prophecy/index.d.ts.map +1 -0
  59. package/dist/prophecy/index.js +94 -0
  60. package/dist/prophecy/index.js.map +1 -0
  61. package/dist/prophecy/prophecy.test.d.ts +2 -0
  62. package/dist/prophecy/prophecy.test.d.ts.map +1 -0
  63. package/dist/prophecy/prophecy.test.js +112 -0
  64. package/dist/prophecy/prophecy.test.js.map +1 -0
  65. package/dist/rainbow/passport.d.ts +28 -5
  66. package/dist/rainbow/passport.d.ts.map +1 -1
  67. package/dist/rainbow/passport.js +44 -9
  68. package/dist/rainbow/passport.js.map +1 -1
  69. package/dist/rainbow/passport_v99.test.d.ts +2 -0
  70. package/dist/rainbow/passport_v99.test.d.ts.map +1 -0
  71. package/dist/rainbow/passport_v99.test.js +53 -0
  72. package/dist/rainbow/passport_v99.test.js.map +1 -0
  73. package/dist/xray/index.d.ts +44 -0
  74. package/dist/xray/index.d.ts.map +1 -0
  75. package/dist/xray/index.js +139 -0
  76. package/dist/xray/index.js.map +1 -0
  77. package/dist/xray/xray.test.d.ts +2 -0
  78. package/dist/xray/xray.test.d.ts.map +1 -0
  79. package/dist/xray/xray.test.js +57 -0
  80. package/dist/xray/xray.test.js.map +1 -0
  81. package/package.json +1 -1
@@ -0,0 +1,221 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { computeVeracity, templateForVerdict, formatVeracityPulseLine, generateRefutations, runDevilsAdvocate, formatDevilsAdvocatePulseLine, groundClaim, formatGroundingPulseLine, predictNextQuery, formatPredictionPulseLine, runFlash, DEFAULT_SOURCE_WEIGHT, } from "./index.js";
3
+ // ============================================================
4
+ // VERACITY
5
+ // ============================================================
6
+ describe("v1.99 FLASH · Veracity-Velocity Singularity", () => {
7
+ it("computes V_eff with strong evidence + low H → AFFIRM", () => {
8
+ const r = computeVeracity({
9
+ claim: "this PSA-10 Pikachu Illustrator card is genuinely rare",
10
+ evidence: [
11
+ { fact: "PSA pop report shows only 41 known copies", supportStrength: 0.95, sourceWeight: 0.95, sourceKind: "expert-database" },
12
+ { fact: "Goldin auction sold one for $5.3M (2024)", supportStrength: 0.95, sourceWeight: 0.95, sourceKind: "verified-third-party" },
13
+ ],
14
+ hallucinationFactor: 0,
15
+ });
16
+ expect(r.V_eff).toBeGreaterThanOrEqual(0.75);
17
+ expect(r.verdict).toBe("AFFIRM");
18
+ });
19
+ it("'Super rare' from seller listing alone → REFUTE", () => {
20
+ const r = computeVeracity({
21
+ claim: "this Capcom Trump card deck is super rare",
22
+ evidence: [
23
+ // Single piece of evidence: the seller's own listing
24
+ { fact: '"Super rare" printed in listing title', supportStrength: 0.8, sourceWeight: 0.20, sourceKind: "seller-listing" },
25
+ ],
26
+ hallucinationFactor: 2.0,
27
+ phi_qx: 2.0, // commerce-source paranoia
28
+ });
29
+ expect(r.V_eff).toBeLessThan(0.30);
30
+ expect(["DOUBTFUL", "REFUTE"]).toContain(r.verdict);
31
+ });
32
+ it("DEFAULT_SOURCE_WEIGHT: seller-listing < image-OCR < user-statement < expert-database < verified-third-party", () => {
33
+ expect(DEFAULT_SOURCE_WEIGHT["seller-listing"]).toBeLessThan(DEFAULT_SOURCE_WEIGHT["image-OCR"]);
34
+ expect(DEFAULT_SOURCE_WEIGHT["image-OCR"]).toBeLessThan(DEFAULT_SOURCE_WEIGHT["user-statement"]);
35
+ expect(DEFAULT_SOURCE_WEIGHT["user-statement"]).toBeLessThan(DEFAULT_SOURCE_WEIGHT["expert-database"]);
36
+ expect(DEFAULT_SOURCE_WEIGHT["expert-database"]).toBeLessThan(DEFAULT_SOURCE_WEIGHT["verified-third-party"]);
37
+ });
38
+ it("ln(H+e) is always >= 1 (no division by zero)", () => {
39
+ const r = computeVeracity({
40
+ claim: "x",
41
+ evidence: [{ fact: "y", supportStrength: 1, sourceWeight: 1, sourceKind: "verified-third-party" }],
42
+ hallucinationFactor: 0,
43
+ });
44
+ expect(r.hallucinationPenalty).toBeGreaterThanOrEqual(1);
45
+ });
46
+ it("Φ_qx multiplier scales V_eff", () => {
47
+ const base = computeVeracity({ claim: "x", evidence: [{ fact: "y", supportStrength: 0.5, sourceWeight: 0.5, sourceKind: "unknown" }], hallucinationFactor: 0 });
48
+ const skeptical = computeVeracity({ claim: "x", evidence: [{ fact: "y", supportStrength: 0.5, sourceWeight: 0.5, sourceKind: "unknown" }], hallucinationFactor: 0, phi_qx: 0.5 });
49
+ expect(skeptical.V_eff).toBeCloseTo(base.V_eff * 0.5, 5);
50
+ });
51
+ it("templateForVerdict produces vendor-appropriate response stems", () => {
52
+ expect(templateForVerdict("AFFIRM", "the card is rare")).toContain("Verified");
53
+ expect(templateForVerdict("CAUTIOUS", "the card is rare")).toContain("Partially supported");
54
+ expect(templateForVerdict("DOUBTFUL", "the card is rare")).toContain("Cannot confirm");
55
+ expect(templateForVerdict("REFUTE", "the card is rare")).toContain("Refuse to confirm");
56
+ });
57
+ it("formatVeracityPulseLine produces compact summary", () => {
58
+ const r = computeVeracity({ claim: "x", evidence: [{ fact: "y", supportStrength: 0.5, sourceWeight: 0.5, sourceKind: "unknown" }], hallucinationFactor: 0 });
59
+ const line = formatVeracityPulseLine(r);
60
+ expect(line).toContain("V_eff=");
61
+ expect(line).toContain("verdict=");
62
+ });
63
+ });
64
+ // ============================================================
65
+ // DEVIL'S ADVOCATE
66
+ // ============================================================
67
+ describe("v1.99 FLASH · Recursive Self-Verification (Devil's Advocate)", () => {
68
+ it("generateRefutations emits negation, source-attack, specificity-flip, burden-shift, outlier", () => {
69
+ const r = generateRefutations("this item is super rare");
70
+ const kinds = new Set(r.map((c) => c.kind));
71
+ expect(kinds).toContain("negation");
72
+ expect(kinds).toContain("source-attack");
73
+ expect(kinds).toContain("specificity-flip");
74
+ expect(kinds).toContain("burden-shift");
75
+ expect(kinds).toContain("outlier");
76
+ });
77
+ it("downgrades AFFIRM → CAUTIOUS when refutation pressure > 0.10", () => {
78
+ const r = runDevilsAdvocate({
79
+ claim: "this trump card is super rare",
80
+ evidence: [
81
+ { fact: "listing says super rare", supportStrength: 0.7, sourceWeight: 0.20, sourceKind: "seller-listing" },
82
+ ],
83
+ hallucinationFactor: 1.5,
84
+ phi_qx: 1.0,
85
+ });
86
+ expect(r.refutations.length).toBeGreaterThan(0);
87
+ expect(r.topRefutation).not.toBeNull();
88
+ // Original was DOUBTFUL → after downgrade still in DOUBTFUL or REFUTE
89
+ expect(["DOUBTFUL", "REFUTE"]).toContain(r.finalVerdict);
90
+ });
91
+ it("preserves verdict when refutation pressure is < 0.10", () => {
92
+ const r = runDevilsAdvocate({
93
+ claim: "this PSA-10 card has 41 known copies",
94
+ evidence: [
95
+ { fact: "PSA pop report shows 41", supportStrength: 0.95, sourceWeight: 0.95, sourceKind: "expert-database" },
96
+ { fact: "Goldin auction sold one $5.3M", supportStrength: 0.9, sourceWeight: 0.95, sourceKind: "verified-third-party" },
97
+ ],
98
+ hallucinationFactor: 0,
99
+ });
100
+ expect(r.finalVerdict).toBe("AFFIRM");
101
+ expect(r.adjustmentReason).toMatch(/preserved|no refutation/i);
102
+ });
103
+ it("custom refutation generator can be injected (for tests)", () => {
104
+ const r = runDevilsAdvocate({
105
+ claim: "x",
106
+ evidence: [{ fact: "y", supportStrength: 0.5, sourceWeight: 0.5, sourceKind: "unknown" }],
107
+ hallucinationFactor: 0,
108
+ refutationGenerator: () => [{ text: "fake refutation", kind: "outlier" }],
109
+ });
110
+ expect(r.refutations.length).toBe(1);
111
+ expect(r.refutations[0].candidate.text).toBe("fake refutation");
112
+ });
113
+ it("formatDevilsAdvocatePulseLine produces compact summary", () => {
114
+ const r = runDevilsAdvocate({ claim: "x", evidence: [{ fact: "y", supportStrength: 0.5, sourceWeight: 0.5, sourceKind: "unknown" }], hallucinationFactor: 0 });
115
+ const line = formatDevilsAdvocatePulseLine(r);
116
+ expect(line).toContain("DEVILS-ADVOCATE");
117
+ expect(line).toContain("final=");
118
+ });
119
+ });
120
+ // ============================================================
121
+ // GROUNDING
122
+ // ============================================================
123
+ describe("v1.99 FLASH · Hyper-Contextual Grounding", () => {
124
+ it("classifies seller-listing context from commerce signals", () => {
125
+ const r = groundClaim("[Super rare] CAPCOM Capcom Character Trump Street Fighter Mega Man ฿1,086.49 (tax included) Shipping included Buy Now on Buyee");
126
+ expect(r.context).toBe("seller-listing");
127
+ expect(r.commerceSignals.length).toBeGreaterThanOrEqual(2);
128
+ expect(r.rarityClaims.length).toBeGreaterThanOrEqual(1);
129
+ expect(r.suggestedSourceWeight).toBeLessThan(0.30);
130
+ expect(r.suggestedHallucinationAddOn).toBeGreaterThanOrEqual(1.0);
131
+ });
132
+ it("classifies expert-review context with PSA / population-report signals", () => {
133
+ const r = groundClaim("PSA grading confirms this card. Population report: 41 copies. Auction record: Goldin 2024.");
134
+ expect(r.context).toBe("expert-review");
135
+ expect(r.thirdPartyProofs.length).toBeGreaterThanOrEqual(2);
136
+ expect(r.suggestedSourceWeight).toBeGreaterThanOrEqual(0.80);
137
+ });
138
+ it("classifies user-statement when rarity present but no commerce + no proof", () => {
139
+ const r = groundClaim("I think this thing is rare");
140
+ expect(r.context).toBe("user-statement");
141
+ });
142
+ it("classifies neutral-text when nothing matches", () => {
143
+ const r = groundClaim("This is some random product description with no specific claims.");
144
+ expect(r.context).toBe("neutral-text");
145
+ });
146
+ it("formatGroundingPulseLine produces compact summary", () => {
147
+ const r = groundClaim("[Super rare] ฿1,086.49 Buy Now on Buyee");
148
+ const line = formatGroundingPulseLine(r);
149
+ expect(line).toContain("GROUNDING");
150
+ expect(line).toContain("rarity=");
151
+ expect(line).toContain("commerce=");
152
+ });
153
+ });
154
+ // ============================================================
155
+ // PROMPT-Q LATENCY
156
+ // ============================================================
157
+ describe("v1.99 FLASH · Prompt-Q-Latency Engine", () => {
158
+ it("predicts 'rarity-followup' when reply mentions rare/collectible", () => {
159
+ const r = predictNextQuery("Cannot confirm this is rare without auction history.");
160
+ expect(r.predictions[0]?.feature.id).toBe("rarity-followup");
161
+ });
162
+ it("predicts 'value-followup' when reply mentions price/worth", () => {
163
+ const r = predictNextQuery("The listed price is 1,086.49 baht.");
164
+ expect(r.predictions.some((p) => p.feature.id === "value-followup")).toBe(true);
165
+ });
166
+ it("returns empty predictions when reply has no triggers", () => {
167
+ const r = predictNextQuery("Hello!");
168
+ expect(r.predictions.length).toBe(0);
169
+ });
170
+ it("formatPredictionPulseLine produces compact summary", () => {
171
+ const r = predictNextQuery("The rare card is collectible.");
172
+ const line = formatPredictionPulseLine(r);
173
+ expect(line).toContain("PROMPT-Q");
174
+ });
175
+ });
176
+ // ============================================================
177
+ // FLASH MASTER — the user's exact "Super rare CAPCOM" case
178
+ // ============================================================
179
+ describe("v1.99 FLASH · the user's exact 'Super rare CAPCOM' hallucination case", () => {
180
+ it("refuses to confirm 'super rare' when the only evidence is the seller listing", () => {
181
+ const r = runFlash({
182
+ claim: "this Capcom Trump card deck is super rare",
183
+ contextText: "[Super rare] CAPCOM Capcom Character Trump Street Fighter Mega Man ฿1,086.49 (tax included) Shipping included Buy Now on Buyee. Product Description: 90年代に販売されたカプコンの人気キャラクター...",
184
+ baseHallucinationFactor: 0,
185
+ phi_qx: 2.0, // commerce paranoia
186
+ });
187
+ // CORE assertion: vanilla AIs would AFFIRM ("yes it's super rare!").
188
+ // FLASH must NOT AFFIRM.
189
+ expect(r.verdict).not.toBe("AFFIRM");
190
+ expect(["DOUBTFUL", "REFUTE"]).toContain(r.verdict);
191
+ expect(r.grounding.context).toBe("seller-listing");
192
+ expect(r.grounding.rarityClaims.length).toBeGreaterThan(0);
193
+ expect(r.veracity.V_eff).toBeLessThan(0.30);
194
+ expect(r.template).toMatch(/Cannot confirm|Refuse to confirm/);
195
+ });
196
+ it("AFFIRMs the same claim WHEN third-party evidence is also present", () => {
197
+ const r = runFlash({
198
+ claim: "this Capcom Trump card deck is super rare",
199
+ contextText: "[Super rare] CAPCOM Capcom Character Trump ฿1,086.49 Buy Now on Buyee",
200
+ additionalEvidence: [
201
+ { fact: "Mandarake catalog shows only 800 copies were printed (1994)", supportStrength: 0.9, sourceWeight: 0.85, sourceKind: "expert-database" },
202
+ { fact: "Yahoo Auctions Japan 5-year history shows 7 completed sales, avg ¥4800", supportStrength: 0.85, sourceWeight: 0.90, sourceKind: "verified-third-party" },
203
+ ],
204
+ baseHallucinationFactor: 0,
205
+ phi_qx: 1.0,
206
+ });
207
+ expect(["AFFIRM", "CAUTIOUS"]).toContain(r.verdict);
208
+ expect(r.veracity.V_eff).toBeGreaterThan(0.35);
209
+ });
210
+ it("produces a pulseLine that an AI agent can surface to the user", () => {
211
+ const r = runFlash({
212
+ claim: "this is super rare",
213
+ contextText: "[Super rare] ฿1,086.49 Buy Now on Buyee",
214
+ baseHallucinationFactor: 0,
215
+ });
216
+ expect(r.pulseLine).toContain("FLASH");
217
+ expect(r.pulseLine).toMatch(/AFFIRM|CAUTIOUS|DOUBTFUL|REFUTE/);
218
+ expect(r.pulseLine).toContain("V_eff=");
219
+ });
220
+ });
221
+ //# sourceMappingURL=flash.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flash.test.js","sourceRoot":"","sources":["../../src/flash/flash.test.ts"],"names":[],"mappings":"AA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Detect that "Super rare" sitting on a product listing image is NOT a
5
+ * verified rarity claim — it's marketing copy. The grounding step
6
+ * extracts text from the user's input (image OCR result or pasted
7
+ * caption), classifies the SOURCE CONTEXT, and assigns a source weight
8
+ * that reflects the trust the AI agent should put in it.
9
+ *
10
+ * The user's exact case:
11
+ * image_4a1c54.jpg contains text "[Super rare] CAPCOM Capcom Character
12
+ * Trump Street Fighter Mega Man" plus "1,086.49 baht" plus
13
+ * "Buy Now on Buyee".
14
+ * Every vanilla AI: "yes it's rare" — because it pattern-matched the
15
+ * surface text. WRONG.
16
+ *
17
+ * FLASH grounding extracts:
18
+ * - rarity claims ("Super rare", "limited", "extremely rare")
19
+ * - commerce signals ("Buy Now", "shipping", "BHT", "$", "¥")
20
+ * - source context ("seller listing", "marketplace", "auction site")
21
+ * - third-party evidence absence
22
+ * → classifies the whole frame as `seller-listing` source kind
23
+ * → demotes source weight to 0.20 (per veracity.ts DEFAULT_SOURCE_WEIGHT)
24
+ *
25
+ * AI agent then runs computeVeracity with the demoted source weight and
26
+ * the rarity claim gets correctly marked DOUBTFUL or REFUTE — not AFFIRM.
27
+ *
28
+ * Pure function. Deterministic. Offline-only (no external lookups).
29
+ */
30
+ import type { EvidenceItem } from "./veracity.js";
31
+ export type SourceContext = "seller-listing" | "auction-record" | "expert-review" | "primary-document" | "encyclopedia" | "user-statement" | "neutral-text";
32
+ export interface GroundingResult {
33
+ /** Classified context for the input frame. */
34
+ context: SourceContext;
35
+ /** Suggested EvidenceItem.sourceKind to use downstream. */
36
+ sourceKind: EvidenceItem["sourceKind"];
37
+ /** Detected rarity claims (literal phrases). */
38
+ rarityClaims: string[];
39
+ /** Detected commerce signals (literal phrases). */
40
+ commerceSignals: string[];
41
+ /** Detected third-party verification signals. */
42
+ thirdPartyProofs: string[];
43
+ /** Suggested source weight for veracity.computeVeracity. */
44
+ suggestedSourceWeight: number;
45
+ /** Suggested hallucination factor add-on for veracity. */
46
+ suggestedHallucinationAddOn: number;
47
+ /** Why we classified it that way. */
48
+ reason: string;
49
+ }
50
+ /** Classify the source context of free-form text (OCR result, caption,
51
+ * description) and produce a recommendation for veracity downstream. */
52
+ export declare function groundClaim(rawText: string): GroundingResult;
53
+ /** One-line summary for the pulse. */
54
+ export declare function formatGroundingPulseLine(r: GroundingResult): string;
55
+ //# sourceMappingURL=grounding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grounding.d.ts","sourceRoot":"","sources":["../../src/flash/grounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA+ClD,MAAM,MAAM,aAAa,GACrB,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,cAAc,CAAC;AAEnB,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,OAAO,EAAE,aAAa,CAAC;IACvB,2DAA2D;IAC3D,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACvC,gDAAgD;IAChD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mDAAmD;IACnD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4DAA4D;IAC5D,qBAAqB,EAAE,MAAM,CAAC;IAC9B,0DAA0D;IAC1D,2BAA2B,EAAE,MAAM,CAAC;IACpC,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD;yEACyE;AACzE,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAqD5D;AAED,sCAAsC;AACtC,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAEnE"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * v1.99.0 -- FLASH · Hyper-Contextual Grounding
3
+ *
4
+ * Detect that "Super rare" sitting on a product listing image is NOT a
5
+ * verified rarity claim — it's marketing copy. The grounding step
6
+ * extracts text from the user's input (image OCR result or pasted
7
+ * caption), classifies the SOURCE CONTEXT, and assigns a source weight
8
+ * that reflects the trust the AI agent should put in it.
9
+ *
10
+ * The user's exact case:
11
+ * image_4a1c54.jpg contains text "[Super rare] CAPCOM Capcom Character
12
+ * Trump Street Fighter Mega Man" plus "1,086.49 baht" plus
13
+ * "Buy Now on Buyee".
14
+ * Every vanilla AI: "yes it's rare" — because it pattern-matched the
15
+ * surface text. WRONG.
16
+ *
17
+ * FLASH grounding extracts:
18
+ * - rarity claims ("Super rare", "limited", "extremely rare")
19
+ * - commerce signals ("Buy Now", "shipping", "BHT", "$", "¥")
20
+ * - source context ("seller listing", "marketplace", "auction site")
21
+ * - third-party evidence absence
22
+ * → classifies the whole frame as `seller-listing` source kind
23
+ * → demotes source weight to 0.20 (per veracity.ts DEFAULT_SOURCE_WEIGHT)
24
+ *
25
+ * AI agent then runs computeVeracity with the demoted source weight and
26
+ * the rarity claim gets correctly marked DOUBTFUL or REFUTE — not AFFIRM.
27
+ *
28
+ * Pure function. Deterministic. Offline-only (no external lookups).
29
+ */
30
+ const RARITY_CLAIM_PATTERNS = [
31
+ /\b(super )?rare\b/i,
32
+ /\bextremely rare\b/i,
33
+ /\blimited edition\b/i,
34
+ /\bone of a kind\b/i,
35
+ /\bunique\b/i,
36
+ /\bcollectible\b/i,
37
+ /\boriginal\b/i,
38
+ /\bauthentic\b/i,
39
+ /\bmint condition\b/i,
40
+ /\bvintage\b/i,
41
+ /\bgrail\b/i,
42
+ ];
43
+ const COMMERCE_SIGNALS = [
44
+ /\bbuy now\b/i,
45
+ /\bshipping\b/i,
46
+ /\bauction\b/i,
47
+ /\bprice\b/i,
48
+ /\bbht\b/i,
49
+ /\b฿/i,
50
+ /[$€¥£]\s*\d/,
51
+ /\d[\d,]*\.\d{2}\b/, // 1,086.49
52
+ /\bproduct description\b/i,
53
+ /\bbuyee\b/i,
54
+ /\bebay\b/i,
55
+ /\bmercari\b/i,
56
+ /\baliexpress\b/i,
57
+ /\bamazon\b/i,
58
+ /\b楽天\b/i, // Rakuten
59
+ /\bヤフオク\b/i, // Yahoo Auctions JP
60
+ ];
61
+ const THIRD_PARTY_PROOF_HINTS = [
62
+ /\bauction record\b/i,
63
+ /\bpopulation report\b/i,
64
+ /\bgrading\b/i,
65
+ /\bpsa\b/i, // PSA / Beckett grading
66
+ /\bbgs\b/i,
67
+ /\bcomptia\b/i,
68
+ /\bmuseum\b/i,
69
+ /\bcatalog\b/i,
70
+ /\barchive\b/i,
71
+ ];
72
+ function findMatches(text, patterns) {
73
+ const hits = [];
74
+ for (const p of patterns) {
75
+ const m = text.match(p);
76
+ if (m)
77
+ hits.push(m[0]);
78
+ }
79
+ return hits;
80
+ }
81
+ /** Classify the source context of free-form text (OCR result, caption,
82
+ * description) and produce a recommendation for veracity downstream. */
83
+ export function groundClaim(rawText) {
84
+ const rarityClaims = findMatches(rawText, RARITY_CLAIM_PATTERNS);
85
+ const commerceSignals = findMatches(rawText, COMMERCE_SIGNALS);
86
+ const thirdPartyProofs = findMatches(rawText, THIRD_PARTY_PROOF_HINTS);
87
+ let context;
88
+ let reason;
89
+ let suggestedSourceWeight;
90
+ let suggestedHallucinationAddOn;
91
+ if (thirdPartyProofs.length >= 2) {
92
+ context = "expert-review";
93
+ reason = `${thirdPartyProofs.length} third-party verification signals detected (${thirdPartyProofs.join(", ")})`;
94
+ suggestedSourceWeight = 0.85;
95
+ suggestedHallucinationAddOn = 0;
96
+ }
97
+ else if (commerceSignals.length >= 2) {
98
+ context = "seller-listing";
99
+ reason = `${commerceSignals.length} commerce signals (${commerceSignals.slice(0, 3).join(", ")}) — this is a sales page; treat rarity claims as marketing copy`;
100
+ suggestedSourceWeight = 0.20;
101
+ // Adding 2 to H = more skepticism for marketing-tier sources
102
+ suggestedHallucinationAddOn = rarityClaims.length > 0 ? 2.0 : 1.0;
103
+ }
104
+ else if (rarityClaims.length > 0) {
105
+ context = "user-statement";
106
+ reason = `rarity claim "${rarityClaims[0]}" present but no commerce signals + no third-party proofs — caller's own assertion`;
107
+ suggestedSourceWeight = 0.55;
108
+ suggestedHallucinationAddOn = 1.0;
109
+ }
110
+ else {
111
+ context = "neutral-text";
112
+ reason = "no rarity claim, no commerce signal, no third-party proof";
113
+ suggestedSourceWeight = 0.50;
114
+ suggestedHallucinationAddOn = 0;
115
+ }
116
+ // Map to the canonical EvidenceItem sourceKind enum.
117
+ // (Only the four cases actually produced by the classifier above are
118
+ // handled here — tsc would flag dead cases otherwise. The other
119
+ // SourceContext values are reserved for future classifiers.)
120
+ let sourceKind;
121
+ if (context === "expert-review")
122
+ sourceKind = "expert-database";
123
+ else if (context === "seller-listing")
124
+ sourceKind = "seller-listing";
125
+ else if (context === "user-statement")
126
+ sourceKind = "user-statement";
127
+ else
128
+ sourceKind = "unknown";
129
+ return {
130
+ context,
131
+ sourceKind,
132
+ rarityClaims,
133
+ commerceSignals,
134
+ thirdPartyProofs,
135
+ suggestedSourceWeight,
136
+ suggestedHallucinationAddOn,
137
+ reason,
138
+ };
139
+ }
140
+ /** One-line summary for the pulse. */
141
+ export function formatGroundingPulseLine(r) {
142
+ return `GROUNDING · context=${r.context} · rarity=${r.rarityClaims.length} · commerce=${r.commerceSignals.length} · third-party=${r.thirdPartyProofs.length} · suggested-weight=${r.suggestedSourceWeight}`;
143
+ }
144
+ //# sourceMappingURL=grounding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grounding.js","sourceRoot":"","sources":["../../src/flash/grounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,MAAM,qBAAqB,GAAG;IAC5B,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,oBAAoB;IACpB,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,qBAAqB;IACrB,cAAc;IACd,YAAY;CACb,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACv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;QACL,OAAO;QACP,UAAU;QACV,YAAY;QACZ,eAAe;QACf,gBAAgB;QAChB,qBAAqB;QACrB,2BAA2B;QAC3B,MAAM;KACP,CAAC;AACJ,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,wBAAwB,CAAC,CAAkB;IACzD,OAAO,uBAAuB,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,YAAY,CAAC,MAAM,eAAe,CAAC,CAAC,eAAe,CAAC,MAAM,kBAAkB,CAAC,CAAC,gBAAgB,CAAC,MAAM,uBAAuB,CAAC,CAAC,qBAAqB,EAAE,CAAC;AAC9M,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * v1.99.0 -- FLASH INTELLIGENCE public surface.
3
+ *
4
+ * "Not trained to be skeptical. Engineered to be."
5
+ *
6
+ * Composed of:
7
+ * ⚖ Veracity-Velocity Singularity (computeVeracity)
8
+ * 👹 Recursive Self-Verification — Devil's Advocate (runDevilsAdvocate)
9
+ * 🌐 Hyper-Contextual Grounding (groundClaim)
10
+ * ⚡ Prompt-Q-Latency Engine (predictNextQuery)
11
+ * ✨ FLASH master function (runFlash)
12
+ */
13
+ export * from "./veracity.js";
14
+ export * from "./devils_advocate.js";
15
+ export * from "./grounding.js";
16
+ export * from "./predictive.js";
17
+ export * from "./flash.js";
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/flash/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * v1.99.0 -- FLASH INTELLIGENCE public surface.
3
+ *
4
+ * "Not trained to be skeptical. Engineered to be."
5
+ *
6
+ * Composed of:
7
+ * ⚖ Veracity-Velocity Singularity (computeVeracity)
8
+ * 👹 Recursive Self-Verification — Devil's Advocate (runDevilsAdvocate)
9
+ * 🌐 Hyper-Contextual Grounding (groundClaim)
10
+ * ⚡ Prompt-Q-Latency Engine (predictNextQuery)
11
+ * ✨ FLASH master function (runFlash)
12
+ */
13
+ export * from "./veracity.js";
14
+ export * from "./devils_advocate.js";
15
+ export * from "./grounding.js";
16
+ export * from "./predictive.js";
17
+ export * from "./flash.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/flash/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * v1.99.0 -- FLASH · Prompt-Q-Latency Engine (predictive reasoning)
3
+ *
4
+ * After the AI replies to N, it pre-warms a Markov-chain prediction for
5
+ * the user's likely N+1 question + builds the context the answer would
6
+ * need. If the prediction hits, the AI replies in ~0 ms wall (no
7
+ * round-trip to "think about the question first").
8
+ *
9
+ * Mneme already ships PRECOG (Markov + ACO pheromone) for MCP tool
10
+ * sequences. This is the same idea applied to USER messages — different
11
+ * domain, same math.
12
+ *
13
+ * Honest scope: this v1.99 ships the predictive CORE + a deterministic
14
+ * "what's the user likely to ask next given the conversation arc?"
15
+ * scorer. The actual context pre-warming hook into Claude Code/Cursor
16
+ * is daemon work in v2.00.
17
+ */
18
+ export interface QueryFeature {
19
+ /** Stable id for this question-class. */
20
+ id: string;
21
+ /** Human label, e.g. "follow-up: is this authentic?". */
22
+ label: string;
23
+ /** Keywords that, when present in the AI's last reply, vote for this. */
24
+ triggers: string[];
25
+ /** Pre-warm hint — what context to fetch for the predicted question. */
26
+ prewarmHint: string;
27
+ }
28
+ /** Built-in question classes derived from common Mneme conversation arcs. */
29
+ export declare const QUESTION_CLASSES: QueryFeature[];
30
+ export interface PredictionResult {
31
+ /** Top-K predicted next questions, ranked by trigger overlap. */
32
+ predictions: Array<{
33
+ feature: QueryFeature;
34
+ score: number;
35
+ matchedTriggers: string[];
36
+ }>;
37
+ /** Pre-warm hints aggregated across the top predictions. */
38
+ prewarmHints: string[];
39
+ }
40
+ /** Predict next likely user question given the AI's last reply text. */
41
+ export declare function predictNextQuery(lastReplyText: string, topK?: number): PredictionResult;
42
+ /** One-line summary. */
43
+ export declare function formatPredictionPulseLine(r: PredictionResult): string;
44
+ //# sourceMappingURL=predictive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predictive.d.ts","sourceRoot":"","sources":["../../src/flash/predictive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,EAAE,YAAY,EAqC1C,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,WAAW,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACxF,4DAA4D;IAC5D,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,gBAAgB,CAUlF;AAED,wBAAwB;AACxB,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAIrE"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * v1.99.0 -- FLASH · Prompt-Q-Latency Engine (predictive reasoning)
3
+ *
4
+ * After the AI replies to N, it pre-warms a Markov-chain prediction for
5
+ * the user's likely N+1 question + builds the context the answer would
6
+ * need. If the prediction hits, the AI replies in ~0 ms wall (no
7
+ * round-trip to "think about the question first").
8
+ *
9
+ * Mneme already ships PRECOG (Markov + ACO pheromone) for MCP tool
10
+ * sequences. This is the same idea applied to USER messages — different
11
+ * domain, same math.
12
+ *
13
+ * Honest scope: this v1.99 ships the predictive CORE + a deterministic
14
+ * "what's the user likely to ask next given the conversation arc?"
15
+ * scorer. The actual context pre-warming hook into Claude Code/Cursor
16
+ * is daemon work in v2.00.
17
+ */
18
+ /** Built-in question classes derived from common Mneme conversation arcs. */
19
+ export const QUESTION_CLASSES = [
20
+ {
21
+ id: "rarity-followup",
22
+ label: "Is this actually rare? Show evidence.",
23
+ triggers: ["rare", "rarity", "collectible", "valuable", "limited"],
24
+ prewarmHint: "Fetch auction history + production-count if available; mark seller-listing claims as low source weight.",
25
+ },
26
+ {
27
+ id: "authenticity-followup",
28
+ label: "How do I verify it's authentic?",
29
+ triggers: ["authentic", "real", "original", "fake", "counterfeit"],
30
+ prewarmHint: "Provide grading-service references (PSA/BGS for cards, expert-database for collectibles).",
31
+ },
32
+ {
33
+ id: "value-followup",
34
+ label: "What's it actually worth?",
35
+ triggers: ["worth", "value", "price", "expensive", "cheap", "money"],
36
+ prewarmHint: "Pull sold-listing comparables; ignore asking prices on active listings.",
37
+ },
38
+ {
39
+ id: "alternative-followup",
40
+ label: "Are there cheaper / better alternatives?",
41
+ triggers: ["alternative", "instead", "competitor", "similar"],
42
+ prewarmHint: "Pull DNA-search results for similar items + cross-vendor pricing.",
43
+ },
44
+ {
45
+ id: "decision-justify-followup",
46
+ label: "Why did you say that?",
47
+ triggers: ["why", "explain", "because", "reason", "justify"],
48
+ prewarmHint: "Surface the V_eff + grounding + devil's-advocate trace from the prior reply.",
49
+ },
50
+ {
51
+ id: "implement-followup",
52
+ label: "Now implement it.",
53
+ triggers: ["implement", "code", "write", "build", "create"],
54
+ prewarmHint: "Cache the file paths + skeleton scaffolds matching the prior decision.",
55
+ },
56
+ ];
57
+ /** Predict next likely user question given the AI's last reply text. */
58
+ export function predictNextQuery(lastReplyText, topK = 3) {
59
+ const text = lastReplyText.toLowerCase();
60
+ const scored = QUESTION_CLASSES.map((qc) => {
61
+ const matched = qc.triggers.filter((t) => text.includes(t.toLowerCase()));
62
+ return { feature: qc, score: matched.length, matchedTriggers: matched };
63
+ });
64
+ scored.sort((a, b) => b.score - a.score);
65
+ const predictions = scored.filter((s) => s.score > 0).slice(0, topK);
66
+ const prewarmHints = predictions.map((p) => p.feature.prewarmHint);
67
+ return { predictions, prewarmHints };
68
+ }
69
+ /** One-line summary. */
70
+ export function formatPredictionPulseLine(r) {
71
+ if (r.predictions.length === 0)
72
+ return `PROMPT-Q · no prediction (lastReply has no triggers)`;
73
+ const top = r.predictions[0];
74
+ return `PROMPT-Q · top=${top.feature.id} score=${top.score} · prewarm=${r.prewarmHints.length} hints`;
75
+ }
76
+ //# sourceMappingURL=predictive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predictive.js","sourceRoot":"","sources":["../../src/flash/predictive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC9C;QACE,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,uCAAuC;QAC9C,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,CAAC;QAClE,WAAW,EAAE,yGAAyG;KACvH;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,iCAAiC;QACxC,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC;QAClE,WAAW,EAAE,2FAA2F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