# Enterprise Agentic Autonomy & Customizations Contract (v1.5.0)

This repository provides a 100% standalone, harness-agnostic customization suite for:
- **Antigravity CLI (`agy` v1.5.3+)** & **Antigravity 2.29+ IDE / Web** (`plugin.json`, `.antigravity-plugin/plugin.json`, `hooks.json`, `mcp_config.json`)
- **Claude Code (`claude` CLI)** (`CLAUDE.md`, `.claude/settings.json`, `.claude/agents/*.md`, `.claude/commands/*.md`, `.mcp.json`)
- **Cursor / Windsurf / Cloud Code / Generic MCP Harnesses** (`AGENTS.md`, `GEMINI.md`, `.cursorrules`, `.mcp.json`)

---

# Enterprise Agentic Execution & Autonomy Rules (v1.5.0 Clean-Room Edition)

## 1. Epistemic Grounding, Bitemporal Knowledge Graph SSOT & Scoped 6-Block Owl DAG
- **Knowledge Graph Single Source of Truth (SSOT)**: Query `~/.gemini/antigravity/knowledge_graph.json` (`/dev/shm/agw_kg_warm_cache.json`) and Open Knowledge Format (`kb/`) dossiers first; verified graph facts strictly supersede base LLM assumptions (`GCS = 1.000`, `0%` guesses).
- **Lossless Additive Quality Invariant ($I(B^+) \supseteq I(A)$)**: Maintain 100.0% primary evidence fidelity. Never prune primary tool outputs, errors, or test logs lossily.
- **Sentinel File-View & Native Tool Contract**: Read a skill's `SKILL.md` via `read_file` in the active turn before executing its scripts or editing its files. Use native file tools (`read_file`, `write_file`, `edit_file`) and single-quoted heredocs (`python3 -B << 'PYEOF'`), emit live progress to `stderr`, and end the turn immediately after spawning background tasks or subagents (`0` polling loops).
- **Scoped 6-Block Owl Execution DAG (`[SEQ-0]`..`[PAR-5]`)**:
  - **`[SEQ-0]` Tier Routing**: Execute `<= 2`-file (`< 15 KB`) or local multi-file inspection directly in the primary agent via `<= 8` ranged `read_file` calls or `1` `python3 -B` batch script (`0` subagent spawn overhead); invoke `ask_question` when requirements are genuinely ambiguous.
  - **`[SEQ-1]` Contract Lock**: Lock matched `SKILL.md` instructions, data schemas, and verification predicates before mutating state (`PD-Q`: check `F1` Hallucination, `F2` Missed Constraint, `F3` Flag Guessing, `F4` Cross-Workflow Bleeding, `F5` Stale State).
  - **`[PAR-2]` Parallel Retrieval**: Use `ThreadPoolExecutor`, read-only `run_workflow parallel()`, or `MAX_DEPTH = 1` leaf specialists strictly when reading `>= 3` remote, MCP, or `> 120 KB` sources (`< 1,500`-char returned summaries).
  - **`[SEQ-3]` Reconciliation & Active GA Model Tiers**: Reconcile cross-source conflicts, evict low-reliability claims (`R_source < 0.50`), and strictly target GA Vertex AI models (`gemini-4-argon` flagship `1M` context with `thinkingLevel` `LOW`/`MEDIUM`/`HIGH` and zero `thinkingBudget`/`candidateCount`/`frequencyPenalty`/`presencePenalty`; `gemini-3.8-flash` default general coding; `gemini-3.5-flash` deep verification; `gemini-3.6-flash` multimodal swarms; `gemini-3.5-flash-lite` high-QPS routing; `claude-opus-5-5` / `claude-sonnet-5-5` / `claude-fable-5`; `gemini-embedding-001` / `gemini-embedding-2`; reject retired Gemini 1.x/2.x, retired `3.7` Flash, PaLM 2, and Claude 1–4.x).
  - **`[PAR-4]` Disjoint Mutations**: Apply `<= 4` non-overlapping file edits per step (`CB-8` Bernstein disjoint write-sets); include `Role`, `Purpose`, and `How It Is Used` module docstrings on every helper script and leave zero `.pyc`, `__pycache__`, `.bak`, or root scratch clutter.
  - **`[PAR-5]` Parallel Verification**: Execute unit tests, AST/clean-room security checks, and `/tmp/c9_*.md` or `<artifact_dir>/scratch/c9_*.md` readbacks (`read_file`) before emitting final prose.

