Skip to content

GitLab plan-run guard: a forge that cannot self-merge must refuse the d… - #12

Open
RandomFish227 wants to merge 2 commits into
mainfrom
warren/run_1t1rfarfnrtq
Open

GitLab plan-run guard: a forge that cannot self-merge must refuse the d…#12
RandomFish227 wants to merge 2 commits into
mainfrom
warren/run_1t1rfarfnrtq

Conversation

@RandomFish227

Copy link
Copy Markdown
Owner

Summary

feat(forge): GitLab plan-run guard — autoMerge capability + dispatch refusal (warren-3e09)

Run

  • Warren run: run_1t1rfarfnrtq
  • Agent: claude-code
  • Cost: $3.93 (96 in / 34.2k out / 9.9M cache-r)

Seeds

  • warren-3e09 — GitLab plan-run guard: a forge that cannot self-merge must refuse the dispatch, not time out

Commits (2)

  • ae0214b feat(forge): GitLab plan-run guard — autoMerge capability + dispatch refusal (warren-3e09)
  • 271c44c chore(warren): seeds state

Files changed

.seeds/issues.jsonl                     |  2 +-
 src/forge/contract.ts                   | 13 +++++++++
 src/forge/fake/fake-forge.test.ts       |  1 +
 src/forge/fake/fake-forge.ts            |  3 ++
 src/forge/github-app/provider.test.ts   |  1 +
 src/forge/github-app/provider.ts        |  1 +
 src/forge/github/provider.test.ts       |  1 +
 src/forge/github/provider.ts            |  1 +
 src/forge/gitlab/merge-requests.test.ts | 52 ++++++++++++++++++++++++++++++++-
 src/forge/gitlab/provider.test.ts       | 17 +++++++++++
 src/forge/gitlab/provider.ts            | 32 ++++++++++++++------
 src/forge/registry.ts                   | 11 ++++---
 src/plan-runs/create.test.ts            | 36 ++++++++++++++++++++++-
 src/plan-runs/create.ts                 | 30 ++++++++++++++++++-
 src/plan-runs/errors.ts                 | 15 ++++++++++
 src/server/errors.ts                    |  9 +++++-
 src/server/handlers/plan-runs.ts        |  2 ++
 17 files changed, 207 insertions(+), 20 deletions(-)

Prompt

Show prompt
Implement seeds issue warren-3e09. Run `sd show warren-3e09` first — its
description is the full specification and it is more precise than this prompt.

Short version: the GitLab forge arm just landed on main. Single runs work.
Plan-runs do not, and they fail silently: warren merges through GitHub's
auto-merge WORKFLOW rather than through the Forge seam, a GitLab project has
no such workflow, so nothing transitions the MR and the plan-run waits until
parent_pr_merge_timeout with no cause named. Make that incapacity explicit —
add a capability flag, and refuse the dispatch up front instead of timing out.
Single runs must keep working; prove it with a test.

The seed also lists three smaller items to fix in the same PR: two doc
inaccuracies in freshly landed code (src/forge/registry.ts claims a
parseRepoRef chain walker that does not exist; src/forge/gitlab/provider.ts
should record the nested-group on-disk layout collision without fixing it),
and one missing test (the GitLab 409 duplicate recovery against a LOCKED
merge request).

Read these before you start:
  - src/forge/contract.ts, especially ForgeCapabilities and the comment at
    :180 about mergePullRequest being deliberately absent
  - src/forge/gitlab/provider.ts, whose doc block already describes this exact
    limitation under PLAN-RUN LIMITATION
  - src/plan-runs/merge-gate.ts and src/runs/pr-merge.ts
  - warren-75e8, which carries the fork-local build constraints

HARD CONSTRAINTS. These are gates, not preferences:
  - `bun run check:all` must pass, all 12 gates. It is also the pre-commit
    hook. Do NOT commit with --no-verify.
  - Do NOT lower any floor in scripts/coverage-budgets.json.
  - Do NOT delete, skip, or .todo a test to make a gate pass.
  - Do NOT add an entry to scripts/debt-marker-allowlist.json.
  - Do NOT edit the existing contract.ts wording about mergePullRequest being
    deliberately absent. A capability flag describes whether the forge's
    ecosystem self-merges; it does not contradict that.
  - Any wire-visible enum value belongs in src/core/wire.ts and nowhere else.
  - check:size caps files at 500 lines and forge files get no budget entry.
  - Biome cognitive-complexity ceiling is 15. resolveForge in
    src/forge/registry.ts was deliberately refactored into per-arm builders to
    stay under it — do not re-inline it.

If you conclude the capability-flag approach is wrong, say so in the PR body
with your reasoning rather than silently implementing something else.

🤖 Opened by warren run run_1t1rfarfnrtq

RandomFish227 and others added 2 commits August 27, 2026 14:26
…refusal (warren-3e09)

Add ForgeCapabilities.autoMerge (true for GitHub/Fake, false for GitLab) and
refuse plan-run dispatch up front when the forge cannot self-merge PRs, rather
than silently timing out at parent_pr_merge_timeout with no cause named.

Also:
- Fix registry.ts doc: no chain walker exists; a null parseRepoRef means
  "this process's forge does not own the URL"
- Update gitlab/provider.ts doc: PLAN-RUN LIMITATION reflects the new guard;
  adds NESTED-GROUP LAYOUT COLLISION note (fail-loud, tracked separately)
- Add test pinning GitLab 409 duplicate recovery against a locked MR
- ForgeCannotAutoMergeError → HTTP 424 (unsupported family)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant