# WDMaker Verification Checklist

Complete verification procedures for batch 001 and batch 010 completion.

---

## Pre-Execution Verification

### Registry Integrity Check

```bash
# Verify registry file exists
[ -f .smbatcher/REGISTRY.md ] && echo "✓ Registry exists" || echo "✗ Registry missing"

# Check registry is readable
head -20 .smbatcher/REGISTRY.md | grep -q "Domain" && echo "✓ Registry readable" || echo "✗ Registry corrupted"

# Count total lines (should be 572 data + header + notes)
wc -l .smbatcher/REGISTRY.md
# Expected: ~575+ lines
```

### Batch Metadata Check

```bash
# Verify batch files exist
ls -la .smbatcher/batches/Batch_001.md
# Should exist and be readable

# Check batch 001 is locked for implementation
grep -q "batch 001" .smbatcher/REGISTRY.md && echo "✓ Batch 001 registered"
```

### Site Directory Structure

```bash
# Count site directories
ls -d sites/*-v1/ | wc -l
# Expected: 572 (all batch 001 sites)

# Sample site directory check
ls -la sites/haroo.day-v1/
# Expected: Contains DESIGN.md, index.html, styles.css, script.js
```

---

## Batch 001 Completion Verification

### Phase 1: Deployment Verification

```bash
# Check wave deployment status
# All 6 waves should show as deployed
echo "Wave 4: a4caded8a8771a7ab"
echo "Wave 5: a5643b20e80c2c91b"
echo "Wave 6: a9d8b38a8433c0a8f"
echo "Wave 7: a34ef6e32a5c2f352"
echo "Wave 8: a6e8574e7fffdd60c"
echo "Wave 9: a4429670ffd0e7fe2"
```

### Phase 2: Implementation Progress Verification

**Check periodically during execution**:

```bash
# Current I-status count
CURRENT_I=$(tools/shared/list-sites.sh --batch 001 --status "I" | wc -l)
echo "Sites at I status: $CURRENT_I / 572"

# Current O-status count (should decrease as agents execute)
CURRENT_O=$(tools/shared/list-sites.sh --batch 001 --status "O" | wc -l)
echo "Sites at O status: $CURRENT_O (should decrease)"

# Current i-status count (in progress)
CURRENT_i=$(tools/shared/list-sites.sh --batch 001 --status "i" | wc -l)
echo "Sites at i status: $CURRENT_i (should decrease)"
```

### Phase 3: File Generation Verification

**Sample verification across domains**:

```bash
# Check file generation for sample sites
for domain in haroo.day jeongchi.boo historical.quest; do
  echo "=== $domain ==="
  [ -f "sites/${domain}-v1/index.html" ] && echo "✓ index.html" || echo "✗ index.html missing"
  [ -f "sites/${domain}-v1/styles.css" ] && echo "✓ styles.css" || echo "✗ styles.css missing"
  [ -f "sites/${domain}-v1/script.js" ] && echo "✓ script.js" || echo "✗ script.js missing"
  [ -f "sites/${domain}-v1/DESIGN.md" ] && echo "✓ DESIGN.md" || echo "✗ DESIGN.md missing"
done
```

### Phase 4: Design Compliance Verification

```bash
# Run design compliance check on sample sites
tools/check/design-compliance.sh --domain haroo.day
tools/check/design-compliance.sh --domain jeongchi.boo
# Expected: PASS for all color and font validations
```

### Phase 5: Pre-Finalization Readiness Check

**Execute when 572 I-status expected**:

```bash
# Count I-status sites (should be 572)
I_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "I" | wc -l)
echo "I-status sites: $I_COUNT"
[ "$I_COUNT" -eq 572 ] && echo "✓ READY FOR FINALIZATION" || echo "✗ NOT READY (missing $(( 572 - I_COUNT )) sites)"

# Count remaining O or i status sites
O_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "O" | wc -l)
i_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "i" | wc -l)
REMAINING=$(( O_COUNT + i_COUNT ))
echo "Remaining unfinished: $REMAINING sites"

# List any stuck sites (for troubleshooting)
if [ $REMAINING -gt 0 ]; then
  echo "Stuck sites:"
  tools/shared/list-sites.sh --batch 001 --status "O"
  tools/shared/list-sites.sh --batch 001 --status "i"
fi
```

---

## Batch 001 Finalization Verification

### Pre-Finalization Confirmation

```bash
# Final check before running finish.sh
echo "=== PRE-FINALIZATION CHECK ==="

# Count I-status (must be 572)
I_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "I" | wc -l)
echo "I-status sites: $I_COUNT / 572"

# Verify no Q-status sites yet (finalization hasn't run)
Q_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "Q" | wc -l)
echo "Q-status sites: $Q_COUNT / 0 (expected)"

# Verify batch file exists
[ -f .smbatcher/batches/Batch_001.md ] && echo "✓ Batch file exists"

# Verify registry is writable
touch .smbatcher/REGISTRY.md.test && rm .smbatcher/REGISTRY.md.test && echo "✓ Registry writable"

# If all checks pass, proceed with finalization
if [ "$I_COUNT" -eq 572 ]; then
  echo "✅ READY FOR FINALIZATION"
else
  echo "❌ NOT READY - missing $((572 - I_COUNT)) sites"
  exit 1
fi
```

### Execute Finalization

```bash
# Run the finalization command
tools/implement/finish.sh --batch 001 --root .

# Expected output:
# Processing batch 001...
# Transitioning 572 sites from I → Q...
# Updating registry...
# Batch 001 finalization complete.
```

### Post-Finalization Verification

```bash
echo "=== POST-FINALIZATION CHECK ==="

# Count Q-status (must be 572)
Q_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "Q" | wc -l)
echo "Q-status sites: $Q_COUNT / 572"

# Verify no remaining I-status sites
I_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "I" | wc -l)
echo "Remaining I-status: $I_COUNT / 0 (expected)"

# Verify no remaining O or i status sites
O_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "O" | wc -l)
i_COUNT=$(tools/shared/list-sites.sh --batch 001 --status "i" | wc -l)
echo "Remaining O status: $O_COUNT / 0 (expected)"
echo "Remaining i status: $i_COUNT / 0 (expected)"

# If all Q and none remaining, finalization successful
if [ "$Q_COUNT" -eq 572 ] && [ "$I_COUNT" -eq 0 ]; then
  echo "✅ BATCH 001 FINALIZATION SUCCESSFUL"
else
  echo "❌ FINALIZATION INCOMPLETE"
  exit 1
fi

# Sample verification: Check registry contains Q-status entries
grep -c "| Q " .smbatcher/REGISTRY.md
# Expected: At least 572 (plus any pre-existing Q from batches 002-009)
```

---

## Batch 010 Workflow Verification

### Batch Creation Verification

```bash
echo "=== BATCH 010 CREATION ==="

# Verify site is still unassigned before creation
grep "20241204.com" .smbatcher/REGISTRY.md | grep "| - "
echo "✓ 20241204.com is unassigned (status: -)"

# After batch creation:
# Verify batch 010 file created
[ -f .smbatcher/batches/Batch_010.md ] && echo "✓ Batch 010 created"

# Verify site assigned to batch 010
grep "20241204.com" .smbatcher/REGISTRY.md | grep "batch 010"
echo "✓ 20241204.com assigned to batch 010"

# Verify site directory created
[ -d sites/20241204.com-v1/ ] && echo "✓ Site directory created"

# Verify site status is B (batched)
grep "20241204.com" .smbatcher/REGISTRY.md | grep "| B "
echo "✓ Site status: B (batched)"
```

### Design Phase Verification

```bash
echo "=== BATCH 010 DESIGN PHASE ==="

# After design phase:
# Verify DESIGN.md exists
[ -f sites/20241204.com-v1/DESIGN.md ] && echo "✓ DESIGN.md generated"

# Verify design file is non-empty
[ -s sites/20241204.com-v1/DESIGN.md ] && echo "✓ DESIGN.md has content"

# Run design compliance check
tools/check/design-compliance.sh --domain 20241204.com
# Expected: PASS color and font checks

# Verify registry status updated to D
grep "20241204.com" .smbatcher/REGISTRY.md | grep "| D "
echo "✓ Site status: D (design complete)"
```

### Implementation Phase Verification

```bash
echo "=== BATCH 010 IMPLEMENTATION PHASE ==="

# After implementation phase:
# Verify all files generated
[ -f sites/20241204.com-v1/index.html ] && echo "✓ index.html"
[ -f sites/20241204.com-v1/styles.css ] && echo "✓ styles.css"
[ -f sites/20241204.com-v1/script.js ] && echo "✓ script.js"

# Verify file sizes are reasonable (not empty/stub)
[ -s sites/20241204.com-v1/index.html ] && echo "✓ index.html has content"
[ -s sites/20241204.com-v1/styles.css ] && echo "✓ styles.css has content"
[ -s sites/20241204.com-v1/script.js ] && echo "✓ script.js has content"

# Verify HTML syntax
tools/check/verify-site.sh --domain 20241204.com
# Expected: PASS

# Verify CSS syntax
grep -q "^body" sites/20241204.com-v1/styles.css && echo "✓ CSS valid"

# Verify JavaScript syntax
node -c sites/20241204.com-v1/script.js && echo "✓ JavaScript valid"

# Verify registry status updated to O
grep "20241204.com" .smbatcher/REGISTRY.md | grep "| O "
echo "✓ Site status: O (ready for implementation)"

# After complete.sh execution:
# Verify status updated to I
grep "20241204.com" .smbatcher/REGISTRY.md | grep "| I "
echo "✓ Site status: I (implementation complete)"
```

### Batch 010 Finalization Verification

