{
  "slug": "terragrunt-mark-many-as-read-enables-source-tracking-and-mark-glob-as-read-751f5d3cb01f",
  "title": "terragrunt mark-many-as-read enables source tracking and mark_glob_as_read",
  "tools": [
    "terragrunt"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-27T14:17:59.000Z",
  "announced_at": "2026-04-27T14:17:59.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a unit reads files indirectly or consumes a local Terraform module, enable `mark-many-as-read` so reading-based filters can select it when those files change. Use `mark_glob_as_read(pattern)` in `locals` to record matching files; local module source files are marked automatically.",
    "examples": [
      "terragrunt run --all --filter 'reading=../../modules/service/**' -- plan",
      "locals {\n  configs = mark_glob_as_read(\"${get_terragrunt_dir()}/config/{*.yaml,**/*.yaml}\")\n}",
      "terragrunt run --all --filter 'reading=./config/**' -- plan"
    ],
    "gotchas": [
      "Version: v1.0.3",
      "Availability: Requires the `mark-many-as-read` experiment to be enabled; calling `mark_glob_as_read` without it returns an error.",
      "--experiment mark-many-as-read (required): Enables the experiment behaviors, including `mark_glob_as_read`; the release note says the function errors without it.",
      "pattern (required): Glob expanded by `mark_glob_as_read`; matches are marked read and returned as absolute paths. Uses `gobwas/glob` syntax. For any-depth matching with a wildcard trailing segment, use `{*.yaml,**/*.yaml}`.",
      "reading=<path> (required): Reading-based filter expression matching units and stacks by files they read.",
      "Prerequisite: Use Terragrunt v1.0.3 or later for the release-note change.",
      "Prerequisite: Enable the `mark-many-as-read` experiment to use `mark_glob_as_read` and automatic local-source file tracking, per v1.0.3 release note. Current documentation says local module files are marked automatically but does not list this experiment as a prerequisite.",
      "Automatic marking applies recursively to `*.tf`, `*.tf.json`, `*.hcl`, `*.tofu`, and `*.tofu.json` files under the local source path; non-source files such as `README.md` are skipped.",
      "`mark_glob_as_read` uses the same `gobwas/glob` syntax as filter expressions.",
      "For match-at-any-depth with a wildcard trailing segment, use `{*.yaml,**/*.yaml}` because `**` only collapses surrounding separators when adjacent segments are literals.",
      "Docs conflict: Current official filter documentation says local module source files are automatically marked read without mentioning `mark-many-as-read`; current docs also say `mark_glob_as_read` is available, while the v1.0.3 release note requires the experiment. The current docs may reflect later behavior."
    ]
  },
  "why_it_matters": "Make reading-based filters match units that consume module files or indirectly read a collection of files.",
  "before": "Before this change, a local module source did not cause its files to be marked read; for files not tracked natively, `mark_as_read(file_path)` could mark an individual file.",
  "sources": [
    "https://github.com/gruntwork-io/terragrunt/releases/tag/v1.0.3",
    "https://docs.terragrunt.com/reference/hcl/functions/#mark_glob_as_read",
    "https://docs.terragrunt.com/features/filter/attributes/#reading-based-expressions"
  ],
  "rank": 0.98044,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-fcea54bb20ea13c8-1:gate",
    "evidence_hash": "971f980a841953c3c89a14d88ab2e29c72ffa049e94b2f40e9a648581d136a5a"
  },
  "review": {
    "draft_hash": "e88fbaed5a7f3a767d8975df148385204ef5545a59ab9cd9b94fb771e317a858",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.64 (>= 0.6 needed)."
  }
}
