Skip to Content

Developer Handoff - Comprehensive Backup/Restore System

Developer Handoff - Comprehensive Backup/Restore System

WITH MANDATORY VERIFICATION PROTOCOL

Created: 2025-10-16
Assigned To: /developer agent (WHEN DELEGATED)
Estimated Time: 5-6 days (40 hours)
Priority: 🔴 CRITICAL - User requires 100% accuracy


🚨 CRITICAL: Read This First

This is NOT a "do your best" project. This is a "100% or nothing" project.

Why:
- User has 51,002 messages (134K chars each)
- User has 560 attachments (119 MB)
- User has 229 conversations (irreplaceable data)
- If you screw this up, user loses EVERYTHING

Requirements:
1. You MUST test every feature you build
2. You MUST provide evidence of testing (not just "I tested it")
3. You MUST verify edge cases (not assume they work)
4. You MUST reach 100% completion (not 75%)

If you cannot reach 100%: STOP and ask for help. Do NOT deliver partial work.


📋 The "100% Rule"

Every task has 3 parts:

Part 1: Implementation (Write Code)

Write the code according to spec.

Part 2: Verification (Prove It Works)

Test the code and provide EVIDENCE (screenshots, command output, logs).

Part 3: Certification (Sign Off)

You must literally type: "✅ VERIFIED: [Task Name] - 100% Complete"

Example:

### Task: Export Database

#### Part 1: Implementation
✅ Created `action_export_complete_backup()` method
✅ Integrated pg_dump call
✅ Added error handling

#### Part 2: Verification
I tested this and here is the EVIDENCE:

**Test 1: Export ai_automator_db**

$ pg_dump -U odoo_user -d ai_automator_db -f backup.sql
[... output showing success ...]
File created: backup.sql (107 MB)
Time: 1 min 43 sec

**Test 2: Verify File Size**

$ ls -lh backup.sql
-rw-r--r-- 1 user user 107M Jan 16 14:30 backup.sql
✅ Matches estimate (100-150 MB)

**Test 3: Verify Data Integrity**

$ psql -U odoo_user -d ai_automator_db -c "SELECT COUNT(*) FROM ai_message;"
count


51002
✅ All 51,002 messages will be backed up

#### Part 3: Certification
✅ VERIFIED: Export Database - 100% Complete

Evidence provided:
- Export successful (pg_dump output)
- File size verified (107 MB)
- Data count verified (51,002 messages)
- Export time measured (1:43)

If you skip Part 2 or Part 3: Your work will be rejected.


📊 100% Verified Data (Your Baseline)

DO NOT ASSUME. These are VERIFIED facts from CTO review:

Metric Value Source
Database Name ai_automator_db ✅ Connected & verified
Database Size 107 MB ✅ Measured via PostgreSQL
Conversations 229 ✅ SELECT COUNT(*)
Messages 51,002 ✅ SELECT COUNT(*)
Longest Message 134,409 characters ✅ MAX(LENGTH(content))
Canvas Workflows 14 ✅ SELECT COUNT(*)
Filestore Location C:\Program Files\Odoo 18\sessions\filestore\ai_automator_db ✅ Found on disk
Filestore Files 560 files ✅ Counted on disk
Filestore Size 119.11 MB ✅ Measured on disk
ChromaDB Location C:\Working With AI\ai_sam\ai_sam\chroma_data ✅ Found on disk
ChromaDB Size 94.1 MB ✅ Measured on disk
PostgreSQL Version 15.14 ✅ psql --version
pg_dump Path C:\Program Files\PostgreSQL\15\bin\pg_dump.exe ✅ NOT in PATH, must use full path

If your tests show different numbers: STOP and investigate. Don't proceed with wrong assumptions.


🎯 Phase-by-Phase Implementation with Verification


PHASE 0: Infrastructure Setup ⚙️

Goal: Verify all tools and paths work BEFORE writing any code.

Task 0.1: Verify PostgreSQL Tools

Implementation:

Run these commands and verify they work:

# Test pg_dump (full path required)
"C:\Program Files\PostgreSQL\15\bin\pg_dump.exe" --version

# Test database connection
"C:\Program Files\PostgreSQL\15\bin\psql.exe" -U odoo_user -d ai_automator_db -c "SELECT current_database();"

# Test pg_dump export
"C:\Program Files\PostgreSQL\15\bin\pg_dump.exe" -U odoo_user -d ai_automator_db -f C:\temp\test.sql

Verification Checklist:

  • [ ] pg_dump version shows: pg_dump (PostgreSQL) 15.14
  • [ ] Database connection succeeds
  • [ ] Test export creates file: C:\temp\test.sql
  • [ ] File size is ~100-150 MB
  • [ ] No errors in output

Evidence Required:

Paste command output here showing:
1. pg_dump version
2. Database connection success
3. File created with size
4. Export time

Certification:

✅ VERIFIED: PostgreSQL Tools - 100% Complete

Task 0.2: Verify Filestore Access

Implementation:

Find and verify filestore directory:

# Check filestore exists
dir "C:\Program Files\Odoo 18\sessions\filestore\ai_automator_db"

# Count files
powershell -Command "(Get-ChildItem -Path 'C:\Program Files\Odoo 18\sessions\filestore\ai_automator_db' -Recurse -File).Count"

# Measure size
powershell -Command "(Get-ChildItem -Path 'C:\Program Files\Odoo 18\sessions\filestore\ai_automator_db' -Recurse -File | Measure-Object -Property Length -Sum).Sum / 1MB"

Verification Checklist:

  • [ ] Directory exists
  • [ ] File count matches: 560 files
  • [ ] Size matches: ~119 MB
  • [ ] Read access confirmed

Evidence Required:

Paste command output showing:
1. Directory listing
2. File count (should be 560)
3. Size in MB (should be ~119 MB)

Certification:

✅ VERIFIED: Filestore Access - 100% Complete

Task 0.3: Verify ChromaDB Access

Implementation:

Find and verify ChromaDB directory:

# Check ChromaDB exists
dir "C:\Working With AI\ai_sam\ai_sam\chroma_data"

# Measure size
powershell -Command "(Get-ChildItem -Path 'C:\Working With AI\ai_sam\ai_sam\chroma_data' -Recurse -File | Measure-Object -Property Length -Sum).Sum / 1MB"

Verification Checklist:

  • [ ] Directory exists
  • [ ] Contains chroma.sqlite3
  • [ ] Size matches: ~94 MB
  • [ ] Read access confirmed

Evidence Required:

Paste command output showing:
1. Directory listing
2. Size in MB (should be ~94 MB)

Certification:

✅ VERIFIED: ChromaDB Access - 100% Complete

PHASE 1: Export System 📥

Goal: Create complete backup export that includes ALL data.


Task 1.1: Create Backup Confirmation Model

Implementation:

Create ai_brain/models/ai_backup_confirmation.py (see UNINSTALL_PROTECTION_SYSTEM_SPEC.md for full code).

Key fields:
- backup_date (datetime)
- backup_filename (char)
- backup_size_mb (float)
- conversation_count, message_count, workflow_count, attachment_count (integers)
- is_valid (computed, True if < 24 hours old)

Verification Checklist:

  • [ ] Model file created
  • [ ] Added to __init__.py
  • [ ] Added to ir.model.access.csv
  • [ ] Model installs without errors
  • [ ] Can create record via shell

Evidence Required:

# Test in Odoo shell:
confirmation = env['ai.backup.confirmation'].create({
    'backup_filename': 'test.zip',
    'backup_size_mb': 250.5,
    'conversation_count': 229,
    'message_count': 51002,
})
print(f"Created: {confirmation.id}")
print(f"Is valid: {confirmation.is_valid}")  # Should be True

Paste shell output here.

Certification:

✅ VERIFIED: Backup Confirmation Model - 100% Complete

Task 1.2: Implement Database Export

Implementation:

Modify ai_brain/models/ai_memory_config.py to add action_export_complete_backup().

Method must:
1. Use FULL PATH to pg_dump: C:\Program Files\PostgreSQL\15\bin\pg_dump.exe
2. Export database: ai_automator_db
3. Save to temp directory
4. Return SQL file path

