Skip to content

feat(ops): add a versioned Vercel Preview retention runner - #1032

Merged
qnbs merged 8 commits into
mainfrom
feat/627-vercel-retention-runner
Oct 13, 2026
Merged

qnbs merged 8 commits into
mainfrom
feat/627-vercel-retention-runner

Conversation

@qnbs

@qnbs qnbs commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Adds a reviewed, versioned runner for the post-merge Vercel Preview retention pass, replacing the session-local scratchpad script. Part of #627.

  • pnpm run vercel:retention:dry-run is read-only.
  • pnpm run vercel:retention:reconcile runs the full pass.
  • Both take no argument: anything else is refused, so a command-line allow rule for them cannot be widened by appending text.

Why

The first ordinary pass under the maintainer's retention decision needed a manual one-off command because the only executable was a temporary file under /tmp. A durable runner removes that dependency. A shell allow rule is not a safety boundary, so the safety lives in the runner.

What a pass does

  1. Proves the exact-main gates: every CI / CD and CodeQL SAST run of the SHA is a completed success, Production is READY on it, the three canonical aliases are bound to it, canonical HTTP is 200, and the project identity matches fixed constants.
  2. Reads every page of deployments and aliases, open PRs and remote branches; an incomplete inventory stops the run.
  3. Classifies each preview as SAFE, PROTECTED or UNKNOWN in a pure function. Production-class deployments (production target, promoted, rollback candidate) never enter the classification.
  4. reconcile only: deletes at most 25 per pass. Before each ID it re-reads main, the gates and the whole provider state and re-classifies; a changed verdict only defers that ID. A branch alias of a gone branch goes first, after it is shown to bind to that deployment. Writes are never retried; a failed or unconfirmed write stops the pass.
  5. Post-proof by full re-read: protected IDs present, deleted IDs absent, canonical aliases unchanged, HTTP 200.

reconcile refuses to run unless scripts/vercel-retention/ and the two package scripts equal the reviewed origin/main and are clean, so an edited or unmerged checkout cannot delete anything.

Tests

172 cases against a simulated provider: authority (main moving at three points, push-only run gates and truncated run lists, five Production faults), pagination and read failure (including missing pagination metadata), project identity, Production-class protection, open-PR retention for 1/2/3/5 previews, unknown-metadata variants (commit SHA, creation time, state, identity), the explicit hold file, ROLLING and promoted Production-class protection, the per-preview manifest, reclassification before deletion, the post-proof Production re-check, the per-machine lock, refused/ambiguous/unconfirmed deletions, alias failure, batch limit, idempotence, redaction, source trust, argument-free entry points and ID/host validation. A live dry-run against the real project reports the same inventory as the hand-verified pass (42 Production, 2 rollback candidates, 0 unknown, 0 writes).

Not changed

