ariadna 1.3.0 → 2.0.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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/ariadna.gemspec +0 -1
  3. data/data/agents/ariadna-codebase-mapper.md +34 -722
  4. data/data/agents/ariadna-debugger.md +44 -1139
  5. data/data/agents/ariadna-executor.md +75 -396
  6. data/data/agents/ariadna-planner.md +78 -1215
  7. data/data/agents/ariadna-roadmapper.md +55 -582
  8. data/data/agents/ariadna-verifier.md +60 -702
  9. data/data/ariadna/templates/config.json +8 -33
  10. data/data/ariadna/workflows/debug.md +28 -0
  11. data/data/ariadna/workflows/execute-phase.md +31 -513
  12. data/data/ariadna/workflows/map-codebase.md +20 -319
  13. data/data/ariadna/workflows/new-milestone.md +20 -365
  14. data/data/ariadna/workflows/new-project.md +19 -880
  15. data/data/ariadna/workflows/plan-phase.md +24 -443
  16. data/data/ariadna/workflows/progress.md +20 -376
  17. data/data/ariadna/workflows/quick.md +19 -221
  18. data/data/ariadna/workflows/roadmap-ops.md +28 -0
  19. data/data/ariadna/workflows/verify-work.md +23 -560
  20. data/data/commands/ariadna/add-phase.md +11 -22
  21. data/data/commands/ariadna/debug.md +11 -143
  22. data/data/commands/ariadna/execute-phase.md +12 -30
  23. data/data/commands/ariadna/insert-phase.md +7 -14
  24. data/data/commands/ariadna/map-codebase.md +16 -49
  25. data/data/commands/ariadna/new-milestone.md +12 -25
  26. data/data/commands/ariadna/new-project.md +22 -26
  27. data/data/commands/ariadna/plan-phase.md +13 -22
  28. data/data/commands/ariadna/progress.md +16 -6
  29. data/data/commands/ariadna/quick.md +9 -11
  30. data/data/commands/ariadna/remove-phase.md +9 -12
  31. data/data/commands/ariadna/verify-work.md +14 -19
  32. data/data/skills/rails-backend/API.md +138 -0
  33. data/data/skills/rails-backend/CONTROLLERS.md +154 -0
  34. data/data/skills/rails-backend/JOBS.md +132 -0
  35. data/data/skills/rails-backend/MODELS.md +213 -0
  36. data/data/skills/rails-backend/SKILL.md +169 -0
  37. data/data/skills/rails-frontend/ASSETS.md +154 -0
  38. data/data/skills/rails-frontend/COMPONENTS.md +253 -0
  39. data/data/skills/rails-frontend/SKILL.md +187 -0
  40. data/data/skills/rails-frontend/VIEWS.md +168 -0
  41. data/data/skills/rails-performance/PROFILING.md +106 -0
  42. data/data/skills/rails-performance/SKILL.md +217 -0
  43. data/data/skills/rails-security/AUDIT.md +118 -0
  44. data/data/skills/rails-security/SKILL.md +422 -0
  45. data/data/skills/rails-testing/FIXTURES.md +78 -0
  46. data/data/skills/rails-testing/SKILL.md +160 -0
  47. data/data/skills/rails-testing/SYSTEM-TESTS.md +73 -0
  48. data/lib/ariadna/installer.rb +11 -15
  49. data/lib/ariadna/tools/cli.rb +0 -12
  50. data/lib/ariadna/tools/config_manager.rb +10 -72
  51. data/lib/ariadna/tools/frontmatter.rb +23 -1
  52. data/lib/ariadna/tools/init.rb +201 -401
  53. data/lib/ariadna/tools/model_profiles.rb +6 -14
  54. data/lib/ariadna/tools/phase_manager.rb +1 -10
  55. data/lib/ariadna/tools/state_manager.rb +170 -451
  56. data/lib/ariadna/tools/template_filler.rb +4 -12
  57. data/lib/ariadna/tools/verification.rb +21 -399
  58. data/lib/ariadna/uninstaller.rb +9 -0
  59. data/lib/ariadna/version.rb +1 -1
  60. data/lib/ariadna.rb +1 -0
  61. metadata +20 -91
  62. data/data/agents/ariadna-backend-executor.md +0 -261
  63. data/data/agents/ariadna-frontend-executor.md +0 -259
  64. data/data/agents/ariadna-integration-checker.md +0 -418
  65. data/data/agents/ariadna-phase-researcher.md +0 -469
  66. data/data/agents/ariadna-plan-checker.md +0 -622
  67. data/data/agents/ariadna-project-researcher.md +0 -618
  68. data/data/agents/ariadna-research-synthesizer.md +0 -236
  69. data/data/agents/ariadna-test-executor.md +0 -266
  70. data/data/ariadna/references/checkpoints.md +0 -772
  71. data/data/ariadna/references/continuation-format.md +0 -249
  72. data/data/ariadna/references/decimal-phase-calculation.md +0 -65
  73. data/data/ariadna/references/git-integration.md +0 -248
  74. data/data/ariadna/references/git-planning-commit.md +0 -38
  75. data/data/ariadna/references/model-profile-resolution.md +0 -32
  76. data/data/ariadna/references/model-profiles.md +0 -73
  77. data/data/ariadna/references/phase-argument-parsing.md +0 -61
  78. data/data/ariadna/references/planning-config.md +0 -194
  79. data/data/ariadna/references/questioning.md +0 -153
  80. data/data/ariadna/references/rails-conventions.md +0 -416
  81. data/data/ariadna/references/tdd.md +0 -267
  82. data/data/ariadna/references/ui-brand.md +0 -160
  83. data/data/ariadna/references/verification-patterns.md +0 -853
  84. data/data/ariadna/templates/codebase/architecture.md +0 -481
  85. data/data/ariadna/templates/codebase/concerns.md +0 -380
  86. data/data/ariadna/templates/codebase/conventions.md +0 -434
  87. data/data/ariadna/templates/codebase/integrations.md +0 -328
  88. data/data/ariadna/templates/codebase/stack.md +0 -189
  89. data/data/ariadna/templates/codebase/structure.md +0 -418
  90. data/data/ariadna/templates/codebase/testing.md +0 -606
  91. data/data/ariadna/templates/context.md +0 -283
  92. data/data/ariadna/templates/continue-here.md +0 -78
  93. data/data/ariadna/templates/debug-subagent-prompt.md +0 -91
  94. data/data/ariadna/templates/phase-prompt.md +0 -609
  95. data/data/ariadna/templates/planner-subagent-prompt.md +0 -117
  96. data/data/ariadna/templates/research-project/ARCHITECTURE.md +0 -439
  97. data/data/ariadna/templates/research-project/FEATURES.md +0 -168
  98. data/data/ariadna/templates/research-project/PITFALLS.md +0 -406
  99. data/data/ariadna/templates/research-project/STACK.md +0 -251
  100. data/data/ariadna/templates/research-project/SUMMARY.md +0 -247
  101. data/data/ariadna/templates/state.md +0 -176
  102. data/data/ariadna/templates/summary-complex.md +0 -59
  103. data/data/ariadna/templates/summary-minimal.md +0 -41
  104. data/data/ariadna/templates/summary-standard.md +0 -48
  105. data/data/ariadna/templates/user-setup.md +0 -310
  106. data/data/ariadna/workflows/add-phase.md +0 -111
  107. data/data/ariadna/workflows/add-todo.md +0 -157
  108. data/data/ariadna/workflows/audit-milestone.md +0 -241
  109. data/data/ariadna/workflows/check-todos.md +0 -176
  110. data/data/ariadna/workflows/complete-milestone.md +0 -644
  111. data/data/ariadna/workflows/diagnose-issues.md +0 -219
  112. data/data/ariadna/workflows/discovery-phase.md +0 -289
  113. data/data/ariadna/workflows/discuss-phase.md +0 -408
  114. data/data/ariadna/workflows/execute-plan.md +0 -448
  115. data/data/ariadna/workflows/help.md +0 -470
  116. data/data/ariadna/workflows/insert-phase.md +0 -129
  117. data/data/ariadna/workflows/list-phase-assumptions.md +0 -178
  118. data/data/ariadna/workflows/pause-work.md +0 -122
  119. data/data/ariadna/workflows/plan-milestone-gaps.md +0 -256
  120. data/data/ariadna/workflows/remove-phase.md +0 -154
  121. data/data/ariadna/workflows/research-phase.md +0 -74
  122. data/data/ariadna/workflows/resume-project.md +0 -306
  123. data/data/ariadna/workflows/set-profile.md +0 -80
  124. data/data/ariadna/workflows/settings.md +0 -145
  125. data/data/ariadna/workflows/transition.md +0 -493
  126. data/data/ariadna/workflows/update.md +0 -212
  127. data/data/ariadna/workflows/verify-phase.md +0 -226
  128. data/data/commands/ariadna/add-todo.md +0 -42
  129. data/data/commands/ariadna/audit-milestone.md +0 -42
  130. data/data/commands/ariadna/check-todos.md +0 -41
  131. data/data/commands/ariadna/complete-milestone.md +0 -136
  132. data/data/commands/ariadna/discuss-phase.md +0 -86
  133. data/data/commands/ariadna/help.md +0 -22
  134. data/data/commands/ariadna/list-phase-assumptions.md +0 -50
  135. data/data/commands/ariadna/pause-work.md +0 -35
  136. data/data/commands/ariadna/plan-milestone-gaps.md +0 -40
  137. data/data/commands/ariadna/reapply-patches.md +0 -110
  138. data/data/commands/ariadna/research-phase.md +0 -187
  139. data/data/commands/ariadna/resume-work.md +0 -40
  140. data/data/commands/ariadna/set-profile.md +0 -34
  141. data/data/commands/ariadna/settings.md +0 -36
  142. data/data/commands/ariadna/update.md +0 -37
  143. data/data/guides/backend.md +0 -3069
  144. data/data/guides/frontend.md +0 -1479
  145. data/data/guides/performance.md +0 -1193
  146. data/data/guides/security.md +0 -1522
  147. data/data/guides/style-guide.md +0 -1091
  148. data/data/guides/testing.md +0 -504
  149. data/data/templates.md +0 -94
