Skip to content

fix(bin): skip push-disabled remotes when resolving role-gate publication target - #190

Merged
sKeLe100 merged 3 commits into
mainfrom
fm/role-gate-ignore-disabled-upstream
Oct 16, 2026
Merged

sKeLe100 merged 3 commits into
mainfrom
fm/role-gate-ignore-disabled-upstream

Conversation

@sKeLe100

@sKeLe100 sKeLe100 commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Intent

Make the publishing-permission gate resolve this fork's real publication target. The gate (bin/fm-role-lib.sh, fm_role_publication_target) picks the first remote in the order upstream, github, origin, but in this fork upstream is the fetch-only clone of the original project (push URL DISABLED), so a maintainer grant written for the fork never matches and every self-repo ship needs a one-task consent. Background: ledger entry FM-20261014-role-gate-01 in data/mistakes.md. The captain approved one-task consent for this ship only.

What Changed

  • fm_role_publication_target in bin/fm-role-lib.sh now reads each remote's push URL (git remote get-url --push) instead of its fetch URL. It skips remotes in the upstream, github, origin order whose push URL is empty or DISABLED. In this fork, the fetch-only upstream clone is skipped, so the gate resolves the fork's real target and a maintainer grant written for the fork can match.
  • docs/configuration.md now says the publication target is the push URL of the first usable remote. It also notes that Git treats the fetch URL as the push URL when none is configured.
  • tests/fm-self-repo-role.test.sh has 35 new lines of tests for this behavior.

Risk Assessment

✅ Low: Small, well-bounded change to remote selection that uses git remote get-url --push, skips empty or DISABLED push URLs, and is covered by a behavioral test and matching docs.

Testing

tests/fm-self-repo-role.test.sh passes in full. I also ran fm_role_publication_target against a disposable repo for three cases: a disabled upstream with a fork origin, a remote whose push URL differs from its fetch URL, and only a disabled upstream. All three gave the expected result. I did not run the full suite, which hit the 3600s cap earlier.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Disabled upstream is skipped, so the fork origin is the publication target ✅ pass live live.txt case A: github.com/skele100/firstmate
A remote's push URL is used instead of its fetch URL ✅ pass live live.txt case B: github.com/skele100/pushfork
With only a disabled upstream, no target resolves ✅ pass live live.txt case C: empty output
Focused role-gate suite, including consent and spawn/promote gating ✅ pass live tests/fm-self-repo-role.test.sh reported all tests passed
Evidence: live publication-target resolution

Source: live publication-target resolution

A: upstream push DISABLED, origin fork:
github.com/skele100/firstmate
B: github fetch x/y, pushurl pushfork:
github.com/skele100/pushfork
C: only disabled upstream (expect empty):
- Outcome: ⚠️ 1 error across 1 run (1h0m34s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 error
  • 🚨 configured test command failed with exit code 124
  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Disabled upstream is skipped, so the fork origin is the publication target ✅ pass live live.txt case A: github.com/skele100/firstmate
A remote's push URL is used instead of its fetch URL ✅ pass live live.txt case B: github.com/skele100/pushfork
With only a disabled upstream, no target resolves ✅ pass live live.txt case C: empty output
Focused role-gate suite, including consent and spawn/promote gating ✅ pass live tests/fm-self-repo-role.test.sh reported all tests passed
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --pc02-if-idle
  • bash tests/fm-self-repo-role.test.sh
  • fm_role_publication_target on a disposable git repo: upstream with push URL DISABLED plus fork origin
  • fm_role_publication_target on a disposable git repo: github remote with differing pushurl
  • fm_role_publication_target on a disposable git repo: only a disabled upstream remote
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@sKeLe100
sKeLe100 force-pushed the fm/role-gate-ignore-disabled-upstream branch from 4d27af5 to 258c9d7 Compare October 16, 2026 00:15
@sKeLe100 sKeLe100 changed the title fix: skip push-disabled remotes when resolving role-gate publication target fix(bin): skip push-disabled remotes when resolving role-gate publication target Oct 16, 2026
@sKeLe100
sKeLe100 merged commit 6d82749 into main Oct 16, 2026
17 of 19 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