feat: MUCIZEWORK WEB4 Engine — Full System (BLACK mode) - #1
Merged
Conversation
- FastAPI API (port 5002): /status, /graph, /events, /db, /health - Engine core: graph state, event logging, wallet/flow/position DB - Storage: JSON-based persistent state (graph, events, db) - Scripts: health_check.py, start.sh, start.ps1 - Config: BLACK mode, MZC_GRAPH=ACTIVE
- Flask API (port 5080): /challenge, /login, /session, /graph, /status - Solana ED25519 imza dogrulama (nacl + base58) - JWT session yonetimi - Graph entegrasyonu (node/edge CRUD) - JSON-based DB (users, sessions, graph) - Test scripti ve start scriptleri (bash + PowerShell)
…ature - api/api.py: Flask orkestrator (port 5002) — /, /status, /graph, /analyze - clustering/cluster_engine.py: Wallet siniflandirma (AJAN/MZC/MYK) - radar/smart_radar.py: Smart Money tespit (>100K akis sinyali) - funding/funding_trace.py: Fon akisi kayit/izleme (port 5003) - signature/verify.py: Hash tabanli imza dogrulama - core/config.json: v5.0 BLACK mode, 4 modul aktif - Graph state: AJAN(execution), MZC(asset), MYK(treasury) node'lari
- api/api.py: Birlesik orkestrator — /health, /graph, /radar, /funding, /flow, /sign - wallet_cluster/cluster.py: AJAN/MZC/MYK graph (bakiye + edge takibi) - radar/radar.py: Smart Money sinyal tarama (ACCUMULATION) - funding/trace.py: Fon kaynak analizi (external/CEX/bridge, confidence 0.87) - signature/engine.py: SHA256 hash imza dogrulama - test_web4.py: Tam endpoint test scripti
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
Test Results — All 11 Assertions PassedRan both Flask APIs locally and tested all endpoints with automated assertions. Orchestrator API (port 5002) — 6/6 PASSED
WEB4 Auth (port 5080) — 5/5 PASSED
Note: Full Solana ED25519 signature flow requires a real keypair — rejection paths verified. No CI configured. |
yunKALKAN
marked this pull request as ready for review
June 22, 2026 20:24
API Contract v1 (Frozen):
GET /api/v1/health
GET /api/v1/graph
GET /api/v1/radar
GET /api/v1/funding/{wallet}
POST /api/v1/flow
POST /api/v1/hash/sha256
POST /api/v1/sign/verify
Kurumsal standartlar:
- X-Request-ID middleware (istekte gelen veya otomatik UUID)
- X-API-Version: 1.0 header tum yanitlarda
- Ortak hata kodlari (INVALID_REQUEST/UNAUTHORIZED/FORBIDDEN/NOT_FOUND/
CONFLICT/VALIDATION_FAILED/RATE_LIMITED/INTERNAL_ERROR)
- Gelismis /health: subsystem durumlari (graph, radar, funding, signature, db)
- /hash/sha256 ve /sign/verify ayrildi
- /funding/{wallet} path parametresi destegi
- OpenAPI 3.0.3 (openapi.yaml) tanimlamasi
- 19 entegrasyon testi (basari + hata senaryolari)
…itution
P0 Blockers resolved:
- P0-1: Flask -> FastAPI migration (apps/api/main.py)
- Pydantic v2 request models
- Auto-generated OpenAPI/Swagger/ReDoc
- Dependency injection ready services
- Async middleware (X-Request-ID, X-Trace-ID, X-API-Version)
- P0-2: Secrets management (.env.example, pydantic-settings config)
- P0-3: Docker (Dockerfile, docker-compose.yml/dev/prod)
- P0-4: CI/CD (GitHub Actions: ruff, black, mypy, pytest, bandit, docker)
Platform structure:
- apps/api/ — FastAPI gateway
- services/{graph,radar,funding,signature}/ — Engine layer
- packages/{models,shared}/ — Config, logger, envelope
- legacy/ — Flask reference code
- configs/ — YAML environment configs
Documentation suite:
- ENGINEERING_CONSTITUTION.md — 12 articles
- ARCHITECTURE.md, API.md, SECURITY.md, DEPLOYMENT.md
- ROADMAP.md, CHANGELOG.md, CONTRIBUTING.md
- 7 ADR files (Anchor, PDA, REST, versioning, signature, risk, graph)
- 4 RFC files (wallet-clustering, radar-v2, graph-v2, risk-v2)
- 9 docs/ guides + diagrams placeholder
GitHub:
- 6 issue templates + PR template + labels
- CI pipeline (lint, typecheck, test, security, docker)
- Anchor build/test workflows
Tests: 23/23 FastAPI integration tests passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Transforms WEB4 Engine from a prototype into an enterprise-grade blockchain intelligence platform. Resolves all P0 architectural blockers (FastAPI migration, secrets management, Docker, CI/CD) and establishes full documentation suite following Google/Microsoft/Solana Labs engineering standards.
P0 Blockers Resolved
P0-1 Flask → FastAPI: New
apps/api/main.pyreplaces Flask Blueprint with FastAPI + Pydantic v2 models. Auto-generates OpenAPI/Swagger/ReDoc. Async middleware injectsX-Request-ID,X-Trace-ID,X-API-Versionheaders. Response envelope:{success, request_id, trace_id, timestamp, data}. Old Flask code preserved inlegacy/.P0-2 Secrets:
.env.examplewith allMZC_*vars.packages/shared/config.pyusespydantic-settingsfor typed config from env.P0-3 Docker:
docker/Dockerfile,Dockerfile.api,docker-compose.yml(base),docker-compose.dev.yml(hot-reload),docker-compose.prod.yml(resource limits).P0-4 CI/CD:
.github/workflows/ci.yml— ruff → black → mypy → pytest+coverage → bandit → docker build. Anchor build/test workflows triggered byprograms/changes.Platform Structure
API Contract v1 (Frozen) — 7 endpoints + 3 observability
All endpoints under
/api/v1/with standardized error codes (400-500) and subsystem health reporting.Documentation (85+ files)
Root docs (README, ARCHITECTURE, API, SECURITY, DEPLOYMENT, ROADMAP, CHANGELOG, CONTRIBUTING, CODE_OF_CONDUCT, LICENSE, ENGINEERING_CONSTITUTION, ORGANIZATION), 7 ADR files, 4 RFC files, 9 docs/ guides, 6 issue templates, PR template, labels.yml, 4 CI workflows.
Tests
23/23 FastAPI integration tests passing — covers all endpoints, error scenarios, header propagation, envelope format.
Link to Devin session: https://app.devin.ai/sessions/9c83bbb8083846e5b15e58d659aa5fa7
Requested by: @yunKALKAN