Skip to content

fix(bin): derive brief forge vocabulary from the project's git remote - #3

Closed
alandomio wants to merge 12 commits into
mainfrom
fm/fm-brief-forge-detect
Closed

alandomio wants to merge 12 commits into
mainfrom
fm/fm-brief-forge-detect

Conversation

@alandomio

@alandomio alandomio commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Makes bin/fm-brief.sh derive the generated brief's forge vocabulary (pull request/PR/gh-axi vs merge request/MR/glab) from the target project's own git remote, instead of hardcoding GitHub into every brief regardless of which forge the project actually uses.

Why it matters: this fleet runs almost entirely on GitLab, but every generated brief previously told the worker to use gh-axi and say "PR" even for GitLab projects. That is wrong tooling and wrong vocabulary handed straight to a crewmate at spawn time. The fix reads the project's local clone origin remote (falling back to a .gitlab-ci.yml marker for self-hosted GitLab, and to an existing .github directory for GitHub Enterprise) and renders the correct noun, tool, and done: convention consistently across the Setup/Rules line, the "never merge a <noun>" rule, and every ship mode's Definition of done. When the forge can't be determined, the brief says so explicitly and tells the worker to run git remote -v, rather than guessing GitHub.

This branch was rebased onto current main to pick up PR #4 (merged as 70794fb), which independently added a requirement that every generated PR/MR description go through the mr-description skill. That line hardcoded "PR description," which is exactly the wrong-forge-vocabulary bug this PR exists to remove, so the rebase reconciliation carries that requirement through this PR's own forge resolver instead of reverting or duplicating it — see Change below.

Change
File Change
bin/fm-brief.sh Adds fm_brief_detect_forge/fm_brief_resolve_project_dir, computes $FORGE_NOUN/$FORGE_ABBR/$FORGE_TOOL/$FORGE_TOOLS_LINE once per brief, and threads them through the Setup/Rules line, rule 1, and every ship mode's DOD (scout, no-mistakes, direct-PR, local-only)
tests/fm-brief.test.sh Adds test_forge_detection_shapes_vocabulary and related forge-detection tests (bare .github dir, repo-arg spellings, nested clone, FM_PROJECTS_OVERRIDE), plus new assertions pinning the reconciled forge-aware mr-description wording

Rebase reconciliation (bin/fm-brief.sh):

  • The direct-PR DOD's "Write the PR description... with the mr-description skill" line (landed on main via PR fix(bin): require mr-description skill for direct-PR and no-mistakes DODs #4) now reads "Write the $FORGE_ABBR description..." so it renders "PR description" for GitHub and "MR description" for GitLab, per the standing rule that GitLab work says "merge request"/"MR."
  • The identical hardcoded-"PR description" wording also existed in the no-mistakes mode's "Three firstmate-specific rules" list — it hadn't conflicted mechanically (this branch never touched that hunk), but carried the same bug, so it was fixed the same way for consistency. The mr-description skill's own name is unaffected either way; only the surrounding prose is forge-aware.
Validation
  • bash tests/fm-brief.test.sh — all 25 tests pass, including the new forge-aware mr-description wording assertions for both direct-PR and no-mistakes modes (GitHub project → "PR description", GitLab project → "MR description", and an explicit assert_no_grep that a GitLab brief never contains "Write the PR description").
  • bin/fm-lint.sh — ShellCheck 0.11.0 (pinned) and actionlint 1.7.12 (pinned), both clean.
  • gh pr view 3 --repo alandomio/firstmate --json mergeable,mergeStateStatus confirms MERGEABLE/CLEAN after the rebase and force-push.
  • This update did not start a no-mistakes pipeline run — the PR was already raised through no-mistakes originally, satisfying that gate, and no-mistakes's shared daemon was deliberately left untouched during this update.
Follow-ups

None. This update is scoped to the rebase and its forced reconciliation; no new scope was added.

🤖 Generated with Claude Code

Alan Domio added 11 commits August 31, 2026 13:21
Scaffolded briefs hardcoded GitHub instructions (gh-axi, "PR") even for
the fleet's GitLab projects. Detect the forge from each project's local
clone origin remote (falling back to .gitlab-ci.yml/.github when the
host is unrecognized) and use it to pick the right tool and terminology
(gh-axi/pull request/PR vs glab/merge request/MR) across Setup, Rules,
and the Definition of done for scout and every ship mode. An
unresolvable forge gets an explicit check-it-yourself marker instead of
a silent GitHub default.
The rebase reconciliation on top of PR #4's newly landed mr-description
requirement carried that requirement through the forge resolver instead of
hardcoding "PR description", so a GitLab project's brief says "MR
description" per the captain's standing GitLab vocabulary rule. Extend the
existing mr-description coverage to pin that per-forge wording for both
direct-PR and no-mistakes modes.
@alandomio
alandomio force-pushed the fm/fm-brief-forge-detect branch from 4c96225 to 27b1222 Compare August 31, 2026 11:23
…f.sh

The rebase reconciliation for PR #3 found the same hardcoded-"PR
description" bug in two places in this file at once (the direct-PR DOD
and the no-mistakes DOD), because a sibling PR added new forge-vocabulary
prose without going through the existing resolver. Record the maintenance
rule in the header comment so it does not recur a third time.
@alandomio

Copy link
Copy Markdown
Owner Author

Superseded by #7. This branch's no-mistakes gate binding drifted out of sync after an earlier manual rebase+force-push (done while no-mistakes runs were paused fleet-wide for a daemon upgrade), so per captain ruling the work was redone on a fresh branch cut from current main and driven through the no-mistakes pipeline properly, producing a genuine attestation rather than a hand-driven one. Closing this PR in favor of #7.

@alandomio alandomio closed this Sep 1, 2026
alandomio added a commit that referenced this pull request Sep 1, 2026
…t's forge (#7)

* fix(fm-brief): derive forge vocabulary from the project's git remote

Scaffolded briefs hardcoded GitHub instructions (gh-axi, "PR") even for
the fleet's GitLab projects. Detect the forge from each project's local
clone origin remote (falling back to .gitlab-ci.yml/.github when the
host is unrecognized) and use it to pick the right tool and terminology
(gh-axi/pull request/PR vs glab/merge request/MR) across Setup, Rules,
and the Definition of done for scout and every ship mode. An
unresolvable forge gets an explicit check-it-yourself marker instead of
a silent GitHub default.

* no-mistakes(review): recognize MR ci-ready token, guard forge detection to clone root

* no-mistakes(review): honor FM_PROJECTS_OVERRIDE in brief forge detection

* no-mistakes(document): note PR/MR ready signal for undetermined-forge briefs

* no-mistakes(document): document glab as a required universal toolchain tool

* no-mistakes(document): revert bootstrap glab check, document glab as unchecked requirement

* no-mistakes(review): normalize brief repo arg, drop .github forge fallback

* no-mistakes(review): make scout brief text forge-aware, correct resolver comment

* no-mistakes(review): correct resolver parity claim in brief test comment

* no-mistakes(document): document brief forge derivation in fm-brief help

* test(fm-brief): cover forge-aware mr-description wording

The rebase reconciliation on top of PR #4's newly landed mr-description
requirement carried that requirement through the forge resolver instead of
hardcoding "PR description", so a GitLab project's brief says "MR
description" per the captain's standing GitLab vocabulary rule. Extend the
existing mr-description coverage to pin that per-forge wording for both
direct-PR and no-mistakes modes.

* no-mistakes(document): warn against hardcoding PR/MR nouns in fm-brief.sh

The rebase reconciliation for PR #3 found the same hardcoded-"PR
description" bug in two places in this file at once (the direct-PR DOD
and the no-mistakes DOD), because a sibling PR added new forge-vocabulary
prose without going through the existing resolver. Record the maintenance
rule in the header comment so it does not recur a third time.

---------

Co-authored-by: Alan Domio <a.domio@peter-park.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant