Files
civitai__civitai/.gitignore
T
Zachary Lowden afe84cf7c8 ci: shard the unit suite across 4 runners, 10.4m -> 3.8m (#4392)
Measured from the Actions API (n=12): the job was 555.5s of test work plus
66.5s of fixed overhead = 622s, the 10.4m median, and 3.4x the next-slowest
job. T(N) = 66.5 + 555.5/N puts N=4 at ~3.4m.

Measured after: 10.3m -> 3.8m on the critical path (2.7x) at +36%
runner-minutes, reproduced across two runs with a 1.12-1.14x shard spread.
N=4 rather than more because `App unit tests + typecheck` is 2.9m — past N=5
sharding optimises something that is no longer the bottleneck.

Ships with a positive control, `scripts/ci/assert-shard-ran.mjs`. Sharding
adds a failure this job did not have: a `--shard=i/N` selecting no files exits
0 and reports green, and four green checks look identical whether they ran
22,000 tests or none. The guard asserts per shard that work happened, counting
EXECUTED assertions rather than `numTotalTests` (which includes skipped, so an
all-self-skipping shard would pass a total-based floor), and its bounds scale
with `total` so a change to the matrix does not trip them.

It earned its keep immediately: on the first run it failed all four shards
while `Unit tests` reported SUCCESS. `pnpm run … -- --shard=…` forwards the
`--` literally, vitest DISCARDS everything after it, and so `--shard` and
`--outputFile` were both silently dropped — each runner executed the entire
suite (7m30s-9m54s per step) and wrote no report. Without the control this
would have merged as four green checks that tested nothing verifiable.

A subsequent adversarial audit found three further claims that measurement did
not support, all fixed here: bounds hardcoded off a ten-day-stale suite size
that would have tripped within weeks and blamed the wrong cause; a comment
asserting post-`--` args become filename filters when they are discarded; and
a "mutation-verified" claim that five of twelve mutants walked through. Four
are now covered by named cases; the fifth was unreachable dead code and is
removed rather than papered over with a test that could not kill it.

Final sweep, re-run after the Prettier pass: 10 mutants, 10 killed, each by its
own named test, with a no-op negative control that correctly survived. Suites
20/20. Verified live across two runs; the typecheck-scripts gate was confirmed
to have executed rather than assumed green.

Not verified: behaviour on a push to `main`, where `continue-on-error` is false
and a red shard renders as a genuine failure. That path only exercises on merge.
2026-08-25 15:59:41 -05:00

189 lines
3.5 KiB
Plaintext

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
node_modules
/.pnp
.pnp.js
# testing
coverage/
# database
/prisma/db.sqlite
/prisma/db.sqlite-journal
# Generated slim schema - edit schema.full.prisma instead
prisma/schema.prisma
packages/civitai-db-schema/prisma/schema.prisma
# next.js
/.next/
/out/
# Auto-generated by `next dev`/`next build`; its import path flips between
# .next/dev/types and .next/types depending on the last command run, so
# tracking it just creates churn. Next regenerates it on every run.
next-env.d.ts
# ladle
.ladle/stubs/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# local env files
.env
.env*
!.env-example
!.env.example
# `.env*` also matches `.envrc`, which is how the flake gets loaded. The real
# .envrc stays ignored (it holds machine-local secrets); the example is tracked
# so the flake is discoverable from a clean clone.
!.envrc.example
# vercel
.vercel
# typescript
*.tsbuildinfo
# docker volumes
/postgres*
/redis
/minio
# browser automation (local session/profile data)
.browser/sessions/
.browser/profiles/
.browser/storage/
/clickhouse*
/undefined
/.docker
/prisma_pit
# Meilisearch
/meilisearch
/data.ms/
# WebStorm
.idea
*.http
# SEO
/public/sitemap*.xml
/public/robots.txt
ca-certificate.crt
# IDE
*~
src/pages/api/admin/*.json
trace/trace.json
trace/types.json
# Local files
/src/local
.todo
/analyze
# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/tests/auth/*.json
src/pages/api/dev-local/*
/.playwright-mcp/
# Vitest browser-mode failure screenshots (written next to *.browser.test.tsx)
**/__screenshots__/
# feature-walkthrough captures. The skill defaults to a temp dir, but SHOTS_DIR is configurable
# and a relative value lands here — these are screenshots of dev accounts and their content, and
# this repo is public and permanent.
/shots/
**/walkthrough-shots/
# Ladle (local dev artifacts)
.ladle/stubs/
# LLM
/.serena/
docs/working/
docs/incidents/
.claude/*.local.*
.claude/skills/cloudflare/.port-tmp-path
# Also holds the XGuard tuning harness: scanner policy prose and corpora extracted
# from prod. This repo is public; a policy file here would be an evasion guide.
local/
.eslintcache
nul
scripts/local-dev/
.direnv
# Claude agent temp directories
tmpclaude-*-cwd
.claude/skills/flipt/.env
.claude/skills/freshdesk/.env
# Ralph agent
scripts/ralph/prd.json
scripts/ralph/progress.txt
# Claude temp files
tmpclaude-*
/.claude/worktrees
.claude/scheduled_tasks.lock
# Bundled SharedWorker scripts (generated by pnpm build:workers)
/public/workers/
# nested Next build output (apps/*)
apps/*/.next/
# nested SvelteKit generated output (apps/*)
apps/*/.svelte-kit/
# Turborepo local task cache
.turbo/
# Lighthouse CI — runtime config (cookie-injected) + report output, never committed
lighthouserc.runtime.json
.lighthouseci/
# Playwright hub e2e generated artifacts
apps/auth/e2e/playwright-report/
apps/auth/e2e/test-results/
apps/auth/e2e/.auth/
mockups/
# local-only SQL (never committed)
*.local.sql
*.local.md
# superpowers skill scratch (specs/plans) — implementation detail, not shipped to main
docs/superpowers/
# vitest JSON report written by the Package unit tests CI job
packages-report.json
apps-report.json
unit-report.json
/.opencode
# Generated by scripts/test-perf/* — measurement output, not source
.test-perf/
# vitest browser-mode failure artifacts
.vitest-attachments