Skip to content

fm-pr-merge: accept a sibling-branch PR once the recorded PR has merged - #15

Merged
shishiv merged 1 commit into
mainfrom
fm/firstmate-pr-merge-varios-prs
Oct 2, 2026
Merged

shishiv merged 1 commit into
mainfrom
fm/firstmate-pr-merge-varios-prs

Conversation

@shishiv

@shishiv shishiv commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Firstmate spec

Uma tarefa pode abrir vários PRs em branches próprias (fm/<id>, fm/<id>-b, fm/<id>-c...). bin/fm-pr-merge.sh mergeava só o primeiro PR registrado (pr= no meta) e recusava os outros com "task is bound to , not ", mesmo depois de bin/fm-pr-check.sh <id> <url> --adopt-external, porque o check interno do merge rodava sem --adopt-external.

require_recorded_pr_identity agora aceita um PR seguinte quando o PR registrado já está integrado (lido ao vivo, nunca confiando só no pr= gravado) e o PR novo é da própria tarefa (fm/<id> ou fm/<id>-<sufixo>, fm_pr_task_branch_family_member em bin/fm-pr-lib.sh). PR de outra tarefa ou branch alheia continua recusado. record_pr_metadata passa --adopt-external só para esse caso provado de branch irmã; fm-pr-check.sh também aceita uma branch irmã sem --adopt-external no seu próprio guard.

Mantidas todas as outras guardas: verde no head, required checks, draft, mergeable, registro do merge.

Prova

Prova: só contrato headless (tests/fm-pr-merge.test.sh: 108 testes, 0 falhas, incluindo 3 novos casos - aceito/ainda-aberto/branch-alheia; tests/fm-pr-check-security.test.sh: 48 testes, 0 falhas); NÃO verificado no jogo (não é projeto lloegrys-live).

shellcheck/bin/fm-lint.sh limpo em bin/fm-pr-check.sh, bin/fm-pr-lib.sh, bin/fm-pr-merge.sh, tests/fm-pr-merge.test.sh.

Retro

Erro: nenhum erro ou obstáculo repetido nesta tarefa - a implementação seguiu o ## Firstmate spec de primeira, sem correções recebidas.

Retro: nada a encodar.

…as merged

A task that opens several PRs for itself on branches fm/<id>,
fm/<id>-b, fm/<id>-c... was bound to only one pr= at a time: once
the first merged, fm-pr-merge.sh still refused every later PR as a
foreign rebind, even after fm-pr-check.sh --adopt-external, because
its own internal re-recording call ran without --adopt-external.

require_recorded_pr_identity now accepts a later PR when the
recorded PR has already landed (read live via the same provider
record readers fm-crew-state.sh uses) and the new PR's own branch is
a sibling of the task's recorded branch
(fm_pr_task_branch_family_member, bin/fm-pr-lib.sh). A branch that is
not a sibling, or a recorded PR that has not landed yet, still
refuses exactly as before. record_pr_metadata passes
--adopt-external only for this proven sibling-branch case.

fm-pr-check.sh's own branch guard also accepts a sibling branch
without --adopt-external, since it is never "outside this task".

Tests: three new cases in tests/fm-pr-merge.test.sh covering
accepted, still-open, and foreign-branch rebinds.
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