Commit Graph
4 Commits
Author SHA1 Message Date
Devin FoleyandPaperclip 2a8a0b8e18 fix(ci): retry inconsistent release admission listings (#23572)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Core release workflows admit a source revision before running full
verification.
> - Admission discovers an active image or npm release for that exact
revision.
> - One inconsistent GitHub run listing currently fails admission before
tests start.
> - This pull request rereads count mismatches within a fixed retry
budget.
> - Complete listings and fresh canonical run identity remain required.

## Linked Issues or Issue Description

**What happened?**

[Cloud readiness run
47005873736](https://github.com/paperclipai/paperclip/actions/runs/47005873736)
failed candidate admission with `Incomplete release workflow listing.`
This happened before source tests ran. The [image
workflow](https://github.com/paperclipai/paperclip/actions/runs/47005873889)
then canceled itself because source verification failed. Image consumers
could not advance to that revision.

**Expected behavior**

Admission should allow a short, bounded recovery window for an
inconsistent workflow count. It must reject persistently incomplete or
untrusted evidence.

**Steps to reproduce**

Return a workflow listing whose `total_count` differs from the number of
returned runs. Then return a complete listing for the same query. The
original script fails on the first response. The new regression test
requires admission to wait for complete evidence and revalidate the
selected run.

**Paperclip version or commit**

The reported run used `b066a3ddd39123972d0e7f5f9935c83d41303297`. This
fix starts from `6e340a3f962c60e2723c780389db878ce7ff74c7`.

**Deployment mode**

Canonical GitHub Actions master-push release workflows.

Related changes: #18869 introduced release admission; #22677 added
conditional Actions reads; #22690 added quota-aware read retries. I
searched open and closed PRs and issues for admission and
workflow-listing failures. I found no duplicate fix.

## What Changed

- Allow up to three admission listing reads when valid, bounded counts
disagree with the returned run count. Wait one second, then two seconds.
- Include safe workflow and count details if the mismatch persists.
- Preserve strict listing validation and the fresh canonical run check.
Publication and deferred-producer readers retain their existing
single-read behavior.
- Cover recovery for both release consumers, exhausted retries,
overcounts, undercounts, and a run attempt changing before admission.

## Verification

- The new admission regressions fail against the original
implementation.
- `node --test scripts/cloud-source-verification.test.mjs
scripts/github-actions-rate-limit.test.mjs
scripts/docker-image-metadata.test.mjs
.github/scripts/tests/cloud-readiness.test.mjs` — 81 tests pass on the
changed revision.
- `node --check scripts/cloud-release-admission.mjs` and `git diff
--check` pass.
- `pnpm verify --explain` exits 2 as designed: the changed script is a
global CI input. Broad typecheck, test, build, Runner, and browser
checks must run in CI. This is not a full local-suite pass.
- Reviewed the diff and scanned added lines for credentials, personal
paths, and private URLs before pushing. No findings.
- Greptile reviewed `525694ddc75e7f4c4d1e6c2e00fbc9fd15deadd5` at 5/5.
No review threads or actionable comments remain. All underlying
typecheck, build, unit, Runner, serialized-server, and 16 browser shard
checks passed in [CI run
47008128119](https://github.com/paperclipai/paperclip/actions/runs/47008128119)
on `525694ddc75e7f4c4d1e6c2e00fbc9fd15deadd5`. The final [`ci / verify`
aggregate](https://github.com/paperclipai/paperclip/actions/runs/47008128119/job/143921126471)
also passed. All checks are settled with no failures. GitHub reports the
branch clean and mergeable against current master.

## Risks

Low risk. Admission can spend up to six extra seconds across its two
consumer queries. Malformed metadata, oversized listings, and exhausted
mismatches still fail closed. No source proof or publication gate is
relaxed. No database or deployment configuration changes are required.

The original GitHub response was not retained, so its exact invalid
field remains unknown. The regression tests inject count mismatches; a
later healthy master run establishes recovery, but does not prove the
cause of the earlier response.

## Model Used

OpenAI `gpt-6.1-sol` through Codex in T3 Code, with xhigh reasoning and
shell/tool access. The runtime does not report the context window size.
No subagents were used.

## 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
- [x] 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-12-02 17:26:18 -08:00
Devin FoleyandPaperclip e65c68726b Require published migrators before publishing Core images (#19023)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Its release pipeline publishes Core images and exact-source database
migrators.
> - A migrator run can pass admission but skip all build and publication
work.
> - The image observer could stop checking after provisional build
admission.
> - The final image gate checked source proof without checking migrator
publication.
> - This pull request requires the exact migrator publisher to finish
before image publication.
> - Consumers can then use the published image with its matching
migration artifact.

## Linked Issues or Issue Description

**What happened?**

The [migrator run for
e968131](https://github.com/paperclipai/paperclip/actions/runs/41868122685)
passed its admission job but skipped build and publish. Its [Docker
run](https://github.com/paperclipai/paperclip/actions/runs/41868122627)
still published an image. The exact-source migrator artifact was absent.

**Expected behavior**

An image consumer restarts a strictly deferred producer. It waits for
the exact migrator publication before it publishes the image. A
successful admission job alone does not prove publication.

**Steps to reproduce**

1. Let a migrator run defer work while the image consumer starts.
2. Make the producer appear admitted before its build later becomes
skipped.
3. Complete the source verification job.
4. Observe that the old image gate can accept source proof without a
successful migrator publisher.

The regression fixtures model this state. The real producer records
establish the missing publication; the exact transient API response seen
by the original observer is not retained.

**Paperclip version or commit**

The observed source was `e968131efa7e63d321f3bcca8d47a62513c2efb4`. This
patch is based on current master.

No duplicate fix was found in open migrator PRs. PR #18406 concerns npm
canary scheduling and does not provide this image publication gate.

## What Changed

- Require the successful canonical migrator `publish` job for the exact
source and latest attempt. Check complete job pages and re-read the run
after the jobs.
- Continue observing deferred producers until publication, even after a
build appeared admitted. Only a physical runner proves build admission.
- Check migrator publication again in the final read-only
`--check-proof` image gate. Failed producers still require inspection
and are not retried automatically.
- Add regression coverage for deferred recovery, skipped and stale
publication, attempt races, and the final CLI gate. Update release
documentation.

## Verification

- All 57 current-head check contexts are successful or expected skips on
`daed1c756a9fc02b8c15128b96af4da86d447e3f`; both required checks (`ci /
verify`, `ci / e2e`) passed. Greptile is 5/5 with no review threads, and
the branch has no merge conflicts. GitHub master rules require CODEOWNER
review before merging.
- The first CI attempt failed serialized server shard 2/9:
`heartbeat-process-recovery.test.ts` timed out after three seconds
waiting for an adapter execution to start (1 failed, 411 passed).
[Failed
job](https://github.com/paperclipai/paperclip/actions/runs/41894941958/job/126802368555).
This PR changes no server or package files. The exact timeout cause is
not established; this failure is retained and is not described as
infrastructure noise.
- The same first attempt also failed general server shard 6/12:
`heartbeat-stale-queue-invalidation.test.ts` waited five seconds for an
adapter execution after native-owner completion; the run remained
running with no error (1 failed, 2,627 passed, 3 skipped). [Failed
job](https://github.com/paperclipai/paperclip/actions/runs/41894941958/job/126802369329).
Its cause is also not established. The first-attempt failures remain
part of this record.
- The single controlled failed-jobs rerun completed successfully on
attempt 2 at the identical commit. Both previously failed heartbeat
shards and the aggregate verifier passed. This demonstrates recovery on
rerun; the underlying first-attempt failure causes are not established.
[Successful
rerun](https://github.com/paperclipai/paperclip/actions/runs/41894941958/attempts/2).
- Node 24: `node --test scripts/cloud-source-verification.test.mjs
scripts/standard-image-contract.test.mjs` passed: 62 tests, 0 failures,
after rebasing on current master.
- An explicitly gated read-only live probe rejected the real skipped
producer for `e968131` and accepted the published producer for
`afbc5a885b52e96df10c1c6e643bea31b51caac8`.
- `git diff --check` and Gitleaks passed before push.
- A broader run that also included
`scripts/__tests__/release-verify-workflow.test.mjs` failed when local
fixture creation and package installation hit `ENOSPC`. Those failures
remain unverified locally; the focused source and image tests passed
separately, and CI Typecheck + Release Registry subsequently passed.
- Full workspace typecheck, Vitest and app builds were not run locally.
Disk capacity does not permit installing the full workspace in this
separate checkout. No application TypeScript or package manifest
changed. The complete CI run subsequently passed, including typecheck,
build, general and serialized tests, release checks and e2e.
- No live Slack posts, workflow dispatches, producer reruns, deployments
or provider mutations.

## Risks

- Image publication now waits for the exact migrator publisher. A failed
publisher blocks the image and reports a publication failure. Existing
source failure cancellation still applies.
- This adds bounded Actions reads to the existing source observer. The
observer keeps its existing deadline. The final publication runner only
reads evidence and cannot restart producers.
- The publisher job name is part of this gate. A workflow rename must
update the gate.
- No database schema, migration content, image contents, credentials or
application behavior change. Revert this PR to restore the prior
publication gate.

## Model Used

- OpenAI `gpt-6.1-sol`, xhigh reasoning effort, through Codex in T3
Code. Source inspection, tool use and code execution. Context window
size is not exposed by the harness.

## 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 — focused tests pass;
broader local ENOSPC failures are recorded above
- [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
- [x] 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-04 11:51:42 -08:00
DottaandPaperclip 44a4ca1c61 fix(ci): remove the admission CLI import cycle (#18889)
Move the unchanged Actions read transport into an independent module so the admission CLI can evaluate consumers without awaiting a circular import of source verification. Preserve the existing source verification export and all verification and placement contracts.

Five child-process cases reproduce the original exit-13 failure before the repair and pass afterward. All 59 source/admission/image checks and 665 workflow contracts pass. Both CLI modes also pass read-only smoke checks against real GitHub metadata. Complete latest-head CI passed on its first attempt, with Greptile 5/5 and no unresolved comments.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-11-03 18:21:55 -06:00
DottaandPaperclip f774992832 perf(ci): admit release candidates and isolate native image capacity (#18869)
Admit full source verification only for exact-source Docker or npm release work, while superseded pending sources complete metadata-only admission. Restart only strictly deferred runs; failed or cancelled checks require an explicit request.

Route canonical master native images to dedicated 32-core Spot profiles and keep source checks on protected verification capacity. Use the four-slot GitHub-hosted publication pool for registry work and signing, with proof waits outside that pool and a fresh source-proof check before tagging. Trim historical checkout blobs and prepared-runner disk cleanup while preserving tag and fork publication behavior.

Validation: release/source and source/artifact regressions, 665 workflow contracts, actionlint, complete latest-head PR CI, and Greptile 5/5 with all comments resolved. Existing CLI and large-file repository timing tests also passed independently; their CI shards received one scoped retry.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-11-03 18:01:07 -06:00