# Sigil Trading Bot — Context Server (Run 2026-05-07T18-58-46)

**Status:** Hive-mind COMPLETE — final design available
**Project:** /projects/apps/internal/sigil

## Key Files

- `final-design.md` — **START HERE** — complete verified design with all implementer corrections
- `reconciliation.md` — cross-model convergence analysis (10 architects)
- `discovery.md` — problem statement, current P&L data, root cause analysis
- `prior-art.md` — May 2 six-layer design (reference)
- `collated-pre-seed.md` — security/robustness/ops pre-seed insights
- `data-snapshot/` — live paper trading CSVs and DB stats (as of 2026-05-07)
- `src/` — sanitized Python source (core bot logic)
- `config/` — sanitized YAML configs
- `grid-overlays/` — variant posture overlays
- `migrations/` — recent SQL schema migrations (up to 013)
- `docs/HLD.md` — high-level architecture

## Current Paper Trading (2026-05-07)

| Variant | Trades | atr_trail | hard_stop | Net P&L | Balance |
|---------|--------|-----------|-----------|---------|---------|
| baseline | 27 closed | 78% / +$9.50 | 22% / -$22.18 | -$12.68 | $987.32 |
| moderate | 83 closed | 87% / +$22.23 | 10% / -$28.64 | -$7.22 | $992.78 |
| aggressive | 78 closed | 85% / +$22.76 | 13% / -$33.46 | -$11.47 | $988.53 |
| unhinged | 144 closed | 89% / +$14.28 | 7% / -$34.67 | -$19.88 | $980.12 |

## Verified Root Causes

1. **Fixed 3% stop inside volatility noise** — TSTUSDT/DOGSUSDT/NFPUSDT/PSGUSDT have ATR ≈ 2–4%
2. **Cooldown written at CLOSE not OPEN** — multiple positions accumulate before cooldown exists
3. **Pre-signal guard missing** — has_open_position() checked at execution, not signal generation (TOCTOU)
4. **APScheduler in-memory job store** — AsyncIOScheduler() with no jobstores= → silent scheduler death
5. **PostureCoordinator doesn't exist** — Layer D from prior design is obsolete

## Designed Fix (Layers G/H/I/F)

- G: ATR-relative hard stop — max(3%, 1.5×ATR(14)) capped at 6%
- H: Pre-signal guard + cooldown-at-open + advisory lock
- I: AsyncIOScheduler persistent store + scanner heartbeat + dead-man probe
- F: Variant grid — 1.5× (baseline/moderate) vs 2.5× (aggressive/unhinged)

## Critical Implementer Corrections (from final verification)

1. Guard goes in `src/micro_scanner/main.py` (_run_breakout_pass), NOT `src/signals/signal_engine.py`
2. `micro_positions` has no `variant_id` column — migration 014 must add it before the unique index
3. Use existing `SymbolProtectionStore` API for cooldown-at-open — not raw SQL
