I3970 — Every pull request carries its metadata, projected from the trunk's records: labels, milestone, assignee and Refs links, never a closing keyword
A pull request's metadata is a projection of the trunk's records, applied by scripts/github-sync --prs locally and by a separate workflow file (not github.yml) on pull_request_target opened, edited, synchronize and labeled, which checks out the base branch only, never the head, and holds pull-requests: write and issues: read with GITHUB_TOKEN, in a concurrency group per pull request. The rule the-projection-is-applied-at-landing moves to version 2 and .ai/repo/ci/github.yaml's forbidden list is amended: the issue projection still never runs for a pull request, while the pull request projection writes only the pull request's own labels, milestone, assignee and managed region, read from the trunk; case 1097 holds the new workflow to its model. The issues a pull request serves are the ones its title and head branch name, resolved by the executable through delivery's named_by (plan/delivery.rs:428-450, wrapping issues_named in ui/prs.rs:174) exposed as a typed subcommand github-sync calls, never a second shell pattern. It projects: a type label from the conventional type of its title, from the commit types I3979 declares (feat, fix, perf, refactor, docs, test, chore, ci, style, build); an area label from the commit scope only when the scope is declared there; the highest priority label of the served issues; train for an integration/train-* head; records when every changed path is under .ai/repo/project; hold and collision:accepted stay a person's. The milestone is the GitHub milestone github-sync already projects for the served issue's milestone; the author is assignee when none is set; a managed region between majordomus:begin and majordomus:end markers lists Refs #<n> for each served issue that has a GitHub issue, and the record id in plain text, with no priority or milestone, for one whose record exists only in the head. GitHub issue numbers come from a record-to-number map the trunk run of github.yml publishes, so a pull request event makes a bounded number of API calls and never lists every issue. No projected text carries a closing keyword (close, fix or resolve followed by an issue number). A second run changes nothing; a region whose hash no longer matches what was written is left alone and reported; a pull request whose token cannot write is reported and passes. Starts after train 4 lands its github-sync listing rewrite (the I3920 record, on chore/landing-survives-any-session), which then becomes a dependency.
BLOKOVÁNO vlna 1 · p0 · profil implementation · běží samostatně
Blocked. This issue cannot start until I3979 is done. The status is derived from that, not declared.
Cíl
A pull request's metadata is a projection of the trunk's records, applied by scripts/github-sync --prs locally and by a separate workflow file (not github.yml) on pull_request_target opened, edited, synchronize and labeled, which checks out the base branch only, never the head, and holds pull-requests: write and issues: read with GITHUB_TOKEN, in a concurrency group per pull request. The rule the-projection-is-applied-at-landing moves to version 2 and .ai/repo/ci/github.yaml's forbidden list is amended: the issue projection still never runs for a pull request, while the pull request projection writes only the pull request's own labels, milestone, assignee and managed region, read from the trunk; case 1097 holds the new workflow to its model. The issues a pull request serves are the ones its title and head branch name, resolved by the executable through delivery's named_by (plan/delivery.rs:428-450, wrapping issues_named in ui/prs.rs:174) exposed as a typed subcommand github-sync calls, never a second shell pattern. It projects: a type label from the conventional type of its title, from the commit types I3979 declares (feat, fix, perf, refactor, docs, test, chore, ci, style, build); an area label from the commit scope only when the scope is declared there; the highest priority label of the served issues; train for an integration/train-* head; records when every changed path is under .ai/repo/project; hold and collision:accepted stay a person's. The milestone is the GitHub milestone github-sync already projects for the served issue's milestone; the author is assignee when none is set; a managed region between majordomus:begin and majordomus:end markers lists Refs #<n> for each served issue that has a GitHub issue, and the record id in plain text, with no priority or milestone, for one whose record exists only in the head. GitHub issue numbers come from a record-to-number map the trunk run of github.yml publishes, so a pull request event makes a bounded number of API calls and never lists every issue. No projected text carries a closing keyword (close, fix or resolve followed by an issue number). A second run changes nothing; a region whose hash no longer matches what was written is left alone and reported; a pull request whose token cannot write is reported and passes. Starts after train 4 lands its github-sync listing rewrite (the I3920 record, on chore/landing-survives-any-session), which then becomes a dependency.
Proč
The owner asked on 2026-10-22 for every pull request to carry its metadata, kept current automatically and offloaded to GitHub, as prismatic-platform does. Today the label set of a pull request is what its author typed: hold, collision:accepted and ci:yielded are read by code (integration/classify.rs, scripts/ci/collision-gate) and set by hand, and no pull request names the GitHub issue its record is projected to. A full listing per pull request event would repeat the truncation of 2026-10-22 and hit the rate limit (github.yaml measured 111 s for one read of 271 issues; there are now about 1384).
Aktuální stav
Verified at 355a0cee79a: scripts/github-sync projects issues, milestones and the labels majordomus, priority:*, status:* and execution:parallel-safe (labels_of, github-sync:156-162) and refuses any tree that is not the trunk (github-sync:214-275); .github/workflows/github.yml runs only on push to master, .ai/repo/ci/github.yaml forbids a run for a pull request, rule the-projection-is-applied-at-landing says no trigger a pull request can reach, and case 1097 (line 21) refuses a pull_request trigger; issues_named reads title and head_ref only; the pull request template carries no managed region.
Cílový stav
Opening or pushing a pull request makes its labels, milestone, assignee and Refs region agree with the trunk's records within one workflow run; github-sync --prs --check reports drift for every open pull request and exits 11 on it; the issue projection rule stands, amended only for the pull request's own fields.
Rozsah
- scripts/github-sync
- .github/workflows
- .github/pull_request_template.md
- .ai/repo/ci/github.yaml
- .ai/repo/rules/project/the-projection-is-applied-at-landing.v1.md
- .ai/repo/rules/project/github-projection-gated.v1.md
- apps/majordomus-cli/src/plan/delivery.rs
- apps/majordomus-cli/src/ui/prs.rs
- test/cases/45_github_projection.sh
- test/cases/894_github_sync_applies_only_the_trunk.sh
- test/cases/1097_the_projection_is_applied_at_landing.sh
- CONTRIBUTING.md
- .ai/repo/project/issues/I3970.yaml
Mimo rozsah
- Auto-merge or any landing; the integration executor lands
- Projecting a pull request's labels into the records
- Running the issue projection for a pull request
Závislosti
Co na tom čeká
Kritéria přijetí
- Against a scripted forge, a pull request titled feat(plan): x (I3970) from branch feature/x gets the type label for feat, the priority of I3970 and its milestone, the author as assignee, and a region holding Refs to the issue projected for I3970 (case a_pull_request_carries_its_projected_metadata)
- A pull request whose served record exists only in its head gets the record id in plain text, no priority and no milestone
- A second apply changes nothing, and a region a person edited is reported and not overwritten
- No projected body, title or comment contains a closing keyword; a fixture title carrying one is projected without it
- One pull request event makes at most a fixed number of API calls, read from the scripted forge's call log, and never a full issue listing
- The workflow checks out the base branch only; case 1097 refuses a pull request workflow that checks out the head or writes issues
- github-sync --prs --check exits 11 on drift and 12 when a read fails
Validace
- bin/majordomus plan validate
- env -u MAJORDOMUS_SHARE -u MAJORDOMUS_HTTP_HOST -u MJ_ROOT bash test/run.sh 45_github_projection
- env -u MAJORDOMUS_SHARE -u MAJORDOMUS_HTTP_HOST -u MJ_ROOT bash test/run.sh 894_github_sync_applies_only_the_trunk
- env -u MAJORDOMUS_SHARE -u MAJORDOMUS_HTTP_HOST -u MJ_ROOT bash test/run.sh 1097_the_projection_is_applied_at_landing
Požadované důkazy
- pr_metadata_projected
Důkazy
Nic nezaznamenáno. Za každým tokenem výše musí stát příkaz nebo artefakt, než lze tento úkol dokončit; vyprávění se odmítá.
Časová osa
- zahájeno
- —
- ověřeno
- —
- dokončeno
- —
Tato tři pole, důkazy výše a stav závislostí jsou vše, z čeho se stav skládá. Neexistuje žádné pole stavu, které by s nimi mohlo být v rozporu.
Canonical record: .ai/repo/project/issues/I3970.yaml. Read it back with majordomus plan show I3970.