|
| 1 | +# Antigravity CLI Integration Model |
| 2 | + |
| 3 | +This document outlines the integration architecture and operational boundaries between the **Antigravity Framework** (the Agent Execution Surface) and the **CompText CLI** (the Context, Policy, and Evidence Control Plane). |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 1. Core Doctrine |
| 8 | + |
| 9 | +CompText operates under a strict separation of concerns between agent execution and context governance: |
| 10 | + |
| 11 | +- **Antigravity CLI is the Agent Execution Surface**: Handles task orchestration, command execution, tool invocations, and subagent lifecycle management. |
| 12 | +- **CompText CLI (`ctxt`) is the Context, Policy, and Evidence Control Plane**: Manages deterministic context packaging, proposal audits, file-write validation gates, and safety constraints. |
| 13 | +- **Skills are progressive context-loading capsules**: Bounded guidelines designed to prevent context bloat and restrict agent operations. |
| 14 | +- **Hooks are policy-interceptor targets**: Structural interception points allowing verification before, during, and after agent activities. |
| 15 | +- **Permissions are defense-in-depth, not the source of truth**: Hard platform sandboxing boundaries that back up (but do not replace) the repository safety constitution. |
| 16 | +- **Subagents are bounded specialist reviewers**: Highly targeted, read-only assistants delegated for review rather than autonomous development. |
| 17 | +- **The source of truth remains the code repository**: Safety constitution (`AGENTS.md`), project tracker (`PROJEKT.md`), CompText configurations, the Proposal/Apply Gate, and local validation commands. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## 2. Structural Interaction |
| 22 | + |
| 23 | +```mermaid |
| 24 | +flowchart TD |
| 25 | + subagent[Antigravity Subagent] |
| 26 | + agent[Antigravity Orchestrator] |
| 27 | + ctxt[CompText CLI] |
| 28 | + repo[(Repository Codebase)] |
| 29 | + policy[Policy Gate / Hook] |
| 30 | +
|
| 31 | + agent -->|1. context inspect| ctxt |
| 32 | + ctxt -->|2. harvest & redact| repo |
| 33 | + ctxt -->|3. pack latest| pack[.comptext/context_pack.latest.json] |
| 34 | + agent -->|4. propose| ctxt |
| 35 | + ctxt -->|5. write proposal| prop[proposals/proposal.latest.json] |
| 36 | + agent -->|6. invoke reviewer| subagent |
| 37 | + subagent -->|7. audit proposal| prop |
| 38 | + agent -->|8. apply gate| ctxt |
| 39 | + ctxt -->|9. policy hook validation| policy |
| 40 | + policy -->|10. sandboxed commit| repo |
| 41 | +``` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## 3. Operational Flow |
| 46 | + |
| 47 | +1. **Context Harvesting**: Before launching a task, the Antigravity Orchestrator executes `ctxt context pack --task "<task_description>"`. This harvest sanitizes the repository state, redacting secrets and building a deterministic Context Pack under `.comptext/context_pack.latest.json`. |
| 48 | +2. **Proposal Generation**: When proposing changes, the agent runs `ctxt propose --provider dummy "<prompt>"`. This creates a structured JSON patch proposal under `proposals/` without mutating source files. |
| 49 | +3. **Apply and Verification**: To modify the codebase, the agent calls `ctxt apply <proposal_path>`. The CompText control plane intercepts the request, validates that target files lie within allowed write boundaries, prompts for user confirmation (or validation suite success), applies the patches, and runs local tests. |
0 commit comments