appydave-tools 0.67.0 → 0.68.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/CLAUDE.md +33 -0
- data/docs/ai-instructions/behavioral-regression-audit.md +659 -0
- data/docs/code-quality/behavioral-audit-2025-01-22.md +659 -0
- data/docs/code-quality/uat-plan-2025-01-22.md +374 -0
- data/lib/appydave/tools/dam/brand_resolver.rb +7 -1
- data/lib/appydave/tools/dam/errors.rb +9 -1
- data/lib/appydave/tools/dam/fuzzy_matcher.rb +63 -0
- data/lib/appydave/tools/dam/project_listing.rb +51 -12
- data/lib/appydave/tools/dam/s3_operations.rb +95 -0
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave/tools.rb +1 -0
- data/package.json +1 -1
- metadata +5 -1
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
# Behavioral Regression Audit
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Verify that code at commit `4228b51` (current HEAD) behaves identically to commit `9e49668` (baseline) except for intentional UX improvements.
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
This is a Ruby gem project (`appydave-tools`) providing CLI tools for video asset management. Between commits `9e49668` and `4228b51`, **75 commits of AI-driven UX improvements** were made without human verification between commits.
|
|
10
|
+
|
|
11
|
+
**The Problem:**
|
|
12
|
+
- Baseline `9e49668`: Code definitely worked (all DAM functions operational)
|
|
13
|
+
- Current `4228b51`: Code state unknown after 75 AI-generated commits
|
|
14
|
+
- Changes focused on: Help text, error messages, table formatting, validation, new flags
|
|
15
|
+
- Risk: Did AI inadvertently break core functionality while "improving" UX?
|
|
16
|
+
|
|
17
|
+
**What We Need to Prove:**
|
|
18
|
+
1. Old functionality preserved (everything that worked still works)
|
|
19
|
+
2. New UX additions are safe (only cosmetic/minor functional improvements)
|
|
20
|
+
3. No silent bugs introduced (no logic errors from AI refactoring)
|
|
21
|
+
|
|
22
|
+
## Commit Range
|
|
23
|
+
|
|
24
|
+
- **Baseline (known working):** `9e49668`
|
|
25
|
+
- **Current (unknown state):** `4228b51`
|
|
26
|
+
- **Commits between:** 75 commits
|
|
27
|
+
- **Analysis method:** Two-snapshot comparison (NOT 75 individual commit reviews)
|
|
28
|
+
|
|
29
|
+
## What Changed (Expected)
|
|
30
|
+
|
|
31
|
+
**Acceptable changes:**
|
|
32
|
+
- Help text wording improvements
|
|
33
|
+
- Table column names and formatting
|
|
34
|
+
- Error message phrasing
|
|
35
|
+
- Validation message improvements
|
|
36
|
+
- New command-line flags (e.g., `--detailed`)
|
|
37
|
+
- Debug output enhancements
|
|
38
|
+
|
|
39
|
+
**Unacceptable changes:**
|
|
40
|
+
- Different projects listed by `dam list`
|
|
41
|
+
- Different file counts or sizes reported
|
|
42
|
+
- Changed brand resolution logic (shortcuts, case-sensitivity)
|
|
43
|
+
- Changed S3 sync behavior
|
|
44
|
+
- Changed git status detection
|
|
45
|
+
- Breaking changes to command syntax
|
|
46
|
+
|
|
47
|
+
## Known High-Risk Areas
|
|
48
|
+
|
|
49
|
+
**From code quality report (2025-01-21):**
|
|
50
|
+
- **Brand resolution:** v- prefix handling, case-insensitive matching, shortcuts (ad, voz, joy, ss)
|
|
51
|
+
- **Regexp.last_match bug:** Fixed in commit 9e49668 (capture groups reset by `.sub()` calls)
|
|
52
|
+
- **Configuration loading:** 7x config load calls issue (commit 94d3ea0)
|
|
53
|
+
- **Git operations:** Duplicated helper methods across files
|
|
54
|
+
- **S3 operations:** Sync status detection, upload/download logic
|
|
55
|
+
|
|
56
|
+
## Prerequisites
|
|
57
|
+
|
|
58
|
+
Before starting this audit:
|
|
59
|
+
- [ ] Working directory: `/Users/davidcruwys/dev/ad/appydave-tools`
|
|
60
|
+
- [ ] Current branch: `main` at commit `4228b51`
|
|
61
|
+
- [ ] Baseline commit exists: Run `git show 9e49668` to verify
|
|
62
|
+
- [ ] DAM command available: `which dam` or use `bin/dam`
|
|
63
|
+
- [ ] Test environment has real project data (v-appydave, v-voz, etc.)
|
|
64
|
+
|
|
65
|
+
## 5-Phase Audit Process
|
|
66
|
+
|
|
67
|
+
### Phase 1: Change Inventory (Understand What Changed)
|
|
68
|
+
|
|
69
|
+
**Goal:** Identify all changed files and classify changes as UX vs Logic vs Refactor
|
|
70
|
+
|
|
71
|
+
**Commands to run:**
|
|
72
|
+
```bash
|
|
73
|
+
# Get list of all changed files with status
|
|
74
|
+
git diff 9e49668..4228b51 --name-status > /tmp/changed-files.txt
|
|
75
|
+
|
|
76
|
+
# Get statistics on changes
|
|
77
|
+
git diff 9e49668..4228b51 --stat
|
|
78
|
+
|
|
79
|
+
# Get detailed diff for lib/ directory
|
|
80
|
+
git diff 9e49668..4228b51 lib/ > /tmp/lib-changes.diff
|
|
81
|
+
|
|
82
|
+
# Get detailed diff for bin/ directory
|
|
83
|
+
git diff 9e49668..4228b51 bin/ > /tmp/bin-changes.diff
|
|
84
|
+
|
|
85
|
+
# Get detailed diff for spec/ directory
|
|
86
|
+
git diff 9e49668..4228b51 spec/ > /tmp/spec-changes.diff
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Analysis tasks:**
|
|
90
|
+
1. List all changed files (group by directory: lib/, bin/, spec/, docs/)
|
|
91
|
+
2. For each file, classify the change:
|
|
92
|
+
- **UX-only:** Help text, error messages, table formatting, column names
|
|
93
|
+
- **Logic change:** Conditionals, calculations, flow control, regex patterns
|
|
94
|
+
- **Refactor:** Method extraction/renaming, file reorganization (same logic, different structure)
|
|
95
|
+
- **New feature:** Entirely new functionality (e.g., --detailed flag)
|
|
96
|
+
- **Bug fix:** Fixing broken behavior
|
|
97
|
+
- **Test change:** Spec updates
|
|
98
|
+
|
|
99
|
+
**Output for Phase 1:**
|
|
100
|
+
```markdown
|
|
101
|
+
### Phase 1: Change Inventory
|
|
102
|
+
|
|
103
|
+
**Files changed:** X files across Y directories
|
|
104
|
+
|
|
105
|
+
#### Changed Files by Category
|
|
106
|
+
|
|
107
|
+
**UX-only changes (N files):**
|
|
108
|
+
- `file1.rb` - Updated help text and error messages
|
|
109
|
+
- `file2.rb` - Table formatting improvements
|
|
110
|
+
|
|
111
|
+
**Logic changes (N files):**
|
|
112
|
+
- `file3.rb` - Modified brand resolution conditional (LINE X-Y)
|
|
113
|
+
- `file4.rb` - Changed regex pattern (LINE Z)
|
|
114
|
+
|
|
115
|
+
**Refactored (N files):**
|
|
116
|
+
- `file5.rb` - Extracted method, same logic
|
|
117
|
+
|
|
118
|
+
**New features (N files):**
|
|
119
|
+
- `file6.rb` - Added --detailed flag support
|
|
120
|
+
|
|
121
|
+
**Test changes (N files):**
|
|
122
|
+
- `file7_spec.rb` - Updated specs for new behavior
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Phase 2: Critical Path Analysis (What Must Work?)
|
|
128
|
+
|
|
129
|
+
**Goal:** Identify core DAM operations that absolutely cannot break
|
|
130
|
+
|
|
131
|
+
**Critical operations to verify:**
|
|
132
|
+
1. **Brand listing:**
|
|
133
|
+
- `dam list` (all brands)
|
|
134
|
+
- `dam list --detailed` (extended view)
|
|
135
|
+
- Invalid brand error handling
|
|
136
|
+
|
|
137
|
+
2. **Project listing:**
|
|
138
|
+
- `dam list <brand>` (specific brand)
|
|
139
|
+
- `dam list <brand> <pattern>` (pattern matching like 'b6*')
|
|
140
|
+
- `dam list <brand> --detailed` (extended project view)
|
|
141
|
+
|
|
142
|
+
3. **S3 operations:**
|
|
143
|
+
- `dam s3-status <brand> <project>` (sync status check)
|
|
144
|
+
- `dam s3-up <brand> <project>` (upload preparation)
|
|
145
|
+
- `dam s3-down <brand> <project>` (download preparation)
|
|
146
|
+
- `dam s3-cleanup <brand> <project>` (cleanup)
|
|
147
|
+
|
|
148
|
+
4. **Git operations:**
|
|
149
|
+
- `dam status <brand>` (git repository status)
|
|
150
|
+
- Git status column in brand list
|
|
151
|
+
- Git status column in project list
|
|
152
|
+
|
|
153
|
+
5. **Brand/project resolution:**
|
|
154
|
+
- Shortcuts (ad → appydave, voz → voz, joy → beauty-and-joy, ss → supportsignal)
|
|
155
|
+
- Case-insensitive matching (appydave, APPYDAVE, AppyDave all work)
|
|
156
|
+
- Fuzzy matching with "Did you mean?" suggestions
|
|
157
|
+
- Auto-detection from PWD
|
|
158
|
+
|
|
159
|
+
6. **Archive operations:**
|
|
160
|
+
- `dam archive <brand> <project>` (archive to SSD)
|
|
161
|
+
- `dam sync-ssd <brand>` (sync from SSD)
|
|
162
|
+
|
|
163
|
+
**Output for Phase 2:**
|
|
164
|
+
```markdown
|
|
165
|
+
### Phase 2: Critical Path Analysis
|
|
166
|
+
|
|
167
|
+
**Core operations identified:** X operations across Y command categories
|
|
168
|
+
|
|
169
|
+
**File dependencies per operation:**
|
|
170
|
+
- `dam list` → Uses: `lib/file1.rb`, `lib/file2.rb`, etc.
|
|
171
|
+
- `dam s3-status` → Uses: `lib/file3.rb`, `lib/file4.rb`, etc.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
### Phase 3: Behavioral Comparison Testing
|
|
177
|
+
|
|
178
|
+
**Goal:** Run identical commands on both versions and compare outputs
|
|
179
|
+
|
|
180
|
+
**⚠️ IMPORTANT:** This phase requires checking out different commits. Save any uncommitted work first.
|
|
181
|
+
|
|
182
|
+
**Method:**
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Step 1: Create output directory
|
|
186
|
+
mkdir -p /tmp/behavioral-audit
|
|
187
|
+
|
|
188
|
+
# Step 2: Checkout baseline and capture outputs
|
|
189
|
+
git checkout 9e49668
|
|
190
|
+
|
|
191
|
+
# Run core commands and save outputs
|
|
192
|
+
dam list > /tmp/behavioral-audit/baseline-dam-list.txt 2>&1
|
|
193
|
+
dam list appydave > /tmp/behavioral-audit/baseline-appydave-list.txt 2>&1
|
|
194
|
+
dam list voz > /tmp/behavioral-audit/baseline-voz-list.txt 2>&1
|
|
195
|
+
dam s3-status appydave b65 > /tmp/behavioral-audit/baseline-s3-status.txt 2>&1 || true
|
|
196
|
+
dam status appydave > /tmp/behavioral-audit/baseline-git-status.txt 2>&1 || true
|
|
197
|
+
|
|
198
|
+
# Test error handling
|
|
199
|
+
dam list invalidbrand > /tmp/behavioral-audit/baseline-error-invalid.txt 2>&1 || true
|
|
200
|
+
dam list appydav > /tmp/behavioral-audit/baseline-fuzzy-match.txt 2>&1 || true
|
|
201
|
+
|
|
202
|
+
# Test shortcuts
|
|
203
|
+
dam list ad > /tmp/behavioral-audit/baseline-shortcut-ad.txt 2>&1
|
|
204
|
+
dam list joy > /tmp/behavioral-audit/baseline-shortcut-joy.txt 2>&1
|
|
205
|
+
|
|
206
|
+
# Step 3: Checkout current and capture outputs
|
|
207
|
+
git checkout 4228b51
|
|
208
|
+
|
|
209
|
+
dam list > /tmp/behavioral-audit/current-dam-list.txt 2>&1
|
|
210
|
+
dam list appydave > /tmp/behavioral-audit/current-appydave-list.txt 2>&1
|
|
211
|
+
dam list voz > /tmp/behavioral-audit/current-voz-list.txt 2>&1
|
|
212
|
+
dam s3-status appydave b65 > /tmp/behavioral-audit/current-s3-status.txt 2>&1 || true
|
|
213
|
+
dam status appydave > /tmp/behavioral-audit/current-git-status.txt 2>&1 || true
|
|
214
|
+
|
|
215
|
+
dam list invalidbrand > /tmp/behavioral-audit/current-error-invalid.txt 2>&1 || true
|
|
216
|
+
dam list appydav > /tmp/behavioral-audit/current-fuzzy-match.txt 2>&1 || true
|
|
217
|
+
|
|
218
|
+
dam list ad > /tmp/behavioral-audit/current-shortcut-ad.txt 2>&1
|
|
219
|
+
dam list joy > /tmp/behavioral-audit/current-shortcut-joy.txt 2>&1
|
|
220
|
+
|
|
221
|
+
# Step 4: Compare outputs
|
|
222
|
+
cd /tmp/behavioral-audit
|
|
223
|
+
for file in baseline-*.txt; do
|
|
224
|
+
current_file="${file/baseline-/current-}"
|
|
225
|
+
echo "=== Comparing $file vs $current_file ==="
|
|
226
|
+
diff "$file" "$current_file" || echo "DIFFERENCES FOUND"
|
|
227
|
+
done
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Analysis tasks:**
|
|
231
|
+
1. For each command pair, identify differences
|
|
232
|
+
2. Classify differences as:
|
|
233
|
+
- **Formatting only:** Column widths, table borders, spacing (ACCEPTABLE)
|
|
234
|
+
- **Wording only:** Help text, error messages (ACCEPTABLE)
|
|
235
|
+
- **Data difference:** Different projects listed, different counts, different statuses (UNACCEPTABLE)
|
|
236
|
+
- **Functional difference:** Command failed in one version but not the other (UNACCEPTABLE)
|
|
237
|
+
|
|
238
|
+
**Output for Phase 3:**
|
|
239
|
+
```markdown
|
|
240
|
+
### Phase 3: Behavioral Comparison Testing
|
|
241
|
+
|
|
242
|
+
**Commands tested:** X commands on both versions
|
|
243
|
+
|
|
244
|
+
**Results:**
|
|
245
|
+
|
|
246
|
+
| Command | Baseline Output | Current Output | Difference Type | Acceptable? |
|
|
247
|
+
|---------|----------------|----------------|-----------------|-------------|
|
|
248
|
+
| `dam list` | 6 brands listed | 6 brands listed | Table formatting | ✅ Yes |
|
|
249
|
+
| `dam list appydave` | 21 projects | 21 projects | Column names changed | ✅ Yes |
|
|
250
|
+
| `dam s3-status appydave b65` | Status shown | Status shown | Same data | ✅ Yes |
|
|
251
|
+
| `dam list invalidbrand` | Error shown | Error shown | Error message wording | ✅ Yes |
|
|
252
|
+
|
|
253
|
+
**Critical differences found:** N
|
|
254
|
+
|
|
255
|
+
**Details of critical differences:**
|
|
256
|
+
[List any UNACCEPTABLE differences here]
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
### Phase 4: Logic Diff Analysis
|
|
262
|
+
|
|
263
|
+
**Goal:** Find places where code logic changed (not just formatting/structure)
|
|
264
|
+
|
|
265
|
+
**Method:**
|
|
266
|
+
|
|
267
|
+
Use grep and diff to find semantic changes in critical areas:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Checkout current version
|
|
271
|
+
git checkout 4228b51
|
|
272
|
+
|
|
273
|
+
# Search for brand resolution logic changes
|
|
274
|
+
git diff 9e49668..4228b51 -- lib/ | grep -A5 -B5 "brand.*==" > /tmp/brand-resolution-changes.txt
|
|
275
|
+
git diff 9e49668..4228b51 -- lib/ | grep -A5 -B5 "v-prefix\|v-appydave" > /tmp/v-prefix-changes.txt
|
|
276
|
+
|
|
277
|
+
# Search for regex pattern changes
|
|
278
|
+
git diff 9e49668..4228b51 -- lib/ | grep -A5 -B5 "Regexp\|\.match\|\.scan" > /tmp/regex-changes.txt
|
|
279
|
+
|
|
280
|
+
# Search for conditional logic changes
|
|
281
|
+
git diff 9e49668..4228b51 -- lib/ | grep -A3 -B3 "^[+-].*if \|^[+-].*elsif \|^[+-].*case " > /tmp/conditional-changes.txt
|
|
282
|
+
|
|
283
|
+
# Search for file path construction changes
|
|
284
|
+
git diff 9e49668..4228b51 -- lib/ | grep -A3 -B3 "File.join\|File.expand_path\|\.sub\|\.gsub" > /tmp/path-changes.txt
|
|
285
|
+
|
|
286
|
+
# Search for configuration loading changes
|
|
287
|
+
git diff 9e49668..4228b51 -- lib/ | grep -A5 -B5 "config\|settings\|load" > /tmp/config-changes.txt
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Red flags to look for:**
|
|
291
|
+
- Changed regex capture groups (could break parsing)
|
|
292
|
+
- Changed file path construction (could break file access)
|
|
293
|
+
- Changed brand resolution conditionals (could break shortcuts)
|
|
294
|
+
- Changed configuration loading order (could break initialization)
|
|
295
|
+
- Changed error handling (raise → return, or vice versa)
|
|
296
|
+
|
|
297
|
+
**Analysis tasks:**
|
|
298
|
+
1. Review each type of change
|
|
299
|
+
2. Identify which files had logic changes vs refactoring
|
|
300
|
+
3. For logic changes, assess risk level (High/Medium/Low)
|
|
301
|
+
|
|
302
|
+
**Output for Phase 4:**
|
|
303
|
+
```markdown
|
|
304
|
+
### Phase 4: Logic Diff Analysis
|
|
305
|
+
|
|
306
|
+
**Logic changes detected:** X changes in Y files
|
|
307
|
+
|
|
308
|
+
#### High-Risk Logic Changes
|
|
309
|
+
|
|
310
|
+
**File:** `lib/appydave/tools/dam/brand_resolver.rb`
|
|
311
|
+
- **Line:** 45-52
|
|
312
|
+
- **Change:** Modified brand shortcut resolution conditional
|
|
313
|
+
- **Risk:** High - Could break 'ad', 'voz', 'joy', 'ss' shortcuts
|
|
314
|
+
- **Verification needed:** Test all shortcuts on both versions
|
|
315
|
+
|
|
316
|
+
#### Medium-Risk Logic Changes
|
|
317
|
+
|
|
318
|
+
**File:** `lib/appydave/tools/dam/project_detector.rb`
|
|
319
|
+
- **Line:** 78-85
|
|
320
|
+
- **Change:** Changed regex pattern for project detection
|
|
321
|
+
- **Risk:** Medium - Could affect pattern matching
|
|
322
|
+
- **Verification needed:** Test 'b6*' pattern expansion
|
|
323
|
+
|
|
324
|
+
#### Low-Risk Logic Changes
|
|
325
|
+
|
|
326
|
+
**File:** `lib/appydave/tools/dam/table_formatter.rb`
|
|
327
|
+
- **Line:** 120-135
|
|
328
|
+
- **Change:** Refactored column width calculation
|
|
329
|
+
- **Risk:** Low - Formatting only, same logic
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
### Phase 5: High-Risk Spot Check
|
|
335
|
+
|
|
336
|
+
**Goal:** Manually review critical files where logic changed
|
|
337
|
+
|
|
338
|
+
**Files to review (from Phase 4 high/medium risk):**
|
|
339
|
+
1. Brand resolution files
|
|
340
|
+
2. Project detection files
|
|
341
|
+
3. S3 operation files
|
|
342
|
+
4. Git status files
|
|
343
|
+
5. Configuration loading files
|
|
344
|
+
|
|
345
|
+
**For each file:**
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
# View the file at baseline
|
|
349
|
+
git show 9e49668:lib/path/to/file.rb > /tmp/baseline-file.rb
|
|
350
|
+
|
|
351
|
+
# View the file at current
|
|
352
|
+
git show 4228b51:lib/path/to/file.rb > /tmp/current-file.rb
|
|
353
|
+
|
|
354
|
+
# Side-by-side diff
|
|
355
|
+
diff -y /tmp/baseline-file.rb /tmp/current-file.rb | less
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Analysis questions:**
|
|
359
|
+
1. Are inputs and outputs the same?
|
|
360
|
+
2. Are edge cases handled identically?
|
|
361
|
+
3. Are error conditions handled identically?
|
|
362
|
+
4. Did refactoring preserve the original logic?
|
|
363
|
+
5. Are there new bugs introduced?
|
|
364
|
+
|
|
365
|
+
**Specific checks for known issues:**
|
|
366
|
+
|
|
367
|
+
**Brand Resolution:**
|
|
368
|
+
- [ ] Shortcuts still map correctly (ad → appydave, voz → voz, etc.)
|
|
369
|
+
- [ ] Case-insensitive matching preserved
|
|
370
|
+
- [ ] v- prefix handling unchanged
|
|
371
|
+
- [ ] Fuzzy matching working
|
|
372
|
+
|
|
373
|
+
**Regexp.last_match (known bug area):**
|
|
374
|
+
- [ ] Capture groups extracted BEFORE any `.sub()` or `.gsub()` calls
|
|
375
|
+
- [ ] No regex results lost due to subsequent string operations
|
|
376
|
+
|
|
377
|
+
**Configuration Loading:**
|
|
378
|
+
- [ ] Config loaded once per command (not 7x)
|
|
379
|
+
- [ ] Config paths resolved correctly
|
|
380
|
+
- [ ] No hard-coded paths introduced
|
|
381
|
+
|
|
382
|
+
**S3 Operations:**
|
|
383
|
+
- [ ] MD5 comparison logic unchanged
|
|
384
|
+
- [ ] Upload/download decision logic unchanged
|
|
385
|
+
- [ ] 3-state model (upload/download/synced) working
|
|
386
|
+
|
|
387
|
+
**Git Operations:**
|
|
388
|
+
- [ ] Status detection unchanged
|
|
389
|
+
- [ ] Branch detection unchanged
|
|
390
|
+
- [ ] Modified files detection unchanged
|
|
391
|
+
|
|
392
|
+
**Output for Phase 5:**
|
|
393
|
+
```markdown
|
|
394
|
+
### Phase 5: High-Risk Spot Check
|
|
395
|
+
|
|
396
|
+
**Files manually reviewed:** X files
|
|
397
|
+
|
|
398
|
+
#### File: `lib/appydave/tools/dam/brand_resolver.rb`
|
|
399
|
+
|
|
400
|
+
**Changes found:**
|
|
401
|
+
- Line 45: Added downcase normalization
|
|
402
|
+
- Line 52: Refactored shortcut hash lookup
|
|
403
|
+
|
|
404
|
+
**Verification:**
|
|
405
|
+
- ✅ Shortcuts still work (tested ad, voz, joy, ss)
|
|
406
|
+
- ✅ Case-insensitive matching preserved
|
|
407
|
+
- ✅ v- prefix handling unchanged
|
|
408
|
+
- ⚠️ New fuzzy matching added (acceptable - UX improvement)
|
|
409
|
+
|
|
410
|
+
**Verdict:** SAFE - Logic preserved, UX enhanced
|
|
411
|
+
|
|
412
|
+
#### File: `lib/appydave/tools/dam/project_detector.rb`
|
|
413
|
+
|
|
414
|
+
**Changes found:**
|
|
415
|
+
- Line 78: Changed regex pattern from `/pattern1/` to `/pattern2/`
|
|
416
|
+
|
|
417
|
+
**Verification:**
|
|
418
|
+
- ❌ Regexp.last_match captured AFTER .sub() call (BUG!)
|
|
419
|
+
- ❌ Pattern matching broken for 'b6*' expansion
|
|
420
|
+
|
|
421
|
+
**Verdict:** UNSAFE - Regression introduced, needs fix
|
|
422
|
+
|
|
423
|
+
[Continue for each high-risk file...]
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
## Report Format
|
|
429
|
+
|
|
430
|
+
Create the audit report at: `docs/code-quality/behavioral-audit-2025-01-22.md`
|
|
431
|
+
|
|
432
|
+
Use this template:
|
|
433
|
+
|
|
434
|
+
```markdown
|
|
435
|
+
# Behavioral Regression Audit Report
|
|
436
|
+
|
|
437
|
+
**Date:** 2025-01-22
|
|
438
|
+
**Baseline Commit:** `9e49668` (known working)
|
|
439
|
+
**Current Commit:** `4228b51` (HEAD)
|
|
440
|
+
**Commits Analyzed:** 75 commits (two-snapshot comparison)
|
|
441
|
+
**Auditor:** Claude Code (AI Assistant)
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
## Executive Summary
|
|
446
|
+
|
|
447
|
+
**Overall Verdict:** [SAFE / NEEDS FIXES / UNSAFE]
|
|
448
|
+
|
|
449
|
+
**Summary:**
|
|
450
|
+
- Files changed: X files
|
|
451
|
+
- Logic changes: Y files
|
|
452
|
+
- Critical issues found: Z issues
|
|
453
|
+
- UX improvements validated: N improvements
|
|
454
|
+
|
|
455
|
+
**Recommendation:** [Proceed to UAT / Fix regressions first / Rollback required]
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## Phase 1: Change Inventory
|
|
460
|
+
|
|
461
|
+
[Insert Phase 1 output here]
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Phase 2: Critical Path Analysis
|
|
466
|
+
|
|
467
|
+
[Insert Phase 2 output here]
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## Phase 3: Behavioral Comparison Testing
|
|
472
|
+
|
|
473
|
+
[Insert Phase 3 output here]
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
## Phase 4: Logic Diff Analysis
|
|
478
|
+
|
|
479
|
+
[Insert Phase 4 output here]
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## Phase 5: High-Risk Spot Check
|
|
484
|
+
|
|
485
|
+
[Insert Phase 5 output here]
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## Critical Issues Found 🔴
|
|
490
|
+
|
|
491
|
+
### Issue 1: [Title]
|
|
492
|
+
- **File:** `lib/path/to/file.rb`
|
|
493
|
+
- **Lines:** X-Y
|
|
494
|
+
- **Problem:** [Description]
|
|
495
|
+
- **Impact:** [What breaks]
|
|
496
|
+
- **Evidence:** [Behavioral test result or code snippet]
|
|
497
|
+
- **Fix Required:** [What needs to change]
|
|
498
|
+
- **Priority:** Critical
|
|
499
|
+
|
|
500
|
+
### Issue 2: [Title]
|
|
501
|
+
[Same format...]
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## Moderate Issues Found 🟡
|
|
506
|
+
|
|
507
|
+
[Similar format for medium-priority issues]
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## Acceptable Changes Validated ✅
|
|
512
|
+
|
|
513
|
+
### UX Improvements Confirmed Safe:
|
|
514
|
+
- Help text improvements in X files
|
|
515
|
+
- Table formatting enhancements
|
|
516
|
+
- Error message improvements
|
|
517
|
+
- New --detailed flag functionality
|
|
518
|
+
|
|
519
|
+
### Refactorings Confirmed Safe:
|
|
520
|
+
- Method extractions in Y files
|
|
521
|
+
- Code organization improvements
|
|
522
|
+
- No logic changes detected
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## Test Results Summary
|
|
527
|
+
|
|
528
|
+
**Behavioral tests run:** X commands tested
|
|
529
|
+
|
|
530
|
+
| Test Category | Tests Run | Passed | Failed |
|
|
531
|
+
|---------------|-----------|--------|--------|
|
|
532
|
+
| Brand listing | 5 | 5 | 0 |
|
|
533
|
+
| Project listing | 8 | 7 | 1 |
|
|
534
|
+
| S3 operations | 4 | 4 | 0 |
|
|
535
|
+
| Git operations | 3 | 3 | 0 |
|
|
536
|
+
| Error handling | 4 | 4 | 0 |
|
|
537
|
+
| **Total** | **24** | **23** | **1** |
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## Action Items
|
|
542
|
+
|
|
543
|
+
### High Priority (Must Fix Before UAT)
|
|
544
|
+
1. [ ] Fix [Issue 1] in `file.rb:X`
|
|
545
|
+
2. [ ] Fix [Issue 2] in `file.rb:Y`
|
|
546
|
+
|
|
547
|
+
### Medium Priority (Should Fix)
|
|
548
|
+
1. [ ] Address [Issue 3]
|
|
549
|
+
2. [ ] Review [Issue 4]
|
|
550
|
+
|
|
551
|
+
### Low Priority (Future Improvement)
|
|
552
|
+
1. [ ] Consider [Observation 1]
|
|
553
|
+
|
|
554
|
+
---
|
|
555
|
+
|
|
556
|
+
## Next Steps
|
|
557
|
+
|
|
558
|
+
**If SAFE verdict:**
|
|
559
|
+
1. ✅ Proceed to UAT testing (docs/code-quality/uat-plan-2025-01-22.md)
|
|
560
|
+
2. Run comprehensive 20-test UAT suite
|
|
561
|
+
3. Validate all functionality before release
|
|
562
|
+
|
|
563
|
+
**If NEEDS FIXES verdict:**
|
|
564
|
+
1. ⚠️ Address critical issues first
|
|
565
|
+
2. Re-run behavioral comparison tests
|
|
566
|
+
3. Verify fixes, then proceed to UAT
|
|
567
|
+
|
|
568
|
+
**If UNSAFE verdict:**
|
|
569
|
+
1. 🔴 Do NOT proceed to UAT
|
|
570
|
+
2. Consider rollback to `9e49668`
|
|
571
|
+
3. Fix critical regressions
|
|
572
|
+
4. Re-run full audit
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## Appendix: Test Artifacts
|
|
577
|
+
|
|
578
|
+
**Location:** `/tmp/behavioral-audit/`
|
|
579
|
+
|
|
580
|
+
**Files:**
|
|
581
|
+
- `baseline-*.txt` - Output from commands at commit `9e49668`
|
|
582
|
+
- `current-*.txt` - Output from commands at commit `4228b51`
|
|
583
|
+
- `*-changes.txt` - Logic diff extracts
|
|
584
|
+
- `baseline-file.rb` / `current-file.rb` - File comparisons
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
**Audit completed:** [Timestamp]
|
|
589
|
+
**Report generated by:** Claude Code v4.5
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
---
|
|
593
|
+
|
|
594
|
+
## Success Criteria
|
|
595
|
+
|
|
596
|
+
### SAFE Verdict Requirements:
|
|
597
|
+
- ✅ All critical operations produce identical results (ignoring formatting)
|
|
598
|
+
- ✅ No logic regressions detected
|
|
599
|
+
- ✅ All shortcuts and edge cases work identically
|
|
600
|
+
- ✅ All high-risk areas verified safe
|
|
601
|
+
- ✅ UX improvements validated as non-breaking
|
|
602
|
+
|
|
603
|
+
### NEEDS FIXES Verdict:
|
|
604
|
+
- ⚠️ Minor logic issues found but fixable
|
|
605
|
+
- ⚠️ Behavioral differences found but understood
|
|
606
|
+
- ⚠️ Some tests failed but fixes are straightforward
|
|
607
|
+
|
|
608
|
+
### UNSAFE Verdict:
|
|
609
|
+
- 🔴 Critical functionality broken
|
|
610
|
+
- 🔴 Data corruption or loss possible
|
|
611
|
+
- 🔴 Multiple regressions across core features
|
|
612
|
+
- 🔴 Fixes would require major refactoring
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
## Tips for Effective Audit
|
|
617
|
+
|
|
618
|
+
1. **Start with automated tests (Phase 3)** - Quick win, catches obvious breaks
|
|
619
|
+
2. **Use git diff strategically** - Focus on lib/ first, then bin/, then spec/
|
|
620
|
+
3. **Trust but verify** - UX changes are expected, but check they didn't hide logic changes
|
|
621
|
+
4. **Look for patterns** - If one brand resolution broke, check all brand resolution code
|
|
622
|
+
5. **Document evidence** - Include actual command outputs and code snippets in report
|
|
623
|
+
6. **Be thorough but pragmatic** - Not every whitespace change needs analysis
|
|
624
|
+
7. **Focus on user impact** - Does the DAM CLI still work for its intended purpose?
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
## How to Start (For Fresh Claude Code Session)
|
|
629
|
+
|
|
630
|
+
**Opening prompt:**
|
|
631
|
+
```
|
|
632
|
+
Read the behavioral regression audit instruction document at:
|
|
633
|
+
/Users/davidcruwys/dev/ad/appydave-tools/docs/ai-instructions/behavioral-regression-audit.md
|
|
634
|
+
|
|
635
|
+
Execute the 5-phase audit process to verify that commit 4228b51 behaves
|
|
636
|
+
identically to commit 9e49668 except for intentional UX improvements.
|
|
637
|
+
|
|
638
|
+
Start with Phase 1: Change Inventory.
|
|
639
|
+
|
|
640
|
+
Wait for my "1" or "continue" confirmation before proceeding to each next phase.
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
**Interactive execution:**
|
|
644
|
+
- Complete Phase 1, show results, wait for confirmation
|
|
645
|
+
- Complete Phase 2, show results, wait for confirmation
|
|
646
|
+
- Complete Phase 3, show results, wait for confirmation
|
|
647
|
+
- Complete Phase 4, show results, wait for confirmation
|
|
648
|
+
- Complete Phase 5, show results, wait for confirmation
|
|
649
|
+
- Generate final report
|
|
650
|
+
|
|
651
|
+
**User can:**
|
|
652
|
+
- Type "1" to proceed to next phase
|
|
653
|
+
- Provide feedback or corrections
|
|
654
|
+
- Request deeper analysis of specific areas
|
|
655
|
+
- Stop at any phase if critical issues found
|
|
656
|
+
|
|
657
|
+
---
|
|
658
|
+
|
|
659
|
+
**Last updated:** 2025-01-22
|