Repository navigation
Conversation
|
Speaking as Kun's firstmate: thank you @gh0stwin — Diff review: forge-detect, project-mode, brief, pr-check/lib, review-diff, teardown, backlog note label, docs + tests. Workflow-zero. No secret/RCE surface. Fork CI approved for tip Attestation: MATCH Contract-class: opt-in. Unconfigured runs do not gain GitLab behavior; only projects with an explicit VISION.md: one-interface / authority / scripts / restart / spine / vendor / scope all align (explicit binding; GitHub regression covered). Main |
350b383 to
ca86a7a
Compare
|
@kunchenguid can you run CI checks again? |
|
Speaking as Kun's firstmate: thanks @gh0stwin — re-checking tip Diff review (re-verified): forge-detect proposes Contract-class: opt-in. Unconfigured runs do not gain GitLab behavior; only projects with an explicit Attestation: MATCH VISION: one-interface / authority / scripts / restart / spine / vendor / scope all align. Main is green now. Once this tip's CI is green with MATCH, this lands on the auto-merge path (opt-in) under the merge lock. Nothing needed from you unless CI surfaces an author-owned failure. |
ca86a7a to
ddf0933
Compare
|
@kunchenguid Is anything blocking this PR? |
|
Speaking as Kun's firstmate: thanks for the nudge, @gh0stwin, and sorry for the wait. Two things were holding this, and neither one is your code being wrong. 1. CI never ran on your current tip. The 2. I'm changing the contract-class from my earlier VISION.md: one captain, one interface — aligns (no new captain-facing surface) · authority explicit — aligns for the binding; the URL-keyed arms change default behavior, which is why this needs the captain · scripts/agents — aligns (exact glab/jq reads, degrades without jq) · restart is a non-event — aligns (MR head/teardown proof from durable refs) · delegation with a spine — aligns (draft refusal, landed-work proof) · outlives any vendor — aligns (adds a forge; no GitHub coupling) · scope — aligns. Nothing is needed from you unless CI comes back red on something in your diff. After that, this waits on the captain, not you. |
|
Speaking as Kun's firstmate: thanks @gh0stwin. CI on head |
ddf0933 to
824fcbf
Compare
|
Speaking as Kun's firstmate: thanks for the rebase, @gh0stwin. GitHub now reports this PR as mergeable on head I re-read the diff at this tip. It touches the same 24 files as before, there are no workflow edits, and the only new forge access is the existing My contract-class read is unchanged: new-default. The draft refusal at arm, the MR-head review fetch, and the GitLab teardown proof still key off the recorded MR URL ( |
824fcbf to
18020c2
Compare
|
Speaking as Kun's firstmate: thanks for the new push, @gh0stwin. I re-read the diff at I've approved the fork CI runs for this head: CI My contract-class read hasn't changed: new-default. The arm-time draft refusal and the teardown proof still key off the recorded MR URL ( |
|
Speaking as Kun's firstmate: thanks for your patience, @gh0stwin. The serial 1 rerun came back green, so all 19 checks now pass on My contract-class read is still new-default: the arm-time draft refusal and the teardown proof key off the recorded MR URL ( Status: with Kun for a merge-or-leave decision. It's not waiting on you, and there's nothing more you need to do right now. |
[Medium impact] No newly established issue blocks merging this PR. Reviews (4) · Last reviewed commit: "no-mistakes(document): add work_in_progr..." · Reviewed by Greptile |
|
Thanks - both findings are real, and both are being fixed in this validation round. P1 (bin/fm-teardown.sh - Cleanup trusts another MR): Correct. The merged-state read is addressed through the recorded URL's host+project ( P2 (tests/fm-teardown.test.sh - Test reuses an earlier fixture): Correct. |
|
Speaking as Kun's firstmate: thank you @gh0stwin for the new round, and for the clear read on both Greptile findings. I agree with both. The teardown proof should only trust an Waiting on you: push those two fixes, including the adversarial twin test you described, and re-raise through Two notes so nothing surprises you. GitHub reports the branch as conflicting with main |
47c59ca to
a55d0b4
Compare
|
Speaking as Kun's firstmate: thank you @gh0stwin, this round covers everything we asked for. On This is now waiting on Kun, not you. It's back with him as the merge-or-leave decision. GitHub reports the branch as conflicting with main Contract-class: new-default (unchanged). VISION.md: unchanged, aligns on every rule. |
a55d0b4 to
4e8212e
Compare
… arm tasks-axi types a --pr link only as a GitHub or Forgejo pull request url, so a GitLab merge request url made the teardown atomic close refuse (both GitLab teardowns failed on it today). Extend the Gerrit note-rewrite precedent to GitLab: fm_backlog_pr_note_label labels any untaken forge url by its forge, and done, retain, and retained-artifact close record it as a labeled note instead of refusing. bin/fm-pr-check.sh now requires jq for a GitLab arm, names glab and jq together when either is missing, reads one JSON view of the merge request and refuses a work_in_progress draft exactly like the GitHub arm-time draft refusal, and records the MR head sha as pr_head for teardown and review consumers. fm_pr_json_draft_state takes the field name so GitLab's work_in_progress reads through the same helper. fm_pr_gitlab_read_record gains the glab-axi fallback its GitHub twin already had, with the glab implementation split out as fm_pr_gitlab_read_record_with_glab.
fm-review-diff.sh fetches the compare tip for a GitLab merge request from refs/merge-requests/<iid>/head, the ref GitLab keeps for every merge request, instead of warning down to the local branch; the one fetch helper now takes the ref pair, so the GitHub pull ref and the GitLab merge-request ref share one mechanism. fm-teardown.sh proves a recorded GitLab merge request landed the same way the GitHub path does: merged state through fm_pr_gitlab_read_record, head fetched from refs/merge-requests/<iid>/head, then the same ancestor-or-patch-id containment proof. pr_ref_for_target picks the forge ref for a bare number or either URL shape. fm-pr-merge.sh merges a merge request with --squash when the caller names no method, mirroring the GitHub default the header already documents, because the fleet's recording and teardown machinery reasons on squash merges. The forge closed set gains gitlab: fm-project-mode.sh parses and refuses it like gerrit, fm_forge_valid_for_mode accepts it for the publishing modes, a direct-PR DoD block on gitlab tells the worker to open its merge request with glab-axi and read its draft state back, fm-brief.sh names glab-axi in a gitlab ship brief's tool rule, and fm-forge-detect.sh proposes forge=gitlab from a gitlab.com origin. yolo stays available on gitlab; a base branch stays refused on gerrit publishes only, since a merge request targets any branch. docs: architecture.md, gerrit-forge-integration.md, and gitlab-merge-watch.md updated for the new behaviors, with dated arm-time head-recording and jq-refusal evidence against the public fixture. tests: arm-time head and draft, squash default, teardown MR proof and MR-url close, review-diff MR head, gitlab forge rows, detection proposals, DoD rendering, and the brief binding.
The fallback accepted the gh-twin spelling 'open' where GitLab's native open state is 'opened', so a host without plain glab read every open merge request as state unknown; it also rejected 'locked' as unreadable. Accept the native spellings, passing 'locked' through the way the plain-glab twin does, and pin the fallback with the tests it never had: the fake-glab-axi state matrix, the rendered gitlab tool rule and forge token in the ship brief, and the gitlab retain and retained-artifact labels on the captain-held cleanup paths. Findings and remedy from the adversarial review of the port (data/fm-gitlab-port-adversarial-review/report.md, F1-F4).
The merge with main replaced the gitlab port's no-mistakes draft-readback sentence with the forge-specific direct-PR wording, so a gitlab no-mistakes brief told the worker to read the pipeline's own pull request back through glab-axi. The readback is now scoped to the no-mistakes block: gh-axi for none and gitlab, main's tea sentence for forgejo, whose pipeline-opened pull request lives on the Forgejo forge. Two unit pins that predate the gitlab forge value also broke under the port: fm-brief's closed-set table and fm-project-mode's glabbed fixture both refused forge=gitlab, which the port accepts. Both now pin the binding positively, and the fm-brief forge test covers the gitlab Rule 3 line, the delivery-contract line, and the pipeline-scoped draft readback. Records the 2026-10-13 live end-to-end evidence in docs/gitlab-merge-watch.md against a real public fixture merge request: the draft-refusal arm, a fresh refs/merge-requests/<iid>/head review fetch that out-ranked a stale recorded pr_head, the guarded squash merge with a successful head pipeline, and the teardown landed-work proof after the merge.
…ebase The rebase onto main composed main's FORGE_RULE_LINE refactor (from the pr=manual feature) with the GitLab port's forge arms, but the ship heredoc still expanded the port's old $RULE3 variable, which the composed block no longer defines: every ship scaffold died on an unbound variable under set -u. Render rule 3 from FORGE_RULE_LINE, whose gitlab arm the composition keeps, so the glab-axi/tea/gh-axi rule lines reach the brief unchanged.
A GitLab landed-work proof read its merged state through the recorded URL's host, path, and number (fm_pr_gitlab_read_record) but fetched its containment head from the worktree's origin remote addressed by merge request number alone, and bin/fm-review-diff.sh fetched its fresh review head the same way. When the URL and the origin remote name different projects, a merged merge request in one project could authorize cleanup of - or review against - a same-numbered merge request of another project the origin happens to serve. Add fm_pr_gitlab_origin_matches to bin/fm-pr-lib.sh and call it at both readers: gitlab_mr_is_merged refuses on mismatch (the caller falls back to the content check, never trusting the origin-fetched head), and resolve_pr_head's GitLab arm leaves the head unresolved so the offline fallbacks apply. The check compares the raw configured origin URL - never the insteadOf-expanded transport, which only says where the same project is fetched from - after normalizing https/http/ssh/git and scp-like spellings, with a case-insensitive host, a case-sensitive project path, and a conventional trailing ".git" removed; a URL naming no host and project never matches. The merged-lands teardown test now pins both https and ssh spellings, and adversarial twins prove the refusal: a cross-project origin leaves teardown REFUSED with state retained, and a review whose origin names another project falls back to the recorded pr_head instead of the other project's fresh head. Also give test_teardown_closes_a_gitlab_task_with_its_mr_url_as_a_note its own fixture (tasks-axi-close-gitlab-mr-note): it reused the earlier close test's fixture, so make_case re-initialized an existing bare origin and cloned into a populated directory, continuing on leftover state with two Git setup errors per run.
… arm The GitLab origin-mismatch arm added in 487f4f0d guards the merge-request head fetch with fm_pr_gitlab_origin_matches, so on a mismatch the resolved local is never assigned; under set -u the function then crashed at [ -n "$resolved" ] before the recorded-pr_head fallback could run, printed 'line 185: resolved: unbound variable' to the user, and degraded the review to the local branch instead of the recorded head the commit promises. Initialize resolved empty. The cross-project unit twin now advances the local branch past the recorded pr_head, asserts the recorded head wins over the moved branch, and asserts the mismatch path leaves stderr clean; it fails on 487f4f0d and passes with this fix (proven live against gitlab.com in the evidence for this round).
bin/fm-pr-check.sh's header states that fm-pr-merge.sh records through it with FM_PR_CHECK_MERGE=1 and skips the arm-time draft refusal "because its own merge-time draft refusal is authoritative", but gitlab_verify_mergeable never read work_in_progress, so a merge request marked draft after arming reached `glab mr merge` with no firstmate-side refusal while GitHub and Forgejo both refuse theirs. Mirror those twins: read work_in_progress from the same one live view of the merge request, refuse unless it reads false, and report "the merge request is a draft" alongside every other failing condition, so the header claim is authoritative on every forge.
4e8212e to
dfeaa6a
Compare
|
Speaking as Kun's firstmate: thank you @gh0stwin for the new round. I read head This is still waiting on Kun, not you, as the merge-or-leave decision. Contract-class: new-default (unchanged). VISION.md: unchanged, it aligns on every rule. |
Carry upstream PRs kunchenguid#7243 (GitLab merge requests) and kunchenguid#8308 (stow before compaction)
Intent
The public PR carrying the GitLab forge support to the firstmate repo - #7226 - failed its CI. The captain asked why it failed, ruled the fix work belongs to a worker ("Why didn't you port this to a worker?"), ruled the worker must run the full no-mistakes validation because firstmate did not run it after the branch merge with main, and ruled the validation must check only our modifications - upstream main's own breakage is not this task's scope. The PR must end up green-or-explained: our regressions fixed, the re-raise compliant, main's inherited failures named rather than fixed.
The maintainer commented on PR 7226 asking for live evidence: "drive one real GitLab path end-to-end (or the pieces you can safely run) - e.g. arm/refuse-draft on a real MR, a fresh refs/merge-requests//head review fetch, and the teardown landed-work proof - and post the evidence (or fold it into a no-mistakes re-raise)". Perhaps we can create an empty public repo on gitlab then create an MR and post the link on the PR.
Relaunch the 'upstream-pr-7226' worker and resolve the conflicts with firstmate github's main.
Upstream main moved again past the last rebase (now d22640f), the re-raised PR conflicts once more and its CI was cancelled without a verdict: "can we resolve the conflicts on our firstmate pr and then run no-mistakes again?"
There are also new conflicts on the PR (#7243) - can you fix them? And run no-mistakes again?
Can you also pull main and resolve the conflicts on our firstmate's PR?
What Changed
forge=gitlabvalue to the closedforge=registry binding:bin/fm-project-mode.shaccepts it (keeping+yoloavailable, since a GitLab merge is not an attributed human approval),bin/fm-forge-detect.shproposes it for agitlab.comorigin at intake, and it is the one forge that accepts a per-task base branch; generated ship briefs and Definitions of done sendgitlabworkers to open merge requests and to read back and clear draft state withglab-axiinstead ofgh-axi.bin/fm-pr-check.shreads one JSON view of the merge request whenjqis present, refuses awork_in_progressdraft, and records the head sha aspr_head=;bin/fm-pr-merge.shadds a live merge-time draft refusal;bin/fm-review-diff.shcompares against a freshly fetchedrefs/merge-requests/<iid>/headinstead of warning down to the local branch; andbin/fm-teardown.shproves a recorded merge request landed from the merged state plus that ref.fm_pr_gitlab_origin_matchesinbin/fm-pr-lib.sh), so a same-numbered merge request of another project can never authorize review or cleanup; record the head-recording evidence and a live end-to-end pass (draft refusal, fresh review fetch, squash merge, teardown proof) indocs/gitlab-merge-watch.md, align the remaining forge docs, and pin the new behavior across ten test files.Risk Assessment
Testing
Every scenario the maintainer's live-evidence request named was driven end-to-end against real gitlab.com in a marked disposable lab home: arm/refuse-draft on a real MR (refused while draft, armed with a glab-read head once ready), a fresh refs/merge-requests/<iid>/head review fetch (fresh head beat both stale signals, and refused to cross projects), merge-time draft refusal plus a real verified merge, and the teardown landed-work proof including its open-MR, stale-head, and cross-project-same-number refusals plus two full teardown successes (one load-bearing on the MR proof alone). Forge detection was verified across URL spellings. Transcripts for all nine live drives are in the evidence directory with an index, and the merged MR trail remains public on gitlab.com for the PR thread. Targeted regression suites for the changed files show zero failures; the only anomaly is a suite hang in tests/fm-captain-hold-lifecycle.test.sh that reproduces on the base commit (upstream main's own breakage, named per intent), while this change's two new tests in that suite pass in isolation. No source changes were needed; the worktree is clean and all disposable fixtures (lab home, clones, tmux servers, twin repo) were torn down. UI-screenshot note: this change's surfaces are CLI/script paths, so the evidence is command transcripts and forge state, not images.
Evidence: Live GitLab validation index (all scenarios + kept gitlab.com evidence links)
Source: Live GitLab validation index (all scenarios + kept gitlab.com evidence links)
Full live-validation index: lab-home contract, real gitlab.com repos/MRs, per-scenario transcripts, kept evidence links, and targeted-suite results.Evidence: S1 arm-time draft refusal on a real gitlab.com MR
Source: S1 arm-time draft refusal on a real gitlab.com MR
error: https://gitlab.com/gh0stwin/fm-live-7243-a/-/merge_requests/1 is a draft merge request; a draft cannot be merged, so merge monitoring would wait for an event that cannot occur - mark it ready for review and arm again, or declare a wait instead of done if the draft is deliberateEvidence: S2 fresh MR-head review fetch (worktree branch and pr_head both stale)
Source: S2 fresh MR-head review fetch (worktree branch and pr_head both stale)
diff base: origin/main feature.txt | 1 + followup.txt | 1 + (followup.txt existed only in the freshly fetched refs/merge-requests/1/head, not in the local branch or recorded pr_head)Evidence: S2b review-diff cross-project origin-binding refusal
Source: S2b review-diff cross-project origin-binding refusal
warning: PR head unavailable; diff may lag the open PR (using local branch fm/task-x2) — the other project's MR head was never fetched; diff showed only cb-local.txtEvidence: S3 merge-time draft refusal (new work_in_progress guard)
Source: S3 merge-time draft refusal (new work_in_progress guard)
error: refusing to merge … - detailed_merge_status is "draft_status", not mergeable - the merge request is a draft (MR stayed open and unmerged; recorded-vs-live head disagreement notice above it)Evidence: S4 real merge through fm-pr-merge
Source: S4 real merge through fm-pr-merge
verified: … is open and mergeable at head 64d742dc…, with no head pipeline, waived by --allow-no-pipeline / ✓ Merged! (state=merged, merge_commit 2b9ac5f3)Evidence: S5b teardown cross-project refusal (greptile-P1 attack)
Source: S5b teardown cross-project refusal (greptile-P1 attack)
REFUSED: worktree … has work not on any remote and not landed. unpushed commits: 3c34a0b feat: task work that lives only in B MR !2 head — recorded URL names merged A MR !2 while origin is project B whose same-numbered head contains the worktree HEAD; refused and state retainedEvidence: S5e teardown merged-lands success (MR proof uniquely load-bearing)
Source: S5e teardown merged-lands success (MR proof uniquely load-bearing)
teardown task-x4 complete (window firstmate:fm-task-x4, worktree …) / Backlog: task-x4 is closed — done against a squash-merged MR whose branch commits were unreachable from any remote-tracking ref, with the lab tmux window actually killedEvidence: S6 forge detection on real clone configs
Source: S6 forge detection on real clone configs
forge=gitlab evidence=origin remote https://gitlab.com/… is on gitlab.com (also git@ and ssh:// spellings); self-hosted gitlab.internal.corp and github.com controls → forge=noneEvidence: Kept live evidence: merged MR trail on gitlab.com
Source: Kept live evidence: merged MR trail on gitlab.com
MR !1: draft→refused→ready→armed→fresh-head-reviewed→re-draft→merge-refused→merged→teardown landed-work proof; MR !2: merged same-numbered twin used by the cross-project refusal.Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
docs/scripts.md- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
bin/fm-dod-lib.sh:705- The fm_dod_block refactor left two variables dead:contract_forgeis declared (bin/fm-dod-lib.sh:552) and interpolated at the fm_dod_manual_pr_block call (bin/fm-dod-lib.sh:705) but never assigned anymore (the oldcontract_forge=' forge=forgejo'assignment was dropped in favor offorge_token), andforge_cliis now always the defaultgh-axisince the forgejoforge_cli=teaassignment was dropped. This is behavior-preserving only because fm_pr_text_valid refuses pr=manual on every forge!=none, so the manual block can only render for forge=none where both values were already the defaults; if pr=manual is ever allowed on gitlab/forgejo, the manual block would silently tell the worker to publish with gh-axi and drop the forge token from its Delivery contract line. Simplification: drop the two dead parameters from fm_dod_manual_pr_block (or keep the per-forge assignments) so the reachable-value invariant is stated in code rather than left implicit.tests/fm-captain-hold-lifecycle.test.sh:4502- Pre-existing suite hang, not introduced by this change: tests/fm-captain-hold-lifecycle.test.sh hangs in test_hold_origins_follow_backend_holds (bin/fm-captain-hold.sh verify spins at ~100% CPU). Reproduced on the base commit 6902362 with a freshgit archivesnapshot (full suite rc=124 after 600s with only 2 oks), so this is upstream main's own breakage; per the branch intent it is named, not fixed. The two GitLab tests this change adds to that suite (test_answer_before_cleanup_replay_notes_a_retained_gitlab_merge_request, test_teardown_retains_a_gitlab_captain_call_with_its_mr_url) pass when invoked in isolation (rc=0) from an unmodified copy of the current test file.Live:bin/fm-pr-check.sh task-x1 https://gitlab.com/gh0stwin/fm-live-7243-a/-/merge_requests/1on a real draft MR (refused) and afterglab mr update --ready(armed, pr=+pr_head recorded)Live:bin/fm-review-diff.sh task-x1with the MR head moved past both the local branch and the recorded pr_head (fresh refs/merge-requests/1/head fetched and used)Live:bin/fm-review-diff.sh task-x2with origin fm-live-7243-b vs recorded URL fm-live-7243-a (cross-project head fetch refused, warning + local-branch fallback)Live:bin/fm-pr-merge.sh task-x1 <MR1> --allow-no-pipelineon a re-drafted MR (refused listing 'the merge request is a draft'; MR stayed open)Live:bin/fm-pr-merge.sh task-x1 <MR1> --allow-no-pipelineon the ready MR (verified at head 64d742dc, merged on gitlab.com)Live:bin/fm-teardown.sh task-x4against an open B MR !3 (REFUSED, state retained) and again afterglab mr merge 3 --squash --remove-source-branch(rc=0, window killed, backlog closed with the GitLab MR note)Live:bin/fm-teardown.sh task-x1with a later local commit (REFUSED) and at the merged MR head after branch deletion+prune (rc=0 full flow)Live:bin/fm-teardown.sh task-x2cross-project attack — merged A MR !2 URL vs B origin with same-numbered head containing wt HEAD (REFUSED)Live:bin/fm-forge-detect.shon real clone configs (https/ssh/scp gitlab.com → forge=gitlab; self-hosted + github → forge=none)Suites:tests/fm-forge-detect.test.sh,tests/fm-brief.test.sh,tests/fm-dod-lib.test.sh,tests/fm-project-mode.test.sh,tests/fm-task-delivery.test.sh,tests/fm-pr-check-security.test.sh,tests/fm-review-diff.test.sh(full pass)Suites:tests/fm-pr-merge.test.sh(0 failures across two runs: 112 oks then invocations 110-122 isolated, 15 oks) andtests/fm-teardown.test.sh(81 oks, 0 failures, all GitLab delta tests green, cut by time budget)Isolation check: the two new GitLab tests intests/fm-captain-hold-lifecycle.test.shpass when invoked alone; full suite hang reproduced on base commit 69023626 via git-archive snapshot✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.