Files
PaperClipAI/.github
DottaandPaperclip 83b5f7d486 fix(ci): keep CODEOWNER PRs on AWS as master advances (#18821)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Its PR checks use reserved AWS capacity for authorized maintainers.
> - The routing gate waited for GitHub capacity and compared an old test
merge with a newer base branch.
> - Normal merges into master then sent trusted PR jobs to the GitHub
queue.
> - This change restores AWS admission and validates the immutable merge
selected for the run.
> - Current CODEOWNER and rerun identity checks still control PR
execution.

## Linked Issues or Issue Description

Related: #18376 moved the gate to GitHub-hosted capacity. #16042
introduced reserved AWS admission.

**What happened?**

In PR #18811, GitHub created test merge
`608d862ff1650db108a3832a2c67f8795924f0e7` at 17:17 UTC. Master advanced
at 17:25. The gate started at 17:30 and rejected the older merge parent
because it did not contain the newer master tip. The authorized PR then
selected GitHub-hosted runners. The gate itself also needed a
GitHub-hosted slot.

**Expected behavior**

Authorized maintainers use reserved AWS admission and PR workers. Normal
base advancement does not change runner placement. Current owner checks,
PR head checks, run-attempt checks, and base-history validation remain
required.

**Steps to reproduce**

1. Start a PR run whose author and sender are current CI CODEOWNERS.
2. Advance master while its routing job waits.
3. Run the gate against the original event merge and the current base
tip.
4. Before this change, the gate selects `ubuntu-latest`. After this
change, it selects the public PR AWS fleet.

**Paperclip version or commit**

Reproduced on master `367f29478d14003cc5c0f161b7ce8f3164993634`.

**Deployment mode**

GitHub Actions with RunsOn Fleet on AWS.

## What Changed

- Restore the reserved routing fleet for the synchronized maintainer
admission roster.
- Check the immutable event merge and its PR head. Accept base snapshots
between the event base and the current base tip.
- Allow GitHub to regenerate its live merge ref while the original run
waits.
- Retain stacked-base validation and all current CODEOWNER, repository,
author, sender, and rerun-attempt checks.
- Add advancement, regenerated-merge, unrelated-history, and
admission-placement regressions, including a stacked parent that
descends from the event base but diverges from the live base.
- Align the developing and CI profiling guides with reserved AWS
admission and current CODEOWNER checks before PR execution.

## Verification

- `node --test .github/scripts/tests/ci-routing.test.mjs
scripts/__tests__/e2e-shard.test.mjs`: 103 passed.
- `node --test .github/scripts/tests/ci-profile.test.mjs
.github/scripts/tests/ci-plan.test.mjs`: 31 passed.
- `actionlint .github/workflows/ci-routing.yml`: passed.
- `git diff --check`: passed.
- Mutation check: removing the snapshot-to-live-base comparison in a
temporary workflow copy makes the new side-branch regression fail,
proving it protects that ancestry guard.
- [Greptile:
5/5](https://github.com/paperclipai/paperclip/pull/18821#issuecomment-6612170970)
with a successful check on `abd6a8ce347228219d8e5127f34f57151788830e`;
both review threads are resolved.
- A regression reproduction on the original workflow selected GitHub
instead of AWS. The patched workflow passes that scenario.
- A read-only execution of the patched routing step against the actual
event for run
[41682867664](https://github.com/paperclipai/paperclip/actions/runs/41682867664),
using live GitHub metadata, selected
`runs-on/fleet=paperclip-public-pr-x64/env=public-ci`. This did not
allocate a runner or rerun CI.
- Full repository typecheck, Vitest, and build were not run in this
worktree, which has no installed dependencies. The change is limited to
workflow routing, its tests, and documentation. Broader CI checks remain
queued.

## Risks

- A stale admission roster can allocate the five-minute metadata gate.
The gate still checks current CODEOWNERS before it authorizes any PR
code on AWS.
- The routing runner group must authorize
`ci-routing.yml@refs/heads/master`. The fleet already exists; live
placement still needs confirmation after merge.
- Rewritten base history, changed PR heads, and unavailable identity or
ancestry evidence continue to deny AWS PR execution.
- Existing runs retain their previously resolved workflow. New runs use
this change after it reaches master.

## Model Used

OpenAI Codex, GPT-6 family, with reasoning, repository inspection, code
execution, and live GitHub API tools. The runtime does not expose the
exact serving model variant or context-window size.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-03 12:47:16 -06:00
..