pam ▸ docs/pam_overview_and_mirofish_assessment_2026-05-24.md
updated 2026-05-24

Pam Overview and MiroFish Assessment

Date: 2026-05-24
Repo: /Users/joshua/Projects/Unicorn.Land/pam

Executive Summary

Pam is in a technically healthy local state: the full test suite passes, the main CLI runs, the local status command can initialize and read the SQLite database, and the research status machinery reports a confident strategy gate. The main caveat is operational freshness: the research handoff says the latest state and latest scan are stale, even though candidate review itself hydrates successfully.

MiroFish is interesting as a research sandbox, but I would not integrate it directly into Pam’s live or execution paths. It is not really a small library; it is an AGPL-3.0 application stack with a Python/Flask backend, Vue frontend, OASIS/CAMEL agent simulation dependencies, Zep Cloud memory, and OpenAI-compatible LLM calls. The safest integration shape is a separately deployed, research-only service that emits structured scenario outputs into Pam’s research lab for backtesting and candidate review, never into execution without calibration and human review.

Recommendation: do not import MiroFish code into Pam. If we explore it, isolate it behind a process or service boundary, treat outputs as untrusted research features, and resolve AGPL obligations before anything commercial or hosted is exposed.

Current Pam State

Local Health Snapshot

Runtime Status

From python3 main.py status:

Important nuance: the local status output reports live trading enabled in test mode, while config.yaml.example shows live_trading.enabled: false. The active runtime config is therefore not just the example file; it comes from config.yaml, defaults, and environment overrides through runtime_config.py.

Research Status

From python3 main.py research-status:

Interpretation: the research gate can classify the current replay as confident, but the live candidate surface should not be trusted until a fresh scan runs. The system is research-ready, not fresh-trade-ready.

Architecture

Pam has five major surfaces:

  1. Signal ingestion and approval - RSS feed aggregation, content processing, translation, signal generation, Telegram approvals, and optional live-trading handling. - Main modules: core/, monitoring/, execution/, main.py.

  2. Cross-venue arbitrage - Market discovery, Kalshi/Polymarket matching, spread analysis, Kelly sizing, liquidity checks, and execution policy. - Main modules: arbitrage/, matcher/, venues/, execution/.

  3. Intra-venue arbitrage - Kalshi ladder and intra-venue relation detection, mirror/range grouping, detector tests, and daemon/alerting support. - Main modules: arbitrage/intra_venue/, arbitrage/kalshi_ladder_scanner.py, arbitrage/kalshi_ladder_daemon.py, intraarb.py.

  4. Research lab - Replay preparation, experiment search, candidate review, status hydration, continuous loop orchestration, and Ralph/Codex handoff. - Main modules: research/, docs/ralph/, docs/prds/, scripts/run_ralph_pam_research.sh.

  5. Dashboards and operations - Flask/FastAPI dashboards, background monitors, overlap watchers, catalog sync tools, deployment scripts, and ops policy. - Main modules: dashboard/, templates/, watchers/, tools/, ops/, policy/.

What Looks Solid

Gaps and Watch Items

MiroFish Research

What It Is

MiroFish describes itself as a multi-agent AI prediction engine that ingests seed material, builds a parallel digital world, simulates many agents, and returns a prediction report plus an interactive environment.

Source: MiroFish README

The repo is a full app, not a small package:

Sources:

Integration Fit With Pam

Potentially useful:

Poor fit:

Security Assessment

Risk rating for direct integration: high.

Key findings:

Sources:

License Assessment

Risk rating for direct code integration: high.

MiroFish is AGPL-3.0 licensed. Its backend also depends on camel-oasis, and issue #421 calls out the AGPL network-use implications explicitly. For Pam, the practical rule is simple: do not import, copy, or modify MiroFish/OASIS code inside Pam unless we are prepared to satisfy AGPL obligations for the combined work and any network-exposed service.

Safer alternatives:

Source: MiroFish LICENSE

Proposed Integration Shape

Recommended architecture:

Pam research lab
  -> creates scenario packet from market/news/replay context
  -> sends packet to isolated MiroFish research service
  -> receives report plus structured probabilities/rationales
  -> stores result as research artifact, not trading signal
  -> evaluates through replay/candidate review before any use

Implementation guardrails:

Suggested first experiment:

  1. Pick 20 historical eventful markets already present in Pam’s replay rows.
  2. Build minimal seed packets: market title, category, relevant news summary, current price, resolution date, and target question.
  3. Run MiroFish manually outside Pam.
  4. Convert outputs into a neutral research feature file, for example research/mirofish_experiments.jsonl.
  5. Compare predictions against realized moves using Pam’s replay harness.
  6. Only consider automation if the feature adds measurable lift over the current strategy baseline.

Bottom Line

Pam is locally test-clean and has a mature research/candidate-review layer, but it needs fresh scans before trade review is current. MiroFish is promising for offline scenario research, especially politics/public-opinion style markets, but the security, AGPL, cloud-data, and operational-complexity risks make direct integration the wrong move.

The pragmatic path is to treat MiroFish as an isolated research probe. If it proves predictive under replay, build a thin, audited adapter. If it does not produce measurable lift, keep Pam focused on its existing scanner, replay, and candidate-review loop.