Outcome
Checks on stacked PRs test an immutable snapshot that includes every lower layer, key their validity to the full context, and let repository policy bound the CI cost of deep stacks.
Context
docs/stacked-prs.md sections 11.3–11.5 and 5.8 define the model. The forge has no per-branch checks surface today; the closest precedents are the release build worker and gate receipts keyed to exact SHAs. This issue lands the stack side and consumes a checks surface when one exists.
Acceptance criteria
- Required-check validity keys to
(pr_id, head_oid, effective_base_oid) at minimum, not head_oid alone; a trunk advance invalidates or re-evaluates affected checks.
- For stacks needing a rebase, and for queue speculation, the system publishes a private synthetic ref whose tree represents current trunk plus all layers through this position, and checks run against that immutable OID.
- Workflow policy supports
run_on: every_layer, top_layer_only, bottom_layer_only, changed_paths, and merge-group-only execution. A check declared required never runs silently skipped; optimization is declared policy.
Verification
Tests for identity invalidation on trunk advance, synthetic ref immutability, and each run-on policy against a fixture workflow set. Run mix precommit.
Dependencies
A per-branch checks surface, which does not exist yet — coordinate with whatever lands it (the build worker and gate receipt machinery are the natural base). Stack schema (#47) and effective-base plumbing (#52) come first.
Outcome
Checks on stacked PRs test an immutable snapshot that includes every lower layer, key their validity to the full context, and let repository policy bound the CI cost of deep stacks.
Context
docs/stacked-prs.mdsections 11.3–11.5 and 5.8 define the model. The forge has no per-branch checks surface today; the closest precedents are the release build worker and gate receipts keyed to exact SHAs. This issue lands the stack side and consumes a checks surface when one exists.Acceptance criteria
(pr_id, head_oid, effective_base_oid)at minimum, nothead_oidalone; a trunk advance invalidates or re-evaluates affected checks.run_on: every_layer,top_layer_only,bottom_layer_only,changed_paths, and merge-group-only execution. A check declared required never runs silently skipped; optimization is declared policy.Verification
Tests for identity invalidation on trunk advance, synthetic ref immutability, and each run-on policy against a fixture workflow set. Run
mix precommit.Dependencies
A per-branch checks surface, which does not exist yet — coordinate with whatever lands it (the build worker and gate receipt machinery are the natural base). Stack schema (#47) and effective-base plumbing (#52) come first.