semcodes 0.1.12__tar.gz
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.
- semcodes-0.1.12/PKG-INFO +17 -0
- semcodes-0.1.12/README.md +506 -0
- semcodes-0.1.12/backend/routers/audit.py +333 -0
- semcodes-0.1.12/backend/routers/auth.py +268 -0
- semcodes-0.1.12/backend/routers/autopr.py +394 -0
- semcodes-0.1.12/backend/routers/badge.py +168 -0
- semcodes-0.1.12/backend/routers/benchmark.py +215 -0
- semcodes-0.1.12/backend/routers/billing.py +317 -0
- semcodes-0.1.12/backend/routers/ecosystem.py +102 -0
- semcodes-0.1.12/backend/routers/marketplace/__init__.py +40 -0
- semcodes-0.1.12/backend/routers/marketplace/billing.py +91 -0
- semcodes-0.1.12/backend/routers/marketplace/browse.py +123 -0
- semcodes-0.1.12/backend/routers/marketplace/connect.py +81 -0
- semcodes-0.1.12/backend/routers/marketplace/deploy.py +140 -0
- semcodes-0.1.12/backend/routers/marketplace/models.py +57 -0
- semcodes-0.1.12/backend/routers/marketplace/publish.py +238 -0
- semcodes-0.1.12/backend/routers/marketplace/quality.py +73 -0
- semcodes-0.1.12/backend/routers/mcp/__init__.py +35 -0
- semcodes-0.1.12/backend/routers/mcp/models.py +33 -0
- semcodes-0.1.12/backend/routers/mcp/resources.py +157 -0
- semcodes-0.1.12/backend/routers/mcp/tools.py +207 -0
- semcodes-0.1.12/backend/routers/metrics.py +262 -0
- semcodes-0.1.12/backend/routers/mirror.py +237 -0
- semcodes-0.1.12/backend/routers/redsl.py +227 -0
- semcodes-0.1.12/backend/routers/report.py +14 -0
- semcodes-0.1.12/backend/routers/system.py +35 -0
- semcodes-0.1.12/backend/routers/tickets/__init__.py +20 -0
- semcodes-0.1.12/backend/routers/tickets/crud.py +188 -0
- semcodes-0.1.12/backend/routers/tickets/models.py +104 -0
- semcodes-0.1.12/backend/routers/tickets/redsl.py +284 -0
- semcodes-0.1.12/backend/routers/tickets/webhook.py +98 -0
- semcodes-0.1.12/backend/routers/trend.py +257 -0
- semcodes-0.1.12/backend/routers/webhook.py +289 -0
- semcodes-0.1.12/backend/routers/webhook_v2.py +129 -0
- semcodes-0.1.12/backend/scripts/scan_samples.py +74 -0
- semcodes-0.1.12/backend/semcodes.egg-info/PKG-INFO +17 -0
- semcodes-0.1.12/backend/semcodes.egg-info/SOURCES.txt +40 -0
- semcodes-0.1.12/backend/semcodes.egg-info/dependency_links.txt +1 -0
- semcodes-0.1.12/backend/semcodes.egg-info/requires.txt +13 -0
- semcodes-0.1.12/backend/semcodes.egg-info/top_level.txt +2 -0
- semcodes-0.1.12/pyproject.toml +77 -0
- semcodes-0.1.12/setup.cfg +4 -0
semcodes-0.1.12/PKG-INFO
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: semcodes
|
|
3
|
+
Version: 0.1.12
|
|
4
|
+
License-Expression: Apache-2.0
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Requires-Dist: fastapi>=0.110.0
|
|
7
|
+
Requires-Dist: httpx>=0.27.0
|
|
8
|
+
Requires-Dist: PyJWT>=2.8.0
|
|
9
|
+
Requires-Dist: goal>=2.1.0
|
|
10
|
+
Requires-Dist: costs>=0.1.20
|
|
11
|
+
Requires-Dist: pfix>=0.1.60
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
15
|
+
Requires-Dist: goal>=2.1.0; extra == "dev"
|
|
16
|
+
Requires-Dist: costs>=0.1.20; extra == "dev"
|
|
17
|
+
Requires-Dist: pfix>=0.1.60; extra == "dev"
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
# Semcod
|
|
2
|
+
|
|
3
|
+
## AI Cost Tracking
|
|
4
|
+
|
|
5
|
+
 
