Files
momentum-system/docs/ideation/momentum-architecture-current.drawio
T
momentum devandClaude Fable 5 653f13a7d9 milestone 2026-07: plans 001-007 + ideation artifacts + architecture diagrams
Recon (8 clusters) -> ideation (48->14->7, all verified) -> plans, cold-read
verified by 8 fresh-context reviewers, 33 plan defects fixed pre-execution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 16:28:07 -04:00

143 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="drawio" version="26.0.0">
<diagram name="Current architecture">
<mxGraphModel dx="1420" dy="900" grid="1" gridSize="10" page="1" pageWidth="1460" pageHeight="920">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" value="Momentum — current production architecture (TrueNAS compose, 2026-07 @ d54a2a9)" style="text;html=1;fontSize=18;fontStyle=1;align=left;" vertex="1" parent="1">
<mxGeometry x="40" y="0" width="900" height="30" as="geometry" />
</mxCell>
<mxCell id="browser" value="Operator browser" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="60" y="60" width="180" height="60" as="geometry" />
</mxCell>
<mxCell id="telegram" value="Telegram" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="300" y="60" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="feeds" value="Data feeds&#xa;Alpaca news &#183; RSS &#183; FMP float &#183; SEC EDGAR" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="700" y="60" width="240" height="60" as="geometry" />
</mxCell>
<mxCell id="alpaca" value="Alpaca Paper API&#xa;orders &#183; account &#183; SIP bars/quotes" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
<mxGeometry x="1040" y="60" width="240" height="60" as="geometry" />
</mxCell>
<mxCell id="compose" value="TrueNAS SCALE &#8212; Docker Compose stack (image: fez5587/momentum-app)" style="swimlane;startSize=30;html=1;fillColor=none;strokeColor=#666666;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="40" y="180" width="1340" height="580" as="geometry" />
</mxCell>
<mxCell id="dashboard" value="Dashboard :8765&#xa;static JS + SSE&#xa;(read-only projections)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="compose">
<mxGeometry x="30" y="60" width="210" height="80" as="geometry" />
</mxCell>
<mxCell id="admin" value="Admin :8767&#xa;config overrides &#183; profiles&#xa;service control" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="compose">
<mxGeometry x="30" y="170" width="210" height="80" as="geometry" />
</mxCell>
<mxCell id="qabot" value="Telegram qabot&#xa;status Q&amp;A (read-only)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="compose">
<mxGeometry x="30" y="280" width="210" height="80" as="geometry" />
</mxCell>
<mxCell id="pg" value="PostgreSQL 18&#xa;events (append-only)&#xa;minute_bars (~19M) &#183; research tables" style="shape=cylinder3;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;boundedLbl=1;" vertex="1" parent="compose">
<mxGeometry x="480" y="160" width="240" height="130" as="geometry" />
</mxCell>
<mxCell id="nightly" value="Nightly scheduler&#xa;premarket_eval 20:00 ET&#xa;retention &#183; shadow tracks &#183; caches" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="compose">
<mxGeometry x="480" y="380" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="loop" value="Trading loop &#8212; run_live_paper.py" style="swimlane;startSize=30;html=1;fillColor=#f8f8f8;strokeColor=#6c8ebf;fontStyle=1;" vertex="1" parent="compose">
<mxGeometry x="810" y="50" width="490" height="350" as="geometry" />
</mxCell>
<mxCell id="schedthread" value="Scheduler thread&#xa;discover &#183; ingest &#183; watch &#183; arm &#183; guard" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="loop">
<mxGeometry x="20" y="40" width="210" height="70" as="geometry" />
</mxCell>
<mxCell id="trigthread" value="Trigger thread (4s)&#xa;live cross &#8594; submit_breakout_now" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="loop">
<mxGeometry x="260" y="40" width="210" height="70" as="geometry" />
</mxCell>
<mxCell id="exitmgr" value="LiveExitManager (12s)&#xa;BE ratchet &#183; trail &#183; EOD flatten" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="loop">
<mxGeometry x="20" y="140" width="210" height="70" as="geometry" />
</mxCell>
<mxCell id="execsvc" value="TradingExecutionService&#xa;gates &#183; sizing &#183; bracket orders" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="loop">
<mxGeometry x="260" y="140" width="210" height="70" as="geometry" />
</mxCell>
<mxCell id="syncsvc" value="AlpacaPaperSync (60s)&#xa;account &#183; positions &#183; orders &#183; journal" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="loop">
<mxGeometry x="140" y="250" width="210" height="70" as="geometry" />
</mxCell>
<mxCell id="e1" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="browser" target="dashboard">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e2" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.1;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="browser" target="admin">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="50" y="390" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="e3" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="telegram" target="qabot">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="380" y="500" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="e4" value="projections (read)" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="dashboard" target="pg">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e5" value="reads" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="qabot" target="pg">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e6" value="events &#183; bars" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="loop" target="pg">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e7" value="writes &#183; purges" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="nightly" target="pg">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e8" value="REST: bars &#183; quotes &#183; orders &#183; fills" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="alpaca" target="loop">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e9" value="ingest" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.1;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="feeds" target="loop">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" x="-10" y="0" />
</mxGeometry>
</mxCell>
<mxCell id="e10" value="overrides.env &#183; restart (docker sock)" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;labelBackgroundColor=#ffffff;fontSize=11;exitX=1;exitY=0.9;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="admin" target="loop">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="460" y="690" />
<mxPoint x="1100" y="690" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="legend" value="Legend" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#666666;verticalAlign=top;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="60" y="790" width="200" height="120" as="geometry" />
</mxCell>
<mxCell id="leg1" value="" style="rounded=0;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="legend">
<mxGeometry x="10" y="26" width="30" height="14" as="geometry" />
</mxCell>
<mxCell id="leg1t" value="Service / thread" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;" vertex="1" parent="legend">
<mxGeometry x="50" y="24" width="140" height="18" as="geometry" />
</mxCell>
<mxCell id="leg2" value="" style="rounded=0;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="legend">
<mxGeometry x="10" y="48" width="30" height="14" as="geometry" />
</mxCell>
<mxCell id="leg2t" value="Datastore" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;" vertex="1" parent="legend">
<mxGeometry x="50" y="46" width="140" height="18" as="geometry" />
</mxCell>
<mxCell id="leg3" value="" style="rounded=0;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="legend">
<mxGeometry x="10" y="70" width="30" height="14" as="geometry" />
</mxCell>
<mxCell id="leg3t" value="Scheduled job" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;" vertex="1" parent="legend">
<mxGeometry x="50" y="68" width="140" height="18" as="geometry" />
</mxCell>
<mxCell id="leg4" value="" style="rounded=0;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="legend">
<mxGeometry x="10" y="92" width="30" height="14" as="geometry" />
</mxCell>
<mxCell id="leg4t" value="Broker API (money path)" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;" vertex="1" parent="legend">
<mxGeometry x="50" y="90" width="140" height="18" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>