Skip to content

Add pnpm clean:artifacts for branch-switch recovery - #3698

Open
TooTallNate wants to merge 2 commits into
mainfrom
nrajlich/clean-artifacts-script
Open

Add pnpm clean:artifacts for branch-switch recovery#3698
TooTallNate wants to merge 2 commits into
mainfrom
nrajlich/clean-artifacts-script

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Problem

Gitignored build outputs survive git checkout across branches whose layouts disagree (main vs stable, or any two branches spanning a refactor), and the mismatched leftovers repeatedly wedge the repo in ways that look like unrelated breakage:

  • pnpm install hangs or errors in workbench prepare scripts: sveltekit's svelte-kit sync loads a vite config that resolves workflow to a stale packages/workflow/dist whose imports no longer match the checked-out exports map (Could not resolve "workflow/internal/private"), or compiles the checked-out workflows with a stale SWC plugin build that predates their syntax (Functions marked with "use step" must be async on valid code)
  • tsc fails on generated files the branch doesn't have (e.g. quickjs-assets.generated.ts on stable, which has no QuickJS), or emits nothing because a stale .tsbuildinfo claims outputs are fresh
  • Worst: a build that runs while dist is polluted lets Turbo capture the polluted dist as that task's cached outputs — after which the cache faithfully restores the pollution on every rebuild, and rm -rf dist alone can't fix it (hit this exact loop with web-shared today)

Every one of these was hit in practice this week while working across main, stable, and backport branches.

Fix

scripts/clean-artifacts.sh, wired as pnpm clean:artifacts and documented in AGENTS.md under a new "Branch-switch hygiene" section. Recovery flow:

pnpm clean:artifacts   # --dry-run to preview, --all to also drop node_modules + Cargo target/
pnpm install
pnpm build