|
|
6
|
+
|
|
7
|
+
This project uses AI-generated code. Total cost: **$23.1413** with **44** AI commits.
|
|
8
|
+
|
|
9
|
+
Generated on 2026-06-29 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
**One-click Audit · PR Comment Bot · Code Health Badge · MCP Integration · Marketplace Auto-Fix**
|
|
16
|
+
|
|
17
|
+
Semcod to zautomatyzowana platforma CI/CD jakości kodu. Umożliwia deweloperom ciągły audyt repozytoriów, automatyczne komentarze w PR, oraz generowanie auto-fix Pull Requestów przez AI (reDSL).
|
|
18
|
+
|
|
19
|
+
## 🎯 **Project Purpose (Test Project)**
|
|
20
|
+
|
|
21
|
+
Ten projekt służy jako **kompletna platforma SaaS do analizy jakości kodu** z następującymi scenariuszami użycia:
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Scenariusze Użycia (User Stories)
|
|
25
|
+
|
|
26
|
+
#### 1. 🔐 **GitHub OAuth → Audit (One-click)**
|
|
27
|
+
- Użytkownik klika "Connect GitHub" → OAuth → wybiera repo → klikna "Audit"
|
|
28
|
+
- System skanuje kod (code2llm → redup → pyqual → regix) i generuje raport z grade (A-F)
|
|
29
|
+
- Wynik: raport z metrykami, rekomendacjami, health score
|
|
30
|
+
|
|
31
|
+
#### 2. 🏆 **Sandbox Mode (bez logowania)**
|
|
32
|
+
- Użytkownik wpisuje URL publicznego repo np. `https://github.com/torvalds/linux`
|
|
33
|
+
- Klikna "Analyze" → system skanuje bez autoryzacji
|
|
34
|
+
- Wynik: ten sam raport, ale oznaczony "Sandbox" badge
|
|
35
|
+
|
|
36
|
+
#### 3. 🛒 **Marketplace → Install → Auto-fix PR (Full Flow)**
|
|
37
|
+
- **Step 1**: Marketplace tab → Select Repository z listy OAuth
|
|
38
|
+
- **Step 2**: Preview & Configure → Install App (webhook setup)
|
|
39
|
+
- **Step 3**: **Generate Artifact** → wybiera między:
|
|
40
|
+
- 🤖 **Auto-fix PR** — patch generator (trailing whitespace, blank lines)
|
|
41
|
+
- 🔄 **reDSL Refactor PR** — 15 DSL refactor actions (SPLIT_MODULE, REDUCE_FAN_OUT, EXTRACT_FUNCTIONS)
|
|
42
|
+
- System tworzy branch, commituje zmiany, otwiera PR na GitHub
|
|
43
|
+
- Wynik: PR URL z auto-fixami, task_id do trackowania w Celery
|
|
44
|
+
|
|
45
|
+
#### 4. 🤖 **PR Comment Bot (GitHub App)**
|
|
46
|
+
- Użytkownik instaluje GitHub App na repo
|
|
47
|
+
- Każdy nowy PR triggeruje webhook → analiza zmian → komentarz z metrykami
|
|
48
|
+
- Wynik: automatyczny code review w PR
|
|
49
|
+
|
|
50
|
+
#### 5. 🏷️ **Badge Generator**
|
|
51
|
+
- Użytkownik kopiuje Markdown badge z panelu
|
|
52
|
+
- Wkleja do README → dynamiczny SVG z health score
|
|
53
|
+
- Wynik: ``
|
|
54
|
+
|
|
55
|
+
#### 6. 🎫 **Ticket-driven Auto-PR (NEW)**
|
|
56
|
+
- **Step 1**: Użytkownik tworzy ticket w panelu Semcod:
|
|
57
|
+
- Typ: `feature` (nowa funkcja) lub `bugfix` (naprawa usterki)
|
|
58
|
+
- Tytuł: np. "Dodaj paginację do listy użytkowników"
|
|
59
|
+
- Opis: szczegóły zmiany lub stack trace błędu
|
|
60
|
+
- Target repo: wybór z zainstalowanych repozytoriów
|
|
61
|
+
- **Step 2**: System analizuje ticket przez reDSL:
|
|
62
|
+
- `redsl.decide()` — ocena gdzie w kodzie wprowadzić zmiany
|
|
63
|
+
- `redsl.refactor()` — automatyczna refaktoryzacja dla nowego feature
|
|
64
|
+
- Lokalizacja plików do modyfikacji na podstawie opisu ticketu
|
|
65
|
+
- **Step 3**: Auto-generacja PR:
|
|
66
|
+
- Tworzony jest branch `ticket-{id}-{typ}`
|
|
67
|
+
- reDSL commituje zmiany (nowe funkcje lub fixy)
|
|
68
|
+
- Otwierany jest PR na GitHub z linkiem do ticketu
|
|
69
|
+
- W PR: komentarz z opisem zmian i referencją do ticketu
|
|
70
|
+
- **Step 4**: Aktualizacja ticketu:
|
|
71
|
+
- Status zmienia się na `in_progress` → `pr_created` → `merged`
|
|
72
|
+
- Po merge ticket automatycznie zamykany
|
|
73
|
+
- Wynik: **Pełna automatyzacja od zgłoszenia do wdrożenia**
|
|
74
|
+
|
|
75
|
+
## ✅ **Current Status: Production Ready**
|
|
76
|
+
|
|
77
|
+
- 🔐 **GitHub OAuth Authentication** - Complete OAuth flow with mock GitHub for development
|
|
78
|
+
- 🚀 **One-click Audit** - Automated code analysis with detailed reports
|
|
79
|
+
- 🤖 **PR Comment Bot** - Automatic pull request analysis and comments
|
|
80
|
+
- 🏆 **Code Health Badges** - Dynamic SVG badges for README files
|
|
81
|
+
- 🔌 **MCP Integration** - Model Context Protocol for AI assistants
|
|
82
|
+
- 📊 **Benchmark KPI MVP** - Instrumentacja do zbierania metryk benchmarkowych (cases, feedback, decisions, export)
|
|
83
|
+
- 🔄 **ReDSL Integration** - Automatyczna refaktoryzacja kodu przez DSL (analyze, refactor, health score, auto-PR)
|
|
84
|
+
- 🛒 **Marketplace Auto-Fix** — 3-step flow: select repo → install → generate artifact (PR)
|
|
85
|
+
- 🐳 **Docker Ready** - Complete containerization with mock GitHub
|
|
86
|
+
- 🧪 **Comprehensive Testing** - Unit, integration, and E2E tests (95 Playwright tests)
|
|
87
|
+
|
|
88
|
+
  
