Skip to content

Commit 898d5b3

Browse files
authored
Increment arthur-engine version to 2.1.456 (#1440)
Increment arthur-engine version to 2.1.456 (#1440)
2 parents 5d31d10 + 91b6850 commit 898d5b3

File tree

339 files changed

+20318
-12378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+20318
-12378
lines changed

.claude/settings.local.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Bash(GENAI_ENGINE_SECRET_STORE_KEY=\"test_key\" PYTHONPATH=src poetry run python:*)",
1111
"Bash(yarn type-check:*)",
1212
"Bash(yarn install:*)",
13-
"Bash(yarn generate-api:clean)",
13+
"Bash(yarn generate-api:*)",
1414
"Bash(PYTHONPATH=\"src:$PYTHONPATH\" GENAI_ENGINE_SECRET_STORE_KEY=\"test_key\" python:*)",
1515
"Bash(yarn lint:*)",
1616
"Bash(PYTHONPATH=\"src:$PYTHONPATH\" GENAI_ENGINE_SECRET_STORE_KEY=\"test_key\" poetry run pytest:*)",
@@ -38,7 +38,15 @@
3838
"Bash(poetry update:*)",
3939
"Bash(PYTHONPATH=src GENAI_ENGINE_SECRET_STORE_KEY=changeme_secret_store_key poetry run generate_changelog:*)",
4040
"Bash(PYTHONPATH=src poetry run mypy:*)",
41-
"Bash(git checkout:*)"
41+
"Bash(git checkout:*)",
42+
"Bash(sleep:*)",
43+
"Bash(python3:*)",
44+
"Bash(docker ps:*)",
45+
"Bash(poetry run serve:*)",
46+
"Bash(yarn dev:*)",
47+
"Bash(source:*)",
48+
"Bash(poetry --version:*)",
49+
"Bash(set -a:*)"
4250
]
4351
}
4452
}
Lines changed: 36 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,62 @@
11
---
22
name: setup-genai-dev
33
description: Set up the GenAI Engine development environment. Use when starting work on the project for the first time, or when environment needs to be reset. Handles Poetry, PostgreSQL, migrations, and environment variables.
4-
allowed-tools: Bash, Read, Write
4+
allowed-tools: Bash, Read, Task
55
---
66

77
# Setup GenAI Engine Development Environment
88

9-
## Prerequisites Check
9+
## Step 1 — GPT Key Gate
1010

11-
Before setup, verify these are installed:
12-
1. Python 3.12 (`python3 --version`)
13-
2. Docker is running (`docker ps`)
14-
3. Poetry (`poetry --version`)
11+
Use the Read tool to read `./genai-engine/.env`.
1512

16-
If any are missing, inform the user and stop.
13+
Check that `GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS` is present and has a non-empty value (not just `GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS=` with nothing after the `=`).
1714

18-
## Setup Steps
15+
If the value is missing or empty:
16+
- **STOP immediately. Do not proceed to Step 2.**
17+
- Tell the user: "Setup cannot continue. Please open `genai-engine/.env` and set `GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS` using the format: `MODEL_NAME::ENDPOINT_URL::API_KEY` (e.g. `gpt-4o::https://api.openai.com/::sk-...`). Run the skill again once the key is set."
1918

20-
Execute these steps in order:
19+
## Step 2 — Delegate Setup to Bash Sub-Agent
2120

22-
### 1. Navigate to Project Directory
23-
```bash
24-
cd ./genai-engine
25-
```
26-
27-
### 2. Configure Poetry Environment
28-
```bash
29-
poetry env use 3.12
30-
poetry install --with dev,linters
31-
```
32-
33-
### 3. Start PostgreSQL Database
34-
```bash
35-
docker compose up -d db
36-
```
37-
38-
Wait for healthy status:
39-
```bash
40-
sleep 5
41-
docker compose ps
42-
```
21+
Only proceed here if Step 1 passed. Spawn a Task sub-agent with subagent_type="Bash" and the following self-contained prompt:
4322

