Add 永期半自动: human arm, machine open/close, then stop.

Settings toggle, Plan panel, Fleet monitor, exit locks and armed TOCTOU gates; docs and dual audits.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-08 11:20:11 +08:00
parent bf3441537e
commit 4585dba3c3
22 changed files with 1147 additions and 44 deletions
+9
View File
@@ -47,6 +47,15 @@ async def lifespan(app: FastAPI):
settings = load_runtime_settings()
engine = StrategyEngine()
set_engine(engine)
# 半自动:无仓时清陈旧授权,须首页重新「授权开下一单」
try:
from .strategy.semi_auto import clear_armed_if_flat
clear_armed_if_flat(
db, has_open_position=engine.matcher.has_open_position()
)
except Exception:
logger.exception("clear stale semi_armed on startup failed")
# LIVE:进程启动后不自动真下单,须人工点「启动」
if not get_settings().is_sim:
try: