Skip to content

Feature request: GitLab forge backend (pluggable VCS/ticketing) — working prototype included #1325

Backlog

Description

@srslypleaswaite

Feature request: GitLab forge backend (pluggable VCS/ticketing) — working prototype included

Summary

The Horizon 2 roadmap section Pluggable VCS and Ticketing says:

Unbound Force is currently GitHub-only — Issues, PRs, Actions, the gh
CLI. Real-world adoption requires GitLab support — Merge Requests instead
of Pull Requests, GitLab CI instead of GitHub Actions, the Files API for
knowledge store operations. … The coupling is in the CLI commands and
workflow scripts that assume GitHub. Pluggable backends for VCS
operations and ticketing operations make the agent layer portable across
platforms.

We run Unbound Force (uf v0.23.0, full scaffold: OpenSpec tier, Divisor
council, convention packs) across a nine-repository GitLab group on a
self-hosted enterprise GitLab instance. The forge-agnostic core works
perfectly there — /opsx-*, /speckit.*, /uf.unleash,
/uf.review-council, /gaze, Replicator worktrees, Dewey — because it
operates on local git and files. Only the six GitHub-aware commands are
unusable for us.

What we did

We prototyped the refactor the roadmap describes, on the current command
set, without forking anything:

  • A gitlab-forge-backend skill defining a small verb interface
    over issues, merge requests, and CI pipelines (issue_get,
    issue_notes, mr_get, mr_diff, pipeline_latest, job_trace,
    mr_note, issue_add_labels, job_retry, …), implemented with the
    glab CLI — the natural twin of gh (OAuth'd, JSON output, same
    invocation shape).
  • Three glab-backed command twins — /gl.triage-issue,
    /gl.review-mr, /gl.fix-ci — that preserve the originals'
    semantics: Divisor fan-out, deterministic-checks-first ordering,
    untrusted-content rules, confirmation-gated mutations, one JSON artifact
    per run, rebase-only CI sync with force-push lease.

The prototype runs daily against real GitLab-hosted repositories. The
safety rails carried over unchanged; only the transport changed.

Why an issue (and not just a PR)

The roadmap paragraph is the only existing guidance — there is no spec, RFC,
or design doc for the backend interface yet, and we would rather converge
on the interface shape with you before porting all six commands. A PR with the working
prototype (the backend skill plus the three command twins) is linked below,
and the full design RFC is posted as a comment on this issue.

Questions for maintainers

  1. Interface placement — should the verb interface live in a shared
    skill (as in our prototype), in the TypeScript plugin layer, or in uf
    itself as a subcommand surface?
  2. Boundary with FullSend — the Now-horizon FullSend BYOA integration
    gives UF a path to GitLab through FullSend's forge abstraction. Our
    reading is that command-layer portability (this proposal) and
    infrastructure-layer dispatch (FullSend) are complementary, not
    competing — but we would like your framing before investing in the
    remaining three commands.
  3. glab distribution — uf setup already has tool_methods
    machinery (gaze, replicator). Should the GitLab backend add a glab
    method with the same treatment?

Environment

  • uf v0.23.0, glab v1.134.0, self-hosted GitLab (issues, MRs, CI pipelines)
  • Repositories: Go, spec-first via OpenSpec, convention packs active

Happy to restructure any of this to fit the project's plans. The prototype
exists and is in daily use; the remaining work is upstreaming shape, not
proof of concept.

