Skip to main content

The Problem with Traditional Versioning

Traditional approach:
Problem: Can’t mix Prompt A v1 with Config B v2. Everything is locked to the app version. Edgit approach:
Power: Mix any combination. Prompt A v1 + Config B v3 + Query C v1.5 + Ensemble D v1.1. Infinite possibilities.

Thin Git Wrapper Philosophy

Edgit creates Git tags. That’s it.
  • No custom databases
  • No version registries
  • No deployment state files
  • Just standard Git tags
Your CI/CD (GitHub Actions, etc.) handles the actual deployment. Edgit gives you the primitives to version and reference everything.

Git Tag Format (4 Levels)

Edgit uses a 4-level tag format:
Levels:
  1. prefix: components or logic (inferred from file path)
  2. type: prompts, agents, ensembles, etc.
  3. name: Component name
  4. slot: Version (v1.0.0) or environment (staging, production)
Examples:
Prefix determines deployment behavior:
  • components: Hot-swappable (prompts, configs, queries, schemas). Push to KV, live immediately.
  • logic: Requires Worker rebuild (agents, ensembles). Bundle into code, redeploy Worker.
No --type flags needed. Edgit infers prefix from file location.

Version Tags vs Environment Tags

Version Tags (Immutable)

Version tags are immutable snapshots:
Characteristics:
  • Semantic versioning: v1.0.0, v1.1.0, v2.0.0
  • Immutable by convention (no —force needed)
  • Create once, reference forever
  • Safe for production

Environment Tags (Mutable)

Environment tags are pointers to versions:
Characteristics:
  • Common names: staging, production, dev, canary
  • Mutable (—force required to update)
  • Point to version tags
  • Easy deployment workflow
Why mutable tags require —force:
  • Git protects against accidental overwrites
  • Forces explicit intent when moving environment pointers
  • Prevents race conditions in CI/CD

Component Versioning

What Gets Versioned

Components are versioned artifacts that agents use:
  • Prompts (.md) - AI instructions
  • Configs (.json, .yaml) - Settings
  • Queries (.sql) - Database queries
  • Scripts (.js, .ts) - Functions
  • Schemas (.json) - Validation rules
  • Templates (.html, .md) - Output templates
Each gets its own version history via Git tags.

Create Component Versions

No registration needed. Just create tags. The 4-level format is self-describing.

Full Workflow Example

GitHub Actions sees tags and deploys them. Edgit just creates the tags.

Semantic Versioning

Follow semver: v{major}.{minor}.{patch} Major (v2.0.0): Breaking changes
Minor (v1.1.0): New features, backward compatible
Patch (v1.0.1): Bug fixes

Reference Versions in Ensembles

Lock to specific versions:
Benefits:
  • Predictable behavior (won’t break on updates)
  • Can A/B test different versions
  • Easy rollback (just change the version)
For TypeScript ensembles, see the Version Primitives documentation for complete API reference including versionedAgent(), versionedEnsemble(), and deploymentRef().

Agent Versioning

What Are Agents?

Agents are workers that execute tasks. They live in logic/ because they require Worker rebuilds:
  • Pre-built agents (scraper, validator, RAG, HITL)
  • Custom agent implementations

Version Agent Implementations

Tag format:

Reference Agent Versions

Ensemble Versioning

What Are Ensembles?

Ensembles are workflow definitions that orchestrate agents. They live in logic/:
  • YAML ensembles (.yaml, .yml) - Declarative workflow definitions
  • TypeScript ensembles (.ts) - Programmatic workflow definitions with full type safety

Version Ensemble Definitions

Tag format:

TypeScript vs YAML Ensembles

When to use TypeScript:
  • Complex flow control (nested branches, loops)
  • Type safety requirements
  • IDE autocomplete and validation
  • Reusable ensemble patterns
When to use YAML:
  • Simple linear workflows
  • Non-developers editing ensembles
  • Quick prototyping
  • Configuration-driven deployments

The Versioning Multiverse

The real power: version components, agents, AND ensembles independently, then mix them.

Example: Testing Matrix

You have:
  • 2 agent versions (analyzer v1.0.0, v2.0.0)
  • 3 prompt versions (prompt v1.0.0, v1.5.0, v2.0.0)
  • 2 config versions (config v1.0.0, v2.0.0)
That’s 12 possible combinations!

Real-World Use Case: Progressive Testing

You de-risked the rollout by testing each change independently.

Version Strategies

Strategy 1: Lock Everything (Maximum Stability)

When: Production systems that can’t break Trade-off: Miss out on improvements

Strategy 2: Latest Everything (Maximum Innovation)

When: Development/staging environments Trade-off: Might break unexpectedly

Strategy 3: Mixed (Balanced)

When: Most production systems Trade-off: Balance between stability and improvement

Strategy 4: Canary (Gradual Rollout)

When: Rolling out risky changes Trade-off: More complex setup

Version Lifecycle

Development Flow

When to Create Versions

Do version:
  • After merging to main
  • After successful tests in staging
  • When deploying to any environment
  • When you want to lock a working state
Don’t version:
  • Every commit during development
  • WIP (work in progress) changes
  • Before testing
  • In feature branches
Philosophy: Versions are milestones, not checkpoints.

Version Discovery

List All Versions

View Version Changes

Best Practices

1. Version After Testing

2. Use Semantic Versioning Correctly

3. Document Breaking Changes

4. Keep Old Versions

5. Test Version Combinations

Troubleshooting

Version Not Found

Version Conflicts

Can’t Push Environment Tags

Next Steps

Deployment Strategies

Progressive rollouts, canaries, A/B testing

Rollback & Time Travel

Emergency rollbacks and debugging

A/B Testing

Multivariate testing with version combinations

CLI Reference

Complete command documentation