Spaces:
Running
Running
scripts/
Every operational CLI for the repo, grouped by function. These are invoked
(by a maintainer or CI), never imported by the running app, and are pruned from
the deployed image by .dockerignore. Code that's imported at runtime is a
package β qua_shared/ (library + schemas) or qua_jobs/ (HF-Job entrypoints) β
not a script.
Where does a NEW script go?
Imported by app/job runtime? β it's a package: qua_shared/ or qua_jobs/
Run ONLY inside a GitHub Action AND meaningless β .github/scripts/
standalone (reads $GITHUB_* / posts PR comments)? (currently none)
Otherwise it's an operational CLI β scripts/<function>/ :
deploy/ ship the app / build + boot the image
devenv/ set up a contributor / fixtures
codegen/ regenerate committed artifacts (FE types, README badges)
bucket/ read/write the HF bucket (raw CLI + reciter round-trip)
backfills/ re-runnable data catch-up / one-off data fixes
diagnostics/ measure / assert (no mutation)
migrations/ FROZEN one-shot schema moves (see migrations/README.md)
A file goes in migrations/ only if re-running it on current state is a
no-op-or-error by design. Idempotent backfill_*/purge_*/convert_* stay in
backfills/.
Catalogue
deploy/
upload_inspector.pyβ stage every git-tracked file β deploy the canonical dev/prod Space (CI + manual)deploy_space.pyβ deploy to any Space (contributor cousin)smoke_boot.pyβ build the image, boot it on fixtures, assert/healthz(CI boot gate)
devenv/
setup.shβ first-time local setup: install FE (npm ci) + BE (pip) deps so tests/build/lint run (frontend/backendto scope). Idempotent.setup_worktree.pyβ fast bootstrap for a linked git worktree: mirror.env+node_modules(root +inspector/frontend) from the main checkout instead of a fullnpm ci; falls back tosetup.sh frontendif main has none. Used by thewtskill. Idempotent.launch.pyβ run the app any mode (dev bucket / offline fixtures / live dev|prod Space), any worktree, conflict-free: free ports, per-worktree SQLite isolation, readiness wait,list/down/doctor, and a Dashboard+Timestamps smoke. The/launchskill wraps it;launch_smoke.mjsis its headless-chromium check.bootstrap_dev_env.pyβ provision a contributor's personal bucket + Spaceseed_fixtures.pyβ download the public fixtures β.fixtures(offline tier-0)make_fixtures_dataset.pyβ maintainer: (re)build the PII-free public fixtures dataset
codegen/
regen_fe_types.pyβ regenerate the FE TypeScript types fromqua_shared/schemas/(CI-checked)update_readme_badges.pyβ regenerate the root README stats badges from the prod bucket (daily cron)
bucket/
bucket_ls / stat / cat / put / rm / cp / sync / diff.pyβ raw HF-bucket CLI toolkit (--bucket dev|prod|aligner,--yes-prodto mutate prod)bucket_reciters.pyβ one-row-per-reciter summary table_bootstrap.pyβ shared helpers (token, bucket ids, prod-write guard)download_bucket_reciter.pyβaudit_bucket_reciter.pyβupload_bucket_reciter.pyβ reciter-folder round-trip (download β validate β upload)
backfills/
backfill_*(5),convert_peaks_v2_to_v3,derive_pipeline_meta,rollback_peaks_slimβ re-runnable artefact backfills / conversionspurge_pad_migration,purge_stale_wrapsβ strip stale records fromdetailed.json/edit_historyunignore_categoryβ bulk-revertignore_issueops (re-runnable data-fix)patch_release_audio_sourcesβ rewrite a shipped GH release'scatalog.jsonto native source URLs +chapter_offsets_ms(re-runnable; no-op once thecut_releasefix shipped)
diagnostics/
bench_storage.pyβ benchmark backend read/write hot pathscheck_eligibility_parity.pyβ assert DB-backed eligibility == legacy git-tracked setts_cell_drift.pyβ scan a bucket's TS shards for the FE cell-snap precondition (stored phones β phonemizer), classify each divergence (waqf / ibtidΔΚΎ-waαΉ£l / merger / domain), and flag structurally-broken re-stamps
migrations/
Frozen, completed one-shot schema moves β see migrations/README.md.