@atlashub/smartstack-cli 3.37.0 → 3.39.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 (228) hide show
  1. package/dist/index.js +16 -24
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +235 -265
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/scripts/extract-api-endpoints.ts +5 -5
  7. package/scripts/generate-doc-with-mock-ui.ts +10 -17
  8. package/templates/agents/ba-reader.md +9 -9
  9. package/templates/agents/ba-writer.md +12 -15
  10. package/templates/agents/code-reviewer.md +1 -1
  11. package/templates/agents/docs-context-reader.md +1 -1
  12. package/templates/agents/efcore/scan.md +3 -1
  13. package/templates/agents/gitflow/commit.md +74 -0
  14. package/templates/agents/gitflow/finish.md +5 -2
  15. package/templates/agents/gitflow/init-clone.md +3 -3
  16. package/templates/agents/gitflow/init-validate.md +3 -2
  17. package/templates/agents/gitflow/merge.md +5 -4
  18. package/templates/agents/gitflow/pr.md +5 -4
  19. package/templates/agents/gitflow/start.md +37 -5
  20. package/templates/hooks/hooks.json +11 -0
  21. package/templates/hooks/wsl-dotnet-cleanup.sh +24 -0
  22. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +20 -20
  23. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +16 -24
  24. package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +2 -2
  25. package/templates/skills/_resources/mcp-validate-documentation-spec.md +3 -3
  26. package/templates/skills/_shared.md +15 -17
  27. package/templates/skills/ai-prompt/SKILL.md +1 -1
  28. package/templates/skills/ai-prompt/steps/step-00-init.md +47 -0
  29. package/templates/skills/apex/SKILL.md +3 -4
  30. package/templates/skills/apex/_shared.md +10 -20
  31. package/templates/skills/apex/references/analysis-methods.md +141 -0
  32. package/templates/skills/apex/references/challenge-questions.md +1 -21
  33. package/templates/skills/apex/references/core-seed-data.md +35 -58
  34. package/templates/skills/apex/references/examine-build-validation.md +82 -0
  35. package/templates/skills/apex/references/execution-frontend-gates.md +177 -0
  36. package/templates/skills/apex/references/execution-frontend-patterns.md +105 -0
  37. package/templates/skills/apex/references/execution-layer1-rules.md +96 -0
  38. package/templates/skills/apex/references/initialization-challenge-flow.md +110 -0
  39. package/templates/skills/apex/references/planning-layer-mapping.md +151 -0
  40. package/templates/skills/apex/references/post-checks.md +145 -40
  41. package/templates/skills/apex/references/smartstack-api.md +35 -51
  42. package/templates/skills/apex/references/smartstack-frontend.md +18 -18
  43. package/templates/skills/apex/references/smartstack-layers.md +38 -62
  44. package/templates/skills/apex/steps/step-00-init.md +14 -26
  45. package/templates/skills/apex/steps/step-01-analyze.md +10 -143
  46. package/templates/skills/apex/steps/step-02-plan.md +10 -92
  47. package/templates/skills/apex/steps/step-03-execute.md +45 -252
  48. package/templates/skills/apex/steps/step-04-examine.md +14 -78
  49. package/templates/skills/apex/steps/step-05-deep-review.md +2 -2
  50. package/templates/skills/apex/steps/step-08-run-tests.md +1 -0
  51. package/templates/skills/application/SKILL.md +241 -242
  52. package/templates/skills/application/references/backend-controller-hierarchy.md +16 -16
  53. package/templates/skills/application/references/backend-seeding-and-dto-output.md +83 -0
  54. package/templates/skills/application/references/backend-table-prefix-mapping.md +79 -0
  55. package/templates/skills/application/references/backend-verification.md +1 -1
  56. package/templates/skills/application/references/frontend-i18n-and-output.md +67 -0
  57. package/templates/skills/application/references/frontend-route-naming.md +117 -0
  58. package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +107 -0
  59. package/templates/skills/application/references/frontend-verification.md +12 -12
  60. package/templates/skills/application/references/init-parameter-detection.md +121 -0
  61. package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
  62. package/templates/skills/application/references/nav-fallback-procedure.md +199 -200
  63. package/templates/skills/application/references/provider-template.md +2 -6
  64. package/templates/skills/application/references/roles-client-project-handling.md +55 -0
  65. package/templates/skills/application/references/roles-fallback-procedure.md +149 -0
  66. package/templates/skills/application/references/test-coverage-requirements.md +213 -0
  67. package/templates/skills/application/references/test-frontend.md +3 -3
  68. package/templates/skills/application/steps/step-00-init.md +130 -260
  69. package/templates/skills/application/steps/step-01-navigation.md +170 -170
  70. package/templates/skills/application/steps/step-02-permissions.md +196 -196
  71. package/templates/skills/application/steps/step-03-roles.md +182 -339
  72. package/templates/skills/application/steps/step-03b-provider.md +133 -134
  73. package/templates/skills/application/steps/step-04-backend.md +174 -265
  74. package/templates/skills/application/steps/step-05-frontend.md +18 -144
  75. package/templates/skills/application/steps/step-06-migration.md +12 -60
  76. package/templates/skills/application/steps/step-07-tests.md +9 -76
  77. package/templates/skills/application/templates-backend.md +29 -27
  78. package/templates/skills/application/templates-frontend.md +49 -49
  79. package/templates/skills/application/templates-seed.md +57 -131
  80. package/templates/skills/business-analyse/SKILL.md +27 -30
  81. package/templates/skills/business-analyse/_architecture.md +6 -6
  82. package/templates/skills/business-analyse/_shared.md +60 -88
  83. package/templates/skills/business-analyse/questionnaire/04-data.md +3 -3
  84. package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
  85. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +1 -1
  86. package/templates/skills/business-analyse/react/application-viewer.md +12 -12
  87. package/templates/skills/business-analyse/react/components.md +8 -12
  88. package/templates/skills/business-analyse/react/schema.md +836 -836
  89. package/templates/skills/business-analyse/references/agent-module-prompt.md +2 -3
  90. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +190 -0
  91. package/templates/skills/business-analyse/references/cache-warming-strategy.md +2 -2
  92. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +41 -0
  93. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +74 -0
  94. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +69 -0
  95. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +1 -1
  96. package/templates/skills/business-analyse/references/compilation-structure-cards.md +297 -0
  97. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
  98. package/templates/skills/business-analyse/references/deploy-modes.md +5 -5
  99. package/templates/skills/business-analyse/references/detection-strategies.md +7 -7
  100. package/templates/skills/business-analyse/references/handoff-file-templates.md +14 -22
  101. package/templates/skills/business-analyse/references/handoff-mappings.md +4 -4
  102. package/templates/skills/business-analyse/references/handoff-seeddata-generation.md +312 -0
  103. package/templates/skills/business-analyse/references/init-schema-deployment.md +3 -3
  104. package/templates/skills/business-analyse/references/naming-conventions.md +22 -24
  105. package/templates/skills/business-analyse/references/prd-generation.md +2 -2
  106. package/templates/skills/business-analyse/references/review-data-mapping.md +2 -2
  107. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  108. package/templates/skills/business-analyse/references/spec-auto-inference.md +3 -3
  109. package/templates/skills/business-analyse/references/team-orchestration.md +49 -6
  110. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  111. package/templates/skills/business-analyse/references/ui-resource-cards.md +18 -18
  112. package/templates/skills/business-analyse/references/validate-incremental-html.md +2 -2
  113. package/templates/skills/business-analyse/references/validation-checklist.md +2 -2
  114. package/templates/skills/business-analyse/schemas/application-schema.json +4 -5
  115. package/templates/skills/business-analyse/schemas/project-schema.json +1 -6
  116. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -3
  117. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +4 -4
  118. package/templates/skills/business-analyse/steps/step-00-init.md +8 -17
  119. package/templates/skills/business-analyse/steps/step-01-cadrage.md +35 -198
  120. package/templates/skills/business-analyse/steps/step-01b-applications.md +16 -20
  121. package/templates/skills/business-analyse/steps/step-02-decomposition.md +1 -1
  122. package/templates/skills/business-analyse/steps/step-03a1-setup.md +4 -4
  123. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +1 -1
  124. package/templates/skills/business-analyse/steps/step-03b-ui.md +4 -4
  125. package/templates/skills/business-analyse/steps/step-03c-compile.md +66 -140
  126. package/templates/skills/business-analyse/steps/step-03d-validate.md +2 -2
  127. package/templates/skills/business-analyse/steps/step-04a-collect.md +2 -2
  128. package/templates/skills/business-analyse/steps/step-04b-analyze.md +42 -160
  129. package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
  130. package/templates/skills/business-analyse/steps/step-05a-handoff.md +74 -104
  131. package/templates/skills/business-analyse/steps/step-05b-deploy.md +13 -11
  132. package/templates/skills/business-analyse/steps/step-06-review.md +3 -3
  133. package/templates/skills/business-analyse/templates/tpl-frd.md +13 -13
  134. package/templates/skills/business-analyse/templates/tpl-handoff.md +12 -12
  135. package/templates/skills/business-analyse/templates/tpl-progress.md +1 -1
  136. package/templates/skills/business-analyse/templates-frd.md +25 -25
  137. package/templates/skills/business-analyse/templates-react.md +15 -21
  138. package/templates/skills/controller/SKILL.md +1 -1
  139. package/templates/skills/controller/postman-templates.md +1 -1
  140. package/templates/skills/controller/references/controller-code-templates.md +2 -2
  141. package/templates/skills/controller/references/mcp-scaffold-workflow.md +209 -0
  142. package/templates/skills/controller/references/permission-sync-templates.md +13 -16
  143. package/templates/skills/controller/steps/step-00-init.md +11 -11
  144. package/templates/skills/controller/steps/step-03-generate.md +64 -103
  145. package/templates/skills/controller/templates.md +67 -71
  146. package/templates/skills/debug/SKILL.md +13 -218
  147. package/templates/skills/debug/steps/step-00-init.md +57 -0
  148. package/templates/skills/debug/steps/step-01-analyze.md +219 -0
  149. package/templates/skills/debug/steps/step-02-resolve.md +85 -0
  150. package/templates/skills/documentation/SKILL.md +49 -345
  151. package/templates/skills/documentation/data-schema.md +11 -8
  152. package/templates/skills/documentation/steps/step-00-init.md +70 -0
  153. package/templates/skills/documentation/steps/step-01-scan.md +113 -0
  154. package/templates/skills/documentation/steps/step-02-generate.md +231 -0
  155. package/templates/skills/documentation/steps/step-03-validate.md +238 -0
  156. package/templates/skills/documentation/templates.md +480 -322
  157. package/templates/skills/efcore/SKILL.md +1 -1
  158. package/templates/skills/efcore/references/both-contexts.md +32 -0
  159. package/templates/skills/efcore/references/database-operations.md +67 -0
  160. package/templates/skills/efcore/references/destructive-operations.md +38 -0
  161. package/templates/skills/efcore/references/reset-operations.md +81 -0
  162. package/templates/skills/efcore/references/seed-methods.md +86 -0
  163. package/templates/skills/efcore/references/shared-init-functions.md +250 -0
  164. package/templates/skills/efcore/references/sql-objects-injection.md +61 -0
  165. package/templates/skills/efcore/references/troubleshooting.md +81 -0
  166. package/templates/skills/efcore/steps/db/step-deploy.md +1 -32
  167. package/templates/skills/efcore/steps/db/step-reset.md +7 -103
  168. package/templates/skills/efcore/steps/db/step-seed.md +10 -132
  169. package/templates/skills/efcore/steps/db/step-status.md +5 -44
  170. package/templates/skills/efcore/steps/migration/step-02-create.md +1 -14
  171. package/templates/skills/efcore/steps/migration/step-03-validate.md +8 -62
  172. package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +1 -57
  173. package/templates/skills/efcore/steps/shared/step-00-init.md +11 -254
  174. package/templates/skills/efcore/steps/squash/step-03-create.md +1 -58
  175. package/templates/skills/feature-full/SKILL.md +1 -1
  176. package/templates/skills/feature-full/steps/step-00-init.md +57 -0
  177. package/templates/skills/feature-full/steps/step-01-implementation.md +1 -1
  178. package/templates/skills/gitflow/SKILL.md +28 -5
  179. package/templates/skills/gitflow/_shared.md +109 -12
  180. package/templates/skills/gitflow/phases/abort.md +4 -0
  181. package/templates/skills/gitflow/phases/cleanup.md +4 -0
  182. package/templates/skills/gitflow/references/commit-message-generation.md +58 -0
  183. package/templates/skills/gitflow/references/commit-migration-validation.md +49 -0
  184. package/templates/skills/gitflow/references/finish-cleanup.md +55 -0
  185. package/templates/skills/gitflow/references/finish-version-bumping.md +45 -0
  186. package/templates/skills/gitflow/references/init-environment-detection.md +41 -0
  187. package/templates/skills/gitflow/references/init-questions.md +185 -0
  188. package/templates/skills/gitflow/references/init-structure-creation.md +75 -0
  189. package/templates/skills/gitflow/references/init-version-detection.md +21 -0
  190. package/templates/skills/gitflow/references/init-workspace-detection.md +43 -0
  191. package/templates/skills/gitflow/references/merge-ci-status.md +36 -0
  192. package/templates/skills/gitflow/references/merge-execution.md +62 -0
  193. package/templates/skills/gitflow/references/merge-pr-context.md +76 -0
  194. package/templates/skills/gitflow/references/pr-build-checks.md +60 -0
  195. package/templates/skills/gitflow/references/pr-generation.md +58 -0
  196. package/templates/skills/gitflow/references/start-branch-normalization.md +28 -0
  197. package/templates/skills/gitflow/references/start-worktree-creation.md +50 -0
  198. package/templates/skills/gitflow/references/sync-push-verify.md +44 -0
  199. package/templates/skills/gitflow/references/sync-rebase-conflicts.md +38 -0
  200. package/templates/skills/gitflow/steps/step-commit.md +12 -91
  201. package/templates/skills/gitflow/steps/step-finish.md +15 -159
  202. package/templates/skills/gitflow/steps/step-init.md +24 -326
  203. package/templates/skills/gitflow/steps/step-merge.md +17 -176
  204. package/templates/skills/gitflow/steps/step-pr.md +10 -116
  205. package/templates/skills/gitflow/steps/step-start.md +16 -109
  206. package/templates/skills/gitflow/steps/step-sync.md +6 -69
  207. package/templates/skills/ralph-loop/SKILL.md +6 -0
  208. package/templates/skills/ralph-loop/references/category-completeness.md +185 -0
  209. package/templates/skills/ralph-loop/references/compact-loop.md +1 -1
  210. package/templates/skills/ralph-loop/references/init-resume-recovery.md +127 -0
  211. package/templates/skills/ralph-loop/references/module-transition.md +151 -0
  212. package/templates/skills/ralph-loop/references/multi-module-queue.md +171 -0
  213. package/templates/skills/ralph-loop/references/parallel-execution.md +246 -0
  214. package/templates/skills/ralph-loop/references/task-transform-legacy.md +6 -9
  215. package/templates/skills/ralph-loop/references/team-orchestration.md +45 -3
  216. package/templates/skills/ralph-loop/steps/step-00-init.md +36 -109
  217. package/templates/skills/ralph-loop/steps/step-01-task.md +15 -163
  218. package/templates/skills/ralph-loop/steps/step-02-execute.md +8 -154
  219. package/templates/skills/ralph-loop/steps/step-04-check.md +20 -73
  220. package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
  221. package/templates/skills/review-code/references/smartstack-conventions.md +568 -568
  222. package/templates/skills/validate-feature/references/api-smoke-tests.md +140 -0
  223. package/templates/skills/validate-feature/references/db-validation-checks.md +180 -0
  224. package/templates/skills/validate-feature/steps/step-01-compile.md +1 -3
  225. package/templates/skills/validate-feature/steps/step-04-api-smoke.md +34 -145
  226. package/templates/skills/validate-feature/steps/step-05-db-validation.md +74 -260
  227. package/templates/skills/workflow/SKILL.md +1 -1
  228. package/templates/skills/workflow/steps/step-00-init.md +57 -0
@@ -48,42 +48,20 @@ Compile all data collected in step-03a (data) and step-03b (UI) into the module
48
48
 
49
49
  Generate the complete specification for this module. **Each subsection below includes a STRUCTURE CARD showing the EXACT JSON format. Follow them precisely.**
50
50
 
51
+ > **Reference:** Load `references/compilation-structure-cards.md` for all STRUCTURE CARD definitions and type inference guidance.
52
+
51
53
  #### ENTITY ATTRIBUTE SCHEMA (MANDATORY — applies to ALL entities in section 6b of step-03a)
52
54
 
53
55
  > **CRITICAL:** Entity attributes MUST use STRUCTURED properties, not free-text validation strings.
54
56
  > The ralph-loop needs parseable types to generate correct C# code.
55
57
 
56
- > **STRUCTURE CARD: analysis.entities[].attributes[]**
57
- > ```json
58
- > {
59
- > "name": "occupancyRate",
60
- > "description": "Employee occupancy percentage",
61
- > "type": "decimal",
62
- > "maxLength": null,
63
- > "nullable": true,
64
- > "required": false,
65
- > "unique": false,
66
- > "indexed": false,
67
- > "defaultValue": "100",
68
- > "validation": "min:0, max:100, step:0.01",
69
- > "foreignKey": null
70
- > }
71
- > ```
72
- > **MANDATORY fields:** `name`, `type`
73
- > **type values:** `string`, `int`, `long`, `decimal`, `double`, `bool`, `DateTime`, `DateOnly`, `TimeOnly`, `Guid`, `enum:{EnumName}`, `byte[]`
74
- > **For FK attributes:**
75
- > ```json
76
- > {
77
- > "name": "departmentId",
78
- > "description": "FK to Department",
79
- > "type": "Guid",
80
- > "required": true,
81
- > "foreignKey": { "targetEntity": "Department", "targetField": "Id", "onDelete": "restrict" }
82
- > }
83
- > ```
84
- > **FORBIDDEN:** Free-text-only validation like `"FK vers Employee"` or `"Max 100 caractères"` without corresponding structured properties.
85
- >
86
- > **BaseEntity inheritance:** All entities inherit `tenantId`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy` from SmartStack.BaseEntity. Do NOT redeclare these. Document this once at the top of the entities section.
58
+ **MANDATORY fields:** `name`, `type`
59
+ **type values:** `string`, `int`, `long`, `decimal`, `double`, `bool`, `DateTime`, `DateOnly`, `TimeOnly`, `Guid`, `enum:{EnumName}`, `byte[]`
60
+
61
+ The reference includes:
62
+ - Detailed STRUCTURE CARD for entity attributes (with FK examples)
63
+ - Type inference priority table for auto-fixing missing types
64
+ - BaseEntity inheritance rules (tenantId, createdAt, updatedAt, createdBy, updatedBy)
87
65
 
88
66
  #### ENTITY ATTRIBUTE FORMAT POST-CHECK (BLOCKING — runs for EVERY module including the first)
89
67
 
@@ -91,85 +69,33 @@ Generate the complete specification for this module. **Each subsection below inc
91
69
  > It runs for ALL modules, not just modules 2+. The first module is NOT exempt.
92
70
  > Without `type`, ralph-loop cannot generate correct C# properties, EF configurations, or validators.
93
71
 
94
- After compiling entities for this module, verify and auto-fix:
72
+ **Reference:** Load `references/compilation-structure-cards.md` § "Type Inference Priority Table" for the complete auto-fix logic and inference patterns.
95
73
 
96
- ```javascript
97
- const entities = analysis.entities || [];
98
- let autoFixCount = 0;
99
- for (const entity of entities) {
100
- for (const attr of entity.attributes || []) {
101
- if (!attr.type) {
102
- // BLOCKING: attribute has no type — likely free-text validation only
103
- console.error(`BLOCKING: ${entity.name}.${attr.name} has no "type" field`);
104
- console.error(` Found: ${JSON.stringify(attr)}`);
105
- console.error(` Expected: { "name": "${attr.name}", "type": "string|int|decimal|...", "maxLength": ..., "required": ... }`);
106
- // AUTO-FIX: Infer type from validation string or attribute name
107
- if (attr.validation?.match(/max\s*\d+/i) || attr.name.match(/name|title|code|description|label|email|phone|address/i)) {
108
- attr.type = "string";
109
- const maxMatch = attr.validation?.match(/max\s*(\d+)/i);
110
- if (maxMatch) attr.maxLength = parseInt(maxMatch[1]);
111
- } else if (attr.name.match(/id$/i)) {
112
- attr.type = "Guid";
113
- } else if (attr.name.match(/date|At$/i)) {
114
- attr.type = "DateTime";
115
- } else if (attr.name.match(/is[A-Z]|has[A-Z]|active|enabled/)) {
116
- attr.type = "bool";
117
- } else if (attr.name.match(/amount|salary|rate|price|total/i)) {
118
- attr.type = "decimal";
119
- } else if (attr.name.match(/count|number|order|sort|index/i)) {
120
- attr.type = "int";
121
- }
122
- // Default to string if no pattern matched
123
- if (!attr.type) attr.type = "string";
124
- autoFixCount++;
125
- }
126
- // Normalize free-text validation into structured maxLength
127
- if (typeof attr.validation === 'string' && !attr.maxLength) {
128
- const maxMatch = attr.validation.match(/max\s*(\d+)/i);
129
- if (maxMatch) attr.maxLength = parseInt(maxMatch[1]);
130
- }
131
- // Ensure required defaults to true if absent
132
- if (attr.required === undefined) attr.required = true;
133
- }
134
- }
135
- if (autoFixCount > 0) {
136
- console.warn(`AUTO-FIXED ${autoFixCount} attributes with missing type — verify correctness`);
137
- }
138
- ```
139
-
140
- > **Type inference priority table:**
141
- >
142
- > | Attribute name pattern | Inferred type | Example |
143
- > |----------------------|---------------|---------|
144
- > | `name\|title\|code\|description\|label\|email\|phone\|address` | `string` | `positionTitle` → `string` |
145
- > | `*Id` (ends with Id) | `Guid` | `departmentId` → `Guid` |
146
- > | `*date\|*At` (ends with date/At) | `DateTime` | `hireDate` → `DateTime` |
147
- > | `is*\|has*\|active\|enabled` | `bool` | `isActive` → `bool` |
148
- > | `amount\|salary\|rate\|price\|total` | `decimal` | `hourlyRate` → `decimal` |
149
- > | `count\|number\|order\|sort\|index` | `int` | `displayOrder` → `int` |
150
- > | `validation` contains `max NNN` | `string` + `maxLength: NNN` | `"Max 200"` → `string`, `200` |
151
- > | No match | `string` (safe default) | — |
74
+ After compiling entities for this module:
75
+ 1. Verify every entity attribute has a `type` field (not free-text only)
76
+ 2. Apply auto-fix logic (infer from validation string or attribute name patterns)
77
+ 3. Normalize free-text validation into structured maxLength/validation properties
78
+ 4. Ensure required defaults to true if absent
152
79
 
153
80
  ---
154
81
 
155
- #### 8a. Actors
82
+ #### 8a-8l. Specification Structure Cards
156
83
 
157
- Inherited from application roles mapped to module permissions.
84
+ > **Reference:** Load `references/compilation-structure-cards.md` for all STRUCTURE CARD definitions.
158
85
 
159
- > **STRUCTURE CARD: specification.actors[]**
160
- > ```json
161
- > {
162
- > "role": "Sales Manager",
163
- > "description": "Creates and approves orders",
164
- > "permissions": [
165
- > "business.{app}.{module}.read",
166
- > "business.{app}.{module}.create",
167
- > "business.{app}.{module}.update"
168
- > ]
169
- > }
170
- > ```
171
- > **MANDATORY fields:** `role`, `permissions` (array of permission paths)
172
- > **FORBIDDEN fields:** Do NOT use `systemRole`. Use `permissions` array.
86
+ The reference includes detailed JSON templates for:
87
+ - **8a. Actors** — role and permissions mapping
88
+ - **8b. Use Cases** — UC-{PREFIX}-NNN format with scenarios
89
+ - **8c. Functional Requirements** — FR-{PREFIX}-NNN format
90
+ - **8d. Permission Matrix** — role assignments and paths
91
+ - **8e. Navigation** — module, sections, and resources
92
+ - **8f. SeedData Core** — 9 mandatory arrays
93
+ - **8g. Gherkin Scenarios** — BDD format (MUST be array)
94
+ - **8h. Validations** — field rules and error keys
95
+ - **8i. Messages** — success/error/warning/info types
96
+ - **8j. Entity Lifecycle** — state machines
97
+ - **8k. API Endpoints** — RESTful routes
98
+ - **8l. i18n Keys** 4 languages (fr, en, it, de)
173
99
 
174
100
  #### 8b. Use Cases (UC-{PREFIX}-NNN)
175
101
 
@@ -181,7 +107,7 @@ Per section: list, create, read, update, delete, approve, etc.
181
107
  > "id": "UC-{PREFIX}-001",
182
108
  > "name": "Create Order",
183
109
  > "primaryActor": "Sales Representative",
184
- > "permission": "business.{app}.{module}.create",
110
+ > "permission": "{app}.{module}.create",
185
111
  > "preconditions": ["Customer exists", "Products in stock"],
186
112
  > "postconditions": ["Order created with Draft status"],
187
113
  > "mainScenario": [
@@ -232,35 +158,35 @@ Roles × resources × operations with full paths.
232
158
  > ```json
