Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .codex-code-quality.json

This file was deleted.

11 changes: 9 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ PORT=3000
# =============================================================================
OPS_API_ENABLED=true
OPS_API_HOST=0.0.0.0
# Required for npm run dev:ops and authenticated /ops/* routes.
OPS_API_TOKEN=
# Dev-only: when true, GET /ops/session?prefill=1 can return OPS_API_TOKEN to localhost clients.
OPS_DEV_SESSION_PREFILL_ENABLED=false
OPS_ALERT_WEBHOOK_URL=
OPS_HEALTH_INTERVAL_MS=30000
OPS_SHUTDOWN_TIMEOUT_MS=30000
Expand Down Expand Up @@ -65,7 +68,6 @@ RISK_PROFILE_PATH=
RISK_PROFILE_ACTIVE_PATH=
MAX_CONCURRENT_MARKETS=3
MAX_CAPITAL_IN_FLIGHT=1000
PHASE2_CROSS_VENUE_ENABLED=false

# =============================================================================
# EV web search (direct API)
Expand All @@ -89,6 +91,11 @@ EV_WEBSEARCH_MAX_CONTENT_BYTES=500000
# Comma or whitespace separated domain list (optional)
EV_WEBSEARCH_DOMAIN_ALLOWLIST=
EV_WEBSEARCH_DOMAIN_DENYLIST=
FW_ORACLE_BASE_URL=http://127.0.0.1:7071
FW_ORACLE_TIMEOUT_MS=120
FW_ORACLE_API_KEY=
FW_ORACLE_CIRCUIT_FAILURE_THRESHOLD=3
FW_ORACLE_CIRCUIT_COOLDOWN_MS=30000

# =============================================================================
# LLM (strictly-advisory)
Expand Down Expand Up @@ -229,7 +236,7 @@ POLYMARKET_POSITIONS_LIMIT=200
POLYMARKET_POSITIONS_OFFSET=0

# =============================================================================
# Phase 2 (Kalshi)
# Kalshi (optional)
# =============================================================================
KALSHI_API_KEY_ID=
KALSHI_PRIVATE_KEY_PEM=
Expand Down
17 changes: 17 additions & 0 deletions .github/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# GitHub Workflows

## Scope
Applies to `.github/`.

## Responsibilities
- CI/CD workflow definitions and automation policy.
- Deterministic quality-gate execution for pull requests and pushes.

## Rules
- Keep workflow steps aligned with local gates: `lint`, `typecheck`, `build`, `test`, `test:coverage`.
- Prefer repository npm scripts over duplicated inline shell logic.
- Never hardcode secrets; use GitHub Actions secrets and env wiring.

## Validation
- Confirm workflow syntax remains valid after edits.
- Verify workflow command names match `package.json` scripts.
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
node_modules/
dashboard/node_modules_stale*/
dist/
coverage/
coverage*/
playwright-report/
test-results/
**/playwright-report*/
**/test-results*/
.vite/
.claude/
.DS_Store
*.log
*.sqlite
*.sqlite.*
*.sqlite-*
*.db
*.db.*
*.db-*
.env
.env.*
!.env.example
Expand All @@ -23,9 +28,13 @@ data/market-catalog.json
# Local artifacts
tmp/
data/*.bak-*
data/*.db.bak
data/*.db-journal
services/ip-oracle/.venv/
services/ip-oracle/.venv*/
services/ip-oracle/__pycache__/
services/ip-oracle/.pytest_cache/

# Agent continuity ledgers (kept local, never committed)
CONTINUITY.md
continuity.md
sub_continuity.md
sub-continuity.md
24 changes: 16 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ Thank you for your interest in contributing to OpenPolyTrader! This document pro
3. **Set up environment:**
```bash
cp .env.example .env
# Edit .env with your settings (see docs/Development/setup.md)
# Set OPS_API_TOKEN in .env for npm run dev:ops and /ops/* auth
# See docs/Development/setup.md for full setup details
```

4. **Verify setup:**
4. **View the root command/tool/flag index:**
```bash
npm run help
```

5. **Verify setup:**
```bash
npm run typecheck
npm run lint
Expand All @@ -68,7 +74,7 @@ Thank you for your interest in contributing to OpenPolyTrader! This document pro
### Development Modes

- **Backend only:** `npm run dev`
- **Backend + Dashboard:** `npm run dev:ops`
- **Backend + Dashboard:** `npm run dev:ops` (requires `OPS_API_TOKEN`)
- **Docker mode:** `npm run dev:live`

See [docs/Development/setup.md](docs/Development/setup.md) for detailed setup instructions.
Expand All @@ -80,12 +86,14 @@ See [docs/Development/setup.md](docs/Development/setup.md) for detailed setup in
```
openpolytrader/
├── src/
│ ├── agents/ # Trading agents (8 agents)
│ ├── agents/ # Trading agents (9 specialized agents)
│ │ ├── dependency/ # Dependency extraction helpers
│ │ ├── execution/ # Order execution logic
│ │ ├── learning/ # RL model integration
│ │ ├── market-data/ # WebSocket data handling
│ │ ├── ops/ # Operations and health
│ │ ├── portfolio/ # Position management
│ │ ├── projection/ # Frank-Wolfe projection agent
│ │ ├── risk/ # Risk evaluation
│ │ ├── scanner/ # Opportunity detection
│ │ └── signal/ # Signal aggregation
Expand All @@ -100,9 +108,9 @@ openpolytrader/
│ ├── db/ # SQLite migrations
│ └── main.ts # Entry point
├── dashboard/ # React/Vite ops dashboard
├── tests/ # Vitest unit + integration tests
├── tests/ # Vitest suites + fixtures
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ ├── integration/ # Reserved integration suites (currently empty)
│ └── fixtures/ # Test fixtures
├── docs/ # Documentation
│ ├── ARCHITECTURE.md
Expand Down Expand Up @@ -223,8 +231,8 @@ npm run test:coverage
- Mock external dependencies with `vi.mock()`
- Fast, deterministic execution

2. **Integration Tests** (`tests/integration/*.test.ts`)
- Test multi-component flows
2. **Integration Suites** (`tests/integration/*.test.ts`, when present)
- Reserved for targeted multi-component flows that need dedicated isolation
- Use real internal systems (don't mock unless justified)
- Isolate external integrations (Polymarket, RPC)

Expand Down
Loading