Live
work / stonedesk
STONEDESK
Solo-built prop trading firm with 3 production agents orchestrating live multi-broker execution. Running on FundedNext, E8, and LiteFinance since 2026-05.
1 · The problem
Prop trading at scale requires more than a strategy. You need an ops layer that survives broker quirks (hedging-account OCO behavior differs from netting), withstands wine-MT5 fragility (terminals die without DISPLAY+XAUTHORITY), coordinates multiple agents without one stepping on another, and enforces kill rules that the model itself can't override. Off-the-shelf agent frameworks don't cover any of this. I built the stack from scratch.
2 · The architecture
┌─────────────────┐
│ DeskHead │ (cogito-2.1:671b)
│ playbook + │
│ daily diary │
└────────┬────────┘
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────────┐
│ QD │ │Researcher│ │ HaltActor │
│ exec │ │ defend + │ │ governance │
│ engineer │ │ extend │ │ -1.5σ kill │
└────┬─────┘ └────┬─────┘ └──────┬───────┘
│ │ │
▼ ▼ ▼
┌──────────────────────────────────────────────────┐
│ paperclip-stonedesk (fork) │
│ planexec adapter · phantom-XML strip · OpenCode │
└─────────────────────────┬────────────────────────┘
│
▼
┌──────────────────────────────────────────────────┐
│ nautilus-mt5-journal │
│ TRB strategies · OCO via TRADE_ACTION_SLTP │
└─────────────────────────┬────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ FundedNext│ │ E8 │ │LiteFinance│
│ MT5+EA │ │ MT5+EA │ │ MT5+EA │
└──────────┘ └──────────┘ └──────────┘
- 3-agent stack: DeskHead (playbook owner, daily diary), QD (live exec engineer, MT5 plumbing, 95% execution-match KPI), Researcher (defend + extend + ρ/cov + time-aware + 11-item self-validation checklist).
- paperclip-stonedesk fork with planexec adapter, phantom-XML strip defense, OpenCode local adapter patched to Ollama-only.
- HaltActor governance: state file at
/var/lib/nautilus-strategy/<book>/halt_state.json, -1.5σ kill rule, operator pause is BUSINESS only — trading halts owned by HaltActor + DeskHead. - Multi-broker execution via file-bridge EA architecture — see MT5 bridge case study.
3 · The code
Planner-executor adapter — format-json injection
// adapter forces structured output, kills XML drift
const planResponse = await ollama.chat({
model: 'cogito-2.1:671b-cloud',
format: 'json',
messages: [
{ role: 'system', content: PLANNER_FEW_SHOT },
{ role: 'user', content: task.prompt },
],
});
const plan = JSON.parse(planResponse.message.content);
// 30% XML rate → 0% under format:json + few-shot (G1 verdict 2026-06-09)
phantom-XML strip — defense layer
// strip-server/src/lib/phantom-strip.ts
const PHANTOM_TAGS = ['thinking', 'execution', 'reasoning', 'inner_monologue'];
export function stripPhantom(raw: string): { cleaned: string; stripped: Tag[] } {
const stripped: Tag[] = [];
let cleaned = raw;
for (const tag of PHANTOM_TAGS) {
const re = new RegExp(`<${tag}>[\\s\\S]*?</${tag}>`, 'gi');
if (re.test(cleaned)) {
stripped.push({ tag, reason: 'phantom-XML wrapper not in plan schema' });
cleaned = cleaned.replace(re, '');
}
}
return { cleaned, stripped };
}
HaltActor — state file pattern
# strategies/trb_london_range.py
HALT_STATE_PATH = f"/var/lib/nautilus-strategy/{book}/halt_state.json"
def is_halted():
try:
with open(HALT_STATE_PATH) as f:
return json.load(f).get("halted", False)
except FileNotFoundError:
return False
# strategy code never decides halts; HaltActor + DeskHead own it
4 · The outcome
3 brokers live
Multi-week runtime
-1.5σ kill rule shipped
60-day agent eval window
Zero broker-side outages caused by stack
- Phantom-XML defense reduced cogito-2.1 zero-tool sessions from 57.5% to 0% on G1 smoke.
- OCO TRADE_ACTION_SLTP fix eliminated naked positions on hedging brokers (STO-49 critical fixed nautilus-mt5-journal@dc46f36).
- Auto-PATCH from EVIDENCE: contract closed the "claim-without-PATCH" loop where agents narrated done without firing API calls.