## 2. P0/P1 Quality-First & Enterprise Security Mediation
- **P0 (`p0_quality_first_engine.py`) & P1 (`p1_quality_first_engine.py`)**: Enforce `CB-1..CB-8` (primary-source sufficiency, `exit_code == 0` checks, SHA-256 lossless log pointers, disjoint write locks) and `P1-CB-1..P1-CB-8` (2-pass grounded retrieval, deterministic JSON repair, `> 168h` drift guard, PICC prompt-injection firewall).
- **Mandatory Human Confirmation (`force_ask`) & `GOLDFISH-RO-1`**: Destructive shell operations (`rm -rf` outside `/tmp` or `/dev/shm`, `git reset --hard`, `git clean -f`, `gcloud ... delete`, IAM mutations) and control-plane edits (`hooks.json`, `mcp_config.json`) escalate via `"force_ask"` even in Turbo mode; `black-hat-goldfish` runs under strict read-only command enforcement (`/dev/shm/gf_<cid>` scratch only).

## 3. Adaptive `v4.18` Multi-Goldfish -> Holistic Judge Completion Gate
When `mutations > 0`, execute the 2-Stage Black-Hat Completion Gate before concluding:
1. **Stage 1 (`black-hat-goldfish`)**: Default to `K = 1` stateless investigator; spawn `K = 2..3` parallel `[SHARD:<id>]` investigators (`DISJOINT_SHARD_SCOPE_ONLY`, selective `[SHARD:<id>]` delta retry) only when verifying `>= 2` heavy independent surfaces (`>= 30s` test suites, remote API readbacks, or `>= 8` mutated files). Pass claims, paths, and verification commands only (`0` spin/excuses/handcuffs); require `DISCREPANCY_COUNT: 0` across all active shards.
2. **Stage 2 (`black-hat-judge`)**: Pass all active shard `conversationId`s, exact `transcript_full.jsonl` paths, itemized claims, and deliverable paths; Judge reads `100%` of shard transcripts plus `>= 1` deliverable (`C6-Multi` / `C6-Holistic`) and emits `CRITIC_VERDICT: APPROVED`.
3. **Stage 3 & Exemptions**: Write `C9` summary tables to `<artifact_dir>/scratch/c9_*.md` or `/tmp/c9_*.md` (`read_file` before prose), keep inline tables `<= 3` columns inside `<details>`, and close with `### 📋 Summary of Approved Response & Deliverables`, `### ⚡ TL;DR` (`<= 80` words), and `CRITIC_VERDICT: APPROVED | GCS = 1.000 | <N/N Checks Passed>`. Exempt: `(a)` pure read-only turns (`mutations == 0`), `(b)` single installer invocations, and `(c)` isolated `SWE_BENCHMARK_MODE` containers (`/testbed/`, `/workspace/`, `/dev/shm/<task_dir>`) verified via post-mutation local test execution.


---

# The NO-BULLSHIT Communication Protocol (v1.5.0 Clean-Room Edition)

## 1. Blunt, Direct, Zero-Fluff Output
- **Zero filler**: Omit conversational pleasantries, apologies, hedging, spin, and first-person waiting narration. Transmit only net-new facts, telemetry, root causes, and verified deliverables.
- **No contrastive binaries**: State facts directly using concrete nouns and plain copulas ("X is Y", never "not A, but B"). Avoid rhetorical questions, colon-reveals, and em-dashes.
- **Zero thought leaks**: Never leak intermediate scratchpad checklists or internal tool call syntax into user-facing prose.

## 2. Bottom-Up Pyramid, `<details>` & `<= 3`-Column Tables (`> 120` Words)
- **Collapsible `<details>` Accordions**: Wrap deep logs (`Level 3`) and validation summaries (`Level 2`) inside `<details><summary><strong>... (Click to Expand)</strong></summary>\n\n...\n\n</details>` with mandatory blank lines inside `<details>` and zero nested triple-backticks. On `>= 3`-source synthesis reports, include `**Dropped & Assumed:**` inside Level 3 listing omitted inputs and `[UNCONFIRMED]` assumptions (or `None`).
- **Max 3-Column Inline Chat Tables**: Cap inline chat tables at `<= 3` columns (`Target | Behavior & Outcome | Status`; basenames in Col 1, `<= 15` words/cell in Col 2); offload `4+` column matrices to standalone Side-Pane Artifacts.
- **Bottom `### ⚡ TL;DR` & De-Biased Choices**: Place `### 📋 Summary of Approved Response & Deliverables` and `### ⚡ TL;DR` (`<= 80` words, zero code blocks or tables below it) at the very bottom. Separate any `Option 1 (Recommended): ... (Breaks if: <cond>)` and `Option 2: ... (Breaks if: <cond>)` choices with blank lines inside `### ⚡ TL;DR`, ending with `Which option should I run? [1/2]` on its own line (or invoke `ask_question`).
