@tera-system/core 0.2.1 → 0.2.3

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.
@@ -203,7 +203,7 @@ The default mandatory package is:
203
203
  - `10_CLIENT_APPROVAL_RECORD.md`
204
204
  - `11_CHANGE_CONTROL.md`
205
205
 
206
- If a file is not applicable to a very small project, Tera must still create an explicit section in `10_CLIENT_APPROVAL_RECORD.md` explaining why it is not applicable and what replaced it.
206
+ If a file is not applicable to a very small project, Tera must still create an explicit section in `10_CLIENT_APPROVAL_RECORD.md` explaining why it is not applicable and what replaced it. Exception: `08_PROTOTYPE_PLAN.md` may not be marked not applicable except with a documented Majed waiver (WAIVED_BY_MAJED) — the prototype is mandatory for all applications (SCP-2026-08-28-001).
207
207
 
208
208
  ### Approval Gates
209
209
 
@@ -214,9 +214,35 @@ 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 (built and reviewed) via a formal approval letter. Mandatory for all applications. Exception: documented Majed waiver (WAIVED_BY_MAJED). |
218
218
  | Gate 7: Execution Authorization | The client authorizes moving into implementation. |
219
219
 
220
+ ### Prototype Mandate (SCP-2026-08-28-001)
221
+
222
+ ```text
223
+ 1. Every application — external or internal — requires an approved prototype before
224
+ real implementation. The only exception is a documented Majed waiver
225
+ (WAIVED_BY_MAJED) recorded in 10_CLIENT_APPROVAL_RECORD.md with a reason.
226
+ No agent may override this gate.
227
+ 2. The prototype is built by Coding Agents under Tera as the FIRST execution task
228
+ (TASK-PROTO-*), isolated under project-control/prototypes/ — non-production,
229
+ deleted or archived after approval. DesignReviewer (ناقد) reviews it before
230
+ it is shown to Majed and the client (Maker/Checker pattern).
231
+ 3. Coverage: all screens listed in 06_SCREEN_MAP.md. Large applications use waves
232
+ (critical transaction/input screens first); reducing waves is a Majed decision only.
233
+ 4. Approval evidence: a formal Prototype Approval Letter (see
234
+ tera-workshop/client-templates/contractual/PROTOTYPE_APPROVAL_LETTER_TEMPLATE.md)
235
+ confirming the screens/fields/flows as prototyped, and acknowledging that any
236
+ later impactful change = priced Change Request on the client's responsibility.
237
+ The letter is the Gate 6 evidence; without it (or a Majed waiver) the prototype
238
+ is not approved.
239
+ 5. The prototype must trace strictly to the approved baseline
240
+ (07_SCREENS_AND_UI_STRUCTURE.md) — it validates and surfaces gaps; it does not
241
+ invent requirements. Objections within approved scope = free design iteration
242
+ (baseline update via مُهندس when needed). Expansion beyond approved scope =
243
+ priced Change Request (MR4).
244
+ ```
245
+
220
246
  ### Approval Record
221
247
 
222
248
  `10_CLIENT_APPROVAL_RECORD.md` must document:
@@ -38,7 +38,7 @@ Project files record project-specific decisions.
38
38
  | TCEA commercial value discovery (MR6) | `.opencode/agents/tera-client-engagement.md` (A.6.0 MR6) | `.opencode/agents/tera.md` | 6th Master Rule: TCEA must actively discover value-added opportunities — propose as options, not commitments. |
39
39
  | TCEA value-added proposals protocol | `tera-system/client-helpers/tera-client-engagement-protocols.md` (A.6.10) | Not applicable | Detailed protocol for commercial proposals: types, rules, template, connection to Future-Proof Discovery. |
40
40
  | Solution preparation (phases 1–4) | `.opencode/agents/application-blueprint.md` | `.opencode/agents/tera.md` (reference only) | Owned by مُهندس. Covers blueprint, intake, project decision, preparation planning, delegation, cross-review, baseline, and Engineering Handoff. SCP-2026-07-28-118. |
41
- | Preparation file catalog | `tera-system/Tera_Project_Preparation_Files.md` | `TERA_PROJECT_DECISION.md` | Comprehensive preparation files **Guide** (catalog + per-file purpose/questions/outputs) owned by مُهندس during preparation. Classified as reference Guide — not split (2026-08-01). |
41
+ | Preparation file catalog | `tera-system/Tera_Project_Preparation_Files.md` + `tera-system/agent-helpers/Tera_Project_Preparation_Files_Conditional.md` | `TERA_PROJECT_DECISION.md` | Main guide/index plus on-demand companion for conditional and supporting files. Owned by مُهندس during preparation. |
42
42
  | Project decision template | `tera-system/TERA_PROJECT_DECISION.md` + `tera-system/runtime/TERA_SOLUTION_PREPARATION_TEMPLATES.md` §1 | Not applicable | Owned by مُهندس. 13-section structure. |
43
43
  | 7-phase Tera workflow | `.opencode/agents/tera.md` §11 (phases 5–7) + `.opencode/agents/application-blueprint.md` (phases 1–4) | Runtime files as referenced | Phases 1–4: مُهندس. Phases 5–7: Tera. SCP-2026-07-28-118. |
44
44
  | Phase 3 preparation planning output | `tera-system/runtime/TERA_SOLUTION_PREPARATION_TEMPLATES.md` §2 | `.opencode/agents/application-blueprint.md` | Produces `PREPARATION_PLAN.md`; owned by مُهندس. |
@@ -49,7 +49,7 @@ Project files record project-specific decisions.
49
49
  | Phase 5 execution planning outputs | `tera-system/runtime/TERA_RUNTIME_TEMPLATES_DELIVERY.md` Sections 29-31 | `.opencode/agents/tera.md`, `TERA_RUNTIME_CHECKLISTS.md`, `TeraPreExecutionGate.md` | Produces `PROJECT_MASTER_PLAN.md`, `PROJECT_DETAILED_EXECUTION_PLAN.md`, and `EXECUTION_BATCH_PLAN.md`. Split notice INS-02: Sections 29-31 moved to DELIVERY file. |
50
50
  | Phase 6 post-execution review template | `tera-system/runtime/TERA_RUNTIME_TEMPLATES_DELIVERY.md` Section 32 | `TASK_TEMPLATE.md`, `TeraPreExecutionGate.md`, `TERA_RUNTIME_CHECKLISTS.md` | Used inside `TASK-COD-*` before final acceptance or closure. Note: `TASK_TEMPLATE.md` lives at `project-control/tasks/TASK_TEMPLATE.md` (clarified INS-07, 2026-08-01). Split notice INS-02: Section 32 moved to DELIVERY file. |
51
51
  | Phase 7 delivery, handover, and closure | `.opencode/agents/tera.md` Section 5 + `TERA_RUNTIME_TEMPLATES_DELIVERY.md` Section 35 | `.opencode/agents/tera.md`, `TERA_RUNTIME_CHECKLISTS.md`, `TERA_RUNTIME_PROTOCOLS.md` | Project closure is separate from last TASK-COD closure. Phase 7 does not execute code. Split notice INS-02: Section 34 moved to DELIVERY file. |
52
- | Sub-agent registry (core) | `tera-system/TeraSubAgents.md` | `.opencode/agents/tera.md` | Core agents (Engineering, QA, Auditor, Software Designer) — 769 lines 🟢 |
52
+ | Sub-agent registry (core) | `tera-system/TeraSubAgents.md` | `.opencode/agents/tera.md` | Core agents (Engineering, QA, Auditor, Software Designer, DesignReviewer) — 904 lines 🟡 |
53
53
  | Sub-agent registry (helpers) | `tera-system/TeraHelperAgents.md` | `.opencode/agents/tera.md` | Helper agents (Security, DevOps, Domain, ERP, etc.) — 964 lines 🟢 — split from TeraSubAgents.md via SCP-2026-07-26 |
54
54
  | Agent generation template | `tera-system/AGENT_GENERATION_TEMPLATE.md` | `TERA_RUNTIME_PROTOCOLS_CORE.md` | Draft agents use this source. |
55
55
  | Pre/Post execution gates | `tera-system/TeraPreExecutionGate.md` | `.opencode/agents/tera.md`, `TERA_RUNTIME_PROTOCOLS_CORE.md` | Gate details stay in the policy file. |
@@ -61,7 +61,8 @@ Project files record project-specific decisions.
61
61
  | Runtime checklists | `tera-system/runtime/TERA_RUNTIME_CHECKLISTS.md` | `.opencode/agents/tera.md` | Checklists stay outside runtime. |
62
62
  | MVP classification | `tera-system/runtime/MVP_DEFINITION_PROTOCOL.md` | `.opencode/agents/tera.md` | Runtime references when to load it. |
63
63
  | Technology profiles | `tera-system/profiles/` | `.opencode/agents/tera.md` | Stack-specific rules stay in profiles. |
64
- | 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. |
64
+ | 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. DesignReviewer (ناقد) = Tera-managed review sub-agent (SCP-2026-08-28-001) with three shields (neutrality / direct escalation / dual invocation). |
65
+ | Prototype mandate | `tera-system/TeraClientPolicy.md` (Prototype Mandate — SCP-2026-08-28-001) | `TERA_RUNTIME_TEMPLATES.md` (08_PROTOTYPE_PLAN.md), `TERA_RUNTIME_PROTOCOLS_CLIENT.md`, `TeraPreExecutionGate.md` (#23) | Gate 6 mandatory for all applications; waiver = documented `WAIVED_BY_MAJED` only. Builder: Coding Agents under Tera (TASK-PROTO-*); reviewer: DesignReviewer (ناقد); evidence: formal Prototype Approval Letter. |
65
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. |
66
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
68
  | 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. |
@@ -104,7 +105,8 @@ Project files record project-specific decisions.
104
105
  | Business Transformation Consultant (BTCA) | `.opencode/agents/tera-business-transformation-consultant.md` | `tera-system/consulting-helpers/BTCA_METHODOLOGY_FRAMEWORK.md`, `BTCA_REPORT_TEMPLATES.md` | عميل مستقل للاستشارات الإدارية والتنظيمية غير البرمجية — Track C. SCP-2026-07-29-002. |
105
106
  | BTCA — Methodology Framework | `tera-system/consulting-helpers/BTCA_METHODOLOGY_FRAMEWORK.md` | `.opencode/agents/tera-business-transformation-consultant.md` | إطار المنهجية: تصنيف الأدلة الخماسي، مراحل العمل، دليل المقابلات، هيكل التقرير النهائي. |
106
107
  | BTCA — Report Templates | `tera-system/consulting-helpers/BTCA_REPORT_TEMPLATES.md` | `.opencode/agents/tera-business-transformation-consultant.md` | قوالب التقارير العشرة الأساسية + التقرير التنفيذي. |
107
- | Tera distribution (versioned) | `tera-system/TERA_DISTRIBUTION_POLICY.md` | `.tera/lock.json` في مستودعات العملاء | توزيع Tera المُروّس على مستودعات العملاء: استمداد من المستودع الأصلي (`tera-fetch.ps1` + RepositoryUrl)، إصدارات (Tag+SHA)، عقد ملكية، أدوات `tera-workshop/tools/`. SCP-2026-08-15-009. |
108
+ | Tera distribution (versioned) | `tera-system/TERA_DISTRIBUTION_POLICY.md` | `.tera/lock.json` في مستودعات العملاء | توزيع Tera المُروّس على مستودعات العملاء: استمداد من المستودع الأصلي (`tera-fetch.ps1` + RepositoryUrl)، إصدارات (Tag+SHA)، عقد ملكية، أدوات `tera-workshop/tools/`. SCP-2026-08-15-009. |
109
+ | Tera product standards — Maintenance | `tera-system/product-standards/maintenance-apps/STANDARD_DEFINITION.md` + `BEST_PRACTICES_DOMAIN.md` | Not applicable | Active reusable product standards for Maintenance/FSM/WOM; content remains in the standards files. |
108
110
 
109
111
  ## 4. Duplication Policy
110
112
 
@@ -219,6 +219,7 @@ BLOCKED
219
219
  | 20 | هل يوجد مسار تراجع آمن إذا فشل التنفيذ؟ | Yes |
220
220
  | 21 | إذا كانت المهمة UI/Frontend، هل يوجد Design Source Decision و`28_UI_UX_GUIDELINES.md` عند الحاجة؟ | Yes / N/A |
221
221
  | 22 | إذا كانت المهمة UI/Frontend، هل ترتبط بـ `UI_ACCEPTANCE_GATE.md` وتتضمن UI Source / UI Rules / UI Acceptance / Design Gap Handling؟ | Yes / N/A |
222
+ | 23 | هل تم اعتماد البروتوتايب (Gate 6 — خطاب رسمي) أو توثيق `WAIVED_BY_MAJED` قبل أي مهمة تنفيذ فعلية؟ (لا ينطبق على مهام البروتوتايب نفسها `TASK-PROTO-*` — فهي Spike معتمد من Majed) | Yes / N/A (مشروع بلا واجهات) |
222
223
 
223
224
  إذا فشل أي بند، يجب على Tera تصحيح المهمة قبل عرضها.
224
225
 
@@ -125,7 +125,7 @@ For external client projects, also ask the shortest useful client questions:
125
125
  - What language should client documents use? Default is Arabic.
126
126
  - Does the client have a logo, colors, references, or examples they like?
127
127
  - Are there examples the client dislikes?
128
- - Does the client need a proposal, prototype, or design approval before implementation?
128
+ - Does the client need a proposal, prototype, or design approval before implementation? (الافتراضي: البروتوتايب إلزامي لجميع التطبيقات — SCP-2026-08-28-001 — إلا بتجاوز Majed موثق `WAIVED_BY_MAJED`)
129
129
 
130
130
  ## 8. When Tera Can Proceed
131
131
 
@@ -142,7 +142,7 @@ For external client projects, Tera may proceed only to client approval preparati
142
142
  - the client application folder under `clients/` is identified.
143
143
  - Tera has enough information to produce a client-facing approval package.
144
144
 
145
- Tera may not proceed to implementation until `tera-system/TeraClientPolicy.md` (Section 7: Client Approval Package) is satisfied.
145
+ Tera may not proceed to implementation until `tera-system/TeraClientPolicy.md` (Section 7: Client Approval Package) is satisfied — including Gate 6 Prototype Approval (formal letter) or a documented `WAIVED_BY_MAJED` (SCP-2026-08-28-001).
146
146
 
147
147
  ## 9. Relationship with 00_PROJECT_INPUTS.md
148
148
 
@@ -789,8 +789,58 @@ project-control/audit-reports/QUAUD-[TASK-ID]-YYYY-MM-DD-NNN.md
789
789
  - لا يحتوي أسراراً حقيقية أو بيانات غير منقحة.
790
790
  - يستخدم STOP / CAUTION / FLAG دون تحويل heuristics إلى blockers تلقائياً.
791
791
 
792
- ---
793
-
792
+ ---
793
+
794
+ ## 5.7.2 DesignReviewer — ناقد (SCP-2026-08-28-001)
795
+
796
+ | البند | القيمة |
797
+ |---|---|
798
+ | اسم العميل | Design Reviewer Agent |
799
+ | المعرّف | `DESIGN_REVIEWER` |
800
+ | الفئة | أساسي / مراجعة بصرية (Tera-managed review sub-agent) |
801
+ | ملف العميل | `.opencode/agents/design-reviewer.md` |
802
+ | الدور | مراجعة البروتوتايب (TASK-PROTO-*) والواجهات المنفذة مقابل مصدر التصميم المعتمد — حكم مستقل |
803
+
804
+ ### متى يستدعيه Tera؟
805
+
806
+ - بعد بناء البروتوتايب (`TASK-PROTO-*`) — قبل عرضه على Majed/الزبون (نمط Maker/Checker).
807
+ - عند الحاجة لمراجعة بصرية للواجهات المنفذة أثناء التنفيذ (قبل القبول).
808
+
809
+ ### متى يستدعيه Majed مباشرة؟
810
+
811
+ - في أي وقت (درع الاستدعاء المزدوج) — لا احتكار من Tera.
812
+
813
+ ### الدروع الثلاثة (إلزامية)
814
+
815
+ - 🛡️ **درع الحياد**: قاعدة Reviewer Invocation Neutrality — ممنوع تلقين النتائج المتوقعة.
816
+ - 🛡️ **درع التصعيد**: يرفع نتائجه إلى Majed مباشرة دون تحرير من Tera.
817
+ - 🛡️ **درع الاستدعاء**: Majed يستدعيه مباشرة في أي وقت.
818
+
819
+ ### يقرأ
820
+
821
+ ```text
822
+ project-control/prototypes/ (البروتوتايب المبني)
823
+ project-preparation/07_SCREENS_AND_UI_STRUCTURE.md
824
+ project-preparation/28_UI_UX_GUIDELINES.md
825
+ project-preparation/design-source/ عند وجوده
826
+ tera-system/design-system/DESIGN_REVIEW_STANDARDS.md (يُقرأ قبل كل مراجعة)
827
+ ```
828
+
829
+ ### ينتج
830
+
831
+ ```text
832
+ تقرير مراجعة تصميم/بروتوتايب مستقل إلى Majed (PASS / REVISION / BLOCKED)
833
+ ```
834
+
835
+ ### حدوده
836
+
837
+ - لا يبني البروتوتايب — البناء حصراً Coding Agents تحت Tera.
838
+ - لا يكتب أو يعدّل كود التطبيق ولا التصميم.
839
+ - لا يقبل المهمة ولا يغلقها — يوصي فقط.
840
+ - لا يحل محل Monitor (الرقابة على الخطط) ولا Auditor (الجودة الهندسية).
841
+
842
+ ---
843
+
794
844
  ## 5.8 DocumentationHandoverAgent
795
845
 
796
846
  | البند | القيمة |
@@ -15,6 +15,7 @@ Check:
15
15
  - Is this a new rule, a clarification, or a runtime summary?
16
16
  - Can an existing file be updated instead of creating a new file?
17
17
  - Will this affect `.opencode/agents/tera.md` runtime behavior?
18
+ - Will agent roles or relationships documented in `book/` change? If yes, plan a `book/` sync pass in the same batch (SCP-2026-08-28-002).
18
19
  - Does this require updating `TeraPolicyMap.md` or `TeraArchitectureMap.md`?
19
20
 
20
21
  ## 3. During Editing
@@ -75,6 +76,7 @@ When the maintenance change is complete, summarize:
75
76
 
76
77
  - source files changed
77
78
  - runtime sync needed: yes / no
79
+ - book/ sync needed (agent roles/relationships changed): yes / no / n/a
78
80
  - duplicate rules removed or accepted
79
81
  - validation performed
80
82
  - remaining risks