Repository navigation
feat(land): mergePolicy.mode "auto" — real GitHub gate, squash push - #690
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| Layer / File(s) | Summary |
|---|---|
Mode configuration and stage contracts examples/land/land.config.schema.json, examples/land/land.flow.ts, examples/land/README.md, examples/land/tests/config.test.ts, examples/land/tests/flow.test.ts, examples/land/tests/transition.test.ts |
The harness options now include grok and devin, and the default is codex. Stage results distinguish shadow, pending, green, and red gate outcomes, as well as planned, pushed, moved, and non-fast-forward merge outcomes. Approval mode remains declined. |
Persisted GitHub gate and Stage E examples/land/land.flow.ts, examples/land/README.md, examples/land/tests/flow.test.ts, examples/land/tests/transition.test.ts |
Auto mode dispatches the GitHub gate and persists polling state across runs. Stage E remains pending while runs continue, advances to F on green, and sends red findings into the fix loop. Dispatches and await runs have limits. |
Squash push and recovery examples/land/land.flow.ts, examples/land/README.md, examples/land/tests/flow.test.ts, examples/land/tests/transition.test.ts |
Auto mode checks the gated base before pushing a squash commit. A moved base or non-fast-forward result returns the flow to D. Other push failures require human attention. Tests cover merge outcomes and mode-specific transitions. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant StageE
participant githubGate
participant GitHubActions
participant StageF
StageE->>githubGate: Dispatch gate or resume polling
githubGate->>GitHubActions: Dispatch workflow and poll runs
GitHubActions-->>githubGate: Return run status
githubGate-->>StageE: Return pending, green, or red findings
StageE->>StageF: Continue when the gate is green
Possibly related PRs
- AgentWorkforce/flows#687: Adds the initial shadow-mode land flow, which this change extends with auto mode.
- AgentWorkforce/flows#688: Changes base-history discovery used by the land flow’s base comparison.
Merge Risk: 
Moderate · previous review 46f2e
-
Auto landing can loop indefinitely when a push is rejected by branch protection, and gates that overrun the stage window may never reach a verdict and end in needs_human. Fix the push-failure classification and the
sincebound before relying on auto mode. Shadow mode is unaffected.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 4 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the gate at E,
Then waits for green from GitHub CI.
Red findings send the fix loop round,
A squash commit is pushed when clear and sound.
If bases move, back to D we bound,
And codex hops with ears unbound.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46f2ed09fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[High impact] No new merge-blocking findings were accepted, and the numbered finding from the previous review is fixed.
|
46f2ed0 to
4e89166
Compare
4e89166 to
4d12ed0
Compare
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
4d12ed0 to
2fd3183
Compare
|
All review threads addressed at 2fd3183. Local test run (CI only runs guard): And |
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
2fd3183 to
0842e43
Compare
|
Round 2 addressed at 0842e43 — all 6 new threads replied + resolved. Local test run: And |
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Phase 3 of cloud#5806. Auto mode lands for real where shadow only planned:
- E really runs the repo's gate (`ci.flow.ts {"github":true}`). A gate that
finishes inside runner.stageMinutes applies its verdict in-run; one that
overruns dies with the sandbox, but the `ci/<sha>` snapshot it pushed and
the Actions runs it dispatched outlive it, so the next E run finds the
snapshot (parent = the head under test) and polls `gh run list` until the
dispatched runs complete. Bookkeeping in <stateDir>/github-gate.json,
capped at 3 dispatches / 6 awaits. Red feeds the fix loop like a closed
gate; green moves to F.
- F squashes the land head onto the latest base and pushes with the
Relay-Session / Land-Run trailers. A moved base or a non-fast-forward
sends the run back to D for a rebase + regate.
- fixLoop.harness accepts claude|codex|grok|devin (default codex) and is
also passed to the review flows as their clis.
- Shadow is unchanged: no write token, E records a would-dispatch, F
writes a pushed:false plan, 'landed' still maps to would_land.
Tests: 72 pass covering every new transition — pending/green/red at E,
push success, moved base and non-FF at F, mode discipline both ways.
0842e43 to
09fe985
Compare
Summary
Phase 3 of AgentWorkforce/cloud#5806.
mergePolicy.mode: "auto"lands for real where shadow only planned:ci.flow.ts {"github":true}). A gate short enough to finish insiderunner.stageMinutesapplies its verdict in the same run. One that overruns dies with the sandbox — but theci/<sha>snapshot it pushed and the Actions runs it dispatched outlive it, so the next E run finds the snapshot (its parent is the head under test) and pollsgh run listuntil the dispatched runs complete. Bookkeeping in<stateDir>/github-gate.json, capped atGITHUB_GATE_MAX_ATTEMPTSdispatches /GITHUB_GATE_MAX_POLLSawaits. Red feeds the fix loop like a closed gate (round cap, stuck-finding, not-decreasing all apply); green moves to F.<commit>:refs/heads/<base>withRelay-Session/Land-Runtrailers. Base moved since the last gate → D; non-fast-forward push → D. Other push failures →needs_human.fixLoop.harnessacceptsclaude|codex|grok|devin, defaultcodex, and is passed to the review flows as theirclis.pushed:falseplan; Cloud still maps shadowlanded→would_land.approvalremains declined.Test plan
npm testinexamples/land— 72/72 pass, covering every new transition (E pending/green/red, F pushed/moved/non-FF, mode discipline, trailers in the commit message,ci/<sha>deletion)npm run typecheckcleanflows check land.flow.tspassedGenerated with Devin
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Implements
mergePolicy.mode: "auto"so the land flow really lands changes — running the repo's GitHub gate at stage E and squash-pushing to the base branch at stage F — where shadow mode only planned them.Behavior
ci/<sha>snapshot and dispatched Actions runs outlive it, so the next E run awaits them viagh run list, capped at 3 dispatches and 6 await runs.Relay-SessionandLand-Runtrailers; a moved base or non-fast-forward push returns to D. A stage reaped after the push records the landed commit instead of landing twice.fixLoop.harnessacceptsclaude|codex|grok|devin(defaultcodex) and passes the chosen CLI to the review flows;grokanddevinare refused at stage one until their worker adapters land.pushed:falseplan), andapprovalis still declined. Auto preflightsghauth and a dry-run push at stage one.Written for commit 09fe985. Summary will update on new commits.
Agent Relay sessions
devinsessiongorgeous· opened viagh pr create· last active 2026-11-02