These docs track main. Latest release: v1.2.0.

antigravity-booster
Internals

Architecture

The layers of agb: entry points, plan compiler, orchestration engine, ADLC bridge and installation, and how they depend on each other.

agb is a Node.js ESM codebase with no runtime dependencies in the installed plugin: every entry point is shipped as a self-contained bundle (see Build and bundle). It drives Google Antigravity's agy CLI as a subprocess and enforces the ADLC through the adlc toolkit and the adlc-antigravity companion plugin.

Layers

The diagram groups modules by role and is drawn from their actual import statements at v1.0.0. Arrows point from a module to what it uses.

Entry points

  • bin/agb.mjs parses arguments against a static COMMANDS table and dispatches to the library (bin/agb.mjs). Every subcommand is documented in the CLI reference.
  • mcp/server.mjs is a stdio JSON-RPC server. It imports no lib/ code; each tool call spawns the agb CLI, resolving dist/agb.mjs next to itself when bundled and bin/agb.mjs in a source checkout (mcp/server.mjs). See MCP tools.
  • hooks/pre-tool-use.mjs is the in-session guard agy calls before every tool use. It depends only on hooks/policy/* and lib/active-rails.mjs. See Policy guard.
  • sidecars/ is the optional local dashboard. It imports no lib/ code and reads run state from disk. See Sidecar dashboard.

Plan compiler

lib/plan.mjs compiles an Antigravity brain plan (read by lib/brain.mjs) or a spec file into a validated, gated plan.json. lib/preflight.mjs supplies the deterministic scope-overlap forecast and the coldstart model gate. See Plan compiler.

Orchestration engine

lib/scheduler.mjs (runPlan) runs the ticket DAG. It routes each ticket through the quota pools (lib/pools.mjs, class PoolSet, backed by the shared model and tier registry in lib/models.mjs), creates worktrees and runs integration transactions (lib/worktrees.mjs), runs sandboxed gates (lib/gates.mjs), prosecutes with a different model family (lib/prosecute.mjs, prompts from lib/charters.mjs), serializes runs per repository (lib/lock.mjs), writes .booster/run.json (lib/status.mjs) and checks that workers did not tamper with anything outside their worktree (lib/run-integrity.mjs) (lib/scheduler.mjs). See Run lifecycle and Integration journal.

lib/lock.mjs and lib/gates.mjs are this repository's own frozen rails: merge-lock correctness and sandbox enforcement.

ADLC bridge

lib/adlc-bridge.mjs and lib/adlc-tool.mjs are the layer where agb talks to the ADLC toolkit. lib/adlc-bridge.mjs resolves and authenticates the adlc binary (the pinned vendored copy when bundled), projects plans into the ticket store, and reads the companion plugin's contract; lib/adlc-tool.mjs (runAdlcTool) runs authenticated adlc <tool> subcommands and parses JSON output. Calls to adlc tools return { ok: false, error } instead of throwing: audit gates such as gate-manifest degrade, while enforcement gates such as rails-guard are failed closed by their callers. lib/active-rails.mjs is the fail-closed reader of active rails, shared by the scheduler and the policy guard (lib/active-rails.mjs).

Installation and health

lib/bootstrap.mjs (agb bootstrap), lib/doctor.mjs (agb doctor), lib/plugin-paths.mjs (plugin root, safe agy plugin install, vendored tarball, terminal shim) and lib/migrate.mjs with lib/migration-lock.mjs (agb migrate). See Plugin and migration.

The agy boundary

lib/agy.mjs is the only module that spawns agy. It isolates runs with --project, parses stream-json output under hard-coded size caps, and enforces timeouts. Builders, prosecutors, plan conversion and quota telemetry all go through it. See agy integration.

Where state lives

LocationOwnerContents
<repo>/.worktrees/agb-*lib/worktrees.mjsTicket and integration worktrees
<repo>/.booster/lib/lock.mjs, lib/status.mjsRun lock, run.json, logs
<repo>/.adlc/ADLC toolkit, lib/adlc-bridge.mjs, lib/worktrees.mjsTicket store, manifest, integration journal
~/.gemini/config/plugins/agy plugin installThe antigravity-booster and adlc-antigravity plugins
~/.gemini/antigravity-cli/plugin_data/antigravity-booster/lib/migrate.mjs, bin/hook-runner.shMigration state and snapshots, hook logs

The full list is in File layout. Every exported symbol, module by module, is in the generated Module map.

On this page