Activity

  1. srslypleaswaite commented on Dec 1, 2026

    @srslypleaswaite
    Author

    RFC: Pluggable VCS and Ticketing Backends — GitLab parity for the forge layer

    Follow-up to the Horizon 2 roadmap item "Pluggable VCS and Ticketing."
    A working prototype exists and is described below.

    Problem

    Six commands are the forge layer — the bridge between the local swarm and
    the hosting platform's collaboration objects:

    Command Forge surface
    /uf.triage-issue Issues
    /uf.review-pr Pull requests
    /uf.address-feedback PR review comments
    /uf.fix-ci CI runs
    /uf.rebase-pr PR branch state
    /uf.finale Merge/ship

    All six are hardwired to the gh CLI and GitHub's object model. Teams
    hosting on GitLab can use the entire forge-agnostic core — specs, swarm,
    council, convention packs, worktrees — but none of these six. The coupling
    is confined to the command files themselves; agents, packs, and the
    constitution are already VCS-agnostic markdown.

    Proposal

    Introduce a forge backend interface with two axes, matching the
    roadmap's "VCS operations and ticketing operations":

    1. The verb interface

    A small, closed set of operations that the six commands consume. From the
    working prototype (GitLab column shown; GitHub column is today's gh
    usage extracted from the commands):

    Verb GitHub (gh) GitLab (glab)
    issue_get gh issue view --json glab api projects/<enc>/issues/<iid>
    issue_notes gh api .../issues/N/comments glab api .../issues/<iid>/notes
    issue_add_labels gh issue edit --add-label glab api -X PUT ... -f add_labels=
    issue_create_child gh issue create glab api -X POST .../issues
    mr_get / mr_diff gh pr view/diff glab api .../merge_requests/<iid>(/changes)
    mr_note gh pr comment glab api -X POST .../notes
    pipeline_latest / job_trace gh run list/view --log glab api .../pipelines, .../jobs/<id>/trace
    mr_rebase / mr_merge gh pr update-branch/merge glab api -X PUT .../rebase, glab mr merge
    job_retry gh run rerun glab api -X POST .../jobs/<id>/retry

    2. Backend selection

    • Detect from git remote get-url origin (host contains gitlab. →
      GitLab backend; github.com → GitHub backend).
    • Explicit override (argument or UF_FORGE env) wins over detection.
    • Fail closed on unknown hosts with a clear message.

    3. Implementation substrate

    Both backends are authenticated CLI wrappers (gh, glab) rather than
    API clients:

    • No new Go/TS dependencies; auth is user-managed, matching today's gh
      assumption.
    • JSON output parity: glab api returns raw GitLab JSON, exactly as the
      commands already consume gh api JSON.
    • glab distribution rides the existing uf setup tool_methods
      machinery (as gaze and replicator already do).
    • Self-hosted instances need host configuration (glab auth login --hostname); the backend skill documents it once.

    What changes for the six commands

    Mechanical refactor, one command per OpenSpec change:

    1. Extract every gh invocation into the verb interface.
    2. Replace GitHub object vocabulary at the command boundary (pull request →
      merge request, check run → pipeline job) while keeping command names
      and semantics stable.
    3. Add a backend-detection preamble and per-forge field mapping (e.g.
      GitLab notes vs GitHub comments pagination shapes).

    Everything the commands already guarantee carries over unchanged:
    untrusted-content rules, deterministic-checks-first ordering, Divisor
    fan-out and model-matrix dispatch, confirmation-gated mutations,
    checkpoint/progress tracking, one JSON artifact per run.

    Working prototype

    Three of the six commands have been ported and run daily against a
    self-hosted enterprise GitLab (nine repositories, Go, spec-first):

    • gitlab-forge-backend skill — the verb interface above, with safety
      rules, project-path resolution (URL-encoded %2F paths), and
      pagination/validation requirements
    • /gl.triage-issue — Ingest → Assess (5-persona Divisor fan-out) →
      Classify → Act, confirmation-gated labels/comments/child issues
    • /gl.review-mr — deterministic checks first, light/full council modes,
      structured findings posted as a single MR note; approve/merge stay human
    • /gl.fix-ci — evidence-grounded job-log diagnosis, failure
      classification (deterministic / flaky / infra / merge-skew), rebase-only
      sync with --force-with-lease, gated fix loop, retry path for
      flaky/infra

    The port took roughly a day for three commands; the verb interface is the
    part worth converging on, since the rest is translation.

    Relationship to FullSend

    The Now-horizon FullSend BYOA integration gives agents a path to GitLab
    through FullSend's forge abstraction. These are complementary layers:

    • FullSend owns infrastructure dispatch: which agent runs where, on
      which event, with what sandbox and credentials — across forges.
    • This proposal owns command portability: the same slash command
      working in an interactive session against whatever forge the repository
      lives on.

    A GitLab-hosted team should not need FullSend to run /uf.triage-issue
    locally, and a FullSend deployment should be able to dispatch
    GitLab-capable agents to these same commands.

    Non-goals

    • Forgejo/Bitbucket backends (the interface should permit them; no plans)
    • Changing agent, pack, or constitution formats — already VCS-agnostic
    • Auto-merge or approval automation changes — human gates stay

    Open questions

    1. Interface placement: shared skill (prototype's choice), TypeScript
      plugin tool, or uf subcommand?
    2. Should the GitHub backend be a thin extraction of today's gh calls
      (zero behavior change) or normalized to the verb shapes exactly?
    3. Dewey's Files API surface (roadmap's third item) — separate change?
    4. Testing: behavior tests against a containerized GitLab, or recorded-
      fixture replay?

    Migration plan

    1. Land the verb interface + GitHub extraction (no user-visible change).
    2. Port /uf.triage-issue (ticketing axis) behind the interface.
    3. Port /uf.review-pr and /uf.fix-ci (VCS axis).
    4. Port /uf.address-feedback, /uf.rebase-pr, /uf.finale.
    5. Dewey Files API operations as a follow-up change.
  2. jflowers commented on Dec 3, 2026

    @jflowers
    Contributor

    Thanks for writing this up, and for running the prototype against a real GitLab. It shows the GitLab mapping actually works, which was the part I was least sure of.

    I think the interface is in the wrong place though. A good chunk of the forge layer already lives in the .opencode/ plugins as typed tools: fetch_pr_review_context, fetch_pr_checks, fetch_failed_run_logs, post_issue_comment, create_child_issue, post_feedback_replies, checkout_pr_head, uf_finale_create_pr, uf_finale_ci_poll. They share one error classifier (.opencode/lib/gh-error.ts), and most take their gh runner as an injected dependency. That injected runner is the seam. Put a GitLab adapter behind it and the commands don't change.

    The RFC's skill would tell the model which glab api call to make, how to encode %2F and how to paginate. That's exactly the mechanical procedural prose our Determinism gate says to keep out of commands and skills when a tool is feasible. So for open question 1, my vote is plugin tools, and I don't think it's close.

    Two more things I'd change.

    The verbs mirror the CLIs. If issue_get returns raw GitHub JSON in one repo and raw GitLab JSON in another, the model still has to know both shapes. I'd rather the tools return normalized objects (a change request with its diff, threads and checks). Notes vs comments, pipelines vs check runs and pagination would all stay in TypeScript, where we can test them.

    Forge and tracker are two axes, not one. Picking a single backend from origin can't express GitLab for merge requests plus Jira for tickets, which is the setup a lot of enterprise teams actually have. I'd split it into a forge adapter (github, gitlab) and a tracker adapter (github, gitlab, jira), configured separately in .uf/config.yaml, with the remote as the default for forge. That also brings up something the RFC doesn't cover yet: Closes #N in /uf.finale means nothing for a Jira key, so the tracker has to own how that link gets written.

    Order I'd suggest:

    1. Move the gh calls still written in command prose into tools, GitHub only. We owe that to the Determinism gate anyway.
    2. Put ForgeAdapter and TrackerAdapter interfaces behind the existing runner seams, with GitHub as the only implementation, and make the error classes forge neutral.
    3. Port your GitLab mappings into a glab adapter, then add a Jira tracker. Test them with recorded fixtures through the existing dependency injection. That answers question 4 without standing up a GitLab container.

    One tradeoff: plugins only run under OpenCode, so this wouldn't carry over to the gl.* skills in other harnesses. For this repo I think that's fine.

    Your verb table is still useful as the checklist of what the adapters have to cover. And I agree with the FullSend split.

    Would you be up for taking step 3 once 1 and 2 land? Your prototype is most of the way there.

  3. srslypleaswaite commented on Dec 4, 2026

    @srslypleaswaite
    Author

    I can take a stab at that. I'll sort out the other issues you raised and take a look.

    I've been using it in anger for the past few days and it seems to be holding up. The only real problems I've hit are that the model sometimes gets a little overly helpful and asking about the feasibility of a feature will on occasion get me a fully built, reviewed and committed code change. That's on me, though. I've also seen it get kinda dumb if it loses it's connection to the gitlab instance (because of a VPN drop or something) and it'll just keep retrying with longer and longer retry windows until I reconnect. Again, basically on my end. I'd rather see it recognize a bad network path and bail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions