@tera-system/core 0.1.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 (161) hide show
  1. package/LICENSE.md +13 -0
  2. package/MANIFEST.json +24 -0
  3. package/README.md +67 -0
  4. package/RELEASES.md +28 -0
  5. package/WELCOME.md +35 -0
  6. package/agents/application-blueprint.md +407 -0
  7. package/agents/auditor.md +665 -0
  8. package/agents/design-reviewer.md +392 -0
  9. package/agents/domain-expert-agent.md +510 -0
  10. package/agents/domain-research-agent.md +360 -0
  11. package/agents/engineering-agent-dotnet.md +218 -0
  12. package/agents/engineering-agent-phaser.md +275 -0
  13. package/agents/engineering-agent-typescript.md +300 -0
  14. package/agents/engineering-agent.md +143 -0
  15. package/agents/monitor.md +395 -0
  16. package/agents/production-erp-expert.md +506 -0
  17. package/agents/project-knowledge-agent.md +271 -0
  18. package/agents/qa-agent.md +498 -0
  19. package/agents/tera-business-transformation-consultant.md +290 -0
  20. package/agents/tera-client-engagement.md +891 -0
  21. package/agents/tera-software-designer.md +237 -0
  22. package/agents/tera-strategic-advisor.md +325 -0
  23. package/agents/tera-system-evolution.md +759 -0
  24. package/agents/tera.md +520 -0
  25. package/agents/ui-designer.md +426 -0
  26. package/commands/tera-approve.md +34 -0
  27. package/commands/tera-diagnose.md +47 -0
  28. package/commands/tera-gate.md +40 -0
  29. package/commands/tera-help.md +41 -0
  30. package/commands/tera-new-project.md +35 -0
  31. package/commands/tera-plan.md +34 -0
  32. package/commands/tera-request-build.md +45 -0
  33. package/commands/tera-resume.md +34 -0
  34. package/commands/tera-review.md +52 -0
  35. package/commands/tera-status.md +38 -0
  36. package/commands/tera-update.md +48 -0
  37. package/core/project-control/templates/TASK_TEMPLATE.md +146 -0
  38. package/core/tera-system/AGENT_ACTIVATION_MATRIX.md +285 -0
  39. package/core/tera-system/AGENT_DEPENDENCY_MAP.md +117 -0
  40. package/core/tera-system/AGENT_GENERATION_TEMPLATE.md +312 -0
  41. package/core/tera-system/AGENT_PERMISSION_MODEL.md +343 -0
  42. package/core/tera-system/AIS_PROTOCOL.md +191 -0
  43. package/core/tera-system/TERA_AGENT_CONDUCT.md +102 -0
  44. package/core/tera-system/TERA_CONTINUOUS_IMPROVEMENT_POLICY.md +111 -0
  45. package/core/tera-system/TERA_DISTRIBUTION_POLICY.md +291 -0
  46. package/core/tera-system/TERA_PROJECT_DECISION.md +281 -0
  47. package/core/tera-system/TERA_USER_GUIDE.md +462 -0
  48. package/core/tera-system/TOOLING_AND_MCP_POLICY.md +285 -0
  49. package/core/tera-system/TeraApplicationQuestionBank.md +362 -0
  50. package/core/tera-system/TeraArchitectureMap.md +91 -0
  51. package/core/tera-system/TeraClientPolicy.md +366 -0
  52. package/core/tera-system/TeraHelperAgents.md +970 -0
  53. package/core/tera-system/TeraPolicyMap.md +131 -0
  54. package/core/tera-system/TeraPreExecutionGate.md +818 -0
  55. package/core/tera-system/TeraPreparationDocumentationGovernance.md +370 -0
  56. package/core/tera-system/TeraPricingPolicy.md +674 -0
  57. package/core/tera-system/TeraProjectIntakePolicy.md +164 -0
  58. package/core/tera-system/TeraScenarioStressTests.md +168 -0
  59. package/core/tera-system/TeraSubAgents.md +854 -0
  60. package/core/tera-system/TeraSystemMaintenanceChecklist.md +80 -0
  61. package/core/tera-system/TeraTokenPolicy.md +362 -0
  62. package/core/tera-system/Tera_Project_Preparation_Files.md +1045 -0
  63. package/core/tera-system/agent-helpers/application-blueprint-details.md +177 -0
  64. package/core/tera-system/client-helpers/tera-client-engagement-discovery-domains.md +99 -0
  65. package/core/tera-system/client-helpers/tera-client-engagement-gates.md +258 -0
  66. package/core/tera-system/client-helpers/tera-client-engagement-pricing.md +341 -0
  67. package/core/tera-system/client-helpers/tera-client-engagement-protocols.md +692 -0
  68. package/core/tera-system/consulting-helpers/BTCA_METHODOLOGY_FRAMEWORK.md +195 -0
  69. package/core/tera-system/consulting-helpers/BTCA_REPORT_TEMPLATES.md +266 -0
  70. package/core/tera-system/design-system/ACCESSIBILITY_RULES.md +31 -0
  71. package/core/tera-system/design-system/COMPONENT_LIBRARY_SCHEMA.md +46 -0
  72. package/core/tera-system/design-system/DESIGN_MD_INTEGRATION.md +59 -0
  73. package/core/tera-system/design-system/DESIGN_REVIEW_STANDARDS.md +241 -0
  74. package/core/tera-system/design-system/DESIGN_SOURCE_PROTOCOL.md +61 -0
  75. package/core/tera-system/design-system/DESIGN_SYSTEM_OVERVIEW.md +66 -0
  76. package/core/tera-system/design-system/DESIGN_TOKENS_SCHEMA.md +66 -0
  77. package/core/tera-system/design-system/EXTERNAL_REFERENCE_ANALYSIS.md +52 -0
  78. package/core/tera-system/design-system/FIGMA_INTEGRATION.md +138 -0
  79. package/core/tera-system/design-system/INTERNAL_KITS_INDEX.md +26 -0
  80. package/core/tera-system/design-system/LAYOUT_PATTERNS.md +52 -0
  81. package/core/tera-system/design-system/MOBILE_UI_UX_STANDARDS.md +342 -0
  82. package/core/tera-system/design-system/RTL_LTR_RULES.md +39 -0
  83. package/core/tera-system/design-system/UI_ACCEPTANCE_GATE.md +80 -0
  84. package/core/tera-system/design-system/kits/KIT_ADMIN_DASHBOARD.md +102 -0
  85. package/core/tera-system/engineering-governance/ENGINEERING_AGENT_RESPONSIBILITIES.md +210 -0
  86. package/core/tera-system/engineering-governance/ENGINEERING_BEST_PRACTICES.md +468 -0
  87. package/core/tera-system/engineering-governance/ENGINEERING_GOVERNANCE_GATE.md +131 -0
  88. package/core/tera-system/engineering-governance/ENGINEERING_REVIEW_CHECKLIST.md +129 -0
  89. package/core/tera-system/engineering-governance/QUALITY_GATE_THRESHOLDS.md +159 -0
  90. package/core/tera-system/engineering-helpers/engineering-agent-core.md +171 -0
  91. package/core/tera-system/knowledge-base/OPENHANDS_ARCHITECTURE_REFERENCE.md +243 -0
  92. package/core/tera-system/knowledge-base/manufacturing/00_INDEX.md +32 -0
  93. package/core/tera-system/knowledge-base/manufacturing/01_MANUFACTURING_ERP_CORE_CONCEPTS.md +7 -0
  94. package/core/tera-system/knowledge-base/manufacturing/02_SAP_MANUFACTURING_RESEARCH.md +7 -0
  95. package/core/tera-system/knowledge-base/manufacturing/03_DYNAMICS_365_MANUFACTURING_RESEARCH.md +7 -0
  96. package/core/tera-system/knowledge-base/manufacturing/04_ORACLE_MANUFACTURING_RESEARCH.md +7 -0
  97. package/core/tera-system/knowledge-base/manufacturing/05_ODOO_MANUFACTURING_RESEARCH.md +7 -0
  98. package/core/tera-system/knowledge-base/manufacturing/06_ERPNEXT_MANUFACTURING_RESEARCH.md +7 -0
  99. package/core/tera-system/knowledge-base/manufacturing/07_MANUFACTURING_COSTING_GUIDE.md +7 -0
  100. package/core/tera-system/knowledge-base/manufacturing/08_PRODUCTION_DISCOVERY_QUESTIONS.md +7 -0
  101. package/core/tera-system/knowledge-base/manufacturing/09_MANUFACTURING_BLUEPRINT_CHECKLIST.md +7 -0
  102. package/core/tera-system/knowledge-base/manufacturing/10_PRODUCTION_TEST_SCENARIOS.md +7 -0
  103. package/core/tera-system/knowledge-base/manufacturing/11_QUALITY_REWORK_AND_SCRAP_GUIDE.md +7 -0
  104. package/core/tera-system/knowledge-base/manufacturing/12_MRP_AND_PLANNING_GUIDE.md +7 -0
  105. package/core/tera-system/knowledge-base/manufacturing/13_LOCAL_AND_REGIONAL_MANUFACTURING_CONTEXT.md +7 -0
  106. package/core/tera-system/knowledge-base/manufacturing/14_VENDOR_COMPARISON_MATRIX.md +7 -0
  107. package/core/tera-system/product-standards/maintenance-apps/BEST_PRACTICES_DOMAIN.md +325 -0
  108. package/core/tera-system/product-standards/maintenance-apps/STANDARD_DEFINITION.md +142 -0
  109. package/core/tera-system/profiles/PROFILES_INDEX.md +57 -0
  110. package/core/tera-system/profiles/TEMPLATE.md +47 -0
  111. package/core/tera-system/profiles/dotnet-blazor-ef.md +76 -0
  112. package/core/tera-system/profiles/dotnet-razorpages-adonet.md +137 -0
  113. package/core/tera-system/profiles/dotnet-wpf-sqlite.md +159 -0
  114. package/core/tera-system/profiles/effect-bun-opencode.md +109 -0
  115. package/core/tera-system/profiles/flutter-mobile.md +369 -0
  116. package/core/tera-system/profiles/nextjs-prisma.md +110 -0
  117. package/core/tera-system/profiles/phaser-react-node.md +302 -0
  118. package/core/tera-system/profiles/react-pwa.md +97 -0
  119. package/core/tera-system/runtime/CLIENT_DISCOVERY_PROTOCOL.md +145 -0
  120. package/core/tera-system/runtime/DOMAIN_INTELLIGENCE_PROTOCOL.md +124 -0
  121. package/core/tera-system/runtime/MVP_DEFINITION_PROTOCOL.md +176 -0
  122. package/core/tera-system/runtime/TERA_RUNTIME_CHECKLISTS.md +646 -0
  123. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS.md +50 -0
  124. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CLIENT.md +355 -0
  125. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CORE.md +799 -0
  126. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES.md +908 -0
  127. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_DELIVERY.md +584 -0
  128. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_PREPARATION.md +376 -0
  129. package/core/tera-system/runtime/TERA_SOLUTION_PREPARATION_PROTOCOL.md +335 -0
  130. package/core/tera-system/runtime/TERA_SOLUTION_PREPARATION_TEMPLATES.md +397 -0
  131. package/core/tera-system/runtime/VERSION_LIFECYCLE_PROTOCOL.md +296 -0
  132. package/core/tera-system/semgrep-rules/README.md +32 -0
  133. package/core/tera-system/semgrep-rules/tera-security.yml +66 -0
  134. package/core/tera-system/semgrep-rules/tera-standards.yml +49 -0
  135. package/core/tera-system/teranoo-ui/README.md +48 -0
  136. package/core/tera-system/teranoo-ui/components/button.tsx +51 -0
  137. package/core/tera-system/teranoo-ui/components/card.tsx +49 -0
  138. package/core/tera-system/teranoo-ui/components/dashboard-layout.tsx +36 -0
  139. package/core/tera-system/teranoo-ui/components/data-table.tsx +146 -0
  140. package/core/tera-system/teranoo-ui/components/empty-state.tsx +31 -0
  141. package/core/tera-system/teranoo-ui/components/kpi-card.tsx +42 -0
  142. package/core/tera-system/teranoo-ui/components/page-header.tsx +25 -0
  143. package/core/tera-system/teranoo-ui/components/search-input.tsx +40 -0
  144. package/core/tera-system/teranoo-ui/components/sidebar.tsx +66 -0
  145. package/core/tera-system/teranoo-ui/components/stats-card.tsx +37 -0
  146. package/core/tera-system/teranoo-ui/registry.json +77 -0
  147. package/core/tera-system/teranoo-ui/styles/teranoo-theme.css +61 -0
  148. package/opencode.tera.example.json +30 -0
  149. package/package.json +37 -0
  150. package/scripts/build.mjs +110 -0
  151. package/scripts/install.js +244 -0
  152. package/scripts/lib/license.mjs +90 -0
  153. package/scripts/lib/public-key.pem +3 -0
  154. package/scripts/tera-license.mjs +63 -0
  155. package/tools/tera-clean.ps1 +97 -0
  156. package/tools/tera-fetch.ps1 +165 -0
  157. package/tools/tera-release.ps1 +96 -0
  158. package/tools/tera-schedule.ps1 +59 -0
  159. package/tools/tera-update.ps1 +472 -0
  160. package/tools/tera-watch.ps1 +154 -0
  161. package/tools/update-client-repositories.ps1 +92 -0
@@ -0,0 +1,355 @@
1
+ # Tera Runtime Protocols — Client & Discovery
2
+
3
+ These are the client-facing and discovery protocols (Sections 12–18) split from TERA_RUNTIME_PROTOCOLS.md via INS-02 continuation (2026-08-01).
4
+ Core operational protocols: `tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CORE.md` (Sections 1–11).
5
+ Knowledge management: `tera-system/runtime/TERA_RUNTIME_PROTOCOLS.md` (Section 19).
6
+
7
+ ---
8
+
9
+ ## 12. Domain Intelligence and Research Protocol
10
+
11
+ → **انتقل إلى ملف منفصل:** `tera-system/runtime/DOMAIN_INTELLIGENCE_PROTOCOL.md`
12
+ → يحتوي: قواعد Domain Intelligence، No-Guessing Rule، Source Policy، مستويات البحث، وكل الإجراءات المرتبطة.
13
+
14
+ ---
15
+
16
+ ## 13. Application Discovery Protocol
17
+
18
+ > ⚠️ **انتقلت ملكية Phase 1 discovery إلى مُهندس (SCP-118).** البروتوكول الكامل الآن في:
19
+ > `tera-system/runtime/TERA_SOLUTION_PREPARATION_PROTOCOL.md` §1.1
20
+ >
21
+ > TeraAgent (Phase 5–7) لا يدير discovery. يحتفظ بهذا القسم كمرجع تاريخي فقط.
22
+
23
+ Application Discovery was the required dialogue and documentation phase when a user starts a new application idea or provides incomplete/unclear app information.
24
+
25
+ Core rules:
26
+
27
+ ```text
28
+ No undocumented materially important discovery.
29
+ No project preparation before documented and confirmed understanding.
30
+ No detailed execution planning or TASK-ID generation before `PROJECT_MASTER_PLAN.md` (including the formal phased roadmap) is approved.
31
+ ```
32
+
33
+ Entry triggers:
34
+
35
+ - User starts a new application idea.
36
+ - User provides scattered or informal app notes.
37
+ - Required `project-inputs` files are missing or materially incomplete.
38
+ - Existing app understanding is unclear, contradictory, or not confirmed.
39
+
40
+ Conversation rules:
41
+
42
+ - Enter `Intake Collection Mode`.
43
+ - Ask short batches of questions based on missing information.
44
+ - Do not ask all discovery questions at once.
45
+ - Normalize user statements instead of copying raw chat blindly.
46
+ - Help the user understand the app by summarizing, organizing, and asking important questions.
47
+ - Do not propose major improvements before Tera can summarize the app accurately.
48
+ - Suggestions must be options, not automatic requirements.
49
+
50
+ Documentation rules:
51
+
52
+ - Document normalized discovery information in official `project-inputs` files.
53
+ - At minimum, maintain:
54
+ - `project-inputs/01_APPLICATION_IDEA.md`
55
+ - `project-inputs/02_TECHNICAL_CONTEXT.md`
56
+ - Additional intake files may be used only when helpful, such as:
57
+ - `project-inputs/03_USER_PREFERENCES.md`
58
+ - `project-inputs/04_INITIAL_ASSUMPTIONS.md`
59
+ - `project-inputs/05_OPEN_QUESTIONS.md`
60
+ - No materially important application information may remain only in chat after discovery.
61
+ - Materially important means information that affects scope, MVP/later phasing, users, workflows, permissions, data, integrations, technical context, constraints, risks, assumptions, open questions, or acceptance.
62
+ - Do not block discovery just to preserve every minor phrase, aside, preference wording, or non-impactful detail.
63
+ - If materially important chat-only information remains undocumented, discovery remains open.
64
+
65
+ Mandatory feature classification:
66
+
67
+ - **Before writing the MVP scope into intake files, Tera must run the classification protocol defined in `tera-system/runtime/MVP_DEFINITION_PROTOCOL.md`.**
68
+ - Collect all candidate features from discovery.
69
+ - For each feature, classify by necessity, dependency, risk, cost, and implementation size into one of: Core MVP (Phase 1A) / Extended MVP (Phase 1B) / Phase 2 / Phase 3 / Later / Out of Scope.
70
+ - **User-selected features during discovery are not automatically MVP.**
71
+ - Document the classified list in `project-inputs/01_APPLICATION_IDEA.md` under the appropriate sub-sections.
72
+ - The classification must be visible in the Application Understanding Summary for user review.
73
+ - The user may reclassify, but the default is Tera's analysis-based classification.
74
+
75
+ Understanding confirmation:
76
+
77
+ 1. Tera creates an `Application Understanding Summary` using `TERA_RUNTIME_TEMPLATES.md`.
78
+ 2. Tera asks the user to confirm or correct the summary.
79
+ 3. If the user corrects it, Tera updates official intake files.
80
+ 4. Tera does not move to project preparation until understanding is minimally confirmed.
81
+
82
+ Suggestion timing:
83
+
84
+ - Tera may suggest improvements only after it sufficiently understands the application.
85
+ - Each suggestion must be classified as MVP / Later / Out of Scope / Needs User Decision.
86
+ - Tera must explain why the suggestion matters and must not push it as required scope.
87
+
88
+ Domain Intelligence handoff:
89
+
90
+ - After initial understanding is confirmed, Tera decides whether Domain Intelligence is needed.
91
+ - Domain Intelligence is optional and trigger-based.
92
+ - If research/domain analysis produces meaningful improvements or changes, Tera must return to the user with a `Research-Based Improvements Review`.
93
+ - Only agreed or Tera-approved findings may update project inputs or preparation scope.
94
+
95
+ Phased roadmap approval:
96
+
97
+ - After discovery and optional Domain Intelligence, Tera creates a `Phased Application Roadmap`.
98
+ - Tera decides what belongs in Phase 1 / MVP and what belongs in later phases.
99
+ - The discovery roadmap is a preliminary scope/phasing agreement.
100
+ - During Phase 5, it is formalized inside `project-control/PROJECT_MASTER_PLAN.md` as the official implementation roadmap.
101
+ - The user must approve `PROJECT_MASTER_PLAN.md` before detailed execution planning or `TASK-COD-*` generation.
102
+
103
+ Exit criteria:
104
+
105
+ - Available materially important user information has been collected.
106
+ - Materially important information is documented in `project-inputs`.
107
+ - Application Understanding Summary is confirmed or minimally approved.
108
+ - Domain Intelligence is completed, deferred, or marked not needed.
109
+ - Research-based changes were reviewed with the user when applicable.
110
+ - Phased roadmap is approved.
111
+
112
+ Reopen discovery when:
113
+
114
+ - A major ambiguity appears.
115
+ - A project rule or user statement conflicts with the current understanding.
116
+ - Domain research reveals a significant gap.
117
+ - The user changes the app idea, MVP, roles, workflow, or technology materially.
118
+
119
+ Forbidden actions:
120
+
121
+ - Do not start `project-preparation/` before documented discovery and user confirmation.
122
+ - Do not leave materially important discovery information only in chat.
123
+ - Do not ask large question dumps.
124
+ - Do not run open-ended domain research before initial understanding unless the user explicitly asks for reference-based discovery.
125
+ - Do not move to detailed execution planning or `TASK-COD-*` generation before `PROJECT_MASTER_PLAN.md` approval.
126
+
127
+ ---
128
+
129
+ ## 14. Client Approval Workflow Protocol
130
+
131
+ > ⚠️ **TCEA owns client approval.** TeraAgent (Phase 5–7) يتحقق فقط من Execution Authorization قبل Build Mode.
132
+ > هذا القسم مرجعي. البروتوكولات النشطة في ملفات TCEA و TeraClientPolicy.md.
133
+
134
+ Use this protocol for every external client project.
135
+
136
+ Authority references:
137
+
138
+ - `tera-system/TeraClientPolicy.md`
139
+
140
+ Workspace rule:
141
+
142
+ ```text
143
+ clients/CLIENT-[client-name-or-id]/applications/APP-[app-name-or-id]/
144
+ ```
145
+
146
+ Required stages:
147
+
148
+ 1. Register or update the client folder.
149
+ 2. Create or update `CLIENT_PROFILE.md`.
150
+ 3. Create or update `CONTACTS.md`.
151
+ 4. Identify the application folder under `applications/`.
152
+ 5. Collect client discovery answers through Majed.
153
+ 6. Produce the mandatory client approval package under `client-approval/`.
154
+ 7. Review the package for client-facing clarity and scope control.
155
+ 8. Ask Majed to confirm what was approved by the client.
156
+ 9. Record approval status in `10_CLIENT_APPROVAL_RECORD.md`.
157
+ 10. Allow Build Mode only after Execution Authorization is approved and recorded.
158
+
159
+ Mandatory approval gates:
160
+
161
+ | Gate | Requirement |
162
+ |---|---|
163
+ | Idea Approval | The client confirms the idea is understood. |
164
+ | Scope Approval | The client confirms in-scope, out-of-scope, and deferred items. |
165
+ | Flow Approval | The client confirms the main flows. |
166
+ | Screen Approval | The client confirms screen list and purpose. |
167
+ | Design Direction Approval | The client confirms style, tone, references, and constraints. |
168
+ | Prototype Approval | The client confirms the prototype or the reason no prototype is needed. |
169
+ | Execution Authorization | The client authorizes implementation to start. |
170
+
171
+ Client question rules:
172
+
173
+ - Ask short question sets that Majed can forward to the client.
174
+ - Separate confirmed facts from suggestions.
175
+ - Do not ask for every possible detail at once.
176
+ - Ask first for approval authority, scope, flows, screen expectations, and visual direction.
177
+ - If the client is non-technical, use business language rather than technical terms.
178
+
179
+ Client-facing document rules:
180
+
181
+ - Default language is Arabic.
182
+ - Do not mention Tera internals, sub-agents, runtime files, token policy, or orchestration mechanics.
183
+ - Include assumptions, exclusions, pending decisions, and approval status.
184
+ - Do not promise unconfirmed timelines, costs, third-party integrations, or platform capabilities.
185
+
186
+ Implementation restrictions:
187
+
188
+ - Do not create implementation tasks for client work before the client approval package is complete and Execution Authorization is approved.
189
+ - Do not build final UI before design direction is approved.
190
+ - Do not expand scope unless a change record exists and is approved.
191
+ - Internal technical spikes require explicit user authorization, must remain non-deliverable research, must not modify final application code, and must not become client deliverable scope without approval.
192
+
193
+ Change handling:
194
+
195
+ 1. Record the request in `client-approval/11_CHANGE_CONTROL.md`.
196
+ 2. Classify it as Clarification, Minor Adjustment, Enhancement, New Scope, Phase 2, or Rejected.
197
+ 3. If it affects execution, also record the related decision or issue in `project-control/`.
198
+ 4. Do not implement `Enhancement` or `New Scope` without documented approval.
199
+
200
+ Exit criteria before Build Mode:
201
+
202
+ - Client profile exists.
203
+ - Contacts exist.
204
+ - Approval authority is documented or explicitly confirmed by the user.
205
+ - Client approval package exists.
206
+ - Scope, flows, screen map, design direction, acceptance criteria, and execution authorization are approved and recorded.
207
+ - Only truly non-applicable package files, such as prototype notes for a no-prototype project, may be marked `Not applicable with reason`; approval gates required for execution must not be waived.
208
+ - Pending decisions are documented and do not block the next phase.
209
+
210
+ ---
211
+
212
+ ## 15. Handoff Readiness Gate
213
+
214
+ Purpose: Determine when a phase or task group is ready for using `DocumentationHandoverAgent`.
215
+
216
+ Important: `Handoff Readiness Gate` is not required for normal internal task handbacks. It is only for evaluating phase readiness, Release readiness, or formal documentation/delivery packages.
217
+
218
+ ### When to use
219
+
220
+ - Before internal handoff.
221
+ - Before Release.
222
+ - After completing a stable set of screens.
223
+ - After closing a Phase.
224
+ - When a run guide, user manual, or delivery summary is needed.
225
+
226
+ ### Must Pass
227
+
228
+ 1. The phase or screen set is stable.
229
+ 2. All core TASKs for the phase are closed or clearly classified.
230
+ 3. No blocking Issues remain open.
231
+
232
+ If any Must Pass item fails:
233
+ - Do not run `DocumentationHandoverAgent` for final delivery.
234
+ - May only run it for an internal draft if Tera decides so and documents the reason.
235
+
236
+ ### Should Pass
237
+
238
+ 4. `DECISIONS_LOG.md` is updated.
239
+ 5. `PROJECT_STATE.md` is updated.
240
+ 6. `TERA_ACTIVE_CONTEXT.md` is updated.
241
+ 7. Run instructions are clear.
242
+ 8. Required accounts or permissions are documented without secrets.
243
+ 9. Deferred notes are listed as `Known Limitations`.
244
+ 10. Documentation type is clear: internal / delivery / Release-facing.
245
+
246
+ Rule:
247
+ - `Must Pass` blocks handoff readiness.
248
+ - `Should Pass` may be bypassed only with a documented reason.
249
+
250
+ ---
251
+
252
+ ## 16. Plan Compliance Review
253
+
254
+ `PlanComplianceReviewAgent` is a compliance reviewer, not a manager above Tera.
255
+
256
+ ### Purpose
257
+
258
+ Compare actual execution against:
259
+ - `PROJECT_MASTER_PLAN.md`
260
+ - `PROJECT_DETAILED_EXECUTION_PLAN.md`
261
+ - `TASK_REGISTRY.md`
262
+ - `ISSUES_AND_GAPS.md`
263
+ - `DECISIONS_LOG.md`
264
+ - Related task files or references when needed
265
+
266
+ Detect:
267
+ - implemented items
268
+ - partially implemented items
269
+ - items needing fix before acceptance
270
+ - intentionally deferred items
271
+ - cancelled or out-of-scope items
272
+ - deviations from the plan
273
+ - inconsistencies between the plan and execution records
274
+
275
+ ### When to use
276
+
277
+ - End of a major or minor Phase.
278
+ - After a large task batch.
279
+ - Before MVP acceptance.
280
+ - Before handoff/release acceptance.
281
+ - When roadmap drift is suspected.
282
+
283
+ ### When not to use by default
284
+
285
+ - After every small task.
286
+ - As a replacement for `qa-agent`.
287
+ - As a replacement for `QualityReviewCoordinatorAgent`.
288
+ - As a replacement for `ProjectControlAgent`.
289
+
290
+ ### Relationship with other agents
291
+
292
+ - `qa-agent`: reviews task/screen/workflow acceptance.
293
+ - `QualityReviewCoordinatorAgent`: reviews periodic multi-domain quality.
294
+ - `PlanComplianceReviewAgent`: reviews roadmap and plan compliance.
295
+ - Tera remains the final decision owner for status updates, task creation, issue creation, and phase acceptance.
296
+
297
+ ### Required report format
298
+
299
+ ```text
300
+ Plan Compliance Report
301
+ - Reviewed Phase / Batch
302
+ - Planned Items Confirmed
303
+ - Implemented but Not Accepted
304
+ - Needs Fix Before Acceptance
305
+ - Deferred / Cancelled / Out of Scope Items
306
+ - Missing or Unclear Plan Coverage
307
+ - Off-Plan Work Detected
308
+ - Linked Tasks / Issues / Decisions Reviewed
309
+ - Tera Decisions Needed
310
+ ```
311
+
312
+ ---
313
+
314
+ ## 17. Sub-Agent Status Review
315
+
316
+ Tera maintains a lightweight file at:
317
+
318
+ ```text
319
+ project-control/SUB_AGENT_STATUS.md
320
+ ```
321
+
322
+ Purpose: Track sub-agent usage, load, quality, update need, and potential merge or deactivation.
323
+
324
+ ### Rules
325
+
326
+ - Tera is the final evaluator.
327
+ - `ProjectControlAgent` may only help collect data or update the file when Tera explicitly requests it.
328
+ - The file must remain compact and non-archival. It must not become a copy of `PROJECT_ACTIVITY_LOG.md`.
329
+ - Do not issue a strong judgment (e.g. `Needs Update`, `Overloaded`, `Candidate for Merge`) based on a single incident unless the problem is clearly structural and obvious.
330
+
331
+ ### When to update
332
+
333
+ - After every 3-5 tasks.
334
+ - At the end of each Phase.
335
+ - When adding, activating, or deactivating an agent.
336
+ - When an error repeats or visible pressure appears on an agent.
337
+ - Before starting a new medium or large project.
338
+
339
+ ### Mandatory separation within evaluation
340
+
341
+ - `Status` = agent's operational state within the project.
342
+ - `Quality` = output quality of the agent.
343
+ - `Decision / Notes` = what Tera decides about the agent.
344
+
345
+ If the review produces an important administrative decision, it may also be recorded in `DECISIONS_LOG.md`.
346
+
347
+ ---
348
+
349
+ ## 18. Client Discovery and Smart Interview Protocol
350
+
351
+ → ⚠️ **ملكية مُهندس (SCP-118).** البروتوكول الكامل:
352
+ → `tera-system/runtime/CLIENT_DISCOVERY_PROTOCOL.md`
353
+ → بروتوكولات التحضير: `tera-system/runtime/TERA_SOLUTION_PREPARATION_PROTOCOL.md`
354
+
355
+ ---