feat(surface): give the gitlab helper its issue and merge-request surface

Merged
KH
1mo ago
+636-179

The gap

Ctx exposes a first-class f.gitlab helper, GitLab is listed as a supported provider, and the trigger surface is generous — but the helper could only post. Its writeback catalog was comments + discussions against GitHub's eight, so a GitLab-sourced factory could not list issues, read an issue, or open a merge request through the helper. Authors used glab instead, splitting the integration across two mechanisms for one journaled comment.

Why this is a dependency bump and not a new client

f.gitlab is generated (scripts/generate-helpers.mjs) from WRITEBACK_PATH_CATALOG in @relayfile/adapter-core, reached through the @relayfile/relay-helpers pin in packages/surface/package.json. Each catalog resource becomes .read() / .list() / .write() / .path(). The catalog was the missing piece, not the helper.

relayfile-adapters#282 added the GitLab writeback resources (shipped in adapter-core 0.6.x), and relay-helpers@0.4.12 is the first release that depends on a core carrying them — npm could never resolve the old ^0.5.x range to 0.6.x, which is why this was blocked until that republish.

Result, verified against the built surface

f.gitlab.issues               read/list/write/path
f.gitlab.merge-requests       read/list/write/path
f.gitlab.refs                 read/list/write/path
f.gitlab.merge                read/list/write/path
f.gitlab.close-merge-request  read/list/write/path

GitLab goes from 2 writeback resources to 7, against GitHub's 8.

What changed, and why some files did not

  • packages/surface/package.json + lockfile: @relayfile/relay-helpers 0.4.11 → 0.4.12 (resolves adapter-core 0.6.2).
  • src/helpers/gitlab.ts is unchanged — a provider's resources come from the type of its client (ReturnType<typeof gitlabClient>), not from enumerated code, so the surface expands with no edit to that file. That is the design working as intended.
  • src/helpers/ramp.ts + clients.ts: generator-driven, not hand-edited. 0.4.12 exports a real rampClient, so the generator drops the generic providerClient("ramp") fallback.
  • workflows/gitlab-surface-parity.flow.ts (new): performs this bump end to end — probes the registry for a relay-helpers whose transitive catalog really carries the resources (installs and reads it, rather than trusting a version range), bumps, regenerates, asserts the built surface, has an agent fix stale docs, and opens a PR. It declines with the exact blocking dependency edge when no usable version exists. A run today is a no-op; it earns its keep on the next catalog bump.

Checks

  • npm test --prefix packages/surface — 50/50 pass, including helpers.snapshot.test.ts (the gate that catches generator drift).
  • Runtime assertion of all five resources against dist/helpers/gitlab.js — pass (output above).
  • flows check workflows/gitlab-surface-parity.flow.ts — CHECK PASSED.
  • typecheck:examples — 0 errors from the added file. It does report 2 pre-existing errors in workflows/stuck-run-triage.flow.ts (Cannot find name 'URL'); identical count with the file removed, so they are not from this PR and are left alone.

Note for maintainers: a preflight false positive

flows check refuses any flow whose string literals contain f.<provider>, even when the helper is never called:

f.run("echo f.gitlab")   → REFUSED [helper_provider.mount_required]
f.run("echo f.github")   → REFUSED
// f.gitlab in a comment → passes

Cloud's equivalent (flow-source-requirements.ts) deliberately blanks strings and comments so "f.slack.post" names nothing; the SDK blanks only comments. The practical effect is that a flow cannot mention a helper in a prompt, shell command, or PR title without being forced to declare a mount it does not use. The new flow works around it by keeping the token out of strings. Worth fixing separately.

🤖 Generated with Claude Code


[!NOTE]
Medium Risk
Expands the published GitLab integration surface via upstream adapter catalog changes and adds npm overrides that affect install resolution; the new workflow can commit and force-push when run on a clean tree.

Overview
Bumps @relayfile/relay-helpers from 0.4.11 to 0.4.12 in packages/surface and packages/sdk (with lockfile refreshes) so the generated f.gitlab helper picks up the GitLab writeback resources from adapter-core 0.6.x—issues, merge-requests, refs, merge, and close-merge-request with read/list/write/path—without editing gitlab.ts.

Adds an overrides block in packages/sdk/package.json so npm resolves @relayflows/surface’s relay-helpers peer to the SDK’s pinned version, keeping npm ci working across callers.

Regenerated Ramp wiring now uses upstream.rampClient instead of a generic providerClient("ramp") fallback in clients.ts / ramp.ts.

Introduces workflows/gitlab-surface-parity.flow.ts and gitignores parity/ so future catalog bumps can probe npm, bump/regenerate, assert the built helper, update docs, and open a PR; with 0.4.12 already applied, a first run is expected to no-op at the “already resolved” path.

Reviewed by Cursor Bugbot for commit 0b3a75e924337d8de94cdcffeb1a1da95f53eabe. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Bumps @relayfile/relay-helpers from 0.4.11 to 0.4.12 so the generated f.gitlab helper gains its issue and merge-request surface: issues, merge-requests, refs, merge, and close-merge-request, each with read/list/write/path. No GitLab method is hand-written; the helper is regenerated from the adapter-core writeback catalog, so src/helpers/gitlab.ts is unchanged. ramp.ts and clients.ts drop the generic providerClient("ramp") fallback because 0.4.12 exports a real rampClient.

SDK peer resolution

  • Adds an overrides entry in packages/sdk/package.json pointing the published surface's exact relay-helpers peer at the SDK's own 0.4.12, which lets npm ci succeed in every caller without workflow or script edits. This replaces an earlier attempt that patched scripts/surface-package-gate.sh with --legacy-peer-deps and --force, which was reverted because the same install runs in publish and schema workflows.
  • The override becomes a no-op once a surface carrying peer 0.4.12 is published.

Automation

  • Adds workflows/gitlab-surface-parity.flow.ts, which probes the registry, bumps, regenerates, asserts the built surface, updates docs, and opens the PR, so the next catalog bump needs no human.
  • The flow now rewrites the pin under peerDependencies, ignores its parity/ scratch tree, and refuses a dirty worktree before staging so unrelated edits cannot ride along to the forced push.

Agent Relay sessions

  • claude session 7fa0c082 · opened via gh pr create · last active 2026-09-21