@@ -1,853 +0,0 @@
1
- # Verification Patterns
2
-
3
- How to verify different types of artifacts are real implementations, not stubs or placeholders.
4
-
5
- <core_principle>
6
- **Existence ≠ Implementation**
7
-
8
- A file existing does not mean the feature works. Verification must check:
9
- 1. **Exists** - File is present at expected path
10
- 2. **Substantive** - Content is real implementation, not placeholder
11
- 3. **Wired** - Connected to the rest of the system
12
- 4. **Functional** - Actually works when invoked
13
-
14
- Levels 1-3 can be checked programmatically. Level 4 often requires human verification.
15
- </core_principle>
16
-
17
- <stub_detection>
18
-
19
- ## Universal Stub Patterns
20
-
21
- These patterns indicate placeholder code regardless of file type:
22
-
23
- **Comment-based stubs:**
24
- ```bash
25
- # Grep patterns for stub comments
26
- grep -E "(TODO|FIXME|XXX|HACK|PLACEHOLDER)" "$file"
27
- grep -E "implement|add later|coming soon|will be" "$file" -i
28
- grep -E "// \.\.\.|/\* \.\.\. \*/|# \.\.\." "$file"
29
- ```
30
-
31
- **Placeholder text in output:**
32
- ```bash
33
- # UI placeholder patterns
34
- grep -E "placeholder|lorem ipsum|coming soon|under construction" "$file" -i
35
- grep -E "sample|example|test data|dummy" "$file" -i
36
- grep -E "\[.*\]|<.*>|\{.*\}" "$file" # Template brackets left in
37
- ```
38
-
39
- **Empty or trivial implementations:**
40
- ```bash
41
- # Functions that do nothing
42
- grep -E "return nil|return \{\}|return \[\]" "$file"
43
- grep -E "pass$|\.\.\.|\bnothing\b|raise NotImplementedError" "$file"
44
- grep -E "puts.*only|Rails\.logger\.(info|debug).*only" "$file" # Log-only functions
45
- ```
46
-
47
- **Hardcoded values where dynamic expected:**
48
- ```bash
49
- # Hardcoded IDs, counts, or content
50
- grep -E "id.*=.*['\"].*['\"]" "$file" # Hardcoded string IDs
51
- grep -E "count.*=.*\d+|length.*=.*\d+" "$file" # Hardcoded counts
52
- grep -E "\\\$\d+\.\d{2}|\d+ items" "$file" # Hardcoded display values
53
- ```
54
-
55
- </stub_detection>
56
-
57
- <api_routes>
58
-
59
- ## Rails Controllers and API Endpoints
60
-
61
- **Existence check:**
62
- ```bash
63
- # Controller file exists and defines class
64
- [ -f "$controller_path" ] && grep -E "class.*Controller < Application" "$controller_path"
65
-
66
- # Expected actions are defined
67
- grep -E "def (index|show|create|update|destroy|new|edit)" "$controller_path"
68
-
69
- # Route exists in config/routes.rb
70
- grep -E "resources :$resource_name|get.*$controller_name|post.*$controller_name" config/routes.rb
71
- ```
72
-
73
- **Substantive check:**
74
- ```bash
75
- # Has actual logic, not just return statement
76
- wc -l "$controller_path" # More than 10-15 lines suggests real implementation
77
-
78
- # Interacts with models (ActiveRecord)
79
- grep -E "$model_name\.(find|where|create|new|update|destroy|all|first|last)" "$controller_path"
80
-
81
- # Has error handling
82
- grep -E "rescue|rescue_from|begin|raise" "$controller_path"
83
-
84
- # Returns meaningful response
85
- grep -E "render json:|render|redirect_to|respond_to" "$controller_path" | grep -v "not implemented" -i
86
- ```
87
-
88
- **Stub patterns specific to Rails controllers:**
89
- ```ruby
90
- # RED FLAGS - These are stubs:
91
- def create
92
- render json: { message: "Not implemented" }
93
- end
94
-
95
- def index
96
- render json: [] # Empty array with no DB query
97
- end
98
-
99
- def update
100
- head :ok # Empty response, no persistence
101
- end
102
-
103
- # Log only:
104
- def create
105
- Rails.logger.info(params.inspect)
106
- render json: { ok: true }
107
- end
108
- ```
109
-
110
- **Wiring check:**
111
- ```bash
112
- # Uses strong parameters
113
- grep -E "def .*_params|params\.require|params\.permit" "$controller_path"
114
-
115
- # Actually uses request params (for create/update)
116
- grep -E "params\[|params\.require|params\.permit" "$controller_path"
117
-
118
- # Has validations via model or inline
119
- grep -E "validates|valid\?|errors|ActiveModel" "$controller_path"
120
- ```
121
-
122
- **Functional verification (human or automated):**
123
- - Does index return real data from database?
124
- - Does create actually persist a record?
125
- - Does error response have correct status code?
126
- - Are auth checks actually enforced (before_action)?
127
-
128
- </api_routes>
129
-
130
- <database_schema>
131
-
132
- ## Database Schema (ActiveRecord Migrations / schema.rb)
133
-
134
- **Existence check:**
135
- ```bash
136
- # Schema file exists
137
- [ -f "db/schema.rb" ] || [ -f "db/structure.sql" ]
138
-
139
- # Table is defined in schema
140
- grep -E "create_table.*\"$table_name\"|create_table.*:$table_name" db/schema.rb
141
-
142
- # Migration exists for this table
143
- ls db/migrate/*_create_$table_name* 2>/dev/null
144
- ```
145
-
146
- **Substantive check:**
147
- ```bash
148
- # Has expected columns (not just id and timestamps)
149
- grep -A 30 "create_table.*$table_name" db/schema.rb | grep -E "t\.\w+"
150
-
151
- # Has relationships (foreign keys)
152
- grep -E "foreign_key.*$table_name\|add_foreign_key.*$table_name\|references.*$table_name" db/schema.rb
153
-
154
- # Has appropriate column types (not all string)
155
- grep -A 30 "create_table.*$table_name" db/schema.rb | grep -E "t\.(integer|datetime|boolean|float|decimal|jsonb|text|bigint)"
156
- ```
157
-
158
- **Stub patterns specific to ActiveRecord:**
159
- ```ruby
160
- # RED FLAGS - These are stubs:
161
- create_table :users do |t|
162
- # TODO: add columns
163
- t.timestamps
164
- end
165
-
166
- create_table :messages do |t|
167
- t.string :content # Only one real column
168
- t.timestamps
169
- end
170
-
171
- # Missing critical columns:
172
- create_table :orders do |t|
173
- # No: user reference, items, total, status
174
- t.timestamps
175
- end
176
- ```
177
-
178
- **Wiring check:**
179
- ```bash
180
- # Migrations exist and are applied
181
- bin/rails db:migrate:status 2>/dev/null | grep -E "up|down"
182
-
183
- # No pending migrations
184
- bin/rails db:migrate:status 2>/dev/null | grep -c "down" # Should be 0
185
- ```
186
-
187
- **Functional verification:**
188
- ```bash
189
- # Can query the table (automated)
190
- bin/rails dbconsole <<< "SELECT COUNT(*) FROM $table_name"
191
- # Or via runner
192
- bin/rails runner "puts $model_name.count"
193
- ```
194
-
195
- </database_schema>
196
-
197
- <ruby_classes>
198
-
199
- ## Ruby Classes and Modules
200
-
201
- **Existence check:**
202
- ```bash
203
- # File exists and defines class/module
204
- [ -f "$class_path" ] && grep -E "^(class|module) " "$class_path"
205
- ```
206
-
207
- **Substantive check:**
208
- ```bash
209
- # Has real methods, not just stubs
210
- grep -E "^\s+def " "$class_path" | wc -l # Count methods
211
- grep -E "raise NotImplementedError|# TODO|# FIXME" "$class_path" # Stub markers
212
-
213
- # Methods have bodies (not single-line stubs)
214
- grep -A 3 "def " "$class_path" | grep -v "raise NotImplementedError\|nil$\|end$" | head -20
215
- ```
216
-
217
- **Stub patterns specific to Ruby:**
218
- ```ruby
219
- # RED FLAGS - These are stubs:
220
- def process(data)
221
- raise NotImplementedError
222
- end
223
-
224
- def calculate
225
- nil # Just returns nil
226
- end
227
-
228
- def perform
229
- # TODO: implement
230
- end
231
-
232
- def call
233
- puts "not yet implemented"
234
- end
235
- ```
236
-
237
- **Wiring check:**
238
- ```bash
239
- # Class is required/used somewhere
240
- grep -r "require.*$module_name\|$class_name\.new\|$class_name\." lib/ app/ --include="*.rb" | grep -v "$class_path"
241
-
242
- # For modules, check includes
243
- grep -r "include $module_name\|extend $module_name\|prepend $module_name" --include="*.rb"
244
- ```
245
-
246
- </ruby_classes>
247
-
248
- <rails_controllers>
249
-
250
- ## Rails Controllers and Actions
251
-
252
- **Existence check:**
253
- ```bash
254
- # Controller file exists and defines class
255
- [ -f "$controller_path" ] && grep -E "class.*Controller" "$controller_path"
256
-
257
- # Expected actions defined
258
- grep -E "def (index|show|create|update|destroy|new|edit)" "$controller_path"
259
- ```
260
-
261
- **Substantive check:**
262
- ```bash
263
- # Actions have more than just render/redirect
264
- grep -A 10 "def $action_name" "$controller_path" | grep -E "@|params|find|where|create|update|save"
265
-
266
- # Has strong parameters
267
- grep -E "def .*_params|params\.require|params\.permit" "$controller_path"
268
-
269
- # Has error handling
270
- grep -E "rescue|rescue_from|begin|raise" "$controller_path"
271
- ```
272
-
273
- **Stub patterns specific to Rails controllers:**
274
- ```ruby
275
- # RED FLAGS - These are stubs:
276
- def index
277
- render json: [] # Empty array, no query
278
- end
279
-
280
- def create
281
- render json: { status: "ok" } # No actual creation
282
- end
283
-
284
- def show
285
- # TODO: implement
286
- head :ok
287
- end
288
-
289
- def update
290
- render json: params # Echo params, no persistence
291
- end
292
- ```
293
-
294
- **Wiring check:**
295
- ```bash
296
- # Route exists for this controller
297
- grep -E "$controller_name" config/routes.rb
298
-
299
- # Callbacks/filters are referenced
300
- grep -E "before_action|after_action|around_action" "$controller_path"
301
-
302
- # Views exist (for non-API controllers)
303
- ls "app/views/$controller_dir/$action_name"* 2>/dev/null
304
- ```
305
-
306
- </rails_controllers>
307
-
308
- <rails_models>
309
-
310
- ## ActiveRecord Models
311
-
312
- **Existence check:**
313
- ```bash
314
- # Model file exists
315
- [ -f "$model_path" ] && grep -E "class.*< ApplicationRecord|class.*< ActiveRecord::Base" "$model_path"
316
-
317
- # Migration exists
318
- ls db/migrate/*_create_$table_name* 2>/dev/null
319
- ```
320
-
321
- **Substantive check:**
322
- ```bash
323
- # Has validations
324
- grep -E "validates|validate " "$model_path"
325
-
326
- # Has associations
327
- grep -E "belongs_to|has_many|has_one|has_and_belongs_to_many" "$model_path"
328
-
329
- # Has scopes or business logic
330
- grep -E "scope :|def self\.|def " "$model_path"
331
-
332
- # Schema has expected columns (check schema.rb or migration)
333
- grep -A 30 "create_table.*$table_name" db/schema.rb | grep -E "t\.\w+"
334
- ```
335
-
336
- **Stub patterns specific to ActiveRecord:**
337
- ```ruby
338
- # RED FLAGS - These are stubs:
339
- class Order < ApplicationRecord
340
- # Empty model, no validations or associations
341
- end
342
-
343
- class User < ApplicationRecord
344
- has_many :posts # Association but no validations
345
- # No: validates, scopes, callbacks, or methods
346
- end
347
-
348
- class Payment < ApplicationRecord
349
- def process
350
- # TODO: integrate with payment gateway
351
- true
352
- end
353
- end
354
- ```
355
-
356
- **Wiring check:**
357
- ```bash
358
- # Model is used in controllers
359
- grep -r "$model_name\." app/controllers/ --include="*.rb"
360
-
361
- # Associations target existing models
362
- grep -E "belongs_to|has_many|has_one" "$model_path" | grep -oP ":\w+" | while read assoc; do
363
- model_file="app/models/${assoc#:}.rb"
364
- [ -f "$model_file" ] && echo "WIRED: $assoc" || echo "MISSING: $assoc model"
365
- done
366
-
367
- # Migrations are applied
368
- bin/rails db:migrate:status 2>/dev/null | grep -E "up|down"
369
- ```
370
-
371
- </rails_models>
372
-
373
- <ruby_services>
374
-
375
- ## Ruby Services / POROs (Plain Old Ruby Objects)
376
-
377
- **Existence check:**
378
- ```bash
379
- # File exists and defines class
380
- [ -f "$service_path" ] && grep -E "^class " "$service_path"
381
- ```
382
-
383
- **Substantive check:**
384
- ```bash
385
- # Has a clear entry point (call, perform, execute, run)
386
- grep -E "def (call|perform|execute|run)" "$service_path"
387
-
388
- # Has real logic (not just delegation)
389
- [ $(wc -l < "$service_path") -gt 15 ]
390
-
391
- # Has error handling
392
- grep -E "rescue|raise|begin" "$service_path"
393
- ```
394
-
395
- **Stub patterns specific to services:**
396
- ```ruby
397
- # RED FLAGS - These are stubs:
398
- class UserCreator
399
- def call(params)
400
- User.create(params) # Just wraps create, adds nothing
401
- end
402
- end
403
-
404
- class PaymentProcessor
405
- def call(amount)
406
- puts "Processing #{amount}" # Log-only
407
- true
408
- end
409
- end
410
-
411
- class NotificationService
412
- def call(user, message)
413
- # TODO: send notification
414
- nil
415
- end
416
- end
417
- ```
418
-
419
- **Wiring check:**
420
- ```bash
421
- # Service is used somewhere
422
- grep -r "$service_name" app/ lib/ --include="*.rb" | grep -v "$service_path"
423
-
424
- # Service is called (instantiated and invoked)
425
- grep -r "$service_name\.new\|$service_name\.call\|$service_name\.()" --include="*.rb"
426
- ```
427
-
428
- </ruby_services>
429
-
430
- <hooks_utilities>
431
-
432
- ## Rails Helpers, Concerns, and Utility Modules
433
-
434
- **Existence check:**
435
- ```bash
436
- # Helper file exists and defines module
437
- [ -f "$helper_path" ] && grep -E "module.*Helper" "$helper_path"
438
-
439
- # Or concern exists
440
- [ -f "$concern_path" ] && grep -E "module.*|extend ActiveSupport::Concern" "$concern_path"
441
-
442
- # Or service object exists
443
- [ -f "$service_path" ] && grep -E "class " "$service_path"
444
- ```
445
-
446
- **Substantive check:**
447
- ```bash
448
- # Helper has real methods (not empty)
449
- grep -E "def " "$helper_path" | wc -l # Should be > 0
450
-
451
- # Concern has meaningful behavior (not just empty included block)
452
- grep -A 5 "included do" "$concern_path" | grep -E "validates|has_many|belongs_to|scope|before_action"
453
-
454
- # More than trivial length
455
- [ $(wc -l < "$helper_path") -gt 10 ]
456
- ```
457
-
458
- **Stub patterns specific to helpers/concerns:**
459
- ```ruby
460
- # RED FLAGS - These are stubs:
461
- module AuthHelper
462
- def current_user
463
- nil # Always returns nil
464
- end
465
-
466
- def authenticate!
467
- # TODO: implement
468
- end
469
- end
470
-
471
- module Authenticatable
472
- extend ActiveSupport::Concern
473
-
474
- included do
475
- # Nothing here
476
- end
477
- end
478
-
479
- # Hardcoded return:
480
- module UserHelper
481
- def user_display_name
482
- "Test User" # Hardcoded, not from model
483
- end
484
- end
485
- ```
486
-
487
- **Wiring check:**
488
- ```bash
489
- # Helper is included in a controller or view
490
- grep -r "include.*$helper_name\|helper.*$helper_name" app/ --include="*.rb"
491
-
492
- # Concern is included in a model or controller
493
- grep -r "include.*$concern_name" app/models/ app/controllers/ --include="*.rb" | grep -v "$concern_path"
494
-
495
- # Service is instantiated or called somewhere
496
- grep -r "$service_name\.new\|$service_name\.call" app/ lib/ --include="*.rb" | grep -v "$service_path"
497
- ```
498
-
499
- </hooks_utilities>
500
-
501
- <environment_config>
502
-
503
- ## Environment Variables and Configuration
504
-
505
- **Existence check:**
506
- ```bash
507
- # .env file exists
508
- [ -f ".env" ] || [ -f ".env.local" ]
509
-
510
- # Required variable is defined
511
- grep -E "^$VAR_NAME=" .env .env.local 2>/dev/null
512
- ```
513
-
514
- **Substantive check:**
515
- ```bash
516
- # Variable has actual value (not placeholder)
517
- grep -E "^$VAR_NAME=.+" .env .env.local 2>/dev/null | grep -v "your-.*-here|xxx|placeholder|TODO" -i
518
-
519
- # Value looks valid for type:
520
- # - URLs should start with http
521
- # - Keys should be long enough
522
- # - Booleans should be true/false
523
- ```
524
-
525
- **Stub patterns specific to env:**
526
- ```bash
527
- # RED FLAGS - These are stubs:
528
- DATABASE_URL=your-database-url-here
529
- STRIPE_SECRET_KEY=sk_test_xxx
530
- API_KEY=placeholder
531
- NEXT_PUBLIC_API_URL=http://localhost:3000 # Still pointing to localhost in prod
532
- ```
533
-
534
- **Wiring check:**
535
- ```bash
536
- # Variable is actually used in code
537
- grep -r "ENV\[\"$VAR_NAME\"\]\|ENV\.fetch(\"$VAR_NAME\")\|ENV\['$VAR_NAME'\]" app/ lib/ config/ --include="*.rb"
538
-
539
- # Variable is in credentials or application config
540
- grep -E "$VAR_NAME" config/credentials.yml.enc 2>/dev/null # Encrypted, check via `bin/rails credentials:show`
541
- grep -E "$VAR_NAME" config/application.yml config/settings.yml 2>/dev/null
542
- ```
543
-
544
- </environment_config>
545
-
546
- <wiring_verification>
547
-
548
- ## Wiring Verification Patterns
549
-
550
- Wiring verification checks that components actually communicate. This is where most stubs hide.
551
-
552
- ### Pattern: View → Controller
553
-
554
- **Check:** Does the view actually submit data to the correct controller action?
555
-
556
- ```bash
557
- # Find form actions pointing to controller
558
- grep -E "form_with\|form_for\|form_tag\|url:.*_path\|action:.*_path" "$view_path"
559
-
560
- # Verify link_to / button_to targets exist
561
- grep -E "link_to.*_path\|button_to.*_path" "$view_path"
562
-
563
- # Check Turbo Frame/Stream targets (Hotwire)
564
- grep -E "turbo_frame_tag\|turbo_stream" "$view_path"
565
- ```
566
-
567
- **Red flags:**
568
- ```erb
569
- <%# Form exists but points nowhere: %>
570
- <%= form_with url: "#" do |f| %>
571
-
572
- <%# Link to undefined route: %>
573
- <%= link_to "Show", "/undefined_path" %>
574
-
575
- <%# Form action commented out: %>
576
- <%# form_with model: @user do |f| %>
577
- ```
578
-
579
- ### Pattern: Controller → Model
580
-
581
- **Check:** Does the controller actually query/persist via the model?
582
-
583
- ```bash
584
- # Find model usage in controller
585
- grep -E "$model_name\.(find|where|create|new|update|destroy|all|first|last)" "$controller_path"
586
-
587
- # Verify result is assigned to instance variable
588
- grep -E "@$instance_var.*=.*$model_name\." "$controller_path"
589
-
590
- # Check result is used in response
591
- grep -E "render.*@$instance_var\|redirect_to.*@$instance_var\|respond_with.*@$instance_var" "$controller_path"
592
- ```
593
-
594
- **Red flags:**
595
- ```ruby
596
- # Model queried but result unused:
597
- def show
598
- User.find(params[:id]) # No assignment
599
- render json: { ok: true }
600
- end
601
-
602
- # Hardcoded instead of queried:
603
- def index
604
- @users = [{ name: "Test" }] # Not from DB
605
- end
606
-
607
- # Params not passed to model:
608
- def create
609
- @user = User.create # No params
610
- redirect_to @user
611
- end
612
- ```
613
-
614
- ### Pattern: Form → Controller Action
615
-
616
- **Check:** Does the form submission actually trigger persistence?
617
-
618
- ```bash
619
- # Find form_with targeting a model or URL
620
- grep -E "form_with.*model:|form_with.*url:" "$view_path"
621
-
622
- # Check controller action has strong params and saves
623
- grep -A 10 "def create\|def update" "$controller_path" | grep -E "\.save\|\.create\|\.update"
624
-
625
- # Verify redirect or render after save
626
- grep -A 15 "def create\|def update" "$controller_path" | grep -E "redirect_to\|render"
627
- ```
628
-
629
- **Red flags:**
630
- ```ruby
631
- # Controller action doesn't save:
632
- def create
633
- @user = User.new(user_params)
634
- # Missing: @user.save
635
- redirect_to users_path
636
- end
637
-
638
- # Action only logs:
639
- def create
640
- Rails.logger.info(params.inspect)
641
- render json: { ok: true }
642
- end
643
-
644
- # Empty action:
645
- def create
646
- head :ok
647
- end
648
- ```
649
-
650
- ### Pattern: Instance Variable → View
651
-
652
- **Check:** Does the view render data from instance variables, not hardcoded content?
653
-
654
- ```bash
655
- # Find instance variable usage in view
656
- grep -E "@$instance_var\b" "$view_path"
657
-
658
- # Check iteration over collections
659
- grep -E "@$collection\.each\|@$collection\.map" "$view_path"
660
-
661
- # Verify dynamic content (ERB interpolation)
662
- grep -E "<%=.*@" "$view_path"
663
- ```
664
-
665
- **Red flags:**
666
- ```erb
667
- <%# Hardcoded instead of from instance var: %>
668
- <p>Message 1</p>
669
- <p>Message 2</p>
670
-
671
- <%# Instance var exists but not rendered: %>
672
- <%# Controller sets @messages but view shows: %>
673
- <p>No messages</p>
674
-
675
- <%# Wrong variable rendered: %>
676
- <% @other_data.each do |item| %> <%# Should be @messages %>
677
- ```
678
-
679
- ### Pattern: Rails Model → Database
680
-
681
- **Check:** Does the model define validations and associations that match the schema?
682
-
683
- ```bash
684
- # Check schema has expected columns
685
- grep -A 30 "create_table.*$table_name" db/schema.rb
686
-
687
- # Check model declares associations
688
- grep -E "belongs_to|has_many|has_one" "$model_path"
689
-
690
- # Check foreign keys exist in schema
691
- grep "foreign_key.*$table_name\|$table_name.*foreign_key" db/schema.rb
692
- ```
693
-
694
- ### Pattern: Ruby Service → Dependencies
695
-
696
- **Check:** Does the service actually use its injected or imported dependencies?
697
-
698
- ```bash
699
- # Find initialize with dependencies
700
- grep -A 5 "def initialize" "$service_path"
701
-
702
- # Verify dependencies are used in methods
703
- grep -E "@[a-z_]+\." "$service_path" | grep -v "def initialize"
704
- ```
705
-
706
- </wiring_verification>
707
-
708
- <verification_checklist>
709
-
710
- ## Quick Verification Checklist
711
-
712
- For each artifact type, run through this checklist:
713
-
714
- ### Rails View Checklist
715
- - [ ] File exists at expected path (`app/views/`)
716
- - [ ] Renders dynamic content via instance variables (not hardcoded)
717
- - [ ] No placeholder text in output
718
- - [ ] Forms use `form_with` pointing to valid routes
719
- - [ ] Partials exist if referenced (`render partial:`)
720
- - [ ] Turbo frames/streams wired correctly (if using Hotwire)
721
- - [ ] Layout references resolve
722
- - [ ] Used by at least one controller action
723
-
724
- ### Rails Controller Checklist
725
- - [ ] File exists at expected path
726
- - [ ] Inherits from ApplicationController (or API base)
727
- - [ ] Expected actions defined (index, show, create, etc.)
728
- - [ ] Actions query/persist via model (not hardcoded)
729
- - [ ] Strong parameters defined
730
- - [ ] Callbacks/filters set up (authentication, authorization)
731
- - [ ] Route defined in config/routes.rb
732
- - [ ] Views exist (for non-API controllers)
733
-
734
- ### ActiveRecord Model Checklist
735
- - [ ] File exists at expected path
736
- - [ ] Inherits from ApplicationRecord
737
- - [ ] Validations present for required fields
738
- - [ ] Associations defined and match schema
739
- - [ ] Migration exists and is applied
740
- - [ ] Schema has expected columns and types
741
- - [ ] Indexes defined for queried columns
742
-
743
- ### Ruby Service/PORO Checklist
744
- - [ ] File exists at expected path
745
- - [ ] Has clear entry point (call/perform/execute)
746
- - [ ] Has meaningful implementation (not stub)
747
- - [ ] Used somewhere in the app
748
- - [ ] Error handling present
749
- - [ ] Dependencies injected or required
750
-
751
- ### Wiring Checklist (Ruby/Rails)
752
- - [ ] Controller → Model: actions query/persist, results assigned to instance vars
753
- - [ ] Model → Database: validations match schema constraints, associations valid
754
- - [ ] Service → Dependencies: injected deps are actually used in methods
755
- - [ ] Routes → Controller: all routes resolve to existing controller actions
756
-
757
- </verification_checklist>
758
-
759
- <automated_verification_script>
760
-
761
- ## Automated Verification Approach
762
-
763
- For the verification subagent, use this pattern:
764
-
765
- ```bash
766
- # 1. Check existence
767
- check_exists() {
768
- [ -f "$1" ] && echo "EXISTS: $1" || echo "MISSING: $1"
769
- }
770
-
771
- # 2. Check for stub patterns
772
- check_stubs() {
773
- local file="$1"
774
- local stubs=$(grep -c -E "TODO|FIXME|placeholder|not implemented" "$file" 2>/dev/null || echo 0)
775
- [ "$stubs" -gt 0 ] && echo "STUB_PATTERNS: $stubs in $file"
776
- }
777
-
778
- # 3. Check wiring (view references controller, controller uses model)
779
- check_wiring() {
780
- local source="$1"
781
- local target="$2"
782
- grep -q "$target" "$source" && echo "WIRED: $source → $target" || echo "NOT_WIRED: $source → $target"
783
- }
784
-
785
- # 4. Check substantive (more than N lines, has expected patterns)
786
- check_substantive() {
787
- local file="$1"
788
- local min_lines="$2"
789
- local pattern="$3"
790
- local lines=$(wc -l < "$file" 2>/dev/null || echo 0)
791
- local has_pattern=$(grep -c -E "$pattern" "$file" 2>/dev/null || echo 0)
792
- [ "$lines" -ge "$min_lines" ] && [ "$has_pattern" -gt 0 ] && echo "SUBSTANTIVE: $file" || echo "THIN: $file ($lines lines, $has_pattern matches)"
793
- }
794
- ```
795
-
796
- Run these checks against each must-have artifact. Aggregate results into VERIFICATION.md.
797
-
798
- </automated_verification_script>
799
-
800
- <human_verification_triggers>
801
-
802
- ## When to Require Human Verification
803
-
804
- Some things can't be verified programmatically. Flag these for human testing:
805
-
806
- **Always human:**
807
- - Visual appearance (does it look right?)
808
- - User flow completion (can you actually do the thing?)
809
- - Real-time behavior (WebSocket, SSE)
810
- - External service integration (Stripe, email sending)
811
- - Error message clarity (is the message helpful?)
812
- - Performance feel (does it feel fast?)
813
-
814
- **Human if uncertain:**
815
- - Complex wiring that grep can't trace
816
- - Dynamic behavior depending on state
817
- - Edge cases and error states
818
- - Mobile responsiveness
819
- - Accessibility
820
-
821
- **Format for human verification request:**
822
- ```markdown
823
- ## Human Verification Required
824
-
825
- ### 1. Chat message sending
826
- **Test:** Type a message and click Send
827
- **Expected:** Message appears in list, input clears
828
- **Check:** Does message persist after refresh?
829
-
830
- ### 2. Error handling
831
- **Test:** Disconnect network, try to send
832
- **Expected:** Error message appears, message not lost
833
- **Check:** Can retry after reconnect?
834
- ```
835
-
836
- </human_verification_triggers>
837
-
838
- <checkpoint_automation_reference>
839
-
840
- ## Pre-Checkpoint Automation
841
-
842
- For automation-first checkpoint patterns, server lifecycle management, CLI installation handling, and error recovery protocols, see:
843
-
844
- **@~/.claude/ariadna/references/checkpoints.md** → `<automation_reference>` section
845
-
846
- Key principles:
847
- - Claude sets up verification environment BEFORE presenting checkpoints
848
- - Users never run CLI commands (visit URLs only)
849
- - Server lifecycle: start before checkpoint, handle port conflicts, keep running for duration
850
- - CLI installation: auto-install where safe, checkpoint for user choice otherwise
851
- - Error handling: fix broken environment before checkpoint, never present checkpoint with failed setup
852
-
853
- </checkpoint_automation_reference>