sandbox-run
БесплатноБез исполняемых скриптовНе проверенRun a BigQuery sandbox to validate pipeline or view changes before merge. Picks between load_end_to_end_data_sandbox (ingest, normalization or pipeline…
от Recidiviz★ 48 звёзд на GitHubОб этом скилле
Skill: Run Sandbox
Overview
Two tools build BigQuery sandboxes from a branch's code:
load_views_to_sandboxrebuilds BigQuery views only. Minutes to an hour.load_end_to_end_data_sandboxrebuilds the Dataflow pipelines (ingest, metrics, supplemental) for one state, then the views on top of them. 1-3 hours.
It covers four jobs: choosing between the tools, a views-only load, an
unattended end-to-end run, and loading views on top of an end-to-end run's
outputs. Comparing the results with compare_views is an optional last step.
By default, hand the user the command to run themselves; the tools consume
shared compute. When the user asks Claude to run an end-to-end sandbox, use
--unattended (below). Never pipe yes into either tool: after launching
each Dataflow pipeline the end-to-end tool asks "Has it completed?", and
answering before the job finishes starts the next stage on unfinished data.
Which mode
Neither tool decides this. Classify the branch's diff:
git diff --name-only $(git merge-base HEAD origin/main)
| Any changed file under | Mode | Why |
|---|---|---|
recidiviz/ingest/direct/regions/*/ingest_views/, .../ingest_mappings/, .../raw_data/, recidiviz/pipelines/, recidiviz/persistence/entity/, or a normalization delegate under recidiviz/pipelines/utils/state_utils/ |
End-to-end | These change normalized_state or the Dataflow outputs; a views-only load would read the stale deployed versions. Ingest views read raw tables through the raw_data/ configs' primary keys, columns and ordering, so a raw config edit counts unless it only changes descriptions |
| Anything else (view SQL, view builders, Python constants that feed SQL) | Views-only auto |
The pipelines are unaffected |
Three situations change that answer:
| Situation | Mode |
|---|---|
| No uncommitted code to measure; comparing deployed datasets | No sandbox. Query staging or prod. Staging deploys ahead of prod, so say which project a number came from. |
| The pipeline change is already in the last staging deploy | Views-only against staging; its normalized_state is already correct. The rebase pre-flight below shows the deployed version. |
| Iterating on views while an end-to-end run's tables last (24 hours from when each was created, so count from its ingest stage) | Views-only reading that run's outputs. See "Views off an end-to-end sandbox". |
Present this as a recommendation: say which rule fired and which files triggered it, and let the user pick the other tool if they prefer, for example views-only for speed, knowing the views read the deployed pipeline outputs.
Pre-flight (both tools)
- Credentials:
gcloud auth login --update-adc. Both tools exit with that message when ADC has expired. If the views to load read Google Sheets (TN'svalidation_views.us_tn_loopback_*andanalyst_data.workflows_live_completion_event_types_by_statedo), usegcloud auth login --enable-gdrive-access --update-adcinstead, or those views fail with a Drive permission error. - Dataflow access, end-to-end only. Seeing Dataflow jobs needs the
dataflow.jobs.listanddataflow.jobs.getpermissions on the project; launching them does not, so a run without them launches jobs nobody can then follow. This read-only command fails withPermission 'dataflow.jobs.list' deniedwithout them:
If it fails, ask the Data Platform team for access.gcloud dataflow jobs list --project=recidiviz-staging --limit=1--unattendedruns the same check before it starts and stops without it. - End-to-end only:
git config user.nameis set. It names the Dataflow image,dataflow-dev/{name lowercased, no spaces}/build:latest, one per person. - Rebase.
automode and the end-to-end tool exit 1, with no prompt, unless the branch contains the commit of the last successful staging view update:
Staging deploys during the day, so a branch cut in the morning can fail this after an afternoon deploy. Rebasing onto main's tip fixes it, but everything merged since the deploy then counts as changed and loads too; rebasing onto the deployed commit itself keeps the sandbox to your changes. This command only reads. The tools' own rebase check also runsuv run python -m recidiviz.tools.deploy.print_latest_view_update_version --project_id recidiviz-staginggit fetch --all --tags --prune --prune-tags --force, which deletes local tags that are not on the remote. Worktrees share one repository's refs, so two runs fetching at once can fail one of them withcannot lock ref; see "Launch order" below. - Prefix:
{username}{MMDDYY}{xx}, wherexxis a short tag of your choosing, conventionally the state's two letters plus a letter per run when there is more than one (agaidus100526nd,agaidus100726oza). Aus_xxtoken in the prefix (agaidus_us_nd) is different: it must match the state filter. The end-t
Установить sandbox-run в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sandbox-run?
Run a BigQuery sandbox to validate pipeline or view changes before merge. Picks between load_end_to_end_data_sandbox (ingest, normalization or pipeline changes) and load_views_to_sandbox (view-only changes), builds the command with the right flag order, runs an end-to-end sandbox unattended with --unattended, chains view-only loads off an end-to-end sandbox's outputs, and diffs results with compare_views. Use when the user mentions a sandbox, says "load views to sandbox", "load my views to a sandbox", "end-to-end sandbox", "load_views_to_sandbox", "load_end_to_end_data_sandbox", "test this view change against real data", "validate my ingest change", "which sandbox tool should I use", "did every view get loaded", "compare sandbox output", or "compare my sandbox view output to what's deployed".
Как установить скилл sandbox-run?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sandbox-run запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic