@roomi-fields/grillhouse 0.0.0-stage → 0.23.1

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 (166) hide show
  1. package/.claude-plugin/plugin.json +9 -0
  2. package/METACADRE.md +41 -0
  3. package/agents/developpeur.md +10 -0
  4. package/agents/explorateur.md +9 -0
  5. package/agents/questionneur.md +11 -0
  6. package/agents/referent-technique.md +9 -0
  7. package/agents/regulateur.md +11 -0
  8. package/agents/relecteur.md +9 -0
  9. package/agents/testwriter.md +10 -0
  10. package/bin/grillhouse.mjs +125 -0
  11. package/cadre/templates/projet/.claude/settings.json +30 -0
  12. package/cadre/templates/projet/.editorconfig +47 -0
  13. package/cadre/templates/projet/.env.example +57 -0
  14. package/cadre/templates/projet/.eslintrc.cjs +56 -0
  15. package/cadre/templates/projet/.github/workflows/ci.yml +66 -0
  16. package/cadre/templates/projet/.mcp.json +13 -0
  17. package/cadre/templates/projet/.prettierrc +11 -0
  18. package/cadre/templates/projet/CHANGELOG.md +61 -0
  19. package/cadre/templates/projet/CLAUDE.md +46 -0
  20. package/cadre/templates/projet/CONTRIBUTING.md +243 -0
  21. package/cadre/templates/projet/CREDITS.md +41 -0
  22. package/cadre/templates/projet/README.md +152 -0
  23. package/cadre/templates/projet/_gitignore +91 -0
  24. package/cadre/templates/projet/_npmignore +46 -0
  25. package/cadre/templates/projet/deployment/README.md +98 -0
  26. package/cadre/templates/projet/deployment/docs/01-INSTALL.md +145 -0
  27. package/cadre/templates/projet/deployment/docs/02-CONFIGURATION.md +117 -0
  28. package/cadre/templates/projet/deployment/docs/03-API.md +264 -0
  29. package/cadre/templates/projet/deployment/docs/04-TROUBLESHOOTING.md +262 -0
  30. package/cadre/templates/projet/deployment/scripts/install.ps1 +100 -0
  31. package/cadre/templates/projet/deployment/scripts/start.ps1 +61 -0
  32. package/cadre/templates/projet/deployment/scripts/stop.ps1 +37 -0
  33. package/cadre/templates/projet/deployment/scripts/test.ps1 +118 -0
  34. package/cadre/templates/projet/docs/agents/issue-tracker.md +44 -0
  35. package/cadre/templates/projet/ecosystem.config.cjs +73 -0
  36. package/cadre/templates/projet/package.json +90 -0
  37. package/cadre/templates/projet/pitmaster/SUIVI.md +22 -0
  38. package/cadre/templates/projet/src/config.ts +68 -0
  39. package/cadre/templates/projet/src/errors.ts +102 -0
  40. package/cadre/templates/projet/src/index.ts +46 -0
  41. package/cadre/templates/projet/src/services/.gitkeep +8 -0
  42. package/cadre/templates/projet/src/types/index.ts +24 -0
  43. package/cadre/templates/projet/src/utils/logger.ts +106 -0
  44. package/cadre/templates/projet/tests/integration/.gitkeep +7 -0
  45. package/cadre/templates/projet/tests/unit/config.spec.ts +68 -0
  46. package/cadre/templates/projet/tests/unit/errors.spec.ts +132 -0
  47. package/cadre/templates/projet/tests/unit/types.spec.ts +73 -0
  48. package/cadre/templates/projet/tsconfig.eslint.json +9 -0
  49. package/cadre/templates/projet/tsconfig.json +41 -0
  50. package/cadre/templates/projet/tsdoc.json +6 -0
  51. package/cadre/templates/projet/vitest.config.ts +44 -0
  52. package/cadre/templates/turbo/paquets.json +29 -0
  53. package/cadre/templates/turbo/sans-paquets.json +28 -0
  54. package/charte.md +107 -0
  55. package/docs/ARCHITECTURE.md +90 -0
  56. package/hooks/crochet.mjs +33 -0
  57. package/hooks/hooks.json +58 -0
  58. package/hooks/register.tsx +558 -0
  59. package/package.json +75 -4
  60. package/scripts/avancement.mjs +244 -0
  61. package/scripts/bilan.mjs +523 -0
  62. package/scripts/branche-de-nuit.mjs +59 -0
  63. package/scripts/cadre.mjs +109 -0
  64. package/scripts/circuit.mjs +4375 -0
  65. package/scripts/code-mort.mjs +371 -0
  66. package/scripts/composants-affectes.mjs +598 -0
  67. package/scripts/consommateurs-arbitres.mjs +192 -0
  68. package/scripts/consommateurs.mjs +310 -0
  69. package/scripts/crochet.mjs +24 -0
  70. package/scripts/crochets.mjs +135 -0
  71. package/scripts/dernier-vert.mjs +208 -0
  72. package/scripts/dette.mjs +181 -0
  73. package/scripts/droits.mjs +354 -0
  74. package/scripts/enveloppe/codes.mjs +17 -0
  75. package/scripts/enveloppe/composant.mjs +11 -0
  76. package/scripts/enveloppe/enveloppe.mjs +628 -0
  77. package/scripts/enveloppe/lancer.sh +311 -0
  78. package/scripts/etapes.mjs +323 -0
  79. package/scripts/etat-du-circuit.mjs +104 -0
  80. package/scripts/frontieres.mjs +456 -0
  81. package/scripts/gardes-du-cadre.mjs +72 -0
  82. package/scripts/greffons.mjs +338 -0
  83. package/scripts/grillhouse-maj.mjs +514 -0
  84. package/scripts/index-interfaces.mjs +293 -0
  85. package/scripts/init.mjs +117 -0
  86. package/scripts/integration/file-attente.mjs +61 -0
  87. package/scripts/integration/file.mjs +494 -0
  88. package/scripts/integration/integrer.mjs +381 -0
  89. package/scripts/integration/rejeu.mjs +139 -0
  90. package/scripts/integration/verdict.mjs +13 -0
  91. package/scripts/interfaces-contre-code.mjs +547 -0
  92. package/scripts/ligne-etat/defaut.sh +110 -0
  93. package/scripts/ligne-etat/ligne-etat.mjs +93 -0
  94. package/scripts/migrations/0.23.0-charte-importee.mjs +47 -0
  95. package/scripts/migrations/0.23.0-config-vitest.mjs +105 -0
  96. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +55 -0
  97. package/scripts/migrations/0.23.0-marche-du-projet.mjs +82 -0
  98. package/scripts/migrations.mjs +43 -0
  99. package/scripts/nuit.sh +269 -0
  100. package/scripts/paquets.mjs +79 -0
  101. package/scripts/poussee-cles.mjs +46 -0
  102. package/scripts/preparation.mjs +84 -0
  103. package/scripts/references-par-les-types.mjs +420 -0
  104. package/scripts/registre.mjs +336 -0
  105. package/scripts/resultats.mjs +580 -0
  106. package/scripts/resumes.mjs +57 -0
  107. package/scripts/retirer-copie.sh +127 -0
  108. package/scripts/session-start.sh +203 -0
  109. package/scripts/sortie.mjs +155 -0
  110. package/scripts/sous-modules.sh +316 -0
  111. package/scripts/structure-guard.sh +27 -0
  112. package/scripts/superviseur.mjs +102 -0
  113. package/scripts/tableau.mjs +1886 -0
  114. package/scripts/tests.mjs +236 -0
  115. package/scripts/ticket.sh +23 -0
  116. package/scripts/turbo-des-paquets.mjs +899 -0
  117. package/scripts/un-commit-par-ticket.mjs +212 -0
  118. package/scripts/verifier.mjs +469 -0
  119. package/scripts/verrou-de-fichier.mjs +130 -0
  120. package/scripts/verrou-de-machine.mjs +211 -0
  121. package/scripts/verrous/commande.mjs +180 -0
  122. package/scripts/verrous/ticket-du-sous-agent.mjs +39 -0
  123. package/scripts/verrous/verrou.mjs +165 -0
  124. package/scripts/vitest-config/avancement.mjs +39 -0
  125. package/scripts/vitest-config/avancement.reporter.mjs +56 -0
  126. package/scripts/vitest-config/base-de-passe.mjs +128 -0
  127. package/scripts/vitest-config/base.d.ts +6 -0
  128. package/scripts/vitest-config/base.mjs +87 -0
  129. package/scripts/vitest-config/changements.mjs +173 -0
  130. package/scripts/vitest-config/cibles.mjs +207 -0
  131. package/scripts/vitest-config/duree.reporter.mjs +98 -0
  132. package/scripts/vitest-config/machine.setup.mjs +14 -0
  133. package/scripts/vitest-config/mesure.d.ts +6 -0
  134. package/scripts/vitest-config/mesure.mjs +13 -0
  135. package/scripts/vitest-config/mesure.setup.mjs +12 -0
  136. package/scripts/vitest-config/pression.mjs +90 -0
  137. package/scripts/vitest-config/resultats.mjs +23 -0
  138. package/scripts/vitest-config/resultats.setup.mjs +19 -0
  139. package/scripts/vitest.nuit.config.mjs +26 -0
  140. package/skills/developpeur/SKILL.md +175 -0
  141. package/skills/explorateur/SKILL.md +84 -0
  142. package/skills/grill/SKILL.md +238 -0
  143. package/skills/grill/references/releve-structurel.md +38 -0
  144. package/skills/mesure/SKILL.md +168 -0
  145. package/skills/pitmaster/SKILL.md +382 -0
  146. package/skills/pitmaster/references/cadre.md +119 -0
  147. package/skills/pitmaster/references/consigne-agent.md +308 -0
  148. package/skills/pitmaster/references/erreurs.md +25 -0
  149. package/skills/pitmaster/references/tour.md +124 -0
  150. package/skills/questionneur/SKILL.md +64 -0
  151. package/skills/redacteur/SKILL.md +84 -0
  152. package/skills/redacteur/references/documents-d-un-composant.md +105 -0
  153. package/skills/referent-technique/SKILL.md +145 -0
  154. package/skills/regulateur/SKILL.md +220 -0
  155. package/skills/release/SKILL.md +134 -0
  156. package/skills/release/scripts/update-version.cjs +92 -0
  157. package/skills/relecteur/SKILL.md +152 -0
  158. package/skills/relecteur/references/LICENSE-MIT +30 -0
  159. package/skills/relecteur/references/SOURCE.md +8 -0
  160. package/skills/relecteur/references/claims-check.md +14 -0
  161. package/skills/relecteur/references/deletion-check.md +14 -0
  162. package/skills/relecteur/references/edge-case-hunter.md +80 -0
  163. package/skills/relecteur/references/verification-gap.md +113 -0
  164. package/skills/testwriter/SKILL.md +187 -0
  165. package/types/index.d.ts +56 -0
  166. package/README.md +0 -3
@@ -0,0 +1,262 @@
1
+ # Troubleshooting Guide
2
+
3
+ ## Common Issues
4
+
5
+ ### Application Won't Start
6
+
7
+ #### Symptom
8
+ Application fails to start with configuration errors.
9
+
10
+ #### Solution
11
+ 1. Verify `.env` file exists
12
+ 2. Check all required variables are set
13
+ 3. Validate variable types
14
+
15
+ ```bash
16
+ # Check .env file
17
+ cat .env
18
+
19
+ # Verify Node version
20
+ node --version
21
+ ```
22
+
23
+ ---
24
+
25
+ ### Port Already in Use
26
+
27
+ #### Symptom
28
+ ```
29
+ Error: listen EADDRINUSE: address already in use :::3000
30
+ ```
31
+
32
+ #### Solution
33
+ 1. Find the process using the port:
34
+ ```bash
35
+ # Linux/macOS
36
+ lsof -i :3000
37
+
38
+ # Windows
39
+ netstat -ano | findstr :3000
40
+ ```
41
+
42
+ 2. Kill the process or use a different port:
43
+ ```bash
44
+ # Change port in .env
45
+ PORT=3001
46
+ ```
47
+
48
+ ---
49
+
50
+ ### Build Errors
51
+
52
+ #### Symptom
53
+ TypeScript compilation fails.
54
+
55
+ #### Solution
56
+ 1. Clear build artifacts:
57
+ ```bash
58
+ rm -rf dist node_modules
59
+ npm install
60
+ npm run build
61
+ ```
62
+
63
+ 2. Check TypeScript version:
64
+ ```bash
65
+ npx tsc --version
66
+ ```
67
+
68
+ ---
69
+
70
+ ### PM2 Issues
71
+
72
+ #### Symptom
73
+ PM2 daemon not starting or crashing.
74
+
75
+ #### Solution
76
+ 1. Check PM2 logs:
77
+ ```bash
78
+ npm run daemon:logs
79
+ # or
80
+ pm2 logs project-name
81
+ ```
82
+
83
+ 2. Check status:
84
+ ```bash
85
+ pm2 status
86
+ ```
87
+
88
+ 3. Restart PM2:
89
+ ```bash
90
+ pm2 delete all
91
+ npm run daemon:start
92
+ ```
93
+
94
+ 4. Check memory usage:
95
+ ```bash
96
+ pm2 monit
97
+ ```
98
+
99
+ ---
100
+
101
+ ### Connection Refused
102
+
103
+ #### Symptom
104
+ ```
105
+ Error: connect ECONNREFUSED 127.0.0.1:3000
106
+ ```
107
+
108
+ #### Solution
109
+ 1. Verify the application is running:
110
+ ```bash
111
+ pm2 status
112
+ # or
113
+ ps aux | grep node
114
+ ```
115
+
116
+ 2. Check the port configuration:
117
+ ```bash
118
+ echo $PORT
119
+ ```
120
+
121
+ 3. Test locally:
122
+ ```bash
123
+ curl http://localhost:3000/health
124
+ ```
125
+
126
+ ---
127
+
128
+ ### Out of Memory
129
+
130
+ #### Symptom
131
+ Application crashes with memory errors.
132
+
133
+ #### Solution
134
+ 1. Increase Node memory limit:
135
+ ```bash
136
+ NODE_OPTIONS="--max-old-space-size=4096" npm start
137
+ ```
138
+
139
+ 2. Update PM2 memory limit in `ecosystem.config.cjs`:
140
+ ```javascript
141
+ max_memory_restart: '2G'
142
+ ```
143
+
144
+ ---
145
+
146
+ ### Permission Errors
147
+
148
+ #### Symptom
149
+ ```
150
+ Error: EACCES: permission denied
151
+ ```
152
+
153
+ #### Solution
154
+ 1. Check file permissions:
155
+ ```bash
156
+ ls -la
157
+ ```
158
+
159
+ 2. Fix ownership:
160
+ ```bash
161
+ sudo chown -R $USER:$USER .
162
+ ```
163
+
164
+ 3. For npm global installs:
165
+ ```bash
166
+ npm config set prefix ~/.npm-global
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Debugging
172
+
173
+ ### Enable Debug Logging
174
+
175
+ ```bash
176
+ LOG_LEVEL=debug npm start
177
+ ```
178
+
179
+ ### Check Application Logs
180
+
181
+ ```bash
182
+ # PM2 logs
183
+ pm2 logs project-name --lines 100
184
+
185
+ # Log files
186
+ tail -f logs/pm2-out.log
187
+ tail -f logs/pm2-error.log
188
+ ```
189
+
190
+ ### Test Endpoints
191
+
192
+ ```bash
193
+ # Health check
194
+ curl -v http://localhost:3000/health
195
+
196
+ # With headers
197
+ curl -v -H "Content-Type: application/json" http://localhost:3000/api/endpoint
198
+ ```
199
+
200
+ ## Performance Issues
201
+
202
+ ### Slow Response Times
203
+
204
+ 1. Check resource usage:
205
+ ```bash
206
+ pm2 monit
207
+ ```
208
+
209
+ 2. Enable debug logging to identify bottlenecks
210
+
211
+ 3. Profile the application:
212
+ ```bash
213
+ node --inspect dist/index.js
214
+ ```
215
+
216
+ ### High CPU Usage
217
+
218
+ 1. Check for infinite loops in logs
219
+ 2. Monitor with PM2:
220
+ ```bash
221
+ pm2 monit
222
+ ```
223
+
224
+ ## Getting Help
225
+
226
+ If none of the above solutions work:
227
+
228
+ 1. **Check GitHub Issues**: Search for similar problems
229
+ 2. **Create an Issue**: Include:
230
+ - Node.js version
231
+ - OS and version
232
+ - Error messages
233
+ - Steps to reproduce
234
+ 3. **Enable Debug Logging**: Attach relevant logs
235
+
236
+ ## Useful Commands Reference
237
+
238
+ ```bash
239
+ # Check Node version
240
+ node --version
241
+
242
+ # Check npm version
243
+ npm --version
244
+
245
+ # View all environment variables
246
+ printenv | grep -E "NODE|PORT|LOG"
247
+
248
+ # Test connectivity
249
+ curl -v http://localhost:3000/health
250
+
251
+ # View PM2 status
252
+ pm2 status
253
+
254
+ # View PM2 logs
255
+ pm2 logs --lines 50
256
+
257
+ # Restart PM2 application
258
+ pm2 restart project-name
259
+
260
+ # Kill all PM2 processes
261
+ pm2 kill
262
+ ```
@@ -0,0 +1,100 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Installation script for the project.
4
+
5
+ .DESCRIPTION
6
+ Installs dependencies, builds the project, and sets up configuration.
7
+
8
+ .EXAMPLE
9
+ .\install.ps1
10
+ #>
11
+
12
+ $ErrorActionPreference = "Stop"
13
+
14
+ function Write-Step {
15
+ param([string]$Message)
16
+ Write-Host "`n==> $Message" -ForegroundColor Cyan
17
+ }
18
+
19
+ function Write-Success {
20
+ param([string]$Message)
21
+ Write-Host "[OK] $Message" -ForegroundColor Green
22
+ }
23
+
24
+ function Write-Error {
25
+ param([string]$Message)
26
+ Write-Host "[ERROR] $Message" -ForegroundColor Red
27
+ }
28
+
29
+ Write-Host "Project Installation" -ForegroundColor Magenta
30
+ Write-Host "====================" -ForegroundColor Magenta
31
+
32
+ # Check Node.js
33
+ Write-Step "Checking Node.js..."
34
+ try {
35
+ $nodeVersion = node --version
36
+ Write-Success "Node.js $nodeVersion found"
37
+ }
38
+ catch {
39
+ Write-Error "Node.js not found. Please install Node.js 18 or higher."
40
+ exit 1
41
+ }
42
+
43
+ # Check npm
44
+ Write-Step "Checking npm..."
45
+ try {
46
+ $npmVersion = npm --version
47
+ Write-Success "npm $npmVersion found"
48
+ }
49
+ catch {
50
+ Write-Error "npm not found."
51
+ exit 1
52
+ }
53
+
54
+ # Install dependencies
55
+ Write-Step "Installing dependencies..."
56
+ npm install
57
+ if ($LASTEXITCODE -ne 0) {
58
+ Write-Error "Failed to install dependencies"
59
+ exit 1
60
+ }
61
+ Write-Success "Dependencies installed"
62
+
63
+ # Build project
64
+ Write-Step "Building project..."
65
+ npm run build
66
+ if ($LASTEXITCODE -ne 0) {
67
+ Write-Error "Build failed"
68
+ exit 1
69
+ }
70
+ Write-Success "Build successful"
71
+
72
+ # Create .env if not exists
73
+ Write-Step "Checking configuration..."
74
+ if (-not (Test-Path ".env")) {
75
+ if (Test-Path ".env.example") {
76
+ Copy-Item ".env.example" ".env"
77
+ Write-Success "Created .env from .env.example"
78
+ Write-Host "Please edit .env with your configuration." -ForegroundColor Yellow
79
+ }
80
+ else {
81
+ Write-Host ".env.example not found, skipping .env creation" -ForegroundColor Yellow
82
+ }
83
+ }
84
+ else {
85
+ Write-Success ".env already exists"
86
+ }
87
+
88
+ # Create logs directory
89
+ Write-Step "Creating logs directory..."
90
+ if (-not (Test-Path "logs")) {
91
+ New-Item -ItemType Directory -Path "logs" | Out-Null
92
+ }
93
+ Write-Success "Logs directory ready"
94
+
95
+ Write-Host "`n" -NoNewline
96
+ Write-Host "Installation complete!" -ForegroundColor Green
97
+ Write-Host "`nNext steps:" -ForegroundColor Yellow
98
+ Write-Host " 1. Edit .env with your configuration"
99
+ Write-Host " 2. Run 'npm start' to start the application"
100
+ Write-Host " 3. Or run 'npm run daemon:start' for background mode"
@@ -0,0 +1,61 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Start the application server.
4
+
5
+ .DESCRIPTION
6
+ Starts the application in foreground or daemon mode.
7
+
8
+ .PARAMETER Daemon
9
+ Run in daemon mode using PM2.
10
+
11
+ .EXAMPLE
12
+ .\start.ps1
13
+ .\start.ps1 -Daemon
14
+ #>
15
+
16
+ param(
17
+ [switch]$Daemon
18
+ )
19
+
20
+ $ErrorActionPreference = "Stop"
21
+
22
+ function Write-Step {
23
+ param([string]$Message)
24
+ Write-Host "`n==> $Message" -ForegroundColor Cyan
25
+ }
26
+
27
+ function Write-Success {
28
+ param([string]$Message)
29
+ Write-Host "[OK] $Message" -ForegroundColor Green
30
+ }
31
+
32
+ # Navigate to project root
33
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
34
+ $ProjectRoot = Resolve-Path (Join-Path $ScriptDir "..\..")
35
+ Set-Location $ProjectRoot
36
+
37
+ # Check if built
38
+ if (-not (Test-Path "dist/index.js")) {
39
+ Write-Step "Building project..."
40
+ npm run build
41
+ if ($LASTEXITCODE -ne 0) {
42
+ Write-Host "[ERROR] Build failed" -ForegroundColor Red
43
+ exit 1
44
+ }
45
+ }
46
+
47
+ if ($Daemon) {
48
+ Write-Step "Starting in daemon mode..."
49
+ npm run daemon:start
50
+ if ($LASTEXITCODE -eq 0) {
51
+ Write-Success "Application started in daemon mode"
52
+ Write-Host "`nUseful commands:" -ForegroundColor Yellow
53
+ Write-Host " npm run daemon:status - Check status"
54
+ Write-Host " npm run daemon:logs - View logs"
55
+ Write-Host " npm run daemon:stop - Stop daemon"
56
+ }
57
+ }
58
+ else {
59
+ Write-Step "Starting application..."
60
+ npm start
61
+ }
@@ -0,0 +1,37 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Stop the application server.
4
+
5
+ .DESCRIPTION
6
+ Stops the application running in daemon mode.
7
+
8
+ .EXAMPLE
9
+ .\stop.ps1
10
+ #>
11
+
12
+ $ErrorActionPreference = "Stop"
13
+
14
+ function Write-Step {
15
+ param([string]$Message)
16
+ Write-Host "`n==> $Message" -ForegroundColor Cyan
17
+ }
18
+
19
+ function Write-Success {
20
+ param([string]$Message)
21
+ Write-Host "[OK] $Message" -ForegroundColor Green
22
+ }
23
+
24
+ # Navigate to project root
25
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
26
+ $ProjectRoot = Resolve-Path (Join-Path $ScriptDir "..\..")
27
+ Set-Location $ProjectRoot
28
+
29
+ Write-Step "Stopping application..."
30
+ npm run daemon:stop
31
+
32
+ if ($LASTEXITCODE -eq 0) {
33
+ Write-Success "Application stopped"
34
+ }
35
+ else {
36
+ Write-Host "[WARN] Application may not have been running" -ForegroundColor Yellow
37
+ }
@@ -0,0 +1,118 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Test the application endpoints.
4
+
5
+ .DESCRIPTION
6
+ Runs basic tests against the running application.
7
+
8
+ .PARAMETER BaseUrl
9
+ Base URL of the application. Default: http://localhost:3000
10
+
11
+ .EXAMPLE
12
+ .\test.ps1
13
+ .\test.ps1 -BaseUrl "http://localhost:8080"
14
+ #>
15
+
16
+ param(
17
+ [string]$BaseUrl = "http://localhost:3000"
18
+ )
19
+
20
+ $ErrorActionPreference = "Continue"
21
+
22
+ function Write-Step {
23
+ param([string]$Message)
24
+ Write-Host "`n==> $Message" -ForegroundColor Cyan
25
+ }
26
+
27
+ function Write-Success {
28
+ param([string]$Message)
29
+ Write-Host "[PASS] $Message" -ForegroundColor Green
30
+ }
31
+
32
+ function Write-Fail {
33
+ param([string]$Message)
34
+ Write-Host "[FAIL] $Message" -ForegroundColor Red
35
+ }
36
+
37
+ function Test-Endpoint {
38
+ param(
39
+ [string]$Name,
40
+ [string]$Method,
41
+ [string]$Url,
42
+ [string]$Body = $null,
43
+ [int]$ExpectedStatus = 200
44
+ )
45
+
46
+ Write-Host " Testing: $Name... " -NoNewline
47
+
48
+ try {
49
+ $params = @{
50
+ Uri = $Url
51
+ Method = $Method
52
+ ContentType = "application/json"
53
+ UseBasicParsing = $true
54
+ }
55
+
56
+ if ($Body) {
57
+ $params.Body = $Body
58
+ }
59
+
60
+ $response = Invoke-WebRequest @params
61
+ $status = $response.StatusCode
62
+
63
+ if ($status -eq $ExpectedStatus) {
64
+ Write-Host "[PASS]" -ForegroundColor Green
65
+ return $true
66
+ }
67
+ else {
68
+ Write-Host "[FAIL] Expected $ExpectedStatus, got $status" -ForegroundColor Red
69
+ return $false
70
+ }
71
+ }
72
+ catch {
73
+ $status = $_.Exception.Response.StatusCode.value__
74
+ if ($status -eq $ExpectedStatus) {
75
+ Write-Host "[PASS]" -ForegroundColor Green
76
+ return $true
77
+ }
78
+ else {
79
+ Write-Host "[FAIL] $($_.Exception.Message)" -ForegroundColor Red
80
+ return $false
81
+ }
82
+ }
83
+ }
84
+
85
+ Write-Host "API Endpoint Tests" -ForegroundColor Magenta
86
+ Write-Host "==================" -ForegroundColor Magenta
87
+ Write-Host "Base URL: $BaseUrl"
88
+
89
+ $passed = 0
90
+ $failed = 0
91
+
92
+ # Health Check
93
+ Write-Step "Health Check"
94
+ if (Test-Endpoint -Name "GET /health" -Method "GET" -Url "$BaseUrl/health") {
95
+ $passed++
96
+ }
97
+ else {
98
+ $failed++
99
+ }
100
+
101
+ # Add more tests as needed
102
+ # Write-Step "API Endpoints"
103
+ # if (Test-Endpoint -Name "GET /api/resources" -Method "GET" -Url "$BaseUrl/api/resources") {
104
+ # $passed++
105
+ # } else {
106
+ # $failed++
107
+ # }
108
+
109
+ # Summary
110
+ Write-Host "`n" -NoNewline
111
+ Write-Host "Results" -ForegroundColor Magenta
112
+ Write-Host "=======" -ForegroundColor Magenta
113
+ Write-Host "Passed: $passed" -ForegroundColor Green
114
+ Write-Host "Failed: $failed" -ForegroundColor $(if ($failed -gt 0) { "Red" } else { "Green" })
115
+
116
+ if ($failed -gt 0) {
117
+ exit 1
118
+ }
@@ -0,0 +1,44 @@
1
+ # Issue tracker: Beads (`bd`)
2
+
3
+ Issues for this repo live in Beads, a git-backed tracker: data under `.beads/`, commands via the `bd` CLI, ids `<prefix>-xxx` (the prefix is set by `grillhouse init`). No remote service. The project owner opens the work; agents take tickets, never invent them.
4
+
5
+ ## Conventions
6
+
7
+ - One ticket = one agent session's worth of work; the body holds the brief, the plan, and (on close) the answer.
8
+ - Every ticket opens with an **Architecture** section, three answers written before any code: the mature model (how the mature product of the domain handles it, named), the address (where it lives in the specified architecture), the common mechanism (existing, or missing — then the missing mechanism is the work, and the reported case only its witness). A ticket without it does not start.
9
+ - A realisation ticket is created with its **Acceptance criteria** section (`## Critères d'acceptation`) after « Architecture »: criteria numbered `1.`, `2.`… (cited « critère 1 » in tests and comments), each a checkable statement answering a real need of the current use, edge cases and refusals included, covering every place that applies the same rule (found through the index). So the flow starts on criteria already numbered, and no agent rewrites the ticket to number them; a ticket does not go to the `testwriter` without them.
10
+ - A change of behaviour is one ticket that passes from agent to agent, never a ticket per post: in the ticket's copy, the `testwriter` writes the tests; the `developpeur` finds them there and writes the code; the `relecteur` gives its verdict (`ACCEPTÉ` or `RENDU`, each finding naming its recipient, a role and a component) in its sheet, which the circuit writes on the same ticket; the circuit (`packages/grillhouse/scripts/circuit.mjs`) leads them, sends a lot RENDU back to the agents its findings name, and on `ACCEPTÉ` builds both lots from the copy and commits them in one commit on the branch `agent/<ticket>` through `packages/grillhouse/scripts/integration/integrer.mjs` (the ticket is labelled `en-file`); the queue (`packages/grillhouse/scripts/integration/file.mjs`) brings that branch onto main, closes the ticket and pushes main.
11
+ - One ticket, one delivery: a goal whose split is unknown opens an exploration ticket (no code, agent `explorateur`), which closes on the realisation tickets it proposes, recorded closed and labelled `decouverte`; the supervisor reopens those the owner validates. A realisation ticket names the components it touches (« Numéros et titres ») and enters in one commit, under its own number alone; the `commit-msg` hook refuses a second commit for a closed ticket whose delivery stands, and lets a ticket reopened after its delivery (open in Beads) take correction commits; a revert (`Revert "…"`, `Reapply "…"`) passes and withdraws the delivery it names.
12
+ - An open ticket is born of the owner's word, or of a direct need of a project that uses the frame (a defect it meets). A discovery during work is recorded, with its example and address, in a closed ticket under the ticket that found it, labelled `decouverte` (see « Numéros et titres »); it reopens on the owner's word. A discovery that blocks stops the agent, and its handoff names it. The supervisor brings to the owner the discoveries that touch a real use.
13
+ - Types: `epic` (a chantier, always at the root: an epic has no mother), `task`, `bug`, `decision`. A mother under a chantier is a `task`; the session start lists an epic that has a mother. Priority `0`-`4`, 0 highest.
14
+ - Comments carry progress and handoffs: `bd comments add <id> "<text>"`. In a ticket's circuit, each comment carries its author: the circuit launches each session with `BEADS_ACTOR` naming its role (`testwriter <composant>`, `developpeur <composant>`, `relecteur`, `regulateur`), writes its own lines (`Circuit · …`) as `circuit` and the reviewer's verdict as `relecteur`; the queue (`packages/grillhouse/scripts/integration/file.mjs`) writes as `file`; a verdict is a comment of the author `relecteur` whose first word is `ACCEPTÉ` or `RENDU`. An agent does not change its author: its rights refuse bd's `--actor`, `-a`/`--author` and the variable `BEADS_ACTOR`.
15
+ - Labels used by the skills: `a-valider` (proposed, waits for the owner), `decouverte` (a discovery recorded closed; it reopens on the owner's word), `circuit` (the owner said to launch it: the ticket is in the flow, and only such a ticket waits in the pane's AGENTS), `attend-responsable` (a rule waits for the owner's word), `arbitrage` (a design question went to the `referent-technique` agent; the lot enters only with its verdict).
16
+
17
+ ## Numéros et titres
18
+
19
+ - A chantier is an `epic` at the root; under it, every subject has a mother ticket (a `task`), open while work remains under it. Every ticket is created under its mother, so Beads numbers it natively: `320.1`, `320.2`, `320.2.1`.
20
+ - The title reads `<number> — <subject> — <components>`, the number being the id without the whole prefix of the project (`bd config get issue_prefix`, which may hold dashes: `bp-mono-`). The components are the ones the ticket touches, separated by commas, the provider first, then its readers (charte, « Un ticket de réalisation nomme ses composants »): `320.5.2 — Publie l'objet de la scène — 020-loader, 050-emitter`. A mother takes `parent` as its component. The survey of the components (`npx grillhouse composants-affectes --description <file>` on a draft, `npx grillhouse composants-affectes <id>` on a ticket) gives that list from the elements the Architecture section and the criteria name: for each, its provider and its readers (the consumers its INTERFACE.md declares, the packages that import it, the tests of other packages that name it). A component it finds that the ticket does not change is admitted out of the title, with its reason, once the ticket exists: `npx grillhouse composants-affectes <id> --admettre <component> --raison "<reason>"`, a line at the ticket. The circuit runs the survey again before the first testwriter, and stops at `composants-manquants` (21) on a component it finds that the title misses and no admission covers.
21
+ - Creating one: `npx grillhouse ticket <mother> <subject> <components> <body> [label]` prints its id; the label is `a-valider` by default, and `decouverte` creates it closed (« découverte consignée »).
22
+
23
+ - A ticket goes through the tree of its circuit, the « auto » steps included (`packages/grillhouse/scripts/etapes.mjs`, the one list): 0 Exploration (`explorateur`); 1 Ouverture: 1.1 Relevé des composants, 1.2 Questionnement (`questionneur` ⇄ `referent-technique`); 2 Composants, for each component: 2.1 Tests (`testwriter`), 2.2 Preuve du rouge, 2.3 Code (`developpeur`), 2.4 Contrôles; 3 Passe finale; 4 Relecture (`relecteur`); 5 Intégration: 5.1 Commit, 5.2 File : main, poussée, CI. Out of the sequence, under the stopped step, the Arbitrage de l'arrêt (`regulateur` ⇄ `questionneur`). The `referent-technique` also settles a design question the supervisor asks him. One says « 320.2.1, step 2.3 »; the pane shows each ticket at its step.
24
+
25
+ ## When a skill says "publish to the issue tracker"
26
+
27
+ `npx grillhouse ticket` (« Numéros et titres »); a child never inherits its mother's `circuit`.
28
+
29
+ ## When a skill says "fetch the relevant ticket"
30
+
31
+ `bd show <id>`, then `bd comments <id>` (the handoff lives there). `bd list --parent <id>` lists an epic's children; `bd list --pretty` shows the tree.
32
+
33
+ ## Working a ticket
34
+
35
+ - **Frontier**: `bd ready` → open, unblocked, unclaimed, in order.
36
+ - **Claim**: `bd update <id> --claim` (assignee = you, status in_progress) **before any work**.
37
+ - **Blocking**: `bd dep add <blocked-id> <blocker-id>`; `bd blocked` shows what waits.
38
+ - **Resolve**: `bd comments add <id> "Réponse : …"` then `bd close <id> --reason "<motif>"`.
39
+
40
+ ## Handoff
41
+
42
+ The handoff is a comment on the ticket being worked, written by `bd comments add <id>`, not a temp file or a skill's document: the next session finds it with `bd show` or `bd comments <id>`.
43
+
44
+ The time each session takes is the register's (`packages/grillhouse/scripts/registre.mjs`), which reads its transcript: the handoff does not declare it. A session the circuit leads ends on its sheet, the structured output its role's schema describes (`packages/grillhouse/scripts/resultats.mjs`), which the circuit reads; the handoff is for the human and the next session of its author. A discovery of such a session goes into its sheet (`decouvertes`), which the circuit files closed under the ticket.
@@ -0,0 +1,73 @@
1
+ /**
2
+ * PM2 Ecosystem Configuration
3
+ *
4
+ * This file configures PM2 for running the application as a background daemon.
5
+ *
6
+ * Usage:
7
+ * npm run daemon:start - Start the daemon
8
+ * npm run daemon:stop - Stop the daemon
9
+ * npm run daemon:restart - Restart the daemon
10
+ * npm run daemon:logs - View logs
11
+ * npm run daemon:status - Check status
12
+ * npm run daemon:delete - Remove from PM2
13
+ *
14
+ * @see https://pm2.keymetrics.io/docs/usage/application-declaration/
15
+ */
16
+
17
+ module.exports = {
18
+ apps: [
19
+ {
20
+ // Application name (used in PM2 commands)
21
+ name: 'project-name',
22
+
23
+ // Entry point script
24
+ script: 'dist/index.js',
25
+
26
+ // Working directory
27
+ cwd: __dirname,
28
+
29
+ // Process mode: 'fork' for single instance, 'cluster' for multiple
30
+ exec_mode: 'fork',
31
+ instances: 1,
32
+
33
+ // Auto-restart configuration
34
+ autorestart: true,
35
+ watch: false,
36
+ max_memory_restart: '1G',
37
+
38
+ // Restart delay strategy
39
+ exp_backoff_restart_delay: 100,
40
+ max_restarts: 10,
41
+ restart_delay: 3000,
42
+
43
+ // Environment variables
44
+ env: {
45
+ NODE_ENV: 'production',
46
+ PORT: 3000
47
+ },
48
+ env_development: {
49
+ NODE_ENV: 'development',
50
+ PORT: 3000
51
+ },
52
+
53
+ // Logging configuration
54
+ log_date_format: 'YYYY-MM-DD HH:mm:ss',
55
+ error_file: 'logs/pm2-error.log',
56
+ out_file: 'logs/pm2-out.log',
57
+ merge_logs: true,
58
+
59
+ // Process identification
60
+ pid_file: 'logs/pm2.pid',
61
+
62
+ // Graceful shutdown
63
+ kill_timeout: 5000,
64
+ listen_timeout: 10000,
65
+
66
+ // Health monitoring
67
+ min_uptime: '10s',
68
+
69
+ // Node.js specific
70
+ node_args: '--enable-source-maps'
71
+ }
72
+ ]
73
+ };