Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
39843b4
ui: numbers are formatted the same on every machine; the wallet test …
SenseiIssei Nov 25, 2026
2244b5c
ui: a page is loaded when it is first opened instead of all 33 at the…
SenseiIssei Nov 25, 2026
994e103
deps: npm up to date: vite 8, plugin-react 6, typescript 7, lucide-re…
SenseiIssei Nov 25, 2026
3008e61
app: with limits=wallet the panels show the caps in force instead of …
SenseiIssei Nov 25, 2026
2362da5
deps: cargo update; cargo audit 5 vulnerabilities to 0 (cookie, crypt…
SenseiIssei Nov 25, 2026
f945e25
cli: pythia kill on|off; kill on never asks and never switches an eng…
SenseiIssei Nov 25, 2026
2ed4227
server: the port is bound before anything else, so a second server on…
SenseiIssei Nov 25, 2026
abd1718
desktop: a second start shows the running window instead of a second …
SenseiIssei Nov 25, 2026
4133c28
ci: the UI (types, tests, also in German, build) on every push, the R…
SenseiIssei Nov 25, 2026
9587d57
docs: what the code does today: SAFETY names the full mode's caps, th…
SenseiIssei Nov 25, 2026
0955229
ui: the browser demo says its prices are made up (Home, the welcome t…
SenseiIssei Nov 25, 2026
bee3acc
plan: where Pythia stands after the audit of 2026-11-25, an honest co…
SenseiIssei Nov 25, 2026
418899a
server: the stop does not wait for a long validation run; plan: the i…
SenseiIssei Nov 25, 2026
3c2e382
docs: the lab needs Linux or macOS, its tests do not load on Windows …
SenseiIssei Nov 25, 2026
45f7ee8
ci: the Linux tests get a throwaway keychain; two tests go through th…
SenseiIssei Nov 25, 2026
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
16 changes: 11 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# this file; it stores keys in the OS keychain (Settings → Alpaca / AI providers).
# NEVER paste real keys into .env.example, screenshots, or chat.

# ── Keep what it did ──────────────────────────────────────────────────────────
# Where the server saves positions, autopilots and the paper record (every
# minute and when it stops). Without it they are gone when the server stops.
PYTHIA_STATE_FILE=state.json

# ── server ───────────────────────────────────────────────────────────────────
# The API has no login of its own: keep it on 127.0.0.1 (the default) and put an
# authenticating reverse proxy in front if it must be reached from elsewhere.
Expand Down Expand Up @@ -52,8 +57,9 @@ APCA_FEED=iex

# ── Crypto exchange (live spot execution) ─────────────────────────────────────
# One exchange at a time — this is where Venue::Crypto routes.
# kraken | binance | bybit | okx (coinbase is listed but not wired: it
# signs with ES256 JWTs, see PROFIT-PLAN.md)
# kraken | binance | bybit | okx | coinbase
# (coinbase: the key name as the key, the EC private key in PEM form as the
# secret; see SAFETY.md 3b)
# Grant the API key TRADE permission and NOT withdrawal. Then a leaked key costs
# you trades, not coins.
# PYTHIA_EXCHANGE=kraken
Expand Down Expand Up @@ -91,7 +97,7 @@ APCA_FEED=iex
# PYTHIA_FORECAST_SWEEP_MIN=60
# PYTHIA_FORECAST_SWEEP_MARKETS=3
# Per-provider model override for ensemble runs, e.g.:
# PYTHIA_MODEL_ANTHROPIC=claude-sonnet-5
# PYTHIA_MODEL_ANTHROPIC=claude-sonnet-5-5

# ── strategy data & execution ─────────────────────────────────────────────────
# Candle size every indicator runs on. 1Min / 5Min / 15Min / 30Min / 1Hour / 1Day.
Expand All @@ -116,9 +122,9 @@ PYTHIA_SLIPPAGE_BPS=25

# ── AI overlay (background model views; OFF until you enable it in the UI) ─────
# Which provider/model the background overlay polls with. Defaults to Anthropic
# and that provider's current flagship (claude-opus-5).
# and that provider's cheap routine model (claude-haiku-5-5).
# PYTHIA_AI_PROVIDER=anthropic
# PYTHIA_AI_MODEL=claude-opus-5
# PYTHIA_AI_MODEL=claude-haiku-5-5
# Thinking depth: low | medium | high | xhigh | max. `low` is the default because
# a signal that arrives after its bar closed is worth nothing.
# PYTHIA_AI_EFFORT=low
Expand Down
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# One grouped pull request per ecosystem and month, plus GitHub's security
# updates. research/ is left to the lab.
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule: { interval: monthly }
open-pull-requests-limit: 2
groups:
rust: { patterns: ["*"], update-types: [minor, patch] }
ignore:
# Comes in through Tauri's GTK 3 stack, which pins 0.18. Nothing here can
# raise it (the security update fails with "security_update_not_possible").
- dependency-name: glib
- package-ecosystem: npm
directory: /
schedule: { interval: monthly }
open-pull-requests-limit: 2
groups:
npm: { patterns: ["*"], update-types: [minor, patch] }
- package-ecosystem: github-actions
directory: /
schedule: { interval: monthly }
groups:
actions: { patterns: ["*"] }
30 changes: 30 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Known vulnerabilities in what we ship: after a lockfile change and once a week.
# Warnings (unmaintained crates) do not fail; the known ones are listed in
# SECURITY.md.
name: Audit

on:
push:
branches: [main]
paths: ["Cargo.lock", "package-lock.json", ".github/workflows/audit.yml"]
schedule:
- cron: "23 5 * * 1"
workflow_dispatch:

permissions:
contents: read

jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: taiki-e/install-action@v2
with:
tool: cargo-audit
- run: cargo audit
- uses: actions/setup-node@v7
with:
node-version: lts/*
- run: npm audit --audit-level=high
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: Release page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
with:
ref: ${{ env.TAG }}
- name: Create the release if it does not exist yet
Expand Down Expand Up @@ -70,15 +70,15 @@ jobs:
out: target/release/bundle/appimage/*.AppImage target/release/bundle/deb/*.deb target/release/bundle/rpm/*.rpm
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
with:
ref: ${{ env.TAG }}
- name: Linux build dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev patchelf pkg-config
- uses: actions/setup-node@v5
- uses: actions/setup-node@v7
with:
node-version: lts/*
cache: npm
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
with:
ref: ${{ env.TAG }}
- name: Linux build dependencies
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# The engine, the server, the command line and the desktop app.
name: Rust

on:
push:
branches: [main]
paths:
- "crates/**"
- "server/**"
- "cli/**"
- "src-tauri/**"
- "config/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/rust.yml"
pull_request:
paths:
- "crates/**"
- "server/**"
- "cli/**"
- "src-tauri/**"
- "config/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/rust.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: rust-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Tests (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- { name: Linux, os: ubuntu-22.04 }
- { name: Windows, os: windows-latest }
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- name: Linux build dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev patchelf pkg-config gnome-keyring
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# The desktop crate embeds the UI folder at build time; an empty one will do here.
- run: mkdir -p dist
shell: bash
- name: Tests
if: runner.os != 'Linux'
run: cargo test --workspace --locked
# Two tests go through the real keychain; a runner has none until one is unlocked.
- name: Tests, with a throwaway keychain
if: runner.os == 'Linux'
run: |
dbus-run-session -- bash -euo pipefail -c '
printf "%s" throwaway | gnome-keyring-daemon --unlock --components=secrets >/dev/null
cargo test --workspace --locked
'

msrv:
name: Oldest supported Rust
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config
- id: msrv
run: echo "rust=$(sed -n 's/^rust-version = "\(.*\)"/\1/p' server/Cargo.toml)" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.rust }}
- uses: Swatinem/rust-cache@v2
with:
key: msrv
- run: cargo check --locked -p pythia-server -p pythia-cli
37 changes: 37 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# The UI: types, tests and the production build. Runs on every push, because
# the Research page bundles research/lab/results and a result file can break it.
name: Web

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: web-${{ github.ref }}
cancel-in-progress: true

jobs:
web:
name: Types, tests, build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: lts/*
cache: npm
- run: npm ci --no-audit --no-fund
- run: npx tsc --noEmit
- run: npx vitest run
- name: Tests again on a German machine in another time zone
run: npx vitest run
env:
LC_ALL: de_DE.UTF-8
TZ: Asia/Tokyo
- run: npm run build
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,50 @@
All notable changes to Pythia. Versions follow [Semantic Versioning](https://semver.org); while the
major version is 0, a minor release may change behaviour.

## Unreleased

### Fixed

- A second start of the desktop app shows the running window. It used to start a second engine on the
same keys and the same state file.
- Quit in the tray, Ctrl+C and `docker stop` save the state. Up to a minute of fills and paper record
was lost each time. A server without `PYTHIA_STATE_FILE` says so at the start.
- The server takes its port before it reads the state or ticks, so a second one ends before it trades.
- The desktop app never saves over a state file it could not read and could not move aside, and tells
you when it starts fresh.
- With `limits=wallet` the app showed "none" for the daily loss limit and the total budget; it shows the
caps the code enforces.
- Numbers look the same on every machine (a German Windows mixed `1.234` with `$1,234`).
- `pythia kill --yes` twice released the kill switch. `pythia kill on` only ever engages it.
- Kraken limit prices follow the pair's price grid and lot size; the Alpaca broker status is read from
the paper endpoint unless Alpaca itself is armed live.
- Real-money caps of both server wallets that no file can lift (2 SOL, 0.5 SOL a day, 0.25 SOL a trade;
the on-chain caps in `SAFETY.md` 3b-2).

### Added

- A capped live test: one autopilot on at most 300 USD of real money without a green passport (§3f).
- pump.fun live page, a Wallet page for the on-chain trader, Trends, News, Lab Live and Progress pages,
a Real money page that keeps real and practice money apart.
- `pythia kill on` and `pythia kill off`; `pythia watch` survives an engine restart.
- `crash.log` in the app data folder after a crash of the desktop app. It stays on the machine.
- `npm run bench:ui`: startup and idle cost of the UI.
- CI on every push: UI tests and build, Rust tests on Linux and Windows, the oldest supported Rust, a
weekly audit.

### Faster

- Pages load when they are opened: the first script 1,159 kB to 495 kB, the DOM 5,850 to 350 nodes.
Ten idle seconds cost 45 to 145 ms of main-thread time instead of 811 to 1,070 ms (headless, CPU
slowed four times).
- The engine fetches its quotes together. A slow venue holds a tick for 5 s at most instead of 15 s.
- The server writes its state for the stream only while someone listens.

### Changed

- Building needs Rust 1.90 (the Tauri crates ask for it). Every dependency is up to date; `npm audit` and
`cargo audit` report no vulnerability.

## 0.5.1 (2026-10-21)

- Installers for Windows (setup .exe), macOS (universal .dmg) and Linux (.AppImage, .deb, .rpm),
Expand Down
Loading