Clear is a local-first portfolio, analytics, and OSINT platform with shared CLI, API, and web surfaces. It combines client/account data, deterministic financial calculations, global tracker feeds, news/intel summaries, and an immersive globe foundation that is now gated by the repo's standards plan.
git clone git@github.com:denv3rr/clear.git --depth 1
cd clear
python clearctl.py start
python clearctl.py stop- Stores client, account, holding, and lot data in SQLite, with JSON kept for import/export.
- Exposes the same analytics through the CLI, FastAPI routes, and the web UI.
- Runs OSINT workflows for trackers, news, and regional intel.
- Supports reports and exports with shared view-models and provenance metadata.
- Builds toward a globe-first presentation layer, but only behind the active standards gate.
Clear now treats standards compliance as a delivery gate, not a cleanup task.
- docs/us_gov_standards.md: mandatory repo baseline for data integrity, fail-safe behavior, accessibility, and performance.
- docs/standards_remediation_plan.md: active remediation phases that must stay green before the next major visual expansion.
- docs/visual_modernization_plan.md: globe-first product direction, explicitly gated by the remediation plan.
- Core runtime: Python, FastAPI, SQLAlchemy, Pandas, NumPy, Rich
- Web app: React, TypeScript, Vite, Tailwind
- Visualization: Three.js, React Three Fiber, MapLibre, Leaflet fallback, Plotly, Recharts
- Testing: pytest, Playwright
Copy .env.example to .env. The most common variables are below.
| Variable | Purpose |
|---|---|
CLEAR_WEB_API_KEY |
Enables API key auth for the web/API stack. |
FINNHUB_API_KEY |
Optional market symbol and quote lookups. |
OPENSKY_CLIENT_ID |
OpenSky OAuth client id for flight feeds. |
OPENSKY_CLIENT_SECRET |
OpenSky OAuth client secret for flight feeds. |
SHIPPING_DATA_URL |
Optional vessel/shipping feed endpoint. |
CLEAR_INCLUDE_COMMERCIAL |
Include commercial flights when set to 1. |
CLEAR_INCLUDE_PRIVATE |
Include private flights when set to 1. |
Notes:
- OpenSky is the only flight feed path right now.
- When
CLEAR_WEB_API_KEYis set, the launcher forwards it to the web UI asVITE_API_KEYfor local auth. - Additional tracker/feed flags and OSINT notes live in docs/osint.md.
python clearctl.py start
python clearctl.py status
python clearctl.py stoppython clearctl.py web
python clearctl.py cli
python clearctl.py doctorpython -m pytestcd web
npx playwright testBrowser-test policy:
- Positive-path browser tests must use the real local stack or captured real fixtures with provenance.
- Demo/mock/synthetic positive-path browser data is not allowed.
| Source | Purpose |
|---|---|
| Finnhub | Optional symbol/quote lookups |
| Yahoo Finance | Historical pricing and macro snapshots |
| OpenSky | Flight tracking |
| Open-Meteo | Weather context for intel/reporting |
| GDELT | Conflict/news signal input |
| RSS feeds | Cached headlines for market and OSINT workflows |
The core deterministic formulas are implemented in modules/client_mgr/calculations.py.
| Metric | Formula used in code | Notes | Source |
|---|---|---|---|
| Annualization factor | A = seconds_per_year / mean(delta_t) or 252 fallback |
Uses timestamp spacing when available. | calculations.py |
| Mean annual return | mean(r) * A |
Used in core and risk metrics. | calculations.py |
| Annualized volatility | std(r, ddof=1) * sqrt(A) |
Sample standard deviation. | Investor.gov Sharpe ratio overview |
| Sharpe ratio | ((mean(r) - r_f / A) / std(r)) * sqrt(A) |
Lightweight summary paths may use r_f = 0. |
Investor.gov Sharpe ratio overview |
| Beta | cov(r_p, r_m) / var(r_m) |
Uses aligned return series. | Sharpe 1964 CAPM paper |
| Max drawdown | min((V_t - peak(V_t)) / peak(V_t)) |
Computed from cumulative returns. | calculations.py |
| Historical VaR / CVaR | quantile(r, 1-q) and mean(r <= VaR_q) |
Empirical tail metrics. | Investor.gov VaR bulletin |
| EWMA volatility | var_t = lambda * var_{t-1} + (1-lambda) * r_t^2 |
lambda defaults to 0.94. |
1996 RiskMetrics Technical Document |
Additional deterministic methods in the same module include Black-Scholes, Shannon entropy, permutation entropy, Hurst exponent, FFT spectrum, CUSUM change points, motif similarity, and CAPM-derived metrics. Their validation lives in the Python test suite rather than in the README.
| Doc | Purpose |
|---|---|
| docs/README.md | Full docs index |
| docs/agent_git_standards.md | Branch, commit, merge, push, and sensitive-file rules for agents |
| docs/us_gov_standards.md | Mandatory standards baseline |
| docs/standards_remediation_plan.md | Active standards gate and phase plan |
| docs/visual_modernization_plan.md | Globe-first UX roadmap |
| docs/osint.md | OSINT workspace and feed notes |
| docs/assistant_usage.md | Assistant usage across CLI/API/web |
| docs/launchers.md | Startup and shutdown behavior |
- NIST SP 800-218, SSDF v1.1: https://csrc.nist.gov/pubs/sp/800/218/final
- NIST SP 800-53 Rev. 5: https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
- NIST SP 800-160 Vol. 1 Rev. 1: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-160v1r1.pdf
- NIST AI RMF 1.0: https://www.nist.gov/itl/ai-risk-management-framework
- Revised Section 508 Standards: https://www.access-board.gov/ict/
- MIL-STD-882E: https://quicksearch.dla.mil/qsDocDetails.aspx?ident_number=36027
- SEC simple-return example: https://www.sec.gov/Archives/edgar/data/0000895421/000089542108000533/texassteel8kex991.htm
- Investor.gov Sharpe ratio: https://www.investor.gov/introduction-investing/investing-basics/terms-and-definitions/sharpe-ratio
- Investor.gov VaR bulletin: https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins/understanding-value-risk
- U.S. DOJ HHI overview: https://www.justice.gov/atr/herfindahl-hirschman-index
- NIST/SEMATECH CUSUM reference: https://www.itl.nist.gov/div898/handbook/pmc/section3/pmc323.htm
- CAPM reference: https://doi.org/10.2307/2977928
- Permutation entropy reference: https://doi.org/10.1103/PhysRevLett.88.174102
- Hurst exponent reference: https://doi.org/10.1098/rspa.1951.0001
- Basel expected shortfall background: https://www.bis.org/publ/bcbs265.pdf
- Finnhub: https://finnhub.io/
- Yahoo Finance: https://finance.yahoo.com/
- OpenSky: https://opensky-network.org/about
- Open-Meteo: https://open-meteo.com/
- GDELT: https://www.gdeltproject.org/
- FRED: https://fred.stlouisfed.org/
- U.S. Treasury rates data: https://home.treasury.gov/resource-center/data-chart-center/interest-rates
- CFTC education: https://www.cftc.gov/LearnAndProtect
- CNBC: https://www.cnbc.com/
- MarketWatch: https://www.marketwatch.com/
- BBC Business: https://www.bbc.com/business
This project is for informational and operational analysis use. It does not provide financial, legal, or tax advice, and no content here should be treated as an offer to buy or sell securities.