233
159
  > {
234
160
  > "permissions": [
235
- > { "path": "business.{app}.{module}.read", "action": "read", "description": "View records" },
236
- > { "path": "business.{app}.{module}.create", "action": "create", "description": "Create new records" },
237
- > { "path": "business.{app}.{module}.update", "action": "update", "description": "Update existing records" },
238
- > { "path": "business.{app}.{module}.delete", "action": "delete", "description": "Delete records" },
239
- > { "path": "business.{app}.{module}.export", "action": "export", "description": "Export data" },
240
- > { "path": "business.{app}.{module}.dashboard.read", "action": "read", "description": "View dashboard (section-level)" }
161
+ > { "path": "{app}.{module}.read", "action": "read", "description": "View records" },
162
+ > { "path": "{app}.{module}.create", "action": "create", "description": "Create new records" },
163
+ > { "path": "{app}.{module}.update", "action": "update", "description": "Update existing records" },
164
+ > { "path": "{app}.{module}.delete", "action": "delete", "description": "Delete records" },
165
+ > { "path": "{app}.{module}.export", "action": "export", "description": "Export data" },
166
+ > { "path": "{app}.{module}.dashboard.read", "action": "read", "description": "View dashboard (section-level)" }
241
167
  > ],
242
168
  > "roleAssignments": [
243
- > { "role": "{App} Admin", "permissions": ["business.{app}.{module}.read", "business.{app}.{module}.create", "business.{app}.{module}.update", "business.{app}.{module}.delete", "business.{app}.{module}.export", "business.{app}.{module}.dashboard.read"] },
244
- > { "role": "{App} Manager", "permissions": ["business.{app}.{module}.read", "business.{app}.{module}.create", "business.{app}.{module}.update", "business.{app}.{module}.dashboard.read"] },
245
- > { "role": "{App} Viewer", "permissions": ["business.{app}.{module}.read"] }
169
+ > { "role": "{App} Admin", "permissions": ["{app}.{module}.read", "{app}.{module}.create", "{app}.{module}.update", "{app}.{module}.delete", "{app}.{module}.export", "{app}.{module}.dashboard.read"] },
170
+ > { "role": "{App} Manager", "permissions": ["{app}.{module}.read", "{app}.{module}.create", "{app}.{module}.update", "{app}.{module}.dashboard.read"] },
171
+ > { "role": "{App} Viewer", "permissions": ["{app}.{module}.read"] }
246
172
  > ]
247
173
  > }
