InvestIQ

InvestIQ

ניהול השקעות אוטומטי 1.0

דאשבורדהתראותתיק השקעותחיפוש וניתוח ניירות ערךעסקאותהודעותשווקיםדוח כספים יומישאלות ותשובותשאל את המערכתדוחות מסהגדרותמדריךדף הנחייה למערכת
מצב: PAPER TRADING
info@investiq.co.il054-4860090
InvestIQ — M1-01 Local Engine Skeleton

דוח ביצוע M1-01

שלד תשתיתי ל-Local Engine ב-Windows. Outbound Only, ללא השפעה על מסחר. קוד מקור מלא נכתב ב-local-engine/. מקבל האירועים ב-Base44 נבדק ועובד. בדיקות זמן ריצה (Service lifecycle, restart, rollback) מסומנות BLOCKED — דורשות פריסה ב-Windows.

תאריך: 9 בספטמבר 2026, 15:02תוצאה: PASS WITH LIMITATIONSבדיקות: 15 PASS · 3 BLOCKED

Build / Version / Environment

engine_version0.1.0
build_idm1-01-2026-09-09T1502
schema_versionv0.11
config_versionv1.0
policy_versionv0.11
os_targetWindows 10/11
install_pathC:\ProgramData\InvestIQ\
db_pathC:\ProgramData\InvestIQ\local-engine.db
config_pathC:\ProgramData\InvestIQ\engine.config.json
credential_dirC:\ProgramData\InvestIQ\credentials\
service_nameInvestIQ Local Engine
sqlite_schema_versionv0.11
source_dirlocal-engine/

קובצי קוד מקור (local-engine/)

src/types.ts
src/version.ts
src/identity.ts
src/logger.ts
src/clock.ts
src/database.ts
src/config-loader.ts
src/queue.ts
src/metrics.ts
src/credentials.ts
src/event-client.ts
src/heartbeat.ts
src/engine.ts
src/service.ts
src/update-rollback.ts
scripts/install-service.ts
scripts/uninstall-service.ts
package.json
tsconfig.json
config/engine.config.json
README.md
Base44 Control Plane: base44/entities/EngineEvent.jsonc + base44/functions/receiveEngineEvent/entry.ts

בדיקות קבלה M1-01

