Repository navigation
feat(bin): name new worker branches feature/<task-id> while still resolving fm/<task-id> - #3
Merged
Merged
Conversation
…olving fm/<task-id> bin/fm-task-branch-lib.sh becomes the one owner of the worker branch naming convention. New workers create feature/<task-id> so project repositories whose automated checks run only on main, develop, or feature/** branches check a worker branch from its first push. Branches already created under fm/<task-id> are never renamed: every lookup, match, and parse (review diff, local-only landing, bearings PR-to-task mapping) recognises both prefixes, current name first, so work under way keeps resolving.
… (legacy fm/ branch PR mapping and feature/ head labeling only for known task records) in tests/fm-bearings-snapshot.test.sh, but the "Stock macOS Bash snapshot compatibility" job in .github/workflows/ci.yml still asserted a hardcoded count of 59 passing Bearings tests. The suite itself passed every test; only the count check failed (got 61). Fix: updated the expected count in .github/workflows/ci.yml from 59 to 61 (both the comparison and the error message). No other files changed. Verification: ran `/bin/bash tests/fm-bearings-snapshot.test.sh` locally under stock GNU bash 3.2.57(1)-release (arm64-apple-darwin25). Exit code 0, 61 lines matching '^ok - ', no non-ok output
demy00
added a commit
that referenced
this pull request
Sep 30, 2026
… The CI job "Behavior portable serial 4" failed on one test, `tests/fm-fleet-ledger.test.sh`, with `fm-merge-local: error: branch feature/on-lifecycle-t1 does not exist`. I got the same failure locally. - **Cause:** Fork change #3 makes `fm-spawn` name new worker branches `feature/<task-id>` and record that name in the task's meta. This test comes from upstream, and it still pre-creates the worker checkout on `fm/<task-id>`. So spawn records `feature/...`, and `fm-merge-local` then can't find that branch. The script code is fine; the test was never updated for the fork's naming. - **Fix:** In `tests/fm-fleet-ledger.test.sh`, `make_case` now creates the checkout on `feature/$TASK`. The fork's own tests already do this in the same setup (for example `tests/fm-captain-hold-lifecycle.test.sh`). Resolving old `fm/` branches is unchanged. - **Check:** `bash tests/fm-fleet-ledger.test.sh` now passes locally (exit 0, every case ok)
demy00
added a commit
that referenced
this pull request
Oct 16, 2026
## Conflict resolutions The trial merge listed 13 conflicted files; the actual merge also conflicts in `tests/fm-procevent.test.sh` (14 total). | File | Fork origin | Resolution | | --- | --- | --- | | `.agents/skills/agent-skill-trigger-index/SKILL.md` | 09efd59 (#6, clickup-tickets) | Fork's `clickup-tickets` trigger line re-added to upstream's list unchanged. | | `AGENTS.md` | 3843b2c (#8, skill selection); 89e1459 (#3, `feature/` prefix) | Fork's `fm-skill-select.sh --apply` line and the `feature/` default wording re-applied on upstream's new section 7 text (upstream added `--base-branch` and self-repo consent lines next to it; both kept). | | `README.md` | 89e1459 (#3), via earlier fork syncs | Default ship-branch prefix wording stays `feature/` in upstream's rewritten bullet. | | `bin/fm-captain-hold.sh` | 999f9d8 (#1, done-archive evidence) | Fork's done-archive lookup re-applied unchanged on upstream's version. | | `bin/fm-dod-lib.sh` | 89e1459 (#3), 16cc4bd | Upstream's new base-branch/forge/consent code kept; its two `fm/$id` defaults now call `fm_task_branch` and the lib sources `fm-task-branch-lib.sh`, as the fork did before. | | `bin/fm-procevent-lavish.sh` | 826e32b, 79d101b, d0ac8f4, cbfb295 (#7) | True clash, decided by the captain (option A) - see below. | | `bin/fm-spawn.sh` | 89e1459 (#3), 16cc4bd, b7edc11, 153f4e2, de04c2d | Fork's `feature/` branch naming and legacy-brief branch binding re-applied unchanged on upstream's version. | | `bin/fm-timeout-lib.sh` | 9e8b923 (bash without `BASHPID`) | Upstream fixed the same macOS bash 3.2 bug independently (5838f10, kunchenguid#6028, perl watchdog takes the pre-exec parent). Took upstream's code; the fork's regression test for it is kept and passes on upstream's fix. | | `docs/architecture.md` | 89e1459 (#3) | `feature/` default and the `fm-task-branch-lib.sh` ownership line re-applied. | | `tests/fm-brief.test.sh` | 89e1459 (#3), via earlier fork syncs | Expected branch names stay `feature/<id>` in upstream's updated cases. | | `tests/fm-calm-pi-extension.test.sh` | bc3f178 (#10), 1757302 (#8 CI fix) | Upstream fixed the `/reload` geometry flake its own way (`wait_for_geometry_reload` on a durable status row), so the fork's `pipe-pane` version is dropped. Kept the fork's lookup-counting export renderer, the report-based Chrome hang attempt check, and the `tuiMode: regular` settings pin next to upstream's `--tui-mode regular` flag. | | `tests/fm-procevent.test.sh` | #7 | Both test sets kept; see the Lavish decision. | | `tests/fm-review-diff.test.sh` | 89e1459 (#3) | Fork's two unrecorded-`feature/` branch cases re-added; case letters shifted after upstream's new cases. | | `tests/fm-timeout-lib.test.sh` | 9e8b923 | Fork's no-`BASHPID` test kept on top of upstream's tests. | ## Decision: Lavish list-form parser (captain chose option A) Both sides fixed the same bug: Lavish emits queued feedback as a TOON list (not a table) when items carry nested content, and the adapter read it as an empty, complete result. - Fork (#7): one parser that flattens and presents every nested field (table-cell `target:`, `attachments:`, other `fields:`, message uid/selector/text), adds `unpresented_items:`, and refuses `complete: yes` when nested content cannot be parsed. - Upstream (fc8972c, kunchenguid#5404): one parser that skips nested targets and attachments; its tests assert nested content is absent from `read`. It also adds stricter refusals (unrecognized header keeps its declared count and counts as malformed; `answers`/`reconciles` exit 3 when not fully accounted for), and 228b27d renames the message count to `captain_message_count`. Options: - **A (chosen):** keep the fork's presenting parser, port upstream's strictness onto it (declared count + malformed on an unrecognized header, `answers`/`reconciles` exit 3, `captain_message_count`), keep both test sets, and adapt upstream's three "absent" assertions to check nested content appears only under its own labelled section and never replaces the item's own text. Cost: this region will likely conflict again on the next upstream sync. - **B:** take upstream's parser and tests wholesale and drop the fork's nested presentation. Cost: Lavish reads lose table-cell location, text-selection range, and image attachment paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
The captain's ask, 2026-09-23, verbatim: "can you switch to using feature branches instead
of fm?"
Today every worker branch firstmate creates is named fm/. He wants
feature/.
Context he did not state but that makes this more than cosmetic: several of his
repositories only run their automated checks on branches matching main, develop or
feature/**. A branch named fm/... matches none of those, so worker branches get no checks
at all until a pull request is opened. Renaming them makes those checks run immediately.
What Changed
bin/fm-task-branch-lib.shas the single owner of the worker branch naming convention: new workers createfeature/<task-id>, and helper functions list, resolve, and export (as JSON) both the currentfeature/prefix and the legacyfm/prefix.fm-brief.sh,fm-promote.sh,fm-dod-lib.sh) now render the branch name from the lib instead of hardcodingfm/<id>, andfm-merge-local.sh/fm-review-diff.shresolve the task's branch under either prefix, current convention first.fm-bearings-snapshot.shmaps PR heads back to task ids for both prefixes; afeature/<id>head is labeled as a task only when<id>is a known in-flight or backlog task, whilefm/<id>heads map unconditionally. Tests cover the new lib, branch resolution, and the PR head labeling rules; docs updated to describe the convention.Existing
fm/branches are not renamed and still resolveNo existing branch, local or remote, is renamed by this change. Three lanes are running on
fm/<task-id>branches today, and renaming a branch out from under a running pipeline would strand it. The compatibility path is deliberate: only a newly created worker branch gets thefeature/<task-id>name, and every lookup keeps recognisingfm/<task-id>.bin/fm-task-branch-lib.shis the single owner of both prefixes. It names new branchesfeature/<task-id>, listsfm/<task-id>as a legacy candidate, and prefers the current name when both exist for one task. These subsystems were updated to resolve through it, so live work keeps resolving after this merges:bin/fm-review-diff.sh) resolves the task's branch underfeature/first, thenfm/, before falling back to the checked-out branch.bin/fm-merge-local.sh) fast-forwards the default branch from whichever of the two names exists for the task.bin/fm-bearings-snapshot.sh) maps a PR head under either prefix back to its task. Anfm/head maps unconditionally, exactly as before. Afeature/head is labelled as a task only when its id matches a task record the snapshot already holds, because humans also branch underfeature/**.bin/fm-brief.sh,bin/fm-promote.sh,bin/fm-dod-lib.sh) render the new name for new workers only. A relaunch reuses the task's stored brief, so a worker already onfm/<task-id>is never told to switch.Tests pin both halves: a new worker branch is named
feature/<task-id>, a task whose only branch isfm/<task-id>still resolves for review diff and local landing, the current name wins over anfm/twin, and the bearings mapping keeps itsfm/behaviour while ignoring an unknownfeature/id.Pre-existing suite failures observed, not touched
The repository's changed-file test selection ran 81 scripts on this branch; 7 failed. All 7 fail identically on an export of the untouched base commit
a08f79c4on the same machine, with the same assertion messages, so they are pre-existing and unrelated to this change. They are filed as their own work and deliberately left alone here:tests/fm-calm-pi-extension.test.shtests/fm-muse-harness.test.shtests/fm-harness-precedence.test.shtests/fm-calm-claude-mod.test.shtests/fm-teardown.test.shtests/fm-backlog-atomicity.test.shtests/fm-teardown-endpoint-safety.test.shEvidence:
bin/fm-test-run.shover those seven scripts on the base export printedFM_TEST_SUMMARY total=7 failed=7, versustotal=81 failed=7for the changed-file run on this branch, with the sevennot oklines matching one for one.Risk Assessment
✅ Low: The rename is routed through a single library, every branch lookup resolves both prefixes with the current name winning, the record-gated PR mapping traces correctly for known, legacy, and unknown heads, and only two informational test-hygiene notes remain.
Testing
Ran all eight directly touched test scripts through the repo runner (all pass, including the new feature/-head record check, legacy fm/ mapping, and both-branch-name landing tests) and performed manual end-to-end verification with transcripts: rendered briefs instruct workers to create feature/<id>, the local-only merge lands both feature/ and legacy fm/ branches, review-diff resolves both names by task id, and the bearings board labels feature/ PR heads only when the id matches a known task record while fm/ heads keep their unconditional mapping. No UI surface is involved, so no screenshot was captured.Evidence: E2E transcript: rendered briefs, local merge of feature/ and fm/ branches, review-diff under both names
Source: E2E transcript: rendered briefs, local merge of feature/ and fm/ branches, review-diff under both names
Evidence: E2E transcript: bearings --include-prs PR head to task mapping (known/unknown feature/ heads, fm/ heads)
Source: E2E transcript: bearings --include-prs PR head to task mapping (known/unknown feature/ heads, fm/ heads)
Evidence: Rendered local-only brief (data/<id>/brief.md) naming feature/tidy-docs-c3
Source: Rendered local-only brief (data/<id>/brief.md) naming feature/tidy-docs-c3
Evidence: Evidence script used to produce the transcripts
Source: Evidence script used to produce the transcripts
Evidence: Bearings PR mapping as the captain sees it
Evidence: Runner output of the bearings and captain-hold suites (both exit 0)
Source: Runner output of the bearings and captain-hold suites (both exit 0)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-bearings-snapshot.sh:308- The PR-to-task mapping now claims any PR whose head starts with feature/ as a firstmate task. The captain's stated reason for the rename is that these repositories already gate checks on feature/**, so humans use that namespace too. A human PR on feature/login-redesign will surface in candidate_prs with task=login-redesign even though no such task exists, where the earlier fm/ prefix was firstmate-only and could not collide. The smallest remedy (cross-checking the parsed id against known task records before labelling it) extends the change beyond the rename, so it needs authorization rather than an auto-fix; the alternative is accepting the ambiguous label as inherent to the requested convention.bin/fm-task-branch-lib.sh:51- fm_task_branch_id has no caller in bin/; only its own test exercises it. The bearings jq consumer reimplements the same prefix parse via fm_task_branch_prefixes_json. Either drop the helper and its test, or keep it only if a shell consumer is planned.🔧 Fix: label feature/ PR heads only for known tasks
2 infos still open:
tests/fm-bearings-snapshot.test.sh:1440- The user's fix instruction required that the task-record check apply only to feature/ heads and NOT to fm/ heads. The legacy test uses headRefName fm/ship-task, and ship-task has an in-flight record, so the test passes equally whether or not the record check is (wrongly) applied to fm/ heads too. Pin the constraint: add an fm/<id> head whose id has no record (for example fm/orphan-lane) to the FAKE_GH_LEGACY_BRANCH fixture and assert its task is "orphan-lane", not "-". Current code already behaves this way (the jq only gates when $p == $current), so this is a coverage pin, not a defect.tests/fm-review-diff.test.sh:14- The new case (f) description says that when the worktree holds neither feature/<id> nor fm/<id>, "a stray checked-out branch is not mistaken for the task". bin/fm-review-diff.sh lines 75-78 do the opposite (unchanged pre-existing behaviour): with no candidate branch it falls back to the currently checked-out branch. Neither new test exercises the neither-exists case, so the comment documents behaviour the code does not have. Reword the comment to describe the real fallback, or drop that clause.✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-task-branch-lib.test.sh tests/fm-review-diff.test.sh tests/fm-tangle-guard.test.sh tests/fm-task-delivery.test.sh tests/fm-control-relaunch.test.sh tests/fm-brief.test.sh(6 scripts, failed=0)bin/fm-test-run.sh tests/fm-bearings-snapshot.test.sh tests/fm-captain-hold-lifecycle.test.sh(2 scripts, failed=0, including the new feature/-head record check and legacy fm/ mapping tests)Manual E2Efm-brief.sh <id> some-proj --mode {no-mistakes,direct-PR,local-only}: rendered brief.md namesgit checkout -b feature/<id>and the rules/DoD lines name the feature/ branchManual E2Efm-merge-local.sh land-feature-1andfm-merge-local.sh land-fm-1: main fast-forwards onto a feature/ branch and onto a pre-rename fm/ branchManual E2Efm-review-diff.sh task-x1with the worktree detached: diff resolves from feature/task-x1, and from fm/task-x1 when only that existsManual E2Efm-bearings-snapshot.sh --include-prs --jsonwith stubbed gh: feature/ship-task and fm/ship-task -> labelled; feature/live-gate (queued) and feature/done-a (done) -> labelled; feature/login-redesign (no record), feature/, hotfix/ship-task -> task=-; fm/orphan-lane (no record) -> still labelled orphan-lanegit status --porcelain --ignoredclean after testing; evidence written only under the evidence directory✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.