248
174
  > ```
249
175
  > **STRUCTURE:** Object with 2 arrays: `permissions[]` and `roleAssignments[]`
250
- > **Permission levels:** Module-level = `business.{app}.{module}.{action}` (4 segments). Section-level = `business.{app}.{module}.{section}.{action}` (5 segments, for sections needing distinct access like dashboard, approve, import).
176
+ > **Permission levels:** Module-level = `{app}.{module}.{action}` (3 segments). Section-level = `{app}.{module}.{section}.{action}` (4 segments, for sections needing distinct access like dashboard, approve, import).
251
177
  > **FORBIDDEN:** Do NOT use a flat array with `resource`/`roles` fields. Always use the nested structure above.
252
178
 
253
179
  #### 8e. Navigation
254
180
 
255
- Module → Sections → Resources (levels 3-4-5 of the hierarchy).
181
+ Module → Sections → Resources (levels 2-3-4 of the hierarchy).
256
182
 
257
183
  > **STRUCTURE CARD: specification.navigation**
258
184
  > ```json
259
185
  > {
260
186
  > "entries": [
261
- > { "level": "module", "code": "{module}", "labels": {"fr": "...", "en": "...", "it": "...", "de": "..."}, "route": "/business/{app}/{module}", "icon": "list" },
262
- > { "level": "section", "code": "list", "labels": {"fr": "Liste", "en": "List", "it": "Elenco", "de": "Liste"}, "route": "/business/{app}/{module}", "icon": "list" },
263
- > { "level": "section", "code": "dashboard", "labels": {"fr": "Tableau de bord", "en": "Dashboard", "it": "Cruscotto", "de": "Dashboard"}, "route": "/business/{app}/{module}/dashboard", "icon": "chart-bar", "isNew": true }
187
+ > { "level": "module", "code": "{module}", "labels": {"fr": "...", "en": "...", "it": "...", "de": "..."}, "route": "/{app}/{module}", "icon": "list" },
188
+ > { "level": "section", "code": "list", "labels": {"fr": "Liste", "en": "List", "it": "Elenco", "de": "Liste"}, "route": "/{app}/{module}", "icon": "list" },
189
+ > { "level": "section", "code": "dashboard", "labels": {"fr": "Tableau de bord", "en": "Dashboard", "it": "Cruscotto", "de": "Dashboard"}, "route": "/{app}/{module}/dashboard", "icon": "chart-bar", "isNew": true }
264
190
  > ]
265
191
  > }
