Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
79e43a6
test: cover repeated legacy login query params (#15054)
dante01yoon Aug 11, 2026
2ab67a6
ci: bump cursor-review to github-workflows@0096e1a (#14992)
cloud-code-bot[bot] Aug 11, 2026
2bdf764
test: use a common fake clock baseline (#15052)
DrJKL Aug 11, 2026
1d26632
test: clear local storage before each test (#15053)
DrJKL Aug 11, 2026
53e569e
fix: price badge cache cannot recover after a failed evaluation (10 v…
jaeone94 Aug 11, 2026
b2d6e41
fix(assets): fall back to bare-tag grouping for legacy tags in model_…
synap5e Aug 12, 2026
05a714e
fix(missing-model): improve gated access accessibility (#14984)
jaeone94 Aug 12, 2026
022c843
fix: render node search highlights as text instead of generated HTML …
christian-byrne Aug 12, 2026
ae27839
refactor(featureFlags): centralize ?ff= reading with the other query-…
huang47 Aug 12, 2026
b2540ac
fix(first-run-tour): read Anti-prompt as the negative prompt (#14669)
christian-byrne Aug 12, 2026
39057d7
test: block real network requests in unit tests (#14687)
christian-byrne Aug 12, 2026
ab42ebc
1.51.2 (#15079)
comfy-pr-bot Aug 12, 2026
f445e41
feat: restyle partner model governance settings panel (#14837)
comfydesigner Aug 12, 2026
d2f611b
test: provide a testing Pinia by default (#15057)
DrJKL Aug 12, 2026
ce7b824
test: centralize unit test isolation and shared automocks (#15104)
DrJKL Aug 12, 2026
cbaf81c
ci(i18n): regenerate translations on cloud release branches (#14071)
christian-byrne Aug 12, 2026
457861c
feat(website): add the LTX 2.5 launch page (#15109)
deepme987 Aug 12, 2026
c6bfb24
test: guard QwenVL reverse-resolution depth ordering (#14315)
claude[bot] Aug 12, 2026
dd5b474
feat(website): link LTX 2.5 from the nav and footer, and serve its po…
mobeenabdullah Aug 12, 2026
f0fd9d0
[chore] Update Ingest API types from cloud@12db084 (#15049)
comfy-pr-bot Aug 12, 2026
2026348
fix: restore body pointer-events when stacked dismissable layers clos…
christian-byrne Aug 12, 2026
4cb44e9
feat(telemetry): split nudge events by how the tour ended (#15107)
christian-byrne Aug 12, 2026
2359c39
feat(website): add /fdct Forward Deployed Creative Technologists page…
imick-io Aug 12, 2026
570bd41
ci: detection proof - poison corpus counter-evidence for the matrix
benjcooley Aug 12, 2026
03c8e48
test(website): guard the upcoming-events e2e when none are upcoming (…
deepme987 Aug 12, 2026
bd89f5a
feat(website): label the products nav featured card CTA "Explore now"…
june-bump Aug 12, 2026
bd693b1
feat(website): FAQ interlinks to /forward-deployed-creatives on prici…
nav-tej Aug 12, 2026
c6fe797
test: add test setup consolidation skill (#15153)
DrJKL Aug 12, 2026
beaddeb
chore: add containerized ComfyUI development backend (#14995)
DrJKL Aug 12, 2026
c4f9b91
fix: unify markdown heading spacing across both node renderers (#15124)
DrJKL Aug 12, 2026
52b2ca1
fix: repair stale and malformed locale data (#15137)
benceruleanlu Aug 12, 2026
b72bdea
ci: enroll in advisory PR risk grading with frontend risk map (#14889)
huang47 Aug 12, 2026
450cc7f
fix: bound auth wait in startStoreBootstrap + catch-all for unknown r…
christian-byrne Aug 13, 2026
891ee51
Support space bar pan while dragging vue nodes (#12943)
AustinMroz Aug 13, 2026
1172789
ci: harden the corpus/matrix against non-node failures; tighten pass …
benjcooley Aug 13, 2026
a01d71f
Merge origin/main into benjcooley/matrix-detection-proof
benjcooley Aug 13, 2026
861f0ad
ci: do not persist git credentials in pack-executing jobs
benjcooley Aug 13, 2026
c5e42ad
ci: fix .mjs/asset corpus blind spots, hung-pack stubs, id validation…
benjcooley Aug 13, 2026
dbf0570
[automated] Apply ESLint and Oxfmt fixes
actions-user Aug 13, 2026
1a0bfcc
fix: replace lobe-i18n with source-aware in-house locale pipeline (#1…
benceruleanlu Aug 13, 2026
e236151
1.51.3 (#15165)
comfy-pr-bot Aug 13, 2026
e1d08ab
feat(website): announce Wan 3.0 at /wan-3.0 (#14850)
mobeenabdullah Aug 13, 2026
108425a
fix: open popular templates for new users (#14896)
ryan-di Aug 13, 2026
6b56659
[chore] Update Comfy Registry API types from cloud@94d0f1b (#15045)
comfy-pr-bot Aug 13, 2026
4111782
fix: re-check tab fallback after deferred error scans (#15012)
DrJKL Aug 13, 2026
2e5c3ba
ci: corpus fetch survives broken symlinks and per-pack crashes
benjcooley Aug 13, 2026
4767c56
Merge branch 'benjcooley/matrix-detection-proof' of https://github.co…
benjcooley Aug 13, 2026
0f1b533
ci: stray pack rejections cannot fail an innocent spec mid-collection
benjcooley Aug 13, 2026
eebfd00
ci: missing rows are structurally impossible; guard hook-error capture
benjcooley Aug 13, 2026
cafc27d
[feat] website: add the MiniMax Music 3 launch page (#15201)
imick-io Aug 13, 2026
d486579
ci: bump cursor-review to github-workflows@732100b (#15128)
cloud-code-bot[bot] Aug 13, 2026
538fb86
[chore] Update Ingest API types from cloud@94d0f1b (#15139)
comfy-pr-bot Aug 13, 2026
298b78a
feat: swap minimax hero video and add mobile still fallback (#14757)
claude[bot] Aug 13, 2026
0bc18c4
fix: clear workflow status when an account precondition ends a run (#…
christian-byrne Aug 13, 2026
0f001a6
fix: stop transient ineligibility from permanently completing the fir…
christian-byrne Aug 13, 2026
b586e9e
fix: stop relaying Desktop execution starts (#15185)
benceruleanlu Aug 13, 2026
5039861
fix(assets): correct video asset interactions (#14765)
ryan-di Aug 13, 2026
f51e309
feat(website): add the Q&A section to the LTX 2.5 page (#15154)
mobeenabdullah Aug 13, 2026
931c8d8
fix: never render the cloud sign-up email form before region detectio…
MaanilVerma Aug 13, 2026
6d090b4
fix: name the cause of a corpus fetch failure, and stop hitting the r…
benjcooley Aug 13, 2026
28cfa7f
lint: ban new hand-written Zod schemas for remote API types (#14951)
claude[bot] Aug 13, 2026
99aaeff
ci: run typecheck on the scripts directory (#15170)
benceruleanlu Aug 14, 2026
0981272
feat: add Try Comfy SDK CTA to API page hero (#15212)
bertfy Aug 14, 2026
2a76e13
perf: cut minimap change detection cost on large graphs (#15029)
benjcooley Aug 14, 2026
8bcce42
feat(website): restore the Seedance 2.5 world cup gallery card (#15152)
mobeenabdullah Aug 14, 2026
52de1e6
feat(website): add a Run Workflow CTA to the MiniMax Music 3 page (#1…
nav-tej Aug 14, 2026
9db0d89
ci: remove unused frontend setup from E2E coverage merge (#15232)
benceruleanlu Aug 14, 2026
1ab17f2
[feat] Add hero video to minimax-music-3 page (#15213)
imick-io Aug 14, 2026
a2ee1a7
fix: show complete workspace member list (#15224)
huntcsg Aug 14, 2026
7e6fb6c
fix: correct tailwind class order in website components (#15238)
benjcooley Aug 14, 2026
073c220
refactor(workspace): expose active workspace identity as readonly (#1…
christian-byrne Aug 14, 2026
82bad2e
1.51.4 (#15234)
comfy-pr-bot Aug 14, 2026
fb24726
ci: label user-prefixed backport branches too (#15105)
christian-byrne Aug 14, 2026
718db8b
fix: stop Canvas Navigation mode resetting to Custom on reload (#14716)
DrJKL Aug 14, 2026
fa5031d
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 14, 2026
cdc846c
ci: make the ecosystem matrix a PR gate, and make it measure what it …
benjcooley Aug 14, 2026
0383f55
Merge branch 'main' into benjcooley/matrix-detection-proof
DrJKL Aug 14, 2026
0e3eb1e
ci: pin the corpus to commits, and make a stale pin impossible to miss
benjcooley Aug 14, 2026
cfe9c73
Merge remote-tracking branch 'origin/benjcooley/matrix-detection-proo…
benjcooley Aug 14, 2026
43b2f9c
ci: pin create-pull-request to a sha, as pinact requires
benjcooley Aug 14, 2026
471bc99
ci: one cache key for the corpus, and let a PR populate it
benjcooley Aug 14, 2026
ade8d89
ci: keep the shard log inside matrix-rows so the rows stay where the …
benjcooley Aug 14, 2026
e2082f1
ci: gate the corpus on fetch REGRESSIONS, not on the permanently brok…
benjcooley Aug 14, 2026
4c5afc8
chore(deps): bump the eslint group across 1 directory with 4 updates …
dependabot[bot] Aug 14, 2026
018086e
feat(cicd): add a way to tag a release that was never created (#15006)
christian-byrne Aug 14, 2026
a8826ee
docs: add TypeScript suppression removal skill (#15259)
DrJKL Aug 14, 2026
95088bd
feat(website): add the local connection to the Comfy MCP page (#15240)
jojodecayz Aug 15, 2026
4e6f170
chore(website): refresh Ashby and cloud nodes snapshots (#15304)
comfy-pr-bot Aug 15, 2026
37f9614
fix(release-sheriff): retry gh calls on transient 502/503 gateway err…
christian-byrne Aug 15, 2026
259cb0a
ci: bump cursor-review to github-workflows@41fb831 (#15295)
cloud-code-bot[bot] Aug 15, 2026
e64d944
1.51.5 (#15299)
comfy-pr-bot Aug 15, 2026
19452ac
fix(website): stop reading union-only fields off heterogeneous data (…
christian-byrne Aug 15, 2026
3340351
feat(website): add Beyond the Models and Model Jam events (#15307)
imick-io Aug 15, 2026
289d9c5
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 15, 2026
32596ad
ci: enforce unit and e2e test coverage for apps/website (#15274)
christian-byrne Aug 15, 2026
3860f64
feat(website): add the launch film and a production use cases section…
bertfy Aug 15, 2026
307c66a
fix: show Billing & invoices button for past-due subscriptions (#15266)
dante01yoon Aug 15, 2026
da403f8
1.51.6 (#15329)
comfy-pr-bot Aug 16, 2026
34b9870
build(website): enable the strictest tsconfig flags that already pass…
christian-byrne Aug 16, 2026
886c353
[experiment] oxlint rule flagging local types that duplicate ingest A…
DrJKL Aug 16, 2026
1d4305e
fix(workspace): cap the invite field height so the dialog footer stay…
comfydesigner Aug 16, 2026
97c5ce5
feat(website): link the Flux 3 page from the footer (#15260)
june-bump Aug 16, 2026
3b2bd08
ci(pr-risk): grant checks: write ahead of the next grader pin bump (#…
mattmillerai Aug 16, 2026
da1d501
fix: a malformed MatchType spec no longer deletes the input (#15187)
christian-byrne Aug 16, 2026
494b980
feat(website): use the coins icon for credits on the pricing page (#1…
comfydesigner Aug 16, 2026
e75edb5
feat(billing): link to platform usage from the subscription footer (#…
comfydesigner Aug 16, 2026
65c4ca8
refactor: use the coins icon for credits everywhere (#15089)
comfydesigner Aug 16, 2026
f78769e
fix(featureFlags): resolve nodeLibraryEssentialsEnabled through resol…
mattmillerai Aug 16, 2026
60d88b2
test(router): drive the legacy /login redirect through the cloud-logi…
mattmillerai Aug 16, 2026
000592b
fix: combo widget renders literal "null" inside a red invalid ring (#…
jaeone94 Aug 16, 2026
07518de
fix(missing-model): restrict localhost downloads (#14983)
jaeone94 Aug 16, 2026
501d5c6
feat(website): add LTX 2.5 FAQ section and refresh meta description (…
claude[bot] Aug 16, 2026
ec6dc89
fix: redirect /career and /privacy to their live pages (#15244)
balpreetgrowthnatives Aug 16, 2026
bf0112e
fix(errors): keep missing node packs across prompt submissions (#14900)
jaeone94 Aug 16, 2026
5de07a4
chore(deps): bump the github-actions group across 1 directory with 6 …
dependabot[bot] Aug 16, 2026
2b99609
fix: persist workflow drafts across page refresh (#14575)
dante01yoon Aug 16, 2026
17407e5
fix: prevent Load3D menubar overflow at narrow node widths (#14525)
jtydhr88 Aug 16, 2026
4f9f62c
feat: add LinkedIn and Pricing links to website footer (#14762)
nav-tej Aug 16, 2026
3ac577e
refactor: replace duplicated node-shape switches with a shared lookup…
claude[bot] Aug 16, 2026
9ecd0a5
fix: guard against missing exec_info in setStatus (#14564)
luke-mino-altherr Aug 16, 2026
b30ed2f
1.51.7 (#15338)
comfy-pr-bot Aug 16, 2026
ec67cff
feat(billing): flag legacy billing migration (#15046)
dante01yoon Aug 16, 2026
0b62302
FE-1585 fix(billing): refresh stale Run entitlement on app return (#1…
dante01yoon Aug 16, 2026
62ee999
fix: remove obsolete subscription settings panel (#15258)
dante01yoon Aug 16, 2026
84b1c6e
fix: Media Assets group badge count to use previewable_outputs_count …
claude[bot] Aug 16, 2026
567a850
fix: run e2e coverage merge even when a shard flakes (#15342)
claude[bot] Aug 16, 2026
049ced1
fix(website): link to brand assets on affiliates page (#14206)
claude[bot] Aug 17, 2026
926d78c
fix(assets): capture canvas state after an image upload commits (#15069)
christian-byrne Aug 17, 2026
7a01087
test: pin that script src loads never reach the network (#15108)
jaeone94 Aug 17, 2026
02e4210
fix: acknowledge a new run ahead of outcome banners (#15067)
christian-byrne Aug 17, 2026
316904a
fix: acknowledge a new run ahead of outcome banners (#15067)
christian-byrne Aug 17, 2026
e357fb9
chore: add per-language CODEOWNERS entries for translation reviewers …
christian-byrne Aug 17, 2026
16a8790
fix: missing-media follow-ups from #14578 review (#14668)
jaeone94 Aug 17, 2026
6cde22b
1.51.8 (#15344)
comfy-pr-bot Aug 17, 2026
38b07da
fix: keep locked widget hover color consistent with node color (#14387)
claude[bot] Aug 17, 2026
511c40d
fix(billing): open the billing portal on OUTSTANDING_PAYMENT_REQUIRED…
wei-hai Aug 17, 2026
4cd7e00
test: stop mobile touch-pan screenshot flaking on text anti-aliasing …
christian-byrne Aug 17, 2026
947e35b
fix(cloud): surface a failed support request instead of logging it (#…
christian-byrne Aug 17, 2026
30b27fb
chore(website): upgrade to Astro 7 (#15209)
imick-io Aug 17, 2026
9a54e1f
refactor: resolve node display name and description at read time (#14…
christian-byrne Aug 17, 2026
edbf2a9
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 17, 2026
5eb898d
fix: close ecosystem matrix fail-open paths
benjcooley Aug 17, 2026
7c3a00a
1.52.0 (#15374)
comfy-pr-bot Aug 17, 2026
6b9fda1
ci: bump comfyui-ci-container to 0.0.22 (#14682)
christian-byrne Aug 17, 2026
86aa43f
fix: safely skip ineligible Playwright video tests (#15373)
DrJKL Aug 17, 2026
9e3e55f
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 17, 2026
8035db5
fix: close matrix review fail-open paths
benjcooley Aug 17, 2026
b60a90e
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 17, 2026
7d68bab
feat: add Vitest cleanup oxlint rules (#15011)
DrJKL Aug 17, 2026
13e96fd
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 18, 2026
a5ede16
feat: note 1080p and video extension in Seedance 2.5 hero copy (#15371)
imick-io Aug 18, 2026
3f78612
fix: require matrix corpus provenance
benjcooley Aug 18, 2026
8e98659
test: add ECS migration regression coverage (#15327)
DrJKL Aug 18, 2026
587ccae
fix: upload hidden matrix provenance
benjcooley Aug 18, 2026
6fee8ce
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 18, 2026
850bbe8
Fix native Vite config loading warnings (#15387)
DrJKL Aug 18, 2026
5ad4161
refactor(workspace): simplify ended subscription state (#14487)
dante01yoon Aug 18, 2026
03cce8f
FE-1550 fix: lift Select and SearchAutocomplete dropdowns above modal…
jtydhr88 Aug 18, 2026
503c4ce
fix: close registry census review gaps
benjcooley Aug 18, 2026
dfe546b
Merge remote-tracking branch 'origin/main' into benjcooley/matrix-det…
benjcooley Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .agents/setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ cd "$repo_root"

if [[ "${AMP_ORB:-}" == 1 ]]; then
gh auth setup-git

if ! command -v docker >/dev/null 2>&1 ||
! command -v dockerd >/dev/null 2>&1; then
echo "Installing Docker"
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg \
-o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
sudo apt-get update
sudo apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin
fi
fi

node_major="$(tr -d '[:space:]' < "$repo_root/.nvmrc")"
Expand Down
131 changes: 131 additions & 0 deletions .agents/skills/consolidating-test-setup/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
name: consolidating-test-setup
description: Consolidates repeated test setup and teardown into the narrowest shared lifecycle owner. Use when test files repeat initialization, cleanup, environment management, fixtures, or equivalent test doubles.
---

# Consolidating test setup

Move repeated test plumbing to the narrowest shared owner that can provide it
reliably. Keep test files focused on behavior.

## Principles

### Prove the code is equivalent

Repetition is evidence, not proof. Similar code may use different defaults,
ordering, or lifetimes. Group candidates by behavior before treating them as
duplicates.

### Centralize invariants, not scenarios

Shared setup should establish conditions that hold for every test in its scope.
State that explains one scenario belongs with that scenario.

### Use the narrowest owner

Prefer the mechanism that already owns the lifecycle. Use runner configuration
before hooks, scoped fixtures before global setup, and local setup for local
requirements. Wider reuse is not better reuse.

### Treat setup and teardown as one contract

Define who creates state, how long it lives, and who releases it. Cleanup must
finish even when a test fails. Tests must not depend on execution order or on
another test's cleanup.

A shared default should be deterministic and easy to override. Local exceptions
must not weaken isolation elsewhere.

### Subtract before abstracting

Remove suspected cargo-cult setup and run the affected tests. A targeted pass
only marks it provisionally unnecessary. Delete it after the complete relevant
suite and runner-specific lifecycle checks pass. If a test fails, use the
failure to identify the contract before designing shared setup.

A helper must own a policy or lifecycle, or remove meaningful reader effort.
Moving the same lines behind a new name is not an improvement.

### Preserve test intent

Do not hide state that matters to the behavior under test. Check history before
removing synchronization or cleanup because it may guard a past regression.
Preserve that guarantee even if the implementation changes.

## Runner-specific guidance

Load only the reference for the runner in use:

- [`reference/vitest.md`](reference/vitest.md) for Vitest and similar
in-process unit-test runners
- [`reference/playwright.md`](reference/playwright.md) for Playwright and
similar browser-test runners

These references supplement the repository's testing guide. They do not replace
it. Load both only when the task spans both runners.

## Workflow

### 1. Discover

Read the runner configuration, setup files, fixtures, helpers, and test guidance.
Count repeated lifecycle behavior and note the suites that use it.

### 2. Classify

For each candidate, record:

- the state it owns
- its lifetime and scope
- whether it is an invariant or scenario detail
- intentional differences between suites
- behavior already supplied by the runner

### 3. Challenge

Remove the candidate and run every affected suite. Classify it as unnecessary,
universal, common with exceptions, or suite-specific.

Subagents may evaluate disjoint groups of suites. Require evidence and exception
reports from each. Keep the design and integration decision in the parent task.

### 4. Place

Choose the required lifetime and scope first. Then use the simplest owner at
that exact boundary:

- native runner behavior that supports the required scope
- existing shared setup, fixture, or hook
- a focused helper or test double
- the individual suite

Do not move state to a broader owner because its mechanism appears earlier in
the list.

### 5. Migrate

Move one responsibility at a time. Add the shared owner, then remove only the
local code it replaces. Keep intentional exceptions and scenario setup visible.
Avoid unrelated test rewrites.

### 6. Prove

Run affected tests, tests of the shared lifecycle, repository static checks, and
the complete relevant suite. Measure before and after when the new behavior runs
for every test. Use enough comparable samples to separate a real change from
normal variance.

## Report

State the repeated contract, its new owner, retained exceptions, rejected
alternatives, duplication removed, and validation results. Include performance
evidence when shared setup could affect suite runtime.

## Guardrails

- Do not replace native runner behavior with a custom abstraction.
- Do not widen setup scope without evidence.
- Do not add a helper merely to move code.
- Do not hide global mutable state behind helper indirection.
- Do not trade visible test intent for shorter files.
- Do not trust targeted tests alone after changing shared lifecycle behavior.
88 changes: 88 additions & 0 deletions .agents/skills/consolidating-test-setup/reference/playwright.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Playwright setup consolidation

Use this reference for Playwright and similar browser-test runners.

## Read first

Read the Playwright configuration, global setup and teardown, affected fixtures,
and canonical browser-test guidance. In this repository, inspect:

- `playwright.config.ts`
- `browser_tests/globalSetup.ts` and `browser_tests/globalTeardown.ts`
- the fixtures used by the affected specs
- `docs/guidance/playwright.md`
- `.agents/checks/playwright-e2e.md`
- `browser_tests/README.md`

Read fixture code directly. Do not guess its setup order or cleanup guarantees.

## Map the lifetime

Browser tests span the run, worker, browser context, page, application session,
and external services. Put state at the narrowest boundary that matches its real
lifetime.

Reserve run-wide hooks for run-wide resources. Worker fixtures must own isolated
worker resources. Keep mutable test state test-scoped unless broader ownership
is proven safe under parallel execution.

## Give fixtures full ownership

Use composable fixtures for resources that need setup and teardown. The fixture
that creates or mutates a resource must restore or release it after the handoff,
including when the test fails.

Keep roles separate:

- fixtures own lifecycle and resources
- page objects own locators and interactions for one UI area
- helpers coordinate domain actions
- data fixtures contain data, not runner behavior

Compose fixtures instead of growing a central page object or adding unrelated
global hooks.

## Preserve ordering

Install configuration, request interception, identity, and initial state before
the navigation that consumes them. Resolving a high-level fixture may navigate
before a hook body runs. Read the dependency graph and use fixture options or a
lower-level dependency for pre-navigation setup.

Do not boot the application and then repair state that should have existed at
startup.

## Account for external state

Assume parallel execution and fresh workers on retry. Resource identities must
not collide. Cleanup must affect only resources owned by that test or worker.

Resetting a page or context does not clean backend state or other external
resources. Define the complete boundary. Use opt-in cleanup when a universal
reset would erase persistence that a test needs to verify.

Retries expose pollution and readiness problems; they do not solve them.

## Preserve readiness guarantees

A fixture should hand control to the test only after observable readiness. Do
not centralize arbitrary delays or timing assumptions that belong to one suite.

Check history before removing waits, resets, or teardown. Preserve any race or
regression guarantee.

## Migrate and prove

For one lifecycle responsibility at a time:

1. Map fixture dependencies and external resources.
2. Identify setup required before navigation.
3. Test whether repeated local setup is necessary.
4. Choose test, worker, or run scope from the resource lifetime.
5. Put guaranteed cleanup in the owning fixture.
6. Keep opt-outs for tests that depend on retained state.

Run affected specs first. Repeat them and exercise parallel execution when
pollution or timing is plausible. Verify failure cleanup for external resources.
Then run the complete relevant browser suite and static checks. Inspect flaky or
retried outcomes instead of relying on the final green status.
77 changes: 77 additions & 0 deletions .agents/skills/consolidating-test-setup/reference/vitest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Vitest setup consolidation

Use this reference for Vitest and similar in-process unit-test runners.

## Read first

Read the active Vitest configuration, its full `setupFiles` chain, package-level
overrides, and the repository's unit-test guidance. In this repository, inspect:

- `vite.config.mts`
- `vitest.setup.ts` and `vitest.timer.setup.ts`
- package-level Vitest configuration and setup
- `docs/guidance/vitest.md`
- `docs/testing/vitest-patterns.md`

Check behavior against the installed Vitest version. Defaults change, and setup
files compose.

## Place the responsibility

Use native configuration for lifecycle behavior Vitest already supports. Use a
setup file only for invariants configuration cannot express. Keep package-only
behavior out of repository-wide setup.

Separate runner-managed resets, fresh mutable state, process-wide modes that
need restoration, and scenario state that must remain local. Add hooks only for
the part of the contract Vitest does not already own.

A global default must fit every test in scope. Find the common behavior from the
tests, then preserve deliberate opt-outs. When choosing a deterministic
baseline, keep absolute values local when the value itself is under test.

## Handle mocks carefully

Runner-level reset and restoration can change module-scope test doubles. Check
whether their default implementations survive and whether tests reprogram them
during a scenario.

Share a module mock only when it reduces reader effort and preserves behavior.
Keep assertion handles explicit. Test module re-evaluation because it can replace
shared mock state while a test still holds the old identity.

Keep test-specific `vi.mock` calls in the test module. A call inside an imported
helper is not hoisted ahead of that test module's static imports. For shared
implementations, use `__mocks__` with a local `vi.mock`. For runtime selection,
call `vi.doMock` before a subsequent dynamic import.

Check whether a setup file imports the mock target, directly or transitively.
Vitest cannot replace that cached module. Prefer removing the setup import. If it
is unavoidable, call `vi.resetModules()` inside `vi.hoisted` before the test
imports the target, and account for setup and test code holding different module
instances.

Skip the extraction if typed shared code is no simpler than the local mocks or
needs global mutable indirection.

## Migrate

Work on one lifecycle responsibility at a time:

1. Count and classify local occurrences.
2. Remove them without adding a replacement.
3. Use failures to find the contract and exceptions.
4. Prefer configuration, then the narrowest setup file.
5. Remove only calls the new owner makes redundant.
6. Keep mid-test resets and scenario state local.

Subagents may check independent suites, but each must report observed necessity
and exceptions.

## Prove

Run affected files, setup-contract tests, static checks, and the complete unit
suite. Shared process state can fail only when unrelated suites run together.

Profile changes that execute for every test. Compare several equivalent runs and
report variance instead of treating normal noise as a result.
Loading
Loading