The AssetFrame forecast engine: market data → analysis → AI research brief → deterministic
compiler → confidence → report → scoring → append‑only ledger → publish. It pairs with
assetframe-infra (the Next.js site + Clerk auth, Neon, R2, Lemon Squeezy). This repo
writes; the website reads.
| Repo | Owns |
|---|---|
assetframe-script (this) |
Python engine + the publish chain — generation, scoring, the ledger, and writing to R2 + Neon. |
assetframe-infra |
The website + infra — auth, billing, the DB schema (migrations), and reading R2/Neon to serve users. |
They share R2 (report files) and Neon (tables) — no shared code. The contract:
- R2 — private bucket, key format
<date>/<slug>/<file>(free/pro×html/pdf, pluspreview.png). - Neon — the engine
INSERTs, the webSELECTs:editions,open_calls,open_call_predictions,scored_results(id formatAF-YYYYMMDD-<SLUG>/report_ref). Schema migrations live inassetframe-infra; the engine only inserts data. - Enums —
scripts/taxonomy.py(confidence buckets / asset classes) is mirrored in the infra repo'sweb/lib/content.ts. Keep the two in sync.
pip install -r requirements.txt # fpdf2 (PDF), pymupdf (preview)
pip install boto3 # only for publish.py (R2 upload)
npm install # @neondatabase/serverless, for sync-db.mjs
cp .env.example .env # fill R2_*, DATABASE_URL[_DEV], EODHD/ANTHROPICpython scripts/validate_config.py # validate config/assets.json
python scripts/run_daily.py --mode dry_run # resolve today's DUE assets, write nothing
python scripts/run_daily.py --mode score_only # score closed windows + refresh memory (idempotent)
python scripts/run_daily.py --mode generate_only # generate due assetsModes: dry_run | score_only | generate_only | production (Phase 2 adds approval). Scope with
--asset <id> or --asset-class fx. Run manifests land in runs/<date>/run_manifest.json.
python scripts/export_content.py # -> content/catalog.json + content/track-record.json
python scripts/publish.py # -> uploads report files to R2
npm run sync-db # -> writes editions + track record into Neon (both branches)data/, reports/, content/, runs/ are gitignored working artifacts (regenerated each run).
The append‑only ledger/outcome_ledger.csv is the tracked source of truth.
for t in scripts/test_*.py; do python "$t"; done # bash / CIGet-ChildItem scripts\test_*.py | ForEach-Object { python $_.FullName } # PowerShellThe full report pipeline is documented in .claude/skills/mvp/SKILL.md. Decision‑support only —
not regulated financial advice; no auto‑trading; no auto‑publish (a human approval gate gates
every report before it goes live on the site).