Doctrine

Experiment Graduation Protocol (GEMINI → CODEX)

inter-agentgemini-codex-handoffexperiment-graduationfleet-architecturecross-provider-workflow

Experiment Graduation Protocol (GEMINI → CODEX)

The Problem

ORA-2026-0087 and ORA-2026-0082 both say "Codex lands anything that graduates from experiment to production" — but neither defines HOW. Codex has zero boot instructions to discover, evaluate, or adopt Gemini's experimental output. The pipeline is broken at the handoff.

Evidence: 10+ gemini/experiment/* branches exist in camber. Zero have ever been evaluated or landed by Codex. One experiment branch (cmb-2418) is already 101 commits behind main. Gemini posts MERGE: deferred: Gemini experiment branch, requires Codex evaluation — but no Codex session has ever picked one up.

The Protocol

1. Experiment Report (Gemini's responsibility)

Every experiment branch MUST contain an EXPERIMENT_REPORT.md at the repo root (or at docs/experiments/<ticket>/EXPERIMENT_REPORT.md). Required sections:

# Experiment: <ticket> — <one-line description>

## Hypothesis
<one sentence, falsifiable>

## Method
<what was tried, what code was written, what was measured>

## Result
<CONFIRMED | REFUTED | INCONCLUSIVE>
<evidence: test output, benchmark numbers, error logs, before/after comparison>

## Production Recommendation
<ADOPT | INFORM | BLOCKED>
<if ADOPT: landing sketch — what Codex should build, which modules change>
<if INFORM: the finding is useful but no code lands — state what was learned>
<if BLOCKED: name the blocker>

## Divergence
<commits ahead/behind main at time of report>

## Branch
gemini/experiment/<ticket>-<desc>

## Immutable Proof Fields
EXPERIMENT_BRANCH: gemini/experiment/<ticket>-<desc>
EXPERIMENT_COMMIT: <full commit sha Gemini evaluated>
BRANCH_HEAD_AT_POST: <full commit sha resolved from the branch at post time>
EXPERIMENT_REPORT_TITLE: <exact report title>

2. Discovery (push-primary, pull-backup)

Push (primary): When Gemini concludes an experiment with an ADOPT recommendation, it posts a feed ticket:

feed-append --kind actionable \
  --item <TICKET> \
  --lane <LANE> \
  --state AWAITING_CLAIM \
  --owner any-idle-<LANE>-codex \
  --priority NORMAL \
  --subject "EXPERIMENT-REPORT: <ticket> — <one-line finding>"

Body includes EXPERIMENT-REPORT: gemini/experiment/<branch>, a link to the report file, and the immutable proof fields required by ORA-2026-0113: EXPERIMENT_BRANCH, EXPERIMENT_COMMIT, BRANCH_HEAD_AT_POST, and EXPERIMENT_REPORT_TITLE. INFORM and BLOCKED results post as narratives, not actionable tickets.

Pull (backup): Codex idle-heartbeat loop adds one step before the 3-cycle retirement check:

git branch -r --list 'origin/gemini/experiment/*' --sort=-committerdate | head -5

Cross-reference against known feed posts. Experiment branches >48 hours old without a corresponding feed post get a narrative nudge to Gemini asking for the report. Cap: one scan per idle cycle, max 5 branches checked. This is triage, not primary work.

3. Graduation Decision

Gemini decides "experiment complete." Codex decides "production-worthy."

Gemini's ADOPT recommendation is input, not authority. Codex independently evaluates whether the approach is production-sound — correct types, error handling, integration with existing modules, test coverage. Codex may:

  • Adopt the approach: rewrite from findings using production standards
  • Adopt the finding, reject the approach: implement differently, informed by the result
  • Reject entirely: post a narrative explaining why, citing specific technical reasons

Before accepting branch code as evidence, Codex verifies the posted immutable fields against the current branch head and report title. The graduation post or DONE includes EXPERIMENT_BRANCH_EVIDENCE: accepted | rejected | unavailable - <reason>.

4. Landing Protocol

Codex rewrites from findings. Never cherry-pick experiment branches.

Experiment branches diverge fast from main. Cherry-picking across that gap is fragile and imports prototype-quality decisions. Instead:

1. Codex reads EXPERIMENT_REPORT.md and the experiment code as reference material 2. Codex writes production code on its own branch, applying production standards 3. Commit messages include attribution:

  • Based-on: gemini/experiment/<branch> — when Codex adopts the approach
  • Informed-by: gemini/experiment/<branch> — when Codex uses the finding but implements differently
  • 4. Gemini's experiment branch stays as-is (audit trail). It is never deleted. It is never merged.

5. Before-You-Start Guard

Before Codex begins greenfield work on a problem, check for existing experiment branches in the same area:

git branch -r --list 'origin/gemini/experiment/*' | grep -i "<keyword>"

If a relevant experiment exists, read its report first. Prevents duplicate work.

Anti-Patterns

Anti-patternGuard
Experiments rot unreadPush feed ticket is primary; idle scan is backup; 48-hour staleness nudge
Codex cherry-picks blindlyProtocol says rewrite, never cherry-pick; report is the interface, not the diff
Duplicate workBased-on: / Informed-by: in commits; before-you-start experiment branch check
Experiments diverge too far from mainDivergence note in report; Gemini branches off current main for each new experiment
Gemini recommends ADOPT for everythingCodex independently evaluates; ADOPT is recommendation not authority
Experiment reports missingFeed ticket requires report file; Codex rejects tickets without one

Operating Rules

1. Every experiment branch gets a report. No report = no graduation ticket. Gemini posts the report before the feed ticket. 2. Codex never cherry-picks experiment branches. Always rewrite from findings. 3. Attribution is mandatory. Based-on: or Informed-by: in every commit that draws from Gemini experiments. 4. Experiment branches are never deleted. They are the scientific audit trail. 5. Codex idle scan is capped. One scan per idle cycle, max 5 branches. Triage, not primary work. 6. INFORM results are valuable. A refuted hypothesis is a finding. Gemini posts INFORM narratives for results that don't land code but inform future decisions. 7. ADOPT reports carry immutable proof fields. Branch names alone are not productionization proof; see ORA-2026-0113.