266
192
  > ```
@@ -275,14 +201,14 @@ if (!nav || !nav.entries || nav.entries.length === 0) {
275
201
  console.warn('AUTO-FIX: navigation.entries is empty — generating from sections');
276
202
  const sections = specification.sections || [];
277
203
  const entries = [
278
- { level: "module", code: "{module}", labels: {fr: "{ModuleName}", en: "{ModuleName}", it: "{ModuleName}", de: "{ModuleName}"}, route: "/business/{app}/{module}", icon: "list" }
204
+ { level: "module", code: "{module}", labels: {fr: "{ModuleName}", en: "{ModuleName}", it: "{ModuleName}", de: "{ModuleName}"}, route: "/{app}/{module}", icon: "list" }
279
205
  ];
280
206
  for (const section of sections) {
281
207
  entries.push({
282
208
  level: "section",
283
209
  code: section.code,
284
210
  labels: {fr: section.name || section.code, en: section.name || section.code, it: section.name || section.code, de: section.name || section.code},
285
- route: section.route || `/business/{app}/{module}/${section.code}`,
211
+ route: section.route || `/{app}/{module}/${section.code}`,
286
212
  icon: section.icon || "file-text"
287
213
  });
288
214
  }
@@ -307,7 +233,7 @@ for (const entry of specification.navigation.entries) {
307
233
  > ```json
