Repository navigation
Testing and CI
DerivLab is verified locally and on GitHub Actions.
pytest -q
ruff check .The suite contains 248 tests and passes on:
- Python 3.12 (local development)
- Python 3.11 (CI and Dev Container)
All tests are offline. tests/conftest.py forces the local LLM provider so a
developer's .env key never triggers paid API calls during tests.
- CI runs
--cov=derivlab --cov-fail-under=80. - The measured total is 85%.
-
coverage.jsonfeedsdocs/badges/coverage.svg; CI verifies the badge is not stale. - The full report is uploaded as a workflow artifact.
| Area | What is covered |
|---|---|
| Option math | Black-Scholes, Greeks, intrinsic value |
| Strategies | Plans, legs, credit/debit signs, condor wings |
| Backtest engine | NAV, drawdown, metrics, fees, assignment, deterministic runs |
| Game | Scenario slicing, alerts, actions, completion, scoring, errors |
| AI agents | Policies, regime changes, JSON parsing, HTTP clients, retries, fallbacks, reports, news, bridge, arena |
| UI | Streamlit AppTest across all six screens, AI Arena run, game flow, low-capital warnings |
| Repository | Compose restart policy, Dockerfile, Dev Container, seed, screenshots, demo media, secrets hygiene |
- Python 3.11 · lint + tests — installs pinned dependencies, runs Ruff and the full pytest suite.
-
Docker image and health — builds the image, starts the container, polls
/_stcore/health, and reports the restart policy.
-
Docs · links + ADRchecks local links, ADR structure, versioning, the social preview, and the coverage badge. - Lychee checks external links with rate-limit tolerance.
- It runs on push, pull request, and manual dispatch.
- Python analysis with
build-mode: none. - Runs on push, pull request, a weekly schedule, and manual dispatch.
- Uploads results to Code Scanning.
main is protected. A pull request must pass:
Python 3.11 · lint + testsDocker image and healthAnalyze PythonDocs · links + ADR
Strict mode requires the branch to be up to date. Force pushes and branch deletion are disabled. Conversation resolution is required.
The first CodeQL analysis completed with 0 alerts.
Pull Request #1 verified the protected-branch flow:
- Both workflows triggered on
pull_request. - All required checks reported success.
- The branch protection rule accepted the squash merge.
- The merged
maincommit re-ran CI and CodeQL.
The demo was verified with Playwright against the Docker container:
- AI Arena with live OpenAI critic/news.
- Leaderboard, three-section report, NewsWire, Model stack.
- Existing Strategy Deck, Backtest Lab, Hold the Position, Data Vault, Field Guide.
- No console or page errors.
DerivLab · an educational options & futures strategy emulator · docs verified against v1.2.0 on 2026-10-23 · README · Docs feedback · MIT License · Not investment advice.
Start here
- Home
- Getting Started
- Compatibility & Versions
- Feature Tour
- FAQ
- Documentation & ADRs
- Versioning
- Roadmap
Core systems
- Architecture
- Backtest Engine
- Strategy Library
- AI Agents
- AI Model Guide
- LLM Quality & Safety
- Data Pipeline
- Game Mode
Engineering
- Configuration
- Testing & CI
- Deployment
- Security
- Project Structure
- Troubleshooting
- Glossary
- Release Notes