More Amplifier Stories

Amplifier Platform Evolution

Infrastructure, Quality & Pragmatic Decisions
A week of PostgreSQL migration, 6x test coverage increase,
and learning when simpler wins
February 6-13, 2026

By The Numbers

3
Development Sessions
39 Conversation Turns
52
Files Changed
11,383 insertions, 4,909 deletions
6x
Test Coverage Increase
67 → 400+ tests
37
REST API Endpoints
Simplified from 40

Infrastructure Evolution

PostgreSQL Migration

Result: Production-ready database infrastructure that scales

Quality Leap

Test Suite Overhaul

Result: 6x increase in test coverage with systematic expansion

API Maturity

Simplification Through Cleanup

Result: 40 → 37 endpoints, clearer API surface

The Journey

Dependency Pinning Attempt

The Problem

Wanted to pin module dependencies to specific commits for stability

The Attempt

  • Runtime pinning with pinned_sources.yaml config
  • Git clone during session startup
  • Hash-based URL references (#hash, @hash)

The Challenges

  • Git clone can't checkout arbitrary commits directly
  • URL format issues: #hash creates tarballs, @hash treats as branch
  • Permission issues, cache corruption, Docker build problems

The Learning

When Simpler Wins

Key Insight: "Sometimes the simpler solution is better than fighting tooling limitations"

Reverting is engineering judgment, not failure

JSON Storage Recovery

Rebuilding Lost Work

Result: Structured config storage with encryption ready

Before/After Impact

Before

  • SQLite database
  • 67 tests
  • YAML config strings
  • Complex dependency pinning ideas
  • 40 API endpoints
  • Single-user sessions

After

  • PostgreSQL with connection pooling
  • 400+ tests (6x increase)
  • JSON config with encryption
  • @main Docker locking
  • 37 API endpoints (simplified)
  • Multi-user session support

Result: Production-scalable, comprehensively tested, pragmatically stable

PostgreSQL Migration Pattern

Evolution from SQLite to asyncpg

# Before: SQLite async with aiosqlite.connect(db_path) as db: await db.execute("INSERT INTO sessions ...") # After: PostgreSQL with connection pooling pool = await asyncpg.create_pool( dsn=database_url, min_size=5, max_size=20 ) async with pool.acquire() as conn: await conn.execute(""" INSERT INTO sessions (id, tags, metadata) VALUES ($1, $2, $3) """, session_id, tags_json, metadata_json)

JSONB columns enable structured data queries at database level

Testing Methodology

Comprehensive Coverage Strategy

New Test Files

  • test_config_validation.py - Config schema validation
  • test_session_management.py - Multi-user session flows
  • test_database_operations.py - JSONB queries, pooling
  • test_encryption.py - ConfigEncryption verification

Key Takeaways

Infrastructure:

PostgreSQL migration enables production scale with connection pooling and JSONB

Quality:

6x test coverage increase through systematic expansion across all layers

Simplicity:

Pre-installed @main dependencies beat runtime pinning complexity

Pragmatism:

Reverting is engineering judgment, not failure—choose simpler when tooling fights you

Recovery:

JSON storage work successfully recovered from patches and diffs

What's Next

Questions? Explore the amplifier-app-api repository

More Amplifier Stories