fix(brief): make the definition of done forge-aware so Forgejo workers are not told to use gh-axi #6

Merged
john merged 1 commit from fm/fm-brief-forge-aware-dod into main 2026-08-08 05:40:41 +00:00
Owner

Makes the generated brief's definition of done match the project's actual forge, so a worker is never instructed to do something impossible.

The defect, and how long it hid

bin/fm-brief.sh generated this for every direct-PR ship task, unconditionally:

Committing your work is not done. Done is the pull request: after committing, push your branch and open a PR with gh-axi

gh-axi targets GitHub. The captain's only delivery target is Forgejo. So on every Forgejo project the brief demanded an action that cannot succeed, and the worker stopped — because its stated definition of done was unreachable.

This was recorded fifteen times as "workers stopping one step short of delivery" and treated as a worker-discipline problem across five different runtimes. It was never that. Five different models behaved identically because the instruction was impossible. Every pull request on the captain's forge today was opened by hand as a result.

Five runtimes agreeing should have been read as structural far sooner. Instead a guard was added to catch the symptom, and the occurrences were counted like weather.

What changed

The forge is resolved from the project clone's remote.origin.url — an offline git config read, no network and no credential:

  • GitHub origin — unchanged: push and open the pull request with gh-axi.
  • Any other origin, or none — the worker's done is: push the branch, verify the remote ref exists, append done: branch fm/<id>, stop. The brief states plainly that firstmate opens the pull request, and that the worker must not go looking for a credential.

The gh-axi tool rule is also dropped on the non-GitHub path, so a worker is not pointed at a tool it cannot use for this forge.

Both direct-PR and no-mistakes are covered — the same assumption was baked into the pipeline-complete text. local-only is untouched; it was already correct.

Absent clone or origin takes the no-worker-PR path deliberately. An unnecessary hand-opened pull request costs a minute; an impossible instruction costs a worker.

Why the wording matters

Today's workers behaved well the moment they were told the boundary explicitly — they pushed, reported "cannot open the Forgejo PR, no credential here", and stopped without hunting for one. Earlier in the day, one that was not told went searching through the operator's home directory for a token. The brief now says it up front rather than setting that trap.

Tests

54 lines of new coverage across the GitHub, Forgejo and unknown-origin shapes.

Environment note

Run the suite with FM_HOME scoped to the worktree under test or unset — pointing it at the primary home while testing a worktree makes fm-arm-pretool-check case A13 fail falsely. Several other failures on this machine are environmental and verified today against clean main and pure upstream/main: the herdr presentation suite, the MISSING-tool checks in bootstrap and session-start, fm-on, fm-remote-doctor, the calm extension and the documentation-audience suite.

Follow-up worth noting

bin/fm-brief.sh's header comment still describes direct-PR as "push + open PR via gh-axi", which is now only true for a GitHub origin. Small documentation drift, not corrected here to keep this diff to the behaviour.

Makes the generated brief's definition of done match the project's actual forge, so a worker is never instructed to do something impossible. ## The defect, and how long it hid `bin/fm-brief.sh` generated this for every `direct-PR` ship task, unconditionally: > Committing your work is not done. Done is the pull request: after committing, push your branch and open a PR with `gh-axi`… **`gh-axi` targets GitHub.** The captain's only delivery target is Forgejo. So on every Forgejo project the brief demanded an action that cannot succeed, and the worker stopped — because its stated definition of done was unreachable. This was recorded **fifteen times** as "workers stopping one step short of delivery" and treated as a worker-discipline problem across **five different runtimes**. It was never that. Five different models behaved identically because the instruction was impossible. Every pull request on the captain's forge today was opened by hand as a result. Five runtimes agreeing should have been read as structural far sooner. Instead a guard was added to catch the symptom, and the occurrences were counted like weather. ## What changed The forge is resolved from the project clone's `remote.origin.url` — an **offline `git config` read**, no network and no credential: - **GitHub origin** — unchanged: push and open the pull request with `gh-axi`. - **Any other origin, or none** — the worker's done is: push the branch, verify the remote ref exists, append `done: branch fm/<id>`, stop. The brief states plainly that **firstmate opens the pull request**, and that the worker must not go looking for a credential. The `gh-axi` tool rule is also dropped on the non-GitHub path, so a worker is not pointed at a tool it cannot use for this forge. Both `direct-PR` and `no-mistakes` are covered — the same assumption was baked into the pipeline-complete text. `local-only` is untouched; it was already correct. **Absent clone or origin takes the no-worker-PR path deliberately.** An unnecessary hand-opened pull request costs a minute; an impossible instruction costs a worker. ## Why the wording matters Today's workers behaved well the moment they were told the boundary explicitly — they pushed, reported "cannot open the Forgejo PR, no credential here", and stopped without hunting for one. Earlier in the day, one that was *not* told went searching through the operator's home directory for a token. The brief now says it up front rather than setting that trap. ## Tests 54 lines of new coverage across the GitHub, Forgejo and unknown-origin shapes. ## Environment note Run the suite with `FM_HOME` scoped to the worktree under test or unset — pointing it at the primary home while testing a worktree makes `fm-arm-pretool-check` case A13 fail falsely. Several other failures on this machine are environmental and verified today against clean `main` and pure `upstream/main`: the herdr presentation suite, the `MISSING`-tool checks in bootstrap and session-start, `fm-on`, `fm-remote-doctor`, the calm extension and the documentation-audience suite. ## Follow-up worth noting `bin/fm-brief.sh`'s header comment still describes `direct-PR` as "push + open PR via gh-axi", which is now only true for a GitHub origin. Small documentation drift, not corrected here to keep this diff to the behaviour.
fix: make brief delivery forge-aware
Some checks failed
CI / Lint shell scripts (pull_request) Has been cancelled
CI / Test coverage guard (pull_request) Has been cancelled
CI / Behavior portable parallel 1 (pull_request) Has been cancelled
CI / Behavior portable parallel 2 (pull_request) Has been cancelled
CI / Behavior portable serial 1 (pull_request) Has been cancelled
CI / Behavior portable serial 2 (pull_request) Has been cancelled
CI / Behavior portable serial 3 (pull_request) Has been cancelled
CI / Behavior portable serial 4 (pull_request) Has been cancelled
CI / Behavior tests (Herdr) (pull_request) Has been cancelled
CI / Behavior timing aggregate (pull_request) Has been cancelled
CI / Stock macOS Bash snapshot compatibility (pull_request) Has been cancelled
CI / Repo invariants (pull_request) Has been cancelled
Require no-mistakes / PR must be raised via no-mistakes (pull_request) Has been cancelled
1f00345ec7
john merged commit 014f539579 into main 2026-08-08 05:40:41 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
john/firstmate!6
No description provided.