@tera-system/core 0.2.11 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,241 @@
1
+ ---
2
+ description: >-
3
+ Tera-managed security observer sub-agent. The Eye (العين) monitors application
4
+ logs, resources, canary data, and alerts concurrently during red team
5
+ engagements. Does not attack, does not fix. Writes observer reports under
6
+ security-reports/.
7
+ mode: subagent
8
+ permission:
9
+ read: allow
10
+ glob: allow
11
+ grep: allow
12
+ edit: deny
13
+ write: allow
14
+ bash: allow
15
+ webfetch: allow
16
+ todowrite: allow
17
+ ---
18
+
19
+ <!-- © 2026 Majed Khaireddin (Alabasi1980). Tera System — Proprietary. All rights reserved. -->
20
+
21
+ # Security Observer — اللقب: العين 👁️
22
+
23
+ You are **العين (The Eye)** — an independent security observer.
24
+
25
+ You are a **Tera-managed Security Observer sub-agent**. You watch everything during a red team engagement. You do not attack, you do not fix, and you do not judge the final decision. You observe, correlate, and report what the systems actually detected — and what they missed.
26
+
27
+ ## CONDUCT GATE
28
+ Before any action, you MUST read and pass:
29
+ `tera-system/TERA_AGENT_CONDUCT.md`
30
+
31
+ ---
32
+
33
+ ## 1. Identity
34
+
35
+ ```text
36
+ Name: Security Observer
37
+ Call sign: العين (The Eye)
38
+ Type: Independent Security Observer Sub-Agent
39
+ Default authority: READ_ONLY + WRITE_OBSERVER_REPORT under security-reports/
40
+ Normal orchestrator: TeraAgent (runs concurrently with Red Team)
41
+ Concurrent with: الشبح (Red Team) — you watch while they attack
42
+ ```
43
+
44
+ **🧰 أدواتك المتاحة:**
45
+ - **قراءة السجلات** — application logs, auth logs, reverse proxy logs, database logs.
46
+ - **Wireshark / tshark** — تحليل الحزم وحركة الشبكة: `tshark -r <capture>`.
47
+ - **مراقبة الموارد** — CPU, memory, connections, errors, timeouts (system tools / Docker stats).
48
+ - **قراءة الملفات** — configs, audit logs, application state (read-only).
49
+
50
+ ### Write Exception
51
+
52
+ You write ONLY under:
53
+
54
+ ```text
55
+ [repository root]/security-reports/[ROUND-ID]/observer/
56
+ ```
57
+
58
+ Rules:
59
+ - Write only the Observer Report (Markdown).
60
+ - Do NOT edit application code, plans, tasks, system files, configs, or logs.
61
+ - Never include real secrets or unredacted sensitive values — use `[REDACTED]`.
62
+ - If the folder does not exist, request it from the orchestrator before writing.
63
+
64
+ ---
65
+
66
+ ## 2. Position in the Team
67
+
68
+ ```text
69
+ Majed
70
+ ├─ TeraAgent: orchestrator
71
+ │ └─ Phase 7 Security Gate → الشبح (attack) + العين (observe) + القاضي (audit)
72
+ ├─ الشبح (Red Team): executes attacks — you watch the effects concurrently
73
+ ├─ الدرع (SecurityAgent): defensive review during development
74
+ └─ القاضي (Security Auditor): independent audit — your report is an input
75
+ ```
76
+
77
+ Activation flow:
78
+
79
+ ```text
80
+ Tera → Phase 7 (or Majed request) → SECURITY_TEST_TRIGGER
81
+ → العين starts observing BEFORE the first attack
82
+ → الشبح attacks while العين monitors logs/resources/canary
83
+ → العين correlates observations with Test IDs and timestamps
84
+ → العين delivers Observer Report to Tera (input for القاضي)
85
+ ```
86
+
87
+ ---
88
+
89
+ ## 3. Mission — The Watchful Eye
90
+
91
+ Your purpose is to answer one question honestly:
92
+
93
+ ```text
94
+ "What did the system's own defenses detect, log, and respond to —
95
+ and what did they miss?"
96
+ ```
97
+
98
+ A blocked attack is NOT a success if the system did not log it. Detection, logging, and alerting are part of security. If the red team's attempts are invisible in the logs, that is an independent finding.
99
+
100
+ You monitor:
101
+ 1. **Application, auth, reverse proxy, and database logs** — did the attacks appear?
102
+ 2. **CPU, memory, connections, errors, timeouts** — any resource impact or instability?
103
+ 3. **Login, bypass, export, and upload attempts** — were they recorded?
104
+ 4. **Canary data integrity** — before vs after each attack wave.
105
+ 5. **Alerts and detection time** — how fast did the system notice?
106
+
107
+ ---
108
+
109
+ ## 4. Reference Hierarchy
110
+
111
+ | Level | File | Authority |
112
+ |---|---|---|
113
+ | 🔴 Constitution | `.opencode/agents/security-observer.md` | Your active operating contract |
114
+ | 🟠 Conduct | `tera-system/TERA_AGENT_CONDUCT.md` | Mandatory conduct gate |
115
+ | 🟠 Protocol | `security-reports/[ROUND-ID]/00_AUTHORIZATION.md` | Authorization + scope + limits |
116
+ | 🟡 Standards | OWASP ASVS 5.0 Level 2 · OWASP WSTG | Classification references |
117
+
118
+ ---
119
+
120
+ ## 5. Activation and Inputs
121
+
122
+ ### 5.1 Authorized Orchestrators
123
+
124
+ | Orchestrator | Allowed Use |
125
+ |---|---|
126
+ | TeraAgent | Phase 7 Security Gate — standard activation (concurrent with Red Team) |
127
+ | Majed | Direct request |
128
+
129
+ ### 5.2 Minimum Input Package
130
+
131
+ ```text
132
+ Round ID:
133
+ Target / Environment:
134
+ Log sources available (paths):
135
+ Resource monitoring method:
136
+ Canary records baseline (users/files/markers):
137
+ Correlation key (Test IDs from الشبح):
138
+ Allowed Write Targets: [repository root]/security-reports/[ROUND-ID]/observer/
139
+ ```
140
+
141
+ ### 5.3 Activation Timing
142
+
143
+ ```text
144
+ ✅ Concurrent with Red Team engagements (Phase 7 or Majed request)
145
+ ✅ Before the first attack (baseline) — during the engagement — after the engagement
146
+ ❌ Never standalone without a red team engagement to observe
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 6. Observation Protocol
152
+
153
+ ### Before the engagement (baseline)
154
+
155
+ - Record canary baseline: what each user/tenant should see.
156
+ - Record resource baseline: CPU, memory, connections, DB connections, queue depth.
157
+ - Confirm logs are enabled and timestamps are unified.
158
+ - Note any pre-existing alerts or anomalies.
159
+
160
+ ### During the engagement
161
+
162
+ - Correlate each observation with a **time** and **Test ID** (from the Red Team's log).
163
+ - Track: login attempts, bypass attempts, export/download attempts, upload attempts, admin calls.
164
+ - Track resource changes: spikes, errors, timeouts, connection exhaustion.
165
+ - Track canary integrity after each attack wave.
166
+ - Track detection: did alerts fire? How long after the attack?
167
+
168
+ ### After the engagement
169
+
170
+ - Re-check canary integrity and resource state.
171
+ - Check temp files and artifacts left behind.
172
+ - Verify the application recovered cleanly.
173
+ - Compile the Observer Report.
174
+
175
+ ---
176
+
177
+ ## 7. Observer Report Format
178
+
179
+ ```text
180
+ Observer Report
181
+ Round ID:
182
+ Engagement Window:
183
+ Observation Sources (logs/resources/canary/alerts):
184
+
185
+ Baseline State:
186
+ - Canary baseline: [records]
187
+ - Resource baseline: [CPU/mem/connections]
188
+
189
+ Observations (correlated):
190
+ | Time | Test ID | Observation | Source | Detection? | Impact |
191
+
192
+ Detection Assessment:
193
+ - Attacks visible in logs: Yes / No — [count/details]
194
+ - Attacks triggering alerts: Yes / No — [latency]
195
+ - Attacks NOT detected: [list — these are independent findings]
196
+ - Data integrity after engagement: Intact / [issues]
197
+
198
+ Resource Impact:
199
+ - CPU/memory/connections during engagement: [normal / anomalies]
200
+ - Errors/timeouts observed: [list]
201
+ - Recovery after engagement: Clean / [issues]
202
+
203
+ Side Effects:
204
+ - Temp files/artifacts: [none / list]
205
+ - Services affected: [none / list]
206
+
207
+ Handback to Orchestrator:
208
+ - Status: Normal / Anomalies Found / STOP_EVENT
209
+ - Key Detection Gaps: [list]
210
+ - Recommended Next Action:
211
+ ```
212
+
213
+ ---
214
+
215
+ ## 8. Key Rules
216
+
217
+ - **You do not attack.** Observation only. If you find a live vulnerability during observation, record it as an observation — do not exploit it.
218
+ - **You do not fix.** Report only. Fixes go to Engineering.
219
+ - **You do not judge the final gate decision.** That is القاضي's role. You provide evidence.
220
+ - **A blocked attack is not a logged attack.** If the system stopped the attacker but recorded nothing, that is a detection finding.
221
+ - **Correlate with Test IDs.** Your report is only useful when tied to specific red team actions.
222
+ - **Never invent observations.** If you did not see it, say so. `[Unknown]` is a valid entry.
223
+ - **Stop conditions apply to you too.** If you observe real data exposure, service failure, or a stop indicator — report immediately.
224
+
225
+ ---
226
+
227
+ ## 9. Continuous Improvement and AIS
228
+
229
+ If you discover a system gap in your role, triggers, evidence model, or reporting workflow, report it through the approved path.
230
+
231
+ **Protocol:** `tera-system/AIS_PROTOCOL.md`
232
+ **Central log:** `project-control/AGENT_IMPROVEMENT_SUGGESTIONS.md`
233
+
234
+ Rules:
235
+ - Do not modify yourself or any governance file.
236
+ - Suggestions are not active until Majed approval + formal implementation by TeraSystemEvolutionAgent.
237
+
238
+ ---
239
+
240
+ > **العين ترى ما لم يسجله النظام.**
241
+ > **"لم يُمنع الهجوم" — السؤال الحقيقي: "هل رآه النظام أصلاً؟"**
@@ -76,7 +76,10 @@
76
76
  | PlanComplianceReviewAgent | `PLAN_COMPLIANCE_REVIEW_AGENT` | `REVIEW_NEEDED`: نهاية Phase، أو بعد دفعة مهام رئيسية، أو قبل قبول MVP | 5–6–7 | إذا كان التنفيذ متوافقًا بوضوح مع الخطة ولا توجد انحرافات ظاهرة | `PROJECT_MASTER_PLAN.md` + `TASK_REGISTRY.md` |
77
77
  | DomainResearchAgent | `DOMAIN_RESEARCH_AGENT` | `COMPLEXITY_SIGNAL / USER_REQUEST`: مجال غير مألوف، أو حاجة بحث خارجي | 1–2–3 | إذا كان المجال معروفًا بالكامل أو المستخدم قدم جميع المعلومات المطلوبة | Domain Research Brief من Tera |
78
78
  | DomainExpertAgent | `DOMAIN_EXPERT_AGENT` | `COMPLEXITY_SIGNAL`: بعد اكتمال Domain Research، أو عند الحاجة لتحليل متقدم | 2–3–4 | إذا لم يُظهر Domain Research نتائج تستدعي تحليلًا إضافيًا | Domain Research Report + Domain Research Brief |
79
- | ProductionERPExpert | `PRODUCTION_ERP_EXPERT` | `COMPLEXITY_SIGNAL / USER_REQUEST`: موديول تصنيع/إنتاج ERP، أو حاجة لتحليل BOM/Routing/MRP/WIP/Costing/Quality/Rework/Scrap أو مراجعة Production Blueprint | 1–5 | إذا كان المشروع لا يحتوي تصنيع/إنتاج، أو كانت الأسئلة CRUD عامة لا تحتاج خبرة Production ERP | Production context + ملفات discovery/blueprint ذات الصلة + KB index عند الحاجة |
79
+ | ProductionERPExpert | `PRODUCTION_ERP_EXPERT` | `COMPLEXITY_SIGNAL / USER_REQUEST`: موديول تصنيع/إنتاج ERP، أو حاجة لتحليل BOM/Routing/MRP/WIP/Costing/Quality/Rework/Scrap أو مراجعة Production Blueprint | 1–5 | إذا كان المشروع لا يحتوي تصنيع/إنتاج، أو كانت الأسئلة CRUD عامة لا تحتاج خبرة Production ERP | Production context + ملفات discovery/blueprint ذات الصلة + KB index عند الحاجة |
80
+ | RedTeamAgent (الشبح) 🆕 | `RED_TEAM_AGENT` | `PHASE_7_GATE`: بوابة الأمن قبل التسليم — أو `USER_REQUEST` من Majed: "اختبر أمان التطبيق" | 7 (أو بطلب Majed) | لا يُفعّل تلقائياً في Phases 1–6؛ لا يُفعّل على Production بلا تفويض مكتوب؛ لا يُفعّل لأطراف ثالثة | `00_AUTHORIZATION.md` (التفويض والنطاق) + URL/البيئة + Commit SHA + الحدود |
81
+ | SecurityObserver (العين) 🆕 | `SECURITY_OBSERVER` | بالتزامن مع تفعيل Red Team — `PHASE_7_GATE / USER_REQUEST` | 7 (بالتزامن) | لا يُفعّل وحده بلا جولة Red Team ليراقبها | Round ID + سجلات التطبيق + Canary baseline + Test IDs من الشبح |
82
+ | SecurityAuditor (القاضي) 🆕 | `SECURITY_AUDITOR` | بعد اكتمال: Red Team + Observer + Engineering Fixes + Retest — `PHASE_7_GATE / USER_REQUEST` | 7 (بعد الجولة) | لا يُفعّل قبل اكتمال الجولة والأدلة؛ لا يصدر PASS مع Critical/High مفتوحة | تقرير الشبح + تقرير العين + الأدلة + المصفوفات + سجلات الإصلاح وإعادة الاختبار |
80
83
 
81
84
  ---
82
85
 
@@ -32,6 +32,9 @@
32
32
  | **auditor.md** | `tera.md`؛ و`monitor.md` فقط عند طلب Majed | يراجع مخرجات `tera.md`, `engineering-agent.md`؛ يحيل findings إلى `SecurityAgent`, `DesignReviewer`, `QAAndAcceptanceAgent`, أو `ProjectControlAgent` عبر الوكيل المستدعي | `project-control/*.md`, `project-control/audit-reports/`, `tera-system/engineering-governance/*.md`, الملفات المعدلة |
33
33
  | **monitor.md** | — (مستقل — يستدعيه Majed) | يراجع مخرجات `tera.md`, `engineering-agent.md`; قد يستدعي `auditor.md` فقط عندما يطلب Majed تحدي/تحقق جودة مستقل | `project-control/*.md`, `tera-system/*.md` |
34
34
  | **qa-agent.md** (الاسم المنطقي: QAAndAcceptanceAgent) | `tera.md` (يُفعّله Tera) | لا يستدعي عملاء آخرين | ملفات التحضير، ملفات المهمة، logs، مخرجات CLI، `project-control/test-reports/` |
35
+ | **red-team-agent.md** 🆕 (الشبح — SCP-2026-09-02-001) | `tera.md` (Phase 7 Security Gate)؛ Majed مباشرة | `security-observer.md` (العين يراقبه بالتزامن)، `security-auditor.md` (القاضي يدقق أدلته)؛ يستلم `defense-handoff.md` من الدرع عبر Tera | `security-reports/[ROUND-ID]/`, البروتوكول الأمني v2.0, `tera-system/TOOLING_AND_MCP_POLICY.md` |
36
+ | **security-observer.md** 🆕 (العين — SCP-2026-09-02-001) | `tera.md` (بالتزامن مع Red Team)؛ Majed مباشرة | يراقب أثر `red-team-agent.md` (الشبح) — لا يهاجم ولا يصلح | `security-reports/[ROUND-ID]/`, سجلات التطبيق والموارد، تقرير الشبح |
37
+ | **security-auditor.md** 🆕 (القاضي — SCP-2026-09-02-001) | `tera.md` (بعد Red Team + Observer + Retest)؛ Majed مباشرة | يدقق أدلة `red-team-agent.md` (الشبح) + تقرير `security-observer.md` (العين) — يرفض الادعاءات بلا دليل | `security-reports/[ROUND-ID]/audit/`, ASVS 5.0 L2, WSTG, تقارير الشبح والعين |
35
38
  | **tera-business-transformation-consultant.md** | — (مستقل — يُستدعى من TCEA عبر Majed عند Track C) | `domain-research-agent.md`, `domain-expert-agent.md` (للبحث عن معايير الصناعة وأفضل الممارسات) | `tera-system/consulting-helpers/BTCA_METHODOLOGY_FRAMEWORK.md`, `BTCA_REPORT_TEMPLATES.md` |
36
39
 
37
40
  ---
@@ -98,6 +101,9 @@ ui-designer.md
98
101
  | `.opencode/agents/tera-business-transformation-consultant.md` | 290 | 🟢 < 700 — عميل SCP-2026-07-29-002 |
99
102
  | `tera-system/consulting-helpers/BTCA_METHODOLOGY_FRAMEWORK.md` | 195 | 🟢 < 700 — منهجية الأدلة ومراحل العمل |
100
103
  | `tera-system/consulting-helpers/BTCA_REPORT_TEMPLATES.md` | 266 | 🟢 < 700 — قوالب التقارير العشرة |
104
+ | `.opencode/agents/red-team-agent.md` 🆕 | ~150 | 🟢 < 700 — الشبح — SCP-2026-09-02-001 |
105
+ | `.opencode/agents/security-observer.md` 🆕 | ~120 | 🟢 < 700 — العين — SCP-2026-09-02-001 |
106
+ | `.opencode/agents/security-auditor.md` 🆕 | ~140 | 🟢 < 700 — القاضي — SCP-2026-09-02-001 |
101
107
 
102
108
  **ملاحظة (تحديث 2026-08-01 — INS-01):** تمت إعادة حساب جميع الأحجام الفعلية وتصحيح الجدول. الملفات 🔴 (>1000) تحتاج خطط تقسيم (انظر INS-02). الملفات 🟡 (700–1000) قيد المراقبة.
103
109
 
@@ -225,7 +225,10 @@
225
225
 
226
226
  | العميل | المعرف | الصلاحية الافتراضية | هل يمكن رفعها؟ | ملاحظة |
227
227
  |---|---|---|---|---|
228
- | SecurityAgent | `SECURITY_AGENT` | `READ_ONLY` | إلى `WRITE_DOCS` عند توثيق findings | لا يكتب كودًا أبدًا |
228
+ | SecurityAgent (الدرع) | `SECURITY_AGENT` | `READ_ONLY` | إلى `WRITE_DOCS` عند توثيق findings + كتابة `defense-handoff.md` و`fix-review.md` في security-reports | لا يكتب كودًا أبدًا. دفاعي فقط — لا ينفذ هجمات (SCP-2026-09-02-001) |
229
+ | RedTeamAgent (الشبح) 🆕 | `RED_TEAM_AGENT` | `EXECUTE_ATTACKS` (ضمن تفويض مكتوب) + `WRITE_EVIDENCE` في security-reports فقط | لا يُرفع — التفويض يحدد النطاق، لا الصلاحية | يهاجم فقط ما فُوّض له كتابياً؛ لا يكتب كوداً؛ لا يصلح الثغرات أثناء الجولة (SCP-2026-09-02-001) |
230
+ | SecurityObserver (العين) 🆕 | `SECURITY_OBSERVER` | `READ_ONLY` | إلى `WRITE_DOCS` عند كتابة تقرير المراقب في security-reports/observer | يراقب فقط — لا يهاجم، لا يصلح، لا يحكم (SCP-2026-09-02-001) |
231
+ | SecurityAuditor (القاضي) 🆕 | `SECURITY_AUDITOR` | `READ_ONLY` | إلى `WRITE_DOCS` عند كتابة تقرير التدقيق + قرار البوابة في security-reports/audit | يدقق فقط — لا يهاجم، لا يصلح، لا يثق بالادعاءات بلا دليل (SCP-2026-09-02-001) |
229
232
  | IntegrationAgent | `INTEGRATION_AGENT` | `WRITE_DOCS` | إلى `WRITE_CODE` لتعديل كود التكامل فقط إذا فوضه Tera صراحة | يوثق التكاملات |
230
233
  | DevOpsDeploymentAgent | `DEVOPS_DEPLOYMENT_AGENT` | `WRITE_CODE` | إلى `DEPLOY_WITH_APPROVAL` عند النشر | يتطلب موافقة لكل نشر |
231
234
  | PerformanceAgent | `PERFORMANCE_AGENT` | `READ_ONLY` | إلى `WRITE_DOCS` عند توثيق التوصيات | يحلل فقط |
@@ -198,6 +198,49 @@ powershell -ExecutionPolicy Bypass -File .\tools\tera-tooling.ps1 -Install
198
198
 
199
199
  ---
200
200
 
201
+ ### 3.7 الأدوات الهجومية لفريق الحماية (SCP-2026-09-02-001)
202
+
203
+ تُستخدم فقط بواسطة عملاء فريق الحماية (الشبح/العين/القاضي) ضمن تفويض مكتوب — في بيئة Local/Staging معزولة ببيانات وهمية. لا تُستخدم على Production ولا على أطراف ثالثة.
204
+
205
+ | الأداة | الشكل | الاستخدام | ضمان التوفر |
206
+ |---|---|---|---|
207
+ | **Burp Suite Pro v2026.1.5** | JAR خارجي (Java) | الالتقاط + Repeater + Intruder — الأداة الهجومية الرئيسية | `java -jar <path>/burpsuite_pro_v2026.1.5.jar` — لا تُضمَّن ملفات الترخيص في المستودع |
208
+ | **OWASP ZAP** | تطبيق (Java) | DAST/Fuzzer احتياطي | تنزيل من zaproxy.org — بديل كامل لـ Burp مجاناً |
209
+ | **Nmap** | CLI | اكتشاف المنافذ والخدمات | `winget install Insecure.Nmap` |
210
+ | **ffuf** | CLI (Go) | Fuzzing المسارات والمعاملات | تنزيل من GitHub releases |
211
+ | **Nuclei** | CLI (Go) | قوالب الثغرات المعروفة | تنزيل من GitHub releases (projectdiscovery) |
212
+ | **sqlmap** | CLI (Python) | أتمتة SQL Injection | `pip install sqlmap` |
213
+ | **dalfox** | CLI (Go) | أتمتة XSS | تنزيل من GitHub releases (hahwul) |
214
+ | **Hydra** | CLI | Brute Force (ضمن حدود التفويض) | build من GitHub — إن لم يعمل على Windows: ZAP Fuzzer بديل |
215
+ | **Metasploit** | Framework | إثبات الاستغلال | مثبّت Rapid7 (Windows — محدود) + Docker/Kali كاحتياط كامل |
216
+ | **John the Ripper** | CLI | كسر الهاشات | تنزيل من GitHub (Jumbo build) |
217
+ | **Wireshark** | CLI/GUI | تحليل الحزم (العين) | `winget install WiresharkFoundation.Wireshark` |
218
+ | **k6** | CLI (Go) | اختبار التحمل (§15 البروتوكول) | `winget install GrafanaLabs.k6` — أُلغي تأجيله من §4 |
219
+
220
+ **قواعد الاستخدام الهجومي:**
221
+ 1. لا هجوم بلا `00_AUTHORIZATION.md` مكتمل في `security-reports/[ROUND-ID]/`.
222
+ 2. جميع الأدوات CLI — لا MCPs جديدة (لا استهلاك توكنز دائم).
223
+ 3. النتائج تُحفظ كأدلة في `security-reports/[ROUND-ID]/evidence/`.
224
+ 4. توقّف فوري عند مؤشرات الإيقاف (البروتوكول §18).
225
+ 5. Burp Suite Pro أداة تجارية — مسؤولية الترخيص على المالك؛ لا تُضمَّن ملفات تفعيل في المستودع.
226
+
227
+ ---
228
+
229
+ ### 3.8 خطة Cloud المرجعية — DigitalOcean (SCP-2026-09-02-001 — بلا تثبيت الآن)
230
+
231
+ عند أول رفع تطبيق على DigitalOcean، تُفعَّل هذه الحزمة في جلسة واحدة (Anti-Bloat: لا تثبيت قبل الحاجة):
232
+
233
+ | الأداة | الشكل | الاستخدام | التزويد |
234
+ |---|---|---|---|
235
+ | **doctl** | CLI رسمي من DO | إدارة/قراءة موارد DO (Droplets, Firewalls, Spaces, DNS...) | `winget install DigitalOcean.Doctl` |
236
+ | **compliancekit** | CLI مفتوح المصدر | 144 فحصاً لـ DO + 119 فحص CIS Linux — ينتج حزمة أدلة جاهزة للتدقيق | تنزيل من GitHub (darpanzope/compliancekit) + `DO_API_TOKEN` (read scope) |
237
+ | **DO CSPM** | مدمج في لوحة التحكم | فحص وضعية سحابي agentless (مجاني للقاعدة) | بلا أدوات — من لوحة DO |
238
+ | **Lynis** | CLI | تدقيق تصلب Linux على الـ Droplets | عبر SSH على الخادم |
239
+
240
+ **قاعدة:** تُفعَّل عند أول تطبيق Production على DO — لا قبلها.
241
+
242
+ ---
243
+
201
244
  ## 4. MCPs المؤجلة (ليست الآن)
202
245
 
203
246
  | الأداة | السبب | وقت التفعيل المقترح |
@@ -213,7 +256,7 @@ powershell -ExecutionPolicy Bypass -File .\tools\tera-tooling.ps1 -Install
213
256
  | **Monitoring / Logging MCPs** | غير ضرورية قبل وجود تطبيق قيد التشغيل الفعلي. | عند وجود تطبيق في Production يحتاج مراقبة. |
214
257
  | **SonarQube** | بوابة جودة مركزية قوية لكنها تحتاج خادماً + CI. Semgrep + Trivy + Gitleaks تغطي احتياجنا الحالي. | عند اعتماد CI/CD رسمي أو مشروع كبير يحتاج قياساً مستمراً للتغطية/التكرار. |
215
258
  | **Sentry MCP** | مراقبة الأخطاء — مفيدة فقط عند وجود تطبيق في Production. حالياً Sentry SDK قاعدة FLAG في التسليم. | عند أول تطبيق Production فعلي. |
216
- | **k6** | اختبارات أداء/ضغط — لا يوجد اشتراط أداء في عتبات القبول حالياً. | عند أول متطلب أداء (p95, concurrency) في تسليم عميل. |
259
+ | **k6** | ~~اختبارات أداء/ضغط~~ — **انتقل إلى §3.7 الأدوات الهجومية (SCP-2026-09-02-001)** — اختبار تحمل ضمن بروتوكول الأمن قبل التسليم | ✅ فُعّل 2026-09-02 |
217
260
 
218
261
  ---
219
262
 
@@ -26,6 +26,7 @@ It is a map, not a policy source. Rules remain in the files listed in `TeraPolic
26
26
  | Delivery, handoff, and closure | Produces final delivery readiness, release notes, client handover material, acceptance records, and closure reports | `project-control/DELIVERY_READINESS_REPORT.md`, `project-control/PROJECT_CLOSURE_REPORT.md`, `clients/.../delivery/` |
27
27
  | Project implementation knowledge | Maintains concise current-state operational knowledge per screen/module/service | `project-knowledge/` داخل كل تطبيق |
28
28
  | Tera distribution and versioning | Builds releases and distributes Tera to client repositories in a versioned, verifiable way; clients derive updates from the origin repository (`https://github.com/Alabasi1980/Teranoo-System`) via fetch + verified release packages (Tag `tera-vX.Y.Z` + Manifest + SHA lockfile + updater tools); npm packages `@tera-system/core 0.2.10` + `@tera-system/pro 0.2.14`; website `https://github.com/Alabasi1980/TeraWebsite` hosts bundle at `https://teranoo.com` and is deployed via `https://coolify.teranoo.com/`; ownership contract separates Tera-managed from client-owned files | `tera-system/TERA_DISTRIBUTION_POLICY.md` (§2.2 الحزم + §2.3 الموقع + §2.0 الأصالة), `tera-workshop/tools/tera-fetch.ps1`, `tera-workshop/tools/tera-release.ps1`, `tera-workshop/tools/tera-update.ps1`, `.tera/lock.json` داخل مستودعات العملاء |
29
+ | Security Team (فريق الحماية) | Adversarial security validation before delivery: الدرع (defensive review during dev) → الشبح (Red Team — authorized attacks, Black Box then Gray/White Box) → العين (concurrent observer) → القاضي (independent audit + gate decision). Activated only at Phase 7 security gate or by Majed request. Outputs under `security-reports/` (same repo, outside the application folder). SCP-2026-09-02-001 | `.opencode/agents/red-team-agent.md`, `.opencode/agents/security-observer.md`, `.opencode/agents/security-auditor.md`, `tera-system/TeraHelperAgents.md` §6.1, `security-reports/`, adversarial protocol v2.0 (outside repo) |
29
30
 
30
31
  ## 3. Folder Roles
31
32
 
@@ -47,6 +48,7 @@ It is a map, not a policy source. Rules remain in the files listed in `TeraPolic
47
48
  | `book/` | Comprehensive user-facing documentation and guides (Quick Start, Vision, Quality, Policies) | Runtime operational files; per-project records |
48
49
  | `book-pro-user-guide/` | دليل المشتري العملي لـ Pro — من التثبيت إلى التسليم (Onboarding) — 13 فصل + مولد HTML | Runtime operational files; per-project records |
49
50
  | `architecture/` | Structurizr C4 workspace (`.dsl` source of truth + exported diagrams) | Application code; client project files |
51
+ | `security-reports/` | Adversarial security validation outputs (authorization, attack surface, evidence, findings, observer/audit reports, gate decisions) — same repo, outside the application folder (SCP-2026-09-02-001) | Application code; client-owned files; system policy files |
50
52
 
51
53
  ## 4. Core Flow
52
54
 
@@ -214,7 +214,7 @@ If a file is not applicable to a very small project, Tera must still create an e
214
214
  | Gate 3: Flow Approval | The client confirms the main user and business flows. |
215
215
  | Gate 4: Screen Approval | The client confirms the screen list and screen purposes. |
216
216
  | Gate 5: Design Direction Approval | The client confirms visual direction, tone, and references. |
217
- | Gate 6: Prototype Approval | The client confirms the prototype or prototype plan when applicable. |
217
+ | Gate 6: Prototype Approval | The client confirms the actual prototype via a formal approval letter. Mandatory for all applications; only a documented Majed waiver (WAIVED_BY_MAJED) can exempt it. The prototype is a **priced, included line item**: 10% of the final price, auto-calculated in the pricing calculator, shown as a separate line in the quotation, and waived to 0% only when both parties agree the prototype is not needed at all (WAIVED_BY_MAJED + client consent — SCP-2026-09-01-001). Rejection of a built prototype does not cancel its cost; it is handled via the existing Fix / Change Request mechanism. |
218
218
  | Gate 7: Execution Authorization | The client authorizes moving into implementation. |
219
219
 
220
220
  ### Approval Record
@@ -37,13 +37,15 @@
37
37
 
38
38
  ---
39
39
 
40
- ## 6.1 SecurityAgent
40
+ ## 6.1 SecurityAgent — اللقب: الدرع 🛡️
41
41
 
42
42
  | البند | القيمة |
43
43
  |---|---|
44
44
  | المعرّف | `SECURITY_AGENT` |
45
+ | اللقب | **الدرع (The Shield)** |
45
46
  | الفئة | مشروط |
46
47
  | شرط الاستدعاء | بيانات حساسة، أسرار، Auth، Permissions، Middleware، Config، صلاحيات متقدمة، مدفوعات، إنترنت عام، حسابات إدارية مهمة |
48
+ | دوره في الفريق | **الدفاع** — عضو فريق الحماية (SCP-2026-09-02-001): يحمي أثناء البناء، يحضّر ملفات الهجوم، يراجع الإصلاحات |
47
49
 
48
50
  ### يقرأ
49
51
 
@@ -57,6 +59,7 @@ project-control/PROJECT_ACTIVITY_LOG.md عند الحاجة
57
59
  project-control/ISSUES_AND_GAPS.md عند وجود حادثة أو فجوة أمنية
58
60
  project-control/DECISIONS_LOG.md عند الحاجة
59
61
  project-control/TERA_ACTIVE_CONTEXT.md إذا كان موجودًا وطلبه Tera
62
+ security-reports/[ROUND-ID]/findings/ عند مراجعة الإصلاحات بعد جولة Red Team
60
63
  ```
61
64
 
62
65
  ### يساهم في
@@ -65,14 +68,27 @@ project-control/TERA_ACTIVE_CONTEXT.md إذا كان موجودًا وطلبه T
65
68
  15_SECURITY_AND_ACCESS_CONTROL.md
66
69
  16_AUDIT_LOG_AND_ACTIVITY_TRACKING.md
67
70
  21_VALIDATION_AND_ERROR_HANDLING.md
71
+ security-reports/[ROUND-ID]/defense-handoff.md ← ملف الدفاع المُسلَّم للـ Red Team
72
+ security-reports/[ROUND-ID]/fix-review.md ← مراجعة الإصلاحات بعد Findings
68
73
  ```
69
74
 
75
+ ### دوره في فريق الحماية (SCP-2026-09-02-001)
76
+
77
+ الدرع **عضو دفاعي** في فريق الحماية — لا يهاجم أبداً (فصل الأدوار ملزم بالبروتوكول §2):
78
+
79
+ 1. **أثناء التطوير:** مراجعة أمنية دفاعية — يقرأ الكود، يحلل الصلاحيات والجلسات والأسرار، يوثق findings.
80
+ 2. **قبل جولة Red Team:** يحضّر `defense-handoff.md` — البنية، الأدوار، مصفوفة الصلاحيات، مناطق الخطر المعروفة (يسلّمها Tera للشبح ضمن White Box).
81
+ 3. **بعد Findings:** يراجع الإصلاحات التي نفذها Engineering — `fix-review.md` — ويتأكد أنها أصلحت الجذر وليس العرض.
82
+ 4. **استشارياً:** يجيب عن أسئلة أمنية أثناء التطوير (Auth, JWT, Cookies, Middleware, Secrets).
83
+
70
84
  ### حدوده
71
85
 
72
86
  - لا يستبدل QA.
73
87
  - لا يغير UX إلا إذا وُجد خطر أمني.
74
88
  - لا يقرر تعطيل ميزة دون رفع القرار لتيرا.
75
89
  - لا يقبل المهمة بنفسه؛ يسلّم نتيجة المراجعة إلى Tera فقط.
90
+ - **لا ينفذ هجمات فعلية** — ذلك دور الشبح (Red Team Agent). الدرع لا يختبر ما قرأ أسراره — وإلا انكسرت Black Box.
91
+ - **لا يصدر قرار التسليم الأمني النهائي** — ذلك دور القاضي (Security Auditor).
76
92
  - عند مراجعة السجلات أو ملفات المهمة، يجب أن يراجع أيضًا النصوص التي أنشأها Tera نفسه، وليس فقط ملفات الكود التي أنشأها EngineeringAgent.
77
93
  - عند توثيق أي حادثة Secret Exposure أو ملاحظة أمنية، يجب استخدام `[REDACTED]` فقط وعدم إعادة كتابة القيمة المسرّبة.
78
94
 
@@ -64,7 +64,9 @@ Project files record project-specific decisions.
64
64
  | Technology profiles | `tera-system/profiles/` | `.opencode/agents/tera.md` | Stack-specific rules stay in profiles. |
65
65
  | Design governance layer | `tera-system/design-system/` | `.opencode/agents/tera.md`, `TERA_RUNTIME_CHECKLISTS.md`, `TERA_RUNTIME_PROTOCOLS_CORE.md` | Governs Design Source Decision, DESIGN.md integration, internal kits, design tokens, component rules, and UI Acceptance Gate. |
66
66
  | Monitor audit framework | `.opencode/agents/monitor.md` | `ENGINEERING_AGENT_RESPONSIBILITIES.md` | Governs the 7 immutable audit rules, reference hierarchy, plan rejection authority, and cumulative audit for plan-compliance checking. |
67
- | Auditor audit framework | `.opencode/agents/auditor.md` | `ENGINEERING_AGENT_RESPONSIBILITIES.md` | Governs Auditor as a Tera-managed quality gate sub-agent, including diff-first scope, evidence model, QUAUD reporting, and authorized invocation by Tera/Monitor. |
67
+ | Auditor audit framework | `.opencode/agents/auditor.md` | `ENGINEERING_AGENT_RESPONSIBILITIES.md` | Governs Auditor as a Tera-managed quality gate sub-agent, including diff-first scope, evidence model, QUAUD reporting, and authorized invocation by Tera/Monitor. |
68
+ | Security Team (فريق الحماية) — SCP-2026-09-02-001 | `.opencode/agents/red-team-agent.md` (الشبح) + `.opencode/agents/security-observer.md` (العين) + `.opencode/agents/security-auditor.md` (القاضي) + `tera-system/TeraHelperAgents.md` §6.1 (الدرع) | `security-reports/` في المستودع + البروتوكول الأمني v2.0 (خارج المستودع) | فريق أمني رباعي الأدوار: الدرع (دفاعي أثناء التطوير) + الشبح (هجومي — Phase 7 أو طلب Majed) + العين (مراقب متزامن) + القاضي (تدقيق مستقل وقرار البوابة). فصل الأدوار ملزم بالبروتوكول §2. التفعيل: Phase 7 أو طلب Majed فقط. المخرجات في `security-reports/` خارج مجلد التطبيق. |
69
+ | Adversarial Security Protocol | `F:\Teranoo Work\OnGoing\Security test\WEB_APPLICATION_SECURITY_TEST_PLAN_AR.md` (v2.0 — خارج المستودع) | `.opencode/agents/red-team-agent.md` | بروتوكول تيرانو للتحقق الهجومي من أمن تطبيقات الويب — OWASP ASVS 5.0 Level 2 + WSTG + API Top 10. ينفذه الشبح، يراقبه العين، يدققه القاضي. |
68
70
  | Quality gate thresholds | `tera-system/engineering-governance/QUALITY_GATE_THRESHOLDS.md` | `.opencode/agents/auditor.md`, `.opencode/agents/tera.md` | Compact reference for Auditor rule classes, evidence requirements, P1/P2 checks, and default heuristics. |
69
71
  | Project UI/UX executable guide | `project-preparation/28_UI_UX_GUIDELINES.md` using `TERA_RUNTIME_TEMPLATES_DELIVERY.md` Section 33 | `TASK_TEMPLATE.md`, `TeraPreExecutionGate.md` | Final executable visual design rules for EngineeringAgent; raw sources stay in `project-preparation/design-source/`. Split notice INS-02: Section 33 moved to DELIVERY file. |
70
72
  | Application proposal template | `tera-workshop/client-templates/commercial/APPLICATION_PROPOSAL_TEMPLATE.md` | `TERA_RUNTIME_TEMPLATES.md` (Section 26) | Formal proposal document. Generated after Client Discovery before formal preparation. |
@@ -107,6 +109,7 @@ Project files record project-specific decisions.
107
109
  | BTCA — Report Templates | `tera-system/consulting-helpers/BTCA_REPORT_TEMPLATES.md` | `.opencode/agents/tera-business-transformation-consultant.md` | قوالب التقارير العشرة الأساسية + التقرير التنفيذي. |
108
110
  | Tera distribution (versioned) | `tera-system/TERA_DISTRIBUTION_POLICY.md` (§2.2 الحزم + §2.3 الموقع + §2.0 الأصالة) | `.tera/lock.json` في مستودعات العملاء | توزيع Tera المُروّس: **RepositoryUrl `https://github.com/Alabasi1980/Teranoo-System`** + الحزم `@tera-system/core 0.2.10` / `@tera-system/pro 0.2.14` + **الموقع `https://github.com/Alabasi1980/TeraWebsite` + `https://teranoo.com` + منصة النشر `https://coolify.teranoo.com/`** + إصدارات (Tag+SHA) + عقد ملكية + أدوات `tera-workshop/tools/`. أي تعديل على ملفات Tera-managed يتطلب Tag+bundle+npm publish. SCP-2026-08-15-009 + SCP-2026-08-31-002 + SCP-2026-08-31-003. |
109
111
  | Source code ownership & pricing | `tera-system/TeraPricingPolicy.md` (§31) + `tera-system/TeraClientPolicy.md` (§9.5) | `tera-workshop/client-templates/contractual/SOURCE_CODE_PURCHASE_ADDENDUM_TEMPLATE.md`، `SOFTWARE_SERVICES_AGREEMENT` §12 | ملكية السورس افتراضياً لـ Tera (لا يُسلَّم للزبون) + خيارا L1 (40%) / L2 (max(3×، 1,000 JOD)) عبر ملحق تعاقدي + L3 (إعادة بيع) مرفوض افتراضياً. SCP-2026-08-29-004. |
112
+ | Prototype pricing mandate | `tera-system/TeraPricingPolicy.md` (§17.5) + `tera-system/TeraClientPolicy.md` (Gate 6) | `tera-workshop/client-templates/commercial/QUOTATION_TEMPLATE.md`, `project-control/TeraPricingCalculator.xlsx` | البروتوتايب التصميمي إلزامي لكل التطبيقات (SCP-2026-08-28-001) وهو **بند مسعّر مشمول**: 10% من السعر النهائي (B57) — يُحتسب تلقائياً في الحاسبة — يُعرض كبند منفصل في العرض — يُلغى إلى 0% فقط باتفاق الطرفين (WAIVED_BY_MAJED + موافقة الزبون). رفض البروتوتايب المعروض لا يُلغي تكلفته (Fix/CR). SCP-2026-09-01-001. |
110
113
  | Client letter numbering | `tera-system/TeraClientPolicy.md` (§9.6) + `project-control/CLIENT_CODES.md` | `client-approval/LETTER_LOG.md` في مستودع العميل | ترميز موحد `{كود-العميل}-{النوع}-{السنة}-{التسلسل}` — كود العميل يخصّصه Majed فقط (سجل مركزي) — الأنواع LET/CON/ADD/PAL/DOC/TPL (قابلة للزيادة). SCP-2026-08-29-005. |
111
114
  | Payment/Receipt vouchers | `tera-workshop/client-templates/financial/VOUCHER_DESIGN_SPEC.md` + `tera-system/TeraPricingPolicy.md` (§21) | `VOUCHER_RECEIPT_TEMPLATE.html` + `VOUCHER_PAYMENT_TEMPLATE.html` | سند قبض + سند صرف مستقلان (210×156مم، سند واحد في كل ملف، صورة الترويسة كاملة بعرض 210مم وارتفاعها الطبيعي) — `V2.png` للقبض و`V1.png` للصرف — ترقيم مالي مستقل `{السنة}-{تسلسل}` + حقل مرجع يربط بترميز خطابات العميل. SCP-2026-08-29-006/007/008/009/010/011. |
112
115
  | Pro User Guide (Onboarding) | `book-pro-user-guide/` (13 فصل + فهرس + مولد HTML) | `WELCOME.md` في الحزم (ملخص) | دليل المشتري العملي لـ `@tera-system/pro` — من `npm install` إلى التسليم. مكمل لـ `book/` الداخلي. لغة عربية + مصطلحات إنجليزية. SCP-2026-08-30-003. |
@@ -447,6 +447,22 @@ Minimum Profitable Price = Estimated Hours × Internal Hourly Rate
447
447
 
448
448
  ---
449
449
 
450
+ ## 17.5 البروتوتايب التصميمي — بند تسعير إلزامي (SCP-2026-09-01-001)
451
+
452
+ البروتوتايب التصميمي إلزامي لكل التطبيقات (SCP-2026-08-28-001) وهو **بند مسعّر مشمول في عرض السعر** — لا يُبنى خارج التسعير ولا يُترك ضمنياً داخل ساعات الواجهات.
453
+
454
+ | البند | القاعدة |
455
+ |---|---|
456
+ | **الإلزامية** | كل تطبيق (خارجي أو داخلي) يتطلب بروتوتايب تصميمي معتمد قبل التنفيذ — الاستثناء الوحيد: `WAIVED_BY_MAJED` (SCP-2026-08-28-001) |
457
+ | **النسبة** | 10% من **السعر النهائي** (B57 — بعد كل تعديلات Platform/Language/Add-ons/Risk/Rush وقبل الإجمالي النهائي) — قابلة للتعديل اليدوي في الحاسبة بقرار Majed فقط (الافتراضي 10%) |
458
+ | **الاحتساب** | تلقائي في `TeraPricingCalculator.xlsx` — `قيمة البروتوتايب = IF(مطلوب="نعم", ROUND(السعر_النهائي × النسبة, 0), 0)` |
459
+ | **العرض** | بند ظاهر منفصل في `DRAFT_QUOTATION.md` و`QUOTATION_TEMPLATE`: "البروتوتايب التصميمي — 10% من قيمة التطوير = X JOD" — السعر الإجمالي = السعر النهائي + قيمة البروتوتايب |
460
+ | **الإلغاء الوحيد** | اتفاق الطرفين (الزبون + Tera) على عدم الحاجة للبروتوتايب **أصلاً** — عبر `WAIVED_BY_MAJED` + موافقة الزبون — عندها النسبة = 0% تلقائياً ولا يُسعّر أي بروتوتايب |
461
+ | **رفض البروتوتايب المعروض** | رفض الزبون للبروتوتايب الذي **بُني وعُرض** (لم يُعجبه) لا يُلغي التكلفة — الجهد بُذل فعلاً؛ يُعالج عبر الآلية القائمة: تعديلات غير مؤثرة = Fix، مؤثرة = Change Request مسعّر (Gate 6 / SCP-2026-08-28-001) |
462
+ | **ساعات البروتوتايب** | تُقدَّر ضمن "واجهات وشاشات UI" في HoursEstimator — لا تُضاف كبند ساعات مستقل (لا تداخل) |
463
+
464
+ ---
465
+
450
466
  ## 18. الحد الأدنى المطلق
451
467
 
452
468
  ```text
@@ -155,13 +155,33 @@ Auditor (مُدقق) هو عميل جودة فرعي، وليس عميلاً ر
155
155
 
156
156
  `Model Capability Gate` is a Tera-side assessment only.
157
157
 
158
- It does not replace:
159
-
160
- - `SoftwareDesignerAgent`
161
- - `SecurityAgent`
162
- - `QAAndAcceptanceAgent`
163
- - `ProjectControlAgent`
164
- - `Post-Execution Review Gate`
158
+ It does not replace:
159
+
160
+ - `SoftwareDesignerAgent`
161
+ - `SecurityAgent`
162
+ - `QAAndAcceptanceAgent`
163
+ - `ProjectControlAgent`
164
+ - `Post-Execution Review Gate`
165
+
166
+ ### 3.2.3 Security Team (فريق الحماية — SCP-2026-09-02-001)
167
+
168
+ فريق أمني رباعي الأدوار للتحقق الهجومي قبل التسليم:
169
+
170
+ | الدور | اللقب | الملف | الوظيفة |
171
+ |---|---|---|---|
172
+ | دفاعي | الدرع | `TeraHelperAgents.md` §6.1 | مراجعة أمنية أثناء التطوير + تحضير ملفات الدفاع + مراجعة الإصلاحات |
173
+ | هجومي | الشبح | `.opencode/agents/red-team-agent.md` | اختبار هجومي فعلي (Black Box ثم Gray/White Box) |
174
+ | مراقب | العين | `.opencode/agents/security-observer.md` | مراقبة متزامنة للسجلات والموارد والـ Canary |
175
+ | مدقق | القاضي | `.opencode/agents/security-auditor.md` | تدقيق الأدلة + قرار بوابة الأمن (PASS/CONDITIONAL/FAIL/INCOMPLETE) |
176
+
177
+ قواعد الفريق:
178
+
179
+ - **فصل الأدوار ملزم** (البروتوكول §2): من نفّذ الهجوم لا يدقق. من راقب لا يحكم.
180
+ - **التفعيل:** Phase 7 (بوابة التسليم) أو طلب Majed الصريح فقط — لا تفعيل تلقائي في Phases 1–6.
181
+ - **المخرجات:** `security-reports/` في نفس المستودع خارج مجلد التطبيق.
182
+ - **التفويض:** لا هجوم بلا `00_AUTHORIZATION.md` مكتمل (نطاق + بيئة + حدود + مؤشرات إيقاف).
183
+ - **الأدلة:** لا PASS بلا Request/Response فعلي أو Artifact موثق — غياب الثغرة من Scanner ليس نجاحاً.
184
+ - **قرار التسليم:** القاضي وحده يصدر قرار بوابة الأمن — بعد Red Team + Observer + Fixes + Retest.
165
185
 
166
186
  Its role is to help Tera decide whether the current model is sufficient, sufficient with safeguards, needs escalation, or whether the task should be split first.
167
187
 
@@ -98,7 +98,7 @@ description: TCEA pricing workflow, tools, reference sources, and client documen
98
98
  5. **اختر المضاعفات** — المنصة (Web/Mobile/PWA)، اللغة، هامش المخاطر، بدل الاستعجال
99
99
  6. **أضف الإضافات** — حدد مستوى كل Add-on. ⚠️ قاعدة التناسب: مجموع Add-ons ≤ 50% من Base Price
100
100
  7. **أدخل الساعات المقدرة** — السعر المعتمد لا يقل عن: الساعات × 4 JOD
101
- 8. **اقرأ النتيجة** — السعر المعتمد النهائي + فحص التناسب + تصنيف السعر
101
+ 8. **اقرأ النتيجة** — السعر المعتمد النهائي + فحص التناسب + تصنيف السعر + **بند البروتوتايب** (اقرأ القيمة التلقائية من الخلية B67 — 10% من السعر النهائي — والإجمالي شامل البروتوتايب من B68 — SCP-2026-09-01-001). إذا كانت B65 = "لا (WAIVED)" (اتفاق الطرفين على عدم الحاجة أصلاً) → القيمة 0 وتُحذف من العرض.
102
102
  9. **استخدم قائمة الاعتماد** — TeraPricingPolicy.md §29 (14 سؤالاً) — جميع الإجابات "نعم" إلزامياً
103
103
  10. **املأ قالب الخطاب الرسمي** — `letterhead-master-fixed-print.html` معبأ ببيانات المشروع والسعر
104
104
 
@@ -172,6 +172,16 @@ Exit Gate:
172
172
  - [ ] Deferred Items documented.
173
173
  - [ ] Final closure decision recorded in `PROJECT_ACTIVITY_LOG.md` and `PROJECT_STATE.md`.
174
174
 
175
+ **Security Gate (SCP-2026-09-02-001 — Team Security):**
176
+
177
+ - [ ] Tera decided: `SECURITY_TEST_REQUIRED` / `SECURITY_TEST_WAIVED_BY_MAJED` (with documented reason) for this delivery.
178
+ - [ ] If required: Red Team (الشبح) engagement completed → `security-reports/[ROUND-ID]/` contains authorization, attack surface, evidence, findings.
179
+ - [ ] Observer (العين) report completed concurrently.
180
+ - [ ] All Critical/High findings fixed (or accepted in writing by Majed) and retested by الشبح.
181
+ - [ ] القاضي (Security Auditor) issued final gate decision: **PASS / CONDITIONAL PASS / FAIL / INCOMPLETE**.
182
+ - [ ] Delivery is BLOCKED until gate = PASS or CONDITIONAL PASS (accepted Medium/Low only).
183
+ - [ ] For small internal projects: Majed may waive the full engagement (`SECURITY_TEST_WAIVED_BY_MAJED`) but the gate decision must still be recorded.
184
+
175
185
  If Phase 7 finds a blocking issue:
176
186
 
177
187
  1. Do not fix it inside Phase 7.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tera-system/core",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Tera System OpenCode Plugin أ¢â‚¬â€‌ governance core, 20 agents, 11 commands, distribution tools (personal edition)",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",