44-
### 4. Set Environment Variables
45-
46-
Export ALL of these environment variables:
47-
```bash
48-
export POSTGRES_USER=postgres
49-
export POSTGRES_PASSWORD=changeme_pg_password
50-
export POSTGRES_URL=localhost
51-
export POSTGRES_PORT=5432
52-
export POSTGRES_DB=arthur_genai_engine
53-
export POSTGRES_USE_SSL=false
54-
export PYTHONPATH="src:$PYTHONPATH"
55-
export GENAI_ENGINE_SECRET_STORE_KEY="some_test_key"
56-
export GENAI_ENGINE_ENVIRONMENT=local
57-
export GENAI_ENGINE_ADMIN_KEY=changeme123
58-
export GENAI_ENGINE_INGRESS_URI=http://localhost:3030
59-
export GENAI_ENGINE_ENABLE_PERSISTENCE=enabled
60-
export ALLOW_ADMIN_KEY_GENERAL_ACCESS=enabled
61-
```
23+
---
24+
Run the following setup steps for the GenAI Engine development environment. Report success or failure for each step and stop immediately if any step fails.
6225

63-
### 5. Run Database Migrations
26+
**Step 1 — Prerequisites check:**
6427
```bash
65-
cd ./genai-engine
66-
poetry run alembic upgrade head
28+
python3 --version && docker ps && poetry --version
6729
```
30+
If any fail, report which tool is missing and stop.
6831

69-
### 6. Verify Setup
70-
Check database is running:
32+
**Step 2 — Configure Poetry and install dependencies:**
7133
```bash
72-
docker compose ps
34+
cd genai-engine && poetry env use 3.12 && poetry install --with dev,linters
7335
```
7436

75-
Check migrations applied:
37+
**Step 3 — Start PostgreSQL:**
7638
```bash
77-
poetry run alembic current
39+
cd genai-engine && docker compose up -d db && sleep 5 && docker compose ps
7840
```
7941

80-
## Output
81-
82-
Report success/failure for each step.
83-
84-
### LLM Configuration
85-
86-
Check for `OPENAI_API_KEY` in the `.env` file in the `./genai-engine` directory. If present, load it:
42+
**Step 4 — Run database migrations with all required env vars:**
8743
```bash
88-
source ./genai-engine/.env
89-
export OPENAI_API_KEY
44+
cd genai-engine && \
45+
set -a && source .env && set +a && \
46+
export POSTGRES_USER=postgres \
47+
POSTGRES_PASSWORD=changeme_pg_password \
48+
POSTGRES_URL=localhost \
49+
POSTGRES_PORT=5432 \
50+
POSTGRES_DB=arthur_genai_engine \
51+
POSTGRES_USE_SSL=false \
52+
PYTHONPATH="src:$PYTHONPATH" \
53+
GENAI_ENGINE_SECRET_STORE_KEY="some_test_key" \
54+
GENAI_ENGINE_ENVIRONMENT=local \
55+
GENAI_ENGINE_ADMIN_KEY=changeme123 \
56+
GENAI_ENGINE_ENABLE_PERSISTENCE=enabled \
57+
ALLOW_ADMIN_KEY_GENERAL_ACCESS=enabled && \
58+
poetry run alembic upgrade head && poetry run alembic current
9059
```
9160

92-
If not present, inform the user they need to add their OpenAI API key to the `.env` file for LLM features to work.
93-
94-
## Troubleshooting
95-
96-
- If Docker fails: ensure Docker Desktop is running
97-
- If Poetry fails: try `poetry env remove 3.12` then retry
98-
- If migrations fail: check PostgreSQL is healthy with `docker compose logs db`
61+
Report the final migration revision that is current after running these steps.
62+
---
Lines changed: 43 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,69 @@
11
---
22
name: start-genai-backend
3-
description: Start the GenAI Engine backend server and frontend UI. Use when you need to launch the API server at localhost:3030 and the frontend at localhost:3000.
4-
allowed-tools: Bash, Read
3+
description: Start the GenAI Engine backend server and frontend UI. Use when you need to launch the API server and the frontend locally.
4+
allowed-tools: Bash, Read, Task
55
---
66

77
# Start GenAI Engine Backend Server
88

9-
## Pre-flight Checks
9+
## Step 1 — GPT Key Gate
1010

11-
### 1. Verify PostgreSQL is running
12-
```bash
13-
cd ./genai-engine
14-
docker compose ps db
15-
```
11+
Use the Read tool to read `./genai-engine/.env`.
1612

17-
If not running or unhealthy, start it:
18-
```bash
19-
docker compose up -d db
20-
sleep 3
21-
docker compose ps db
22-
```
13+
Check that `GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS` is present and has a non-empty value (not just `GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS=` with nothing after the `=`).
2314

24-
## Environment Variables
15+
If the value is missing or empty:
16+
- **STOP immediately. Do not proceed to Step 2.**
17+
- Tell the user: "Setup cannot continue. Please open `genai-engine/.env` and set `GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS` using the format: `MODEL_NAME::ENDPOINT_URL::API_KEY` (e.g. `gpt-4o::https://api.openai.com/::sk-...`). Run the skill again once the key is set."
2518

26-
Set ALL of these environment variables before starting:
19+
## Step 2 — Delegate Startup to Bash Sub-Agent
2720

28-
```bash
29-
# Database
30-
export POSTGRES_USER=postgres
31-
export POSTGRES_PASSWORD=changeme_pg_password
32-
export POSTGRES_URL=localhost
33-
export POSTGRES_PORT=5432
34-
export POSTGRES_DB=arthur_genai_engine
35-
export POSTGRES_USE_SSL=false
21+
Only proceed here if Step 1 passed. Spawn a Task sub-agent with subagent_type="Bash" and the following self-contained prompt:
3622

37-
# Application
38-
export PYTHONPATH="src:$PYTHONPATH"
39-
export GENAI_ENGINE_SECRET_STORE_KEY="some_test_key"
40-
export GENAI_ENGINE_ENVIRONMENT=local
41-
export GENAI_ENGINE_ADMIN_KEY=changeme123
42-
export GENAI_ENGINE_INGRESS_URI=http://localhost:3030
43-
export GENAI_ENGINE_ENABLE_PERSISTENCE=enabled
44-
export ALLOW_ADMIN_KEY_GENERAL_ACCESS=enabled
45-
```
46-
47-
## LLM Provider Configuration
23+
---
24+
Start the GenAI Engine backend and frontend. Report success or failure for each step.
4825

49-
Load LLM configuration from the `.env` file:
26+
**Step 1 — Verify PostgreSQL is running:**
5027
```bash
51-
source ./genai-engine/.env
52-
export OPENAI_API_KEY
53-
export GENAI_ENGINE_OPENAI_PROVIDER
54-
export GENAI_ENGINE_OPENAI_GPT_NAMES_ENDPOINTS_KEYS
28+
cd genai-engine && docker compose ps db
5529
```
56-
57-
If `OPENAI_API_KEY` is not set in `.env`, inform the user they need to add it for LLM features to work.
58-
59-
## Start Backend Server
60-
61-
Run the server in the background so it doesn't block:
30+
If not running or unhealthy, start it:
6231
```bash
63-
cd ./genai-engine
64-
poetry run serve
32+
cd genai-engine && docker compose up -d db && sleep 3
6533
```
6634

67-
Server will be available at:
68-
- **API**: `http://localhost:3030`
69-
- **Swagger Docs**: `http://localhost:3030/docs`
70-
- **Health Check**: `http://localhost:3030/health`
71-
72-
## Start Frontend
35+
**Step 2 — Start the backend server in the background:**
7336
```bash
74-
cd ./genai-engine/ui
75-
yarn install
76-
yarn dev
37+
cd genai-engine && \
38+
set -a && source .env && set +a && \
39+
export POSTGRES_USER=postgres \
40+
POSTGRES_PASSWORD=changeme_pg_password \
41+
POSTGRES_URL=localhost \
42+
POSTGRES_PORT=5432 \
43+
POSTGRES_DB=arthur_genai_engine \
44+
POSTGRES_USE_SSL=false \
45+
PYTHONPATH="src:$PYTHONPATH" \
46+
GENAI_ENGINE_SECRET_STORE_KEY="some_test_key" \
47+
GENAI_ENGINE_ENVIRONMENT=local \
48+
GENAI_ENGINE_ADMIN_KEY=changeme123 \
49+
GENAI_ENGINE_ENABLE_PERSISTENCE=enabled \
50+
ALLOW_ADMIN_KEY_GENERAL_ACCESS=enabled && \
51+
poetry run serve &
7752
```
7853

