geminize 0.1.1 → 1.1.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.
- checksums.yaml +4 -4
- data/.cursor/mcp.json +3 -0
- data/.cursor/rules/isolation_rules/Core/command-execution.mdc +235 -0
- data/.cursor/rules/isolation_rules/Core/complexity-decision-tree.mdc +187 -0
- data/.cursor/rules/isolation_rules/Core/creative-phase-enforcement.mdc +145 -0
- data/.cursor/rules/isolation_rules/Core/creative-phase-metrics.mdc +195 -0
- data/.cursor/rules/isolation_rules/Core/file-verification.mdc +198 -0
- data/.cursor/rules/isolation_rules/Core/platform-awareness.mdc +71 -0
- data/.cursor/rules/isolation_rules/Level3/planning-comprehensive.mdc +159 -0
- data/.cursor/rules/isolation_rules/Level3/task-tracking-intermediate.mdc +135 -0
- data/.cursor/rules/isolation_rules/Phases/CreativePhase/creative-phase-architecture.mdc +187 -0
- data/.cursor/rules/isolation_rules/main.mdc +123 -0
- data/.cursor/rules/isolation_rules/visual-maps/archive-mode-map.mdc +277 -0
- data/.cursor/rules/isolation_rules/visual-maps/creative-mode-map.mdc +224 -0
- data/.cursor/rules/isolation_rules/visual-maps/implement-mode-map.mdc +321 -0
- data/.cursor/rules/isolation_rules/visual-maps/plan-mode-map.mdc +269 -0
- data/.cursor/rules/isolation_rules/visual-maps/qa-mode-map.mdc +495 -0
- data/.cursor/rules/isolation_rules/visual-maps/reflect-mode-map.mdc +234 -0
- data/.cursor/rules/isolation_rules/visual-maps/van-mode-map.mdc +902 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-complexity-determination.mdc +60 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-file-verification.mdc +49 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-mode-map.mdc +49 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-platform-detection.mdc +50 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/build-test.mdc +117 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/config-check.mdc +103 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/dependency-check.mdc +147 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/environment-check.mdc +104 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/file-verification.mdc +1 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-main.mdc +142 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/common-fixes.mdc +92 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/mode-transitions.mdc +101 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/reports.mdc +149 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/rule-calling-guide.mdc +66 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/rule-calling-help.mdc +19 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-validation.md.old +363 -0
- data/.env.example +7 -0
- data/.memory_bank/activeContext.md +78 -0
- data/.memory_bank/progress.md +80 -0
- data/.memory_bank/projectbrief.md +29 -0
- data/.memory_bank/systemPatterns.md +90 -0
- data/.memory_bank/tasks.md +98 -0
- data/.memory_bank/techContext.md +73 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +27 -1
- data/README.md +34 -98
- data/examples/README.md +7 -28
- data/examples/embeddings.rb +18 -20
- data/examples/models_api.rb +125 -0
- data/examples/multimodal.rb +9 -9
- data/lib/geminize/configuration.rb +4 -4
- data/lib/geminize/model_info.rb +87 -8
- data/lib/geminize/models/content_request.rb +1 -1
- data/lib/geminize/models/model.rb +101 -109
- data/lib/geminize/models/model_list.rb +70 -28
- data/lib/geminize/request_builder.rb +29 -0
- data/lib/geminize/version.rb +1 -1
- data/lib/geminize.rb +71 -17
- metadata +46 -20
- data/examples/rails_chat/README.md +0 -69
- data/examples/rails_chat/app/controllers/chat_controller.rb +0 -26
- data/examples/rails_chat/app/views/chat/index.html.erb +0 -112
- data/examples/rails_chat/config/routes.rb +0 -8
- data/examples/rails_initializer.rb +0 -46
- data/geminize-0.1.0.gem +0 -0
- data/lib/geminize/rails/app/controllers/concerns/geminize/controller.rb +0 -105
- data/lib/geminize/rails/app/helpers/geminize_helper.rb +0 -125
- data/lib/geminize/rails/controller_additions.rb +0 -41
- data/lib/geminize/rails/engine.rb +0 -29
- data/lib/geminize/rails/helper_additions.rb +0 -37
- data/lib/geminize/rails.rb +0 -50
- data/lib/geminize/railtie.rb +0 -33
- data/lib/generators/geminize/install_generator.rb +0 -22
- data/lib/generators/geminize/templates/README +0 -31
- data/lib/generators/geminize/templates/initializer.rb +0 -38
@@ -0,0 +1,363 @@
|
|
1
|
+
# VAN MODE: QA TECHNICAL VALIDATION (Pre-BUILD)
|
2
|
+
|
3
|
+
> **TL;DR:** This map details the technical validation process executed *after* CREATIVE mode and *before* BUILD mode, triggered by the `VAN QA` command. It ensures dependencies, configuration, environment, and basic build functionality are sound.
|
4
|
+
|
5
|
+
## 🚀 VAN QA MODE ACTIVATION
|
6
|
+
|
7
|
+
After completing CREATIVE mode, when the user types "VAN QA", respond:
|
8
|
+
|
9
|
+
```
|
10
|
+
User: VAN QA
|
11
|
+
|
12
|
+
Response: OK VAN QA - Beginning Technical Validation
|
13
|
+
Loading QA Validation map...
|
14
|
+
```
|
15
|
+
|
16
|
+
## 🔄 QA COMMAND PRECEDENCE (QA Override)
|
17
|
+
|
18
|
+
QA validation can be called at any point (`QA` command) and takes immediate precedence:
|
19
|
+
|
20
|
+
```mermaid
|
21
|
+
graph TD
|
22
|
+
UserQA["User Types: QA"] --> HighPriority["⚠️ HIGH PRIORITY COMMAND"]
|
23
|
+
HighPriority --> CurrentTask["Pause Current Task/Process"]
|
24
|
+
CurrentTask --> LoadQA["Load QA Validation Map (This File)"]
|
25
|
+
LoadQA --> RunQA["Execute QA Validation Process"]
|
26
|
+
RunQA --> QAResults{"QA Results"}
|
27
|
+
|
28
|
+
QAResults -->|"PASS"| ResumeFlow["Resume Prior Process Flow"]
|
29
|
+
QAResults -->|"FAIL"| FixIssues["Fix Identified Issues"]
|
30
|
+
FixIssues --> ReRunQA["Re-run QA Validation"]
|
31
|
+
ReRunQA --> QAResults
|
32
|
+
|
33
|
+
style UserQA fill:#f8d486,stroke:#e8b84d,color:black
|
34
|
+
style HighPriority fill:#ff0000,stroke:#cc0000,color:white,stroke-width:3px
|
35
|
+
style LoadQA fill:#4da6ff,stroke:#0066cc,color:white
|
36
|
+
style RunQA fill:#4da6ff,stroke:#0066cc,color:white
|
37
|
+
style QAResults fill:#f6546a,stroke:#c30052,color:white
|
38
|
+
```
|
39
|
+
|
40
|
+
### QA Interruption Rules
|
41
|
+
|
42
|
+
1. **Immediate Precedence:** `QA` command interrupts everything.
|
43
|
+
2. **Load & Execute:** Load this map (`van-qa-validation.mdc`) and run the full process.
|
44
|
+
3. **Remediation Priority:** Fixes take priority over pending mode switches.
|
45
|
+
4. **Resume:** On PASS, resume the previous flow.
|
46
|
+
|
47
|
+
```
|
48
|
+
⚠️ QA OVERRIDE ACTIVATED
|
49
|
+
All other processes paused
|
50
|
+
QA validation checks now running...
|
51
|
+
Any issues found MUST be remediated before continuing with normal process flow
|
52
|
+
```
|
53
|
+
|
54
|
+
## 🔍 TECHNICAL VALIDATION OVERVIEW
|
55
|
+
|
56
|
+
Four-point validation process:
|
57
|
+
|
58
|
+
```mermaid
|
59
|
+
graph TD
|
60
|
+
VANQA["VAN QA MODE"] --> FourChecks["FOUR-POINT VALIDATION"]
|
61
|
+
|
62
|
+
FourChecks --> DepCheck["1️⃣ DEPENDENCY VERIFICATION"]
|
63
|
+
DepCheck --> ConfigCheck["2️⃣ CONFIGURATION VALIDATION"]
|
64
|
+
ConfigCheck --> EnvCheck["3️⃣ ENVIRONMENT VALIDATION"]
|
65
|
+
EnvCheck --> MinBuildCheck["4️⃣ MINIMAL BUILD TEST"]
|
66
|
+
|
67
|
+
MinBuildCheck --> ValidationResults{"All Checks<br>Passed?"}
|
68
|
+
ValidationResults -->|"Yes"| SuccessReport["GENERATE SUCCESS REPORT"]
|
69
|
+
ValidationResults -->|"No"| FailureReport["GENERATE FAILURE REPORT"]
|
70
|
+
|
71
|
+
SuccessReport --> BUILD_Transition["Trigger BUILD Mode"]
|
72
|
+
FailureReport --> FixIssues["Fix Technical Issues"]
|
73
|
+
FixIssues --> ReValidate["Re-validate (Re-run VAN QA)"]
|
74
|
+
ReValidate --> FourChecks
|
75
|
+
|
76
|
+
style VANQA fill:#4da6ff,stroke:#0066cc,color:white
|
77
|
+
style FourChecks fill:#f6546a,stroke:#c30052,color:white
|
78
|
+
style ValidationResults fill:#f6546a,stroke:#c30052,color:white
|
79
|
+
style BUILD_Transition fill:#10b981,stroke:#059669,color:white
|
80
|
+
style FixIssues fill:#ff5555,stroke:#dd3333,color:white
|
81
|
+
```
|
82
|
+
|
83
|
+
## 🔄 INTEGRATION WITH DESIGN DECISIONS
|
84
|
+
|
85
|
+
Reads Creative Phase outputs (e.g., `memory-bank/systemPatterns.md`) to inform validation:
|
86
|
+
|
87
|
+
```mermaid
|
88
|
+
graph TD
|
89
|
+
Start["Read Design Decisions"] --> ReadCreative["Parse Creative Phase<br>Documentation"]
|
90
|
+
ReadCreative --> ExtractTech["Extract Technology<br>Choices"]
|
91
|
+
ExtractTech --> ExtractDeps["Extract Required<br>Dependencies"]
|
92
|
+
ExtractDeps --> BuildValidationPlan["Build Validation<br>Plan"]
|
93
|
+
BuildValidationPlan --> StartValidation["Start Four-Point<br>Validation Process"]
|
94
|
+
|
95
|
+
style Start fill:#4da6ff,stroke:#0066cc,color:white
|
96
|
+
style ExtractTech fill:#f6546a,stroke:#c30052,color:white
|
97
|
+
style BuildValidationPlan fill:#10b981,stroke:#059669,color:white
|
98
|
+
style StartValidation fill:#f6546a,stroke:#c30052,color:white
|
99
|
+
```
|
100
|
+
|
101
|
+
### Example Technology Extraction (PowerShell):
|
102
|
+
```powershell
|
103
|
+
# Example: Extract technology choices from creative phase documentation
|
104
|
+
function Extract-TechnologyChoices {
|
105
|
+
$techChoices = @{}
|
106
|
+
# Read from systemPatterns.md
|
107
|
+
if (Test-Path "memory-bank\systemPatterns.md") {
|
108
|
+
$content = Get-Content "memory-bank\systemPatterns.md" -Raw
|
109
|
+
if ($content -match "Framework:\s*(\w+)") { $techChoices["framework"] = $Matches[1] }
|
110
|
+
if ($content -match "UI Library:\s*(\w+)") { $techChoices["ui_library"] = $Matches[1] }
|
111
|
+
if ($content -match "State Management:\s*([^\n]+)") { $techChoices["state_management"] = $Matches[1].Trim() }
|
112
|
+
}
|
113
|
+
return $techChoices
|
114
|
+
}
|
115
|
+
```
|
116
|
+
|
117
|
+
## 🔍 DETAILED QA VALIDATION STEPS & SCRIPTS
|
118
|
+
|
119
|
+
### 1️⃣ DEPENDENCY VERIFICATION
|
120
|
+
|
121
|
+
```mermaid
|
122
|
+
# Mermaid graph for Dependency Verification (as in original file)
|
123
|
+
graph TD
|
124
|
+
Start["Dependency Verification"] --> ReadDeps["Read Required Dependencies<br>from Creative Phase"]
|
125
|
+
ReadDeps --> CheckInstalled["Check if Dependencies<br>are Installed"]
|
126
|
+
CheckInstalled --> DepStatus{"All Dependencies<br>Installed?"}
|
127
|
+
DepStatus -->|"Yes"| VerifyVersions["Verify Versions<br>and Compatibility"]
|
128
|
+
DepStatus -->|"No"| InstallMissing["Install Missing<br>Dependencies"]
|
129
|
+
InstallMissing --> VerifyVersions
|
130
|
+
VerifyVersions --> VersionStatus{"Versions<br>Compatible?"}
|
131
|
+
VersionStatus -->|"Yes"| DepSuccess["Dependencies Verified<br>✅ PASS"]
|
132
|
+
VersionStatus -->|"No"| UpgradeVersions["Upgrade/Downgrade<br>as Needed"]
|
133
|
+
UpgradeVersions --> RetryVerify["Retry Verification"]
|
134
|
+
RetryVerify --> VersionStatus
|
135
|
+
style Start fill:#4da6ff; style DepSuccess fill:#10b981; style DepStatus fill:#f6546a; style VersionStatus fill:#f6546a;
|
136
|
+
```
|
137
|
+
|
138
|
+
#### Example Implementation (PowerShell):
|
139
|
+
```powershell
|
140
|
+
# Verify-Dependencies function (as in original file)
|
141
|
+
function Verify-Dependencies {
|
142
|
+
$requiredDeps = @{ "node" = ">=14.0.0"; "npm" = ">=6.0.0" }
|
143
|
+
$missingDeps = @(); $incompatibleDeps = @()
|
144
|
+
try { $nodeVersion = node -v; if ($nodeVersion -match "v(\d+).*") { if ([int]$Matches[1] -lt 14) { $incompatibleDeps += "node" } } } catch { $missingDeps += "node" }
|
145
|
+
try { $npmVersion = npm -v; if ($npmVersion -match "(\d+).*") { if ([int]$Matches[1] -lt 6) { $incompatibleDeps += "npm" } } } catch { $missingDeps += "npm" }
|
146
|
+
if ($missingDeps.Count -eq 0 -and $incompatibleDeps.Count -eq 0) { Write-Output "✅ Deps OK"; return $true } else { Write-Output "❌ Deps FAIL"; return $false }
|
147
|
+
}
|
148
|
+
```
|
149
|
+
|
150
|
+
#### Example Implementation (Bash):
|
151
|
+
```bash
|
152
|
+
# verify_dependencies function (as in original file)
|
153
|
+
verify_dependencies() {
|
154
|
+
local missing_deps=(); local incompatible_deps=()
|
155
|
+
if command -v node &> /dev/null; then node_version=$(node -v); if [[ $node_version =~ v([0-9]+) ]]; then if (( ${BASH_REMATCH[1]} < 14 )); then incompatible_deps+=("node"); fi; fi; else missing_deps+=("node"); fi
|
156
|
+
if command -v npm &> /dev/null; then npm_version=$(npm -v); if [[ $npm_version =~ ([0-9]+) ]]; then if (( ${BASH_REMATCH[1]} < 6 )); then incompatible_deps+=("npm"); fi; fi; else missing_deps+=("npm"); fi
|
157
|
+
if [ ${#missing_deps[@]} -eq 0 ] && [ ${#incompatible_deps[@]} -eq 0 ]; then echo "✅ Deps OK"; return 0; else echo "❌ Deps FAIL"; return 1; fi
|
158
|
+
}
|
159
|
+
```
|
160
|
+
|
161
|
+
### 2️⃣ CONFIGURATION VALIDATION
|
162
|
+
|
163
|
+
```mermaid
|
164
|
+
# Mermaid graph for Configuration Validation (as in original file)
|
165
|
+
graph TD
|
166
|
+
Start["Configuration Validation"] --> IdentifyConfigs["Identify Files"]
|
167
|
+
IdentifyConfigs --> ReadConfigs["Read Files"]
|
168
|
+
ReadConfigs --> ValidateSyntax["Validate Syntax"]
|
169
|
+
ValidateSyntax --> SyntaxStatus{"Valid?"}
|
170
|
+
SyntaxStatus -->|"Yes"| CheckCompatibility["Check Compatibility"]
|
171
|
+
SyntaxStatus -->|"No"| FixSyntax["Fix Syntax"]
|
172
|
+
FixSyntax --> RetryValidate["Retry"]
|
173
|
+
RetryValidate --> SyntaxStatus
|
174
|
+
CheckCompatibility --> CompatStatus{"Compatible?"}
|
175
|
+
CompatStatus -->|"Yes"| ConfigSuccess["Configs Validated ✅ PASS"]
|
176
|
+
CompatStatus -->|"No"| AdaptConfigs["Adapt Configs"]
|
177
|
+
AdaptConfigs --> RetryCompat["Retry Check"]
|
178
|
+
RetryCompat --> CompatStatus
|
179
|
+
style Start fill:#4da6ff; style ConfigSuccess fill:#10b981; style SyntaxStatus fill:#f6546a; style CompatStatus fill:#f6546a;
|
180
|
+
```
|
181
|
+
|
182
|
+
#### Example Implementation (PowerShell):
|
183
|
+
```powershell
|
184
|
+
# Validate-Configurations function (as in original file)
|
185
|
+
function Validate-Configurations {
|
186
|
+
$configFiles = @("package.json", "tsconfig.json", "vite.config.js")
|
187
|
+
$invalidConfigs = @(); $incompatibleConfigs = @()
|
188
|
+
foreach ($configFile in $configFiles) {
|
189
|
+
if (Test-Path $configFile) {
|
190
|
+
if ($configFile -match "\.json$") { try { Get-Content $configFile -Raw | ConvertFrom-Json | Out-Null } catch { $invalidConfigs += "$configFile (JSON)"; continue } }
|
191
|
+
if ($configFile -eq "vite.config.js") { $content = Get-Content $configFile -Raw; if ($content -notmatch "react\(\)") { $incompatibleConfigs += "$configFile (React)" } }
|
192
|
+
} else { $invalidConfigs += "$configFile (missing)" }
|
193
|
+
}
|
194
|
+
if ($invalidConfigs.Count -eq 0 -and $incompatibleConfigs.Count -eq 0) { Write-Output "✅ Configs OK"; return $true } else { Write-Output "❌ Configs FAIL"; return $false }
|
195
|
+
}
|
196
|
+
```
|
197
|
+
|
198
|
+
### 3️⃣ ENVIRONMENT VALIDATION
|
199
|
+
|
200
|
+
```mermaid
|
201
|
+
# Mermaid graph for Environment Validation (as in original file)
|
202
|
+
graph TD
|
203
|
+
Start["Environment Validation"] --> CheckEnv["Check Env"]
|
204
|
+
CheckEnv --> VerifyBuildTools["Verify Tools"]
|
205
|
+
VerifyBuildTools --> ToolsStatus{"Available?"}
|
206
|
+
ToolsStatus -->|"Yes"| CheckPerms["Check Permissions"]
|
207
|
+
ToolsStatus -->|"No"| InstallTools["Install Tools"]
|
208
|
+
InstallTools --> RetryTools["Retry"]
|
209
|
+
RetryTools --> ToolsStatus
|
210
|
+
CheckPerms --> PermsStatus{"Sufficient?"}
|
211
|
+
PermsStatus -->|"Yes"| EnvSuccess["Environment Validated ✅ PASS"]
|
212
|
+
PermsStatus -->|"No"| FixPerms["Fix Permissions"]
|
213
|
+
FixPerms --> RetryPerms["Retry Check"]
|
214
|
+
RetryPerms --> PermsStatus
|
215
|
+
style Start fill:#4da6ff; style EnvSuccess fill:#10b981; style ToolsStatus fill:#f6546a; style PermsStatus fill:#f6546a;
|
216
|
+
```
|
217
|
+
|
218
|
+
#### Example Implementation (PowerShell):
|
219
|
+
```powershell
|
220
|
+
# Validate-Environment function (as in original file)
|
221
|
+
function Validate-Environment {
|
222
|
+
$requiredTools = @(@{Name='git';Cmd='git --version'},@{Name='node';Cmd='node --version'},@{Name='npm';Cmd='npm --version'})
|
223
|
+
$missingTools = @(); $permissionIssues = @()
|
224
|
+
foreach ($tool in $requiredTools) { try { Invoke-Expression $tool.Cmd | Out-Null } catch { $missingTools += $tool.Name } }
|
225
|
+
try { $testFile = ".__perm_test"; New-Item $testFile -ItemType File -Force | Out-Null; Remove-Item $testFile -Force } catch { $permissionIssues += "CWD Write" }
|
226
|
+
try { $L = New-Object Net.Sockets.TcpListener([Net.IPAddress]::Loopback, 3000); $L.Start(); $L.Stop() } catch { $permissionIssues += "Port 3000" }
|
227
|
+
if ($missingTools.Count -eq 0 -and $permissionIssues.Count -eq 0) { Write-Output "✅ Env OK"; return $true } else { Write-Output "❌ Env FAIL"; return $false }
|
228
|
+
}
|
229
|
+
```
|
230
|
+
|
231
|
+
### 4️⃣ MINIMAL BUILD TEST
|
232
|
+
|
233
|
+
```mermaid
|
234
|
+
# Mermaid graph for Minimal Build Test (as in original file)
|
235
|
+
graph TD
|
236
|
+
Start["Minimal Build Test"] --> CreateTest["Create Test Proj"]
|
237
|
+
CreateTest --> BuildTest["Attempt Build"]
|
238
|
+
BuildTest --> BuildStatus{"Success?"}
|
239
|
+
BuildStatus -->|"Yes"| RunTest["Run Basic Test"]
|
240
|
+
BuildStatus -->|"No"| FixBuild["Fix Build Issues"]
|
241
|
+
FixBuild --> RetryBuild["Retry Build"]
|
242
|
+
RetryBuild --> BuildStatus
|
243
|
+
RunTest --> TestStatus{"Passed?"}
|
244
|
+
TestStatus -->|"Yes"| TestSuccess["Build Test ✅ PASS"]
|
245
|
+
TestStatus -->|"No"| FixTest["Fix Test Issues"]
|
246
|
+
FixTest --> RetryTest["Retry Test"]
|
247
|
+
RetryTest --> TestStatus
|
248
|
+
style Start fill:#4da6ff; style TestSuccess fill:#10b981; style BuildStatus fill:#f6546a; style TestStatus fill:#f6546a;
|
249
|
+
```
|
250
|
+
|
251
|
+
#### Example Implementation (PowerShell):
|
252
|
+
```powershell
|
253
|
+
# Perform-MinimalBuildTest function (as in original file)
|
254
|
+
function Perform-MinimalBuildTest {
|
255
|
+
$buildSuccess = $false; $testSuccess = $false; $testDir = ".__build_test"
|
256
|
+
if (Test-Path $testDir) { Remove-Item $testDir -Recurse -Force }
|
257
|
+
try {
|
258
|
+
New-Item $testDir -ItemType Directory | Out-Null; Push-Location $testDir
|
259
|
+
'{"name": "build-test","scripts": {"build": "echo Build test successful"}}' | Set-Content package.json
|
260
|
+
npm run build | Out-Null; $buildSuccess = $true
|
261
|
+
'console.log("Test successful");' | Set-Content index.js
|
262
|
+
node index.js | Out-Null; $testSuccess = $true
|
263
|
+
} catch { Write-Output "❌ Build test exception" } finally { Pop-Location; if (Test-Path $testDir) { Remove-Item $testDir -Recurse -Force } }
|
264
|
+
if ($buildSuccess -and $testSuccess) { Write-Output "✅ Build Test OK"; return $true } else { Write-Output "❌ Build Test FAIL"; return $false }
|
265
|
+
}
|
266
|
+
```
|
267
|
+
|
268
|
+
## 📝 VALIDATION REPORT FORMATS
|
269
|
+
|
270
|
+
### Comprehensive Success Report:
|
271
|
+
```
|
272
|
+
╔═════════════════════ 🔍 QA VALIDATION REPORT ══════════════════════╗
|
273
|
+
│ PROJECT: [Project Name] | TIMESTAMP: [Current Date/Time] │
|
274
|
+
├─────────────────────────────────────────────────────────────────────┤
|
275
|
+
│ 1️⃣ DEPENDENCIES: ✓ Compatible │
|
276
|
+
│ 2️⃣ CONFIGURATION: ✓ Valid & Compatible │
|
277
|
+
│ 3️⃣ ENVIRONMENT: ✓ Ready │
|
278
|
+
│ 4️⃣ MINIMAL BUILD: ✓ Successful & Passed │
|
279
|
+
├─────────────────────────────────────────────────────────────────────┤
|
280
|
+
│ 🚨 FINAL VERDICT: PASS │
|
281
|
+
│ ➡️ Clear to proceed to BUILD mode │
|
282
|
+
╚═════════════════════════════════════════════════════════════════════╝
|
283
|
+
```
|
284
|
+
|
285
|
+
### Detailed Failure Report:
|
286
|
+
```
|
287
|
+
⚠️⚠️⚠️ QA VALIDATION FAILED ⚠️⚠️⚠️
|
288
|
+
Issues must be resolved before BUILD mode:
|
289
|
+
|
290
|
+
1️⃣ DEPENDENCY ISSUES: [Details/Fix]
|
291
|
+
2️⃣ CONFIGURATION ISSUES: [Details/Fix]
|
292
|
+
3️⃣ ENVIRONMENT ISSUES: [Details/Fix]
|
293
|
+
4️⃣ BUILD TEST ISSUES: [Details/Fix]
|
294
|
+
|
295
|
+
⚠️ BUILD MODE BLOCKED. Type 'VAN QA' after fixing to re-validate.
|
296
|
+
```
|
297
|
+
|
298
|
+
## 🧪 COMMON QA VALIDATION FIXES
|
299
|
+
|
300
|
+
- **Dependencies:** Install Node/npm, run `npm install`, check versions.
|
301
|
+
- **Configuration:** Validate JSON, check required plugins (e.g., React for Vite), ensure TSConfig compatibility.
|
302
|
+
- **Environment:** Check permissions (Admin/sudo), ensure ports are free, install missing CLI tools (git, etc.).
|
303
|
+
- **Build Test:** Check logs for errors, verify minimal config, check path separators.
|
304
|
+
|
305
|
+
## 🔒 BUILD MODE PREVENTION MECHANISM
|
306
|
+
|
307
|
+
Logic to check QA status before allowing BUILD mode transition.
|
308
|
+
|
309
|
+
```mermaid
|
310
|
+
graph TD
|
311
|
+
Start["User Types: BUILD"] --> CheckQA{"QA Validation<br>Passed?"}
|
312
|
+
CheckQA -->|"Yes"| AllowBuild["Allow BUILD Mode"]
|
313
|
+
CheckQA -->|"No"| BlockBuild["BLOCK BUILD MODE"]
|
314
|
+
BlockBuild --> Message["Display:<br>⚠️ QA VALIDATION REQUIRED"]
|
315
|
+
Message --> ReturnToVANQA["Prompt: Type VAN QA"]
|
316
|
+
|
317
|
+
style CheckQA fill:#f6546a; style BlockBuild fill:#ff0000,stroke:#990000; style Message fill:#ff5555; style ReturnToVANQA fill:#4da6ff;
|
318
|
+
```
|
319
|
+
|
320
|
+
### Example Implementation (PowerShell):
|
321
|
+
```powershell
|
322
|
+
# Example: Check QA status before allowing BUILD
|
323
|
+
function Check-QAValidationStatus {
|
324
|
+
$qaStatusFile = "memory-bank\.qa_validation_status" # Assumes status is written here
|
325
|
+
if (Test-Path $qaStatusFile) {
|
326
|
+
if ((Get-Content $qaStatusFile -Raw) -match "PASS") { return $true }
|
327
|
+
}
|
328
|
+
Write-Output "🚫 BUILD MODE BLOCKED: QA VALIDATION REQUIRED. Type 'VAN QA'. 🚫"
|
329
|
+
return $false
|
330
|
+
}
|
331
|
+
```
|
332
|
+
|
333
|
+
## 🚨 MODE TRANSITION TRIGGERS (Relevant to QA)
|
334
|
+
|
335
|
+
### CREATIVE to VAN QA Transition:
|
336
|
+
```
|
337
|
+
⏭️ NEXT MODE: VAN QA
|
338
|
+
To validate technical requirements before implementation, please type 'VAN QA'
|
339
|
+
```
|
340
|
+
|
341
|
+
### VAN QA to BUILD Transition (On Success):
|
342
|
+
```
|
343
|
+
✅ TECHNICAL VALIDATION COMPLETE
|
344
|
+
All prerequisites verified successfully
|
345
|
+
You may now proceed to BUILD mode
|
346
|
+
Type 'BUILD' to begin implementation
|
347
|
+
```
|
348
|
+
|
349
|
+
## 📋 FINAL QA VALIDATION CHECKPOINT
|
350
|
+
|
351
|
+
```
|
352
|
+
✓ SECTION CHECKPOINT: QA VALIDATION
|
353
|
+
- Dependency Verification Passed? [YES/NO]
|
354
|
+
- Configuration Validation Passed? [YES/NO]
|
355
|
+
- Environment Validation Passed? [YES/NO]
|
356
|
+
- Minimal Build Test Passed? [YES/NO]
|
357
|
+
|
358
|
+
→ If all YES: Ready for BUILD mode transition.
|
359
|
+
→ If any NO: Fix identified issues and re-run VAN QA.
|
360
|
+
```
|
361
|
+
|
362
|
+
**Next Step (on PASS):** Trigger BUILD mode.
|
363
|
+
**Next Step (on FAIL):** Address issues and re-run `VAN QA`.
|
data/.env.example
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Active Context
|
2
|
+
|
3
|
+
## Current Focus Areas
|
4
|
+
|
5
|
+
### Core Functionality
|
6
|
+
|
7
|
+
- Text generation with Gemini models
|
8
|
+
- Chat conversation support
|
9
|
+
- Multimodal content handling (text + images)
|
10
|
+
- Embeddings generation
|
11
|
+
- Streaming responses
|
12
|
+
|
13
|
+
### Key Implementation Details
|
14
|
+
|
15
|
+
#### Text Generation
|
16
|
+
|
17
|
+
- Support for all Gemini models
|
18
|
+
- System instructions for guiding model behavior
|
19
|
+
- Generation parameters (temperature, top_k, top_p)
|
20
|
+
- Support for stop sequences
|
21
|
+
|
22
|
+
#### Multimodal Support
|
23
|
+
|
24
|
+
- Image handling from multiple sources (files, URLs, bytes)
|
25
|
+
- MIME type detection and validation
|
26
|
+
- Size limits enforcement
|
27
|
+
- Support for JPEG, PNG, GIF, WEBP formats
|
28
|
+
|
29
|
+
#### Chat & Conversations
|
30
|
+
|
31
|
+
- Conversation state management
|
32
|
+
- Message history tracking
|
33
|
+
- Context preservation
|
34
|
+
- System instructions for chat
|
35
|
+
|
36
|
+
#### Embeddings
|
37
|
+
|
38
|
+
- Vector generation for semantic text analysis
|
39
|
+
- Vector similarity operations
|
40
|
+
- Task type optimization
|
41
|
+
- Normalization utilities
|
42
|
+
|
43
|
+
#### Streaming
|
44
|
+
|
45
|
+
- Multiple streaming modes (raw, incremental, delta)
|
46
|
+
- Cancellation support
|
47
|
+
- Efficient buffer management
|
48
|
+
- Error handling for interrupted streams
|
49
|
+
|
50
|
+
### API and HTTP Communication
|
51
|
+
|
52
|
+
- Robust HTTP client implementation
|
53
|
+
- Retry mechanisms for transient errors
|
54
|
+
- Timeout handling
|
55
|
+
- Response parsing and validation
|
56
|
+
|
57
|
+
### Error Handling Strategy
|
58
|
+
|
59
|
+
- Comprehensive error class hierarchy
|
60
|
+
- Detailed error messages
|
61
|
+
- API error translation
|
62
|
+
- Validation prior to API calls
|
63
|
+
|
64
|
+
## Active Development Areas
|
65
|
+
|
66
|
+
### Current Improvements
|
67
|
+
|
68
|
+
- Enhanced multimodal support
|
69
|
+
- Streaming response optimizations
|
70
|
+
- Comprehensive documentation
|
71
|
+
- Error handling refinements
|
72
|
+
|
73
|
+
### Upcoming Features
|
74
|
+
|
75
|
+
- Support for newer Gemini models
|
76
|
+
- Advanced parameter tuning
|
77
|
+
- Additional vector operations
|
78
|
+
- Improved conversation persistence
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# Progress
|
2
|
+
|
3
|
+
## Current Status
|
4
|
+
|
5
|
+
Geminize is a functional Ruby gem providing a complete interface to the Google Gemini API. The current implementation includes all core features with a focus on stability, documentation, and ease of use.
|
6
|
+
|
7
|
+
## Development Progress
|
8
|
+
|
9
|
+
### Core Functionality
|
10
|
+
|
11
|
+
- **Text Generation**: ✅ Complete
|
12
|
+
- **Chat Conversations**: ✅ Complete
|
13
|
+
- **Embeddings**: ✅ Complete
|
14
|
+
- **Multimodal Support**: ✅ Complete
|
15
|
+
- **Streaming Responses**: ✅ Complete
|
16
|
+
- **Error Handling**: ✅ Complete
|
17
|
+
- **Configuration System**: ✅ Complete
|
18
|
+
|
19
|
+
### Documentation
|
20
|
+
|
21
|
+
- **README**: ✅ Complete
|
22
|
+
- **YARD Documentation**: 🟡 Partially Complete (80%)
|
23
|
+
- **Examples**: ✅ Complete
|
24
|
+
- **Diagrams**: ❌ Not Started
|
25
|
+
|
26
|
+
### Testing
|
27
|
+
|
28
|
+
- **Unit Tests**: ✅ Complete
|
29
|
+
- **Integration Tests**: 🟡 Partially Complete (70%)
|
30
|
+
- **Performance Tests**: ❌ Not Started
|
31
|
+
|
32
|
+
### Deployment
|
33
|
+
|
34
|
+
- **RubyGems Publishing**: ✅ Complete
|
35
|
+
- **CI/CD Pipeline**: 🟡 Partially Complete (50%)
|
36
|
+
- **Version Management**: ✅ Complete
|
37
|
+
|
38
|
+
## Version History
|
39
|
+
|
40
|
+
### v0.1.0 (2025-04-21)
|
41
|
+
|
42
|
+
- Initial release
|
43
|
+
- Core functionality implemented
|
44
|
+
- Basic documentation
|
45
|
+
|
46
|
+
### v0.1.1 (2025-05-01)
|
47
|
+
|
48
|
+
- Added Rails integration
|
49
|
+
- Enhanced multimodal support
|
50
|
+
- Additional embedding task types
|
51
|
+
- Improved documentation
|
52
|
+
|
53
|
+
### v1.0.0 (Planned for 2025-05-02)
|
54
|
+
|
55
|
+
- Removed Rails-specific integration
|
56
|
+
- Simplified usage
|
57
|
+
- API stabilization
|
58
|
+
|
59
|
+
## Upcoming Milestones
|
60
|
+
|
61
|
+
### v1.1.0 (Planned)
|
62
|
+
|
63
|
+
- Support for latest Gemini models
|
64
|
+
- Advanced vector operations
|
65
|
+
- Improved streaming performance
|
66
|
+
- Enhanced documentation
|
67
|
+
|
68
|
+
### v1.2.0 (Planned)
|
69
|
+
|
70
|
+
- Batch processing capabilities
|
71
|
+
- Improved conversation persistence
|
72
|
+
- Additional configuration options
|
73
|
+
- Memory optimizations
|
74
|
+
|
75
|
+
### v2.0.0 (Planned)
|
76
|
+
|
77
|
+
- Major API refinements
|
78
|
+
- Advanced function calling support
|
79
|
+
- Performance improvements
|
80
|
+
- Additional middleware options
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Geminize Project Brief
|
2
|
+
|
3
|
+
## Project Overview
|
4
|
+
|
5
|
+
Geminize is a Ruby gem providing a convenient and robust interface to Google's Gemini AI API. It enables Ruby developers to easily integrate Google's powerful generative AI models into their applications with a clean, idiomatic API.
|
6
|
+
|
7
|
+
## Core Features
|
8
|
+
|
9
|
+
- **Text Generation**: Generate text using various Gemini models
|
10
|
+
- **Multimodal Support**: Send mixed content including text and images
|
11
|
+
- **Conversation Management**: Maintain conversation context for chat applications
|
12
|
+
- **Embeddings Generation**: Generate and manipulate vector representations for text
|
13
|
+
- **Streaming Responses**: Support for efficient streaming output
|
14
|
+
- **Error Handling**: Comprehensive error handling and validation
|
15
|
+
|
16
|
+
## Technical Foundation
|
17
|
+
|
18
|
+
- Pure Ruby implementation with minimal dependencies
|
19
|
+
- Faraday for HTTP client functionality
|
20
|
+
- Support for environment-based or programmatic configuration
|
21
|
+
- Comprehensive API for both simple and advanced use cases
|
22
|
+
|
23
|
+
## Project Goals
|
24
|
+
|
25
|
+
- Provide a complete Ruby interface to all Gemini API capabilities
|
26
|
+
- Ensure robust error handling and validation
|
27
|
+
- Maintain clean, well-documented, and idiomatic Ruby code
|
28
|
+
- Support both simple use cases and advanced configurations
|
29
|
+
- Enable seamless integration with various Ruby applications
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# System Patterns
|
2
|
+
|
3
|
+
## Design Patterns
|
4
|
+
|
5
|
+
### Singleton Pattern
|
6
|
+
|
7
|
+
- Used for the `Configuration` class to ensure a single global configuration instance.
|
8
|
+
- Implemented using Ruby's `Singleton` module.
|
9
|
+
|
10
|
+
### Builder Pattern
|
11
|
+
|
12
|
+
- Employed in `RequestBuilder` to construct API requests.
|
13
|
+
- Separates request construction from execution.
|
14
|
+
|
15
|
+
### Factory Methods
|
16
|
+
|
17
|
+
- Used throughout the codebase to instantiate model objects from API responses.
|
18
|
+
- Example: `Models::ContentResponse.from_hash(response_data)`
|
19
|
+
|
20
|
+
### Repository Pattern
|
21
|
+
|
22
|
+
- Implemented in `ConversationRepository` for conversation persistence.
|
23
|
+
- Abstracts storage details from the conversation service.
|
24
|
+
|
25
|
+
### Adapter Pattern
|
26
|
+
|
27
|
+
- Used to adapt various image sources (files, URLs, raw bytes) to a common format.
|
28
|
+
|
29
|
+
### Strategy Pattern
|
30
|
+
|
31
|
+
- Applied in streaming responses with different processing modes (raw, incremental, delta).
|
32
|
+
- Allows clients to choose how streaming data is processed.
|
33
|
+
|
34
|
+
## Core Architectural Principles
|
35
|
+
|
36
|
+
### Separation of Concerns
|
37
|
+
|
38
|
+
- Each class has a single, well-defined responsibility.
|
39
|
+
- Examples: `Client` handles HTTP, `TextGeneration` handles generation logic.
|
40
|
+
|
41
|
+
### Immutable Objects
|
42
|
+
|
43
|
+
- Response objects are designed to be immutable.
|
44
|
+
- Request objects are built incrementally but not modified after submission.
|
45
|
+
|
46
|
+
### Comprehensive Validation
|
47
|
+
|
48
|
+
- Input validation happens before API calls.
|
49
|
+
- Extensive parameter checking and error handling.
|
50
|
+
|
51
|
+
### Error Handling
|
52
|
+
|
53
|
+
- Structured hierarchy of error classes.
|
54
|
+
- Detailed error messages with relevant context.
|
55
|
+
- Translation of API errors to gem-specific errors.
|
56
|
+
|
57
|
+
### Configuration Flexibility
|
58
|
+
|
59
|
+
- Multiple configuration approaches (env vars, block config).
|
60
|
+
- Sensible defaults with override capabilities.
|
61
|
+
|
62
|
+
### Developer Experience
|
63
|
+
|
64
|
+
- Method signatures follow Ruby idioms.
|
65
|
+
- Clear documentation with usage examples.
|
66
|
+
- Consistent return values and error handling.
|
67
|
+
|
68
|
+
## Code Organization
|
69
|
+
|
70
|
+
### Module Structure
|
71
|
+
|
72
|
+
- Everything contained within the `Geminize` namespace.
|
73
|
+
- Logical grouping of related functionality.
|
74
|
+
|
75
|
+
### Dependency Management
|
76
|
+
|
77
|
+
- Minimal external dependencies.
|
78
|
+
- Clear version requirements.
|
79
|
+
|
80
|
+
### Testing Approach
|
81
|
+
|
82
|
+
- RSpec for unit and integration tests.
|
83
|
+
- VCR for recording and replaying HTTP interactions.
|
84
|
+
- Comprehensive test coverage.
|
85
|
+
|
86
|
+
### Documentation
|
87
|
+
|
88
|
+
- YARD documentation for all public methods.
|
89
|
+
- Usage examples throughout codebase.
|
90
|
+
- Clear README with quickstart and detailed examples.
|