Code Template:

def action_export_complete_backup(self):
    """Export complete SAM AI backup"""
    import subprocess
    import tempfile
    import os

    # Create temp directory
    temp_dir = tempfile.mkdtemp(prefix='sam_backup_')

    # Export database
    db_name = self.env.cr.dbname  # Should be 'ai_automator_db'
    sql_path = os.path.join(temp_dir, f'{db_name}.sql')

    cmd = [
        r'C:\Program Files\PostgreSQL\15\bin\pg_dump.exe',  # FULL PATH
        '-U', 'odoo_user',
        '-d', db_name,
        '-f', sql_path,
    ]

    result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)

    if result.returncode != 0:
        raise Exception(f"pg_dump failed: {result.stderr}")

    # Return SQL file path
    return sql_path

Verification Checklist:

  • [ ] Method created
  • [ ] Uses FULL PATH to pg_dump (not just pg_dump)
  • [ ] Exports to temp directory
  • [ ] Handles errors (non-zero return code)
  • [ ] Test export succeeds

Evidence Required:

# Test in Odoo shell:
config = env['ai.memory.config'].search([], limit=1)
sql_path = config.action_export_complete_backup()
print(f"SQL exported to: {sql_path}")
print(f"File size: {os.path.getsize(sql_path) / 1024 / 1024:.2f} MB")
print(f"File exists: {os.path.exists(sql_path)}")

# Verify export time
import time
start = time.time()
sql_path = config.action_export_complete_backup()
elapsed = time.time() - start
print(f"Export time: {elapsed:.2f} seconds")  # Should be < 120 seconds

Paste shell output showing:
1. SQL file path
2. File size (~107 MB)
3. Export time (< 2 minutes)

Certification:

✅ VERIFIED: Database Export - 100% Complete

Task 1.3: Implement Filestore Export

Implementation:

Add method to copy filestore directory to temp location and ZIP it.

Code Template:

def _export_filestore(self, temp_dir):
    """Copy filestore to temp directory and zip it"""
    import shutil
    import os

    filestore_source = r'C:\Program Files\Odoo 18\sessions\filestore\ai_automator_db'
    filestore_zip = os.path.join(temp_dir, 'filestore.zip')

    # Create zip of filestore
    shutil.make_archive(
        filestore_zip.replace('.zip', ''),  # base name
        'zip',
        filestore_source
    )

    return filestore_zip

Verification Checklist:

  • [ ] Method created
  • [ ] Uses CORRECT filestore path (verified in Phase 0)
  • [ ] Creates ZIP file
  • [ ] ZIP contains 560 files
  • [ ] ZIP size is ~119 MB

Evidence Required:

# Test in Odoo shell:
config = env['ai.memory.config'].search([], limit=1)
temp_dir = tempfile.mkdtemp()
zip_path = config._export_filestore(temp_dir)
print(f"Filestore ZIP: {zip_path}")
print(f"ZIP size: {os.path.getsize(zip_path) / 1024 / 1024:.2f} MB")
print(f"ZIP exists: {os.path.exists(zip_path)}")

# Verify ZIP contents
import zipfile
with zipfile.ZipFile(zip_path, 'r') as z:
    print(f"Files in ZIP: {len(z.namelist())}")  # Should be 560

Paste output showing:
1. ZIP created
2. ZIP size (~119 MB)
3. File count (560 files)

Certification:

✅ VERIFIED: Filestore Export - 100% Complete

Task 1.4: Implement ChromaDB Export

Implementation:

Add method to copy ChromaDB directory and ZIP it.

Verification Checklist:

  • [ ] Method created
  • [ ] Uses CORRECT ChromaDB path: C:\Working With AI\ai_sam\ai_sam\chroma_data
  • [ ] Creates ZIP file
  • [ ] ZIP size is ~94 MB

Evidence Required:

# Test similar to filestore export
# Paste output showing ZIP created with correct size

Certification:

✅ VERIFIED: ChromaDB Export - 100% Complete

Task 1.5: Implement Final ZIP Bundle

Implementation:

Combine all exports into single encrypted ZIP file.

