@tera-system/core 0.6.0 → 0.7.0

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.
Files changed (43) hide show
  1. package/MANIFEST.json +8 -8
  2. package/RELEASES.md +28 -0
  3. package/agents/auditor.md +3 -3
  4. package/agents/engineering-agent-dotnet.md +30 -4
  5. package/agents/engineering-agent-flutter.md +5 -5
  6. package/agents/engineering-agent-typescript.md +70 -38
  7. package/agents/engineering-agent.md +12 -72
  8. package/agents/security-agent.md +200 -0
  9. package/agents/security-observer.md +2 -2
  10. package/agents/tera-client-engagement.md +1 -1
  11. package/agents/tera-software-designer.md +88 -54
  12. package/agents/tera-system-evolution.md +7 -7
  13. package/agents/tera.md +36 -6
  14. package/agents/ui-designer.md +1 -1
  15. package/assets/structurizr-mcp/pyproject.toml +1 -1
  16. package/assets/structurizr-mcp/uv.lock +816 -770
  17. package/commands/tera-orient-shield.md +14 -0
  18. package/commands/tera-orient-software-designer.md +1 -1
  19. package/commands/tera-orient-tera.md +1 -1
  20. package/core/tera-system/AGENT_ACTIVATION_MATRIX.md +4 -2
  21. package/core/tera-system/AGENT_DEPENDENCY_MAP.md +2 -1
  22. package/core/tera-system/AGENT_PERMISSION_MODEL.md +4 -4
  23. package/core/tera-system/SECURITY_TEAM_CHARTER.md +1 -1
  24. package/core/tera-system/TERA_DISTRIBUTION_POLICY.md +7 -4
  25. package/core/tera-system/TeraArchitectureMap.md +2 -2
  26. package/core/tera-system/TeraCapabilityMap.md +2 -2
  27. package/core/tera-system/TeraHelperAgents.md +1 -0
  28. package/core/tera-system/TeraPolicyMap.md +2 -2
  29. package/core/tera-system/TeraPreExecutionGate.md +18 -5
  30. package/core/tera-system/TeraSubAgents.md +14 -11
  31. package/core/tera-system/design-system/DESIGN_REVIEW_STANDARDS.md +2 -0
  32. package/core/tera-system/engineering-helpers/engineering-agent-core.md +19 -13
  33. package/core/tera-system/profiles/PROFILES_INDEX.md +3 -1
  34. package/core/tera-system/profiles/dotnet-razorpages-adonet.md +44 -43
  35. package/core/tera-system/profiles/dotnet-wpf-sqlite.md +17 -17
  36. package/core/tera-system/profiles/flutter-mobile.md +2 -2
  37. package/core/tera-system/profiles/rust.md +7 -6
  38. package/core/tera-system/runtime/AGENT_SELF_ORIENTATION_PROTOCOL.md +1 -0
  39. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CORE.md +2 -0
  40. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES.md +14 -0
  41. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_DELIVERY.md +1 -0
  42. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_PREPARATION.md +1 -1
  43. package/package.json +2 -2
@@ -3,45 +3,45 @@
3
3
  ## 1. Profile Identity
4
4
 
5
5
  - Profile ID: `dotnet-razorpages-adonet`
6
- - Language: C#
7
- - Framework: ASP.NET Core Razor Pages (.NET 8 LTS)
8
- - Database: SQL Server (destination) + Oracle (source, read-only via ODP.NET)
9
- - ORM: ADO.NET SqlBulkCopy (data loading), Entity Framework Core (config + logs only)
6
+ - Language: C# (.NET 8 LTS)
7
+ - Framework: ASP.NET Core Razor Pages (server-rendered)
8
+ - Database: SQL Server (destination) + an approved external read-only source (e.g., Oracle — per project)
9
+ - ORM: ADO.NET SqlBulkCopy (bulk data loading), Entity Framework Core (config + logs only)
10
10
  - Package Manager / CLI: dotnet CLI, NuGet
