Engineering Manifesto

Reliability-first architecture for quantitative execution: deterministic state, resilient I/O, and operational safety primitives.

Reliability: First-Class Feature

Principles

  • Local-first security: keep sensitive strategy context and credentials on the user's device whenever possible.
  • Deterministic recovery: define clear invariants and replayable state transitions.
  • Atomic persistence: avoid partial writes; guarantee consistency across interruptions.
  • Observable operations: track heartbeat, watchdogs, and error boundaries.
Thread Watchdog

Continuous health monitoring for critical loops. Detects stalls, enforces timeouts, and triggers controlled recovery.

Atomic Write

Write-then-swap persistence model to protect configuration and reporting artifacts against corruption and power loss.

Orphan Recovery

Detects orphaned processes/state and restores a consistent runtime snapshot, minimizing downtime during reconnect events.

Thread Watchdog

A health supervisor for critical loops (data feed, signal engine, order pipeline). It enforces heartbeat checks, detects stalls, and triggers controlled recovery with invariant validation.

# Watchdog loop (simplified) while True: for worker in critical_workers: if now() - worker.last_heartbeat > timeout_s: quarantine(worker) restart(worker, max_attempts=3) sleep(30)
  • Heartbeat-based stall detection
  • Timeouts + quarantine for degraded components
  • Crash-safe restart with state validation
  • Audit-friendly event trail (no secrets)
30s
Health Check Interval
3Ă—
Max Restart Attempts
Deterministic
Recovery Posture

Atomic Write Guarantees

For configuration, catalogs, and reports, Sentralyx uses a write-then-swap pattern. Critical artifacts are either fully written or unchanged—no partial states.

# Atomic write (concept) def atomic_write(payload, path): tmp = path + ".tmp" with open(tmp, "wb") as f: f.write(payload) f.flush() fsync(f) rename(tmp, path)
  • Crash-safe persistence for critical artifacts
  • Prevents file corruption under interruption
  • Supports consistent recovery after restart
  • Makes state replay reliable and inspectable
0%
Partial Write Tolerance
ACID-like
Artifact Consistency
Replayable
State Transitions

Orphan Recovery

Disconnects happen. Orphan recovery reconciles open orders/positions after reconnect, restores a consistent snapshot, and prevents duplicate intent under uncertain network conditions.

5s
Reconcile Target
24/7
Monitoring
Idempotent
Order Intent

Recovery Flow

  • Fetch exchange state (orders, positions, balances)
  • Compare against last persisted runtime snapshot
  • Resolve conflicts (cancel/replace) with safety checks
  • Resume execution only after invariants pass

Security Posture

Designed around least privilege and local-first secret handling. Use trade-only keys, IP restrictions, and encrypted storage. Logs and exports remain audit-friendly without leaking sensitive credentials.

Credential Hygiene
  • Trade-only permissions (no withdrawals)
  • IP allowlisting / restrictions
  • Rotation-ready storage patterns
Audit-Friendly Outputs
  • No secrets in logs or exported reports
  • Clear error boundaries for incident review
  • Deterministic state for traceability

Rule Engine: Execution Examples

Illustrative snippets showing how signals and confirmations are expressed.

# Trend gate example if adx > 25 and rsi < 70: return "ALLOW_LONG", 0.9 return "NO_TRADE", 0.0

A simple gate that favors directional regimes (ADX) and avoids overheated entries (RSI).

# Momentum confirmation if macd > signal and prev_macd <= prev_signal: return "BUY", 0.7 if macd < signal and prev_macd >= prev_signal: return "SELL", 0.7

Cross events add structure to momentum shifts while keeping the rule expressive and inspectable.

# MTF confirmation concept signals = [analyze("15m"), analyze("1h"), analyze("4h")] if majority(signals) == "BULLISH": return "CONFIRMED" return "WEAK"

Multi-timeframe confirmation reduces false positives by requiring alignment across regimes.

Operational Metrics

High-level reliability and quality posture indicators.

99.9%
Uptime Target
<1ms
UI Response Target
626/626
Tests Passed
0
Known Critical Issues