Requirements:
1. Create directory structure:
sam_ai_backup_YYYYMMDD_HHMMSS.zip ├── metadata.json ├── odoo_data/ │ └── ai_automator_db.sql ├── filestore/ │ └── filestore.zip └── chroma_data/ └── chroma_data.zip
2. Encrypt ZIP with password (use pyminizip or zipfile with encryption)
3. Create metadata.json with counts, checksums, versions
4. Create backup confirmation record

Verification Checklist:

  • [ ] Final ZIP created
  • [ ] ZIP is password-protected
  • [ ] Directory structure matches spec
  • [ ] metadata.json includes ALL required fields
  • [ ] Backup confirmation record created
  • [ ] ZIP size is ~250-300 MB
  • [ ] Download works via Odoo attachment

Evidence Required:

# Full export test:
config = env['ai.memory.config'].search([], limit=1)
result = config.action_export_complete_backup()
print(f"Backup created: {result}")

# Verify backup confirmation
confirmation = env['ai.backup.confirmation'].search([], order='id desc', limit=1)
print(f"Confirmation ID: {confirmation.id}")
print(f"Filename: {confirmation.backup_filename}")
print(f"Size: {confirmation.backup_size_mb} MB")
print(f"Conversations: {confirmation.conversation_count}")  # Should be 229
print(f"Messages: {confirmation.message_count}")  # Should be 51002
print(f"Is valid: {confirmation.is_valid}")  # Should be True

# Try to download
# (Paste screenshot of download working)

Paste output + screenshot.

Certification:

✅ VERIFIED: Final ZIP Bundle - 100% Complete

PHASE 2: Import/Restore System 📤

Goal: Restore backup with 100% data fidelity.


Task 2.1: Implement Import Validation

Implementation:

Create method to validate uploaded backup:
1. Check ZIP is password-protected
2. Decrypt with user password
3. Validate metadata.json
4. Check version compatibility
5. Verify checksums

Verification Checklist:

  • [ ] Method created
  • [ ] Rejects invalid password
  • [ ] Validates metadata format
  • [ ] Checks Odoo version compatibility
  • [ ] Verifies file checksums

Evidence Required:

# Test with WRONG password
# (Should fail with clear error message)

# Test with CORRECT password
# (Should validate successfully)

# Paste outputs for both tests

Certification:

✅ VERIFIED: Import Validation - 100% Complete

Task 2.2: Implement Database Restore

Implementation:

Restore PostgreSQL database from SQL dump.

CRITICAL REQUIREMENTS:
1. Use psql (NOT pg_restore for SQL format)
2. Delete current data FIRST (or use separate test DB)
3. Restore SQL dump
4. Verify record counts MATCH original

Code Template:

def _restore_database(self, sql_path):
    """Restore database from SQL dump"""
    import subprocess

    db_name = self.env.cr.dbname

    cmd = [
        r'C:\Program Files\PostgreSQL\15\bin\psql.exe',
        '-U', 'odoo_user',
        '-d', db_name,
        '-f', sql_path,
    ]

    result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)

    if result.returncode != 0:
        raise Exception(f"psql restore failed: {result.stderr}")

    return True

Verification Checklist:

  • [ ] Method created
  • [ ] Uses FULL PATH to psql
  • [ ] Restores to test database FIRST
  • [ ] Verifies record counts match
  • [ ] Handles errors gracefully

CRITICAL TEST (MUST PASS):

# Create test database
# Restore backup to test database
# Verify counts:

test_db_cursor = ...  # Connect to test DB
test_db_cursor.execute("SELECT COUNT(*) FROM ai_conversation;")
conv_count = test_db_cursor.fetchone()[0]
print(f"Conversations: {conv_count}")  # MUST BE 229

test_db_cursor.execute("SELECT COUNT(*) FROM ai_message;")
msg_count = test_db_cursor.fetchone()[0]
print(f"Messages: {msg_count}")  # MUST BE 51,002

test_db_cursor.execute("SELECT MAX(LENGTH(content)) FROM ai_message;")
max_len = test_db_cursor.fetchone()[0]
print(f"Longest message: {max_len} chars")  # MUST BE 134,409

# All three MUST match original counts