No permission rule is installed and none is requested here; the exact command is documented as the one narrow rule the maintainer may choose to set. No change to the retention policy text (the Active-mode supersession is #1031), to tag, publish or Gate 7 authority, or to GitHub Pages record handling. Orphan aliases are reported by the provider but not removed.

Summary by Sourcery

Introduce a reviewed, versioned Vercel Preview retention runner that inventories and conservatively reconciles obsolete deployments with strict safety gates and post-run proof.

New Features:

  • Add fixed, argument-free dry-run and reconciliation commands for safely managing Vercel Preview deployments.
  • Classify Preview deployments conservatively while protecting Production-class deployments, active review evidence, open-PR previews, aliases, and unknown cases.

Enhancements:

  • Require exact-main CI, Production, alias, project, repository, and HTTP gates before reconciliation.
  • Bound deletions, revalidate each candidate before removal, avoid write retries, serialize reconciliation, and verify the final provider state.
  • Provide reviewed hold-file support and redacted manifests, summaries, and stop reasons for operational auditing.

Build:

  • Add package scripts for Vercel retention dry runs and reconciliation.

Documentation:

  • Document the retention runner commands, safety model, operational constraints, holds, permissions, and stop conditions.

Tests:

  • Add comprehensive simulated-provider coverage for authority checks, pagination, classification, deletion races, post-proof validation, locking, source trust, argument validation, and redaction.

Chores:

  • Add the initial reviewed Vercel retention hold file and update changelog and test-count documentation.

Summary by cubic

Replaces the temporary scratchpad script behind the Vercel Preview post-merge retention pass with a versioned runner under scripts/vercel-retention/ (issue #627). pnpm run vercel:retention:dry-run is read-only; pnpm run vercel:retention:reconcile runs the full pass, and both refuse any argument so an allow rule cannot be widened by appending text.

Safeguards

  • A pass proves the exact-main gates (every required push-triggered run on the SHA green, Production READY, canonical aliases bound, canonical HTTP 200) and the fixed project and origin identity, reads every page of deployments and aliases, validates every record before classification, and classifies each preview as SAFE, PROTECTED or UNKNOWN in a pure function. A manual or tag run never stands in, a run list at the request limit counts as truncated, a page without pagination metadata as malformed, and each page cursor is checked against its own page.
  • PROTECTED covers canonical or live-branch aliases, an open PR's newest three plain previews (ranked only from recognized plain previews with plausible creation times), main/open heads, and previews named in .github/vercel-retention-holds.json; missing, contradictory or foreign metadata (commit SHA, creation time, state, rollback flag, identity, PR identifier, environment id, promotion substate) makes a preview UNKNOWN.
  • reconcile deletes at most 25 previews per pass, re-reads main, the gates and the whole provider state before each ID, removes the branch alias of a gone branch first (settling a removal that landed despite a reported failure), never retries a write, and ends with a post-proof that re-asserts the gates, Production, the full Production predicate, kept branch aliases and deferred IDs together with their alias bindings, settled states and the Production-class set; one pass runs per machine.
  • reconcile runs only when the runner, hold file and package scripts equal the reviewed origin/main; the entry file loads only built-ins and the lock before that check.

Covered by the node:test suites against a simulated provider, plus a live dry-run matching the hand-verified inventory.

Written for commit b0eeeca. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • New Features
    • Added read-only dry-run and reconciliation commands for reviewing Vercel preview deployments and removing eligible previews.
    • Reconciliation requires the reviewed source to match the latest main branch, protects uncertain or held deployments, limits each run to 25 removals, and stops if safety checks fail.
  • Documentation
    • Added guidance on running the commands, safety checks, and exclusions.
  • Chores
    • Updated the reported test count in the README.

CodeAnt-AI Description

Add a reviewed Vercel Preview cleanup runner

What Changed

  • Add a read-only preview that lists which deployments would be kept or removed and why, before cleanup begins.
  • Add a cleanup command that removes up to 25 safe previews per run, while preserving Production, rollback candidates, active pull request previews, and previews explicitly held for review.
  • Recheck each preview before removal and verify the results afterward. Cleanup stops when required checks, Production health, inventory, or reviewed-source checks cannot be confirmed; extra command arguments are refused.

Impact

✅ Preview deletions reviewed before cleanup
✅ Production and active pull request previews retained
✅ Uncertain cleanup stops before further deletions

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Replace the scratchpad script behind the post-merge Vercel Preview
reconciliation with a reviewed runner under scripts/vercel-retention.
pnpm run vercel:retention:dry-run is read-only and
pnpm run vercel:retention:reconcile is the full pass; both take no argument,
so a command-line allow rule for them cannot be widened by appending text.

A pass proves the exact-main gates (every CI / CD and CodeQL SAST run on the
SHA, Production READY on it, the three canonical aliases, canonical HTTP) and
the fixed project identity, reads every page of deployments and aliases,
classifies each preview as SAFE, PROTECTED or UNKNOWN in a pure function,
re-reads main, the gates and the provider before deleting each ID, removes the
branch alias of a gone branch first, never retries a write and ends with a
post-proof. A mutating pass runs only when the runner and the two package
scripts equal the reviewed origin/main.

Mutations validate one deployment ID or alias host and always pass --safe, so
a project name cannot reach the project-wide form of remove. Tests run against
a simulated provider and cover authority, pagination, project identity,
Production protection, open-PR retention, unknown metadata, fault handling,
idempotence, redaction and the argument-free entry points.
@sourcery-ai

sourcery-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Sorry @qnbs, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
worldscript-studio Ready Ready Preview Oct 13, 2026 2:37am UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T02:34:08.180041Z e290d57 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR b0eeeca Oct 13, 2026 · 02:37 02:43
✅ Reviewed your PR e290d57 Oct 13, 2026 · 02:26 02:32
✅ Reviewed your PR a70a625 Oct 13, 2026 · 02:13 02:19
✅ Incremental review completed a70a625 Oct 13, 2026 · 02:12 02:13
✅ Reviewed your PR 4820471 Oct 13, 2026 · 01:58 02:05

@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: qnbs/WorldScript-Studio/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 94340471-3abd-4734-861e-52233fc70267
📥 Commits

Reviewing files that changed from the base of the PR and between e290d57 and b0eeeca.

📒 Files selected for processing (5)
  • docs/VERCEL-RETENTION-RUNNER.md
  • scripts/vercel-retention/apply.mjs
  • scripts/vercel-retention/authority.mjs
  • scripts/vercel-retention/classify.mjs
  • tests/unit/tooling/vercelRetentionSafety.test.mjs
📝 Walkthrough

The PR adds a Vercel preview-retention runner with dry-run and reconcile commands. It checks repository and production authority, classifies deployments, and applies bounded deletions with per-deployment checks and post-reconciliation proof.

Changes: Vercel Preview Retention Runner

Layer / File(s) Summary
Scope, provider reads, and authority checks
scripts/vercel-retention/scope.mjs, util.mjs, provider.mjs, authority.mjs, holds.mjs, tests/unit/tooling/*
Defines fixed Vercel scope and input checks. Reads complete provider inventories and verifies required runs, Production, and review holds. Tests cover authority and inventory validation.
Preview classification
scripts/vercel-retention/classify.mjs, tests/unit/tooling/*
Separates Production-class deployments from previews. Preview verdicts use aliases, branches, pull requests, deployment identity and state, and holds. Tests cover classification and protection rules.
Reconciliation and post-proof
scripts/vercel-retention/apply.mjs, scripts/vercel-retention/lock.mjs, tests/unit/tooling/*
Adds locking, per-candidate state and gate rechecks, bounded removals, and post-reconciliation checks for retained deployments and Production state. Tests cover writes, post-proof, and lock recovery.
CLI, trusted source, and operational documentation
scripts/vercel-retention/cli.mjs, scripts/vercel-retention/*, package.json, .github/vercel-retention-holds.json, docs/VERCEL-RETENTION-RUNNER.md, CHANGELOG.md, README.md, tests/unit/tooling/*
Adds the two package commands and a trusted-source check for reconciliation. Documents command behavior, safeguards, permissions, stop reasons, and exclusions. Adds fixtures and CLI tests, and updates test counts.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to e290d

The retention runner looks safe to merge. One sentence in the runbook misdescribes what operators will see when another process deletes the same preview, and should be corrected so stop reasons are read accurately.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a reviewed, versioned Vercel Preview retention runner that proves exact-main and production safety gates, inventories and classifies provider state conservatively, performs bounded per-ID revalidated deletion only from a trusted checkout, and verifies the resulting state with comprehensive simulated-provider tests.

Sequence diagram for the Vercel retention reconciliation pass

sequenceDiagram
    participant CLI
    participant Runner
    participant GitHub
    participant Vercel
    participant HTTP

    CLI->>Runner: parseMode(dry-run or reconcile)
    alt reconcile
        Runner->>GitHub: assertTrustedSource()
    end
    Runner->>GitHub: readMain()
    Runner->>Vercel: readProject()
    Runner->>Vercel: listDeployments()
    Runner->>Vercel: listAliases()
    Runner->>GitHub: readOpenPrs()
    Runner->>GitHub: readBranches()
    Runner->>GitHub: assertRequiredRuns(main SHA)
    Runner->>Vercel: assertProduction(world, main SHA)
    Runner->>HTTP: GET canonical URL
    Runner->>Runner: classify(world)
    alt reconcile with SAFE candidates
        loop Up to 25 IDs
            Runner->>GitHub: readMain()
            Runner->>Vercel: readProject(), listDeployments(), listAliases()
            Runner->>GitHub: readOpenPrs(), readBranches()
            Runner->>Runner: classify(world)
            alt verdict remains SAFE
                Runner->>Vercel: removeAlias(host)
                Runner->>Vercel: removeDeployment(id)
                Runner->>Vercel: listDeployments()
            else verdict changed
                Runner->>Runner: defer ID
            end
        end
        Runner->>Vercel: listDeployments(), listAliases()
        Runner->>HTTP: GET canonical URL
    end
    Runner-->>CLI: RETENTION_SUMMARY
Loading

State diagram for Vercel retention deployment verdicts

stateDiagram-v2
    [*] --> ProductionClass: isProductionClass
    [*] --> Preview: deployment is not production-class
    Preview --> PROTECTED: protectionReasons found
    Preview --> UNKNOWN: unknownReasons or lifecycleUnknown found
    Preview --> SAFE: no protection or unknown reasons
    SAFE --> Revalidate: reconcile candidate
    Revalidate --> SAFE: verdict unchanged
    Revalidate --> Deferred: verdict changed
    SAFE --> Deleted: removeDeployment confirmed
    SAFE --> Stopped: write failed or unconfirmed
    PROTECTED --> [*]
    UNKNOWN --> [*]
    Deleted --> [*]
    Deferred --> [*]
    Stopped --> [*]
Loading

Flow diagram for conservative Vercel preview classification

flowchart TD
    A[Provider deployment] --> B{isProductionClass}
    B -->|yes| P[PROTECTED production class]
    B -->|no| C{identity and metadata valid}
    C -->|no| U[UNKNOWN]
    C -->|yes| D{protectionReasons present}
    D -->|yes| K[PROTECTED preview]
    D -->|no| E{lifecycleUnknown present}
    E -->|yes| U
    E -->|no| S[SAFE]
    P --> Z[Exclude from deletion candidates]
    K --> Z
    U --> Z
Loading

File-Level Changes

Change Details Files
Add a fixed-command Vercel retention runner with separate read-only and mutating modes.
  • Register argument-free dry-run and reconcile package scripts.
  • Validate CLI modes before invoking any tools.
  • Document command behavior, stop reasons, source trust, scope, and operational boundaries.
package.json
docs/VERCEL-RETENTION-RUNNER.md
CHANGELOG.md
Implement conservative authority checks, complete inventory reads, and pure preview classification.
  • Anchor passes to the exact remote main SHA and require all required CI/CodeQL runs to be successful.
  • Validate Production readiness, canonical aliases, canonical HTTP, project identity, and repository linkage.
  • Read paginated deployments and aliases plus open PRs and branches, stopping on incomplete data.
  • Separate Production-class deployments and classify previews as SAFE, PROTECTED, or UNKNOWN using aliases, branch/PR state, metadata, and recency.
scripts/vercel-retention/authority.mjs
scripts/vercel-retention/provider.mjs
scripts/vercel-retention/classify.mjs
scripts/vercel-retention/scope.mjs
scripts/vercel-retention/util.mjs
Implement bounded, revalidated reconciliation with write safety and post-proof verification.
  • Re-read main, gates, and provider state before each candidate deletion and defer changed verdicts.
  • Remove validated non-canonical branch aliases before deleting deployments, with a 25-item batch limit.
  • Never retry writes; confirm deletion outcomes and stop on failures or ambiguity.
  • Re-read the full state after mutation to verify protected deployments, deleted IDs, canonical aliases, and HTTP status.
  • Redact provider errors and creator metadata from summaries and stop output.
scripts/vercel-retention/apply.mjs
scripts/vercel-retention/provider.mjs
Add broad simulated-provider regression coverage and update repository test metrics.
  • Cover authority failures, pagination, identity, production protection, classification edge cases, reclassification, deletion faults, batching, idempotence, redaction, source trust, argument validation, and ID/host validation.
  • Run the standalone Node test suite through the required Vitest test.
  • Update README test counts and testing documentation.
tests/unit/tooling/support/vercelRetentionFixture.mjs
tests/unit/tooling/vercelRetention.test.mjs
tests/unit/tooling/vercelRetention.test.ts
README.md

Possibly linked issues

  • #: The runner directly automates stale Preview cleanup with conservative classification, bounded deletions, and verification; the grace-period requirement remains unimplemented.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Oct 13, 2026
@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: b0eeeca2
Scan Time: 2026-10-13 03:13:13 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found, 2 false positive secrets suppressed
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED Rating S: No issues

View Full Results

codescene-access[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

[check-pr-size] PR size is over the hard tier (normal profile): 18 files, 2530 meaningful lines, 8 commits — limit ≤20 files / ≤1200 lines / ≤10 commits. Consider splitting into smaller, independently reviewable PRs.

codescene-access[bot]

This comment was marked as outdated.

Comment thread scripts/vercel-retention/authority.mjs Outdated
Comment thread scripts/vercel-retention/classify.mjs Outdated
Comment thread scripts/vercel-retention/cli.mjs Outdated
@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

CodeAnt PR Risk: Medium Risk

  • The PR needs attention before merging because a PR can reopen after per-deployment validation but before deletion, causing irreversible loss that post-proof only detects afterward.
  • Clarify how operators should avoid this check/delete race; the final proof cannot restore a deleted preview.

Assessed commit: b0eeeca265a7

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0133481e44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/vercel-retention/classify.mjs Outdated
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/provider.mjs Outdated
Comment thread scripts/vercel-retention/cli.mjs Outdated
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/cli.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/authority.mjs Outdated
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Classification: a preview without a usable commit SHA is UNKNOWN because it
cannot be compared with main or PR heads; a preview without a creation time is
ranked out of the newest-three selection instead of corrupting the sort; a
deployment rolling to Production is Production-class; previews named in a
reviewed hold file (.github/vercel-retention-holds.json) are kept as review
or retest evidence.

Authority: the gate is the push-triggered run on main for the exact SHA, so a
manual or tag run cannot stand in for it, and a run list as long as the request
limit is treated as truncated. Provider pages without pagination metadata are
malformed instead of final.

Pass: both modes print one manifest line per preview before the summary. The
post-proof re-asserts the anchored gates and that Production is still the same
READY deployment. A per-machine lock stops a second concurrent reconcile before
it reads anything and is always released. The entry file loads only built-ins
and the lock before the source check, so no runner module that reads or deletes
is loaded from an untrusted source; the doc states that this guards against an
accidental checkout, not a hostile one.

The fixture is table-driven to keep each function small.
codescene-access[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: qnbs/WorldScript-Studio/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 56fe5617-a1d2-42b8-bf65-05cf8e6b455a
📥 Commits

Reviewing files that changed from the base of the PR and between 1d4a0ca and f2770d8.

📒 Files selected for processing (17)
  • .github/vercel-retention-holds.json
  • CHANGELOG.md
  • README.md
  • docs/VERCEL-RETENTION-RUNNER.md
  • package.json
  • scripts/vercel-retention/apply.mjs
  • scripts/vercel-retention/authority.mjs
  • scripts/vercel-retention/classify.mjs
  • scripts/vercel-retention/cli.mjs
  • scripts/vercel-retention/holds.mjs
  • scripts/vercel-retention/lock.mjs
  • scripts/vercel-retention/provider.mjs
  • scripts/vercel-retention/scope.mjs
  • scripts/vercel-retention/util.mjs
  • tests/unit/tooling/support/vercelRetentionFixture.mjs
  • tests/unit/tooling/vercelRetention.test.mjs
  • tests/unit/tooling/vercelRetention.test.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Comment thread scripts/vercel-retention/lock.mjs Outdated
@qnbs

qnbs commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2770d8e93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/vercel-retention/authority.mjs Outdated
Comment thread scripts/vercel-retention/provider.mjs Outdated
Comment thread scripts/vercel-retention/cli.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/provider.mjs
Comment thread scripts/vercel-retention/provider.mjs
@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

CodeAnt Nitpicks

2 code suggestions

1. assertBoundAlias checks an earlier snapshot, then removes by host alone; a concurrent rebind lets this call remove another deployment’s alias.

Race condition · scripts/vercel-retention/apply.mjs:131-132


2. lockPath() creates a new temporary directory for each lock test, and none remove it, so every suite run leaves directories and sometimes lock files in the system temp directory.

Resource leak · tests/unit/tooling/vercelRetentionSafety.test.mjs:511

Validate every open-PR, alias and deployment record before classification,
protect branches of open fork PRs and failed previews of living branches,
treat custom deployment targets as unknown, read page-boundary ties, take the
lock atomically, print the manifest before the first write, and make the
post-proof re-check the anchor, kept branch aliases and deferred IDs.
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@qnbs

qnbs commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

Comment thread scripts/vercel-retention/apply.mjs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4820471a31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/vercel-retention/provider.mjs
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/apply.mjs
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs
…o the retention post-proof

Validate page cursors against their own page, treat a malformed PR identifier
as unknown, settle an alias removal that failed after it landed by re-reading,
and compare the alias bindings and settled states of deferred previews and the
set of Production-class deployments in the post-proof.
codescene-access[bot]

This comment was marked as outdated.

@qnbs

qnbs commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

Comment thread scripts/vercel-retention/lock.mjs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a70a625c5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/vercel-retention/authority.mjs
Comment thread scripts/vercel-retention/classify.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/lock.mjs Outdated
Comment thread scripts/vercel-retention/authority.mjs
Comment thread scripts/vercel-retention/apply.mjs
Comment thread scripts/vercel-retention/apply.mjs
…identity and the final PR snapshot

Check the Production deployment's own identity and the origin remote, treat a
non-string branch and an alias host the removal would refuse as unknown, keep
a displaced lock when its put-back fails, and make the post-proof require the
exact planned Production-class set and re-classify deleted records against the
final PR and branch snapshot.
@qnbs

qnbs commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

codescene-access[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: qnbs/WorldScript-Studio/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 11d5cff8-364e-47c1-8711-d664b8860585
📥 Commits

Reviewing files that changed from the base of the PR and between f2770d8 and e290d57.

📒 Files selected for processing (11)
  • docs/VERCEL-RETENTION-RUNNER.md
  • scripts/vercel-retention/apply.mjs
  • scripts/vercel-retention/authority.mjs
  • scripts/vercel-retention/classify.mjs
  • scripts/vercel-retention/cli.mjs
  • scripts/vercel-retention/lock.mjs
  • scripts/vercel-retention/provider.mjs
  • tests/unit/tooling/support/vercelRetentionFixture.mjs
  • tests/unit/tooling/vercelRetention.test.mjs
  • tests/unit/tooling/vercelRetention.test.ts
  • tests/unit/tooling/vercelRetentionSafety.test.mjs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Comment thread docs/VERCEL-RETENTION-RUNNER.md Outdated
Comment thread scripts/vercel-retention/classify.mjs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e290d57e5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/vercel-retention/apply.mjs Outdated
Comment thread scripts/vercel-retention/classify.mjs Outdated
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/classify.mjs
Comment thread scripts/vercel-retention/classify.mjs
…predicate

Rank open-PR retention slots from recognized plain previews only, accept a
creation time only when it is a plausible instant, treat any environment id
or unrecognized promotion substate as unknown, and apply the authorizing
Production predicate again in the post-proof.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@qnbs

qnbs commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Comment thread scripts/vercel-retention/cli.mjs
@qnbs
qnbs merged commit f07bb64 into main Oct 13, 2026
52 checks passed
@qnbs
qnbs deleted the feat/627-vercel-retention-runner branch October 13, 2026 03:13
qnbs added a commit that referenced this pull request Oct 13, 2026
qnbs added a commit that referenced this pull request Oct 13, 2026
qnbs added a commit that referenced this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant