- M3 hub: predictions publish continuously to Marketplace via M2 (not trader-queried) - M3 BoundedPrediction: three quality metrics (confidence, correctness, certainty) - M5 traders: read predictions from Marketplace, mixed roster (LLM + bots) - M7 SAE: monitors at Marketplace level (the only trader interface) - M6 Conductor: clarified as LLM, not rule-based - M4 wallets: one multi-chain wallet per trader, strictly 1:1 - M1 Marketplace: added query_predictions interface for traders - M3d/M3e: Fortran 2018, gfortran, fpm, OpenBLAS, hand-rolled numerics - M3b typo: "literao" -> "literal" - SessionStart hook: added gfortran, fpm, Tcl, ECLiPSe Prolog, Zig, Foundry - Stub fpm.toml for M3d (mev sims) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5.1 KiB
M7 — SAE monitor (trader surveillance)
1. Component
The economy organ's internal watchdog: a sparse autoencoder pointed at every trader tool call. Monitors all Trader (M5) actions — Marketplace submissions, Sim queries, Data Feed reads, and any other tool invocation — and reports suspicious behavior to the Conductor (M6). Messages from the SAE share identical format and signatures with Brain messages, so the Conductor processes them through the same pathway.
Extends the F2 (SAE monitor) pattern to the economy organ's internal domain. F2 watches subagents at the organism level; M7 watches traders at the stomach level.
2. Status / certainty
DESIGN-FIRST · ABSENT. F2 SAE monitor provides the architectural pattern (watch the machinery, never the homunculus — F2-L1). M7 adapts this: watch the traders (the machinery), never the Conductor (the stomach's judgment). Role C3; implementation C1.
3. Language & location
TBD · src/economy/sae/. ML interpretability (sparse autoencoder over trader action embeddings).
Shares the architectural pattern with F2 but is a separate instance scoped to the economy organ.
4. Does / does-not
- Does: intercept and log every trader action at the Marketplace level — the Marketplace is the only interface traders can act through, so monitoring it captures everything; embed trader action sequences; run SAE anomaly detection over action embeddings; flag suspicious patterns (unusual trading frequency, outsized positions, coordinated behavior across traders, repeated failed actions); report alerts to the Conductor (M6) with evidence; format alerts identically to Brain messages (same structure, same signatures).
- Does-not: block actions directly (Conductor decides); watch the Conductor (the stomach's "homunculus" — echoes F2-L1); correct trader behavior (detection only — F2-L2: no closed elimination loop); trade or access wallets.
5. Interface contract
log_action(trader_id, action_type, args, result, timestamp)— called on every trader interaction at the Marketplace level. Synchronous interception (the action is logged before execution proceeds).alert(trader_id, alert_type, evidence, severity) -> SAEAlert.alert_type∈ {unusual_frequency,outsized_position,coordinated_behavior,repeated_failures,pattern_deviation}.severity∈ {low,medium,high,critical}.SAEAlertstructure is identical to Brain message structure — same fields, same signature scheme. The Conductor (M6) processes SAE alerts and Brain messages through the same intake (M6-L5).status() -> { active, traders_monitored, alerts_pending, model_freshness }.
6. Dependencies & stubs
- M5 Traders — tool call source; stub: canned tool call log.
- M6 Conductor — alert consumer; stub: print alerts.
- F2 SAE monitor (organism-level) — architectural pattern; no runtime dependency.
7. Invariants / laws
- L1 (C5): the SAE watches traders, never the Conductor — the Conductor is the stomach's judgment; the SAE monitors the machinery. Echoes F2-L1 (watch the machinery, never the homunculus).
- L2 (C5): every tool call is logged — no trader action escapes monitoring. This is enforced architecturally (tool call interception), not by policy.
- L3 (C4): detection only, no enforcement — the SAE reports to the Conductor; it never blocks, pauses, or modifies trader actions itself. Echoes F2-L2 (no closed elimination loop).
- L4 (C4): alert format = Brain message format — structurally identical, same signatures. This is not coincidental; it ensures the Conductor can be supervised by the Brain using the same protocol if the organism ever needs to override stomach autonomy.
- L5 (C3): the SAE model is trained on normal trader behavior — anomalies are deviations from the learned normal, not violations of predefined rules (those are the law script's job in M1).
8. Build steps
- Implement action interception at the Marketplace level (M1).
- Define the action embedding scheme (how tool calls are vectorized).
- Train the SAE on normal trader behavior (bootstrapped from simulated trading).
- Implement anomaly scoring and alert threshold.
- Wire alerts to Conductor (M6) in Brain-compatible message format.
9. Tests
Interception: every Marketplace action produces a log entry. Anomaly: known-suspicious patterns (e.g. 100x normal frequency) trigger alert. Normal: baseline behavior does not trigger alert. No enforcement: SAE cannot pause or block a trader (only Conductor can). Alert format: SAE alert parses as valid Brain message. Conductor-blind: no Conductor action appears in SAE logs.
10. Open items
- SAE architecture (how many features? reconstruction vs. classification?).
- Training data bootstrapping (simulated trading or historical data?).
- Alert threshold tuning (too sensitive = alert fatigue; too lax = missed anomalies).
- Whether M7 should also monitor Marketplace execution outcomes (fills, slippage) in addition to tool calls.
- Relationship to F2: shared model? shared training pipeline? or fully independent?