{
  "slug": "shopify-app-function-run-supports-profile-8ce125e52ace",
  "title": "shopify app function run supports --profile",
  "tools": [
    "shopify"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-08-19T18:41:01.000Z",
  "announced_at": "2026-08-19T18:41:01.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When you have a built function and valid JSON input, run it with `--profile` to generate a WebAssembly performance profile. Open the `.perf` file from the function directory in Speedscope.",
    "examples": [
      "shopify app function build\nshopify app function run --export <export> --input <input.json> --profile",
      "shopify app function run --export run --input input.json --profile"
    ],
    "gotchas": [
      "Version: 4.7.0",
      "--profile: Generate a WebAssembly performance profile for the run; profile can be viewed in Speedscope. Environment variable: `SHOPIFY_FLAG_PROFILE`.",
      "--input, -i <value>: JSON input to pass to the function; if omitted, standard input is used. A valid input is needed for this profiling task.",
      "--export, -e <value>: Name of the WebAssembly export to invoke.",
      "Prerequisite: Build the function first; `app function run` executes the already-built WebAssembly module.",
      "Prerequisite: Provide valid JSON input; the command accepts input via `--input` or standard input.",
      "Prerequisite: Load the generated `.perf` file in Speedscope. Shopify CLI writes it to the function directory, named after the WebAssembly module.",
      "A valid input is required.",
      "The built WebAssembly module may lack a function name section, which makes profiles difficult to interpret and triggers a warning before profiling.",
      "JavaScript functions' Javy output does not include function names regardless of the `wasm_opt` setting.",
      "Docs conflict: The current Shopify CLI docs show `--profile` and a profiling example, but do not state the CLI version. The release note establishes that the flag was added in 4.7.0."
    ]
  },
  "why_it_matters": "Inspect WebAssembly performance for a function you are running locally.",
  "before": "Run `shopify app function run` without generating a WebAssembly performance profile.",
  "sources": [
    "https://github.com/Shopify/cli/releases/tag/4.7.0",
    "https://github.com/Shopify/cli/pull/8226",
    "https://shopify.dev/docs/apps/build/functions/optimize-instruction-counts",
    "https://shopify.dev/docs/api/shopify-cli/app/app-function-run"
  ],
  "rank": 0.97025,
  "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-92ee2f6d98ce7685-1:gate",
    "evidence_hash": "7ee0ac65ff30b3c1c96dcfeeb0b2a9444685ff89dab78785502d9763ed07ac58"
  },
  "review": {
    "draft_hash": "436d422a5dd49799037a7edb76c490e1a7bd16dc58b588de5578f2804efe52ba",
    "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.97 >= 0.9; 2 needed) and Jev gave 0.69 (>= 0.6 needed)."
  }
}