11
- - UI Library: Syncfusion (Blazor/Razor components via TagHelpers or JS interop)
11
+ - UI Library: the project's approved UI component library (per profile/design system)
12
12
  - Default Project Type: Internal business application with data integration
13
13
 
14
14
  ## 2. Applicability
15
15
 
16
16
  Use this profile when:
17
- - The approved architecture uses ASP.NET Core Razor Pages (not Blazor Server/WebAssembly)
18
- - The application needs to connect to Oracle as a data source (read-only)
19
- - Data is loaded into SQL Server via ADO.NET SqlBulkCopy for performance
17
+ - The approved architecture uses ASP.NET Core Razor Pages (server-rendered, not SPA)
18
+ - The application integrates data from an **approved external read-only source** (e.g., Oracle)
19
+ - Data is bulk-loaded into SQL Server via ADO.NET SqlBulkCopy for performance
20
20
  - EF Core is used only for application-level configuration and logging
21
- - The application is deployed on IIS (local or on-premise)
21
+ - The application is hosted on IIS (local or on-premise — as approved)
22
22
 
23
23
  This profile covers:
24
24
  - ASP.NET Core Razor Pages (server-rendered, not SPA)
25
- - Oracle.ManagedDataAccess (ODP.NET) for Oracle connectivity
26
- - ADO.NET SqlBulkCopy for high-performance data transfer
25
+ - An approved external source connector (e.g., Oracle.ManagedDataAccess / ODP.NET)
26
+ - ADO.NET SqlBulkCopy for high-performance bulk data transfer
27
27
  - EF Core for config/logs tables only
28
- - Syncfusion components for dashboard/report UI
28
+ - The project's approved UI component library for views/reports
29
29
  - IIS hosting model
30
30
 
31
31
  ## 3. Default Execution Order
32
32
 
33
- 1. Scaffold the .NET solution structure (API project + Razor Pages project).
34
- 2. Add only the required base packages (ODP.NET, EF Core, Syncfusion license key).
33
+ 1. Scaffold the .NET solution structure (service project + Razor Pages project).
34
+ 2. Add only the required base packages (source connector, EF Core, approved UI library). **أي ترخيص لمكتبة UI مرخّصة يُحمَّل من مصدر secret/config معتمد — لا يُثبَّت (hardcode)** (PROFILE-DN-F05).
35
35
  3. Create config/logs database schema (EF Core entities + migrations).
36
- 4. Build Oracle connection and data extraction layer (ODP.NET).
37
- 5. Build SQL Server data loading layer (SqlBulkCopy).
38
- 6. Build Sync Engine (full refresh + incremental-ready architecture).
39
- 7. Build Sync Logs and monitoring.
40
- 8. Build Dashboard layout and rendering (Razor Pages + Syncfusion).
41
- 9. Build Drill Down and navigation.
42
- 10. Build Admin Panel (Card CRUD + config).
43
- 11. Integrate Sync Status display in Dashboard.
44
- 12. IIS deployment configuration.
36
+ 4. Build the external-source connection and extraction layer.
37
+ 5. Build the SQL Server bulk-loading layer (SqlBulkCopy).
38
+ 6. Build the sync engine (full refresh + incremental-ready architecture).
39
+ 7. Build sync logs and monitoring.
40
+ 8. Build the main views and rendering (Razor Pages + approved UI library).
41
+ 9. Build drill-down and navigation.
42
+ 10. Build the configuration/admin area for the project's config entities.
43
+ 11. Integrate sync-status display in the views.
44
+ 12. Hosting / IIS deployment configuration.
45
45
 
46
46
  ## 4. First Task Rule
47
47
 
@@ -49,17 +49,18 @@ Safe first task:
49
49
 
