Repository navigation
feat(bin): add GitLab --allow-no-pipeline merge waiver and close backlog items for GitLab MRs - #7462
Conversation
A GitLab repository that deliberately runs no merge request pipeline could never be merged through fm-pr-merge.sh: the guard requires a successful head pipeline at the current head, and GitLab has no per-check waiver. --allow-no-pipeline waives only the pipeline condition, and only when GitLab reports head_pipeline as present and null. A failed, running, canceled, or stale pipeline still refuses, every other condition (open, mergeable detailed_merge_status, no conflicts, discussions resolved) still holds, and the verified head is still passed to glab as --sha. The flag is attended-only (refused while the away-posture record exists), GitLab-only, and takes no value; without it the default refusal is unchanged.
tasks-axi accepts a --pr link only as a GitHub or Forgejo pull request, so after a GitLab merge request landed, teardown could never complete the backlog Done transition and left the close pending forever. Extend the existing Gerrit carve-out in fm_backlog_done and fm_backlog_retain, and the captain-hold answer replay that shares it, to record a GitLab merge request URL as a "GitLab merge request <url>" note, until tasks-axi accepts GitLab merge request URLs. GitHub and Forgejo pull requests are still recorded as pr links.
|
Speaking as Kun's firstmate: thanks @syarifid — reviewed tip Closes claim: your body says Diff review (safe):
Contract-class: opt-in + restore (my own read). The waiver stays off unless the captain passes the flag in an attended run. The GitLab note carve-out makes teardown's existing Done transition work again for GitLab tasks. VISION.md (each rule):
What I need from you: the merge waiver is the merge-authority part of this PR, and so far it has only been run against the glab fixture (1 of 6 scenarios live). When you have a chance, could you run it against a real GitLab project (gitlab.com free tier or self-hosted is fine) and post the transcripts plus a fresh API readback for each case? The cases: (a) an MR with no head pipeline is refused without the flag, (b) the same MR merges with Overlap FYI: #6866 (GitLab project delivery) also changes the GitLab no-pipeline gate, but in a different shape. It merges automatically when the project doesn't require pipelines, with no flag. It also adds a near-identical GitLab note carve-out. The two PRs conflict in |
|
Thanks for the review. I ran the waiver against a real gitlab.com project: a private throwaway, https://gitlab.com/syarifdn/fm-allow-no-pipeline-test, using (a) No head pipeline, no flag: refused. MR !1 has no Readback: (b) Same MR with Readback: (c) Failed head pipeline with Readback: The project and both MRs are left in place if you want to look. |
|
Speaking as Kun's firstmate: this is merged. Thank you @syarifid — really appreciate you taking the time on this. |
## Commits taken - d20196a feat(herdr): opt-in project groups with status tags and a sorted agents view (kunchenguid#7434) - ce69740 fix(bin): pin LC_ALL=C for remote job process identity reads (kunchenguid#7410) - 64dddf6 fix(opencode): ignore child stdin EPIPE in guard and encoder (kunchenguid#7447) - 11becbb fix(bin): ignore crew state overrides for other tasks (kunchenguid#5881) - eeeeb91 fix(bin): re-anchor a Claude session's lock so /clear keeps ownership (kunchenguid#7415) - 66c300b feat: support version URLs for watched tool updates (kunchenguid#7449) - 3094475 fix(pi): keep a live session's extension markers when a nested Pi command loads them (kunchenguid#7287) - f05b628 fix: reclaim orphaned Claude auto-arm claims (kunchenguid#5939) - c4f4333 feat(bin): add Polytoken crewmate/scout worker adapter (kunchenguid#7321) - 11990a2 Fix away branch relaunch admission (kunchenguid#7444) - 56074d0 fix(bin): show reported checks when a pull request's base requires none (kunchenguid#7450) - 0791268 fix: support durable per-secondmate account pins (kunchenguid#7452) - 4e6b9f5 feat(bin): consult operator evidence guards before wedge escalation (kunchenguid#6958) - c7b7798 fix(bin): make inbox listing succeed when the inbox is empty (kunchenguid#7460) - 63fc5eb fix: bound remote secondmate convergence and preserve owed re-reads (kunchenguid#7394) - 8ba34f1 fix: require positive daemon running status in crew-state (kunchenguid#7317) - 1aa2a21 fix(tests): stabilize supervision host drain and offer fixtures (kunchenguid#7467) - 69f9d09 fix(bin): refuse spawn into a project with an unborn HEAD (kunchenguid#6987) - 45dd50a feat(bin): add GitLab --allow-no-pipeline merge waiver and close backlog items for GitLab MRs (kunchenguid#7462) ## Conflict decisions - `.agents/skills/operational-home-layout/SKILL.md`: Fork seat configuration; upstream per-secondmate account configuration. Decision: Keep both configuration entries. - `bin/backends/herdr.sh`: Fork send-failure/recovery semantics and harness variable; upstream Polytoken busy override. Decision: Keep fork send-failed and recovery handling; add Polytoken busy identity without losing the fork harness variable. - `bin/fm-backlog-transition-lib.sh`: Fork cached library directory; upstream GitLab completion support. Decision: Keep cached source path and extend forge ownership comment to GitLab; accept GitLab completion path. - `bin/fm-config-inherit-lib.sh`: Fork Claude/Codex seat inheritance; upstream Herdr project groups. Decision: Union the allowlist; per-secondmate account pins remain local to the primary home. - `bin/fm-control.sh`: Fork pre-stop seat checks; upstream per-mate pins and Polytoken launch checks. Decision: Select the per-mate pin while retaining its returned account for seat conflict validation; keep all Polytoken pre-stop checks. A valid explicit pin supersedes the old recorded Claude store on relaunch. - `bin/fm-harness.sh`: Fork in-process HARNESS_VERDICT result; upstream echo-based Polytoken detection. Decision: Add Polytoken through the fork verdict convention, retaining existing adapter detection. - `bin/fm-lock.sh`: Fork handover reservation and runtime publication; upstream session re-anchor lease/auto-arm locks. Decision: Share the existing claim lock and release helper, add lease/auto-arm locking, then publish runtime and clear an admitted handover before releasing locks. - `bin/fm-pr-state.sh`: Fork shared required-check evaluator from dbe11b1 and 91371c8; upstream 56074d0 adds a second gh pr checks fallback. Decision: Keep one evaluator through fm-pr-checks.sh and fm-pr-checks-lib.sh. It already checks non-advisory reported checks on unprotected bases, includes missing configured requirements, and fails closed on read errors. Adapt upstream regressions to this API; preserve the fork REQUIRED CHECK label and advisory policy. - `bin/fm-spawn.sh`: Fork parked-session resume, seats, unclaimed-worktree guard and ticket hook; upstream Polytoken, per-mate accounts and Herdr groups. Decision: Compose both paths, retain validate_spawn_worktree_unclaimed, seat gates, profile trust and metadata, and both hooks. Extend pin/seat refusal to the selected per-mate pin while retaining the primary-home seat guard. The selected durable Claude pin owns trust and recorded store on relaunch so old seats cannot override it. - `bin/fm-teardown.sh`: Fork merged-at/park record cleanup and isolation protections; upstream generated Polytoken wiring cleanup. Decision: Keep fork cleanup and guards; add only task-owned Polytoken files and generated untracked wiring to existing guarded teardown. - `bin/fm-test-run.sh`: Fork timing entries and pipeline-spend suite; upstream Herdr-group and Polytoken suites. Decision: Union suite entries, preserve fork timing measurements for existing suites. - `bin/fm-wake-lib.sh`: Fork single-read auto-arm ledger parser; upstream session-owner identity fields. Decision: Extend the single-read parser with owner_session_id and the third-line lock identity; retain orphan recovery and lease logic. - `bin/fm-watch.sh`: Fork bounded run-activity deferral and escalation wording; upstream operator evidence guard. Decision: Keep both bounded deferrals and append operator guard evidence to both ordinary and deep-inspection escalations. Keep exact owned watcher termination semantics. - `docs/agent-control.md`: Fork seat relaunch policy; upstream per-mate account selection. Decision: Describe both policies with account pin checked before stopping the live agent. - `docs/configuration.md`: Fork seat sections and ticket timeout; upstream per-mate pins and remote convergence settings. Decision: Keep all sections, place per-mate pins under worker accounts before the seat sections, and retain all timeout entries. - `tests/fm-control-relaunch.test.sh`: Fork fixture cleanup and seat regressions; upstream account and away-admission regressions. Decision: Keep fixture-scoped cleanup and all regression calls; extend the changed-pin case to check trust in the new store and recorded profile. - `tests/fm-crew-state.test.sh`: Fork no-fork metadata parsing test; upstream override-identity tests. Decision: Keep both test bodies and calls, plus upstream positive daemon-status cases. - `tests/fm-pr-merge.test.sh`: Fork named-case local selector; upstream GitLab waiver test definitions. Decision: Place upstream definitions before the named-case selector and retain every case. - `tests/fm-supervision-host.test.sh`: Fork split helper/suite layout; upstream snapshot-aware offer fixture. Decision: Update the shared supervision-host-helpers.sh implementation and retain its split consumers rather than duplicate the helper in one suite. - `tests/fm-teardown.test.sh`: Fork collision/released-claim cases; upstream Polytoken cleanup cases. Decision: Keep all regression calls. - `tests/fm-watch-triage.test.sh`: Fork split classifier/stale/delivery suites; upstream unsplit suite with four new operator-guard cases. Decision: Keep the split and move only new guard fixtures/cases into fm-watch-triage-stale.test.sh; do not resurrect duplicated legacy test bodies. ## Additional integration and verification decisions - Preserve fork teardown, merge, push, worktree ownership/isolation, and exact-owned watcher termination guards. GitLab no-pipeline waiver remains explicit, attended-only, GitLab-only, and only accepts an explicit null pipeline; default and existing-pipeline safety checks remain in force. - Existing pull-request CI selects subsets and cannot prove the requested full suite. Add a manual CI workflow trigger using the existing full-suite fallback, so the feature head can run every required lane before landing; document that entry point. No local full suite or real Herdr lifecycle run is authorized.
Intent
yes, go ahead with both fixes
Context: the fixes are the two gaps in upstream issue #7355, which the maintainer confirmed on main 9b1ada0 and labeled ready-for-pr.
bin/fm-pr-merge.shcan never merge a GitLab merge request in a repository that runs no merge request pipeline, even on an explicit captain order, because the GitLab guard requires a successful head pipeline and GitLab has no waiver. The maintainer's accepted shape: an opt-in, attended-only--allow-no-pipeline, refused under the away posture, scoped to a present-and-nullhead_pipelineonly (never a failed, running, canceled or stale pipeline verdict), with the default refusal byte-identical without the flag; a project's "pipelines must succeed" setting still refuses throughdetailed_merge_status.bin/fm-teardown.shcannot complete the backlog Done transition, because tasks-axi rejects GitLab/-/merge_requests/NURLs as pr links. The maintainer's accepted shape: restore parity with the existing Gerrit carve-out infm_backlog_done/fm_backlog_retain(bin/fm-backlog-transition-lib.sh), recording a GitLab merge request URL as a note so cleanup completes, until tasks-axi accepts GitLab MR URLs.One pull request to kunchenguid/firstmate covering both fixes, linked to the issue.
run /no-mistakes and open the PR to kunchenguid/firstmate for issue 7355
What Changed
bin/fm-pr-merge.shaccepts a new attended-only--allow-no-pipelineflag for GitLab.It waives the pipeline check only when GitLab reports
head_pipelineas present and null.A failed, running, canceled, or stale pipeline still refuses, every other mergeability check still applies, and a project that requires pipelines to succeed still refuses through
detailed_merge_status.The flag is refused on GitHub and Forgejo, refused while the away-posture record exists, and rejected if given a value.
Without the flag, the default refusal is unchanged.
bin/fm-backlog-transition-lib.shreplacesfm_backlog_pr_is_gerrit_changewithfm_backlog_pr_note_label.fm_backlog_done,fm_backlog_retain, and the retained-close path inbin/fm-captain-hold.shnow record a GitLab merge request URL as aGitLab merge request <url>note, the same way they already handled Gerrit changes.tasks-axi rejects GitLab MR URLs as
--prlinks, so this lets teardown finish the Done transition after a GitLab merge request lands.AGENTS.md, the afk skill, the branch prompt, and the captain-hold, GitLab merge-watch, and Pi supervision docs now describe the new waiver and the GitLab note handling.New tests in
tests/fm-pr-merge.test.shandtests/fm-teardown.test.shcover both behaviors.Closes #7355
🤖 Generated with Claude Code
Risk Assessment
✅ Low: Both fixes are opt-in or narrowly scoped and match the maintainer's accepted shape: the waiver only applies to an attended run with a head_pipeline that is present and null, the away posture is refused both before metadata is recorded and inside the locked critical section, every other GitLab condition still holds, the default refusal is unchanged without the flag, and the backlog GitLab note mirrors the existing Gerrit carve-out at every consumer.
Testing
I drove the teardown scenario live with the real tasks-axi 0.2.6. On the base commit, teardown exits 1 and leaves the item in_flight with a pending-close marker. On the target commit, it exits 0, marks the item done with the note "GitLab merge request <url>", and removes the marker. The fm-pr-merge waiver scenarios and the non-GitLab teardown regressions ran only through the repo's forge fixtures and targeted tests, and those all passed. No GitLab instance or glab credentials were available, so those scenarios are not live and are reported as untested. This is a CLI-only change, so there is no visual evidence.Evidence: Teardown of a landed GitLab task at base (real tasks-axi rejects the URL, item stays in_flight)
Source: Teardown of a landed GitLab task at base (real tasks-axi rejects the URL, item stays in_flight)
Evidence: Teardown of a landed GitLab task at target (item done, merge request URL recorded as a note)
Source: Teardown of a landed GitLab task at target (item done, merge request URL recorded as a note)
Evidence: fm-pr-merge default no-pipeline refusal at base (glab fixture)
Source: fm-pr-merge default no-pipeline refusal at base (glab fixture)
Evidence: fm-pr-merge --allow-no-pipeline scenario transcripts at target (glab fixture)
Source: fm-pr-merge --allow-no-pipeline scenario transcripts at target (glab fixture)
Evidence: Targeted fm-pr-merge test run
Source: Targeted fm-pr-merge test run
Evidence: Targeted fm-teardown test run
Source: Targeted fm-teardown test run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
Targeted copies oftests/fm-pr-merge.test.shrunning onlytest_allow_no_pipeline_merges_only_a_null_head_pipeline,test_allow_no_pipeline_is_attended_only_and_gitlab_onlyandtest_allow_missing_follows_the_allow_red_rulesTargeted copy oftests/fm-teardown.test.shrunning onlytest_teardown_closes_a_gitlab_task_with_its_merge_request_url_as_a_noteandtest_teardown_closes_a_gerrit_task_with_its_change_url_as_a_notetasks-axi done t1 --pr https://gitlab.example.com/group/sub/repo/-/merge_requests/12against real tasks-axi 0.2.6: rejected with VALIDATION_ERROR, confirming the upstream refusalRealbin/fm-teardown.shwith the unmodified real tasks-axi 0.2.6 on a landed GitLab task, at base c7b7798 (from git archive) and at target 4fa2233bin/fm-pr-merge.shCLI transcripts at base and target through the repo's GitLab fixture: default no-pipeline refusal, the waiver on a null pipeline, failed/running/canceled/stale pipelines, ci_must_pass, away posture, valued flag, green pipeline; default refusal diffed between base and target✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Note on a pre-existing local test failure
tests/fm-pr-merge.test.sh'sforgejo-mergescase fails locally on unchanged main (c7b7798) as well, with "the combined commit status is "unreadable"", so it is unrelated to this change and left untouched here.