308
234
  > {
309
235
  > "navigationApplications": [
310
- > { "code": "{app}", "label": "{Application Name}", "icon": "{icon}", "route": "/business/{app-kebab}", "sort": 1 }
236
+ > { "code": "{app}", "label": "{Application Name}", "icon": "{icon}", "route": "/{app-kebab}", "sort": 1 }
311
237
  > ],
312
238
  > "applicationRoles": [
313
239
  > { "code": "admin", "name": "{App} Admin", "permissions": "*" },
@@ -316,16 +242,16 @@ for (const entry of specification.navigation.entries) {
316
242
  > { "code": "viewer", "name": "{App} Viewer", "permissions": "R" }
317
243
  > ],
318
244
  > "navigationModules": [
319
- > { "code": "{module}", "label": "{Module Name}", "icon": "list", "route": "/business/{app}/{module}", "parentCode": "{app}", "sort": 1 }
245
+ > { "code": "{module}", "label": "{Module Name}", "icon": "list", "route": "/{app}/{module}", "parentCode": "{app}", "sort": 1 }
320
246
  > ],
321
247
  > "navigationSections": [
322
- > { "code": "list", "label": "Liste", "icon": "List", "route": "/business/{app}/{module}", "parentCode": "{module}", "permission": "business.{app}.{module}.read", "sort": 1 },
323
- > { "code": "detail", "label": "Détail", "icon": "FileText", "route": "/business/{app}/{module}/:id", "parentCode": "{module}", "permission": "business.{app}.{module}.read", "sort": 2, "navigation": "hidden" },
324
- > { "code": "dashboard", "label": "Dashboard", "icon": "BarChart", "route": "/business/{app}/{module}/dashboard", "parentCode": "{module}", "permission": "business.{app}.{module}.dashboard.read", "sort": 3 }
248
+ > { "code": "list", "label": "Liste", "icon": "List", "route": "/{app}/{module}", "parentCode": "{module}", "permission": "{app}.{module}.read", "sort": 1 },
249
+ > { "code": "detail", "label": "Détail", "icon": "FileText", "route": "/{app}/{module}/:id", "parentCode": "{module}", "permission": "{app}.{module}.read", "sort": 2, "navigation": "hidden" },
250
+ > { "code": "dashboard", "label": "Dashboard", "icon": "BarChart", "route": "/{app}/{module}/dashboard", "parentCode": "{module}", "permission": "{app}.{module}.dashboard.read", "sort": 3 }
325
251
  > ],
326
252
  > "navigationResources": [
327
- > { "code": "{module}-grid", "type": "SmartTable", "entity": "{Entity}", "parentCode": "list", "permission": "business.{app}.{module}.read" },
328
- > { "code": "{module}-detail-card", "type": "DetailCard", "entity": "{Entity}", "parentCode": "detail", "permission": "business.{app}.{module}.read" }
253
+ > { "code": "{module}-grid", "type": "SmartTable", "entity": "{Entity}", "parentCode": "list", "permission": "{app}.{module}.read" },
254
+ > { "code": "{module}-detail-card", "type": "DetailCard", "entity": "{Entity}", "parentCode": "detail", "permission": "{app}.{module}.read" }
329
255
  > ],
330
256
  > "navigationTranslations": [
331
257
  > { "moduleCode": "{module}", "language": "fr", "label": "..." },
@@ -334,17 +260,17 @@ for (const entry of specification.navigation.entries) {
334
260
  > { "moduleCode": "{module}", "language": "de", "label": "..." }
335
261
  > ],
336
262
  > "permissions": [
337
- > { "path": "business.{app}.{module}.read", "action": "read", "description": "View {module}" },
338
- > { "path": "business.{app}.{module}.create", "action": "create", "description": "Create {module}" },
339
- > { "path": "business.{app}.{module}.dashboard.read", "action": "read", "description": "View {module} dashboard (section-level)" }
263
+ > { "path": "{app}.{module}.read", "action": "read", "description": "View {module}" },
264
+ > { "path": "{app}.{module}.create", "action": "create", "description": "Create {module}" },
265
+ > { "path": "{app}.{module}.dashboard.read", "action": "read", "description": "View {module} dashboard (section-level)" }
340
266
  > ],
341
267
  > "rolePermissions": [
342
- > { "role": "{App} Admin", "permissionPath": "business.{app}.{module}.*" },
343
- > { "role": "{App} Manager", "permissionPath": "business.{app}.{module}.read" }
268
+ > { "role": "{App} Admin", "permissionPath": "{app}.{module}.*" },
269
+ > { "role": "{App} Manager", "permissionPath": "{app}.{module}.read" }
344
270
  > ],
345
271
  > "permissionConstants": [
346
- > { "constantName": "{Module}Read", "path": "business.{app}.{module}.read" },
347
- > { "constantName": "{Module}Create", "path": "business.{app}.{module}.create" }
272
+ > { "constantName": "{Module}Read", "path": "{app}.{module}.read" },
273
+ > { "constantName": "{Module}Create", "path": "{app}.{module}.create" }
348
274
  > ]
349
275
  > }
350
276
  > ```
@@ -355,8 +281,8 @@ for (const entry of specification.navigation.entries) {
355
281
  > **FORBIDDEN:** Do NOT use `navigationModule` (singular string), `permissions` as flat string array, `rolePermissions` as flat object, `permissionsConstants` as comma-separated string.
356
282
  >
357
283
  > **FORBIDDEN in navigation routes:**
358
- > - `/business/{app}/{module}/list` → use `/business/{app}/{module}` (list IS the module route)
359
- > - `/business/{app}/{module}/detail/:id` → use `/business/{app}/{module}/:id`
284
+ > - `/{app}/{module}/list` → use `/{app}/{module}` (list IS the module route)
285
+ > - `/{app}/{module}/detail/:id` → use `/{app}/{module}/:id`
360
286
  > - Navigation routes must match React Router paths exactly
361
287
 
362
288
  #### 8f-bis. Transform Sections into Navigation SeedData
@@ -500,7 +426,7 @@ State machines for entities with status/state.
500
426
  > {
501
427
  > "from": "draft", "to": "submitted", "action": "submit",
502
428
  > "label": { "fr": "Soumettre", "en": "Submit" },
503
- > "permission": "business.{app}.{module}.update",
429
+ > "permission": "{app}.{module}.update",
504
430
  > "guards": ["BR-VAL-{PREFIX}-001"],
505
431
  > "effects": [{ "type": "notification", "target": "role:manager", "template": "{module}-submitted" }],
506
432
  > "confirm": true
@@ -520,8 +446,8 @@ RESTful routes following SmartStack patterns.
520
446
  > ```json
521
447
  > {
522
448
  > "method": "GET|POST|PUT|PATCH|DELETE",
523
- > "path": "/api/business/{app}/{module}",
524
- > "permission": "business.{app}.{module}.read",
449
+ > "path": "/api/{app}/{module}",
450
+ > "permission": "{app}.{module}.read",
525
451
  > "requestDto": "Get{Module}Query",
526
452
  > "responseDto": "{Module}Dto[]",
527
453
  > "description": "List all records with pagination and filters"
@@ -106,7 +106,7 @@ IF failures.length > 0:
106
106
  - Every FR has ≥1 linked BR
107
107
  - All BR references exist in analysis.businessRules
108
108
  - All actors appear in permissionMatrix
109
- - Permission paths use correct format: module-level `business.{app}.{module}.{action}` or section-level `business.{app}.{module}.{section}.{action}`
109
+ - Permission paths use correct format: module-level `{app}.{module}.{action}` or section-level `{app}.{module}.{section}.{action}`
110
110
  - rolePermissions paths match permissions paths
111
111
  - API routes use consistent prefix
112
112
 
@@ -339,7 +339,7 @@ Display comprehensive summary:
339
339
  ### Rôles & Permissions pour {currentModule}
340
340
  | Rôle | Permissions |
341
341
  |------|------------|
342
- | {App} Admin | business.{app}.{module}.* |
342
+ | {App} Admin | {app}.{module}.* |
343
343
  | {App} Manager | read, create, update, assign |
344
344
  | {App} Contributor | read, create, update |
345
345
  | {App} Viewer | read |
@@ -327,9 +327,9 @@ IF workflow.mode !== "project":
327
327
 
328
328
  3. **Cross-Application Permission Path Consistency:**
329
329
  ```javascript
330
- // Verify permission paths use correct context per application
330
+ // Verify permission paths use correct prefix per application
331
331
  for (const app of applications) {
332
- const expectedPrefix = `${app.context}.${toKebabCase(app.code)}`;
332
+ const expectedPrefix = toKebabCase(app.code);
333
333
  for (const mod of app.modules) {
334
334
  for (const perm of mod.permissions || []) {
335
335
  if (!perm.path.startsWith(expectedPrefix)) {
@@ -23,140 +23,44 @@ Validate permission coherence, execute semantic checks, identify E2E business fl
23
23
 
24
24
  ### 3. Permission Coherence
25
25
 
26
- > **All modules MUST use the same application-level roles.**
26
+ > **Reference:** Load `references/analysis-semantic-checks.md` § "Permission Coherence Checks" for complete validation logic.
27
27
 
28
- **3a. Role Consistency**
28
+ **All modules MUST use the same application-level roles.**
29
29
 
30
- Verify all modules use the applicationRoles defined in cadrage:
31
- ```
32
- FOR each module in completedModules:
33
- FOR each role in module.specification.permissionMatrix.roles:
34
- IF role NOT IN cadrage.applicationRoles → ERROR
35
- ```
36
-
37
- **3b. Permission Path Format**
30
+ Execute these checks:
38
31
 
39
- Verify all permission paths follow one of these patterns:
40
- - Module-level: `business.{app}.{module}.{action}` (4 segments)
41
- - Section-level: `business.{app}.{module}.{section}.{action}` (5 segments)
32
+ **3a. Role Consistency** — Verify all modules use the applicationRoles defined in cadrage
42
33
 
43
- Check for:
44
- - Inconsistent app prefix → ERROR
45
- - Missing module segment → ERROR
46
- - Fewer than 4 segments (shortcut paths) → ERROR
47
- - More than 5 segments → ERROR
34
+ **3b. Permission Path Format** — Verify paths follow 3-segment (module-level) or 4-segment (section-level) patterns
48
35
 
49
- **3c. Role Hierarchy Coherence**
36
+ **3c. Role Hierarchy Coherence** — Verify: Admin ⊃ Manager ⊃ Contributor ⊃ Viewer
50
37
 
51
- Verify the role hierarchy is respected across all modules:
52
- ```
53
- Admin ⊃ Manager ⊃ Contributor ⊃ Viewer
38
+ **3d. Permission Conflicts** Detect conflicts (e.g., Manager can approve in Orders but not Invoices)
39
+ - Present conflicts to user via AskUserQuestion for intentionality confirmation
54
40
 
55
- FOR each module:
56
- IF Admin has fewer permissions than Manager ERROR
57
- IF Manager has fewer permissions than Contributor → ERROR
58
- IF Contributor has fewer permissions than Viewer → ERROR
59
- ```
60
-
61
- **3d. Permission Conflicts**
62
-
63
- Detect conflicting permission assignments:
64
- ```json
65
- {
66
- "conflicts": [
67
- {
68
- "role": "Manager",
69
- "module1": "Orders",
70
- "permission1": "business.sales.orders.approve",
71
- "module2": "Invoices",
72
- "permission2": "business.sales.invoices.approve",
73
- "issue": "Manager can approve orders but not invoices - is this intentional?"
74
- }
75
- ]
76
- }
77
- ```
78
-
79
- Present conflicts to user via AskUserQuestion:
80
- ```
81
- question: "Le Manager peut approuver les commandes mais pas les factures. Est-ce intentionnel ?"
82
- header: "Permissions"
83
- options:
84
- - label: "Oui, intentionnel"
85
- description: "Les factures nécessitent un niveau d'approbation supérieur"
86
- - label: "Non, corriger"
87
- description: "Le Manager devrait aussi pouvoir approuver les factures"
88
- ```
89
-
90
- **3e. Permission-Role Coherence Across Modules (WARNING)**
91
-
92
- For each role defined in `cadrage.applicationRoles`, verify the permission PATTERN is consistent across ALL modules:
93
-
94
- ```javascript
95
- // Build role-to-actions matrix per module
96
- const roleActions = {};
97
- for (const module of completedModules) {
98
- const pm = module.specification.permissionMatrix;
99
- for (const ra of pm.roleAssignments || []) {
100
- const key = ra.role;
101
- if (!roleActions[key]) roleActions[key] = {};
102
- roleActions[key][module.code] = ra.permissions.map(p => p.split('.').pop()); // extract action
103
- }
104
- }
105
-
106
- // Detect inconsistencies: role has action X in module A but not in module B
107
- for (const [role, modules] of Object.entries(roleActions)) {
108
- const allActions = new Set(Object.values(modules).flat());
109
- for (const [mod, actions] of Object.entries(modules)) {
110
- for (const action of allActions) {
111
- if (!actions.includes(action)) {
112
- // Role has this action in other modules but NOT in this one
113
- const otherMods = Object.entries(modules).filter(([m, a]) => a.includes(action)).map(([m]) => m);
114
- console.warn(`WARNING: permission-role-coherence: ${role} has "${action}" in [${otherMods.join(', ')}] but NOT in ${mod}`);
115
- }
116
- }
117
- }
118
- }
119
- ```
120
-
121
- Store as semantic check with severity WARNING (not ERROR — some permission differences may be intentional):
122
- ```json
123
- {
124
- "check": "permission-role-coherence",
125
- "status": "WARNING",
126
- "details": "Contributor has 'create' in [Projects, TimeManagement] but NOT in Employees — verify if intentional"
127
- }
128
- ```
41
+ **3e. Permission-Role Coherence Across Modules (WARNING)** — For each role, verify permission PATTERN is consistent across ALL modules
42
+ - Some permission differences may be intentional (store as WARNING, not ERROR)
129
43
 
130
44
  ### 4. Semantic Validation (MANDATORY)
131
45
 
132
- For EACH module feature.json, execute these checks:
133
-
134
- | # | Check | Rule | Severity |
135
- |---|-------|------|----------|
136
- | 1 | Permission orpheline | Every permissionMatrix.permissions[].path is used by at least one useCases[].permission | WARNING |
137
- | 2 | UC sans FR | Every useCases[].id is referenced by at least one functionalRequirements[].linkedUseCases[] | WARNING |
138
- | 3 | Entity sans endpoint | Every entities[].name has at least one endpoint in apiEndpoints[] | WARNING |
139
- | 4 | UC sans scenario | Every useCases[].mainScenario has at least 2 steps | WARNING |
140
- | 5 | Role sans permissions | Every applicationRole has at least one entry in roleAssignments[] | WARNING |
141
- | 6 | Navigation sans traduction | Every navigation.entries[].code has translations in 4 languages in seedDataCore.navigationTranslations[] | ERROR |
142
- | 7 | LifeCycle terminal | Every lifeCycles[].states[] has at least one state with isTerminal: true | WARNING |
143
- | 8 | Schema conformity | No custom fields outside defined schema (no KPIDefinitions, ChartConfigurations, etc.) | ERROR |
144
- | 9 | Wireframe coverage | Every navigation section has a corresponding uiWireframes[].screen | ERROR |
145
- | 10 | Doublon entity | No entity with same name in two different modules (unless shared via dependencyGraph) | ERROR |
146
- | 11 | Permission fantome | Every action used in applicationRoles pattern (read, create, update, delete, assign, export, approve) MUST exist as a permission path in permissionMatrix.permissions[].action for at least one module | ERROR |
147
- | 12 | Dashboard coverage | If cadrage mentions dashboard for a module OR navigation includes "dashboard" section, then specification.dashboards[] MUST NOT be empty | WARNING |
148
- | 13 | Permission-UC alignment | Every permission.action (except "read" and wildcard "*") MUST have at least one UC where that permission is referenced in useCases[].permission | WARNING |
149
-
150
- Store results in consolidation.semanticChecks[]:
151
- ```json
152
- {
153
- "check": "permission-orpheline",
154
- "module": "RepairManagement",
155
- "status": "PASS|WARNING|ERROR",
156
- "details": "Permission business.freebike.repairmanagement.export not referenced by any UC",
157
- "autoFixed": false
158
- }
159
- ```
46
+ > **Reference:** Load `references/analysis-semantic-checks.md` for complete semantic check definitions and blocking rules.
47
+
48
+ For EACH module feature.json, execute 13 checks:
49
+ - Permission orpheline (WARNING)
50
+ - UC sans FR (WARNING)
51
+ - Entity sans endpoint (WARNING)
52
+ - UC sans scenario (WARNING)
53
+ - Role sans permissions (WARNING)
54
+ - Navigation sans traduction (ERROR)
55
+ - LifeCycle terminal (WARNING)
56
+ - Schema conformity (ERROR)
57
+ - Wireframe coverage (ERROR)
58
+ - Doublon entity (ERROR)
59
+ - Permission fantome (ERROR)
60
+ - Dashboard coverage (WARNING)
61
+ - Permission-UC alignment (WARNING)
62
+
63
+ Store results in consolidation.semanticChecks[] with format: {check, module, status, details, autoFixed}
160
64
 
161
65
  **Blocking rule:**
162
66
  - 0 ERROR → PASS
@@ -179,47 +83,25 @@ See [references/consolidation-structural-checks.md](../references/consolidation-
179
83
 
180
84
  ### 5. End-to-End Flows
181
85
 
182
- Identify business processes that span multiple modules:
183
-
184
- ```json
185
- {
186
- "e2eFlows": [
187
- {
188
- "name": "Order to Invoice",
189
- "steps": [
190
- { "module": "Customers", "action": "Customer exists", "permission": "customers.read" },
191
- { "module": "Products", "action": "Products selected", "permission": "products.read" },
192
- { "module": "Orders", "action": "Order created", "permission": "orders.create" },
193
- { "module": "Orders", "action": "Order approved", "permission": "orders.approve" },
194
- { "module": "Invoices", "action": "Invoice generated", "permission": "invoices.create" },
195
- { "module": "Invoices", "action": "Invoice sent", "permission": "invoices.update" }
196
- ],
197
- "actors": ["Contributor (create)", "Manager (approve)"],
198
- "data": "Customer → Order → OrderLines (Products) → Invoice → InvoiceLines"
199
- }
200
- ]
201
- }
202
- ```
86
+ > **Reference:** Load `references/analysis-semantic-checks.md` § "E2E Flow Template" for the complete format.
203
87
 
204
- Display each E2E flow as a diagram:
205
- ```
206
- Customer ──[read]──→ Order ──[create]──→ Order ──[approve]──→ Invoice ──[create]──→ Invoice ──[send]──→
207
- (Customers) (Orders) (Orders) (Invoices) (Invoices)
208
- Contributor Contributor Manager System Manager
209
- ```
88
+ Identify business processes that span multiple modules:
89
+ - Build flow with module → action → permission chain
90
+ - List actors involved and their roles
91
+ - Map data flow (entities referenced across modules)
92
+ - Display as diagrams for user understanding
210
93
 
211
94
  ### 6. Global Risk Assessment
212
95
 
213
- Evaluate application-level risks:
96
+ > **Reference:** Load `references/analysis-semantic-checks.md` § "Global Risk Assessment Metrics" for complete evaluation.
214
97
 
215
- | Risk | Metric | Threshold | Status |
216
- |------|--------|-----------|--------|
217
- | Total entities | {sum across modules} | 20 | PASS/WARNING |
218
- | Total BRs | {sum across modules} | 50 | PASS/WARNING |
219
- | Cross-module dependencies | {edge count} | 10 | PASS/WARNING |
220
- | Shared entities | {count} | 5 | PASS/WARNING |
221
- | E2E flow length | {max steps} | 8 | PASS/WARNING |
222
- | Permission paths | {total} | ≤100 | PASS/WARNING |
98
+ Evaluate application-level risks using these metrics:
99
+ - Total entities (≤20)
100
+ - Total BRs (50)
101
+ - Cross-module dependencies (10)
102
+ - Shared entities (5)
103
+ - E2E flow length (8 steps max)
104
+ - Permission paths (100)
223
105
 
224
106
  ### 7. Consolidation Summary
225
107
 
@@ -80,7 +80,7 @@ ba-writer.enrichSection({
80
80
  "name": "Order to Invoice",
81
81
  "modules": ["Customers", "Orders", "Invoices"],
82
82
  "steps": [
83
- { "module": "Orders", "action": "Create order", "permission": "business.sales.orders.create", "dataFlow": "Customer → Order" }
83
+ { "module": "Orders", "action": "Create order", "permission": "sales.orders.create", "dataFlow": "Customer → Order" }
84
84
  ]
85
85
  }
86
86
  ],