T7.1 — Registry As-Is: נתיבי ביצוע, ספים וזהויות
v1.0 Registry Draft · 11 באוגוסט 2026 · BAROUCH SHALIT
Baseline: CH7 Architecture v1.0 — Approved Baseline · READ-ONLY — no code changes · מקור: קריאת קוד ישירה (executeTrade, tradeExecution, decisionObject, refreshPortfolioPrices, permissionMatrix, leastPrivilege, emergencyLiquidation, explainBeforeExecute)
כיסוי As-Is מאומת
נתיבי ביצוע
4/4
0 פערים
ספים
4/4
0 פער
שדות
5/5
0 פערים
זהויות
7/7
0 פערים
סה״כ פערים
0
P0: 0 · P1: 0 · Info: 0
4 נתיבי ביצוע מופו במלואם. כל נתיב כולל: actor, role, trigger, כל השערים (gates), וראיות audit. לחצו על נתיב להרחבה.
| טענה | מיקום בקוד | סטטוס | פער |
|---|---|---|---|
| 8.5 (auto_execute_threshold) | SystemSettings.auto_execute_threshold (default: 8.5) | CONFIRMED — configurable via SystemSettings | |
| 9.5 (semi_auto high-confidence) | SystemSettings.semi_auto_high_confidence_threshold (default: 9.5) + decisionObject.ts determineApprovalRequired() | CONFIRMED — configurable via SystemSettings (GAP-001 resolved in T7.2) | |
| hard_semi (management_mode) | Trade.management_mode enum + tradeExecution.ts poolField (line 19): hard_semi → cash_semi; semi_hard → cash_semi (backward compat) | CONFIRMED — canonical name is "hard_semi"; "semi_hard" is backward-compat alias | |
| price_drift_threshold (auto/semi) | SystemSettings.price_drift_threshold_auto_pct (3%) / price_drift_threshold_semi_pct (5%) | CONFIRMED — both thresholds configurable |
| שדה | ישות | מיקום בקוד | תכלית | סטטוס |
|---|---|---|---|---|
| version_cas | Decision | decisionObject.ts: supersedeDecision (line 454) — CAS atomic update | מונה אופטימי להחלפה אטומית של Decision | CONFIRMED — separate field, CAS enforced |
| decision_version | Decision | decisionObject.ts: createDecision (line 254) + supersedeDecision (line 389) | מספר גרסה בתוך משפחה (decision_family_id) | CONFIRMED — separate field, increments on supersede |
| expires_at | Decision | decisionObject.ts: publishDecision (line 332) — computeExpiresAt(ttlHours) | תוקף Decision TTL (מתוך decision_ttl_hours) | CONFIRMED — separate field, checked in assertDecisionActive |
| proposal_expires_at | Trade | executeTrade line 114; stateMachine createTradeWithAudit | תוקף Proposal ל-Trade ב-pending (proposal_ttl_hours) | CONFIRMED — separate field, checked in executeTrade |
| approval_expires_at | Trade | executeTrade line 115; refreshPortfolioPrices line 440 | תוקף אישור ל-Trade ב-approved/wait (approval_ttl_hours) | CONFIRMED — separate field, checked in both execution paths |
מסקנה: 5 שדות נפרדים על 2 ישויות (Decision + Trade) — מאומת. אינם שמות חלופיים.
PermissionMatrix entity
מיקום: base44/entities/PermissionMatrix.jsonc + base44/shared/permissionMatrix.ts
סטטוס: CONFIRMED — entity + module exist
10 logical components defined; checkPermission() with DENY default
10 Logical Components
מיקום: PermissionMatrix entity (component field) + Ch7Review.jsx part D
סטטוס: CONFIRMED — Scanner, Agent, CIO Shadow, Risk Gate, Execution, Broker, System Admin, Security Admin, Operator, Auditor
Approver = logical role within Operator (not separate)
Agent Permission Matrix
מיקום: base44/shared/leastPrivilege.ts — PERMISSION_MATRIX (6 agent types)
סטטוס: CONFIRMED — scanner, news, technical, financials, portfolio, cio_shadow
All 6 prohibit executeTrade + access_broker_credentials
actor_id / actor_type / logical_role / session_id
מיקום: AuditEvent.actor + actor_type (enum) + logical_role (string) + session_id; auditEventLogger.ts
סטטוס: CONFIRMED — actor_type + logical_role added to AuditEvent (T7.2, 11.8.2026); session_id pre-existing
auditEventLogger.ts populates all fields; AuditEventInput extended
Re-auth (full_auto / Freeze cancel / permission change)
מיקום: base44/shared/reauthGuard.ts — requireReauth() + requiresReauth() + isFullAutoTransition() + isFreezeCancel()
סטטוס: CONFIRMED — re-auth alternative implemented (T7.2, 11.8.2026)
Confirmation + reason + audit pattern (Base44 auth has no native step-up auth)
Break-Glass
מיקום: permissionMatrix.ts: requestBreakGlass() + emergencyLiquidation.ts: verifyEmergencyAuthorized()
סטטוס: CONFIRMED — BreakGlassEvent entity + approval flow
Emergency Liquidation requires BreakGlassEvent with approver
Broker Credential Isolation
מיקום: BrokerageConnection.api_key_ref (reference only); leastPrivilege.ts: all agents prohibit access_broker_credentials
סטטוס: CONFIRMED — credentials isolated from agents
api_key_ref stored, not raw key
סף 9.5 מוקשח בקוד (hardcoded)
ממצא: decisionObject.ts line 128: confidence >= 9.5 is a hardcoded constant, not a SystemSettings field like auto_execute_threshold (8.5).
השפעה: לא ניתן לשנות את סף 9.5 ללא שינוי קוד — בניגוד ל-8.5 שניתן לשינוי דרך SystemSettings.
המלצה: T7.2: להוסיף שדה semi_auto_high_confidence_threshold ל-SystemSettings (default 9.5) ולהחליף את ה-hardcode.
סטטוס: נסגר ✅ — T7.2 (11.8.2026): semi_auto_high_confidence_threshold נוסף ל-SystemSettings; decisionObject.ts משתמש בשדה ה-configurable
semi_hard כשם חלופי (backward compat)
ממצא: tradeExecution.ts line 19: semi_hard ממופה ל-cash_semi (אותו pool כ-hard_semi). השם הקנוני הוא hard_semi.
השפעה: אין השפעה תפעולית — שני השמות מביאים לאותה תוצאה. יש לתעד כי hard_semi הוא השם הקנוני.
המלצה: לתעד ב-§7.7 כי hard_semi קנוני; semi_hard נשמר לתאימות לאחור בלבד.
סטטוס: נסגר — תיעוד בלבד
market_open נאכף בשתי נקודות
ממצא: executeTrade line 154 (BUY park when closed) + refreshPortfolioPrices line 438 (skip if closed). §7.2 אומר "נקודת האכיפה המדויקת תאומת" — ואכן יש שתי נקודות.
השפעה: אין השפעה — שתי הנקודות משלימות (manual park + auto skip). המסמך כבר מציין שהנקודה תאומת.
המלצה: לעדכן §7.2: "נקודות האכיפה המאומתות: executeTrade (BUY park) + refreshPortfolioPrices (auto skip)."
סטטוס: נסגר — עדכון ניסוח בלבד
חסרים שדות actor_type / logical_role / session_id מובנים
ממצא: AuditEvent.entity מכיל actor (string) בלבד. הקוד משתמש ב-user.email כ-actor. אין שדות פורמליים ל-actor_type, logical_role, session_id.
השפעה: לא ניתן לסנן/לבקר לפי תפקיד לוגי או session ללא parsing של שדה ה-actor החופשי.
המלצה: T7.2: להוסיף שדות actor_type, logical_role, session_id ל-AuditEvent entity.
סטטוס: נסגר ✅ — T7.2 (11.8.2026): actor_type (enum) + logical_role (string) נוספו ל-AuditEvent; auditEventLogger.ts מאכלס את השדות
אין מנגנון Re-auth בקוד
ממצא: §7.7/§7.12 דורש re-auth ל-3 פעולות (מעבר ל-full_auto, ביטול Freeze, שינוי הרשאות מהותי). לא נמצא מנגנון step-up auth בקוד.
השפעה: פעולות קריטיות אינן מחויבות באימות מחדש. Base44 auth אינו תומך ב-step-up auth ילידי.
המלצה: T7.2: לתכנן חלופה — דיאלוג אישור עם הזנת סיבה + Audit מפורט (במקום re-auth טכני).
סטטוס: נסגר ✅ — T7.2 (11.8.2026): reauthGuard.ts נוצר — חלופת confirmation + reason + audit; requireReauth() ל-3 פעולות קריטיות
המלצת מעבר ל-T7.2
T7.1 השלים מיפוי As-Is מלא. 3 פערי P1 הועברו ל-T7.2 (חוזה Approval וסמכות לפי מצב עבודה): (1) הוספת שדה 9.5 ל-SystemSettings; (2) הוספת שדות actor_type/logical_role/session_id ל-AuditEvent; (3) תכנון חלופת re-auth. ניתן לעבור ל-T7.2.