Core Concepts

Master the fundamental concepts that power Lattice Engine. Understand how AI-driven development works and how to leverage it effectively.

FundamentalsAI-PoweredBest Practices

Core Concepts

Mutations
AI-powered code transformations that understand context and intent

What are Mutations?

Mutations are AI-powered code transformations that can understand context, intent, and project structure. They go beyond simple text replacement to provide intelligent code modifications.

Context Awareness

Mutations understand your codebase, dependencies, and coding patterns to make intelligent changes that maintain consistency.

Safety First

Each mutation includes validation, testing, and rollback capabilities to ensure code integrity.

Example: Add TypeScript Types

Automatically add TypeScript type definitions to existing JavaScript code

Before
function calculateTotal(items) {
  return items.reduce((sum, item) => sum + item.price, 0);
}
After
interface Item {
  price: number;
  name: string;
}

function calculateTotal(items: Item[]): number {
  return items.reduce((sum: number, item: Item) => sum + item.price, 0);
}
Specifications
Structured requirements that define what changes should be made

Structured Requirements

Specifications define changes in a machine-readable format that AI can understand and execute reliably.

Validation Rules

Include constraints, validation rules, and acceptance criteria to ensure changes meet requirements.

Version Control

Track specification changes over time and understand the evolution of your requirements.

Example: API Specification

Define requirements for adding a new REST API endpoint

{
  "type": "add_api_endpoint",
  "endpoint": "/api/users/{id}",
  "method": "GET",
  "description": "Get user by ID",
  "parameters": {
    "id": {
      "type": "string",
      "required": true,
      "format": "uuid"
    }
  },
  "response": {
    "200": {
      "schema": "UserResponse",
      "description": "User found"
    },
    "404": {
      "schema": "ErrorResponse",
      "description": "User not found"
    }
  },
  "validation": {
    "authenticate": true,
    "rate_limit": "100/hour"
  }
}
Approvals
Human-in-the-loop review process for critical changes

Review Process

Critical changes require human approval before execution, ensuring oversight and quality control.

Approval Workflows

Configure multi-stage approval processes with different reviewers for different types of changes.

Audit Trail

Complete audit trail of all approvals, rejections, and modifications for compliance and debugging.

Example: Production Deployment Approval

Multi-stage approval process for deploying to production

  1. 1. Developer submits deployment request
  2. 2. Code review by team lead
  3. 3. Security review by security team
  4. 4. Final approval by release manager
  5. 5. Automated deployment execution
Real-time Sync
Keep your specifications and code synchronized across all environments

Bidirectional Sync

Changes in code are automatically reflected in specifications and vice versa.

Conflict Resolution

Intelligent conflict detection and resolution when changes occur in multiple places.

Environment Consistency

Ensure all environments (dev, staging, production) stay synchronized.

Example: Database Schema Sync

Keep database schema changes synchronized across environments

Architecture Concepts

Event-Driven Architecture
Lattice uses an event-driven architecture to handle mutations, approvals, and synchronization in real-time.
  • Events trigger mutations and sync operations
  • Asynchronous processing for better performance
  • Real-time notifications and updates
Plugin System
Extensible plugin architecture allows custom mutations and integrations.
  • Custom mutation types
  • Third-party integrations
  • Language-specific plugins
State Management
Centralized state management ensures consistency across all operations.
  • Distributed state coordination
  • Conflict resolution
  • Rollback capabilities

Best Practices

Specifications
  • Write clear, specific requirements
  • Include validation rules and constraints
  • Use version control for specifications
  • Document business logic and intent
Mutations
  • Test mutations in development first
  • Use incremental changes when possible
  • Always include rollback procedures
  • Monitor mutation success rates
Approvals
  • Define clear approval workflows
  • Use appropriate reviewers for each change type
  • Document approval decisions
  • Regular review of approval processes
Learning Path
1

Understanding Mutations

Learn how AI-powered mutations work and their benefits

15 min
2

Creating Specifications

Master the art of writing effective specifications

20 min
3

Approval Workflows

Set up and manage approval processes

15 min
4

Real-world Examples

Apply concepts to real development scenarios

30 min

Need Help?

Have questions about core concepts? Our community is here to help.