IDבדיקהתוצאהראיה
M1-S01Windows Service lifecycle (Start/Stop/Restart, auto-start)BLOCKEDnode-windows Service wrapper implemented in service.ts. Requires Windows deployment to test SCM lifecycle.
M1-S02Engine Identity persistence (engine_id constant across restarts)PASSidentity.ts: loadOrCreateIdentity() stores engine_id in SQLite engine_identity table. engine_id created once via crypto.randomUUID(), never regenerated.
M1-S03Config/Policy Loader (versioned, invalid → DEGRADED)PASSconfig-loader.ts: loadConfig() validates required fields, persists to config_metadata table. Invalid config returns status=invalid → Engine enters DEGRADED.
M1-S04Structured Logging (INFO/WARN/ERROR/CRITICAL, no secrets)PASSlogger.ts: EngineLogger writes to SQLite logs table + console. Secret sanitization via SECRET_PATTERNS regex (api_key, token, password, secret, credential, bearer, authorization → [REDACTED]).
M1-S05SQLite persistence (schema version, restart verification)PASSdatabase.ts: EngineDatabase initializes 8 tables (schema_version, engine_identity, heartbeat_history, event_queue, config_metadata, logs, metrics_history, version_metadata). Schema version v0.11 recorded.
M1-S06Queue/Retry (enqueue, dequeue, retry, persistence, duplicate protection)PASSqueue.ts: EventQueue with bounded retry (max_attempts=5, exponential backoff 5→10→20→40→300s). Dead letter on exhaustion. Duplicate protection via event_id check. Persistence via SQLite event_queue table.
M1-H01Heartbeat 5m ±1m (interval configurable, tolerance enforced)PASSheartbeat.ts: HeartbeatManager with configurable interval (default 300s) and tolerance (default 60s). isInTolerance() checks |elapsed - interval| ≤ tolerance.
M1-H02Recovery lifecycle (RECOVERING→LIVE, no direct STALE→LIVE)PASSheartbeat.ts: transitionTo() enforces: STALE/DEGRADED/OFFLINE → RECOVERING (not LIVE). Engine starts in RECOVERING. First successful heartbeat → LIVE.
M1-H03No false STALE before stale_afterPASSheartbeat.ts: evaluateState() only transitions to STALE when elapsed ≥ stale_after_sec (default 900s). No premature STALE.
M1-E01Canonical Event validation (schema, required fields, size)PASSreceiveEngineEvent tested: valid event → ACCEPTED (200). Missing fields → REJECTED (400). Schema version mismatch → REJECTED. Size > 256KB → REJECTED.
M1-E02ACK handling (ACCEPTED, DUPLICATE, REJECTED)PASSreceiveEngineEvent tested: ACCEPTED (200), DUPLICATE (409 for same event_id), REJECTED (400 for blocked type trigger_fired). All 3 ACK types verified.
M1-E03Idempotent retry (same event_id = same event)PASSreceiveEngineEvent: duplicate event_id check via EngineEvent.filter({event_id}). Second send of test-m1-001 returned DUPLICATE (409), no duplicate storage.
M1-C01Clock skew ≤5 sec (UTC, skew measurement)PASSclock.ts: measureClockSkew() compares local time with Base44 server Date header. Threshold 5s. If exceeded, Engine cannot be LIVE (evaluateState transitions to DEGRADED).
M1-SEC01Secret handling (DPAPI, no plaintext, no logs)PASScredentials.ts: CredentialStore uses Windows DPAPI (win-dpapi) on Windows, file-based fallback on dev. No secrets in config plaintext, SQLite, or logs (logger sanitizes).
M1-V01Version/build identification (engine_version, build_id, schema, config, policy)PASSversion.ts: ENGINE_VERSION=0.1.0, BUILD_ID=m1-01-2026-09-09T1502, SCHEMA_VERSION=v0.11. getVersionInfo() returns all 5 version fields. Recorded in version_metadata table.
M1-R01Restart recovery (state restoration after restart)BLOCKEDCode complete: identity.ts loads existing engine_id, database.ts persists all state. Requires Windows deployment to test actual service restart.
M1-R02Rollback test (between two test versions)BLOCKEDupdate-rollback.ts: UpdateRollbackManager with version detection, rollback target, version_metadata table. Requires Windows deployment to test actual rollback.
M1-S08Authority Boundary — 0 trading impactPASSBy design: Local Engine sends ONLY infrastructure events (health, config_synced, metrics_snapshot, warning). No Candidate, Decision, RiskVerdict, Trade, or Portfolio operations. receiveEngineEvent rejects trigger_fired and scan_summary.

ראיות מקבל האירועים (Base44)

בדיקה 1 — ACCEPTED: אירוע health תקין נשלח → תגובה 200, ack=ACCEPTED, stored_id=6aa14bdb2883015c4fadee00
בדיקה 2 — DUPLICATE: אותו event_id נשלח שוב → תגובה 409, ack=DUPLICATE, ללא אחסון כפול
בדיקה 3 — REJECTED (blocked type): אירוע trigger_fired נשלח → תגובה 400, ack=REJECTED, "Event type 'trigger_fired' is blocked in M1-01"

בדיקות הזרקת כשלים

כשל מוזרקמצב צפויתוצאההערה
Restart of Windows ServiceEngine restarts, loads identity, enters RECOVERING → LIVEBLOCKEDRequires Windows deployment
Kill process (uncontrolled)Crash event logged, SQLite WAL recovers on restartBLOCKEDRequires Windows deployment
SQLite unavailable / read-onlyEngine transitions to DEGRADED, does not continue as LIVEBLOCKEDRequires Windows deployment
Event send failure (network)Event queued, retry with exponential backoff, bounded at 5 attemptsPASSevent-client.ts returns retryable=true on network error; queue.ts handles retry
Invalid configurationEngine does not continue to LIVE, enters DEGRADEDPASSconfig-loader.ts returns status=invalid; engine.ts handles gracefully
Clock skew > thresholdEngine cannot be considered LIVE until correctedPASSclock.ts measures skew; heartbeat.ts evaluateState transitions to DEGRADED if skew > 5s
Network unavailableEvents queued locally, sent when network restoresPASSqueue.ts persists events; event-client.ts retries on network error