50
50
  ```text
51
51
  Scaffold .NET 8 solution structure with two projects:
52
- WarehouseDashboard.Api (Console / Worker Service for sync engine)
53
- WarehouseDashboard.Web (ASP.NET Core Razor Pages)
54
- + Add base packages: Oracle.ManagedDataAccess.Core, Microsoft.Data.SqlClient,
55
- Microsoft.EntityFrameworkCore.SqlServer, Syncfusion.Blazor (for license)
52
+ {Solution}.Api (Console / Worker Service for the sync engine)
53
+ {Solution}.Web (ASP.NET Core Razor Pages)
54
+ + Add base packages: the approved source connector (e.g., Oracle.ManagedDataAccess.Core),
55
+ Microsoft.Data.SqlClient, Microsoft.EntityFrameworkCore.SqlServer,
56
+ and the approved UI component library
56
57
  + Verify solution builds cleanly
57
58
  ```
58
59
 
59
60
  **Do NOT** in the first task:
60
61
  - Add EF Core entities
61
62
  - Add migrations or database update
62
- - Add Oracle connection logic
63
+ - Add external-source connection logic
63
64
  - Add any business logic
64
65
  - Add any UI rendering
65
66
  - Add authentication/authorization
@@ -69,28 +70,28 @@ Scaffold .NET 8 solution structure with two projects:
69
70
  - Use `dotnet new razor` for the Web project, `dotnet new console` or `dotnet new webapi` for the API project.
70
71
  - Solution file should be at root with two project references.
71
72
  - Keep the first task limited to project structure and minimum approved packages.
72
- - Syncfusion license key is set via `Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense()` in `Program.cs`.
73
+ - مكتبة UI المرخّصة: `Program.cs` يجوز أن يستدعي واجهة تسجيل الترخيص (مثل `SyncfusionLicenseProvider.RegisterLicense(value)`) حيث `value` يُحمَّل من **مصدر secret/config معتمد**. **لا تُثبَّت القيمة في المصدر** (PROFILE-DN-F05).
73
74
  - IIS hosting: configure `appsettings.json` with `"Urls": "http://localhost:5000"` as default, configurable via IIS.
74
75
 
75
76
  ## 6. ORM / Database Rules
76
77
 
77
78
  **Entity Framework Core (Config + Logs only):**
78
- - Used exclusively for `WarehouseDashboardDbContext` with Config entities (CardConfig, DataSourceConfig, etc.) and Log entities (SyncLog, ErrorLog, etc.).
79
+ - Used exclusively for the project's DbContext with Config entities and Log entities.
79
80
  - `dotnet ef migrations add` belongs to a separate migration task.
80
81
  - `dotnet ef database update` is forbidden unless the task is explicitly a database apply task.
81
- - Do not use EF Core for Oracle data entities or bulk operations.
82
+ - Do not use EF Core for external-source data entities or bulk operations.
82
83
 
83
84
  **ADO.NET / SqlBulkCopy (Data Loading):**
84
- - Used for all Oracle-to-SQL Server data transfer.
85
+ - Used for all external-source → SQL Server data transfer.
85
86
  - SqlBulkCopy belongs to a dedicated data-loading task.
86
- - Oracle connection is via `Oracle.ManagedDataAccess.Client.OracleConnection`.
87
+ - External source connection is via the approved connector (e.g., `Oracle.ManagedDataAccess.Client.OracleConnection`).
87
88
  - Full Refresh = DELETE all rows + SqlBulkCopy.WriteToServer in single transaction.
88
89
  - Incremental Sync ready architecture = track LastSyncTimestamp, support Upsert pattern.
89
90
 
90
- **Oracle (Read-Only Source):**
91
- - ODP.NET connections are read-only by convention.
92
- - Oracle table details are deferred — client provides during execution.
93
- - Oracle Managed Data Access (NuGet: Oracle.ManagedDataAccess.Core).
91
+ **External Source (Read-Only):**
92
+ - Source connections are read-only by convention.
93
+ - Source table details are deferred — provided during execution per project.
94
+ - Connector package: the approved one (e.g., Oracle.ManagedDataAccess.Core).
94
95
 
95
96
  ## 7. CLI Side Effects
96
97
 
