web3infra-foundation/mega

每日信息看板 · 2026-03-07
开源项目
Category
github_search
Source
0
Score
2026-03-07T01:36:12Z
Published

AI 总结

Mega 是一个用 Rust 编写、Git 兼容的开源单体仓库引擎,面向 AI 代理协作开发提供全局代码上下文、可追踪版本控制与大规模工程基础设施,重要性在于它试图把 Google 级 monorepo 能力带到开源生态。
#GitHub #repo #开源项目 #Rust #Monorepo #Buck2 #Agent

内容摘录

Mega — Monorepo Infrastructure for the AI Agent Era

Mega is an open-source implementation of Google Piper — a Git-compatible monorepo engine built for AI-native engineering workflows. Written entirely in Rust, Mega is designed to manage petabyte-scale codebases while serving as the infrastructure backbone for AI coding agents.
Why Mega?

AI coding agents are becoming first-class participants in software engineering. But today's version control systems were designed for human developers working in isolated branches — they lack the unified context, structured metadata, and programmatic interfaces that agents need to operate reliably at scale.

Monorepos solve the context problem. When an agent can see the entire codebase — dependencies, downstream consumers, build targets, and test coverage — it makes better decisions, produces fewer hallucinations, and delivers atomic cross-project changes in a single commit.

**Mega brings Google-scale monorepo infrastructure to the open-source world, purpose-built for the agentic future.**
Mega + Libra: Version Control for Agents

Mega works together with **Libra**, our Rust-based, Git-compatible client with SQLite-backed storage, to provide a complete version control workflow where AI agents are tracked, attributable contributors:
**Mega** (server-side) — The centralized monorepo engine. Manages code at scale with full codebase context, trunk-based development, and fine-grained access control. Provides the global visibility that agents need for dependency analysis, impact assessment, and cross-project reasoning.
**Libra** (agent-side) — A lightweight, embeddable Git client optimized for programmatic access. Agents use Libra to clone, commit, and push with structured metadata and intent tracking — no shell-out to git required.

Together, they enable a new paradigm: **from intent to merge, every agent action is versioned, attributed, and traceable.**
Features
Git Compatible

Mega offers full Git protocol support with a monorepo. Clone or pull any folder in the monorepo into your local filesystem as a standard Git repository, and seamlessly push changes back. Both human developers and AI agents interact through the same familiar Git interface.
Trunk-Based Development

Large-scale codebases thrive on trunk-based development — a single source of truth, continuous integration, and short-lived branches. This model is especially critical for AI agents, which benefit from always operating against the latest, consistent state of the codebase. Learn more at Trunk-Based Development.
Conventional Commits

Mega supports Conventional Commits, enabling both humans and agents to produce structured, machine-readable commit messages that power automated changelogs, semantic versioning, and audit trails.
Scorpio — FUSE Filesystem for Monorepo

Scorpio is a FUSE filesystem that mounts any monorepo folder as a local filesystem. Developers and agents work with their codebase as if it were local, while Mega handles the scale underneath — no need to check out the entire repository.
Buck2 Integration

Mega integrates Buck2 as its default build system. Developed by Meta in Rust, Buck2 enables declarative, reproducible, and highly parallelized builds — essential for maintaining build correctness across a monorepo that both humans and agents contribute to simultaneously.
Roadmap

Mega is evolving toward deeper AI-native capabilities:
**IntentSpec** — A structured, machine-readable intent contract that drives agent task execution with security policies and provenance binding.
**Multi-Agent DAG Orchestration** — Pipeline architecture for coordinating multiple AI agents across complex, multi-step code generation workflows.
**Code Attribution** — Line-level tracking of AI-generated vs. human-written code, enabling auditability and trust in agent contributions.
Quick Start

To facilitate a rapid deployment and hands-on experience with the Mega service, the following instructions are derived from the project's documentation.
Community

Discord Channel - https://discord.gg/HMFuu6pJmQ
Contributing

The mega project relies on community contributions and aims to simplify getting started. To develop Mega, clone the repository, then install all dependencies and initialize the database schema, run the test suite and try it out locally. Pick an issue, make changes, and submit a pull request for community review.
Pre-submission Checks
Before submitting a Pull Request, please ensure your code passes the following checks:

Both commands must complete without any warnings. The clippy check treats all warnings as errors, and the formatter check ensures code follows the project style guide. Only PRs that pass these checks will be accepted for merge.

If the formatting check fails, you can automatically fix formatting issues by running:
Buck2 Build Requirements

This project builds with Buck2. Please install both Buck2 and cargo-buckal before development:

Pull Requests must also pass the Buck2 build:

When you update dependencies in Cargo.toml, regenerate Buck metadata and third-party lockfiles:

More information on contributing to Mega is available in the Contributing Guide.
License

Mega is licensed under this License:
MIT LICENSE ( LICENSE-MIT or https://opensource.org/licenses/MIT)
Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)