|
|
89
|
+
 
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
semcod/
|
|
93
|
+
├── backend/ # FastAPI server
|
|
94
|
+
│ ├── server.py # Główny serwer (CORS, routers)
|
|
95
|
+
│ ├── config.py # Konfiguracja z env (20 zmiennych)
|
|
96
|
+
│ ├── database.py # SQLite persistence (scans, users)
|
|
97
|
+
│ ├── store.py # In-memory cache (audit_results, badge_cache, scan_history)
|
|
98
|
+
│ ├── routers/
|
|
99
|
+
│ │ ├── audit.py # Audit pipeline + sandbox analysis
|
|
100
|
+
│ │ ├── auth.py # GitHub OAuth authentication
|
|
101
|
+
│ │ ├── webhook.py # GitHub webhook (PR bot)
|
|
102
|
+
│ │ ├── badge.py # SVG badge generator
|
|
103
|
+
│ │ ├── metrics.py # Standardized metrics API
|
|
104
|
+
│ │ ├── mcp.py # Model Context Protocol
|
|
105
|
+
│ │ └── system.py # Health check, domain config
|
|
106
|
+
│ ├── services/
|
|
107
|
+
│ │ ├── analyzer.py # code2llm, redup, pyqual runners
|
|
108
|
+
│ │ ├── scoring.py # Health score, grades, recommendations
|
|
109
|
+
│ │ └── github_client.py # GitHub App JWT auth
|
|
110
|
+
│ └── Dockerfile
|
|
111
|
+
├── frontend/ # React + Vite
|
|
112
|
+
│ ├── src/
|
|
113
|
+
│ │ ├── App.jsx # Główny komponent
|
|
114
|
+
│ │ ├── api.js # API client
|
|
115
|
+
│ │ ├── config.js # Frontend config (VITE_ vars)
|
|
116
|
+
│ │ ├── constants.js # Colors, grades, configuration data
|
|
117
|
+
│ │ ├── hooks/ # useAppState (URL hash routing)
|
|
118
|
+
│ │ ├── components/ # Phases, tabs, shared UI
|
|
119
|
+
│ │ └── screens/ # Screen layouts
|
|
120
|
+
│ └── Dockerfile
|
|
121
|
+
├── quadlet/ # Podman Quadlet (systemd deployment)
|
|
122
|
+
├── traefik/ # Traefik config (local HTTPS + production)
|
|
123
|
+
├── articles/ # 28 artykułów WordPress
|
|
124
|
+
├── .env.example # Wszystkie zmienne konfiguracyjne
|
|
125
|
+
├── docker-compose.yml # Production stack
|
|
126
|
+
├── docker-compose.sim.yml # Mock GitHub simulation (development)
|
|
127
|
+
└── README.md
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 📋 **Wymagania systemowe**
|
|
131
|
+
|
|
132
|
+
- **Python 3.9+** - Backend FastAPI
|
|
133
|
+
- **Node.js 16+** - Frontend React + Vite
|
|
134
|
+
- **Docker & Docker Compose** - Konteneryzacja (opcjonalne)
|
|
135
|
+
- **Git** - Wersjonowanie kodu
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🚀 Szybki start
|
|
140
|
+
|
|
141
|
+
### 1. Instalacja i konfiguracja
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Sklonuj repozytorium
|
|
145
|
+
git clone <repository-url>
|
|
146
|
+
cd semcod/www
|
|
147
|
+
|
|
148
|
+
# Skonfiguruj środowisko
|
|
149
|
+
cp .env.example .env
|
|
150
|
+
# Dla dewelopmentu z mock GitHub - zmienne są już ustawione
|
|
151
|
+
# Dla produkcji - uzupełnij GITHUB_APP_ID, GITHUB_CLIENT_ID, etc.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 2. Uruchomienie deweloperskie
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Lokalnie (Vite :5174 + backend :8200)
|
|
158
|
+
make dev
|
|
159
|
+
|
|
160
|
+
# Lub z Docker + mock GitHub (rekomendowane)
|
|
161
|
+
make sim
|
|
162
|
+
|
|
163
|
+
# Usługi dostępne na:
|
|
164
|
+
# Lokalnie: Frontend http://localhost:5174, Backend http://localhost:8200
|
|
165
|
+
# Docker: Frontend http://localhost:3000, Backend http://localhost:8003, Mock GH http://localhost:4010
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Pełna lista komend: `make help`
|
|
169
|
+
|
|
170
|
+
### 3. Uruchomienie z Docker Compose
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Z mock GitHub (dewelopment) — równoważne: make sim
|
|
174
|
+
make sim
|
|
175
|
+
|
|
176
|
+
# Produkcja (wymaga prawdziwych credentials GitHub) — równoważne: make up
|
|
177
|
+
make up
|
|
178
|
+
|
|
179
|
+
# Zatrzymanie: make down lub make sim-down
|
|
180
|
+
|
|
181
|
+
# Dostępne na:
|
|
182
|
+
# Frontend: http://localhost:3000
|
|
183
|
+
# Backend: http://localhost:8003
|
|
184
|
+
# Mock GitHub: http://localhost:4010
|
|
185
|
+
# ReDSL: http://localhost:8030
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 4. Produkcja VPS (Podman Quadlet)
|
|
189
|
+
|
|
190
|
+
Zobacz [quadlet/README.md](./quadlet/README.md) — systemd + Traefik + Let's Encrypt.
|
|
191
|
+
|
|
192
|
+
### 5. Testowanie
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Testy jednostkowe backend
|
|
196
|
+
make test
|
|
197
|
+
|
|
198
|
+
# Pełne testy backend
|
|
199
|
+
make test-all
|
|
200
|
+
|
|
201
|
+
# E2E Playwright (wymaga make sim lub make dev)
|
|
202
|
+
make e2e
|
|
203
|
+
|
|
204
|
+
# E2E na lokalnym dev serwerze
|
|
205
|
+
make e2e-dev
|
|
206
|
+
|
|
207
|
+
# Instalacja Playwright (pierwszy raz)
|
|
208
|
+
make e2e-install
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 📊 **Performance & Metrics**
|
|
214
|
+
|
|
215
|
+
### 🚀 **System Performance**
|
|
216
|
+
- **Audit completion:** ~30-60 seconds (depending on repository size)
|
|
217
|
+
- **API response time:** <200ms for most endpoints
|
|
218
|
+
- **Database:** SQLite with in-memory caching for speed
|
|
219
|
+
- **Frontend build:** <30 seconds production build
|
|
220
|
+
- **Docker startup:** <10 seconds full stack
|
|
221
|
+
|
|
222
|
+
### 📈 **Scalability Features**
|
|
223
|
+
- **Background processing** - Async audit pipeline
|
|
224
|
+
- **Redis caching** - Session and result caching
|
|
225
|
+
- **Database pooling** - Efficient connection management
|
|
226
|
+
- **Load balancing ready** - Traefik integration
|
|
227
|
+
- **Horizontal scaling** - Stateless services
|
|
228
|
+
|
|
229
|
+
### 🧪 **Test Coverage**
|
|
230
|
+
- **Unit tests:** Backend pytest with markers
|
|
231
|
+
- **Integration tests:** API endpoint testing
|
|
232
|
+
- **E2E tests:** Playwright GUI automation
|
|
233
|
+
- **Performance tests:** Load testing capabilities
|
|
234
|
+
- **Quality gates:** Automated code quality checks
|
|
235
|
+
|
|
236
|
+
## Co jest w paczce
|
|
237
|
+
|
|
238
|
+
### Backend
|
|
239
|
+
- **GitHub OAuth flow** — `/auth/github` → Mock GitHub → `/auth/callback` → JWT session
|
|
240
|
+
- **One-click Audit** — `/api/audit` → background pipeline (code2llm → redup → pyqual → regix) → raport JSON
|
|
241
|
+
- **Sandbox Analysis** — `/api/analyze` → public repo bez autoryzacji
|
|
242
|
+
- **PR Comment Bot** — `/webhook/github` → analiza plików PR → komentarz Markdown z metrykami
|
|
243
|
+
- **Badge SVG** — `/badge/{owner-repo}.svg` → dynamiczny shields.io-style badge
|
|
244
|
+
- **Scan History** — `/api/scans/recent` → SQLite + in-memory fallback
|
|
245
|
+
- **MCP Server** — `/mcp/*` → Model Context Protocol dla AI
|
|
246
|
+
- **Benchmark KPI** — `/api/benchmark/*` → cases, feedback, decisions, events, summary, export CSV/JSON
|
|
247
|
+
- **ReDSL Engine** — `/api/redsl/*` → analyze, refactor, health score, batch-hybrid, badge generation
|
|
248
|
+
- **Webhook security** — HMAC-SHA256 signature verification
|
|
249
|
+
- **Mock GitHub integration** — pełne symulowanie OAuth flow dla dewelopmentu
|
|
250
|
+
|
|
251
|
+
### Frontend
|
|
252
|
+
- **Tab: Audit** — OAuth → wybór repo → animowany skan → raport z grade, metrykami, rekomendacjami
|
|
253
|
+
- **Tab: Recent Scans** — lista ostatnich skanów z metrykami i share buttons
|
|
254
|
+
- **Tab: Badge** — generator kodu Markdown/HTML z live preview badge'ów
|
|
255
|
+
- **Sandbox mode** — skanowanie publicznych repo bez logowania
|
|
256
|
+
|
|
257
|
+
### Deployment
|
|
258
|
+
- **Docker Compose** — lokalny dev z Traefik HTTPS + LAN access
|
|
259
|
+
- **Podman Quadlet** — produkcja VPS z systemd + Let's Encrypt
|
|
260
|
+
- **20 zmiennych env** — pełna konfiguracja bez hardkodu (zobacz `.env.example`)
|
|
261
|
+
|
|
262
|
+
## Endpointy API
|
|
263
|
+
|
|
264
|
+
| Endpoint | Metoda | Opis |
|
|
265
|
+
|----------|--------|------|
|
|
266
|
+
| `GET /auth/github` | GET | GitHub OAuth start |
|
|
267
|
+
| `GET /auth/callback` | GET | OAuth callback → redirect z tokenem |
|
|
268
|
+
| `GET /api/me` | GET | Profil użytkownika |
|
|
269
|
+
| `GET /api/repos` | GET | Lista repozytoriów użytkownika |
|
|
270
|
+
| `POST /api/audit` | POST | Uruchom audyt `{repo}` → `{audit_id}` |
|
|
271
|
+
| `POST /api/analyze` | POST | Sandbox analysis `{repo_url, sandbox}` |
|
|
272
|
+
| `GET /api/audit/{id}` | GET | Pobierz wynik audytu |
|
|
273
|
+
| `GET /api/scans/recent` | GET | Ostatnie skany z metrykami |
|
|
274
|
+
| `GET /api/metrics/standard` | GET | Standaryzowane metryki |
|
|
275
|
+
| `GET /api/config/domain` | GET | Konfiguracja domeny |
|
|
276
|
+
| `GET /api/health` | GET | Health check |
|
|
277
|
+
| `POST /webhook/github` | POST | Webhook (PR bot, instalacje) |
|
|
278
|
+
| `GET /badge/{owner-repo}.svg` | GET | Badge SVG |
|
|
279
|
+
| `GET /mcp/info` | GET | MCP server info |
|
|
280
|
+
| `GET /mcp/resources` | GET | MCP resources list |
|
|
281
|
+
| `POST /mcp/invoke` | POST | MCP tool invocation |
|
|
282
|
+
| **Benchmark KPI** | | |
|
|
283
|
+
| `POST /api/benchmark/cases` | POST | Create benchmark case |
|
|
284
|
+
| `GET /api/benchmark/cases` | GET | List benchmark cases |
|
|
285
|
+
| `GET /api/benchmark/cases/{id}` | GET | Get benchmark case |
|
|
286
|
+
| `PATCH /api/benchmark/cases/{id}` | PATCH | Update benchmark case |
|
|
287
|
+
| `POST /api/benchmark/cases/{id}/decision` | POST | Submit deployment decision |
|
|
288
|
+
| `POST /api/benchmark/cases/{id}/recommendations/{rid}/feedback` | POST | Submit recommendation feedback |
|
|
289
|
+
| `POST /api/benchmark/cases/{id}/events` | POST | Track benchmark event |
|
|
290
|
+
| `GET /api/benchmark/summary` | GET | Benchmark KPI summary |
|
|
291
|
+
| `GET /api/benchmark/export.json` | GET | Export benchmark data (JSON) |
|
|
292
|
+
| `GET /api/benchmark/export.csv` | GET | Export benchmark data (CSV) |
|
|
293
|
+
| **ReDSL** | | |
|
|
294
|
+
| `GET /api/redsl/status` | GET | ReDSL engine status |
|
|
295
|
+
| `POST /api/redsl/analyze` | POST | Run reDSL analysis |
|
|
296
|
+
| `POST /api/redsl/health` | POST | Get project health score |
|
|
297
|
+
| `POST /api/redsl/refactor` | POST | Run reDSL refactoring |
|
|
298
|
+
| `POST /api/redsl/decide` | POST | Evaluate DSL rules (dry-run) |
|
|
299
|
+
| `POST /api/redsl/batch-hybrid` | POST | Hybrid quality refactoring |
|
|
300
|
+
| `GET /api/redsl/badge/{owner}/{repo}` | GET | SVG health badge |
|
|
301
|
+
|
|
302
|
+
## MCP Integration
|
|
303
|
+
|
|
304
|
+
Semcod supports [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) for AI assistant integration. AI assistants can programmatically:
|
|
305
|
+
- Start audits: `POST /mcp/invoke` with `{"name": "start_audit"}`
|
|
306
|
+
- Check scan status: `{"name": "get_scan_status"}`
|
|
307
|
+
- Query metrics: `GET /mcp/resources/content?uri=metrics://summary`
|
|
308
|
+
|
|
309
|
+
📚 [Full MCP Documentation](./docs/MCP.md)
|
|
310
|
+
|
|
311
|
+
## 🛠️ Makefile - Najważniejsze komendy
|
|
312
|
+
|
|
313
|
+
Pełna lista: `make help`
|
|
314
|
+
|
|
315
|
+
### Środowisko deweloperskie
|
|
316
|
+
```bash
|
|
317
|
+
make install # Instaluje zależności (backend + frontend + e2e)
|
|
318
|
+
make dev # Lokalnie: backend :8200 + Vite :5174
|
|
319
|
+
make backend # Tylko backend (port 8200)
|
|
320
|
+
make frontend # Tylko frontend Vite (port 5174)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Docker + Mock GitHub
|
|
324
|
+
```bash
|
|
325
|
+
make sim # Docker + mock GitHub (frontend :3000, backend :8003, mock :4010)
|
|
326
|
+
make sim-down # Zatrzymaj stack z mock GitHub
|
|
327
|
+
make up # Docker production stack
|
|
328
|
+
make down # Zatrzymaj production stack
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Testowanie
|
|
332
|
+
```bash
|
|
333
|
+
make test # Backend pytest (bez slow)
|
|
334
|
+
make test-all # Pełne testy backend
|
|
335
|
+
make e2e # Playwright E2E na Docker (port 3000)
|
|
336
|
+
make e2e-dev # Playwright E2E na lokalnym dev (port 5174)
|
|
337
|
+
make e2e-install # Instaluj Playwright Chromium
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Jakość kodu i utilities
|
|
341
|
+
```bash
|
|
342
|
+
make lint # ruff lint + format check
|
|
343
|
+
make logs # Tail Docker logs (backend, frontend, worker)
|
|
344
|
+
make ps # Pokaż kontenery Docker
|
|
345
|
+
make clean # Czyści cache i node_modules
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Testy - szczegóły
|
|
349
|
+
Testy są oznaczone markerami:
|
|
350
|
+
- `@pytest.mark.fast` - szybkie testy bez zewnętrznych zależności
|
|
351
|
+
- `@pytest.mark.unit` - izolowane testy jednostkowe
|
|
352
|
+
- `@pytest.mark.integration` - testy integracyjne
|
|
353
|
+
- `@pytest.mark.slow` - wolne testy (domyślnie pomijane w `test-fast`)
|
|
354
|
+
|
|
355
|
+
## 🔧 Zmienne środowiskowe
|
|
356
|
+
|
|
357
|
+
Wszystkie ustawienia w `.env` — bez hardkodu w kodzie. Pełna lista w `.env.example`:
|
|
358
|
+
|
|
359
|
+
### GitHub OAuth Configuration
|
|
360
|
+
| Zmienna | Domyślnie | Opis |
|
|
361
|
+
|---------|-----------|------|
|
|
362
|
+
| `GITHUB_APP_ID` | | GitHub App ID |
|
|
363
|
+
| `GITHUB_CLIENT_ID` | | OAuth Client ID |
|
|
364
|
+
| `GITHUB_CLIENT_SECRET` | | OAuth Client Secret |
|
|
365
|
+
| `GITHUB_WEBHOOK_SECRET` | | Webhook signing secret |
|
|
366
|
+
| `GITHUB_PRIVATE_KEY_PATH` | `private-key.pem` | Ścieżka do klucza prywatnego |
|
|
367
|
+
| `GITHUB_OAUTH_SCOPE` | `repo,read:org` | OAuth scope |
|
|
368
|
+
|
|
369
|
+
### Mock GitHub Configuration (dewelopment)
|
|
370
|
+
| Zmienna | Domyślnie | Opis |
|
|
371
|
+
|---------|-----------|------|
|
|
372
|
+
| `MOCK_GITHUB_CLIENT_ID` | `Iv1.mock_test_client` | Mock OAuth Client ID |
|
|
373
|
+
| `MOCK_GITHUB_CLIENT_SECRET` | `mock_secret_for_testing` | Mock OAuth Client Secret |
|
|
374
|
+
| `MOCK_GITHUB_APP_ID` | `999999` | Mock GitHub App ID |
|
|
375
|
+
| `MOCK_GITHUB_WEBHOOK_SECRET` | `whsec_mock_test` | Mock Webhook Secret |
|
|
376
|
+
| `MOCK_USER_LOGIN` | `tom-sapletta-com` | Mock user login |
|
|
377
|
+
| `MOCK_USER_NAME` | `Tom Sapletta` | Mock user name |
|
|
378
|
+
| `MOCK_USER_EMAIL` | `tom@sapletta.com` | Mock user email |
|
|
379
|
+
| `MOCK_USER_ID` | `5669315` | Mock user ID |
|
|
380
|
+
| `MOCK_USER_BIO` | `Architect & Developer` | Mock user bio |
|
|
381
|
+
| `MOCK_USER_COMPANY` | `Softreck` | Mock user company |
|
|
382
|
+
| `MOCK_USER_LOCATION` | `Gdańsk, Poland` | Mock user location |
|
|
383
|
+
| `MOCK_USER_AVATAR_URL` | | Mock user avatar URL |
|
|
384
|
+
| `MOCK_USER_PUBLIC_REPOS` | `150` | Mock user public repos count |
|
|
385
|
+
|
|
386
|
+
### Application Configuration
|
|
387
|
+
| Zmienna | Domyślnie | Opis |
|
|
388
|
+
|---------|-----------|------|
|
|
389
|
+
| `APP_URL` | `http://localhost:8003` | URL backendu (Docker) / `:8200` (local) |
|
|
390
|
+
| `FRONTEND_URL` | `http://localhost:3000` | URL frontendu (Docker) / `:5174` (local) |
|
|
391
|
+
| `PUBLIC_URL` | `$APP_URL` | Publiczny URL |
|
|
392
|
+
| `HOST` | `0.0.0.0` | Bind address |
|
|
393
|
+
| `PORT` | `9000` | Port backendu |
|
|
394
|
+
| `SECRET_KEY` | `dev-secret-change-me` | Klucz JWT (zmień w produkcji!) |
|
|
395
|
+
| `SESSION_EXPIRE_HOURS` | `168` | Czas wygaśnięcia sesji (7 dni) |
|
|
396
|
+
| `DB_PATH` | `scans.db` | Ścieżka do SQLite |
|
|
397
|
+
| `SCAN_HISTORY_LIMIT` | `100` | Limit skanów w pamięci |
|
|
398
|
+
| `REPOS_PER_PAGE` | `30` | Repozytoria na stronę |
|
|
399
|
+
| `CORS_ORIGINS` | `$FRONTEND_URL,https://semcod.com` | Dozwolone origins |
|
|
400
|
+
| `LARGE_FILE_THRESHOLD` | `300` | Próg zmian w pliku (PR bot) |
|
|
401
|
+
|
|
402
|
+
## 📚 Dokumentacja
|
|
403
|
+
|
|
404
|
+
### 🚀 Szybki start
|
|
405
|
+
- [Getting Started](./docs/getting-started.md) - Szybki start i instalacja
|
|
406
|
+
- [Platform Overview](./docs/01-semcod-platform-overview.md) - Przegląd platformy
|
|
407
|
+
|
|
408
|
+
### 🏗️ Architektura i API
|
|
409
|
+
- [Architecture](./docs/architecture.md) - Architektura systemu
|
|
410
|
+
- [API Reference](./docs/api.md) - Dokumentacja API
|
|
411
|
+
- [MCP Integration](./docs/MCP.md) - Integracja z AI asystentami
|
|
412
|
+
|
|
413
|
+
### 🚀 Deployment
|
|
414
|
+
- [Quadlet Deployment](./quadlet/README.md) - VPS z Podman + systemd
|
|
415
|
+
- [Platform Status](./docs/02-semcod-www-status.md) - Status platformy
|
|
416
|
+
|
|
417
|
+
### 📈 Roadmap i planowanie
|
|
418
|
+
- [Roadmap](./docs/roadmap.md) - Roadmapa rozwoju
|
|
419
|
+
- [Complete Roadmap](./docs/semcod-complete-roadmap.md) - Szczegółowa roadmapa
|
|
420
|
+
- [Marketplace Business](./docs/04-semcod-marketplace-business.md) - Model biznesowy
|
|
421
|
+
|
|
422
|
+
### 📊 Benchmark i walidacja
|
|
423
|
+
- [Validation Benchmark](./docs/validation-benchmark.md) - Plan benchmarku i KPI
|
|
424
|
+
- [Benchmark Checklist](./docs/validation-benchmark-checklist.md) - Checklista wykonawcza
|
|
425
|
+
- [Benchmark Template](./docs/validation-benchmark-template.md) - Szablon przypadków testowych
|
|
426
|
+
- [Benchmark CSV Template](./docs/validation-benchmark-template.csv) - Szablon CSV do wyników
|
|
427
|
+
- [KPI Product Plan](./docs/benchmark-kpi-product-plan.md) - Plan zmian UI/API (Etap 1 ✅ zakończony)
|
|
428
|
+
|
|
429
|
+
### 🔄 ReDSL (Refactoring DSL)
|
|
430
|
+
- [ReDSL Engine Status](./docs/03-redsl-engine-status.md) - Status silnika refaktoryzacji
|
|
431
|
+
- API endpoints: `/api/redsl/*` — analyze, refactor, health, decide, batch-hybrid, badge
|
|
432
|
+
|
|
433
|
+
### 🔧 Inne
|
|
434
|
+
- [REFACTORING-SUMMARY.md](./docs/REFACTORING-SUMMARY.md) - Podsumowanie refaktoryzacji OAuth
|
|
435
|
+
- [DEMO-REMOVAL-SUMMARY.md](./docs/DEMO-REMOVAL-SUMMARY.md) - Usunięcie demo login
|
|
436
|
+
- [FINAL-TEST-REPORT.md](./docs/FINAL-TEST-REPORT.md) - Raport końcowych testów
|
|
437
|
+
|
|
438
|
+
## 🔧 **Troubleshooting**
|
|
439
|
+
|
|
440
|
+
### Common Issues
|
|
441
|
+
|
|
442
|
+
#### **Port conflicts**
|
|
443
|
+
```bash
|
|
444
|
+
# Jeśli porty są zajęte, zmień je w .env:
|
|
445
|
+
BACKEND_PORT=8201
|
|
446
|
+
FRONTEND_PORT=5175
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
#### **Python virtual environment issues**
|
|
450
|
+
```bash
|
|
451
|
+
# Clean setup
|
|
452
|
+
make clean
|
|
453
|
+
make install
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
#### **Docker issues**
|
|
457
|
+
```bash
|
|
458
|
+
# Reset Docker containers
|
|
459
|
+
docker compose down -v
|
|
460
|
+
docker compose up -d
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
#### **Mock GitHub not working**
|
|
464
|
+
```bash
|
|
465
|
+
# Check mock GitHub status
|
|
466
|
+
curl http://localhost:4010/health
|
|
467
|
+
|
|
468
|
+
# Should return:
|
|
469
|
+
{"status": "ok", "mode": "github-simulation", "users": ["tom-sapletta-com"]}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
#### **Frontend build issues**
|
|
473
|
+
```bash
|
|
474
|
+
# Clean and rebuild
|
|
475
|
+
cd frontend
|
|
476
|
+
rm -rf node_modules dist
|
|
477
|
+
npm install
|
|
478
|
+
npm run build
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## 📚 **Dokumentacja**
|
|
484
|
+
|
|
485
|
+
📖 **[Pełna dokumentacja](https://semcod.github.io/www/)** - dostępna na GitHub Pages
|
|
486
|
+
|
|
487
|
+
## Licencja
|
|
488
|
+
|
|
489
|
+
Apache-2.0
|
|
490
|
+
|
|
491
|
+
<!-- taskill:status:start -->
|
|
492
|
+
|
|
493
|
+
## Status
|
|
494
|
+
|
|
495
|
+
_Last updated by [taskill](https://github.com/oqlos/taskill) at 2026-04-25 13:49 UTC_
|
|
496
|
+
|
|
497
|
+
| Metric | Value |
|
|
498
|
+
|---|---|
|
|
499
|
+
| HEAD | `daf768a` |
|
|
500
|
+
| Coverage | — |
|
|
501
|
+
| Failing tests | — |
|
|
502
|
+
| Commits in last cycle | 50 |
|
|
503
|
+
|
|
504
|
+
> Large refactor plus new quick-ticket and reDSL features: integrated a /cycle API for real file modifications, enhanced quick-ticket with apply/--auto modes and a helper script, plus cycle-test examples and documentation/packaging fixes.
|
|
505
|
+
|
|
506
|
+
<!-- taskill:status:end -->
|