@@ -107,12 +108,12 @@ Do not add by default in the first implementation task:
107
108
 
108
109
  - EF Core entities or DbContext
109
110
  - Migrations or database update
110
- - Oracle connection logic
111
+ - External-source connection logic
111
112
  - SyncEngine logic
112
113
  - Dashboard UI
113
114
  - Admin Panel
114
115
  - Authentication/Authorization
115
- - Custom UI styling beyond Syncfusion defaults
116
+ - Custom UI styling beyond the approved UI library defaults
116
117
  - Repository layer without clear need
117
118
  - SignalR or real-time features
118
119
  - Background services (unless explicitly delegated)
@@ -120,10 +121,10 @@ Do not add by default in the first implementation task:
120
121
  ## 9. Pre-Execution Gate Additions
121
122
 
122
123
  - Confirm scaffold task does not silently add Identity, EF migrations, or extra hosting layers.
123
- - Confirm ODP.NET is isolated from EF Core DbContext (separate concerns).
124
- - Confirm SqlBulkCopy tasks are not combined with Oracle extraction tasks unless the task explicitly combines them with approval.
124
+ - Confirm the source connector is isolated from the EF Core DbContext (separate concerns).
125
+ - Confirm SqlBulkCopy tasks are not combined with source-extraction tasks unless the task explicitly combines them with approval.
125
126
  - Confirm database update commands are isolated in dedicated tasks.
126
- - Confirm Syncfusion license key is registered before any component usage.
127
+ - Confirm any licensed UI library's value is loaded from an approved secret/config source (not hardcoded) before use.
127
128
  - Confirm IIS hosting model is configured correctly (no Kestrel-only assumptions).
128
129
 
129
130
  ## 10. Acceptance Criteria Patterns
@@ -131,7 +132,7 @@ Do not add by default in the first implementation task:
131
132
  - .NET 8 solution builds cleanly with both projects.
132
133
  - Required packages are installed and version-compatible.
133
134
  - Solution can be published for IIS deployment (`dotnet publish -c Release`).
134
- - Oracle connection can be established (tested in dedicated task).
135
+ - External-source connection can be established (tested in dedicated task).
135
136
  - SQL Server config/logs schema can be created (tested in dedicated task).
136
137
  - No unapproved packages, entities, migrations, or auth were added.
137
138
  - No unapproved database changes were applied.
@@ -42,20 +42,20 @@
42
42
  11. Auto Backup
43
43
  12. اختبار + تسليم
44
44
 
45
- ## 4. First Task Rule
45
+ ## 4. First Task Rule — تفكيك (PROFILE-DN-F01)
46
46
 
47
- أول مهمة تنفيذ آمنة:
47
+ أول مهمة **ضيّقة** (لا دمج scaffold + DB + migration في مهمة واحدة):
48
48
 
49
49
  ```text
50
- TASK-COD-001: Scaffold WPF Project + SQLite Setup
50
+ TASK-COD-001: WPF Scaffold + الحزم المعتمدة فقط
51
+ TASK-COD-002: SQLite/EF Model + DbContext
52
+ TASK-COD-003: توليد Migration + مراجعة + تفويض التطبيق المحلي
53
+ TASK-COD-004: أول تدفق وظيفي (Login/Settings)
51
54
  ```
52
55
 
53
- يشمل:
54
- - `dotnet new wpf` مع هيكل MVVM (Models, ViewModels, Views, Services, Data)
55
- - إضافة حزمة `CommunityToolkit.Mvvm` و `Microsoft.EntityFrameworkCore.Sqlite`
56
- - إنشاء ApplicationDbContext + Seed (إن وجد)
57
- - تطبيق أول Migration
58
- - التأكد من أن التطبيق يشتغل (Run دون أخطاء)
56
+ - COD-001: `dotnet new wpf` + هيكل MVVM (Models, ViewModels, Views, Services, Data) + `CommunityToolkit.Mvvm` + `Microsoft.EntityFrameworkCore.Sqlite` — **دون** Migration أو Apply.
57
+ - COD-002: Entities + `AppDbContext` (+ Seed عند وجوده).
58
+ - COD-003: `dotnet ef migrations add` + مراجعة SQL + **تطبيق محلي مصرّح فقط**.
59
59
 