79-
Frontend will be available at: `http://localhost:3000`
80-
81-
## Authentication
82-
83-
To make API requests, use the admin key as a Bearer token:
84-
```
85-
Authorization: Bearer changeme123
54+
**Step 3 — Wait for the backend to become healthy:**
55+
```bash
56+
sleep 5 && curl -s -H "Authorization: Bearer changeme123" http://localhost:3030/health
8657
```
8758

88-
## Verification
89-
90-
After starting, verify the server is running:
59+
**Step 4 — Start the frontend and capture the URL:**
9160
```bash
92-
curl -s -H "Authorization: Bearer changeme123" http://localhost:3030/health
61+
cd genai-engine/ui && yarn install && yarn dev 2>&1 | tee /tmp/vite-fe.log &
62+
sleep 3 && grep -m1 "Local:" /tmp/vite-fe.log
9363
```
9464

95-
If successful, report the server is ready. If it fails, check the server logs for errors.
96-
97-
## Troubleshooting
98-
99-
- If port 3030 is in use: `lsof -i :3030` to find the process
100-
- If database connection fails: verify PostgreSQL is running with `docker compose ps`
101-
- If import errors: ensure `PYTHONPATH` includes `src`
65+
Report the following when done:
66+
- Backend API: the health check URL with `/docs` appended
67+
- Frontend: the Local URL that Vite printed
68+
- Auth header: `Authorization: Bearer changeme123`
69+
---
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: start-genai-frontend
3+
description: Start the GenAI Engine frontend UI dev server. Use when you need to launch the React app locally.
4+
allowed-tools: Bash, Task
5+
---
6+
7+
# Start GenAI Engine Frontend
8+
9+
Spawn a Task sub-agent with subagent_type="Bash" and the following self-contained prompt:
10+
11+
---
12+
Set up and start the GenAI Engine frontend dev server. Report success or failure for each step.
13+
14+
**Step 1 — Check the backend is reachable (optional, non-blocking):**
15+
```bash
16+
curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer changeme123" http://localhost:3030/health
17+
```
18+
If the response is not 200, warn the user that the backend may not be running and suggest running `/start-genai-backend` first, but continue anyway.
19+
20+
**Step 2 — Install dependencies:**
21+
```bash
22+
cd genai-engine/ui && yarn install
23+
```
24+
25+
**Step 3 — Generate API client bindings:**
26+
```bash
27+
cd genai-engine/ui && yarn generate-api:clean
28+
```
29+
30+
**Step 4 — Start the dev server and capture the URL:**
31+
```bash
32+
cd genai-engine/ui && yarn dev 2>&1 | tee /tmp/vite-fe.log &
33+
sleep 3 && grep -m1 "Local:" /tmp/vite-fe.log
34+
```
35+
36+
Report the Local URL that Vite printed (e.g. `http://localhost:3000`). If the default port was taken, Vite will have chosen a different one.
37+
---

.github/workflows/arthur-engine-workflow.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ jobs:
197197
github.ref != 'refs/heads/dev' &&
198198
needs.check-genai-engine-changes.outputs.ui == 'true'
199199
runs-on: ubuntu-latest
200+
env:
201+
GITLAB_UNIFY_FRONTEND_TOKEN: ${{ secrets.GITLAB_UNIFY_FRONTEND_TOKEN }}
200202
defaults:
201203
run:
202204
working-directory: genai-engine/ui
@@ -391,6 +393,7 @@ jobs:
391393
ENABLE_TELEMETRY=${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}
392394
METICULOUS_RECORDING_TOKEN=${{ secrets.METICULOUS_RECORDING_TOKEN }}
393395
METICULOUS_API_TOKEN=${{ secrets.METICULOUS_API_TOKEN }}
396+
GITLAB_UNIFY_FRONTEND_TOKEN=${{ secrets.GITLAB_UNIFY_FRONTEND_TOKEN }}
394397
tags: |
395398
arthurplatform/genai-engine-${{ matrix.torch_device }}:${{ env.VERSION }}
396399
${{ github.ref == 'refs/heads/main' && format('arthurplatform/genai-engine-{0}:latest', matrix.torch_device) || '' }}

0 commit comments

Comments
 (0)