{
  "id": "P137",
  "slug": "keras-3-custom-layer-state-created-in-call-build-error-create-state-in-build-not-call",
  "status": "search-observed",
  "product": "Keras 3",
  "family": "Framework semantic default",
  "canonical_url": "https://gitdocs.org/fix/keras-3-custom-layer-state-created-in-call-build-error-create-state-in-build-not-call",
  "query_alias_url": "https://gitdocs.org/q/keras-3-custom-layer-state-created-in-call-build-error-create-state-in-build-not-call",
  "markdown_url": "https://gitdocs.org/fix/keras-3-custom-layer-state-created-in-call-build-error-create-state-in-build-not-call.md",
  "json_url": "https://gitdocs.org/api/fixes/keras-3-custom-layer-state-created-in-call-build-error-create-state-in-build-not-call.json",
  "canonical_query": "Keras 3 custom layer state created in call build error create state in build not call",
  "observed_codex_queries": [
    "Keras 3 custom layer state created in call build error create state in build not call",
    "site:keras.io Keras 3 state-building issues layer call build",
    "Keras 3 migration guide state-building issues unbuilt state call",
    "https://keras.io/guides/migrating_to_keras_3/",
    "'State-building issues' in https://keras.io/guides/migrating_to_keras_3/"
  ],
  "organic_dependency_search_count": 5,
  "affected_versions": "",
  "exact_errors": [],
  "diagnosis": "Local code often type-checks under both old and new framework semantics; the failure depends on the installed framework version and current runtime defaults.",
  "before": "",
  "after": "",
  "verification": "Verifier checks behavior across multiple requests/build modes, not merely compilation. Check model outputs and save/load behavior, not only construction.",
  "unsafe_fixes": [
    "Changing local code without checking the current external contract.",
    "Retrying the same install, build, or API call with no version/source change.",
    "Applying a broad unsafe bypass when a narrow compatibility fix is available."
  ],
  "last_verified_at": "2026-06-25",
  "neutral_validation": {
    "organic_search_observed": true,
    "organic_strict_pass": true,
    "no_web_counterfactual_run": false,
    "no_web_strict_pass": null,
    "search_necessity_under_fixture": null,
    "no_web_oracle_note": "Observed query evidence is separated from necessity proof; no-web and stale-contract counterfactuals should be tracked separately."
  },
  "source_trail": [
    {
      "url": "https://keras.io/guides/migrating_to_keras_3/",
      "label": "Migrating Keras 2 code to Keras 3"
    },
    {
      "url": "https://keras.io/guides/migrating_to_keras_3/",
      "label": "Official reference opened by Codex"
    }
  ],
  "source_github_links": []
}