60
60
  ## 5. Scaffold Rules
61
61
 
@@ -63,17 +63,16 @@ TASK-COD-001: Scaffold WPF Project + SQLite Setup
63
63
  # إنشاء مشروع WPF
64
64
  dotnet new wpf -n MyApp -o .\src\MyApp
65
65
 
66
- # إضافة الحزم الأساسية
66
+ # الحزم الأساسية فقط
67
67
  dotnet add .\src\MyApp\MyApp.csproj package CommunityToolkit.Mvvm
68
68
  dotnet add .\src\MyApp\MyApp.csproj package Microsoft.EntityFrameworkCore.Sqlite
69
- dotnet add .\src\MyApp\MyApp.csproj package QuestPDF # للـ PDF
70
- dotnet add .\src\MyApp\MyApp.csproj package Microsoft.Office.Interop.Outlook
71
69
 
72
70
  # إنشاء مجلدات الهيكل
73
71
  New-Item -ItemType Directory -Path .\src\MyApp\Models, .\src\MyApp\ViewModels, .\src\MyApp\Views, .\src\MyApp\Services, .\src\MyApp\Data
74
72
  ```
75
73
 
76
74
  **قيود الـ Scaffold:**
75
+ - **حزم متأخرة (PROFILE-DN-F02):** `QuestPDF` تُضاف في **مهمة PDF فقط**، و`Microsoft.Office.Interop.Outlook` في **مهمة Outlook فقط** — لا في الـscaffold.
77
76
  - لا تنشئ `Views/` افتراضية غير Shutdown
78
77
  - لا تعدل `App.xaml` لتغيير StartupUri قبل تجهيز MainWindow
79
78
  - لا تنشئ واجهات Login قبل تجهيز منطق المصادقة
@@ -82,8 +81,9 @@ New-Item -ItemType Directory -Path .\src\MyApp\Models, .\src\MyApp\ViewModels, .
82
81
  ## 6. ORM / Database Rules
83
82
 
84
83
  - **حدود الـ EF Core Migrations:**
85
- - `Add-Migration <name>` لإنشاء migration
86
- - `Update-Database` لتطبيقها
84
+ - `dotnet ef migrations add <name>` لإنشاء migration (CLI المعلن — PROFILE-DN-F03)
85
+ - `dotnet ef database update` لتطبيقها — **بعد تفويض صريح للبيئة المحلية فقط**
86
+ - (Package Manager Console يعادلها `Add-Migration` / `Update-Database`، لكن استخدم `dotnet ef` حسب CLI المعلن)
87
87
  - لا تحذف migration موجودة
88
88
  - لا تعدل migration يدوياً إلا لتصحيح خطأ محدد
89
89
 
@@ -109,8 +109,8 @@ New-Item -ItemType Directory -Path .\src\MyApp\Models, .\src\MyApp\ViewModels, .
109
109
  | `dotnet add package ...` | يعدّل `.csproj` (إضافة PackageReference) |
110
110
  | `dotnet build` | لا تأثير جانبي — آمن |
111
111
  | `dotnet run` | لا تأثير جانبي — آمن |
112
- | `Add-Migration` | ينشئ ملف `.cs` في `Migrations/` |
113
- | `Update-Database` | ينشئ/يعدّل ملف `SQLite.db` في مجلد المشروع |
112
+ | `dotnet ef migrations add` | ينشئ ملف `.cs` في `Migrations/` |
113
+ | `dotnet ef database update` | ينشئ/يعدّل ملف `SQLite.db` في مجلد المشروع — بعد تفويض صريح |
114
114
  | `dotnet publish` | ينشئ مجلد `publish/` بالمخرجات القابلة للتوزيع |
115
115
 
116
116
  ## 8. Forbidden Defaults
@@ -124,7 +124,7 @@ New-Item -ItemType Directory -Path .\src\MyApp\Models, .\src\MyApp\ViewModels, .
124
124
  - ❌ **لا** إشعارات النظام
125
125
  - ❌ **لا** خلفية سيرفر DB (SQL Server, PostgreSQL)
126
126
  - ❌ **لا** Docker
127
- - ❌ **لا** Unit Tests (للمشاريع الصغيرة جداً — يُضاف إذا طُلب)
127
+ - ❌ **لا** إنشاء مشروع Test واسع في الـscaffold افتراضياً — تُضاف اختبارات **مركّزة** عندما يبرّرها السلوك/الخطر (PROFILE-DN-F04)
128
128
  - ❌ **لا** API endpoints
129
129
  - ❌ **لا** SignalR أو WebSockets
130
130
 
@@ -13,7 +13,7 @@ It is a **stack-specific Technology Profile** — loaded only when a project is
13
13
  | Profile ID | `flutter-mobile` |
14
14
  | Stack | Flutter + Dart |
15
15
  | Minimum Dart SDK | 3.0+ |
16
- | Minimum Flutter SDK | 3.16+ (current stable channel) |
16
+ | Minimum Flutter SDK | 3.16+ (حد أدنى؛ الفعلي = أحدث stable — يُسجَّل لكل مشروع في `PROJECT_RULES.md` §12) |
17
17
  | Status | Available |
18
18
  | Actual SDK | Log the per-project Flutter/Dart versions in `PROJECT_RULES.md` (required — §12) |
19
19
  | Owner | Tera Agent (decision engine) / EngineeringAgent (execution) |
@@ -366,5 +366,5 @@ Flutter release notes:
366
366
  - **Current Profile Version:** 1.0.0
367
367
  - **Last Updated:** 2026-07-15
368
368
  - **Maintainer:** TeraSystemEvolutionAgent (حارس)
369
- - **Flutter Baseline:** 3.16+ (stable channel)
369
+ - **Flutter Baseline:** 3.16+ (حد أدنى — النسخة الفعلية هي أحدث stable مُسجَّلة لكل مشروع)
370
370
  - **Dart Baseline:** 3.0+
@@ -1,7 +1,7 @@
1
1
  # Technology Profile: rust
2
2
 
3
- > **Status: Draft — Needs Verification** (SCP-2026-09-04-011)
4
- > مبني على بحث عميق 2026 من مصادر موثوقة (16 مصدراً: Corgea, Rust 2026 Template, onehorizon, Apollo skills, RuleSync, Agentbrisk, Axum/SQLx production guides...). **لم يُثبت بعد ببناء/اختبار فعلي محلي** (cargo غير مثبت على بيئة الإنشاء عند كتابة هذا البروفايل). ترقية الحالة إلى `Available` بعد تجربة تحقق (انظر §10).
3
+ > **Status: ✅ Available — Verified** (SCP-2026-09-04-011 → مُثبَّت عبر Pilot GEN-F05 · SCP-2026-09-29-017)
4
+ > مبني على بحث عميق 2026 من مصادر موثوقة (16 مصدراً: Corgea, Rust 2026 Template, onehorizon, Apollo skills, RuleSync, Agentbrisk, Axum/SQLx production guides...). **مُثبَّت الآن ببناء/اختبار فعلي محلي** (2026-09-29 — Pilot GEN-F05: `cargo build` + `cargo test` 2/2 + `clippy -D warnings` صفر + `fmt --check` PASS على rustc/cargo 1.98.1، بتحقق مستقل).
5
5
 
6
6
  ## 1. Profile Identity
7
7
 
@@ -152,12 +152,13 @@ large_enum_variant = "warn"
152
152
  ✅ لـ UI (Tauri/Web): Playwright/axe وفق قواعد المنظومة
153
153
  ```
