Repository navigation
feat(bin): make a task's pull request venue follow its contribution target - #81
Merged
Merged
Conversation
A task's contribution target names a commit; it also implicitly names the repository that commit's trunk belongs to, and that repository is where the task's pull request has to be raised. On a fork layout it is not a per-project constant: work cut from the upstream trunk belongs upstream, and work cut from the fork trunk belongs at the fork. Nothing recorded which one a task meant, so a fork-targeted task's pull request could be raised upstream, contributing every commit the two trunks do not share. Derive the venue from the contribution target and record it per task: - bin/fm-task-base-lib.sh gains task_base_venue, which resolves the venue from the target's trunk, and task_base_venue_identity, which reduces a remote URL to a comparable "host/owner/repo". Upstream is tested first, and that ordering is the safety property: fork-only commits are unreachable from the upstream trunk, so no fork-only target can ever be assigned the upstream venue. A target on neither trunk is refused rather than guessed. - bin/fm-spawn.sh records contribution_venue= and contribution_venue_url=, resolved after every --slot-base/--contribution-target override, so a task retargeted onto fork-only material records the venue it was retargeted to. - bin/fm-pr-check.sh refuses a pull request whose venue contradicts that record, before anything is armed. The check is three-valued: only a contradiction refuses, and a task with no recorded venue is reported unchecked rather than read as agreement. The venue is derived from the target value rather than from TASK_BASE_STATE because the target can be overridden after resolution, and the venue has to move with it. Opening the pull request remains the pipeline's own step, so this decides, records and guards the venue rather than selecting it at creation time. Tests cover both directions in one fixture repository, so what is proven is that the venue follows the task rather than that it merely moved, plus the inversion case, the three-valued refusal, transport/case/nested-path identity, and the guard's refuse, accept and unchecked paths.
fm-pr-check.sh now prints a venue line before arming, so the verbatim transcripts in this file under-reported what the command actually outputs. The fixture tasks record no contribution venue, so each invocation reports the venue as unchecked rather than claiming a match it never verified. The refreshed lines were captured from the real script through the suite's own hermetic harness rather than composed by hand, so the transcript stays a record of observed output.
…t aliases in venue derivation
sbracewell64
force-pushed
the
fm/nomistakes-pr-venue-fork-target-v2
branch
from
August 11, 2026 04:50
5d37ed7 to
91df412
Compare
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.
What this changes
A task's contribution target names a commit; it also implicitly names the repository that commit's trunk belongs to, and that repository is where the task's pull request has to be raised.
On a fork layout that is not a per-project constant: work cut from the upstream trunk belongs upstream, and work cut from the fork trunk belongs at the fork.
Nothing recorded which one a task meant, so a fork-targeted task's pull request could be raised upstream, contributing every commit the two trunks do not share.
bin/fm-task-base-lib.shgainstask_base_venue, deriving the venue from the contribution target's trunk, andtask_base_venue_identity, reducing a remote URL to a comparablehost/owner/repoacross transport, port, case,.gitand nested forge paths.Upstream is tested first, and that ordering is the safety property: fork-only commits are unreachable from the upstream trunk, so no fork-only target can ever be assigned the upstream venue.
Both fork layouts are handled - a separate
upstreamremote, and anoriginwhose fetch and push URLs differ - and the fork trunk is recognised through its landing ref when the local branch lags.A target on neither trunk is refused rather than guessed.
bin/fm-spawn.shrecordscontribution_venue=andcontribution_venue_url=for every ship, resolved after any base override so a task retargeted onto fork-only material records the venue it was actually retargeted to.bin/fm-pr-check.shrefuses a pull request whose venue contradicts that record, before anything is armed, naming both venues.The venue is derived from the contribution target's value rather than from the resolved base state, because the target can be overridden after resolution and the venue has to move with it.
Three-valued, on purpose
Only a contradiction refuses.
A task with no recorded venue, or one whose venue could not be derived, is reported as unchecked rather than read as agreement, and nothing infers a venue from the pull request itself.
Scope
Opening the pull request is the validation pipeline's own step, and that tool holds one venue per repository.
So this decides, records and guards the venue rather than selecting it at creation time.
Tests
Both venue directions are proven in one fixture repository, for each of the two fork layouts, so what is demonstrated is that the venue follows the task rather than that it merely moved.
Each new test was run against the unfixed code and observed red before being trusted green.