Evidence Required:

Paste test output showing:
1. Restore succeeded
2. Record counts MATCH: 229 conversations, 51,002 messages
3. Longest message INTACT: 134,409 characters (NO TRUNCATION)

Certification:

✅ VERIFIED: Database Restore - 100% Complete
✅ DATA INTEGRITY: 100% (all counts match, no truncation)

Task 2.3: Implement Filestore Restore

Implementation:

Unzip filestore to correct location.

Verification Checklist:

  • [ ] Method created
  • [ ] Backs up existing filestore BEFORE restore
  • [ ] Unzips to correct location
  • [ ] Verifies file count matches (560 files)

Evidence Required:

# After restore, verify:
powershell -Command "(Get-ChildItem -Path 'C:\Program Files\Odoo 18\sessions\filestore\ai_automator_db' -Recurse -File).Count"
# Should be 560

Certification:

✅ VERIFIED: Filestore Restore - 100% Complete

Task 2.4: Implement ChromaDB Restore

Implementation:

Unzip ChromaDB to correct location.

Verification Checklist:

  • [ ] Method created
  • [ ] Backs up existing ChromaDB BEFORE restore
  • [ ] Unzips to correct location: C:\Working With AI\ai_sam\ai_sam\chroma_data
  • [ ] Verifies directory size matches (~94 MB)

Certification:

✅ VERIFIED: ChromaDB Restore - 100% Complete

PHASE 3: Uninstall Protection 🛡️

Goal: Block uninstall unless recent backup exists.

(See UNINSTALL_PROTECTION_SYSTEM_SPEC.md for full implementation)


Task 3.1: Create Uninstall Interceptor

Implementation:

Create ai_brain/models/ir_module_module.py to override button_immediate_uninstall().

Verification Checklist:

  • [ ] Model file created
  • [ ] Overrides button_immediate_uninstall()
  • [ ] Checks if ai_brain is being uninstalled
  • [ ] Checks if data exists
  • [ ] Checks if recent backup exists
  • [ ] BLOCKS uninstall if no backup

CRITICAL TEST (MUST PASS):

# Delete all backup confirmations
env['ai.backup.confirmation'].search([]).unlink()

# Try to uninstall ai_brain
module = env['ir.module.module'].search([('name', '=', 'ai_brain')])
try:
    module.button_immediate_uninstall()
    print("❌ FAIL: Uninstall should have been blocked!")
except Exception as e:
    print(f"✅ PASS: Uninstall blocked with message: {e}")
    # Error message should say "You MUST backup first!"

Evidence Required:

Paste test output showing uninstall was BLOCKED.

Certification:

✅ VERIFIED: Uninstall Interceptor - 100% Complete
✅ PROTECTION: Uninstall blocked without backup

Task 3.2: Create Final Confirmation Wizard

Implementation:

Create ai_brain/models/ai_brain_uninstall_final_wizard.py (see spec for full code).

Verification Checklist:

  • [ ] Model file created
  • [ ] View XML created
  • [ ] Wizard shows backup details
  • [ ] Requires 3 checkboxes
  • [ ] Requires typed phrase "DELETE MY DATA"
  • [ ] Creates audit log on uninstall

CRITICAL TEST (MUST PASS):

# Create backup
config = env['ai.memory.config'].search([], limit=1)
config.action_export_complete_backup()

# Try to uninstall (should show wizard, not error)
module = env['ir.module.module'].search([('name', '=', 'ai_brain')])
result = module.button_immediate_uninstall()
print(f"Result type: {result['type']}")  # Should be 'ir.actions.act_window'
print(f"Wizard model: {result['res_model']}")  # Should be 'ai.brain.uninstall.final.wizard'

# Try to confirm without typing phrase
wizard = env['ai.brain.uninstall.final.wizard'].create({
    'understood_1': True,
    'understood_2': True,
    'understood_3': True,
    'confirmation_phrase': 'wrong phrase',
})
try:
    wizard.action_confirm_uninstall()
    print("❌ FAIL: Should have rejected wrong phrase")
except Exception as e:
    print(f"✅ PASS: Rejected wrong phrase: {e}")

Evidence Required:

