Infra-bot generates grounded public market-intelligence memos from Musashi's truth layer.
It reads directly from the Musashi Supabase/Postgres truth layer and produces:
- deterministic source packets
- a strict gated publish packet
- a flagship daily memo in Markdown + JSON + PDF
- optional deep case-study memos only when an event cluster clears the publish gate
Outputs are deterministic Markdown + JSON files under outputs/.
This repo is not a trading bot.
It is a content/report automation layer that sits on top of Musashi infra and answers questions like:
- what did Kalshi reprice the most in politics / macro / crypto?
- what does Kalshi imply about AI / crypto / Fed / elections right now?
- how did one event cluster move over time?
- what do resolved markets suggest about trustworthiness by category / liquidity?
Infra-bot v2 is a three-stage pipeline:
- Deterministic source packets
movers_packetsector_packetmarket_structure_packetcase_study_packet
- Strict publish gating
- suppresses thin/noisy sections
- omits sectors that do not clear minimum thresholds
- blocks weak case studies
- Narrative synthesis
- uses validated publish packets only
- keeps numerically sensitive section bullets deterministic
- uses the LLM only for constrained framing/title/summary
- Copy
.env.exampleto.env - Fill in the DB credentials for the Musashi Supabase pooler connection
- Install dependencies
npm install
npm run checkGenerate the deterministic daily packet set:
npm run generate:dailyGenerate one online flagship daily memo directly from live deterministic packets:
npm run generate:deep-dailyGenerate one flagship daily memo from already-written JSON packets:
npm run generate:deep-daily-from-cache -- --date 2026-05-13Generate one deep case-study memo. This command fails if the cluster does not clear the case-study gate:
npm run generate:deep-case-study -- --event-id YOUR_EVENT_IDExport every Markdown artifact for a given day to PDF:
npm run export:daily-pdfs -- --date 2026-05-13Generate only movers:
npm run generate:moversGenerate a sector snapshot:
npm run generate:sector -- --sector cryptoGenerate a deterministic case-study source packet:
npm run generate:case-study -- --event-id FED-SEP-2025Generate market-structure / trust analysis:
npm run generate:market-structureEach command writes both:
- Markdown
- JSON
to date-scoped folders under outputs/.
The flagship public artifact is:
deep-daily-YYYY-MM-DD.mddeep-daily-YYYY-MM-DD.jsonpdf/deep-daily-YYYY-MM-DD.pdf
Supporting packet files are internal/source artifacts and are kept primarily for validation, reuse, and debugging.
The GitHub workflow in .github/workflows/generate-content.yml runs the daily pack on schedule and uploads outputs as an artifact.
This workflow needs these repo secrets:
SUPABASE_DB_HOSTSUPABASE_DB_PORTSUPABASE_DB_NAMESUPABASE_DB_USERSUPABASE_DB_PASSWORD
For the LLM-backed memo path, set:
LLM_PROVIDER=deepseekDEEPSEEK_API_KEY- optionally
DEEPSEEK_BASE_URL - optionally
DEEPSEEK_MODEL
The scheduled workflow now:
- generates deterministic source packets
- synthesizes the flagship memo from cached packets
- exports Markdown artifacts for that day to PDF
The system is intentionally split so that:
- raw numbers come from Musashi truth-layer data
- the publish gate decides what is strong enough to surface
- deterministic bullets carry numerically sensitive facts
- the LLM only writes constrained framing on top of validated facts
The daily memo is therefore a market-implied intelligence product, not a claim of external-world causal certainty.