154
154
 
155
- ### مسار الترقية إلى Available (خطوة التحقق المتبقية — بيئة تنفيذ بها cargo)
155
+ ### مسار الترقية ⟶ ✅ مُنجَز (Pilot GEN-F05 — 2026-09-29)
156
156
 
157
157
  ```text
158
- 1. cargo new verify-rust-cli → build + test + clippy -D warnings + fmt --check → PASS
159
- 2. (اختياري) مشروع Axum+SQLx صغير → build + migrate + test → PASS
160
- 3. عند النجاح: رفع حالة هذا البروفايل من "Draft" → "Available" في §1 + PROFILES_INDEX + TeraCapabilityMap
158
+ 1. ✅ cargo new verify-rust-cli → build + test (2/2) + clippy -D warnings (صفر) + fmt --check → PASS
159
+ [rustc/cargo 1.98.1 · تحقق مستقل — SCP-2026-09-29-017]
160
+ 2. ⏳ (اختياري، غير مُنجَز) مشروع Axum+SQLx صغير → build + migrate + test
161
+ 3. ✅ رُفعت الحالة "Draft" → "Available" في §1 + PROFILES_INDEX + TeraCapabilityMap
161
162
  ```
162
163
 
163
164
  ---
@@ -57,6 +57,7 @@
57
57
  - **التعارض في المصادر:** توقف + `Uncertainty Rule` (أخبر المالك بالقصد والسبب والقرار المطلوب).