Paste test outputs showing:
1. Wizard appears (not error)
2. Wrong phrase rejected
3. Correct phrase + checkboxes → uninstall proceeds

Certification:

✅ VERIFIED: Final Confirmation Wizard - 100% Complete
✅ PROTECTION: Typed confirmation required

FINAL VERIFICATION: Full Roundtrip Test 🔄

This is the ULTIMATE test. If this passes, system is 100% complete.

Test Scenario: Complete Backup → Delete → Restore → Verify

# STEP 1: Record current state
original_conv_count = env['ai.conversation'].search_count([])
original_msg_count = env['ai.message'].search_count([])
original_workflow_count = env['canvas'].search_count([])
original_max_msg_length = env.cr.execute("SELECT MAX(LENGTH(content)) FROM ai_message")
original_max_msg_length = env.cr.fetchone()[0]

print(f"Original state:")
print(f"  Conversations: {original_conv_count}")  # Should be 229
print(f"  Messages: {original_msg_count}")  # Should be 51,002
print(f"  Workflows: {original_workflow_count}")  # Should be 14
print(f"  Longest message: {original_max_msg_length} chars")  # Should be 134,409

# STEP 2: Create backup
config = env['ai.memory.config'].search([], limit=1)
backup_result = config.action_export_complete_backup()
print(f"✓ Backup created: {backup_result}")

# STEP 3: Delete ALL data (simulate disaster)
env['ai.conversation'].search([]).unlink()
env['canvas'].search([]).unlink()
# (Delete other data...)

deleted_conv_count = env['ai.conversation'].search_count([])
deleted_msg_count = env['ai.message'].search_count([])
print(f"After delete: {deleted_conv_count} conversations, {deleted_msg_count} messages")
# Should be 0, 0

# STEP 4: Restore from backup
wizard = env['ai.memory.import.wizard'].create({
    'backup_file': backup_result,  # Upload the backup
})
restore_result = wizard.action_import_backup()
print(f"✓ Restore complete: {restore_result}")

# STEP 5: Verify restored data MATCHES original
restored_conv_count = env['ai.conversation'].search_count([])
restored_msg_count = env['ai.message'].search_count([])
restored_workflow_count = env['canvas'].search_count([])
restored_max_msg_length = env.cr.execute("SELECT MAX(LENGTH(content)) FROM ai_message")
restored_max_msg_length = env.cr.fetchone()[0]

print(f"\nRestored state:")
print(f"  Conversations: {restored_conv_count}")
print(f"  Messages: {restored_msg_count}")
print(f"  Workflows: {restored_workflow_count}")
print(f"  Longest message: {restored_max_msg_length} chars")

# STEP 6: VERIFY 100% MATCH
assert original_conv_count == restored_conv_count, f"❌ Conversation count mismatch: {original_conv_count} → {restored_conv_count}"
assert original_msg_count == restored_msg_count, f"❌ Message count mismatch: {original_msg_count} → {restored_msg_count}"
assert original_workflow_count == restored_workflow_count, f"❌ Workflow count mismatch: {original_workflow_count} → {restored_workflow_count}"
assert original_max_msg_length == restored_max_msg_length, f"❌ Message length mismatch: {original_max_msg_length} → {restored_max_msg_length}"

print("\n✅ ✅ ✅ FULL ROUNDTRIP TEST PASSED ✅ ✅ ✅")
print("100% data fidelity confirmed")

Final Certification

✅ VERIFIED: Full Roundtrip Test - PASSED
✅ DATA INTEGRITY: 100%
  - 229 conversations restored (100%)
  - 51,002 messages restored (100%)
  - 14 workflows restored (100%)
  - Longest message: 134,409 chars (NO TRUNCATION)

✅ SYSTEM COMPLETE: 100%

🎯 Definition of "100% Complete"

System is 100% complete when:

Export System:

  • [ ] Creates encrypted ZIP with password
  • [ ] Includes database SQL dump (107 MB)
  • [ ] Includes filestore ZIP (119 MB, 560 files)
  • [ ] Includes ChromaDB ZIP (94 MB)
  • [ ] Includes metadata.json
  • [ ] Creates backup confirmation record
  • [ ] Export time < 5 minutes
  • [ ] Download works via Odoo

