Skip to Content
Source ControlOverview

Source Control

Version control for AI artifacts with built-in Git integration, enabling collaborative development and audit trails for workflows, prompts, and configurations.

Why Source Control for AI Systems?

Traditional software has long benefited from version control, but AI systems present unique challenges:

  • Prompts and workflows evolve rapidly during experimentation
  • Multiple team members iterate on the same AI pipelines
  • Production deployments require stable, tested versions
  • Compliance and auditing demand change history and authorship tracking
  • Rollback capability when a deployed workflow underperforms

M3 Forge embeds source control directly into the platform, treating AI artifacts as first-class versioned assets.

Source Control section showing repository list with branch indicators and sync status

Git Integration

M3 Forge integrates with Gitea, a self-hosted Git service that runs alongside the platform. This provides:

  • Full Git workflow — branches, commits, merges, pull requests
  • Web-based code editor — no local Git client required
  • Change visualization — side-by-side diffs for workflow JSON and prompt YAML
  • Access control — repository-level permissions and team collaboration
  • Audit trail — complete history of who changed what and when

Gitea runs as a separate service. See Gitea Integration for setup instructions.

Versioned Artifacts

M3 Forge stores the following artifacts in Git repositories:

Artifact TypeStorage FormatLocation
WorkflowsDAG JSONworkflows/<name>.json
PromptsYAML with frontmatterprompts/<name>.yaml
Query PlansDAG JSON with prefabsquery-plans/<name>.json
AgentsConfiguration YAMLagents/<name>.yaml
ConfigurationsEnvironment-specific JSONconfig/<env>/<name>.json

All files are human-readable and diff-friendly, enabling meaningful code reviews and change tracking.

Git Workflow

M3 Forge follows a branch-based development workflow:

  1. Create a branch for new features or changes
  2. Commit changes incrementally as you iterate
  3. Open a pull request when ready for review
  4. Review and approve — team members provide feedback
  5. Merge to main — approved changes become the new baseline
  6. Deploy via Release Pipeline — promote stable versions to production

This workflow integrates with the Release Pipeline to ensure only reviewed, tested changes reach production.

Key Concepts

Repository

A Git repository containing versioned AI artifacts. Each repository can hold workflows, prompts, agents, and configurations. Repositories support:

  • Branching for isolated development
  • Commit history with full authorship tracking
  • Pull requests for peer review
  • Tags for release marking

Commit

A snapshot of changes with a descriptive message. Commits track:

  • What changed — file diffs showing added, modified, deleted content
  • Who changed it — author name and email
  • When it changed — timestamp
  • Why it changed — commit message describing intent

Branch

An isolated line of development. Branches enable:

  • Parallel work — multiple team members working simultaneously
  • Safe experimentation — try new approaches without affecting production
  • Feature isolation — keep unrelated changes separate

Pull Request

A request to merge changes from one branch to another. Pull requests provide:

  • Code review — team members inspect changes before merge
  • Discussion — comments and feedback on specific lines
  • Approval workflow — require sign-off before merge
  • CI integration — automated testing of proposed changes

Change Set

A logical grouping of related changes across multiple commits. Change sets:

  • Track related edits — e.g., “Add fraud detection workflow”
  • Enable bulk review — evaluate all changes together
  • Support promotion — move a set of changes through environments

See Change Sets for details.

Integration with Release Pipeline

Source control is tightly integrated with the Release Pipeline:

  1. Development happens in Git branches
  2. Pull requests are reviewed and merged to main
  3. Change sets group related commits
  4. Versions are created from change sets
  5. Deployments promote versions to environments

This ensures every production deployment is traceable back to specific commits and authors.

When to Use Source Control

Use CaseExample
Team collaborationMultiple engineers iterating on a complex workflow
Production stabilityMaintain stable main branch while experimenting in feature branches
ComplianceAudit trail showing who approved changes to sensitive prompts
RollbackRevert to previous workflow version when performance degrades
Change reviewRequire peer review before deploying new LLM prompts

For solo prototyping or throwaway experiments, you can work directly without source control and commit later when ready.

Getting Started

Architecture

M3 Forge uses Gitea for Git hosting and provides a custom UI for repository browsing, editing, and commit management. The integration architecture:

The repository browser, code editor, and PR views are built into M3 Forge, while Gitea handles Git operations and repository storage.

Gitea provides a standalone web UI accessible at the configured Gitea endpoint. Use it for advanced Git operations not yet supported in M3 Forge.

Next Steps

Last updated on