{
  "slug": "atlas-scripts-declare-data-operations-as-code-3ec71d16e352",
  "title": "Atlas Scripts declare data operations as code",
  "tools": [
    "atlas"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-08-02T09:09:55.000Z",
  "announced_at": "2026-08-02T09:09:55.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "For a backfill or purge, declare an Atlas `loop` or `exec` script; for a report, declare a `query` script. Run it with the matching `atlas script` command, then review and test it against a dev database in CI before production use.",
    "examples": [
      "atlas script loop --url \"<database-url>\" --file \"file://<script-file>\" --run \"<script-name>\"",
      "atlas script query --url \"<database-url>\" --file \"file://<script-file>\" --run \"<script-name>\" --quiet",
      "atlas script exec --url \"<database-url>\" --file \"file://<script-file>\" --run \"<script-name>\""
    ],
    "gotchas": [
      "Version: v1.3.0",
      "--url: Database URL. The docs show it in each example but do not state whether it is required.",
      "--file: Script file URL, shown as `file://<script-file>` in the examples. Requiredness is not stated.",
      "--run: Script name to run; examples use a name or a regular expression. Requiredness is not stated.",
      "--quiet: For `query`, suppresses the per-step report and prints only script output.",
      "script \"loop\" / script \"query\" / script \"exec\" (required): Declares the script kind: batched work, reads with output masking, or transactional mutations. The docs do not state whether the kinds are mutually exclusive within one file.",
      "mask.columns: Columns to mask in query output.",
      "mask.method: Masking method; documented examples include `REDACT`, `PARTIAL`, `HASH`, and `REPLACE`. The docs do not state that methods are mutually exclusive.",
      "mask.salt: Salt used in the documented `HASH` mask example.",
      "mask.keep_right: Number of right-side characters to retain in the documented `PARTIAL` example.",
      "Prerequisite: Use Atlas v1.3 or later; Atlas Scripts were introduced in v1.3.",
      "Prerequisite: The docs say the script testing framework runs against a real dev database and can verify results and privileges using an `as` block for a reduced role."
    ]
  },
  "why_it_matters": "Implement backfills, GDPR purges, or reports as reviewed and tested code in CI.",
  "sources": [
    "https://github.com/ariga/atlas/releases/tag/v1.3.0",
    "https://atlasgo.io/blog/2026/07/30/atlas-v1-3"
  ],
  "rank": 0.93031,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3-rejudge+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-1c0ea676ada2b6ff-1:rescue",
    "evidence_hash": "bf7c664bfd23f633f4f5cc76282ec3705fd84e3c4dc6f3ec27fd8a16c4f167d9"
  },
  "review": {
    "draft_hash": "623197b90241942f6c9d4f417f9f638d2a5620f7969bac68d316908a04d0e3a1",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:rescue",
    "reason": "Rescue path: first rejected only because the extracted card lacked usage; judged again on the enriched card, 3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.93 >= 0.9; 2 needed) and Jev gave 0.62 (>= 0.6 needed)."
  }
}