```bash
echo "=== BATCH 010 FINALIZATION ==="

# Pre-finalization
I_COUNT=$(tools/shared/list-sites.sh --batch 010 --status "I" | wc -l)
echo "I-status sites: $I_COUNT / 1"

# Run finalization
tools/implement/finish.sh --batch 010 --root .

# Post-finalization
Q_COUNT=$(tools/shared/list-sites.sh --batch 010 --status "Q" | wc -l)
echo "Q-status sites: $Q_COUNT / 1"

# Verify status updated to Q
grep "20241204.com" .smbatcher/REGISTRY.md | grep "| Q "
echo "✓ Site status: Q (finalized)"

if [ "$Q_COUNT" -eq 1 ]; then
  echo "✅ BATCH 010 FINALIZATION SUCCESSFUL"
else
  echo "❌ BATCH 010 FINALIZATION INCOMPLETE"
fi
```

---

## Final System Verification

### Overall Completion Check

```bash
echo "=== FINAL SYSTEM STATE ==="

# Total Q-status sites (should be ~568: 567 from 001-009 + 1 from 010)
TOTAL_Q=$(tools/shared/list-sites.sh --status "Q" | wc -l)
echo "Total finalized sites: $TOTAL_Q / 568"

# Total I-status sites (should be 0 if all finalized)
TOTAL_I=$(tools/shared/list-sites.sh --status "I" | wc -l)
echo "Remaining I-status: $TOTAL_I / 0"

# Total O-status sites (should be ~2 if any unaccounted)
TOTAL_O=$(tools/shared/list-sites.sh --status "O" | wc -l)
echo "Remaining O-status: $TOTAL_O / 0-2"

# Total i-status sites (should be 0)
TOTAL_i=$(tools/shared/list-sites.sh --status "i" | wc -l)
echo "Remaining i-status: $TOTAL_i / 0"

# Unassigned sites (should be 0)
TOTAL_MINUS=$(tools/shared/list-sites.sh --status "-" | wc -l)
echo "Unassigned (-status): $TOTAL_MINUS / 0"

# Run comprehensive status report
echo ""
echo "=== COMPREHENSIVE STATUS REPORT ==="
tools/check/status-report.sh

# Completion percentage
COMPLETION=$((TOTAL_Q * 100 / 570))
echo ""
echo "Overall Completion: $COMPLETION % ($TOTAL_Q / 570)"

if [ $COMPLETION -ge 99 ]; then
  echo "✅ PROJECT COMPLETE"
else
  echo "⚠️  Project incomplete - review status report"
fi
```

### Batch Summary

```bash
echo "=== BATCH SUMMARY ==="

# List all batches
ls -la .smbatcher/batches/

# Summary per batch
for batch_file in .smbatcher/batches/Batch_*.md; do
  BATCH=$(basename $batch_file | sed 's/Batch_//;s/.md//')
  Q=$(grep -c "batch $BATCH.*| Q " .smbatcher/REGISTRY.md || echo "0")
  I=$(grep -c "batch $BATCH.*| I " .smbatcher/REGISTRY.md || echo "0")
  i=$(grep -c "batch $BATCH.*| i " .smbatcher/REGISTRY.md || echo "0")
  O=$(grep -c "batch $BATCH.*| O " .smbatcher/REGISTRY.md || echo "0")
  echo "Batch $BATCH: Q=$Q, I=$I, i=$i, O=$O"
done
```

---

## Troubleshooting Verification

### If Finalization Appears to Fail

```bash
# Check for error messages in registry
tail -50 .smbatcher/REGISTRY.md | grep -i error

# Verify finish.sh script exists and is executable
[ -x tools/implement/finish.sh ] && echo "✓ finish.sh exists"

# Check if any sites are in a "stuck" state
echo "Stuck sites:"
tools/shared/list-sites.sh --batch 001 | grep -E "| [Oio] "

# Retry finalization
tools/implement/finish.sh --batch 001 --root . 2>&1 | tail -20
```

### If Site Files Are Missing

```bash
# Check which sites are missing files
for domain in $(tools/shared/list-sites.sh --batch 001 --status "I"); do
  [ -f "sites/${domain}-v1/index.html" ] || echo "Missing: ${domain}/index.html"
  [ -f "sites/${domain}-v1/styles.css" ] || echo "Missing: ${domain}/styles.css"
  [ -f "sites/${domain}-v1/script.js" ] || echo "Missing: ${domain}/script.js"
done
```

---

## Success Criteria

| Criterion | Expected | Verification Command |
|-----------|----------|----------------------|
| Batch 001 I-status | 572 | `tools/shared/list-sites.sh --batch 001 --status "I" \| wc -l` |
| Batch 001 Q-status | 572 | `tools/shared/list-sites.sh --batch 001 --status "Q" \| wc -l` |
| Batch 010 Q-status | 1 | `tools/shared/list-sites.sh --batch 010 --status "Q" \| wc -l` |
| Total Q-status | 568+ | `tools/shared/list-sites.sh --status "Q" \| wc -l` |
| No remaining I | 0 | `tools/shared/list-sites.sh --status "I" \| wc -l` |
| No remaining O | 0-2 | `tools/shared/list-sites.sh --status "O" \| wc -l` |
| No remaining i | 0 | `tools/shared/list-sites.sh --status "i" \| wc -l` |
| Completion Rate | 99.6% | (Total Q / 570) * 100 |

---

**Last Updated**: 2026-03-23
**Status**: Ready for deployment verification
**Use**: Execute these checks at each phase for comprehensive validation

