@futdevpro/nts-dynamo 1.15.113 → 1.15.115

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.
@@ -0,0 +1,92 @@
1
+ import { DyFM_Error } from '@futdevpro/fsm-dynamo';
2
+
3
+ import { DyNTS_AIMock_Modality } from '../_enums/aim-modality.enum';
4
+ import { DyNTS_AIMock_Fixture } from '../_models/interfaces/aim-fixture.interface';
5
+ import { DyNTS_AIMock_ServiceCollection } from '../_models/interfaces/aim-service-collection.interface';
6
+ import { getDefaultAiMockServiceCollection } from '../_collections/aim-default-collection.util';
7
+ import { DyNTS_AIMock_TextFixtures } from '../fixtures/aim-text.fixtures';
8
+
9
+ /**
10
+ * **MP-8 SP-8.2 — integracios bizonyitas, NULLA halozattal.**
11
+ *
12
+ * Ez a spec a TENYLEGESEN COMMITOLT, valodi AI-generalasbol beegetett fixture-oket (`DyNTS_AIMock_TextFixtures`)
13
+ * tolti be a `getDefaultAiMockServiceCollection` factory-n keresztul — vagyis pontosan azon az uton, ahogy egy
14
+ * consumer hasznalna —, es igazolja a rendszer ket alapigeretet:
15
+ * 1. **replay**: a beegetett valasz visszajon, outbound hivas NELKUL,
16
+ * 2. **reject-on-unknown**: a nem beegetett input strukturalt hibat kap (D3 — sosem csendes fallback).
17
+ *
18
+ * Ha ez a spec zold, akkor a lanc `valodi generalas → determinisztikus beegetes → offline replay` mukodik.
19
+ */
20
+ describe('| ai-mock INTEGRACIOS BIZONYITAS (commitolt fixture-ok, halozat nelkul)', () => {
21
+
22
+ /** A beegetett keszlet legyen tenylegesen jelen — ures fixture-keszlet eseten a spec hamis-zold lenne. */
23
+ it('| a commitolt fixture-keszlet NEM ures (kulonben a tobbi allitas ertelmetlen)', () => {
24
+ expect(DyNTS_AIMock_TextFixtures.length).toBeGreaterThan(0);
25
+ });
26
+
27
+ it('| a factory-n keresztul betoltve a beegetett valasz VISSZAJATSZHATO (outbound hivas nelkul)', async () => {
28
+ const collection: DyNTS_AIMock_ServiceCollection = getDefaultAiMockServiceCollection({
29
+ fixtures: DyNTS_AIMock_TextFixtures,
30
+ });
31
+
32
+ const chat: DyNTS_AIMock_Fixture = DyNTS_AIMock_TextFixtures.find(
33
+ (fixture: DyNTS_AIMock_Fixture) => fixture.modality === DyNTS_AIMock_Modality.text && !!fixture.output
34
+ );
35
+
36
+ expect(chat).toBeDefined();
37
+
38
+ const replayed: unknown = await collection.service.chatCompletion({
39
+ provider: chat.provider,
40
+ model: chat.model,
41
+ config: chat.config,
42
+ input: chat.input,
43
+ });
44
+
45
+ expect(replayed).toEqual(chat.output);
46
+ });
47
+
48
+ it('| embedding-fixture is visszajatszhato ugyanazon a felületen', async () => {
49
+ const collection: DyNTS_AIMock_ServiceCollection = getDefaultAiMockServiceCollection({
50
+ fixtures: DyNTS_AIMock_TextFixtures,
51
+ });
52
+
53
+ const embedding: DyNTS_AIMock_Fixture = DyNTS_AIMock_TextFixtures.find(
54
+ (fixture: DyNTS_AIMock_Fixture) => fixture.modality === DyNTS_AIMock_Modality.embedding
55
+ );
56
+
57
+ if (!embedding) {
58
+ pending('nincs embedding-fixture a beegetett keszletben');
59
+
60
+ return;
61
+ }
62
+
63
+ const replayed: unknown = await collection.service.embed({
64
+ provider: embedding.provider,
65
+ model: embedding.model,
66
+ config: embedding.config,
67
+ input: embedding.input,
68
+ });
69
+
70
+ expect(replayed).toEqual(embedding.output);
71
+ });
72
+
73
+ it('| NEM beegetett input → strukturalt reject-on-unknown (D3: sosem csendes fallback)', async () => {
74
+ const collection: DyNTS_AIMock_ServiceCollection = getDefaultAiMockServiceCollection({
75
+ fixtures: DyNTS_AIMock_TextFixtures,
76
+ });
77
+
78
+ try {
79
+ await collection.service.chatCompletion({
80
+ provider: 'open-ai',
81
+ model: 'gpt-4o-mini',
82
+ input: 'ezt a bemenetet SOHA nem egettuk be',
83
+ });
84
+ fail('reject-on-unknown-t vartunk');
85
+ } catch (error) {
86
+ expect(error instanceof DyFM_Error).toBe(true);
87
+ if (error instanceof DyFM_Error) {
88
+ expect(error.message).toContain('no fixture');
89
+ }
90
+ }
91
+ });
92
+ });
@@ -1,7 +1,7 @@
1
1
  import { DyNTS_AIMock_Fixture } from '../_models/interfaces/aim-fixture.interface';
2
2
 
3
3
  /**
4
- * Valodi AI-generalasbol beegetve (live capture 2026-07-21). Kezzel NE szerkeszd.
4
+ * Valodi AI-generalasbol beegetve (live capture 2026-07-21/22). Kezzel NE szerkeszd.
5
5
  *
6
6
  * Determinisztikus sorrend (match-kulcs szerint) + rendezett objektum-kulcsok, hogy az ujra-generalas
7
7
  * ne okozzon zajos diff-et. Forras: `DyNTS_AIMock_FixtureSerializer_Util`.
@@ -100,6 +100,39 @@ export const DyNTS_AIMock_TextFixtures: DyNTS_AIMock_Fixture[] = [
100
100
  "provider": "open-ai",
101
101
  "sourceModel": "gpt-5.4-nano"
102
102
  },
103
+ {
104
+ "capturedAt": "2026-07-22T13:50:16.666Z",
105
+ "config": {
106
+ "size": "1024x1024"
107
+ },
108
+ "input": "a plain solid red square, flat color",
109
+ "inputHash": "cac20fa0b4d6eb0429e72b6695998ee4af14ea4337aa5d6f7e66af6cbe51e3ba",
110
+ "modality": "image",
111
+ "model": "gpt-image-2",
112
+ "output": {
113
+ "background": "opaque",
114
+ "imageBytes": 836511,
115
+ "imageSha256": "eac470a0c262c7db79fb42988671379e6ac1c97a687ee17a0f26846c81fe1173",
116
+ "output_format": "png",
117
+ "quality": "low",
118
+ "size": "1024x1024",
119
+ "usage": {
120
+ "input_tokens": 14,
121
+ "input_tokens_details": {
122
+ "image_tokens": 0,
123
+ "text_tokens": 14
124
+ },
125
+ "output_tokens": 196,
126
+ "output_tokens_details": {
127
+ "image_tokens": 196,
128
+ "text_tokens": 0
129
+ },
130
+ "total_tokens": 210
131
+ }
132
+ },
133
+ "provider": "open-ai",
134
+ "sourceModel": "gpt-image-2"
135
+ },
103
136
  {
104
137
  "capturedAt": "2026-07-22T00:58:39.151Z",
105
138
  "config": {},