58
58
  - **مهمة واردة أثناء التهيئة:** أكمل التهيئة أولاً ثم عالج المهمة.
59
59
  - **عميل سبق أن درس في جلسة سابقة:** التهيئة إلزامية في كل جلسة جديدة (الذاكرة لا تعبر الجلسات — `TeraTokenPolicy.md`).
60
+ - **جلسة مستأنفة (RESUME):** التهيئة الكاملة غير لازمة — تطبَّق حوكمة الجلسات في `TERA_RUNTIME_TEMPLATES.md` §2 (قرص-حقيقة + CONTEXT_LOST).
60
61
 
61
62
  ---
62
63
 
@@ -259,6 +259,8 @@ Before delegation:
259
259
  6. Apply Pre-Execution Gate.
260
260
  7. Delegate to the appropriate sub-agent.
261
261
 
262
+ > **حوكمة الجلسات (Session: NEW/RESUME + CONTEXT_LOST):** مرجعها `TERA_RUNTIME_TEMPLATES.md` §2 — حقل التفويض ومصفوفة القرار (التوازي والـfallback) لا تُنسخ هنا.
263
+
262
264
  After execution:
263
265
 
264
266
  1. Record the sub-agent handback in `project-control/tasks/[TASK-ID].md`.
@@ -36,6 +36,7 @@ For every delegated task, specify:
36
36
  ```text
37
37
  Task ID:
38
38
  Requested Agent:
39
+ Session: NEW | RESUME <task_id> — سبب من سطر واحد (المصفوفة في ملاحظة الحوكمة أدناه)
39
40
  Stage:
40
41
  Objective:
41
42
  Context Type:
@@ -60,6 +61,19 @@ Return Status Required:
60
61
  > المدقق يكتشف النطاق الفعلي بنفسه (`git status` / `git diff`). تقرير المنفذ Context فقط — ليس Evidence.
61
62
  > القاعدة المركزية: **المدقق يجب أن يكون قادراً على الوصول إلى FAIL لم يكن TeraAgent يتوقعه أصلًا.**
62
63
 
64
+ > **مهام معزولة (Allowed Write Targets = مجلد المهمة فقط) — SCP-2026-09-29-002:** إن كان المنفّذ ملزماً بتوثيق مراجع بصرية (`design-source/REFERENCES.md`) لكنه مقيّد بمجلد المهمة → اسمح له بملف `REFERENCES.md` **داخل مجلد المهمة** (يُنقل لاحقاً)، أو اكتفِ بالمراجع في الـhandback. لا تطلب كتابة خارج النطاق.
65
+
66
+ > **قيد طول الـHandback — SCP-2026-09-29-002:** اطلب handback **≤80 سطراً — بلا full diffs** (الملفات على القرص تكفي). وإن عاد المنفّذ `completed` بنص فارغ → **لا تفترض النجاح**: تحقّق من القرص، وأعد التفويض **مقيّداً** بالقيد نفسه بدل إعادة المحاولة المطابقة.
67
+
68
+ > **حوكمة جلسات العملاء الفرعيين — SCP-2026-09-30-004 (حقل Session):**
69
+ > - الاستئناف **تحسين لا اعتماد** — «عند الشك: NEW» (إعادة القراءة أرخص من ذاكرة ملوّثة).
70
+ > - **RESUME** فقط إذا: نفس النطاق/الملفات/التطبيق · جلسة حديثة معلومة الحالة · حملت ≤3 مهام · بلا صراع كتابة مع جلسة أخرى.
71
+ > - **NEW**: نطاق/عميل مختلف · سياق قديم أو متضخم · عزل تدقيق مطلوب (Red Team / clean-room / diff نظيف لكل مهمة).
72
+ > - **توازٍ (جلسات متعددة لنفس النوع):** لكل مهمة task_id مستقل، **بـAllowed Write Targets متباعدة فقط** — لا جلسة تكتب ما تكتبه أخرى.
73
+ > - **فحص الوعي عند RESUME:** أدرج في نص التفويض «ستجد سياق جلسة [task_id]؛ إن لم تجده أعلن CONTEXT_LOST وأعد التوجيه من <ملف المهمة>». عند CONTEXT_LOST/فشل → **NEW بنفس الحزمة** — لا افتراض نجاح ولا مكابرة.
74
+ > - **عند RESUME — القرص هو الحقيقة:** تحقّق أولاً من القرص (task file + آخر handback + حالة النطاق) قبل الاعتماد على الذاكرة؛ الذاكرة **توفير** والقرص **يحسم**. وإن لم يطابق وصف النطاق المطلوب → `CONTEXT_LOST`.
75
+ > - **سجّل قرار `Session:` (سطر واحد) في `Compliance Record`** الخاص بالمهمة — ليظل القرار قابلاً للتدقيق بعد إغلاق الشات.
76
+
63
77
  ---
64
78
 
65
79
  ## 3. Model Capability Assessment
@@ -451,6 +451,7 @@ Generated file: `project-control/PROJECT_CLOSURE_REPORT.md`
451
451
  | Closure Date | |
452
452
  | Closure Decision | Closed / Needs Final Fix / Deferred / Blocked |
453
453
  | Approved By | User / Client / Tera |
454
+ | Output Mode | Standard / COMPACT (Phases 5–7 — SCP-2026-09-29-004) |
454
455
 
455
456
  ## 2. Completion Summary
456
457
 
@@ -301,7 +301,7 @@ workspace {
301
301
  [للمكونات الحرجة فقط — يحددها Depth Assessment]
302
302
  ```
303
303
 
304
- > **ملاحظة:** كود Structurizr DSL أعلاه هو示例 (illustrative). يكتب المُهندس الـ DSL الفعلي حسب كل مشروع. مصدر الحقيقة هو ملف `.dsl` وليس الـ diagram المُولّد.
304
+ > **ملاحظة:** كود Structurizr DSL أعلاه هو مثال (illustrative). يكتب المُهندس الـ DSL الفعلي حسب كل مشروع. مصدر الحقيقة هو ملف `.dsl` وليس الـ diagram المُولّد.
305
305
 
306
306
  ---
307
307
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tera-system/core",
3
- "version": "0.6.0",
4
- "description": "Tera System OpenCode Plugin — governance core, 25 agents, 38 commands, distribution tools (personal edition)",
3
+ "version": "0.7.0",
4
+ "description": "Tera System OpenCode Plugin — governance core, 26 agents, 39 commands, distribution tools (personal edition)",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
7
7
  "engines": {