Import System:

  • [ ] Validates backup (password, checksum, version)
  • [ ] Restores database (100% record count match)
  • [ ] Restores filestore (560 files)
  • [ ] Restores ChromaDB (94 MB)
  • [ ] Import time < 15 minutes
  • [ ] NO DATA TRUNCATION (134K message intact)

Uninstall Protection:

  • [ ] Blocks uninstall without backup
  • [ ] Shows clear error message
  • [ ] Requires recent backup (< 24 hours)
  • [ ] Requires typed confirmation phrase
  • [ ] Creates audit log

Integration:

  • [ ] Backup confirmation recorded after export
  • [ ] Uninstall interceptor checks confirmation
  • [ ] Final wizard shows backup details
  • [ ] All error messages are clear and actionable

Testing:

  • [ ] All unit tests pass
  • [ ] Full roundtrip test passes
  • [ ] 100% data fidelity verified
  • [ ] No truncation (134K message test)
  • [ ] Edge cases handled

🚨 Red Flags: When to STOP and Ask for Help

STOP immediately if:

  1. ❌ Export file size doesn't match (should be ~107 MB for database)
  2. ❌ Record counts don't match (should be 229 conv, 51,002 msg)
  3. ❌ Longest message is truncated (should be 134,409 chars, not 32,767)
  4. ❌ Filestore files missing (should be 560 files)
  5. ❌ pg_dump fails with errors
  6. ❌ Restore gives different record counts than original
  7. ❌ Any test fails
  8. ❌ You're stuck for > 2 hours on one task

Do NOT:
- ❌ Skip verification because "it probably works"
- ❌ Assume test will pass without running it
- ❌ Deliver partial work and say "user can finish the rest"
- ❌ Say "it works on my machine" without evidence

DO:
- ✅ Test every feature you build
- ✅ Provide evidence of testing
- ✅ Ask for help if stuck
- ✅ Verify edge cases
- ✅ Reach 100% before declaring complete


📋 Final Checklist

Before saying "I'm done", verify ALL of these:

  • [ ] All Phase 0 tasks certified (infrastructure verified)
  • [ ] All Phase 1 tasks certified (export system complete)
  • [ ] All Phase 2 tasks certified (import system complete)
  • [ ] All Phase 3 tasks certified (uninstall protection complete)
  • [ ] Full roundtrip test PASSED
  • [ ] No data truncation (134K message test PASSED)
  • [ ] All verification evidence provided
  • [ ] All certifications signed off
  • [ ] User can download backup
  • [ ] User can restore backup
  • [ ] User CANNOT uninstall without backup
  • [ ] Audit logs created

Only when ALL boxes are checked: You are 100% complete.


💬 Communication Protocol

When reporting progress:

❌ BAD: "I implemented the export function, it should work"

✅ GOOD:

Task: Export Database
Status: ✅ Complete

Evidence:
- Tested on ai_automator_db
- Export succeeded in 1:43
- File size: 107 MB (matches estimate)
- Verified 51,002 messages will be backed up
- [screenshot of successful export]

✅ VERIFIED: Export Database - 100% Complete

When blocked:

❌ BAD: "It's not working"

✅ GOOD:

Task: Export Database
Status: ⚠️ BLOCKED

Problem:
- pg_dump returns error: "connection refused"
- Tried: psql -U odoo_user -d ai_automator_db
- Error: FATAL: password authentication failed

What I've tried:
1. Verified PostgreSQL is running (pg_ctl status)
2. Checked password in code (matches env variable)
3. Tested manual connection (same error)

Need help with:
- How to resolve PostgreSQL authentication?
- Alternative approach to export database?

🎯 Success = Evidence-Based Completion

Remember:
- Claims are NOT evidence
- "It should work" is NOT verification
- "I tested it" is NOT proof (show the test output)
- 75% complete is NOT acceptable
- 100% or nothing

This is a data-critical project. User is trusting you with 51,002 messages.

Do not let them down. 🎯


End of Developer Handoff with Verification Protocol ✅

Was this helpful?