Design

  • Candidates come from git ls-files -o -i --exclude-standard --directoryonly files git ignores. Untracked work-in-progress files are never touched. Two tempting alternatives were deliberately rejected: git clean -x (removes untracked files too — it ate this PR's own uncommitted script during validation), and git clean -X -e <pattern> (under -X, -e patterns modify the ignore rules rather than protect, and negations leak into subdirectories — verified empirically).
  • Keep-list by default: node_modules (slow reinstall; pnpm's store makes staleness rare — the Turbo cache lives at .turbo/ and IS removed), .env*/*.local (secrets like the pulled VERCEL_OIDC_TOKEN), .vercel (project links), Cargo target/ (Cargo fingerprints inputs correctly across branches; a cold SWC-plugin rebuild costs minutes), and local agent state.
  • Needs nothing from the workspace — not turbo, not pnpm scripts, not a working build — so it works precisely when everything else is too broken to run.

Verification

Ran the full cycle on a workspace that was actively wedged (the exact workflow/internal/private + SWC-transform-error state from the issue report): pnpm clean:artifactspnpm install completes in 4s (sveltekit prepare falls back gracefully instead of hanging) → pnpm build green (28/28 tasks) → git status clean of tracked modifications. Dry-run confirms zero protected paths in the removal set (93 candidates, 61 kept on a warm tree).

Gitignored build outputs survive git checkout across branches whose
layouts disagree (main vs stable, or any two branches spanning a
refactor), and the mismatched leftovers wedge the repo in ways that
look like unrelated breakage: pnpm install hanging in workbench
prepare scripts ('Could not resolve "workflow/internal/private"',
SWC transform errors on valid workflow code), tsc failing on generated
files the branch doesn't have, and — worst — Turbo capturing polluted
dist as cached task outputs and faithfully restoring the pollution on
every rebuild.

scripts/clean-artifacts.sh removes exactly the files git ignores
(candidates from git ls-files -o -i, filtered through a keep-list in
shell). Untracked work-in-progress files are never touched — git clean
-x removes those too, and git clean -X -e patterns modify the ignore
rules under -X rather than protect, so both were deliberately avoided.
Kept by default: node_modules, .env*/*.local, .vercel links, Cargo
target/, and local agent state; --all also drops node_modules and
target/, --dry-run previews. Wired as 'pnpm clean:artifacts' and
documented in AGENTS.md under Branch-switch hygiene.
@TooTallNate
TooTallNate requested a review from a team as a code owner August 20, 2026 19:24
Copilot AI lite review requested due to automatic review settings August 20, 2026 19:24
@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c05fc54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

⚠️ Flaky E2E Tests (passed on retry)

These tests failed at least once and passed on a retry. A recurring entry here is a real race worth investigating.

  • addTenWorkflow (astro)
  • addTenWorkflow (hono)
  • deploymentId: 'latest' is a no-op in non-Vercel worlds (tanstack-start)
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data (nextjs-webpack)
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running (nextjs-webpack)
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions (example)
  • utf8StreamWorkflow (nitro)

🛠 Infra Events (absorbed by the harness)

Platform anomalies the e2e harness detected and worked around (e.g. a run the queue never picked up, replaced by a fresh run). Clustered timestamps indicate a backend blip; a steady drip indicates a platform issue worth escalating.

  • cold-start-warmup · suite warmup (tanstack-start) · at 19:50:04Z · abandoned wrun_01M0GBHKB02QXHF7EFC8M5ZQ54
  • run-pickup-stall · abortParallelWorkflow: abort cancels all parallel steps (nuxt) · at 19:52:24Z · abandoned wrun_01M0GBP7M55507VX0323NCK9DX

E2E Test Summary

Summary
Passed Failed Skipped Total
✅ ▲ Vercel Production 3578 0 742 4320
✅ 💻 Local Development 3922 0 558 4480
✅ 📦 Local Production 3922 0 558 4480
✅ 🐘 Local Postgres 3922 0 558 4480
✅ 🪟 Windows 320 0 0 320
✅ 🌐 Cross-language Conformance 9 0 132 141
✅ vercel-multi-region 27 0 0 27
Total 15700 0 2548 18248
Details by Category

✅ ▲ Vercel Production

App Passed Failed Skipped
✅ astro-node 132 0 28
✅ astro-quickjs 132 0 28
✅ example-node 132 0 28
✅ example-quickjs 132 0 28
✅ express-node 132 0 28
✅ express-quickjs 132 0 28
✅ fastify-node 132 0 28
✅ fastify-quickjs 132 0 28
✅ hono-node 132 0 28
✅ hono-quickjs 132 0 28
✅ nest-node 132 0 28
✅ nest-quickjs 132 0 28
✅ nextjs-turbopack-node 157 0 3
✅ nextjs-turbopack-quickjs 157 0 3
✅ nextjs-webpack-node 157 0 3
✅ nextjs-webpack-quickjs 157 0 3
✅ nitro-node 132 0 28
✅ nitro-quickjs 132 0 28
✅ nuxt-node 132 0 28
✅ nuxt-quickjs 132 0 28
✅ python-node 8 0 152
✅ sveltekit-node 151 0 9
✅ sveltekit-quickjs 151 0 9
✅ tanstack-start-node 132 0 28
✅ tanstack-start-quickjs 132 0 28
✅ vite-node 132 0 28
✅ vite-quickjs 132 0 28

✅ 💻 Local Development

App Passed Failed Skipped
✅ astro-stable-node 134 0 26
✅ astro-stable-quickjs 134 0 26
✅ express-stable-node 134 0 26
✅ express-stable-quickjs 134 0 26
✅ fastify-stable-node 134 0 26
✅ fastify-stable-quickjs 134 0 26
✅ hono-stable-node 134 0 26
✅ hono-stable-quickjs 134 0 26
✅ nest-stable-node 134 0 26
✅ nest-stable-quickjs 134 0 26
✅ nextjs-turbopack-canary-node 141 0 19
✅ nextjs-turbopack-canary-quickjs 141 0 19
✅ nextjs-turbopack-stable-node 160 0 0
✅ nextjs-turbopack-stable-quickjs 160 0 0
✅ nextjs-webpack-canary-node 141 0 19
✅ nextjs-webpack-canary-quickjs 141 0 19
✅ nextjs-webpack-stable-node 160 0 0
✅ nextjs-webpack-stable-quickjs 160 0 0
✅ nitro-stable-node 134 0 26
✅ nitro-stable-quickjs 134 0 26
✅ nuxt-stable-node 134 0 26
✅ nuxt-stable-quickjs 134 0 26
✅ sveltekit-stable-node 153 0 7
✅ sveltekit-stable-quickjs 153 0 7
✅ tanstack-start-node 134 0 26
✅ tanstack-start-quickjs 134 0 26
✅ vite-stable-node 134 0 26
✅ vite-stable-quickjs 134 0 26

✅ 📦 Local Production

App Passed Failed Skipped
✅ astro-stable-node 134 0 26
✅ astro-stable-quickjs 134 0 26
✅ express-stable-node 134 0 26
✅ express-stable-quickjs 134 0 26
✅ fastify-stable-node 134 0 26
✅ fastify-stable-quickjs 134 0 26
✅ hono-stable-node 134 0 26
✅ hono-stable-quickjs 134 0 26
✅ nest-stable-node 134 0 26
✅ nest-stable-quickjs 134 0 26
✅ nextjs-turbopack-canary-node 141 0 19
✅ nextjs-turbopack-canary-quickjs 141 0 19
✅ nextjs-turbopack-stable-node 160 0 0
✅ nextjs-turbopack-stable-quickjs 160 0 0
✅ nextjs-webpack-canary-node 141 0 19
✅ nextjs-webpack-canary-quickjs 141 0 19
✅ nextjs-webpack-stable-node 160 0 0
✅ nextjs-webpack-stable-quickjs 160 0 0
✅ nitro-stable-node 134 0 26
✅ nitro-stable-quickjs 134 0 26
✅ nuxt-stable-node 134 0 26
✅ nuxt-stable-quickjs 134 0 26
✅ sveltekit-stable-node 153 0 7
✅ sveltekit-stable-quickjs 153 0 7
✅ tanstack-start-node 134 0 26
✅ tanstack-start-quickjs 134 0 26
✅ vite-stable-node 134 0 26
✅ vite-stable-quickjs 134 0 26

✅ 🐘 Local Postgres

App Passed Failed Skipped
✅ astro-stable-node 134 0 26
✅ astro-stable-quickjs 134 0 26
✅ express-stable-node 134 0 26
✅ express-stable-quickjs 134 0 26
✅ fastify-stable-node 134 0 26
✅ fastify-stable-quickjs 134 0 26
✅ hono-stable-node 134 0 26
✅ hono-stable-quickjs 134 0 26
✅ nest-stable-node 134 0 26
✅ nest-stable-quickjs 134 0 26
✅ nextjs-turbopack-canary-node 141 0 19
✅ nextjs-turbopack-canary-quickjs 141 0 19
✅ nextjs-turbopack-stable-node 160 0 0
✅ nextjs-turbopack-stable-quickjs 160 0 0
✅ nextjs-webpack-canary-node 141 0 19
✅ nextjs-webpack-canary-quickjs 141 0 19
✅ nextjs-webpack-stable-node 160 0 0
✅ nextjs-webpack-stable-quickjs 160 0 0
✅ nitro-stable-node 134 0 26
✅ nitro-stable-quickjs 134 0 26
✅ nuxt-stable-node 134 0 26
✅ nuxt-stable-quickjs 134 0 26
✅ sveltekit-stable-node 153 0 7
✅ sveltekit-stable-quickjs 153 0 7
✅ tanstack-start-node 134 0 26
✅ tanstack-start-quickjs 134 0 26
✅ vite-stable-node 134 0 26
✅ vite-stable-quickjs 134 0 26

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack-node 160 0 0
✅ nextjs-turbopack-quickjs 160 0 0

✅ 🌐 Cross-language Conformance

App Passed Failed Skipped
✅ python 9 0 132

✅ vercel-multi-region

App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

📋 View full workflow run

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Aug 20, 2026 7:51pm
example-nextjs-workflow-webpack Ready Ready Preview Aug 20, 2026 7:51pm
example-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-astro-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-express-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-fastify-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-hono-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-nestjs-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-nitro-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-nuxt-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-python-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-sveltekit-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-tanstack-start-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workbench-vite-workflow Ready Ready Preview Aug 20, 2026 7:51pm
workflow-docs Ready Ready Preview, v0 Aug 20, 2026 7:51pm
workflow-swc-playground Ready Ready Preview Aug 20, 2026 7:51pm
workflow-tarballs Ready Ready Preview Aug 20, 2026 7:51pm
workflow-web Ready Ready Preview Aug 20, 2026 7:51pm

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit c05fc54 · Thu, 20 Aug 2026 20:09:57 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1257 (+34%) 🔻 1386 🔴 (+18%) 🔻 1424 🔴 (+15%) 🔻 1476 🔴 (+3.9%) 30
TTFS stream 233 (-78%) 💚 1352 🔴 (+16%) 🔻 1405 🔴 (+14%) 1469 🔴 (+14%) 30
TTFS hook + stream 1297 (-5.7%) 1764 🔴 (+16%) 🔻 1829 🔴 (+17%) 🔻 1986 🔴 (+23%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 596 (-11%) 957 (-50%) 💚 2108 (+9.7%) 2824 (+42%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 5223 (-17%) 💚 11183 (+17%) 🔻 18140 (+50%) 🔻 19085 (+30%) 🔻 10
STSO 1020 steps (inline) 148 (-8.6%) 185 (-35%) 💚 209 (-37%) 💚 380 (-43%) 💚 1019
WO 1020 steps 186620 (-33%) 💚 186620 (-33%) 💚 186620 (-33%) 💚 186620 (-33%) 💚 1
CRTT first chunk (pooled) 126 (+6.8%) 172 (+6.2%) 414 (+26%) 🔻 479 (-38%) 💚 28

Streams

Scenario CRTT 1st p75 p90 p99 CDV max iters
paced control (100/s, 60B) 144 (+1%) 164 (-20%) 243 (-59%) 597 (-59%) 138 (-40%) 10
size sweep (100/s, 160B-12KB) 148 (-1%) 167 (-17%) 309 (+28%) 619 (-67%) 138 (-6%) 10
replay gateway-gpt-5.4-nano-2000t (1x) 286 (+95%) 438 (+60%) 2763 (+357%) 4843 (+343%) 521 (+24%) 3
replay eve-gpt-5.6-sol-2000t (1x) 207 (+36%) 155 (-27%) 201 (-48%) 330 (-59%) 182 (-66%) 2
replay eve-gpt-5.6-sol-2000t (2x) 416 (+165%) 639 (+157%) 1019 (+159%) 1439 (+85%) 665 (+63%) 3
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 278970ms → this run 186378ms (Δ -92592ms, -33%)

  100-150 ms  ┃                         main   0  this   1    +1
  150-200 ms  █░░░░░░░░░░░░░░░░░░░░░░┃  main  26  this 874  +848
  200-250 ms  ██┃██████████             main 472  this 101  -371
  250-300 ms  ┃████████                 main 335  this  24  -311
  300-350 ms  ┃██                       main 104  this   7   -97
  350-400 ms  ┃                         main  34  this   3   -31
  400-450 ms  ┃                         main  20  this   5   -15
  450-500 ms  ┃                         main   7  this   1    -6
  500-550 ms  ┃                         main   5  this   1    -4
  550-600 ms  ┃                         main   4  this   2    -2
  600-650 ms  ┃                         main   1  this   0    -1
  650-700 ms  ┃                         main   4  this   0    -4
  700-750 ms  ┃                         main   1  this   0    -1
  750-800 ms  ┃                         main   2  this   0    -2
  900-950 ms  ┃                         main   1  this   0    -1
1050-1100 ms  ┃                         main   1  this   0    -1
1600-1650 ms  ┃                         main   1  this   0    -1
3600-3650 ms  ┃                         main   1  this   0    -1
📈 CRTT drill-down vs main (RTT distributions & profiles)
variant  RTT 1ms→5s+             avg         p50           p90           p99     n
control  ······▂█▂▁···  146.6 (-29%)  130 (-13%)    243 (-59%)    597 (-59%)  3000
sweep    ······▂█▂▁···  148.5 (-32%)  130 (-13%)    309 (+28%)    619 (-67%)  3000
gw 1x    ······▂█▂▁▁▁▁  348.7 (+78%)  132 (-12%)  2763 (+357%)  4843 (+343%)  5295
eve 1x   ·····▁▃█▁····  132.8 (-27%)  122 (-13%)    201 (-48%)    330 (-59%)  5186
eve 2x   ······▁█▇▃▁··  316.2 (+54%)  234 (+38%)  1019 (+159%)   1439 (+85%)  7779

RTT over stream progress (avg per tenth of stream, bars scaled min→max):

control  ▄▃▄▄█▃▂▂▁▂  128–188ms
sweep    ▄▁▃▅▁▂▅█▄▂  128–187ms
gw 1x    ▂▁█▅▂▁▁▁▁▁  119–1296ms
eve 1x   ▄▁▃▃▃▃█▆▆▃  109–164ms
eve 2x   ▄▃▂▃▁▁▂█▆▃  188–599ms

RTT by chunk size (avg per log size bin, ~160B → ~12KB serialized, bars scaled min→max):

sweep  ▆▃▃█▁▂▄  148–150ms

Delivery jitter over stream progress (avg positive CDV per tenth of stream, bars scaled min→max):

control  ▃▂▄▄█▂▂▂▁▁  41–56ms
sweep    ▁▃█▄▄▅█▄▄▃  42–72ms
gw 1x    █▂█▁▃▂▃▂▂▂  29–102ms
eve 1x   ▅▁▃▁▁▆█▅▇▇  21–28ms
eve 2x   █▄▃▃▃▂▂▂▁▄  22–57ms
📜 Previous results (1)

9820d77

Thu, 20 Aug 2026 19:44:30 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1468 (+43%) 🔻 1563 🔴 (+38%) 🔻 1588 🔴 (+35%) 🔻 1667 🔴 (+36%) 🔻 30
TTFS stream 1291 (+625%) 🔻 1551 🔴 (+38%) 🔻 1589 🔴 (+41%) 🔻 1795 🔴 (+53%) 🔻 30
TTFS hook + stream 1542 (+210%) 🔻 1703 🔴 (+18%) 🔻 1786 🔴 (+21%) 🔻 1847 🔴 (+20%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 452 (+14%) 804 (-10%) 1966 (+12%) 3182 (+69%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 4191 (-12%) 6015 (-2.6%) 7423 (+19%) 🔻 23090 (+220%) 🔻 10
STSO 1020 steps (inline) 124 (+3.3%) 202 (-18%) 💚 274 (-8.7%) 373 (-26%) 💚 1019
WO 1020 steps 186386 (-21%) 💚 186386 (-21%) 💚 186386 (-21%) 💚 186386 (-21%) 💚 1
CRTT first chunk (pooled) 102 (+11%) 182 (+38%) 🔻 348 (+130%) 🔻 400 (+142%) 🔻 28

Streams

Scenario CRTT 1st p75 p90 p99 CDV max iters
paced control (100/s, 60B) 124 (+2%) 148 (+2%) 235 (-11%) 510 (-54%) 109 (-26%) 10
size sweep (100/s, 160B-12KB) 127 (-2%) 165 (-25%) 262 (-50%) 454 (-42%) 136 (-50%) 10
replay gateway-gpt-5.4-nano-2000t (1x) 162 (+34%) 134 (-9%) 181 (-29%) 456 (-35%) 227 (-56%) 3
replay eve-gpt-5.6-sol-2000t (1x) 230 (+80%) 141 (-7%) 178 (-30%) 304 (-64%) 340 (-32%) 2
replay eve-gpt-5.6-sol-2000t (2x) 149 (+22%) 229 (+9%) 361 (+12%) 863 (-74%) 459 (-24%) 3
ℹ️ Metric definitions & methodology

Streams: first-chunk RTT (the stream-open path, before any buffering/backpressure), CRTT percentiles, and worst delivery stall (CDV max). Cells are medians across iterations; per-run values in the artifacts. No 🔴/🟢 marks until targets attach.

The collapsed STSO distribution section above buckets every step gap, split inline (same warm process — pure framework overhead) vs queue-hop (fresh process — dispatch, reinit, replay). = main, = this run, = fill.

The collapsed CRTT drill-down: per-variant RTT histograms (fixed log bins, · = empty) and mean RTT/positive-CDV profile lines over stream progress and chunk size. Histograms, avgs, and profiles merge exactly across runs; p50–p99 are percentile-of-percentiles. Per-index rows live in the artifacts.

Best/P75/P90/P99 deltas compare against the most recent benchmark run on main at the time of this run. 🔻 flags a delta worse than +15%, 💚 one better than −15%.

Metrics — TTFS: time to first step body (in-deployment start() → first step body) · Fan-out TTFS: fan-out time to first step (in-deployment start() → first of the parallel step bodies to complete) · Fan-out TTLS: fan-out time to last step (in-deployment start() → last of the parallel step bodies to complete, i.e. when the Promise.all resolves) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · CRTT: chunk round-trip time (per-chunk write → read latency, one clock domain: deployment → stream backend → same deployment) · CDV: chunk delay variation / delivery jitter (inter-arrival gap minus inter-write gap per seq-adjacent pair; skew-free; the row is each run's MAX positive value, so one stall moves it)

Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · Promise.all(100 steps): 100 trivial no-op steps started together in a single Promise.all; Fan-out TTFS is the first of them to complete and Fan-out TTLS the last, both from the in-deployment clientStart, so their gap is the spread the runtime adds across the fan-out · paced control (100/s, 60B): the control: 300 tiny (~60B) deltas metronome-paced at 100/s — zero workload structure, so it reads the transport floor and flush cadence, and disambiguates transport-wide vs workload-specific when a replay row moves · size sweep (100/s, 160B-12KB): same pacing as the control with deltas padded in rotation across seven log-spaced sizes (~160B–12KB) — rotation decouples size from stream position, so it isolates whether chunk size causes latency · replay gateway-gpt-5.4-nano-2000t (1x): raw provider SSE cadence captured at the AI gateway boundary (gpt-5.4-nano, the most popular gateway model; per-token deltas p50 208B = the modal production chunk size), replayed exactly as measured — the typical customer's workload; its CDV is the typical customer's real delivery jitter · replay eve-gpt-5.6-sol-2000t (1x): a captured eve turn (gpt-5.6-sol, the most-used demanding eve model; ~2000 output tokens = production p50 turn length) replayed exactly as measured — eve's envelope protocol re-ships the cumulative message so sizes ramp 142B→13KB; the demanding outlier tenant's reality · replay eve-gpt-5.6-sol-2000t (2x): the same eve capture at 2x — the headroom/stress row; real fast-tier models emit the same chunk sizes at proportionally higher rate, so time compression is a faithful speed model · first chunk (pooled): every run's seq-0 RTT pooled across all stream scenarios — the first chunk precedes any workload differentiation, so pooling samples one shared stream-open path with exact percentiles

Replay cadences (semantic sha256) — eve-gpt-5.6-sol-2000t eaf22f5946e7c61f3c65c7006d550df180cfabd4e706254a09f22aec0cfb420d · gateway-gpt-5.4-nano-2000t 6f24ac518b6b83ff1d0e85a5fe78230db192716d66a7fc6b2fe022752001d041

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600

All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = start() → first step body (includes dispatch + any cold start); Fan-out TTFS/TTLS = first/last step completion of one Promise.all from the same anchor (the gap is the runtime’s fan-out spread); STSO/WO between step bodies; CRTT inside the workflow (excludes the api.vercel.com read path).

Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
smoke-no-steps completed 3 0ms ok 0
smoke-one-step completed 6 0ms ok 0
hook-at-step-started completed 12 0ms ok 0
hook-at-step-completed completed 12 0ms ok 0
hook-at-hook-created completed 12 0ms ok 0
deadline-hook-wins completed 7 1.0h ok 0
deadline-expires completed 7 1.0h ok 0
long-sleep completed 11 30.0d ok 0
hook-never-arrives stalled 3 0ms skipped 0
step-retries-twice completed 10 2.0s ok 0
parallel-steps completed 9 0ms ok 0
hook-on-execution-state completed 12 0ms ok 0
peek-hook-before-branch completed 12 0ms ok 0
peek-hook-after-branch completed 12 0ms ok 0
peek-hook-at-registration completed 12 0ms ok 0
race-hook-before-probe completed 12 0ms ok 0
race-hook-after-probe completed 12 0ms ok 0
race-duplicate-delivery completed 13 0ms ok 0
attr-hook-before-step completed 11 0ms ok 0
attr-hook-after-step completed 11 0ms ok 0
attr-from-step-body completed 13 0ms ok 0
fork-hook-after-timeout completed 14 1.0m ok 0
fork-hook-before-timeout completed 14 1.0m ok 0
count-hook-after-timeout completed 17 1.0m ok 0
count-hook-before-timeout completed 20 1.0m ok 0
stale-read-step-count-fork completed 20 1.0m ok 0
stale-read-equal-step-counts completed 14 1.0m ok 0
step-vs-step-fork completed 12 0ms ok 0
step-vs-step-fork-fenced completed 12 0ms ok 0
fence-catches-benign-direction completed 12 5ms ok 0
in-flight-before-decision completed 17 1.0m ok 0
in-flight-before-decision-counted completed 17 1.0m ok 0
in-flight-after-decision completed 19 2.0m ok 0
stale-read-step-count-fork-fenced completed 20 1.0m ok 0
fork-hook-wins completed 13 1.0m ok 0
fork-timeout-wins completed 13 1.0m ok 0
unclaimed-payload-under-fork completed 17 1.0m ok 0
claimed-payload-under-fork completed 17 1.0m ok 0
writers-independent-step-bodies completed 12 0ms ok 0
writers-scripted-tempo completed 12 0ms ok 0
cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a workspace recovery command to reliably remove gitignored build artifacts that can persist across branch switches (e.g., mainstable) and cause confusing build/install failures, without touching untracked work-in-progress files.

Changes:

  • Add scripts/clean-artifacts.sh to delete gitignored artifacts using git ls-files -o -i --exclude-standard --directory, with a keep-list and --dry-run/--all options.
  • Wire the script into the root package.json as pnpm clean:artifacts.
  • Document the branch-switch recovery workflow in AGENTS.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
scripts/clean-artifacts.sh New cleaning script that removes gitignored artifacts with safety keep-list and flags.
package.json Adds clean:artifacts script entry to invoke the cleaner.
AGENTS.md Documents “Branch-switch hygiene” workflow and when to run it.
.changeset/clean-artifacts-script.md Adds a changeset entry for the PR.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.md Outdated
Comment on lines +87 to +90
It is a thin wrapper around `git clean -xdf` with a small exclusion list
(`node_modules`, `.env*`/`*.local`, `.vercel`, Cargo `target/`, local agent
state), so it works even when the workspace is too broken to run turbo or
pnpm scripts.
Comment on lines +73 to +76
--help | -h)
sed -n '2,66p' "$0" | sed 's/^# \{0,1\}//'
exit 0
;;
Comment thread scripts/clean-artifacts.sh Outdated
Per the Vercel technical writing guidelines: em dashes create ambiguity
for agents parsing sentence boundaries, so replace them with periods,
commas, parentheses, or colons. Also corrects the AGENTS.md description
of the script's mechanics (it filters a git ls-files listing rather
than wrapping git clean -xdf, which the earlier draft used) and makes
--help print the header comment block dynamically instead of via a
hardcoded line range that had drifted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants