Skip to content

fix(bin): derive PR/MR vocabulary in generated briefs from the project's forge - #7

Merged
alandomio merged 12 commits into
mainfrom
fm/fm-brief-forge-detect-v2
Sep 1, 2026
Merged

alandomio merged 12 commits into
mainfrom
fm/fm-brief-forge-detect-v2

Conversation

@alandomio

Copy link
Copy Markdown
Owner

Intent

Resolve the merge conflict that was blocking firstmate PR #3 (originally branch fm/fm-brief-forge-detect) against current main, and get equivalent content mergeable again on a fresh branch cut from the current default-branch head, per explicit captain ruling to abandon the old branch and produce a genuine no-mistakes pipeline attestation rather than a hand-driven one. PR #3's branch had drifted out of sync with the no-mistakes daemon's own gate-mirror bookkeeping after an earlier manual rebase+force-push (done because no-mistakes runs were deliberately paused fleet-wide for a captain-initiated daemon upgrade to v1.60.2), so rather than fight that stale gate state, the captain ruled to cut this fresh branch, redo the resolution here, and drive it through no-mistakes properly; PR #3 will be closed once this replacement PR is open, referencing it.

Underlying change (unchanged from the original PR): bin/fm-brief.sh now derives 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, so GitLab projects (most of this fleet) get correct tooling and vocabulary in their generated crewmate briefs. When the forge can't be determined it says so explicitly rather than guessing GitHub.

Reconciliation on top of that (added during conflict resolution): this branch conflicted with PR #4 (merged as 70794fb on main), which independently added a line requiring every generated PR/MR description to go through the mr-description skill, using hardcoded 'PR description' wording. That hardcoded noun is exactly the wrong-forge-vocabulary bug this branch exists to remove, so the reconciliation carries the mr-description requirement through this branch's own forge resolver ($FORGE_ABBR) instead, so a GitLab project's brief correctly says 'MR description' per the standing captain instruction that GitLab work says merge request/MR, never PR. The identical hardcoded-PR wording was also found in a second, non-conflicting spot in the same file (the no-mistakes-mode DOD's 'Three firstmate-specific rules' list) and fixed the same way for consistency. tests/fm-brief.test.sh was extended with GitHub/GitLab-clone assertions pinning this forge-aware mr-description wording for both direct-PR and no-mistakes modes. A maintenance-note comment was added to fm-brief.sh's header warning that any new PR/MR-naming prose must route through the forge resolver, since the bug appeared in two places in one file at once.

This branch's own scope is otherwise unchanged from the original PR #3 - no new functional requirements beyond the reconciliation described above.

What Changed

  • bin/fm-brief.sh now detects a project's forge (GitHub vs GitLab) from its clone's origin remote, with a .gitlab-ci.yml fallback and an explicit "forge could not be determined" case, and uses that to pick the brief's noun (pull request/merge request), abbreviation (PR/MR), and tool (gh-axi/glab) throughout the scout, direct-PR, local-only, and no-mistakes brief scaffolds instead of hardcoding GitHub wording.
  • Routes the existing mr-description skill requirement and the no-mistakes-mode "Three firstmate-specific rules" DOD text through this same forge resolver ($FORGE_ABBR/$FORGE_NOUN), removing two spots that hardcoded "PR" regardless of the target project's actual forge, and adds a maintenance-note comment in the file header warning future edits to route new PR/MR-naming prose through the resolver.
  • bin/fm-crew-state.sh recognizes the MR ... checks green status-line token as a CI-ready signal alongside the existing PR token; AGENTS.md and docs/configuration.md document the forge-derived wording and the glab prerequisite for GitLab-hosted projects.
  • tests/fm-brief.test.sh gains GitHub- and GitLab-clone assertions pinning the forge-aware mr-description wording for both direct-PR and no-mistakes modes; tests/fm-crew-state.test.sh adds coverage for the new MR ci-ready token.

Risk Assessment

✅ Low: The change is a well-bounded conflict-resolution: forge-vocabulary derivation from the git remote (with a sound .gitlab-ci.yml fallback and clone-root guard) is applied consistently to both hardcoded-PR spots introduced by the conflicting PR #4, tests exercise real script output rather than static source content, and no reachable input produces an incorrect forge label or wrong wording.

Testing

Both targeted test files most directly exercising this change's underlying diff (bin/fm-brief.sh forge derivation + reconciled mr-description wording, and bin/fm-crew-state.sh's MR-noun CI-ready detection) pass in full, generating real git clones with GitHub/GitLab/self-hosted/unresolvable remotes and asserting on the actual rendered brief.md content end-to-end; no findings.

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.

  • bash tests/fm-brief.test.sh (25/25 pass, including test_forge_detection_shapes_vocabulary, test_forge_detection_rejects_bare_github_dir, test_forge_detection_accepts_repo_arg_spellings, test_forge_detection_ignores_enclosing_repo, test_forge_detection_honors_projects_override, and the new GitHub/GitLab mr-description wording assertions in test_mr_description_skill_required_for_pr_modes)
  • bash tests/fm-crew-state.test.sh (full suite pass, including new test_ci_ready_done_log_accepts_merge_request_noun regression test for the MR noun in log_reports_ci_ready)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Alan Domio added 12 commits September 1, 2026 09:05
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.
…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
alandomio merged commit 0c266ad into main Sep 1, 2026
13 checks passed
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