Skip to content

feat(bin): make a task's pull request venue follow its contribution target - #81

Merged
sbracewell64 merged 6 commits into
mainfrom
fm/nomistakes-pr-venue-fork-target-v2
Aug 11, 2026
Merged

sbracewell64 merged 6 commits into
mainfrom
fm/nomistakes-pr-venue-fork-target-v2

Conversation

@sbracewell64

Copy link
Copy Markdown
Owner

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.sh gains task_base_venue, deriving the venue from the contribution target's trunk, and task_base_venue_identity, reducing a remote URL to a comparable host/owner/repo across transport, port, case, .git and 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 upstream remote, and an origin whose 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.sh records contribution_venue= and contribution_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.sh refuses 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.

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.
@sbracewell64
sbracewell64 force-pushed the fm/nomistakes-pr-venue-fork-target-v2 branch from 5d37ed7 to 91df412 Compare August 11, 2026 04:50
@sbracewell64
sbracewell64 merged commit 7616b98 into main Aug 11, 2026
13 of 14 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