@tera-system/core 0.5.0 → 0.6.2
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.
- package/MANIFEST.json +8 -8
- package/RELEASES.md +29 -0
- package/agents/application-blueprint.md +6 -6
- package/agents/auditor.md +19 -2
- package/agents/engineering-agent-dotnet.md +30 -4
- package/agents/engineering-agent-flutter.md +5 -5
- package/agents/engineering-agent-typescript.md +70 -38
- package/agents/engineering-agent.md +12 -72
- package/agents/security-observer.md +2 -2
- package/agents/tera-client-engagement.md +7 -7
- package/agents/tera-software-designer.md +88 -54
- package/agents/tera-system-evolution.md +6 -6
- package/agents/tera.md +38 -6
- package/agents/ui-designer.md +1 -1
- package/assets/structurizr-mcp/pyproject.toml +1 -1
- package/assets/structurizr-mcp/uv.lock +816 -770
- package/commands/tera-approve.md +43 -34
- package/commands/tera-diagnose.md +2 -0
- package/commands/tera-gate.md +2 -0
- package/commands/tera-help.md +1 -0
- package/commands/tera-new-project.md +32 -35
- package/commands/tera-orient-software-designer.md +1 -1
- package/commands/tera-orient-tera.md +1 -1
- package/commands/tera-plan.md +2 -0
- package/commands/tera-reconcile.md +35 -0
- package/commands/tera-request-build.md +2 -0
- package/commands/tera-resume.md +2 -0
- package/commands/tera-review.md +2 -0
- package/commands/tera-status.md +2 -0
- package/core/tera-system/AGENT_ACTIVATION_MATRIX.md +11 -7
- package/core/tera-system/AGENT_DEPENDENCY_MAP.md +9 -7
- package/core/tera-system/AGENT_GENERATION_TEMPLATE.md +6 -5
- package/core/tera-system/AGENT_PERMISSION_MODEL.md +29 -12
- package/core/tera-system/TERA_AGENT_CONDUCT.md +17 -0
- package/core/tera-system/TERA_DISTRIBUTION_POLICY.md +7 -4
- package/core/tera-system/TeraArchitectureMap.md +1 -1
- package/core/tera-system/TeraCapabilityMap.md +2 -2
- package/core/tera-system/TeraPolicyMap.md +5 -3
- package/core/tera-system/TeraPreExecutionGate.md +51 -4
- package/core/tera-system/TeraPreparationDocumentationGovernance.md +21 -15
- package/core/tera-system/TeraSubAgents.md +7 -4
- package/core/tera-system/TeraSystemMaintenanceChecklist.md +12 -0
- package/core/tera-system/client-helpers/tera-client-engagement-gates.md +2 -2
- package/core/tera-system/client-helpers/tera-client-engagement-pricing.md +1 -1
- package/core/tera-system/client-helpers/tera-client-engagement-protocols.md +14 -9
- package/core/tera-system/design-system/DESIGN_REVIEW_STANDARDS.md +2 -0
- package/core/tera-system/engineering-helpers/database-privileges.md +63 -0
- package/core/tera-system/engineering-helpers/engineering-agent-core.md +30 -13
- package/core/tera-system/profiles/PROFILES_INDEX.md +3 -1
- package/core/tera-system/profiles/dotnet-razorpages-adonet.md +44 -43
- package/core/tera-system/profiles/dotnet-wpf-sqlite.md +17 -17
- package/core/tera-system/profiles/flutter-mobile.md +2 -2
- package/core/tera-system/profiles/rust.md +8 -6
- package/core/tera-system/runtime/AGENT_SELF_ORIENTATION_PROTOCOL.md +2 -1
- package/core/tera-system/runtime/TERA_COMMAND_PROTOCOL.md +86 -0
- package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CORE.md +16 -0
- package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES.md +14 -0
- package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_DELIVERY.md +1 -0
- package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_PREPARATION.md +1 -1
- package/core/tera-system/runtime/TERA_SOLUTION_PREPARATION_PROTOCOL.md +2 -2
- package/core/tera-system/runtime/TERA_SOLUTION_PREPARATION_TEMPLATES.md +9 -2
- 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 (
|
|
8
|
-
- Database: SQL Server (destination) +
|
|
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:
|
|
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
|
|
18
|
-
- The application
|
|
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
|
|
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
|
|
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
|
-
-
|
|
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 (
|
|
34
|
-
2. Add only the required base packages (
|
|
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
|
|
37
|
-
5. Build SQL Server
|
|
38
|
-
6. Build
|
|
39
|
-
7. Build
|
|
40
|
-
8. Build
|
|
41
|
-
9. Build
|
|
42
|
-
10. Build
|
|
43
|
-
11. Integrate
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
+ Add base packages: Oracle.ManagedDataAccess.Core,
|
|
55
|
-
Microsoft.EntityFrameworkCore.SqlServer,
|
|
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
|
|
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
|
-
-
|
|
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
|
|
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
|
|
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
|
|
85
|
+
- Used for all external-source → SQL Server data transfer.
|
|
85
86
|
- SqlBulkCopy belongs to a dedicated data-loading task.
|
|
86
|
-
-
|
|
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
|
-
**
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
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
|
-
-
|
|
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
|
|
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
|
|
124
|
-
- Confirm SqlBulkCopy tasks are not combined with
|
|
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
|
|
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
|
-
-
|
|
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:
|
|
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
|
-
-
|
|
55
|
-
-
|
|
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
|
-
- `
|
|
86
|
-
- `
|
|
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
|
-
| `
|
|
113
|
-
| `
|
|
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
|
-
- ❌ **لا**
|
|
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+ (
|
|
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
|
|
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:
|
|
4
|
-
> مبني على بحث عميق 2026 من مصادر موثوقة (16 مصدراً: Corgea, Rust 2026 Template, onehorizon, Apollo skills, RuleSync, Agentbrisk, Axum/SQLx production guides...).
|
|
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
|
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
- **Parameterized queries إلزامي** — ممنوع string interpolation في SQL (SQL injection — OWASP).
|
|
71
71
|
- `PgPool`: max_connections محدود (أقل من max Postgres ÷ عدد النسخ) + `acquire_timeout` + `idle_timeout` — لا إعدادات افتراضية.
|
|
72
72
|
- Diesel/SeaORM: عند الحاجة — migrations عبر أدواتها الخاصة (`diesel_cli` / `sea-orm-cli`).
|
|
73
|
+
- **Schema-Head / Migration Pins (SCP-2026-09-24-005):** عند إضافة migration يغيّر رقم/رأس الـSchema، نفّذ **جرداً شاملاً** لكل مواضع التثبيت المحتملة (MIGRATION_HEAD · EXPECTED_HEAD · migration count · startup guards · fixtures · error messages · test names) **قبل التفويض التالي** — راجع `TeraPreExecutionGate §5.1 (ج)`.
|
|
73
74
|
|
|
74
75
|
## 7. CLI Side Effects
|
|
75
76
|
|
|
@@ -151,12 +152,13 @@ large_enum_variant = "warn"
|
|
|
151
152
|
✅ لـ UI (Tauri/Web): Playwright/axe وفق قواعد المنظومة
|
|
152
153
|
```
|
|
153
154
|
|
|
154
|
-
### مسار الترقية
|
|
155
|
+
### مسار الترقية ⟶ ✅ مُنجَز (Pilot GEN-F05 — 2026-09-29)
|
|
155
156
|
|
|
156
157
|
```text
|
|
157
|
-
1. cargo new verify-rust-cli → build + test + clippy -D warnings + fmt --check → PASS
|
|
158
|
-
|
|
159
|
-
|
|
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
|
|
160
162
|
```
|
|
161
163
|
|
|
162
164
|
---
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
- ما مصادر الحقيقة الخاصة بي؟
|
|
32
32
|
|
|
33
33
|
5. **تأكد من فهم العلاقات:**
|
|
34
|
-
- لا تفعّل أي عميل ولا تطلب تفعيلك ذاتياً (مالك التفعيل محدد في `
|
|
34
|
+
- لا تفعّل أي عميل ولا تطلب تفعيلك ذاتياً (مالك التفعيل محدد في `AGENT_ACTIVATION_MATRIX.md` «القاعدة الحاكمة» وفي `TeraSubAgents.md` §1).
|
|
35
35
|
- اعرف من يستدعيك (المالك / TeraAgent / عميل آخر) ومتى.
|
|
36
36
|
|
|
37
37
|
## إقرار الجاهزية (READINESS DECLARATION)
|
|
@@ -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
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# TERA_COMMAND_PROTOCOL.md — بروتوكول طبقة الأوامر السريعة
|
|
2
|
+
|
|
3
|
+
> **المصدر:** SCP-2026-09-24-002 (معالجة Review 02 — Runtime/Orchestration).
|
|
4
|
+
> كل أمر في `.opencode/commands/` **يلتزم** بهذا الملف. الأوامر طبقة دخول — لا تتجاوز Runtime Core.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Workspace Resolution Gate (إلزامي قبل أي قراءة/كتابة)
|
|
9
|
+
|
|
10
|
+
كل أمر يحدّد المسارات أولاً — لا يستخدم مساراً نسبياً غامضاً:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
ActiveAppPath = مسار التطبيق النشط
|
|
14
|
+
ProjectControlPath = <ActiveAppPath>/project-control/
|
|
15
|
+
ProjectPreparationPath = <ActiveAppPath>/project-preparation/
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**مصدر `ActiveAppPath` (بالترتيب):**
|
|
19
|
+
1. `project-control/SYSTEM_ACTIVE_CONTEXT.md` الجذري إن وُجد (حقل `ActiveAppPath`).
|
|
20
|
+
2. سياق الجلسة/الطلب الصريح من Majed.
|
|
21
|
+
3. إن لم يتضح → **توقف واسأل**: "أي تطبيق/مشروع؟" — لا تفترض.
|
|
22
|
+
|
|
23
|
+
**قواعد:**
|
|
24
|
+
- لمشروع تطبيق/عميل: اقرأ/اكتب تحت `<ActiveAppPath>/project-control/` — **لا** الجذر.
|
|
25
|
+
- ملفات الجذر `project-control/` = **System Templates فقط** (وفق `tera.md` Tier 1).
|
|
26
|
+
- لا تعتمد على أن الجذر يحتوي `TASK_REGISTRY.md`/`PROJECT_ACTIVITY_LOG.md` — هذه خاصة بكل تطبيق.
|
|
27
|
+
- إن اختلف `HostRepoPath` (مستودع كود خارجي) عن مسار المنظومة → صرّح به منفصلاً.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 2. Quick Command Principles
|
|
32
|
+
|
|
33
|
+
- الأوامر **تُشغّل** الـRuntime القائم؛ لا تعرّفه من جديد ولا تتجاوزه.
|
|
34
|
+
- لا تنفيذ بلا موافقة صريحة (Plan ≠ Build).
|
|
35
|
+
- لا تفترض حالةً غير موجودة في السجلات الرسمية؛ إن غابت → أخبر المالك.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Closure Prerequisites (إلزامي قبل `Accepted`/`Closed`)
|
|
40
|
+
|
|
41
|
+
لا يُغلق أي TASK إلا بعد استيفاء **كل** ما يلي (بالترتيب):
|
|
42
|
+
|
|
43
|
+
| # | الشرط | المرجع |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| 1 | Handback مسجّل في ملف المهمة | Task file |
|
|
46
|
+
| 2 | `Post-Execution Review` = PASS | `TeraPreExecutionGate.md` §6.2 |
|
|
47
|
+
| 3 | `Compliance Record` = COMPLIANT | Task file |
|
|
48
|
+
| 4 | `Owner Approval Required`: إن Yes → اعتماد صريح مسجّل | Owner Approval Gate |
|
|
49
|
+
| 5 | قرارات QA / Auditor / Security المطلوبة مسجّلة | §6.2 Independent Review |
|
|
50
|
+
| 6 | Cross-Record Consistency: لا تعارض بين Task/REGISTRY/PROJECT_STATE/DECISIONS/ACTIVITY/AUDIT_TRAIL | CORE §4.0.1 |
|
|
51
|
+
|
|
52
|
+
**أي شرط فاشل → لا إغلاق.** أبلغ بالسبب المحدد وانتظر قرار Majed.
|
|
53
|
+
> `/tera-approve` يسجّل **نية المالك**؛ ولا يتجاوز أبداً الشروط التقنية أعلاه.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Closure Transaction & Reconciliation (منع Partial/Split State)
|
|
58
|
+
|
|
59
|
+
الإغلاق = **معاملة واحدة قابلة للتحقق**، لا writes متفرقة:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
1. حدّد كل السجلات المستهدفة (Task file, TASK_REGISTRY, PROJECT_STATE,
|
|
63
|
+
PROJECT_ACTIVITY_LOG, DECISIONS_LOG, TERA_AUDIT_TRAIL, ISSUES_AND_GAPS عند الحاجة).
|
|
64
|
+
2. احسب الحالة النهائية المطلوبة في كلٍّ منها.
|
|
65
|
+
3. طبّقها كلها.
|
|
66
|
+
4. أعد قراءتها وتأكد من التطابق (reconcile).
|
|
67
|
+
5. إن تعذّر الإكمال → لا تُعلن Closed؛ أبلغ بحالة جزئية + ما تبقّى، واقترح الإصلاح.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- أمر **`/tera-reconcile`** يفحص الاتساق ويصدر `CONSISTENT` أو `DRIFT_FOUND`.
|
|
71
|
+
- لا `Closed` مع أي سجل غير متزامن.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 5. Command Conformance Gate
|
|
76
|
+
|
|
77
|
+
أي تغيير نظامي يمس: **phase ownership · task lifecycle · approval · path rules · state records · role boundaries**
|
|
78
|
+
→ ضمن الـSCP، يجب فحص `.opencode/commands/*.md` المتأثرة وتحديثها في نفس الدفعة.
|
|
79
|
+
(يمتد هذا إلى فحص `scripts/validate-governance.mjs` حيث ينطبق.)
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 6. Path Semantics (توضيح)
|
|
84
|
+
|
|
85
|
+
- المسارات في الأوامر **مُحلّة** عبر §1 — لا تُقرأ حرفياً من الجذر.
|
|
86
|
+
- `project-control/…` في أي أمر = `<ProjectControlPath>/…` بعد الحل.
|
|
@@ -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`.
|
|
@@ -333,6 +335,20 @@ No task may become `Accepted` or `Closed` without:
|
|
|
333
335
|
|
|
334
336
|
Use `TERA_RUNTIME_TEMPLATES_DELIVERY.md` Section 33 for the official template format.
|
|
335
337
|
|
|
338
|
+
### 4.0.2 Staleness Sweep (SCP-2026-09-24-005)
|
|
339
|
+
|
|
340
|
+
At each project boundary — **Task Accepted · Phase boundary · Batch closure · Session handoff** — run a consistency sweep over the state files **that actually exist in this project** (لا تفترض مجموعة ثابتة):
|
|
341
|
+
|
|
342
|
+
```text
|
|
343
|
+
Master Plan · Detailed Plan · Batch Plan · PROJECT_STATE · TASK_REGISTRY ·
|
|
344
|
+
TERA_ACTIVE_CONTEXT · PROJECT_ACTIVITY_LOG · TERA_AUDIT_TRAIL
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
- الغرض: كشف الخطط المتقادمة، وضَياع Paired-Records، وتعارض الحالة **قبل** التفويض التالي.
|
|
348
|
+
- تكيّف مع ملفات المشروع الفعلية (داخلي/عميل، موجود/غائب). ملف غائب = `N/A` لا فشل.
|
|
349
|
+
- قراءة فقط افتراضياً؛ أي تصحيح = تغيير حوكمي عادي (Allowed Write Targets + مراجعة).
|
|
350
|
+
- يقرن مع Paired Records: حدّث `TERA_AUDIT_TRAIL` و`PROJECT_ACTIVITY_LOG` **معاً**.
|
|
351
|
+
|
|
336
352
|
### 4.1 Roadmap and Detailed Plan Tracking
|
|
337
353
|
|
|
338
354
|
For medium and large projects, the following files are mandatory operational references:
|
|
@@ -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 أعلاه
|
|
304
|
+
> **ملاحظة:** كود Structurizr DSL أعلاه هو مثال (illustrative). يكتب المُهندس الـ DSL الفعلي حسب كل مشروع. مصدر الحقيقة هو ملف `.dsl` وليس الـ diagram المُولّد.
|
|
305
305
|
|
|
306
306
|
---
|
|
307
307
|
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
### 4.1 Maker / Checker Model
|
|
125
125
|
|
|
126
126
|
- **Maker:** عميل تحضير متخصص يكتب الملف.
|
|
127
|
-
- **Checker:** عميل تحضير
|
|
127
|
+
- **Checker:** عميل تحضير **مختلف** يراجع الاتساق (Checker ≠ Maker) — الافتراضي: `auditor` في وضع `Preparation-Review` (كل دفعة، قراءة فقط — SCP-2026-09-24-006).
|
|
128
128
|
- **Orchestrator:** مُهندس يخطط ويدير lifecycle.
|
|
129
129
|
|
|
130
130
|
### 4.2 Document States
|
|
@@ -136,7 +136,7 @@ Draft → Under Cross-Review → Module Baseline Approved → System Pending Int
|
|
|
136
136
|
### 4.3 Cross-Review Rules
|
|
137
137
|
|
|
138
138
|
1. كل ملف تحضيري يمر بـ Cross-Review قبل `Module Baseline Approved`.
|
|
139
|
-
2. الـ Checker يجب أن يكون مختلفاً عن الـ Maker.
|
|
139
|
+
2. الـ Checker يجب أن يكون مختلفاً عن الـ Maker. إن تعذّر → التصنيف `SELF_REVIEW` صراحةً (لا "Cross-Review") + تنازل مالك للمشاريع Tiny/Low-risk (راجع Governance §4.2/§9 — SCP-2026-09-24-004).
|
|
140
140
|
3. الـ Checker يراجع: اتساق مع upstream، اكتمال، حالات الحافة، التبعيات.
|
|
141
141
|
4. Issues → يعاد الملف إلى Draft مع توثيق findings.
|
|
142
142
|
5. موافقة Checker → مُهندس يرفع الحالة.
|
|
@@ -386,8 +386,15 @@ Approval status: Pending / Approved
|
|
|
386
386
|
| 11 | No unresolved High/Critical item | PASS / FAIL | |
|
|
387
387
|
| 12 | No Low Confidence section | PASS / FAIL | |
|
|
388
388
|
| 13 | No Pending Approval blocking Phase 5 | PASS / FAIL | |
|
|
389
|
-
| 14 | Technology Profile
|
|
390
|
-
| 15 |
|
|
389
|
+
| 14 | Technology Profile: `CONFIRMED` **أو** `EXPLICITLY_DEFERRED_TO_ENGINEERING_INTAKE` مع قرار حاجب مسجّل | PASS / FAIL | |
|
|
390
|
+
| 15 | Review Evidence مفصول: Self-Review / Independent Review / Cross-Document Reconciliation — كلٌّ بنتيجته (SCP-2026-09-24-004) | PASS / FAIL | |
|
|
391
|
+
| 16 | Recommended implementation sequence exists | PASS / FAIL | |
|
|
392
|
+
|
|
393
|
+
## Review Evidence (مفصول — SCP-2026-09-24-004)
|
|
394
|
+
- Review Type: `SELF_REVIEW` / `INDEPENDENT_REVIEW` / `MIXED`
|
|
395
|
+
- Self Verification: PASS / FAIL
|
|
396
|
+
- Independent Preparation Review: PASS / NOT_REQUIRED / WAIVED (reason)
|
|
397
|
+
- Cross-Document Reconciliation: PASS / FAIL
|
|
391
398
|
|
|
392
399
|
## Gate Result
|
|
393
400
|
**PASS / REVISION_REQUIRED / BLOCKED**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tera-system/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Tera System OpenCode Plugin — governance core, 25 agents,
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"description": "Tera System OpenCode Plugin — governance core, 25 agents, 38 commands, distribution tools (personal edition)",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|