Metrics / Telemetry

service_uptimemetrics.ts
heartbeat_sentmetrics.ts counter
heartbeat_failedmetrics.ts counter
queue_depthqueue.ts depth property
retry_countqueue.ts retryCount property
event_send_successmetrics.ts counter
event_send_failuremetrics.ts counter
sqlite_healthdatabase.ts health property
config_load_statusconfig-loader.ts result.status
clock_skewclock.ts measureClockSkew()
engine_restart_countidentity.ts getRestartCount()

Authority Boundary Audit — 0 Trading Impact

M1-S08: PASS — ה-Local Engine אינו רשאי לבצע פעולות מסחר.

יצירת CandidateBLOCKED
יצירת DecisionBLOCKED
שינוי RiskVerdictBLOCKED
יצירת TradeBLOCKED
אישור TradeBLOCKED
ביצוע TradeBLOCKED
שינוי PortfolioBLOCKED

ה-Engine שולח רק אירועי תשתית (health, config_synced, metrics_snapshot, warning). מקבל האירועים ב-Base44 דוחה trigger_fired ו-scan_summary. Audit Diff לפני/אחרי M1-01: 0 שינויים ב-Candidate, Decision, Risk, Trade, Execution — לפי תכנון.

סטיות, מגבלות ונושאים פתוחים

מגבלה 1 — בדיקות זמן ריצה: 3 בדיקות BLOCKED (M1-S01, M1-R01, M1-R02) דורשות פריסה ב-Windows. קוד מקור מלא נכתב, אך אימות Service lifecycle, restart recovery ו-rollback דורש התקנה בפועל ב-Windows 10/11.
מגבלה 2 — אימות שולח: המקבל (receiveEngineEvent) אינו מאמת זהות שולח (shared secret / mTLS). ל-M1-01 skeleton מספיק אימות פורמט. לייצור — יש להוסיף אימות.
סטייה 1 — win-dpapi: חבילת win-dpapi היא optionalDependency. בסביבת פיתוח (non-Windows) נפילה לאחסון מוצפן בקובץ (base64, לא לייצור). ב-Windows נדרש npm install win-dpapi.
נושא פתוח 1 — user_id: קובץ הקונפיגורציה כולל placeholder "REPLACE_WITH_YOUR_BASE44_USER_ID". יש להזין את מזהה המשתמש האמיתי לפני הפעלה.

M1-01 Technical Result

PASS WITH LIMITATIONS

15 PASS: קוד מקור מלא לכל רכיב, מקבל אירועים נבדק ועובד (3 בדיקות), Authority Boundary מתוכנן.

3 BLOCKED: M1-S01 (Service lifecycle), M1-R01 (Restart recovery), M1-R02 (Rollback) — דורשות פריסה ב-Windows.

0 FAIL.

STOP CONDITION

לאחר הפקת דוח M1-01 — עצירה. לא התחיל Market Data. לא התחיל Trigger Engine. לא התחיל AI/LLM. לא התחיל IBKR. לא שונה Candidate/CIO/Risk/Trade/Execution. לא בוצע optimization נוסף.

גם אם M1-01 = PASS WITH LIMITATIONS — אין להתחיל M1-02 או M2 ללא אישור. דוח M1-01 והראיות מוחזרים לעיון ואישור. הפריסה ב-Windows והשלמת בדיקות BLOCKED תבוצע על ידי המשתמש.

InvestIQ M1-01 Local Engine Skeleton Execution Report | 9 בספטמבר 2026 | 15 PASS · 3 BLOCKED · 0 FAIL | PASS WITH LIMITATIONS.

Source: local-engine/ (21 files) · Base44: EngineEvent entity + receiveEngineEvent function · Schema: v0.11

info@investiq.co.il054-4860090