Sm Gitlab
The GitLab state engine for the machine loop. Each tick it reads GitLab issue and merge-request state through the GitLab SM provider and dispatches review, rework and development legs. This is not full parity with sm_github.json yet. The GitHub-only lanes are switched off until GitLab support exists (see “GitLab engine gaps”).
Selecting GitLab
jobParams.scm.provider: "gitlab"insm_gitlab.jsonselects GitLab for the whole tick.js/smAgent.jsapplies it over the project config’sscm.provider, and it reaches dispatch, MR labels and the SM probes.- Every rule uses
source: "gitlab".js/sm/sourceResolver.jssends these rules to the forge-portable state source, which runs against the GitLab SM provider (js/common/smProvider.js). Agitlabrule always dispatches through the GitLab SCM, even when the project config names another forge. - You can also set
scm: { provider: 'gitlab' }in the consuming repo’s.dmtools/config.js, or passcustomParams.scmProvider.
Enabled rules
Only the dispatch-only rules (no localAction) are enabled:
rework-on-red-cirework-on-labeldev-on-assignmentreview-after-devreview-external-oncereview-machine-unlinkedreview-on-labelreview-on-issue-label
Each rule’s description points to its sm_github.json twin, which documents the operational contract. All other rules ship with enabled: false, and the description names the reason.
Teammate pipeline dispatch
The GitLab ai-teammate.yml pipeline expects FACTORY_ISSUE or FACTORY_MR (exactly one), FACTORY_LEG, and FACTORY_REASON. The SCM adapter translates the rules’ issue, pr, leg, reason, and optional checkout_ref inputs to their FACTORY_* counterparts, preserving explicit FACTORY_* overrides.
Enabled teammate rules use the configured default workflow ref, not the MR source branch. Set workflowRef in the consuming repository’s .dmtools/config.js to its default branch if it is not main. The teammate fetches the MR head separately; dispatching the pipeline on the MR branch is rejected by the generated default-branch workflow/job rules.
If a review leaves only rework-round:N and no rework pipeline, inspect the SM dispatch errors and confirm the agents pack includes this dispatch contract. The round label records the review’s rework request, not a successful dispatch. Once updated, re-add agent:rework to the MR if it was consumed, then run a non-dry-run SM tick. Manual web SM runs generated by the factory use SM_DRY_RUN: "true"; scheduled ticks use "false".
GitLab engine gaps
- Machine verdict records. GitLab has no verdict records. The
reconcile_verdictsrules would never match, and thenotLatestVerdictmerge/validation vetoes would fail open. Those rules are disabled. - Close issue. The bridge has no close-issue tool, so
close-on-mergeis disabled.closeIssuewarns and does nothing. It never posts an MR note keyed by an issue iid. - Issue labels. The bridge has no issue-label tool. Label writes on issue carriers (
gh-<iid>, for exampleconsumeLabelson an issue rule) are skipped with a warning. MR carriers (pr-<iid>) usegitlab_add_mr_label/gitlab_remove_mr_label. - Local actions. Merge, validation, branch update, rerun of cancelled checks, rework/review arming, plan advance and guest transplant still call GitHub-only tools in
js/smAgent.js. Their rules are disabled. The GitHub-only naked-PR sweep and dispatch-failure park bookkeeping are skipped on a GitLab tick. - Busy detection.
activeMachineRunscannot map a pipeline to an issue, so busy detection is conservative. - runAsync fan-out. GitLab has no cache snapshot preseed. Issue search runs sequentially over a single cached
gitlab_list_issuespage of 100 open issues. - Guest transplant.
smGuestTransplantis{ "enabled": false }. An empty object would turn on the transplant defaults.
Parameters
Set these in jobParams in sm_gitlab.json.
maxTriggeredWorkflows— maximum workflows dispatched in one tick.validationConcurrency— maximum concurrent validation runs once the approved queue reaches the watermark.validationConcurrencyQueueWatermark— approved queue depth that turns on concurrent validation.smGuestTransplant— guest-transplant settings (disabled on GitLab).scm— forge selection ({ "provider": "gitlab" }), read byjs/smAgent.js.rules— GitLab issue and merge-request rules processed byjs/smAgent.js.
Human doc: agents/docs/agents/sm_gitlab.md
Attributes
| Attribute | Value |
|---|---|
| Job | JSRunner |
| Config | sm_gitlab.json |
| ContextId | — |
| outputType | — |
| skipAIProcessing | false |
Prompt snapshot
Full prompt / instruction set: agents/snapshots/sm_gitlab.md
Actions
LLM step
- outputType:
none - Prompt snapshot:
agents/snapshots/sm_gitlab.md
Generated by js/agentDocGenerator.js